]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
Merge branch 'akpm' (patches from Andrew)
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 11 Nov 2015 05:14:23 +0000 (21:14 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 11 Nov 2015 05:14:23 +0000 (21:14 -0800)
Merge final patch-bomb from Andrew Morton:
 "Various leftovers, mainly Christoph's pci_dma_supported() removals"

* emailed patches from Andrew Morton <akpm@linux-foundation.org>:
  pci: remove pci_dma_supported
  usbnet: remove ifdefed out call to dma_supported
  kaweth: remove ifdefed out call to dma_supported
  sfc: don't call dma_supported
  nouveau: don't call pci_dma_supported
  netup_unidvb: use pci_set_dma_mask insted of pci_dma_supported
  cx23885: use pci_set_dma_mask insted of pci_dma_supported
  cx25821: use pci_set_dma_mask insted of pci_dma_supported
  cx88: use pci_set_dma_mask insted of pci_dma_supported
  saa7134: use pci_set_dma_mask insted of pci_dma_supported
  saa7164: use pci_set_dma_mask insted of pci_dma_supported
  tw68-core: use pci_set_dma_mask insted of pci_dma_supported
  pcnet32: use pci_set_dma_mask insted of pci_dma_supported
  lib/string.c: add ULL suffix to the constant definition
  hugetlb: trivial comment fix
  selftests/mlock2: add ULL suffix to 64-bit constants
  selftests/mlock2: add missing #define _GNU_SOURCE

909 files changed:
Documentation/acpi/i2c-muxes.txt [new file with mode: 0644]
Documentation/arm/Samsung/Bootloader-interface.txt
Documentation/arm/keystone/knav-qmss.txt [new file with mode: 0644]
Documentation/arm/sunxi/README
Documentation/devicetree/bindings/arm/amlogic.txt
Documentation/devicetree/bindings/arm/apm/scu.txt [new file with mode: 0644]
Documentation/devicetree/bindings/arm/arm,scpi.txt [new file with mode: 0644]
Documentation/devicetree/bindings/arm/bcm/brcm,brcmstb.txt
Documentation/devicetree/bindings/arm/bcm/brcm,nsp.txt [new file with mode: 0644]
Documentation/devicetree/bindings/arm/coherency-fabric.txt
Documentation/devicetree/bindings/arm/cpus.txt
Documentation/devicetree/bindings/arm/exynos/power_domain.txt [deleted file]
Documentation/devicetree/bindings/arm/fsl.txt
Documentation/devicetree/bindings/arm/hisilicon/hisilicon.txt
Documentation/devicetree/bindings/arm/keystone/keystone.txt
Documentation/devicetree/bindings/arm/mvebu-cpu-config.txt [new file with mode: 0644]
Documentation/devicetree/bindings/arm/pmu.txt
Documentation/devicetree/bindings/arm/psci.txt
Documentation/devicetree/bindings/arm/rockchip.txt
Documentation/devicetree/bindings/arm/samsung-boards.txt [deleted file]
Documentation/devicetree/bindings/arm/samsung/samsung-boards.txt [new file with mode: 0644]
Documentation/devicetree/bindings/arm/shmobile.txt
Documentation/devicetree/bindings/arm/sunxi.txt
Documentation/devicetree/bindings/arm/uniphier/cache-uniphier.txt [new file with mode: 0644]
Documentation/devicetree/bindings/board/fsl-board.txt [new file with mode: 0644]
Documentation/devicetree/bindings/bus/sunxi-rsb.txt [new file with mode: 0644]
Documentation/devicetree/bindings/clock/qcom,gcc.txt
Documentation/devicetree/bindings/clock/qcom,mmcc.txt
Documentation/devicetree/bindings/gpio/gpio-mpc8xxx.txt
Documentation/devicetree/bindings/hwmon/pwm-fan.txt
Documentation/devicetree/bindings/i2c/i2c-davinci.txt
Documentation/devicetree/bindings/i2c/i2c-imx.txt
Documentation/devicetree/bindings/i2c/i2c-rcar.txt
Documentation/devicetree/bindings/i2c/i2c-sh_mobile.txt
Documentation/devicetree/bindings/i2c/i2c-uniphier-f.txt [new file with mode: 0644]
Documentation/devicetree/bindings/i2c/i2c-uniphier.txt [new file with mode: 0644]
Documentation/devicetree/bindings/iommu/samsung,sysmmu.txt
Documentation/devicetree/bindings/memory-controllers/arm,pl172.txt
Documentation/devicetree/bindings/memory-controllers/renesas-memory-controllers.txt
Documentation/devicetree/bindings/mfd/s2mps11.txt
Documentation/devicetree/bindings/net/cpsw.txt
Documentation/devicetree/bindings/pci/arm,juno-r1-pcie.txt [new file with mode: 0644]
Documentation/devicetree/bindings/pci/plda,xpressrich3-axi.txt [new file with mode: 0644]
Documentation/devicetree/bindings/power/pd-samsung.txt [new file with mode: 0644]
Documentation/devicetree/bindings/powerpc/fsl/board.txt [deleted file]
Documentation/devicetree/bindings/soc/mediatek/scpsys.txt
Documentation/devicetree/bindings/soc/qcom/qcom,smem.txt [new file with mode: 0644]
Documentation/devicetree/bindings/soc/rockchip/power_domain.txt [new file with mode: 0644]
Documentation/devicetree/bindings/soc/ti/keystone-navigator-qmss.txt
Documentation/devicetree/bindings/timer/mediatek,mtk-timer.txt
Documentation/devicetree/bindings/usb/dwc3.txt
Documentation/devicetree/bindings/vendor-prefixes.txt
Documentation/filesystems/proc.txt
Documentation/hwmon/scpi-hwmon [new file with mode: 0644]
Documentation/i2c/busses/i2c-i801
Documentation/kbuild/Kconfig.recursion-issue-01 [new file with mode: 0644]
Documentation/kbuild/Kconfig.recursion-issue-02 [new file with mode: 0644]
Documentation/kbuild/Kconfig.select-break [new file with mode: 0644]
Documentation/kbuild/kconfig-language.txt
Documentation/networking/filter.txt
Documentation/networking/ip-sysctl.txt
Documentation/spi/pxa2xx
MAINTAINERS
Makefile
arch/arm/Kconfig
arch/arm/Kconfig.debug
arch/arm/boot/dts/Makefile
arch/arm/boot/dts/am335x-base0033.dts
arch/arm/boot/dts/am335x-bone-common.dtsi
arch/arm/boot/dts/am335x-bonegreen.dts [new file with mode: 0644]
arch/arm/boot/dts/am335x-evm.dts
arch/arm/boot/dts/am335x-evmsk.dts
arch/arm/boot/dts/am335x-igep0033.dtsi
arch/arm/boot/dts/am335x-phycore-som.dtsi
arch/arm/boot/dts/am335x-wega.dtsi
arch/arm/boot/dts/am437x-gp-evm.dts
arch/arm/boot/dts/am437x-idk-evm.dts
arch/arm/boot/dts/am437x-sk-evm.dts
arch/arm/boot/dts/am43x-epos-evm.dts
arch/arm/boot/dts/am57xx-beagle-x15.dts
arch/arm/boot/dts/armada-370-db.dts
arch/arm/boot/dts/armada-370-dlink-dns327l.dts
arch/arm/boot/dts/armada-370-mirabox.dts
arch/arm/boot/dts/armada-370-netgear-rn102.dts
arch/arm/boot/dts/armada-370-netgear-rn104.dts
arch/arm/boot/dts/armada-370-rd.dts
arch/arm/boot/dts/armada-370-seagate-nas-2bay.dts [new file with mode: 0644]
arch/arm/boot/dts/armada-370-seagate-nas-4bay.dts [new file with mode: 0644]
arch/arm/boot/dts/armada-370-seagate-nas-xbay.dtsi [new file with mode: 0644]
arch/arm/boot/dts/armada-370-seagate-personal-cloud-2bay.dts [new file with mode: 0644]
arch/arm/boot/dts/armada-370-seagate-personal-cloud.dts [new file with mode: 0644]
arch/arm/boot/dts/armada-370-seagate-personal-cloud.dtsi [new file with mode: 0644]
arch/arm/boot/dts/armada-370-synology-ds213j.dts
arch/arm/boot/dts/armada-370.dtsi
arch/arm/boot/dts/armada-375-db.dts
arch/arm/boot/dts/armada-375.dtsi
arch/arm/boot/dts/armada-385-db-ap.dts
arch/arm/boot/dts/armada-385-linksys.dtsi
arch/arm/boot/dts/armada-388-db.dts
arch/arm/boot/dts/armada-388-gp.dts
arch/arm/boot/dts/armada-388-rd.dts
arch/arm/boot/dts/armada-38x.dtsi
arch/arm/boot/dts/armada-xp-axpwifiap.dts
arch/arm/boot/dts/armada-xp-db.dts
arch/arm/boot/dts/armada-xp-gp.dts
arch/arm/boot/dts/armada-xp-lenovo-ix4-300d.dts
arch/arm/boot/dts/armada-xp-linksys-mamba.dts
arch/arm/boot/dts/armada-xp-matrix.dts
arch/arm/boot/dts/armada-xp-netgear-rn2120.dts
arch/arm/boot/dts/armada-xp-openblocks-ax3-4.dts
arch/arm/boot/dts/armada-xp-synology-ds414.dts
arch/arm/boot/dts/armada-xp.dtsi
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/at91rm9200.dtsi
arch/arm/boot/dts/at91sam9260.dtsi
arch/arm/boot/dts/at91sam9261.dtsi
arch/arm/boot/dts/at91sam9263.dtsi
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/at91sam9x5.dtsi
arch/arm/boot/dts/at91sam9x5ek.dtsi
arch/arm/boot/dts/axp209.dtsi
arch/arm/boot/dts/axp22x.dtsi [new file with mode: 0644]
arch/arm/boot/dts/bcm-cygnus.dtsi
arch/arm/boot/dts/bcm-nsp.dtsi [new file with mode: 0644]
arch/arm/boot/dts/bcm2835-rpi-a-plus.dts [new file with mode: 0644]
arch/arm/boot/dts/bcm2835-rpi-b-rev2.dts [new file with mode: 0644]
arch/arm/boot/dts/bcm2835-rpi-b.dts
arch/arm/boot/dts/bcm2835-rpi.dtsi
arch/arm/boot/dts/bcm2835.dtsi
arch/arm/boot/dts/bcm4708-netgear-r6250.dts
arch/arm/boot/dts/bcm4709-asus-rt-ac87u.dts
arch/arm/boot/dts/bcm4709-netgear-r7000.dts [new file with mode: 0644]
arch/arm/boot/dts/bcm7445.dtsi
arch/arm/boot/dts/bcm911360_entphn.dts
arch/arm/boot/dts/bcm911360k.dts
arch/arm/boot/dts/bcm958300k.dts
arch/arm/boot/dts/bcm958305k.dts
arch/arm/boot/dts/bcm958625k.dts [new file with mode: 0644]
arch/arm/boot/dts/bcm9hmidc.dtsi [new file with mode: 0644]
arch/arm/boot/dts/berlin2-sony-nsz-gs7.dts
arch/arm/boot/dts/berlin2.dtsi
arch/arm/boot/dts/berlin2cd-google-chromecast.dts
arch/arm/boot/dts/berlin2cd.dtsi
arch/arm/boot/dts/berlin2q-marvell-dmp.dts
arch/arm/boot/dts/berlin2q.dtsi
arch/arm/boot/dts/cx92755.dtsi
arch/arm/boot/dts/cx92755_equinox.dts
arch/arm/boot/dts/dove.dtsi
arch/arm/boot/dts/dra7-evm.dts
arch/arm/boot/dts/dra7.dtsi
arch/arm/boot/dts/dra72-evm.dts
arch/arm/boot/dts/dra72x.dtsi
arch/arm/boot/dts/dra74x.dtsi
arch/arm/boot/dts/efm32gg-dk3750.dts
arch/arm/boot/dts/efm32gg.dtsi
arch/arm/boot/dts/exynos3250-monk.dts
arch/arm/boot/dts/exynos3250-rinato.dts
arch/arm/boot/dts/exynos3250.dtsi
arch/arm/boot/dts/exynos4.dtsi
arch/arm/boot/dts/exynos4210-origen.dts
arch/arm/boot/dts/exynos4210-smdkv310.dts
arch/arm/boot/dts/exynos4210-trats.dts
arch/arm/boot/dts/exynos4210-universal_c210.dts
arch/arm/boot/dts/exynos4412-odroid-common.dtsi
arch/arm/boot/dts/exynos4412-odroidu3.dts
arch/arm/boot/dts/exynos4412-odroidx.dts
arch/arm/boot/dts/exynos4412-origen.dts
arch/arm/boot/dts/exynos4412-tiny4412.dts
arch/arm/boot/dts/exynos4412-trats2.dts
arch/arm/boot/dts/exynos5250-arndale.dts
arch/arm/boot/dts/exynos5250-smdk5250.dts
arch/arm/boot/dts/exynos5250-snow-common.dtsi [new file with mode: 0644]
arch/arm/boot/dts/exynos5250-snow-rev5.dts [new file with mode: 0644]
arch/arm/boot/dts/exynos5250-snow.dts
arch/arm/boot/dts/exynos5250.dtsi
arch/arm/boot/dts/exynos5420-arndale-octa.dts
arch/arm/boot/dts/exynos5420-peach-pit.dts
arch/arm/boot/dts/exynos5420-smdk5420.dts
arch/arm/boot/dts/exynos5422-odroidxu3-audio.dtsi [new file with mode: 0644]
arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi
arch/arm/boot/dts/exynos5422-odroidxu3-lite.dts
arch/arm/boot/dts/exynos5422-odroidxu3.dts
arch/arm/boot/dts/exynos5422-odroidxu4.dts [new file with mode: 0644]
arch/arm/boot/dts/exynos5440-ssdk5440.dts
arch/arm/boot/dts/exynos5800-peach-pi.dts
arch/arm/boot/dts/hi3620-hi4511.dts
arch/arm/boot/dts/hisi-x5hd2-dkb.dts
arch/arm/boot/dts/imx23.dtsi
arch/arm/boot/dts/imx28-evk.dts
arch/arm/boot/dts/imx28-m28evk.dts
arch/arm/boot/dts/imx28.dtsi
arch/arm/boot/dts/imx31.dtsi
arch/arm/boot/dts/imx35.dtsi
arch/arm/boot/dts/imx50-evk.dts
arch/arm/boot/dts/imx53-smd.dts
arch/arm/boot/dts/imx6dl-nit6xlite.dts [new file with mode: 0644]
arch/arm/boot/dts/imx6dl-nitrogen6x.dts
arch/arm/boot/dts/imx6dl-rex-basic.dts
arch/arm/boot/dts/imx6dl-sabrelite.dts
arch/arm/boot/dts/imx6q-dmo-edmqmx6.dts
arch/arm/boot/dts/imx6q-gw5400-a.dts
arch/arm/boot/dts/imx6q-nitrogen6_max.dts [new file with mode: 0644]
arch/arm/boot/dts/imx6q-nitrogen6x.dts
arch/arm/boot/dts/imx6q-rex-pro.dts
arch/arm/boot/dts/imx6q-sabrelite.dts
arch/arm/boot/dts/imx6qdl-aristainetos.dtsi
arch/arm/boot/dts/imx6qdl-aristainetos2.dtsi
arch/arm/boot/dts/imx6qdl-dfi-fs700-m60.dtsi
arch/arm/boot/dts/imx6qdl-nit6xlite.dtsi [new file with mode: 0644]
arch/arm/boot/dts/imx6qdl-nitrogen6_max.dtsi [new file with mode: 0644]
arch/arm/boot/dts/imx6qdl-nitrogen6x.dtsi
arch/arm/boot/dts/imx6qdl-phytec-pfla02.dtsi
arch/arm/boot/dts/imx6qdl-sabreauto.dtsi
arch/arm/boot/dts/imx6qdl-sabrelite.dtsi
arch/arm/boot/dts/imx6qdl-sabresd.dtsi
arch/arm/boot/dts/imx6qdl.dtsi
arch/arm/boot/dts/imx6sl-evk.dts
arch/arm/boot/dts/imx6sl.dtsi
arch/arm/boot/dts/imx6sx-sdb-reva.dts
arch/arm/boot/dts/imx6sx-sdb.dts
arch/arm/boot/dts/imx6sx-sdb.dtsi
arch/arm/boot/dts/imx6sx.dtsi
arch/arm/boot/dts/imx6ul-14x14-evk.dts
arch/arm/boot/dts/imx6ul.dtsi
arch/arm/boot/dts/imx7d-pinfunc.h
arch/arm/boot/dts/imx7d-sdb.dts
arch/arm/boot/dts/imx7d.dtsi
arch/arm/boot/dts/k2e-evm.dts
arch/arm/boot/dts/k2e-netcp.dtsi
arch/arm/boot/dts/k2e.dtsi
arch/arm/boot/dts/k2hk-evm.dts
arch/arm/boot/dts/k2hk-netcp.dtsi
arch/arm/boot/dts/k2hk.dtsi
arch/arm/boot/dts/k2l-evm.dts
arch/arm/boot/dts/k2l-netcp.dtsi
arch/arm/boot/dts/k2l.dtsi
arch/arm/boot/dts/keystone.dtsi
arch/arm/boot/dts/kirkwood.dtsi
arch/arm/boot/dts/lpc18xx.dtsi
arch/arm/boot/dts/lpc4350-hitex-eval.dts
arch/arm/boot/dts/lpc4357-ea4357-devkit.dts
arch/arm/boot/dts/ls1021a-twr.dts
arch/arm/boot/dts/ls1021a.dtsi
arch/arm/boot/dts/meson8b-mxq.dts [new file with mode: 0644]
arch/arm/boot/dts/meson8b-odroidc1.dts [new file with mode: 0644]
arch/arm/boot/dts/meson8b.dtsi [new file with mode: 0644]
arch/arm/boot/dts/mt8127.dtsi
arch/arm/boot/dts/mt8135-evbp1.dts
arch/arm/boot/dts/mt8135.dtsi
arch/arm/boot/dts/nspire.dtsi
arch/arm/boot/dts/omap2420-n8x0-common.dtsi
arch/arm/boot/dts/omap3-beagle-xm.dts
arch/arm/boot/dts/omap3-beagle.dts
arch/arm/boot/dts/omap3-cm-t3x.dtsi
arch/arm/boot/dts/omap3-devkit8000-lcd-common.dtsi
arch/arm/boot/dts/omap3-evm-common.dtsi
arch/arm/boot/dts/omap3-gta04.dtsi
arch/arm/boot/dts/omap3-gta04a5.dts
arch/arm/boot/dts/omap3-igep.dtsi
arch/arm/boot/dts/omap3-igep0020-common.dtsi
arch/arm/boot/dts/omap3-igep0020-rev-f.dts
arch/arm/boot/dts/omap3-igep0020.dts
arch/arm/boot/dts/omap3-igep0030-common.dtsi
arch/arm/boot/dts/omap3-igep0030-rev-g.dts
arch/arm/boot/dts/omap3-igep0030.dts
arch/arm/boot/dts/omap3-ldp.dts
arch/arm/boot/dts/omap3-lilly-a83x.dtsi
arch/arm/boot/dts/omap3-lilly-dbb056.dts
arch/arm/boot/dts/omap3-n950-n9.dtsi
arch/arm/boot/dts/omap3-overo-base.dtsi
arch/arm/boot/dts/omap3-overo-common-lcd35.dtsi
arch/arm/boot/dts/omap3-overo-common-lcd43.dtsi
arch/arm/boot/dts/omap3-pandora-common.dtsi
arch/arm/boot/dts/omap3-tao3530.dtsi
arch/arm/boot/dts/omap3-zoom3.dts
arch/arm/boot/dts/omap4-panda-common.dtsi
arch/arm/boot/dts/omap4-sdp.dts
arch/arm/boot/dts/omap4-var-som-om44-wlan.dtsi
arch/arm/boot/dts/omap4-var-som-om44.dtsi
arch/arm/boot/dts/omap4460.dtsi
arch/arm/boot/dts/omap5-board-common.dtsi [new file with mode: 0644]
arch/arm/boot/dts/omap5-cm-t54.dts
arch/arm/boot/dts/omap5-igep0050.dts [new file with mode: 0644]
arch/arm/boot/dts/omap5-uevm.dts
arch/arm/boot/dts/orion5x.dtsi
arch/arm/boot/dts/qcom-apq8064-cm-qs600.dts
arch/arm/boot/dts/qcom-apq8064-ifc6410.dts
arch/arm/boot/dts/qcom-apq8064.dtsi
arch/arm/boot/dts/qcom-apq8084.dtsi
arch/arm/boot/dts/qcom-msm8974.dtsi
arch/arm/boot/dts/qcom-pm8941.dtsi
arch/arm/boot/dts/r8a7778-bockw-reference.dts [deleted file]
arch/arm/boot/dts/r8a7778.dtsi
arch/arm/boot/dts/r8a7779-marzen.dts
arch/arm/boot/dts/r8a7790-lager.dts
arch/arm/boot/dts/r8a7790.dtsi
arch/arm/boot/dts/r8a7791-koelsch.dts
arch/arm/boot/dts/r8a7791-porter.dts [new file with mode: 0644]
arch/arm/boot/dts/r8a7791.dtsi
arch/arm/boot/dts/r8a7794-silk.dts
arch/arm/boot/dts/r8a7794.dtsi
arch/arm/boot/dts/r8a77xx-aa121td01-panel.dtsi [new file with mode: 0644]
arch/arm/boot/dts/rk3066a-bqcurie2.dts
arch/arm/boot/dts/rk3066a-marsboard.dts
arch/arm/boot/dts/rk3066a-rayeager.dts
arch/arm/boot/dts/rk3188-radxarock.dts
arch/arm/boot/dts/rk3188.dtsi
arch/arm/boot/dts/rk3288-firefly.dtsi
arch/arm/boot/dts/rk3288-popmetal.dts
arch/arm/boot/dts/rk3288-rock2-som.dtsi [new file with mode: 0644]
arch/arm/boot/dts/rk3288-rock2-square.dts [new file with mode: 0644]
arch/arm/boot/dts/rk3288-veyron-jaq.dts [new file with mode: 0644]
arch/arm/boot/dts/rk3288-veyron.dtsi
arch/arm/boot/dts/rk3288.dtsi
arch/arm/boot/dts/s3c2416.dtsi
arch/arm/boot/dts/s5pv210-aquila.dts
arch/arm/boot/dts/s5pv210-goni.dts
arch/arm/boot/dts/sama5d2-pinfunc.h [new file with mode: 0644]
arch/arm/boot/dts/sama5d2.dtsi
arch/arm/boot/dts/sama5d3.dtsi
arch/arm/boot/dts/sama5d3_mci2.dtsi
arch/arm/boot/dts/sama5d3xmb.dtsi
arch/arm/boot/dts/sama5d4.dtsi
arch/arm/boot/dts/sh73a0-kzm9g.dts
arch/arm/boot/dts/socfpga.dtsi
arch/arm/boot/dts/socfpga_arria10.dtsi
arch/arm/boot/dts/socfpga_arria10_socdk.dtsi
arch/arm/boot/dts/stih407-b2120.dts
arch/arm/boot/dts/stih407-family.dtsi
arch/arm/boot/dts/stih407-pinctrl.dtsi
arch/arm/boot/dts/stih407.dtsi
arch/arm/boot/dts/stih410-b2120.dts
arch/arm/boot/dts/stih410.dtsi
arch/arm/boot/dts/stih418-b2199.dts
arch/arm/boot/dts/stih418-clock.dtsi
arch/arm/boot/dts/stih418.dtsi
arch/arm/boot/dts/stihxxx-b2120.dtsi
arch/arm/boot/dts/sun4i-a10-a1000.dts
arch/arm/boot/dts/sun4i-a10-chuwi-v7-cw0825.dts
arch/arm/boot/dts/sun4i-a10-cubieboard.dts
arch/arm/boot/dts/sun4i-a10-gemei-g9.dts
arch/arm/boot/dts/sun4i-a10-inet1.dts [new file with mode: 0644]
arch/arm/boot/dts/sun4i-a10-inet97fv2.dts
arch/arm/boot/dts/sun4i-a10-inet9f-rev03.dts [new file with mode: 0644]
arch/arm/boot/dts/sun4i-a10-jesurun-q5.dts
arch/arm/boot/dts/sun4i-a10-marsboard.dts
arch/arm/boot/dts/sun4i-a10-olinuxino-lime.dts
arch/arm/boot/dts/sun4i-a10-pcduino.dts
arch/arm/boot/dts/sun4i-a10-pcduino2.dts [new file with mode: 0644]
arch/arm/boot/dts/sun4i-a10-pov-protab2-ips9.dts [new file with mode: 0644]
arch/arm/boot/dts/sun4i-a10.dtsi
arch/arm/boot/dts/sun5i-a10s-auxtek-t003.dts [new file with mode: 0644]
arch/arm/boot/dts/sun5i-a10s-olinuxino-micro.dts
arch/arm/boot/dts/sun5i-a10s-wobo-i5.dts [new file with mode: 0644]
arch/arm/boot/dts/sun5i-a10s.dtsi
arch/arm/boot/dts/sun5i-a13-inet-98v-rev2.dts [new file with mode: 0644]
arch/arm/boot/dts/sun5i-a13-q8-tablet.dts [new file with mode: 0644]
arch/arm/boot/dts/sun5i-a13.dtsi
arch/arm/boot/dts/sun5i-q8-common.dtsi [new file with mode: 0644]
arch/arm/boot/dts/sun5i-r8-chip.dts [new file with mode: 0644]
arch/arm/boot/dts/sun5i-r8.dtsi [new file with mode: 0644]
arch/arm/boot/dts/sun5i.dtsi
arch/arm/boot/dts/sun6i-a31-colombus.dts
arch/arm/boot/dts/sun6i-a31-hummingbird.dts
arch/arm/boot/dts/sun6i-a31.dtsi
arch/arm/boot/dts/sun6i-a31s-primo81.dts [new file with mode: 0644]
arch/arm/boot/dts/sun6i-a31s-sina31s-core.dtsi [new file with mode: 0644]
arch/arm/boot/dts/sun6i-a31s-sina31s.dts [new file with mode: 0644]
arch/arm/boot/dts/sun6i-a31s-sinovoip-bpi-m2.dts [new file with mode: 0644]
arch/arm/boot/dts/sun6i-a31s-yones-toptech-bs1078-v2.dts [new file with mode: 0644]
arch/arm/boot/dts/sun7i-a20-bananapi.dts
arch/arm/boot/dts/sun7i-a20-cubieboard2.dts
arch/arm/boot/dts/sun7i-a20-cubietruck.dts
arch/arm/boot/dts/sun7i-a20-olimex-som-evb.dts [new file with mode: 0644]
arch/arm/boot/dts/sun7i-a20-olinuxino-lime.dts
arch/arm/boot/dts/sun7i-a20-olinuxino-lime2.dts
arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts
arch/arm/boot/dts/sun7i-a20-orangepi-mini.dts
arch/arm/boot/dts/sun7i-a20-orangepi.dts
arch/arm/boot/dts/sun7i-a20-pcduino3-nano.dts
arch/arm/boot/dts/sun7i-a20-pcduino3.dts
arch/arm/boot/dts/sun7i-a20-wexler-tab7200.dts
arch/arm/boot/dts/sun7i-a20-wits-pro-a20-dkt.dts [new file with mode: 0644]
arch/arm/boot/dts/sun7i-a20.dtsi
arch/arm/boot/dts/sun8i-a23-a33.dtsi
arch/arm/boot/dts/sun8i-a23-gt90h-v4.dts [new file with mode: 0644]
arch/arm/boot/dts/sun8i-a23-ippo-q8h-v1.2.dts [changed from file to symlink]
arch/arm/boot/dts/sun8i-a23-ippo-q8h-v5.dts [changed from file to symlink]
arch/arm/boot/dts/sun8i-a23-q8-tablet.dts [new file with mode: 0644]
arch/arm/boot/dts/sun8i-a23.dtsi
arch/arm/boot/dts/sun8i-a33-et-q8-v1.6.dts [changed from file to symlink]
arch/arm/boot/dts/sun8i-a33-ippo-q8h-v1.2.dts [changed from file to symlink]
arch/arm/boot/dts/sun8i-a33-q8-tablet.dts [new file with mode: 0644]
arch/arm/boot/dts/sun8i-a33-sinlinx-sina33.dts
arch/arm/boot/dts/sun8i-a33.dtsi
arch/arm/boot/dts/sun8i-q8-common.dtsi [new file with mode: 0644]
arch/arm/boot/dts/sun9i-a80.dtsi
arch/arm/boot/dts/sunxi-q8-common.dtsi [new file with mode: 0644]
arch/arm/boot/dts/tegra124-nyan.dtsi
arch/arm/boot/dts/tegra124.dtsi
arch/arm/boot/dts/tegra20.dtsi
arch/arm/boot/dts/tegra30-apalis-eval.dts
arch/arm/boot/dts/tegra30-apalis.dtsi
arch/arm/boot/dts/tegra30-colibri-eval-v3.dts
arch/arm/boot/dts/tegra30-colibri.dtsi
arch/arm/boot/dts/tegra30.dtsi
arch/arm/boot/dts/uniphier-ph1-ld4-ref.dts
arch/arm/boot/dts/uniphier-ph1-ld4.dtsi
arch/arm/boot/dts/uniphier-ph1-ld6b-ref.dts
arch/arm/boot/dts/uniphier-ph1-pro4-ref.dts
arch/arm/boot/dts/uniphier-ph1-pro4.dtsi
arch/arm/boot/dts/uniphier-ph1-pro5.dtsi
arch/arm/boot/dts/uniphier-ph1-sld3-ref.dts
arch/arm/boot/dts/uniphier-ph1-sld3.dtsi
arch/arm/boot/dts/uniphier-ph1-sld8-ref.dts
arch/arm/boot/dts/uniphier-ph1-sld8.dtsi
arch/arm/boot/dts/uniphier-proxstream2-gentil.dts [new file with mode: 0644]
arch/arm/boot/dts/uniphier-proxstream2-vodka.dts [new file with mode: 0644]
arch/arm/boot/dts/uniphier-proxstream2.dtsi
arch/arm/boot/dts/vf-colibri.dtsi
arch/arm/boot/dts/vf500-colibri-eval-v3.dts
arch/arm/boot/dts/vf500-colibri.dtsi
arch/arm/boot/dts/vf610-twr.dts
arch/arm/boot/dts/vfxxx.dtsi
arch/arm/boot/dts/wm8750.dtsi
arch/arm/configs/at91_dt_defconfig
arch/arm/configs/bockw_defconfig [deleted file]
arch/arm/configs/exynos_defconfig
arch/arm/configs/imx_v6_v7_defconfig
arch/arm/configs/keystone_defconfig
arch/arm/configs/lpc18xx_defconfig
arch/arm/configs/multi_v7_defconfig
arch/arm/configs/mvebu_v7_defconfig
arch/arm/configs/qcom_defconfig
arch/arm/configs/sama5_defconfig
arch/arm/configs/shmobile_defconfig
arch/arm/configs/socfpga_defconfig
arch/arm/configs/sunxi_defconfig
arch/arm/configs/tegra_defconfig
arch/arm/include/asm/hardware/cache-uniphier.h [new file with mode: 0644]
arch/arm/include/debug/at91.S
arch/arm/kernel/irq.c
arch/arm/kernel/psci_smp.c
arch/arm/mach-at91/pm_suspend.S
arch/arm/mach-bcm/Kconfig
arch/arm/mach-bcm/Makefile
arch/arm/mach-bcm/bcm_nsp.c [new file with mode: 0644]
arch/arm/mach-bcm/brcmstb.c
arch/arm/mach-berlin/berlin.c
arch/arm/mach-berlin/platsmp.c
arch/arm/mach-cns3xxx/pcie.c
arch/arm/mach-davinci/board-dm644x-evm.c
arch/arm/mach-davinci/clock.c
arch/arm/mach-digicolor/Kconfig
arch/arm/mach-exynos/suspend.c
arch/arm/mach-imx/common.h
arch/arm/mach-imx/gpc.c
arch/arm/mach-imx/mach-imx6ul.c
arch/arm/mach-imx/mach-imx7d.c
arch/arm/mach-imx/pm-imx6.c
arch/arm/mach-imx/suspend-imx6.S
arch/arm/mach-keystone/keystone.c
arch/arm/mach-mediatek/Makefile
arch/arm/mach-mediatek/mediatek.c
arch/arm/mach-mediatek/platsmp.c [new file with mode: 0644]
arch/arm/mach-meson/Kconfig
arch/arm/mach-meson/meson.c
arch/arm/mach-mvebu/board-v7.c
arch/arm/mach-mvebu/coherency.c
arch/arm/mach-mvebu/pmsu.c
arch/arm/mach-omap1/Kconfig
arch/arm/mach-omap1/Makefile
arch/arm/mach-omap1/board-voiceblue.c [deleted file]
arch/arm/mach-omap1/include/mach/board-voiceblue.h [deleted file]
arch/arm/mach-omap2/Kconfig
arch/arm/mach-omap2/Makefile
arch/arm/mach-omap2/board-generic.c
arch/arm/mach-omap2/board-ldp.c
arch/arm/mach-omap2/board-rx51.c
arch/arm/mach-omap2/clkt34xx_dpll3m2.c [deleted file]
arch/arm/mach-omap2/common.h
arch/arm/mach-omap2/devices.c
arch/arm/mach-omap2/devices.h [deleted file]
arch/arm/mach-omap2/id.c
arch/arm/mach-omap2/omap-hotplug.c
arch/arm/mach-omap2/omap-wakeupgen.c
arch/arm/mach-omap2/omap_hwmod_33xx_43xx_interconnect_data.c
arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
arch/arm/mach-omap2/omap_hwmod_44xx_data.c
arch/arm/mach-omap2/omap_hwmod_54xx_data.c
arch/arm/mach-omap2/omap_hwmod_7xx_data.c
arch/arm/mach-omap2/pm44xx.c
arch/arm/mach-omap2/powerdomains3xxx_data.c
arch/arm/mach-omap2/soc.h
arch/arm/mach-omap2/sram.c
arch/arm/mach-omap2/sram.h
arch/arm/mach-omap2/sram34xx.S [deleted file]
arch/arm/mach-omap2/timer.c
arch/arm/mach-omap2/vc.c
arch/arm/mach-orion5x/Kconfig
arch/arm/mach-orion5x/dns323-setup.c
arch/arm/mach-orion5x/tsx09-common.c
arch/arm/mach-prima2/hotplug.c
arch/arm/mach-pxa/cm-x300.c
arch/arm/mach-pxa/colibri-pxa270-income.c
arch/arm/mach-pxa/devices.c
arch/arm/mach-pxa/ezx.c
arch/arm/mach-pxa/hx4700.c
arch/arm/mach-pxa/icontrol.c
arch/arm/mach-pxa/include/mach/magician.h
arch/arm/mach-pxa/include/mach/pxa27x.h
arch/arm/mach-pxa/lpd270.c
arch/arm/mach-pxa/magician.c
arch/arm/mach-pxa/mainstone.c
arch/arm/mach-pxa/mioa701.c
arch/arm/mach-pxa/palm27x.c
arch/arm/mach-pxa/palmtc.c
arch/arm/mach-pxa/palmte2.c
arch/arm/mach-pxa/pcm990-baseboard.c
arch/arm/mach-pxa/pxa27x.c
arch/arm/mach-pxa/raumfeld.c
arch/arm/mach-pxa/tavorevb.c
arch/arm/mach-pxa/viper.c
arch/arm/mach-pxa/z2.c
arch/arm/mach-pxa/zylonite.c
arch/arm/mach-qcom/platsmp.c
arch/arm/mach-realview/hotplug.c
arch/arm/mach-s3c24xx/mach-h1940.c
arch/arm/mach-s3c24xx/mach-rx1950.c
arch/arm/mach-s3c64xx/dev-backlight.c
arch/arm/mach-s3c64xx/mach-crag6410.c
arch/arm/mach-s3c64xx/mach-hmt.c
arch/arm/mach-s3c64xx/mach-smartq.c
arch/arm/mach-s3c64xx/mach-smdk6410.c
arch/arm/mach-shmobile/Kconfig
arch/arm/mach-shmobile/Makefile
arch/arm/mach-shmobile/Makefile.boot [deleted file]
arch/arm/mach-shmobile/board-bockw-reference.c [deleted file]
arch/arm/mach-shmobile/board-bockw.c [deleted file]
arch/arm/mach-shmobile/clock-r8a7778.c [deleted file]
arch/arm/mach-shmobile/clock.c [deleted file]
arch/arm/mach-shmobile/clock.h [deleted file]
arch/arm/mach-shmobile/common.h
arch/arm/mach-shmobile/console.c [deleted file]
arch/arm/mach-shmobile/intc.h [deleted file]
arch/arm/mach-shmobile/platsmp-apmu.c
arch/arm/mach-shmobile/pm-r8a7779.c
arch/arm/mach-shmobile/pm-rmobile.c
arch/arm/mach-shmobile/pm-rmobile.h
arch/arm/mach-shmobile/r8a7778.h [deleted file]
arch/arm/mach-shmobile/r8a7779.h
arch/arm/mach-shmobile/setup-r8a7778.c
arch/arm/mach-shmobile/sh-gpio.h [deleted file]
arch/arm/mach-shmobile/timer.c
arch/arm/mach-spear/hotplug.c
arch/arm/mach-sunxi/sunxi.c
arch/arm/mach-tegra/board-paz00.c
arch/arm/mach-tegra/hotplug.c
arch/arm/mach-uniphier/Makefile
arch/arm/mach-uniphier/headsmp.S [new file with mode: 0644]
arch/arm/mach-uniphier/platsmp.c
arch/arm/mach-ux500/hotplug.c
arch/arm/mach-vexpress/hotplug.c
arch/arm/mm/Kconfig
arch/arm/mm/Makefile
arch/arm/mm/cache-uniphier.c [new file with mode: 0644]
arch/arm64/Kconfig.platforms
arch/arm64/boot/dts/Makefile
arch/arm64/boot/dts/altera/Makefile [new file with mode: 0644]
arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/altera/socfpga_stratix10_socdk.dts [new file with mode: 0644]
arch/arm64/boot/dts/apm/Makefile
arch/arm64/boot/dts/apm/apm-merlin.dts [new file with mode: 0644]
arch/arm64/boot/dts/apm/apm-mustang.dts
arch/arm64/boot/dts/apm/apm-shadowcat.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/apm/apm-storm.dtsi
arch/arm64/boot/dts/arm/juno-base.dtsi
arch/arm64/boot/dts/arm/juno-motherboard.dtsi
arch/arm64/boot/dts/arm/juno-r1.dts
arch/arm64/boot/dts/arm/juno.dts
arch/arm64/boot/dts/arm/vexpress-v2f-1xv7-ca53x2.dts
arch/arm64/boot/dts/arm/vexpress-v2m-rs1.dtsi [new symlink]
arch/arm64/boot/dts/exynos/exynos7-pinctrl.dtsi
arch/arm64/boot/dts/exynos/exynos7.dtsi
arch/arm64/boot/dts/freescale/Makefile
arch/arm64/boot/dts/freescale/fsl-ls2080a-qds.dts [new file with mode: 0644]
arch/arm64/boot/dts/freescale/fsl-ls2080a-rdb.dts [new file with mode: 0644]
arch/arm64/boot/dts/freescale/fsl-ls2080a-simu.dts [new file with mode: 0644]
arch/arm64/boot/dts/freescale/fsl-ls2080a.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/freescale/fsl-ls2085a-simu.dts [deleted file]
arch/arm64/boot/dts/freescale/fsl-ls2085a.dtsi [deleted file]
arch/arm64/boot/dts/hisilicon/Makefile
arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts
arch/arm64/boot/dts/hisilicon/hi6220.dtsi
arch/arm64/boot/dts/hisilicon/hip05-d02.dts [new file with mode: 0644]
arch/arm64/boot/dts/hisilicon/hip05.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/marvell/Makefile
arch/arm64/boot/dts/marvell/berlin4ct-stb.dts [new file with mode: 0644]
arch/arm64/boot/dts/marvell/berlin4ct.dtsi
arch/arm64/boot/dts/mediatek/mt8173-evb.dts
arch/arm64/boot/dts/mediatek/mt8173.dtsi
arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi
arch/arm64/boot/dts/qcom/msm8916-pins.dtsi
arch/arm64/boot/dts/qcom/msm8916.dtsi
arch/arm64/configs/defconfig
arch/arm64/kernel/psci.c
arch/m68k/emu/nfblock.c
arch/metag/include/asm/irq.h
arch/metag/kernel/smp.c
arch/powerpc/sysdev/axonram.c
arch/um/Makefile
arch/um/drivers/net_kern.c
arch/um/include/asm/ptrace-generic.h
arch/um/include/shared/os.h
arch/um/include/shared/skas/stub-data.h
arch/um/include/shared/timer-internal.h [new file with mode: 0644]
arch/um/kernel/process.c
arch/um/kernel/skas/clone.c
arch/um/kernel/skas/mmu.c
arch/um/kernel/skas/syscall.c
arch/um/kernel/time.c
arch/um/kernel/tlb.c
arch/um/os-Linux/internal.h [deleted file]
arch/um/os-Linux/main.c
arch/um/os-Linux/process.c
arch/um/os-Linux/signal.c
arch/um/os-Linux/skas/process.c
arch/um/os-Linux/time.c
arch/x86/mm/init.c
arch/x86/mm/init_64.c
arch/x86/um/stub_32.S
arch/x86/um/stub_64.S
arch/xtensa/platforms/iss/simdisk.c
block/blk-core.c
block/blk-mq-sysfs.c
block/blk-mq.c
block/blk-sysfs.c
drivers/acpi/nfit.c
drivers/acpi/nfit.h
drivers/base/devres.c
drivers/base/power/clock_ops.c
drivers/block/brd.c
drivers/block/drbd/drbd_int.h
drivers/block/drbd/drbd_req.c
drivers/block/null_blk.c
drivers/block/pktcdvd.c
drivers/block/ps3vram.c
drivers/block/rsxx/dev.c
drivers/block/umem.c
drivers/block/zram/zram_drv.c
drivers/bluetooth/btusb.c
drivers/bus/Kconfig
drivers/bus/Makefile
drivers/bus/sunxi-rsb.c [new file with mode: 0644]
drivers/clk/Kconfig
drivers/clk/Makefile
drivers/clk/berlin/bg2q.c
drivers/clk/clk-scpi.c [new file with mode: 0644]
drivers/clk/samsung/clk-exynos5250.c
drivers/clk/shmobile/clk-mstp.c
drivers/clk/sunxi/clk-sunxi.c
drivers/clocksource/Kconfig
drivers/clocksource/Makefile
drivers/clocksource/tcb_clksrc.c
drivers/clocksource/timer-atmel-st.c
drivers/clocksource/timer-ti-32k.c [new file with mode: 0644]
drivers/cpufreq/Kconfig.arm
drivers/cpufreq/Makefile
drivers/cpufreq/scpi-cpufreq.c [new file with mode: 0644]
drivers/firmware/Kconfig
drivers/firmware/Makefile
drivers/firmware/arm_scpi.c [new file with mode: 0644]
drivers/firmware/psci.c
drivers/firmware/qcom_scm-32.c
drivers/firmware/raspberrypi.c [new file with mode: 0644]
drivers/gpu/drm/ast/ast_drv.h
drivers/gpu/drm/ast/ast_fb.c
drivers/gpu/drm/ast/ast_main.c
drivers/gpu/drm/ast/ast_mode.c
drivers/gpu/drm/nouveau/nvkm/subdev/instmem/gk20a.c
drivers/gpu/drm/vc4/Kconfig
drivers/hwmon/Kconfig
drivers/hwmon/Makefile
drivers/hwmon/scpi-hwmon.c [new file with mode: 0644]
drivers/i2c/busses/Kconfig
drivers/i2c/busses/Makefile
drivers/i2c/busses/i2c-at91.c
drivers/i2c/busses/i2c-au1550.c
drivers/i2c/busses/i2c-davinci.c
drivers/i2c/busses/i2c-designware-core.c
drivers/i2c/busses/i2c-designware-core.h
drivers/i2c/busses/i2c-designware-pcidrv.c
drivers/i2c/busses/i2c-designware-platdrv.c
drivers/i2c/busses/i2c-i801.c
drivers/i2c/busses/i2c-ibm_iic.c
drivers/i2c/busses/i2c-img-scb.c
drivers/i2c/busses/i2c-imx.c
drivers/i2c/busses/i2c-ismt.c
drivers/i2c/busses/i2c-meson.c
drivers/i2c/busses/i2c-mt65xx.c
drivers/i2c/busses/i2c-ocores.c
drivers/i2c/busses/i2c-pnx.c
drivers/i2c/busses/i2c-pxa.c
drivers/i2c/busses/i2c-rcar.c
drivers/i2c/busses/i2c-rk3x.c
drivers/i2c/busses/i2c-sh_mobile.c
drivers/i2c/busses/i2c-sirf.c
drivers/i2c/busses/i2c-stu300.c
drivers/i2c/busses/i2c-tegra.c
drivers/i2c/busses/i2c-uniphier-f.c [new file with mode: 0644]
drivers/i2c/busses/i2c-uniphier.c [new file with mode: 0644]
drivers/i2c/i2c-core.c
drivers/i2c/i2c-dev.c
drivers/i2c/i2c-mux.c
drivers/lightnvm/rrpc.c
drivers/md/Kconfig
drivers/md/bcache/request.c
drivers/md/dm.c
drivers/md/md.c
drivers/memory/pl172.c
drivers/misc/atmel_tclib.c
drivers/mtd/ubi/attach.c
drivers/mtd/ubi/cdev.c
drivers/mtd/ubi/eba.c
drivers/mtd/ubi/fastmap-wl.c
drivers/mtd/ubi/fastmap.c
drivers/mtd/ubi/ubi-media.h
drivers/net/bonding/bond_main.c
drivers/net/caif/caif_spi.c
drivers/net/dsa/mv88e6171.c
drivers/net/dsa/mv88e6352.c
drivers/net/dsa/mv88e6xxx.c
drivers/net/dsa/mv88e6xxx.h
drivers/net/ethernet/apm/xgene/xgene_enet_hw.c
drivers/net/ethernet/apm/xgene/xgene_enet_hw.h
drivers/net/ethernet/apm/xgene/xgene_enet_main.c
drivers/net/ethernet/broadcom/Kconfig
drivers/net/ethernet/broadcom/bnxt/bnxt.c
drivers/net/ethernet/broadcom/bnxt/bnxt.h
drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c
drivers/net/ethernet/hisilicon/Kconfig
drivers/net/ethernet/marvell/Kconfig
drivers/net/ethernet/marvell/mvneta.c
drivers/net/ethernet/qlogic/Kconfig
drivers/net/ethernet/qlogic/qed/qed_dev.c
drivers/net/ethernet/qlogic/qed/qed_int.c
drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
drivers/net/ethernet/renesas/sh_eth.c
drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
drivers/net/ethernet/synopsys/dwc_eth_qos.c
drivers/net/ethernet/ti/cpsw.c
drivers/net/fjes/fjes_hw.c
drivers/net/macvtap.c
drivers/net/usb/qmi_wwan.c
drivers/nfc/nfcmrvl/Kconfig
drivers/nfc/nfcmrvl/fw_dnld.c
drivers/nfc/nfcmrvl/main.c
drivers/nfc/nfcmrvl/uart.c
drivers/nvdimm/blk.c
drivers/nvdimm/btt.c
drivers/nvdimm/pmem.c
drivers/nvme/host/pci.c
drivers/pwm/pwm-atmel-tcb.c
drivers/s390/block/dcssblk.c
drivers/s390/block/xpram.c
drivers/soc/Kconfig
drivers/soc/Makefile
drivers/soc/brcmstb/Kconfig [new file with mode: 0644]
drivers/soc/brcmstb/Makefile [new file with mode: 0644]
drivers/soc/brcmstb/biuctrl.c [new file with mode: 0644]
drivers/soc/brcmstb/common.c [new file with mode: 0644]
drivers/soc/mediatek/mtk-pmic-wrap.c
drivers/soc/mediatek/mtk-scpsys.c
drivers/soc/qcom/Kconfig
drivers/soc/qcom/smd-rpm.c
drivers/soc/qcom/smd.c
drivers/soc/qcom/smem.c
drivers/soc/rockchip/Kconfig [new file with mode: 0644]
drivers/soc/rockchip/Makefile [new file with mode: 0644]
drivers/soc/rockchip/pm_domains.c [new file with mode: 0644]
drivers/soc/ti/knav_qmss.h
drivers/soc/ti/knav_qmss_acc.c
drivers/soc/ti/knav_qmss_queue.c
drivers/staging/lustre/lustre/llite/lloop.c
fs/binfmt_elf.c
fs/binfmt_elf_fdpic.c
fs/compat_ioctl.c
fs/direct-io.c
fs/ubifs/Kconfig
fs/ubifs/debug.c
fs/ubifs/dir.c
fs/ubifs/file.c
fs/ubifs/lpt.c
fs/ubifs/misc.h
fs/ubifs/recovery.c
fs/ubifs/super.c
fs/ubifs/tnc.c
fs/ubifs/ubifs.h
fs/ubifs/xattr.c
include/dt-bindings/clock/berlin2q.h
include/dt-bindings/clock/exynos5250.h
include/dt-bindings/power/rk3288-power.h [new file with mode: 0644]
include/linux/acpi.h
include/linux/atmel_tc.h
include/linux/blk-mq.h
include/linux/blk_types.h
include/linux/blkdev.h
include/linux/device.h
include/linux/fs.h
include/linux/i2c-ocores.h
include/linux/i2c/i2c-rcar.h [deleted file]
include/linux/lightnvm.h
include/linux/mfd/syscon/imx7-iomuxc-gpr.h [new file with mode: 0644]
include/linux/netdevice.h
include/linux/platform_data/atmel.h
include/linux/pmem.h
include/linux/psci.h
include/linux/qcom_scm.h
include/linux/sched.h
include/linux/scpi_protocol.h [new file with mode: 0644]
include/linux/soc/brcmstb/brcmstb.h [new file with mode: 0644]
include/linux/soc/qcom/smd.h
include/linux/soc/qcom/smem.h
include/linux/spi/pxa2xx_spi.h
include/linux/sunxi-rsb.h [new file with mode: 0644]
include/linux/tcp.h
include/net/bluetooth/l2cap.h
include/net/dst_metadata.h
include/net/inet_sock.h
include/soc/bcm2835/raspberrypi-firmware.h [new file with mode: 0644]
include/soc/brcmstb/common.h [new file with mode: 0644]
include/uapi/linux/i2c-dev.h
include/uapi/linux/psci.h
kernel/memremap.c
kernel/trace/Kconfig
lib/test_bpf.c
mm/page_alloc.c
net/bluetooth/hci_core.c
net/bluetooth/l2cap_core.c
net/bridge/br_stp.c
net/core/dev.c
net/core/dst.c
net/ipv4/fib_semantics.c
net/ipv4/igmp.c
net/ipv4/ip_sockglue.c
net/ipv4/netfilter/nf_defrag_ipv4.c
net/ipv4/sysctl_net_ipv4.c
net/ipv4/tcp_ipv4.c
net/ipv4/tcp_minisocks.c
net/ipv6/addrconf.c
net/ipv6/tcp_ipv6.c
net/netfilter/nf_nat_redirect.c
net/netfilter/nfnetlink.c
net/netfilter/nft_meta.c
net/netfilter/xt_TEE.c
net/netfilter/xt_owner.c
net/packet/af_packet.c
net/sched/cls_flow.c
net/sched/em_meta.c
net/vmw_vsock/vmci_transport.c
scripts/coccicheck
scripts/coccinelle/free/ifnullfree.cocci
scripts/coccinelle/iterators/device_node_continue.cocci [new file with mode: 0644]
scripts/coccinelle/misc/compare_const_fl.cocci [new file with mode: 0644]
scripts/coccinelle/misc/of_table.cocci
scripts/coccinelle/misc/simple_return.cocci [deleted file]
scripts/coccinelle/null/deref_null.cocci
scripts/coccinelle/tests/odd_ptr_err.cocci
scripts/kconfig/Makefile
scripts/kconfig/expr.c
scripts/kconfig/merge_config.sh
scripts/kconfig/qconf.cc
scripts/kconfig/qconf.h
scripts/kconfig/symbol.c
scripts/package/builddeb
scripts/tags.sh
security/selinux/hooks.c
security/selinux/netlabel.c
security/smack/smack_netfilter.c
tools/testing/nvdimm/test/nfit.c
tools/testing/selftests/Makefile
tools/testing/selftests/breakpoints/Makefile
tools/testing/selftests/efivarfs/.gitignore [new file with mode: 0644]
tools/testing/selftests/ftrace/test.d/kprobe/add_and_remove.tc
tools/testing/selftests/ftrace/test.d/kprobe/busy_check.tc
tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args.tc
tools/testing/selftests/ftrace/test.d/kprobe/kprobe_ftrace.tc
tools/testing/selftests/ftrace/test.d/kprobe/kretprobe_args.tc
tools/testing/selftests/memfd/Makefile
tools/testing/selftests/memfd/memfd_test.c
tools/testing/selftests/memfd/run_fuse_test.sh [changed mode: 0644->0755]
tools/testing/selftests/mqueue/mq_open_tests.c
tools/testing/selftests/mqueue/mq_perf_tests.c
tools/testing/selftests/pstore/Makefile [new file with mode: 0644]
tools/testing/selftests/pstore/common_tests [new file with mode: 0755]
tools/testing/selftests/pstore/pstore_crash_test [new file with mode: 0755]
tools/testing/selftests/pstore/pstore_post_reboot_tests [new file with mode: 0755]
tools/testing/selftests/pstore/pstore_tests [new file with mode: 0755]
tools/testing/selftests/seccomp/seccomp_bpf.c
tools/testing/selftests/static_keys/test_static_keys.sh [changed mode: 0644->0755]
tools/testing/selftests/timers/nanosleep.c
tools/testing/selftests/vm/run_vmtests

diff --git a/Documentation/acpi/i2c-muxes.txt b/Documentation/acpi/i2c-muxes.txt
new file mode 100644 (file)
index 0000000..9fcc4f0
--- /dev/null
@@ -0,0 +1,58 @@
+ACPI I2C Muxes
+--------------
+
+Describing an I2C device hierarchy that includes I2C muxes requires an ACPI
+Device () scope per mux channel.
+
+Consider this topology:
+
++------+   +------+
+| SMB1 |-->| MUX0 |--CH00--> i2c client A (0x50)
+|      |   | 0x70 |--CH01--> i2c client B (0x50)
++------+   +------+
+
+which corresponds to the following ASL:
+
+Device (SMB1)
+{
+    Name (_HID, ...)
+    Device (MUX0)
+    {
+        Name (_HID, ...)
+        Name (_CRS, ResourceTemplate () {
+            I2cSerialBus (0x70, ControllerInitiated, I2C_SPEED,
+                          AddressingMode7Bit, "^SMB1", 0x00,
+                          ResourceConsumer,,)
+        }
+
+        Device (CH00)
+        {
+            Name (_ADR, 0)
+
+            Device (CLIA)
+            {
+                Name (_HID, ...)
+                Name (_CRS, ResourceTemplate () {
+                    I2cSerialBus (0x50, ControllerInitiated, I2C_SPEED,
+                                  AddressingMode7Bit, "^CH00", 0x00,
+                                  ResourceConsumer,,)
+                }
+            }
+        }
+
+        Device (CH01)
+        {
+            Name (_ADR, 1)
+
+            Device (CLIB)
+            {
+                Name (_HID, ...)
+                Name (_CRS, ResourceTemplate () {
+                    I2cSerialBus (0x50, ControllerInitiated, I2C_SPEED,
+                                  AddressingMode7Bit, "^CH01", 0x00,
+                                  ResourceConsumer,,)
+                }
+            }
+        }
+    }
+}
index df8d4fb85939c82a712e74b6d3987e2598262468..ed494ac0beb2acc0a7a102224cda6e1055c15a3a 100644 (file)
@@ -19,7 +19,7 @@ executing kernel.
 Address:      sysram_ns_base_addr
 Offset        Value                                        Purpose
 =============================================================================
-0x08          exynos_cpu_resume_ns                         System suspend
+0x08          exynos_cpu_resume_ns, mcpm_entry_point       System suspend
 0x0c          0x00000bad (Magic cookie)                    System suspend
 0x1c          exynos4_secondary_startup                    Secondary CPU boot
 0x1c + 4*cpu  exynos4_secondary_startup (Exynos4412)       Secondary CPU boot
@@ -56,7 +56,8 @@ Offset        Value                                        Purpose
 Address:      pmu_base_addr
 Offset        Value                           Purpose
 =============================================================================
-0x0908        Non-zero (only Exynos3250)      Secondary CPU boot up indicator
+0x0908        Non-zero                        Secondary CPU boot up indicator
+                                              on Exynos3250 and Exynos542x
 
 
 4. Glossary
diff --git a/Documentation/arm/keystone/knav-qmss.txt b/Documentation/arm/keystone/knav-qmss.txt
new file mode 100644 (file)
index 0000000..fcdb9fd
--- /dev/null
@@ -0,0 +1,56 @@
+* Texas Instruments Keystone Navigator Queue Management SubSystem driver
+
+Driver source code path
+  drivers/soc/ti/knav_qmss.c
+  drivers/soc/ti/knav_qmss_acc.c
+
+The QMSS (Queue Manager Sub System) found on Keystone SOCs is one of
+the main hardware sub system which forms the backbone of the Keystone
+multi-core Navigator. QMSS consist of queue managers, packed-data structure
+processors(PDSP), linking RAM, descriptor pools and infrastructure
+Packet DMA.
+The Queue Manager is a hardware module that is responsible for accelerating
+management of the packet queues. Packets are queued/de-queued by writing or
+reading descriptor address to a particular memory mapped location. The PDSPs
+perform QMSS related functions like accumulation, QoS, or event management.
+Linking RAM registers are used to link the descriptors which are stored in
+descriptor RAM. Descriptor RAM is configurable as internal or external memory.
+The QMSS driver manages the PDSP setups, linking RAM regions,
+queue pool management (allocation, push, pop and notify) and descriptor
+pool management.
+
+knav qmss driver provides a set of APIs to drivers to open/close qmss queues,
+allocate descriptor pools, map the descriptors, push/pop to queues etc. For
+details of the available APIs, please refers to include/linux/soc/ti/knav_qmss.h
+
+DT documentation is available at
+Documentation/devicetree/bindings/soc/ti/keystone-navigator-qmss.txt
+
+Accumulator QMSS queues using PDSP firmware
+============================================
+The QMSS PDSP firmware support accumulator channel that can monitor a single
+queue or multiple contiguous queues. drivers/soc/ti/knav_qmss_acc.c is the
+driver that interface with the accumulator PDSP. This configures
+accumulator channels defined in DTS (example in DT documentation) to monitor
+1 or 32 queues per channel. More description on the firmware is available in
+CPPI/QMSS Low Level Driver document (docs/CPPI_QMSS_LLD_SDS.pdf) at
+       git://git.ti.com/keystone-rtos/qmss-lld.git
+
+k2_qmss_pdsp_acc48_k2_le_1_0_0_9.bin firmware supports upto 48 accumulator
+channels. This firmware is available under ti-keystone folder of
+firmware.git at
+   git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
+
+To use copy the firmware image to lib/firmware folder of the initramfs or
+ubifs file system and provide a sym link to k2_qmss_pdsp_acc48_k2_le_1_0_0_9.bin
+in the file system and boot up the kernel. User would see
+
+ "firmware file ks2_qmss_pdsp_acc48.bin downloaded for PDSP"
+
+in the boot up log if loading of firmware to PDSP is successful.
+
+Use of accumulated queues requires the firmware image to be present in the
+file system. The driver doesn't acc queues to the supported queue range if
+PDSP is not running in the SoC. The API call fails if there is a queue open
+request to an acc queue and PDSP is not running. So make sure to copy firmware
+to file system before using these queue types.
index 5e38e1582f9545a6c82d0252baa4841e91a577d3..430d279a8df374883f5038d0f86961843928f2a7 100644 (file)
@@ -25,7 +25,7 @@ SunXi family
         + Datasheet
           http://dl.linux-sunxi.org/A10s/A10s%20Datasheet%20-%20v1.20%20%282012-03-27%29.pdf
 
-      - Allwinner A13 (sun5i)
+      - Allwinner A13 / R8 (sun5i)
         + Datasheet
          http://dl.linux-sunxi.org/A13/A13%20Datasheet%20-%20v1.12%20%282012-03-29%29.pdf
         + User Manual
index 973884a1bacff8b9619b07f708367bf664fe7673..1dfee20eee744efa2ec7cc248475501f4ae84cb7 100644 (file)
@@ -9,6 +9,12 @@ Boards with the Amlogic Meson8 SoC shall have the following properties:
   Required root node property:
     compatible: "amlogic,meson8";
 
+Boards with the Amlogic Meson8b SoC shall have the following properties:
+  Required root node property:
+    compatible: "amlogic,meson8b";
+
 Board compatible values:
-  - "geniatech,atv1200"
-  - "minix,neo-x8"
+  - "geniatech,atv1200" (Meson6)
+  - "minix,neo-x8" (Meson8)
+  - "tronfy,mxq" (Meson8b)
+  - "hardkernel,odroid-c1" (Meson8b)
diff --git a/Documentation/devicetree/bindings/arm/apm/scu.txt b/Documentation/devicetree/bindings/arm/apm/scu.txt
new file mode 100644 (file)
index 0000000..b45be06
--- /dev/null
@@ -0,0 +1,17 @@
+APM X-GENE SoC series SCU Registers
+
+This system clock unit contain various register that control block resets,
+clock enable/disables, clock divisors and other deepsleep registers.
+
+Properties:
+ - compatible : should contain two values. First value must be:
+                  - "apm,xgene-scu"
+               second value must be always "syscon".
+
+ - reg : offset and length of the register set.
+
+Example :
+       scu: system-clk-controller@17000000 {
+               compatible = "apm,xgene-scu","syscon";
+               reg = <0x0 0x17000000 0x0 0x400>;
+       };
diff --git a/Documentation/devicetree/bindings/arm/arm,scpi.txt b/Documentation/devicetree/bindings/arm/arm,scpi.txt
new file mode 100644 (file)
index 0000000..86302de
--- /dev/null
@@ -0,0 +1,188 @@
+System Control and Power Interface (SCPI) Message Protocol
+----------------------------------------------------------
+
+Firmware implementing the SCPI described in ARM document number ARM DUI 0922B
+("ARM Compute Subsystem SCP: Message Interface Protocols")[0] can be used
+by Linux to initiate various system control and power operations.
+
+Required properties:
+
+- compatible : should be "arm,scpi"
+- mboxes: List of phandle and mailbox channel specifiers
+         All the channels reserved by remote SCP firmware for use by
+         SCPI message protocol should be specified in any order
+- shmem : List of phandle pointing to the shared memory(SHM) area between the
+         processors using these mailboxes for IPC, one for each mailbox
+         SHM can be any memory reserved for the purpose of this communication
+         between the processors.
+
+See Documentation/devicetree/bindings/mailbox/mailbox.txt
+for more details about the generic mailbox controller and
+client driver bindings.
+
+Clock bindings for the clocks based on SCPI Message Protocol
+------------------------------------------------------------
+
+This binding uses the common clock binding[1].
+
+Container Node
+==============
+Required properties:
+- compatible : should be "arm,scpi-clocks"
+              All the clocks provided by SCP firmware via SCPI message
+              protocol much be listed as sub-nodes under this node.
+
+Sub-nodes
+=========
+Required properties:
+- compatible : shall include one of the following
+       "arm,scpi-dvfs-clocks" - all the clocks that are variable and index based.
+               These clocks don't provide an entire range of values between the
+               limits but only discrete points within the range. The firmware
+               provides the mapping for each such operating frequency and the
+               index associated with it. The firmware also manages the
+               voltage scaling appropriately with the clock scaling.
+       "arm,scpi-variable-clocks" - all the clocks that are variable and provide full
+               range within the specified range. The firmware provides the
+               range of values within a specified range.
+
+Other required properties for all clocks(all from common clock binding):
+- #clock-cells : Should be 1. Contains the Clock ID value used by SCPI commands.
+- clock-output-names : shall be the corresponding names of the outputs.
+- clock-indices: The identifying number for the clocks(i.e.clock_id) in the
+       node. It can be non linear and hence provide the mapping of identifiers
+       into the clock-output-names array.
+
+SRAM and Shared Memory for SCPI
+-------------------------------
+
+A small area of SRAM is reserved for SCPI communication between application
+processors and SCP.
+
+Required properties:
+- compatible : should be "arm,juno-sram-ns" for Non-secure SRAM on Juno
+
+The rest of the properties should follow the generic mmio-sram description
+found in ../../misc/sysram.txt
+
+Each sub-node represents the reserved area for SCPI.
+
+Required sub-node properties:
+- reg : The base offset and size of the reserved area with the SRAM
+- compatible : should be "arm,juno-scp-shmem" for Non-secure SRAM based
+              shared memory on Juno platforms
+
+Sensor bindings for the sensors based on SCPI Message Protocol
+--------------------------------------------------------------
+SCPI provides an API to access the various sensors on the SoC.
+
+Required properties:
+- compatible : should be "arm,scpi-sensors".
+- #thermal-sensor-cells: should be set to 1. This property follows the
+                        thermal device tree bindings[2].
+
+                        Valid cell values are raw identifiers (Sensor
+                        ID) as used by the firmware. Refer to
+                        platform documentation for your
+                        implementation for the IDs to use. For Juno
+                        R0 and Juno R1 refer to [3].
+
+[0] http://infocenter.arm.com/help/topic/com.arm.doc.dui0922b/index.html
+[1] Documentation/devicetree/bindings/clock/clock-bindings.txt
+[2] Documentation/devicetree/bindings/thermal/thermal.txt
+[3] http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0922b/apas03s22.html
+
+Example:
+
+sram: sram@50000000 {
+       compatible = "arm,juno-sram-ns", "mmio-sram";
+       reg = <0x0 0x50000000 0x0 0x10000>;
+
+       #address-cells = <1>;
+       #size-cells = <1>;
+       ranges = <0 0x0 0x50000000 0x10000>;
+
+       cpu_scp_lpri: scp-shmem@0 {
+               compatible = "arm,juno-scp-shmem";
+               reg = <0x0 0x200>;
+       };
+
+       cpu_scp_hpri: scp-shmem@200 {
+               compatible = "arm,juno-scp-shmem";
+               reg = <0x200 0x200>;
+       };
+};
+
+mailbox: mailbox0@40000000 {
+       ....
+       #mbox-cells = <1>;
+};
+
+scpi_protocol: scpi@2e000000 {
+       compatible = "arm,scpi";
+       mboxes = <&mailbox 0 &mailbox 1>;
+       shmem = <&cpu_scp_lpri &cpu_scp_hpri>;
+
+       clocks {
+               compatible = "arm,scpi-clocks";
+
+               scpi_dvfs: scpi_clocks@0 {
+                       compatible = "arm,scpi-dvfs-clocks";
+                       #clock-cells = <1>;
+                       clock-indices = <0>, <1>, <2>;
+                       clock-output-names = "atlclk", "aplclk","gpuclk";
+               };
+               scpi_clk: scpi_clocks@3 {
+                       compatible = "arm,scpi-variable-clocks";
+                       #clock-cells = <1>;
+                       clock-indices = <3>, <4>;
+                       clock-output-names = "pxlclk0", "pxlclk1";
+               };
+       };
+
+       scpi_sensors0: sensors {
+               compatible = "arm,scpi-sensors";
+               #thermal-sensor-cells = <1>;
+       };
+};
+
+cpu@0 {
+       ...
+       reg = <0 0>;
+       clocks = <&scpi_dvfs 0>;
+};
+
+hdlcd@7ff60000 {
+       ...
+       reg = <0 0x7ff60000 0 0x1000>;
+       clocks = <&scpi_clk 4>;
+};
+
+thermal-zones {
+       soc_thermal {
+               polling-delay-passive = <100>;
+               polling-delay = <1000>;
+
+                               /* sensor         ID */
+               thermal-sensors = <&scpi_sensors0 3>;
+               ...
+       };
+};
+
+In the above example, the #clock-cells is set to 1 as required.
+scpi_dvfs has 3 output clocks namely: atlclk, aplclk, and gpuclk with 0,
+1 and 2 as clock-indices. scpi_clk has 2 output clocks namely: pxlclk0
+and pxlclk1 with 3 and 4 as clock-indices.
+
+The first consumer in the example is cpu@0 and it has '0' as the clock
+specifier which points to the first entry in the output clocks of
+scpi_dvfs i.e. "atlclk".
+
+Similarly the second example is hdlcd@7ff60000 and it has pxlclk1 as input
+clock. '4' in the clock specifier here points to the second entry
+in the output clocks of scpi_clocks  i.e. "pxlclk1"
+
+The thermal-sensors property in the soc_thermal node uses the
+temperature sensor provided by SCP firmware to setup a thermal
+zone. The ID "3" is the sensor identifier for the temperature sensor
+as used by the firmware.
index 430608ec09f0c7fee0dd226fbbc6da570ca5e4cf..0d0c1ae81bedfd4ae07fb746b0b51faedb589a0f 100644 (file)
@@ -20,6 +20,25 @@ system control is required:
     - compatible: "brcm,bcm<chip_id>-hif-cpubiuctrl", "syscon"
     - compatible: "brcm,bcm<chip_id>-hif-continuation", "syscon"
 
+hif-cpubiuctrl node
+-------------------
+SoCs with Broadcom Brahma15 ARM-based CPUs have a specific Bus Interface Unit
+(BIU) block which controls and interfaces the CPU complex to the different
+Memory Controller Ports (MCP), one per memory controller (MEMC). This BIU block
+offers a feature called Write Pairing which consists in collapsing two adjacent
+cache lines into a single (bursted) write transaction towards the memory
+controller (MEMC) to maximize write bandwidth.
+
+Required properties:
+
+    - compatible: must be "brcm,bcm7445-hif-cpubiuctrl", "syscon"
+
+Optional properties:
+
+    - brcm,write-pairing:
+       Boolean property, which when present indicates that the chip
+       supports write-pairing.
+
 example:
     rdb {
         #address-cells = <1>;
@@ -35,6 +54,7 @@ example:
         hif_cpubiuctrl: syscon@3e2400 {
             compatible = "brcm,bcm7445-hif-cpubiuctrl", "syscon";
             reg = <0x3e2400 0x5b4>;
+            brcm,write-pairing;
         };
 
         hif_continuation: syscon@452000 {
@@ -43,8 +63,7 @@ example:
         };
     };
 
-Lastly, nodes that allow for support of SMP initialization and reboot are
-required:
+Nodes that allow for support of SMP initialization and reboot are required:
 
 smpboot
 -------
@@ -95,3 +114,142 @@ example:
         compatible = "brcm,brcmstb-reboot";
         syscon = <&sun_top_ctrl 0x304 0x308>;
     };
+
+
+
+Power management
+----------------
+
+For power management (particularly, S2/S3/S5 system suspend), the following SoC
+components are needed:
+
+= Always-On control block (AON CTRL)
+
+This hardware provides control registers for the "always-on" (even in low-power
+modes) hardware, such as the Power Management State Machine (PMSM).
+
+Required properties:
+- compatible     : should contain "brcm,brcmstb-aon-ctrl"
+- reg            : the register start and length for the AON CTRL block
+
+Example:
+
+aon-ctrl@410000 {
+       compatible = "brcm,brcmstb-aon-ctrl";
+       reg = <0x410000 0x400>;
+};
+
+= Memory controllers
+
+A Broadcom STB SoC typically has a number of independent memory controllers,
+each of which may have several associated hardware blocks, which are versioned
+independently (control registers, DDR PHYs, etc.). One might consider
+describing these controllers as a parent "memory controllers" block, which
+contains N sub-nodes (one for each controller in the system), each of which is
+associated with a number of hardware register resources (e.g., its PHY). See
+the example device tree snippet below.
+
+== MEMC (MEMory Controller)
+
+Represents a single memory controller instance.
+
+Required properties:
+- compatible     : should contain "brcm,brcmstb-memc" and "simple-bus"
+
+Should contain subnodes for any of the following relevant hardware resources:
+
+== DDR PHY control
+
+Control registers for this memory controller's DDR PHY.
+
+Required properties:
+- compatible     : should contain one of these
+       "brcm,brcmstb-ddr-phy-v225.1"
+       "brcm,brcmstb-ddr-phy-v240.1"
+       "brcm,brcmstb-ddr-phy-v240.2"
+
+- reg            : the DDR PHY register range
+
+== DDR SHIMPHY
+
+Control registers for this memory controller's DDR SHIMPHY.
+
+Required properties:
+- compatible     : should contain "brcm,brcmstb-ddr-shimphy-v1.0"
+- reg            : the DDR SHIMPHY register range
+
+== MEMC DDR control
+
+Sequencer DRAM parameters and control registers. Used for Self-Refresh
+Power-Down (SRPD), among other things.
+
+Required properties:
+- compatible     : should contain "brcm,brcmstb-memc-ddr"
+- reg            : the MEMC DDR register range
+
+Example:
+
+memory_controllers {
+       ranges;
+       compatible = "simple-bus";
+
+       memc@0 {
+               compatible = "brcm,brcmstb-memc", "simple-bus";
+               ranges;
+
+               ddr-phy@f1106000 {
+                       compatible = "brcm,brcmstb-ddr-phy-v240.1";
+                       reg = <0xf1106000 0x21c>;
+               };
+
+               shimphy@f1108000 {
+                       compatible = "brcm,brcmstb-ddr-shimphy-v1.0";
+                       reg = <0xf1108000 0xe4>;
+               };
+
+               memc-ddr@f1102000 {
+                       reg = <0xf1102000 0x800>;
+                       compatible = "brcm,brcmstb-memc-ddr";
+               };
+       };
+
+       memc@1 {
+               compatible = "brcm,brcmstb-memc", "simple-bus";
+               ranges;
+
+               ddr-phy@f1186000 {
+                       compatible = "brcm,brcmstb-ddr-phy-v240.1";
+                       reg = <0xf1186000 0x21c>;
+               };
+
+               shimphy@f1188000 {
+                       compatible = "brcm,brcmstb-ddr-shimphy-v1.0";
+                       reg = <0xf1188000 0xe4>;
+               };
+
+               memc-ddr@f1182000 {
+                       reg = <0xf1182000 0x800>;
+                       compatible = "brcm,brcmstb-memc-ddr";
+               };
+       };
+
+       memc@2 {
+               compatible = "brcm,brcmstb-memc", "simple-bus";
+               ranges;
+
+               ddr-phy@f1206000 {
+                       compatible = "brcm,brcmstb-ddr-phy-v240.1";
+                       reg = <0xf1206000 0x21c>;
+               };
+
+               shimphy@f1208000 {
+                       compatible = "brcm,brcmstb-ddr-shimphy-v1.0";
+                       reg = <0xf1208000 0xe4>;
+               };
+
+               memc-ddr@f1202000 {
+                       reg = <0xf1202000 0x800>;
+                       compatible = "brcm,brcmstb-memc-ddr";
+               };
+       };
+};
diff --git a/Documentation/devicetree/bindings/arm/bcm/brcm,nsp.txt b/Documentation/devicetree/bindings/arm/bcm/brcm,nsp.txt
new file mode 100644 (file)
index 0000000..eae53e4
--- /dev/null
@@ -0,0 +1,34 @@
+Broadcom Northstar Plus device tree bindings
+--------------------------------------------
+
+Broadcom Northstar Plus family of SoCs are used for switching control
+and management applications as well as residential router/gateway
+applications. The SoC features dual core Cortex A9 ARM CPUs, integrating
+several peripheral interfaces including multiple Gigabit Ethernet PHYs,
+DDR3 memory, PCIE Gen-2, USB 2.0 and USB 3.0, serial and NAND flash,
+SATA and several other IO controllers.
+
+Boards with Northstar Plus SoCs shall have the following properties:
+
+Required root node property:
+
+BCM58522
+compatible = "brcm,bcm58522", "brcm,nsp";
+
+BCM58525
+compatible = "brcm,bcm58525", "brcm,nsp";
+
+BCM58535
+compatible = "brcm,bcm58535", "brcm,nsp";
+
+BCM58622
+compatible = "brcm,bcm58622", "brcm,nsp";
+
+BCM58623
+compatible = "brcm,bcm58623", "brcm,nsp";
+
+BCM58625
+compatible = "brcm,bcm58625", "brcm,nsp";
+
+BCM88312
+compatible = "brcm,bcm88312", "brcm,nsp";
index 8dd46617c889afa3f05f1e578ddc34bc76d94cc8..9b5c3f620e65ea348ac57eed59a63c1c61d2e3a0 100644 (file)
@@ -27,6 +27,11 @@ Required properties:
  * For "marvell,armada-380-coherency-fabric", only one pair is needed
    for the per-CPU fabric registers.
 
+Optional properties:
+
+- broken-idle: boolean to set when the Idle mode is not supported by the
+  hardware.
+
 Examples:
 
 coherency-fabric@d0020200 {
index 91e6e5c478d006245c5a88e7ae7e304d6fa7f097..3a07a87fef2087550cb24f0c4aff5f8e2fecab21 100644 (file)
@@ -195,6 +195,8 @@ nodes to be present and contain the properties described below.
                            "marvell,armada-380-smp"
                            "marvell,armada-390-smp"
                            "marvell,armada-xp-smp"
+                           "mediatek,mt6589-smp"
+                           "mediatek,mt81xx-tz-smp"
                            "qcom,gcc-msm8660"
                            "qcom,kpss-acc-v1"
                            "qcom,kpss-acc-v2"
diff --git a/Documentation/devicetree/bindings/arm/exynos/power_domain.txt b/Documentation/devicetree/bindings/arm/exynos/power_domain.txt
deleted file mode 100644 (file)
index e151057..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-* Samsung Exynos Power Domains
-
-Exynos processors include support for multiple power domains which are used
-to gate power to one or more peripherals on the processor.
-
-Required Properties:
-- compatible: should be one of the following.
-    * samsung,exynos4210-pd - for exynos4210 type power domain.
-- reg: physical base address of the controller and length of memory mapped
-    region.
-- #power-domain-cells: number of cells in power domain specifier;
-    must be 0.
-
-Optional Properties:
-- clocks: List of clock handles. The parent clocks of the input clocks to the
-       devices in this power domain are set to oscclk before power gating
-       and restored back after powering on a domain. This is required for
-       all domains which are powered on and off and not required for unused
-       domains.
-- clock-names: The following clocks can be specified:
-       - oscclk: Oscillator clock.
-       - clkN: Input clocks to the devices in this power domain. These clocks
-               will be reparented to oscclk before swithing power domain off.
-               Their original parent will be brought back after turning on
-               the domain. Maximum of 4 clocks (N = 0 to 3) are supported.
-       - asbN: Clocks required by asynchronous bridges (ASB) present in
-               the power domain. These clock should be enabled during power
-               domain on/off operations.
-- power-domains: phandle pointing to the parent power domain, for more details
-                see Documentation/devicetree/bindings/power/power_domain.txt
-
-Node of a device using power domains must have a power-domains property
-defined with a phandle to respective power domain.
-
-Example:
-
-       lcd0: power-domain-lcd0 {
-               compatible = "samsung,exynos4210-pd";
-               reg = <0x10023C00 0x10>;
-               #power-domain-cells = <0>;
-       };
-
-       mfc_pd: power-domain@10044060 {
-               compatible = "samsung,exynos4210-pd";
-               reg = <0x10044060 0x20>;
-               clocks = <&clock CLK_FIN_PLL>, <&clock CLK_MOUT_SW_ACLK333>,
-                       <&clock CLK_MOUT_USER_ACLK333>;
-               clock-names = "oscclk", "pclk0", "clk0";
-               #power-domain-cells = <0>;
-       };
-
-See Documentation/devicetree/bindings/power/power_domain.txt for description
-of consumer-side bindings.
index 2a3ba73f0c5cc3da965315c1aa0f49acb1a7541a..34c88b0c7ab48cb20c828da2ad054a53c5d5ca9e 100644 (file)
@@ -128,10 +128,18 @@ Example:
                reg = <0x0 0x1ee0000 0x0 0x10000>;
        };
 
-Freescale LS2085A SoC Device Tree Bindings
-------------------------------------------
+Freescale ARMv8 based Layerscape SoC family Device Tree Bindings
+----------------------------------------------------------------
 
-LS2085A ARMv8 based Simulator model
+LS2080A ARMv8 based Simulator model
 Required root node properties:
-    - compatible = "fsl,ls2085a-simu", "fsl,ls2085a";
+    - compatible = "fsl,ls2080a-simu", "fsl,ls2080a";
+
+LS2080A ARMv8 based QDS Board
+Required root node properties:
+    - compatible = "fsl,ls2080a-qds", "fsl,ls2080a";
+
+LS2080A ARMv8 based RDB Board
+Required root node properties:
+    - compatible = "fsl,ls2080a-rdb", "fsl,ls2080a";
 
index 764c738bb3baf0bd12f8d4c9567b2bf2836b5c6e..6ac7c000af2257ba16bc2101f4549c917a38025e 100644 (file)
@@ -20,6 +20,10 @@ HiKey Board
 Required root node properties:
        - compatible = "hisilicon,hi6220-hikey", "hisilicon,hi6220";
 
+HiP05 D02 Board
+Required root node properties:
+       - compatible = "hisilicon,hip05-d02";
+
 Hisilicon system controller
 
 Required properties:
index 59d7a46f85eb59ae0e33f217c98c0277fd7182b9..3090a8a008c03ed61cfb42b94d2cf36f3b5756ed 100644 (file)
@@ -9,12 +9,26 @@ Required properties:
    the form "ti,keystone-*". Generic devices like gic, arch_timers, ns16550
    type UART should use the specified compatible for those devices.
 
+SoC families:
+
+- Keystone 2 generic SoC:
+   compatible = "ti,keystone"
+
+SoCs:
+
+- Keystone 2 Hawking/Kepler
+   compatible = "ti,k2hk", "ti,keystone"
+- Keystone 2 Lamarr
+   compatible = "ti,k2l", "ti,keystone"
+- Keystone 2 Edison
+   compatible = "ti,k2e", "ti,keystone"
+
 Boards:
 -  Keystone 2 Hawking/Kepler EVM
-   compatible = "ti,k2hk-evm","ti,keystone"
+   compatible = "ti,k2hk-evm", "ti,k2hk", "ti,keystone"
 
 -  Keystone 2 Lamarr EVM
-   compatible = "ti,k2l-evm","ti,keystone"
+   compatible = "ti,k2l-evm", "ti, k2l", "ti,keystone"
 
 -  Keystone 2 Edison EVM
-   compatible = "ti,k2e-evm","ti,keystone"
+   compatible = "ti,k2e-evm", "ti,k2e", "ti,keystone"
diff --git a/Documentation/devicetree/bindings/arm/mvebu-cpu-config.txt b/Documentation/devicetree/bindings/arm/mvebu-cpu-config.txt
new file mode 100644 (file)
index 0000000..2cdcd71
--- /dev/null
@@ -0,0 +1,20 @@
+MVEBU CPU Config registers
+--------------------------
+
+MVEBU (Marvell SOCs: Armada 370/XP)
+
+Required properties:
+
+- compatible: one of:
+       - "marvell,armada-370-cpu-config"
+       - "marvell,armada-xp-cpu-config"
+
+- reg: Should contain CPU config registers location and length, in
+  their per-CPU variant
+
+Example:
+
+       cpu-config@21000 {
+               compatible = "marvell,armada-xp-cpu-config";
+               reg = <0x21000 0x8>;
+       };
index 4b7c3d9b29bbf33327a832f2712f4f7bd1a101b7..97ba45af04fc693f831c00f15f9388df864434a6 100644 (file)
@@ -7,6 +7,7 @@ representation in the device tree should be done as under:-
 Required properties:
 
 - compatible : should be one of
+       "apm,potenza-pmu"
        "arm,armv8-pmuv3"
        "arm.cortex-a57-pmu"
        "arm.cortex-a53-pmu"
index 5aa40ede0e99337d9c66b4b45ccf2cb7c1cd0e93..a9adab84e2feb78596ef9e0b74b3d440c9cf4ff0 100644 (file)
@@ -31,6 +31,10 @@ Main node required properties:
                                        support, but are permitted to be present for compatibility with
                                        existing software when "arm,psci" is later in the compatible list.
 
+                               * "arm,psci-1.0" : for implementations complying to PSCI 1.0. PSCI 1.0 is
+                                       backward compatible with PSCI 0.2 with minor specification updates,
+                                       as defined in the PSCI specification[2].
+
  - method        : The method of calling the PSCI firmware. Permitted
                    values are:
 
@@ -100,3 +104,5 @@ Case 3: PSCI v0.2 and PSCI v0.1.
 
 [1] Kernel documentation - ARM idle states bindings
     Documentation/devicetree/bindings/arm/idle-states.txt
+[2] Power State Coordination Interface (PSCI) specification
+    http://infocenter.arm.com/help/topic/com.arm.doc.den0022c/DEN0022C_Power_State_Coordination_Interface.pdf
index af58cd74aeff55cc4f62a30f3ca217e8fda064d3..8e985dd2f181e11c3a28d10e9284924e24d74eb4 100644 (file)
@@ -17,6 +17,10 @@ Rockchip platforms device tree bindings
     Required root node properties:
       - compatible = "radxa,rock", "rockchip,rk3188";
 
+- Radxa Rock2 Square board:
+    Required root node properties:
+      - compatible = "radxa,rock2-square", "rockchip,rk3288";
+
 - Firefly Firefly-RK3288 board:
     Required root node properties:
       - compatible = "firefly,firefly-rk3288", "rockchip,rk3288";
@@ -31,6 +35,13 @@ Rockchip platforms device tree bindings
     Required root node properties:
       - compatible = "netxeon,r89", "rockchip,rk3288";
 
+- Google Jaq (Haier Chromebook 11 and more):
+    Required root node properties:
+      - compatible = "google,veyron-jaq-rev5", "google,veyron-jaq-rev4",
+                    "google,veyron-jaq-rev3", "google,veyron-jaq-rev2",
+                    "google,veyron-jaq-rev1", "google,veyron-jaq",
+                    "google,veyron", "rockchip,rk3288";
+
 - Google Jerry (Hisense Chromebook C11 and more):
     Required root node properties:
       - compatible = "google,veyron-jerry-rev7", "google,veyron-jerry-rev6",
diff --git a/Documentation/devicetree/bindings/arm/samsung-boards.txt b/Documentation/devicetree/bindings/arm/samsung-boards.txt
deleted file mode 100644 (file)
index 43589d2..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-* Samsung's Exynos SoC based boards
-
-Required root node properties:
-    - compatible = should be one or more of the following.
-       - "samsung,monk"        - for Exynos3250-based Samsung Simband board.
-       - "samsung,rinato"      - for Exynos3250-based Samsung Gear2 board.
-       - "samsung,smdkv310"    - for Exynos4210-based Samsung SMDKV310 eval board.
-       - "samsung,trats"       - for Exynos4210-based Tizen Reference board.
-       - "samsung,universal_c210" - for Exynos4210-based Samsung board.
-       - "samsung,smdk4412",   - for Exynos4412-based Samsung SMDK4412 eval board.
-       - "samsung,trats2"      - for Exynos4412-based Tizen Reference board.
-       - "samsung,smdk5250"    - for Exynos5250-based Samsung SMDK5250 eval board.
-       - "samsung,xyref5260"   - for Exynos5260-based Samsung board.
-       - "samsung,smdk5410"    - for Exynos5410-based Samsung SMDK5410 eval board.
-       - "samsung,smdk5420"    - for Exynos5420-based Samsung SMDK5420 eval board.
-       - "samsung,sd5v1"       - for Exynos5440-based Samsung board.
-       - "samsung,ssdk5440"    - for Exynos5440-based Samsung board.
-
-Optional:
-    - firmware node, specifying presence and type of secure firmware:
-        - compatible: only "samsung,secure-firmware" is currently supported
-        - reg: address of non-secure SYSRAM used for communication with firmware
-
-       firmware@0203F000 {
-               compatible = "samsung,secure-firmware";
-               reg = <0x0203F000 0x1000>;
-       };
diff --git a/Documentation/devicetree/bindings/arm/samsung/samsung-boards.txt b/Documentation/devicetree/bindings/arm/samsung/samsung-boards.txt
new file mode 100644 (file)
index 0000000..12129c0
--- /dev/null
@@ -0,0 +1,69 @@
+* Samsung's Exynos SoC based boards
+
+Required root node properties:
+    - compatible = should be one or more of the following.
+       - "samsung,monk"        - for Exynos3250-based Samsung Simband board.
+       - "samsung,rinato"      - for Exynos3250-based Samsung Gear2 board.
+       - "samsung,smdkv310"    - for Exynos4210-based Samsung SMDKV310 eval board.
+       - "samsung,trats"       - for Exynos4210-based Tizen Reference board.
+       - "samsung,universal_c210" - for Exynos4210-based Samsung board.
+       - "samsung,smdk4412",   - for Exynos4412-based Samsung SMDK4412 eval board.
+       - "samsung,trats2"      - for Exynos4412-based Tizen Reference board.
+       - "samsung,smdk5250"    - for Exynos5250-based Samsung SMDK5250 eval board.
+       - "samsung,xyref5260"   - for Exynos5260-based Samsung board.
+       - "samsung,smdk5410"    - for Exynos5410-based Samsung SMDK5410 eval board.
+       - "samsung,smdk5420"    - for Exynos5420-based Samsung SMDK5420 eval board.
+       - "samsung,sd5v1"       - for Exynos5440-based Samsung board.
+       - "samsung,ssdk5440"    - for Exynos5440-based Samsung board.
+
+* Other companies Exynos SoC based
+  * FriendlyARM
+       - "friendlyarm,tiny4412"  - for Exynos4412-based FriendlyARM
+                                   TINY4412 board.
+
+  * Google
+       - "google,pi"           - for Exynos5800-based Google Peach Pi
+                                 Rev 10+ board,
+         also: "google,pi-rev16", "google,pi-rev15", "google,pi-rev14",
+               "google,pi-rev13", "google,pi-rev12", "google,pi-rev11",
+               "google,pi-rev10", "google,peach".
+
+       - "google,pit"          - for Exynos5420-based Google Peach Pit
+                                 Rev 6+ (Exynos5420),
+         also: "google,pit-rev16", "google,pit-rev15", "google,pit-rev14",
+               "google,pit-rev13", "google,pit-rev12", "google,pit-rev11",
+               "google,pit-rev10", "google,pit-rev9", "google,pit-rev8",
+               "google,pit-rev7", "google,pit-rev6", "google,peach".
+
+       - "google,snow-rev4"    - for Exynos5250-based Google Snow board,
+         also: "google,snow"
+       - "google,snow-rev5"    - for Exynos5250-based Google Snow
+                                 Rev 5+ board.
+       - "google,spring"       - for Exynos5250-based Google Spring board.
+
+  * Hardkernel
+       - "hardkernel,odroid-u3"  - for Exynos4412-based Hardkernel Odroid U3.
+       - "hardkernel,odroid-x"   - for Exynos4412-based Hardkernel Odroid X.
+       - "hardkernel,odroid-x2"  - for Exynos4412-based Hardkernel Odroid X2.
+       - "hardkernel,odroid-xu3" - for Exynos5422-based Hardkernel Odroid XU3.
+       - "hardkernel,odroid-xu3-lite" - for Exynos5422-based Hardkernel
+                                        Odroid XU3 Lite board.
+       - "hardkernel,odroid-xu4" - for Exynos5422-based Hardkernel Odroid XU4.
+
+  * Insignal
+       - "insignal,arndale"      - for Exynos5250-based Insignal Arndale board.
+       - "insignal,arndale-octa" - for Exynos5420-based Insignal Arndale
+                                   Octa board.
+       - "insignal,origen"       - for Exynos4210-based Insignal Origen board.
+       - "insignal,origen4412    - for Exynos4412-based Insignal Origen board.
+
+
+Optional nodes:
+    - firmware node, specifying presence and type of secure firmware:
+        - compatible: only "samsung,secure-firmware" is currently supported
+        - reg: address of non-secure SYSRAM used for communication with firmware
+
+       firmware@0203F000 {
+               compatible = "samsung,secure-firmware";
+               reg = <0x0203F000 0x1000>;
+       };
index c4f19b2e7dd95c1022a43ebe2b764a6c58f26062..40bb9007cd0d034a2cb45468db16a566af0277e3 100644 (file)
@@ -39,8 +39,6 @@ Boards:
     compatible = "renesas,armadillo800eva"
   - BOCK-W
     compatible = "renesas,bockw", "renesas,r8a7778"
-  - BOCK-W - Reference Device Tree Implementation
-    compatible = "renesas,bockw-reference", "renesas,r8a7778"
   - Genmai (RTK772100BC00000BR)
     compatible = "renesas,genmai", "renesas,r7s72100"
   - Gose
@@ -57,7 +55,7 @@ Boards:
     compatible = "renesas,lager", "renesas,r8a7790"
   - Marzen
     compatible = "renesas,marzen", "renesas,r8a7779"
-
-Note: Reference Device Tree Implementations are temporary implementations
-      to ease the migration from platform devices to Device Tree, and are
-      intended to be removed in the future.
+  - Porter (M2-LCDP)
+    compatible = "renesas,porter", "renesas,r8a7791"
+  - SILK (RTP0RC7794LCB00011S)
+    compatible = "renesas,silk", "renesas,r8a7794"
index 67da20539540cc4e7725deac8748e70fcce357a5..bb9b0faa919d098309c9eb22289f8cef3b995d9b 100644 (file)
@@ -6,6 +6,7 @@ using one of the following compatible strings:
   allwinner,sun4i-a10
   allwinner,sun5i-a10s
   allwinner,sun5i-a13
+  allwinner,sun5i-r8
   allwinner,sun6i-a31
   allwinner,sun7i-a20
   allwinner,sun8i-a23
diff --git a/Documentation/devicetree/bindings/arm/uniphier/cache-uniphier.txt b/Documentation/devicetree/bindings/arm/uniphier/cache-uniphier.txt
new file mode 100644 (file)
index 0000000..d27a646
--- /dev/null
@@ -0,0 +1,60 @@
+UniPhier outer cache controller
+
+UniPhier SoCs are integrated with a full-custom outer cache controller system.
+All of them have a level 2 cache controller, and some have a level 3 cache
+controller as well.
+
+Required properties:
+- compatible: should be "socionext,uniphier-system-cache"
+- reg: offsets and lengths of the register sets for the device.  It should
+  contain 3 regions: control register, revision register, operation register,
+  in this order.
+- cache-unified: specifies the cache is a unified cache.
+- cache-size: specifies the size in bytes of the cache
+- cache-sets: specifies the number of associativity sets of the cache
+- cache-line-size: specifies the line size in bytes
+- cache-level: specifies the level in the cache hierarchy.  The value should
+  be 2 for L2 cache, 3 for L3 cache, etc.
+
+Optional properties:
+- next-level-cache: phandle to the next level cache if present.  The next level
+  cache should be also compatible with "socionext,uniphier-system-cache".
+
+The L2 cache must exist to use the L3 cache; the cache hierarchy must be
+indicated correctly with "next-level-cache" properties.
+
+Example 1 (system with L2):
+       l2: l2-cache@500c0000 {
+               compatible = "socionext,uniphier-system-cache";
+               reg = <0x500c0000 0x2000>, <0x503c0100 0x4>,
+                     <0x506c0000 0x400>;
+               cache-unified;
+               cache-size = <0x80000>;
+               cache-sets = <256>;
+               cache-line-size = <128>;
+               cache-level = <2>;
+       };
+
+Example 2 (system with L2 and L3):
+       l2: l2-cache@500c0000 {
+               compatible = "socionext,uniphier-system-cache";
+               reg = <0x500c0000 0x2000>, <0x503c0100 0x8>,
+                     <0x506c0000 0x400>;
+               cache-unified;
+               cache-size = <0x200000>;
+               cache-sets = <512>;
+               cache-line-size = <128>;
+               cache-level = <2>;
+               next-level-cache = <&l3>;
+       };
+
+       l3: l3-cache@500c8000 {
+               compatible = "socionext,uniphier-system-cache";
+               reg = <0x500c8000 0x2000>, <0x503c8100 0x8>,
+                     <0x506c8000 0x400>;
+               cache-unified;
+               cache-size = <0x400000>;
+               cache-sets = <512>;
+               cache-line-size = <256>;
+               cache-level = <3>;
+       };
diff --git a/Documentation/devicetree/bindings/board/fsl-board.txt b/Documentation/devicetree/bindings/board/fsl-board.txt
new file mode 100644 (file)
index 0000000..fb7b03e
--- /dev/null
@@ -0,0 +1,112 @@
+Freescale Reference Board Bindings
+
+This document describes device tree bindings for various devices that
+exist on some Freescale reference boards.
+
+* Board Control and Status (BCSR)
+
+Required properties:
+
+ - compatible : Should be "fsl,<board>-bcsr"
+ - reg : Offset and length of the register set for the device
+
+Example:
+
+       bcsr@f8000000 {
+               compatible = "fsl,mpc8360mds-bcsr";
+               reg = <f8000000 8000>;
+       };
+
+* Freescale on-board FPGA
+
+This is the memory-mapped registers for on board FPGA.
+
+Required properties:
+- compatible: should be a board-specific string followed by a string
+  indicating the type of FPGA.  Example:
+       "fsl,<board>-fpga", "fsl,fpga-pixis", or
+       "fsl,<board>-fpga", "fsl,fpga-qixis"
+- reg: should contain the address and the length of the FPGA register set.
+
+Optional properties:
+- interrupt-parent: should specify phandle for the interrupt controller.
+- interrupts: should specify event (wakeup) IRQ.
+
+Example (P1022DS):
+
+        board-control@3,0 {
+                compatible = "fsl,p1022ds-fpga", "fsl,fpga-ngpixis";
+                reg = <3 0 0x30>;
+                interrupt-parent = <&mpic>;
+                interrupts = <8 8 0 0>;
+        };
+
+Example (LS2080A-RDB):
+
+        cpld@3,0 {
+                compatible = "fsl,ls2080ardb-fpga", "fsl,fpga-qixis";
+                reg = <0x3 0 0x10000>;
+        };
+
+* Freescale BCSR GPIO banks
+
+Some BCSR registers act as simple GPIO controllers, each such
+register can be represented by the gpio-controller node.
+
+Required properities:
+- compatible : Should be "fsl,<board>-bcsr-gpio".
+- reg : Should contain the address and the length of the GPIO bank
+  register.
+- #gpio-cells : Should be two. The first cell is the pin number and the
+  second cell is used to specify optional parameters (currently unused).
+- gpio-controller : Marks the port as GPIO controller.
+
+Example:
+
+       bcsr@1,0 {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "fsl,mpc8360mds-bcsr";
+               reg = <1 0 0x8000>;
+               ranges = <0 1 0 0x8000>;
+
+               bcsr13: gpio-controller@d {
+                       #gpio-cells = <2>;
+                       compatible = "fsl,mpc8360mds-bcsr-gpio";
+                       reg = <0xd 1>;
+                       gpio-controller;
+               };
+       };
+
+* Freescale on-board FPGA connected on I2C bus
+
+Some Freescale boards like BSC9132QDS have on board FPGA connected on
+the i2c bus.
+
+Required properties:
+- compatible: Should be a board-specific string followed by a string
+  indicating the type of FPGA.  Example:
+       "fsl,<board>-fpga", "fsl,fpga-qixis-i2c"
+- reg: Should contain the address of the FPGA
+
+Example:
+       fpga: fpga@66 {
+               compatible = "fsl,bsc9132qds-fpga", "fsl,fpga-qixis-i2c";
+               reg = <0x66>;
+       };
+
+* Freescale on-board CPLD
+
+Some Freescale boards like T1040RDB have an on board CPLD connected.
+
+Required properties:
+- compatible: Should be a board-specific string like "fsl,<board>-cpld"
+  Example:
+       "fsl,t1040rdb-cpld", "fsl,t1042rdb-cpld", "fsl,t1042rdb_pi-cpld"
+- reg: should describe CPLD registers
+
+Example:
+       cpld@3,0 {
+               compatible = "fsl,t1040rdb-cpld";
+               reg = <3 0 0x300>;
+       };
diff --git a/Documentation/devicetree/bindings/bus/sunxi-rsb.txt b/Documentation/devicetree/bindings/bus/sunxi-rsb.txt
new file mode 100644 (file)
index 0000000..3dd2834
--- /dev/null
@@ -0,0 +1,47 @@
+Allwinner Reduced Serial Bus (RSB) controller
+
+The RSB controller found on later Allwinner SoCs is an SMBus like 2 wire
+serial bus with 1 master and up to 15 slaves. It is represented by a node
+for the controller itself, and child nodes representing the slave devices.
+
+Required properties :
+
+ - reg             : Offset and length of the register set for the controller.
+ - compatible      : Shall be "allwinner,sun8i-a23-rsb".
+ - interrupts      : The interrupt line associated to the RSB controller.
+ - clocks          : The gate clk associated to the RSB controller.
+ - resets          : The reset line associated to the RSB controller.
+ - #address-cells  : shall be 1
+ - #size-cells     : shall be 0
+
+Optional properties :
+
+ - clock-frequency : Desired RSB bus clock frequency in Hz. Maximum is 20MHz.
+                    If not set this defaults to 3MHz.
+
+Child nodes:
+
+An RSB controller node can contain zero or more child nodes representing
+slave devices on the bus.  Child 'reg' properties should contain the slave
+device's hardware address. The hardware address is hardwired in the device,
+which can normally be found in the datasheet.
+
+Example:
+
+       rsb@01f03400 {
+               compatible = "allwinner,sun8i-a23-rsb";
+               reg = <0x01f03400 0x400>;
+               interrupts = <0 39 4>;
+               clocks = <&apb0_gates 3>;
+               clock-frequency = <3000000>;
+               resets = <&apb0_rst 3>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               pmic@3e3 {
+                       compatible = "...";
+                       reg = <0x3e3>;
+
+                       /* ... */
+               };
+       };
index 54c23f34f194608c34c01f1ecb6ae9be58e11704..152dfaab2575dc92b7d8ae97ce49282704219a6e 100644 (file)
@@ -18,10 +18,14 @@ Required properties :
 - #clock-cells : shall contain 1
 - #reset-cells : shall contain 1
 
+Optional properties :
+- #power-domain-cells : shall contain 1
+
 Example:
        clock-controller@900000 {
                compatible = "qcom,gcc-msm8960";
                reg = <0x900000 0x4000>;
                #clock-cells = <1>;
                #reset-cells = <1>;
+               #power-domain-cells = <1>;
        };
index 29ebf84d25af9b3832d17bb3b7f3fdc9bdd9fba2..34e7614d5074a0e5e32eeaff53b2ac8d237b23a3 100644 (file)
@@ -14,10 +14,14 @@ Required properties :
 - #clock-cells : shall contain 1
 - #reset-cells : shall contain 1
 
+Optional properties :
+- #power-domain-cells : shall contain 1
+
 Example:
        clock-controller@4000000 {
                compatible = "qcom,mmcc-msm8960";
                reg = <0x4000000 0x1000>;
                #clock-cells = <1>;
                #reset-cells = <1>;
+               #power-domain-cells = <1>;
        };
index 805ddcd79a572df79ad39978c27353f9ac6b7f3e..f2455c50533d6c7388ebfacbe572d164e5d11314 100644 (file)
@@ -1,9 +1,9 @@
-* Freescale MPC512x/MPC8xxx GPIO controller
+* Freescale MPC512x/MPC8xxx/Layerscape GPIO controller
 
 Required properties:
 - compatible : Should be "fsl,<soc>-gpio"
   The following <soc>s are known to be supported:
-    mpc5121, mpc5125, mpc8349, mpc8572, mpc8610, pq3, qoriq
+    mpc5121, mpc5125, mpc8349, mpc8572, mpc8610, pq3, qoriq.
 - reg : Address and length of the register set for the device
 - interrupts : Should be the port interrupt shared by all 32 pins.
 - #gpio-cells : Should be two.  The first cell is the pin number and
index 610757ce449213aa03765b1c476785433c1afa24..c6d533202d3e3a1a12eee650fe17125d48e5963f 100644 (file)
@@ -3,10 +3,35 @@ Bindings for a fan connected to the PWM lines
 Required properties:
 - compatible   : "pwm-fan"
 - pwms         : the PWM that is used to control the PWM fan
+- cooling-levels      : PWM duty cycle values in a range from 0 to 255
+                       which correspond to thermal cooling states
 
 Example:
-       pwm-fan {
+       fan0: pwm-fan {
                compatible = "pwm-fan";
-               status = "okay";
+               cooling-min-state = <0>;
+               cooling-max-state = <3>;
+               #cooling-cells = <2>;
                pwms = <&pwm 0 10000 0>;
+               cooling-levels = <0 102 170 230>;
        };
+
+       thermal-zones {
+               cpu_thermal: cpu-thermal {
+                            thermal-sensors = <&tmu 0>;
+                            polling-delay-passive = <0>;
+                            polling-delay = <0>;
+                            trips {
+                                       cpu_alert1: cpu-alert1 {
+                                                   temperature = <100000>; /* millicelsius */
+                                                   hysteresis = <2000>; /* millicelsius */
+                                                   type = "passive";
+                                       };
+                            };
+                            cooling-maps {
+                                       map0 {
+                                                   trip = <&cpu_alert1>;
+                                                   cooling-device = <&fan0 0 1>;
+                                       };
+                            };
+               };
index a4e1cbc810c19e43f83a273bdb2f11e334bb5fe0..5b123e0e4cc240bdf5c911bede1e71447ded7544 100644 (file)
@@ -1,10 +1,10 @@
-* Texas Instruments Davinci I2C
+* Texas Instruments Davinci/Keystone I2C
 
 This file provides information, what the device node for the
-davinci i2c interface contain.
+davinci/keystone i2c interface contains.
 
 Required properties:
-- compatible: "ti,davinci-i2c";
+- compatible: "ti,davinci-i2c" or "ti,keystone-i2c";
 - reg : Offset and length of the register set for the device
 
 Recommended properties :
index ce4311d726ae5e4a414e6240cc8832e876a9c24e..eab5836ba7f98a10dedeb8d30b997cc45470944d 100644 (file)
@@ -14,6 +14,10 @@ Optional properties:
   The absence of the propoerty indicates the default frequency 100 kHz.
 - dmas: A list of two dma specifiers, one for each entry in dma-names.
 - dma-names: should contain "tx" and "rx".
+- scl-gpios: specify the gpio related to SCL pin
+- sda-gpios: specify the gpio related to SDA pin
+- pinctrl: add extra pinctrl to configure i2c pins to gpio function for i2c
+  bus recovery, call it "gpio" state
 
 Examples:
 
@@ -37,4 +41,9 @@ i2c0: i2c@40066000 { /* i2c0 on vf610 */
        dmas = <&edma0 0 50>,
                <&edma0 0 51>;
        dma-names = "rx","tx";
+       pinctrl-names = "default", "gpio";
+       pinctrl-0 = <&pinctrl_i2c1>;
+       pinctrl-1 = <&pinctrl_i2c1_gpio>;
+       scl-gpios = <&gpio5 26 GPIO_ACTIVE_HIGH>;
+       sda-gpios = <&gpio5 27 GPIO_ACTIVE_HIGH>;
 };
index 16b3e07aa98fdd7b2795f783775f8e2501a6a443..ea406eb20fa5ad117b3590cd88c6f1fa13253c2a 100644 (file)
@@ -10,6 +10,7 @@ Required properties:
        "renesas,i2c-r8a7792"
        "renesas,i2c-r8a7793"
        "renesas,i2c-r8a7794"
+       "renesas,i2c-r8a7795"
 - reg: physical base address of the controller and length of memory mapped
   region.
 - interrupts: interrupt specifier.
index 2bfc6e7ed0947304e45d8ca0b2dadcea3cb838ee..214f94c25d370bd408396a82c84c6ecd963cc195 100644 (file)
@@ -10,6 +10,7 @@ Required properties:
                        - "renesas,iic-r8a7792" (R-Car V2H)
                        - "renesas,iic-r8a7793" (R-Car M2-N)
                        - "renesas,iic-r8a7794" (R-Car E2)
+                       - "renesas,iic-r8a7795" (R-Car H3)
                        - "renesas,iic-sh73a0" (SH-Mobile AG5)
 - reg             : address start and address range size of device
 - interrupts      : interrupt of device
diff --git a/Documentation/devicetree/bindings/i2c/i2c-uniphier-f.txt b/Documentation/devicetree/bindings/i2c/i2c-uniphier-f.txt
new file mode 100644 (file)
index 0000000..27fc6f8
--- /dev/null
@@ -0,0 +1,25 @@
+UniPhier I2C controller (FIFO-builtin)
+
+Required properties:
+- compatible: should be "socionext,uniphier-fi2c".
+- #address-cells: should be 1.
+- #size-cells: should be 0.
+- reg: offset and length of the register set for the device.
+- interrupts: a single interrupt specifier.
+- clocks: phandle to the input clock.
+
+Optional properties:
+- clock-frequency: desired I2C bus frequency in Hz.  The maximum supported
+  value is 400000.  Defaults to 100000 if not specified.
+
+Examples:
+
+       i2c0: i2c@58780000 {
+               compatible = "socionext,uniphier-fi2c";
+               reg = <0x58780000 0x80>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+               interrupts = <0 41 4>;
+               clocks = <&i2c_clk>;
+               clock-frequency = <100000>;
+       };
diff --git a/Documentation/devicetree/bindings/i2c/i2c-uniphier.txt b/Documentation/devicetree/bindings/i2c/i2c-uniphier.txt
new file mode 100644 (file)
index 0000000..26f9d95
--- /dev/null
@@ -0,0 +1,25 @@
+UniPhier I2C controller (FIFO-less)
+
+Required properties:
+- compatible: should be "socionext,uniphier-i2c".
+- #address-cells: should be 1.
+- #size-cells: should be 0.
+- reg: offset and length of the register set for the device.
+- interrupts: a single interrupt specifier.
+- clocks: phandle to the input clock.
+
+Optional properties:
+- clock-frequency: desired I2C bus frequency in Hz.  The maximum supported
+  value is 400000.  Defaults to 100000 if not specified.
+
+Examples:
+
+       i2c0: i2c@58400000 {
+               compatible = "socionext,uniphier-i2c";
+               reg = <0x58400000 0x40>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+               interrupts = <0 41 1>;
+               clocks = <&i2c_clk>;
+               clock-frequency = <100000>;
+       };
index 729543c470468e57c816cf411da17677db16fe35..bc620fe32a707375113f50d7f7b386967f0f29e0 100644 (file)
@@ -47,7 +47,7 @@ Required properties:
 - clocks: Required if the System MMU is needed to gate its clock.
 - power-domains: Required if the System MMU is needed to gate its power.
          Please refer to the following document:
-         Documentation/devicetree/bindings/arm/exynos/power_domain.txt
+         Documentation/devicetree/bindings/power/pd-samsung.txt
 
 Examples:
        gsc_0: gsc@13e00000 {
index e6df32f9986df16fd2d25939827fc0213b7aebd1..22b77ee02f58340eca67c7566553a391e11d8461 100644 (file)
@@ -1,8 +1,9 @@
-* Device tree bindings for ARM PL172 MultiPort Memory Controller
+* Device tree bindings for ARM PL172/PL175/PL176 MultiPort Memory Controller
 
 Required properties:
 
-- compatible:          "arm,pl172", "arm,primecell"
+- compatible:          Must be "arm,primecell" and exactly one from
+                       "arm,pl172", "arm,pl175" or "arm,pl176".
 
 - reg:                 Must contains offset/length value for controller.
 
@@ -56,7 +57,8 @@ Optional child cs node config properties:
 
 - mpmc,extended-wait:  Enable extended wait.
 
-- mpmc,buffer-enable:  Enable write buffer.
+- mpmc,buffer-enable:  Enable write buffer, option is not supported by
+                       PL175 and PL176 controllers.
 
 - mpmc,write-protect:  Enable write protect.
 
index c64b7925cd0924e84a9486a6ec27b8421d0782b9..9f78e6c82740cc89ed9556e111a91ad104fe5138 100644 (file)
@@ -24,9 +24,9 @@ Required properties:
 Optional properties:
   - interrupts: Must contain a list of interrupt specifiers for memory
                controller interrupts, if available.
-  - interrupts-names: Must contain a list of interrupt names corresponding to
-                     the interrupts in the interrupts property, if available.
-                     Valid interrupt names are:
+  - interrupt-names: Must contain a list of interrupt names corresponding to
+                    the interrupts in the interrupts property, if available.
+                    Valid interrupt names are:
                        - "sec" (secure interrupt)
                        - "temp" (normal (temperature) interrupt)
   - power-domains: Must contain a reference to the PM domain that the memory
index a42adda944bf146c382f71009884c755f10df87b..09b94c97faaccf1914253bf54a514dad9867a1cb 100644 (file)
@@ -22,6 +22,10 @@ Optional properties:
 - samsung,s2mps11-wrstbi-ground: Indicates that WRSTBI pin of PMIC is pulled
   down. When the system is suspended it will always go down thus triggerring
   unwanted buck warm reset (setting buck voltages to default values).
+- samsung,s2mps11-acokb-ground: Indicates that ACOKB pin of S2MPS11 PMIC is
+  connected to the ground so the PMIC must manually set PWRHOLD bit in CTRL1
+  register to turn off the power. Usually the ACOKB is pulled up to VBATT so
+  when PWRHOLD pin goes low, the rising ACOKB will trigger power off.
 
 Optional nodes:
 - clocks: s2mps11, s2mps13, s2mps15 and s5m8767 provide three(AP/CP/BT) buffered 32.768
index 4efca560adda4b22f0498f123f053650e4427da5..9853f8e7096613e990c28cc545b39ab7f26afddc 100644 (file)
@@ -48,6 +48,11 @@ Optional properties:
 - mac-address          : See ethernet.txt file in the same directory
 - phy-handle           : See ethernet.txt file in the same directory
 
+Slave sub-nodes:
+- fixed-link           : See fixed-link.txt file in the same directory
+                         Either the properties phy_id and phy-mode,
+                         or the sub-node fixed-link can be specified
+
 Note: "ti,hwmods" field is used to fetch the base address and irq
 resources from TI, omap hwmod data base during device registration.
 Future plan is to migrate hwmod data base contents into device tree
diff --git a/Documentation/devicetree/bindings/pci/arm,juno-r1-pcie.txt b/Documentation/devicetree/bindings/pci/arm,juno-r1-pcie.txt
new file mode 100644 (file)
index 0000000..f7514c1
--- /dev/null
@@ -0,0 +1,10 @@
+* ARM Juno R1 PCIe interface
+
+This PCIe host controller is based on PLDA XpressRICH3-AXI IP
+and thus inherits all the common properties defined in plda,xpressrich3-axi.txt
+as well as the base properties defined in host-generic-pci.txt.
+
+Required properties:
+ - compatible: "arm,juno-r1-pcie"
+ - dma-coherent: The host controller bridges the AXI transactions into PCIe bus
+   in a manner that makes the DMA operations to appear coherent to the CPUs.
diff --git a/Documentation/devicetree/bindings/pci/plda,xpressrich3-axi.txt b/Documentation/devicetree/bindings/pci/plda,xpressrich3-axi.txt
new file mode 100644 (file)
index 0000000..f3f75bf
--- /dev/null
@@ -0,0 +1,12 @@
+* PLDA XpressRICH3-AXI host controller
+
+The PLDA XpressRICH3-AXI host controller can be configured in a manner that
+makes it compliant with the SBSA[1] standard published by ARM Ltd. For those
+scenarios, the host-generic-pci.txt bindings apply with the following additions
+to the compatible property:
+
+Required properties:
+ - compatible: should contain "plda,xpressrich3-axi" to identify the IP used.
+
+
+[1] http://infocenter.arm.com/help/topic/com.arm.doc.den0029a/
diff --git a/Documentation/devicetree/bindings/power/pd-samsung.txt b/Documentation/devicetree/bindings/power/pd-samsung.txt
new file mode 100644 (file)
index 0000000..4e94737
--- /dev/null
@@ -0,0 +1,52 @@
+* Samsung Exynos Power Domains
+
+Exynos processors include support for multiple power domains which are used
+to gate power to one or more peripherals on the processor.
+
+Required Properties:
+- compatible: should be one of the following.
+    * samsung,exynos4210-pd - for exynos4210 type power domain.
+- reg: physical base address of the controller and length of memory mapped
+    region.
+- #power-domain-cells: number of cells in power domain specifier;
+    must be 0.
+
+Optional Properties:
+- clocks: List of clock handles. The parent clocks of the input clocks to the
+       devices in this power domain are set to oscclk before power gating
+       and restored back after powering on a domain. This is required for
+       all domains which are powered on and off and not required for unused
+       domains.
+- clock-names: The following clocks can be specified:
+       - oscclk: Oscillator clock.
+       - clkN: Input clocks to the devices in this power domain. These clocks
+               will be reparented to oscclk before swithing power domain off.
+               Their original parent will be brought back after turning on
+               the domain. Maximum of 4 clocks (N = 0 to 3) are supported.
+       - asbN: Clocks required by asynchronous bridges (ASB) present in
+               the power domain. These clock should be enabled during power
+               domain on/off operations.
+- power-domains: phandle pointing to the parent power domain, for more details
+                see Documentation/devicetree/bindings/power/power_domain.txt
+
+Node of a device using power domains must have a power-domains property
+defined with a phandle to respective power domain.
+
+Example:
+
+       lcd0: power-domain-lcd0 {
+               compatible = "samsung,exynos4210-pd";
+               reg = <0x10023C00 0x10>;
+               #power-domain-cells = <0>;
+       };
+
+       mfc_pd: power-domain@10044060 {
+               compatible = "samsung,exynos4210-pd";
+               reg = <0x10044060 0x20>;
+               clocks = <&clock CLK_FIN_PLL>, <&clock CLK_MOUT_USER_ACLK333>;
+               clock-names = "oscclk", "clk0";
+               #power-domain-cells = <0>;
+       };
+
+See Documentation/devicetree/bindings/power/power_domain.txt for description
+of consumer-side bindings.
diff --git a/Documentation/devicetree/bindings/powerpc/fsl/board.txt b/Documentation/devicetree/bindings/powerpc/fsl/board.txt
deleted file mode 100644 (file)
index cff38bd..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-Freescale Reference Board Bindings
-
-This document describes device tree bindings for various devices that
-exist on some Freescale reference boards.
-
-* Board Control and Status (BCSR)
-
-Required properties:
-
- - compatible : Should be "fsl,<board>-bcsr"
- - reg : Offset and length of the register set for the device
-
-Example:
-
-       bcsr@f8000000 {
-               compatible = "fsl,mpc8360mds-bcsr";
-               reg = <f8000000 8000>;
-       };
-
-* Freescale on-board FPGA
-
-This is the memory-mapped registers for on board FPGA.
-
-Required properities:
-- compatible: should be a board-specific string followed by a string
-  indicating the type of FPGA.  Example:
-       "fsl,<board>-fpga", "fsl,fpga-pixis"
-- reg: should contain the address and the length of the FPGA register set.
-- interrupt-parent: should specify phandle for the interrupt controller.
-- interrupts: should specify event (wakeup) IRQ.
-
-Example (P1022DS):
-
-        board-control@3,0 {
-                compatible = "fsl,p1022ds-fpga", "fsl,fpga-ngpixis";
-                reg = <3 0 0x30>;
-                interrupt-parent = <&mpic>;
-                interrupts = <8 8 0 0>;
-        };
-
-* Freescale BCSR GPIO banks
-
-Some BCSR registers act as simple GPIO controllers, each such
-register can be represented by the gpio-controller node.
-
-Required properities:
-- compatible : Should be "fsl,<board>-bcsr-gpio".
-- reg : Should contain the address and the length of the GPIO bank
-  register.
-- #gpio-cells : Should be two. The first cell is the pin number and the
-  second cell is used to specify optional parameters (currently unused).
-- gpio-controller : Marks the port as GPIO controller.
-
-Example:
-
-       bcsr@1,0 {
-               #address-cells = <1>;
-               #size-cells = <1>;
-               compatible = "fsl,mpc8360mds-bcsr";
-               reg = <1 0 0x8000>;
-               ranges = <0 1 0 0x8000>;
-
-               bcsr13: gpio-controller@d {
-                       #gpio-cells = <2>;
-                       compatible = "fsl,mpc8360mds-bcsr-gpio";
-                       reg = <0xd 1>;
-                       gpio-controller;
-               };
-       };
-
-* Freescale on-board FPGA connected on I2C bus
-
-Some Freescale boards like BSC9132QDS have on board FPGA connected on
-the i2c bus.
-
-Required properties:
-- compatible: Should be a board-specific string followed by a string
-  indicating the type of FPGA.  Example:
-       "fsl,<board>-fpga", "fsl,fpga-qixis-i2c"
-- reg: Should contain the address of the FPGA
-
-Example:
-       fpga: fpga@66 {
-               compatible = "fsl,bsc9132qds-fpga", "fsl,fpga-qixis-i2c";
-               reg = <0x66>;
-       };
-
-* Freescale on-board CPLD
-
-Some Freescale boards like T1040RDB have an on board CPLD connected.
-
-Required properties:
-- compatible: Should be a board-specific string like "fsl,<board>-cpld"
-  Example:
-       "fsl,t1040rdb-cpld", "fsl,t1042rdb-cpld", "fsl,t1042rdb_pi-cpld"
-- reg: should describe CPLD registers
-
-Example:
-       cpld@3,0 {
-               compatible = "fsl,t1040rdb-cpld";
-               reg = <3 0 0x300>;
-       };
index c0511142b39cc44aa29694f3d0c7f732efe08f66..a6c8afc8385a79787f4ce4b999a7f2ea69ae9613 100644 (file)
@@ -17,9 +17,9 @@ Required properties:
 - reg: Address range of the SCPSYS unit
 - infracfg: must contain a phandle to the infracfg controller
 - clock, clock-names: clocks according to the common clock binding.
-                      The clocks needed "mm" and "mfg". These are the
-                     clocks which hardware needs to be enabled before
-                     enabling certain power domains.
+                      The clocks needed "mm", "mfg", "venc" and "venc_lt".
+                     These are the clocks which hardware needs to be enabled
+                     before enabling certain power domains.
 
 Example:
 
@@ -30,7 +30,9 @@ Example:
                infracfg = <&infracfg>;
                clocks = <&clk26m>,
                         <&topckgen CLK_TOP_MM_SEL>;
-               clock-names = "mfg", "mm";
+                        <&topckgen CLK_TOP_VENC_SEL>,
+                        <&topckgen CLK_TOP_VENC_LT_SEL>;
+               clock-names = "mfg", "mm", "venc", "venc_lt";
        };
 
 Example consumer:
diff --git a/Documentation/devicetree/bindings/soc/qcom/qcom,smem.txt b/Documentation/devicetree/bindings/soc/qcom/qcom,smem.txt
new file mode 100644 (file)
index 0000000..9326cdf
--- /dev/null
@@ -0,0 +1,57 @@
+Qualcomm Shared Memory Manager binding
+
+This binding describes the Qualcomm Shared Memory Manager, used to share data
+between various subsystems and OSes in Qualcomm platforms.
+
+- compatible:
+       Usage: required
+       Value type: <stringlist>
+       Definition: must be:
+                   "qcom,smem"
+
+- memory-region:
+       Usage: required
+       Value type: <prop-encoded-array>
+       Definition: handle to memory reservation for main SMEM memory region.
+
+- qcom,rpm-msg-ram:
+       Usage: required
+       Value type: <prop-encoded-array>
+       Definition: handle to RPM message memory resource
+
+- hwlocks:
+       Usage: required
+       Value type: <prop-encoded-array>
+       Definition: reference to a hwspinlock used to protect allocations from
+                   the shared memory
+
+= EXAMPLE
+The following example shows the SMEM setup for MSM8974, with a main SMEM region
+at 0xfa00000 and the RPM message ram at 0xfc428000:
+
+       reserved-memory {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges;
+
+               smem_region: smem@fa00000 {
+                       reg = <0xfa00000 0x200000>;
+                       no-map;
+               };
+       };
+
+       smem@fa00000 {
+               compatible = "qcom,smem";
+
+               memory-region = <&smem_region>;
+               qcom,rpm-msg-ram = <&rpm_msg_ram>;
+
+               hwlocks = <&tcsr_mutex 3>;
+       };
+
+       soc {
+               rpm_msg_ram: memory@fc428000 {
+                       compatible = "qcom,rpm-msg-ram";
+                       reg = <0xfc428000 0x4000>;
+               };
+       };
diff --git a/Documentation/devicetree/bindings/soc/rockchip/power_domain.txt b/Documentation/devicetree/bindings/soc/rockchip/power_domain.txt
new file mode 100644 (file)
index 0000000..112756e
--- /dev/null
@@ -0,0 +1,46 @@
+* Rockchip Power Domains
+
+Rockchip processors include support for multiple power domains which can be
+powered up/down by software based on different application scenes to save power.
+
+Required properties for power domain controller:
+- compatible: Should be one of the following.
+       "rockchip,rk3288-power-controller" - for RK3288 SoCs.
+- #power-domain-cells: Number of cells in a power-domain specifier.
+       Should be 1 for multiple PM domains.
+- #address-cells: Should be 1.
+- #size-cells: Should be 0.
+
+Required properties for power domain sub nodes:
+- reg: index of the power domain, should use macros in:
+       "include/dt-bindings/power/rk3288-power.h" - for RK3288 type power domain.
+- clocks (optional): phandles to clocks which need to be enabled while power domain
+       switches state.
+
+Example:
+
+       power: power-controller {
+               compatible = "rockchip,rk3288-power-controller";
+               #power-domain-cells = <1>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               pd_gpu {
+                       reg = <RK3288_PD_GPU>;
+                       clocks = <&cru ACLK_GPU>;
+               };
+       };
+
+Node of a device using power domains must have a power-domains property,
+containing a phandle to the power device node and an index specifying which
+power domain to use.
+The index should use macros in:
+       "include/dt-bindings/power/rk3288-power.h" - for rk3288 type power domain.
+
+Example of the node using power domain:
+
+       node {
+               /* ... */
+               power-domains = <&power RK3288_PD_GPU>;
+               /* ... */
+       };
index d8e8cdb733f96353fb75e4b94917cd6293486ed0..d1ce21a4904dee8aa6f203c3424c047ed247dc14 100644 (file)
@@ -221,7 +221,6 @@ qmss: qmss@2a40000 {
                #size-cells = <1>;
                ranges;
                pdsp0@0x2a10000 {
-                       firmware = "keystone/qmss_pdsp_acc48_k2_le_1_0_0_8.fw";
                        reg = <0x2a10000 0x1000>,
                              <0x2a0f000 0x100>,
                              <0x2a0c000 0x3c8>,
index 53a3029b7589c6b3d6f79c55429b228e4f17d8a0..64083bc5633c136b0cee1424b93d115086609cc0 100644 (file)
@@ -3,10 +3,12 @@ Mediatek MT6577, MT6572 and MT6589 Timers
 
 Required properties:
 - compatible should contain:
-       * "mediatek,mt6589-timer" for MT6589 compatible timers
        * "mediatek,mt6580-timer" for MT6580 compatible timers
-       * "mediatek,mt6577-timer" for all compatible timers (MT6589, MT6580,
-               MT6577)
+       * "mediatek,mt6589-timer" for MT6589 compatible timers
+       * "mediatek,mt8127-timer" for MT8127 compatible timers
+       * "mediatek,mt8135-timer" for MT8135 compatible timers
+       * "mediatek,mt8173-timer" for MT8173 compatible timers
+       * "mediatek,mt6577-timer" for MT6577 and all above compatible timers
 - reg: Should contain location and length for timers register.
 - clocks: Clocks driving the timer hardware. This list should include two
        clocks. The order is system clock and as second clock the RTC clock.
index 9ff48e0defb4651743c25916ed6c7a9d88853042..fb2ad0acedbdbe0db4253b0fe4c2818f13f8ef71 100644 (file)
@@ -1,6 +1,7 @@
 synopsys DWC3 CORE
 
-DWC3- USB3 CONTROLLER
+DWC3- USB3 CONTROLLER. Complies to the generic USB binding properties
+      as described in 'usb/generic.txt'
 
 Required properties:
  - compatible: must be "snps,dwc3"
index 8c6cef73e0d7c4f9e597e060151dff255a429044..55df1d444e9f82c150ef144c02357d13169ead31 100644 (file)
@@ -34,6 +34,7 @@ avago Avago Technologies
 avic   Shanghai AVIC Optoelectronics Co., Ltd.
 axis   Axis Communications AB
 bosch  Bosch Sensortec GmbH
+boundary       Boundary Devices Inc.
 brcm   Broadcom Corporation
 buffalo        Buffalo, Inc.
 calxeda        Calxeda
@@ -171,6 +172,7 @@ pericom     Pericom Technology Inc.
 phytec PHYTEC Messtechnik GmbH
 picochip       Picochip Ltd
 plathome       Plat'Home Co., Ltd.
+plda   PLDA
 pixcir  PIXCIR MICROELECTRONICS Co., Ltd
 pulsedlight    PulsedLight, Inc
 powervr        PowerVR (deprecated, use img)
@@ -228,6 +230,7 @@ toradex     Toradex AG
 toshiba        Toshiba Corporation
 toumaz Toumaz
 tplink TP-LINK Technologies Co., Ltd.
+tronfy Tronfy
 truly  Truly Semiconductors Limited
 upisemi        uPI Semiconductor Corp.
 usi    Universal Scientific Industrial Co., Ltd.
index 1e4a6cc1b6ea8b753836ba2fec7b92e15ec61949..402ab99e409fabb1c8ec8d4ba8b6fd248e295f14 100644 (file)
@@ -1605,16 +1605,16 @@ Documentation/accounting.
 ---------------------------------------------------------------
 When a process is dumped, all anonymous memory is written to a core file as
 long as the size of the core file isn't limited. But sometimes we don't want
-to dump some memory segments, for example, huge shared memory. Conversely,
-sometimes we want to save file-backed memory segments into a core file, not
-only the individual files.
+to dump some memory segments, for example, huge shared memory or DAX.
+Conversely, sometimes we want to save file-backed memory segments into a core
+file, not only the individual files.
 
 /proc/<pid>/coredump_filter allows you to customize which memory segments
 will be dumped when the <pid> process is dumped. coredump_filter is a bitmask
 of memory types. If a bit of the bitmask is set, memory segments of the
 corresponding memory type are dumped, otherwise they are not dumped.
 
-The following 7 memory types are supported:
+The following 9 memory types are supported:
   - (bit 0) anonymous private memory
   - (bit 1) anonymous shared memory
   - (bit 2) file-backed private memory
@@ -1623,20 +1623,22 @@ The following 7 memory types are supported:
             effective only if the bit 2 is cleared)
   - (bit 5) hugetlb private memory
   - (bit 6) hugetlb shared memory
+  - (bit 7) DAX private memory
+  - (bit 8) DAX shared memory
 
   Note that MMIO pages such as frame buffer are never dumped and vDSO pages
   are always dumped regardless of the bitmask status.
 
-  Note bit 0-4 doesn't effect any hugetlb memory. hugetlb memory are only
-  effected by bit 5-6.
+  Note that bits 0-4 don't affect hugetlb or DAX memory. hugetlb memory is
+  only affected by bit 5-6, and DAX is only affected by bits 7-8.
 
-Default value of coredump_filter is 0x23; this means all anonymous memory
-segments and hugetlb private memory are dumped.
+The default value of coredump_filter is 0x33; this means all anonymous memory
+segments, ELF header pages and hugetlb private memory are dumped.
 
 If you don't want to dump all shared memory segments attached to pid 1234,
-write 0x21 to the process's proc file.
+write 0x31 to the process's proc file.
 
-  $ echo 0x21 > /proc/1234/coredump_filter
+  $ echo 0x31 > /proc/1234/coredump_filter
 
 When a new process is created, the process inherits the bitmask status from its
 parent. It is useful to set up coredump_filter before the program runs.
diff --git a/Documentation/hwmon/scpi-hwmon b/Documentation/hwmon/scpi-hwmon
new file mode 100644 (file)
index 0000000..4cfcdf2
--- /dev/null
@@ -0,0 +1,33 @@
+Kernel driver scpi-hwmon
+========================
+
+Supported chips:
+ * Chips based on ARM System Control Processor Interface
+   Addresses scanned: -
+   Datasheet: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0922b/index.html
+
+Author: Punit Agrawal <punit.agrawal@arm.com>
+
+Description
+-----------
+
+This driver supports hardware monitoring for SoC's based on the ARM
+System Control Processor (SCP) implementing the System Control
+Processor Interface (SCPI). The following sensor types are supported
+by the SCP -
+
+  * temperature
+  * voltage
+  * current
+  * power
+
+The SCP interface provides an API to query the available sensors and
+their values which are then exported to userspace by this driver.
+
+Usage Notes
+-----------
+
+The driver relies on device tree node to indicate the presence of SCPI
+support in the kernel. See
+Documentation/devicetree/bindings/arm/arm,scpi.txt for details of the
+devicetree node.
\ No newline at end of file
index 82f48f774afbc3f0ccd429e047455c892f257c69..6a4b1af724f8626c61f04bc2cb47a353f26a4826 100644 (file)
@@ -30,6 +30,8 @@ Supported adapters:
   * Intel BayTrail (SOC)
   * Intel Sunrise Point-H (PCH)
   * Intel Sunrise Point-LP (PCH)
+  * Intel DNV (SOC)
+  * Intel Broxton (SOC)
    Datasheets: Publicly available at the Intel website
 
 On Intel Patsburg and later chipsets, both the normal host SMBus controller
diff --git a/Documentation/kbuild/Kconfig.recursion-issue-01 b/Documentation/kbuild/Kconfig.recursion-issue-01
new file mode 100644 (file)
index 0000000..e8877db
--- /dev/null
@@ -0,0 +1,57 @@
+# Simple Kconfig recursive issue
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+# Test with:
+#
+# make KBUILD_KCONFIG=Documentation/kbuild/Kconfig.recursion-issue-01 allnoconfig
+#
+# This Kconfig file has a simple recursive dependency issue. In order to
+# understand why this recursive dependency issue occurs lets consider what
+# Kconfig needs to address. We iterate over what Kconfig needs to address
+# by stepping through the questions it needs to address sequentially.
+#
+#  * What values are possible for CORE?
+#
+# CORE_BELL_A_ADVANCED selects CORE, which means that it influences the values
+# that are possible for CORE. So for example if CORE_BELL_A_ADVANCED is 'y',
+# CORE must be 'y' too.
+#
+#  * What influences CORE_BELL_A_ADVANCED ?
+#
+# As the name implies CORE_BELL_A_ADVANCED is an advanced feature of
+# CORE_BELL_A so naturally it depends on CORE_BELL_A. So if CORE_BELL_A is 'y'
+# we know CORE_BELL_A_ADVANCED can be 'y' too.
+#
+#   * What influences CORE_BELL_A ?
+#
+# CORE_BELL_A depends on CORE, so CORE influences CORE_BELL_A.
+#
+# But that is a problem, because this means that in order to determine
+# what values are possible for CORE we ended up needing to address questions
+# regarding possible values of CORE itself again. Answering the original
+# question of what are the possible values of CORE would make the kconfig
+# tools run in a loop. When this happens Kconfig exits and complains about
+# the "recursive dependency detected" error.
+#
+# Reading the Documentation/kbuild/Kconfig.recursion-issue-01 file it may be
+# obvious that an easy to solution to this problem should just be the removal
+# of the "select CORE" from CORE_BELL_A_ADVANCED as that is implicit already
+# since CORE_BELL_A depends on CORE. Recursive dependency issues are not always
+# so trivial to resolve, we provide another example below of practical
+# implications of this recursive issue where the solution is perhaps not so
+# easy to understand. Note that matching semantics on the dependency on
+# CORE also consist of a solution to this recursive problem.
+
+mainmenu "Simple example to demo kconfig recursive dependency issue"
+
+config CORE
+       tristate
+
+config CORE_BELL_A
+       tristate
+       depends on CORE
+
+config CORE_BELL_A_ADVANCED
+       tristate
+       depends on CORE_BELL_A
+       select CORE
diff --git a/Documentation/kbuild/Kconfig.recursion-issue-02 b/Documentation/kbuild/Kconfig.recursion-issue-02
new file mode 100644 (file)
index 0000000..b9fd56c
--- /dev/null
@@ -0,0 +1,63 @@
+# Cumulative Kconfig recursive issue
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+# Test with:
+#
+# make KBUILD_KCONFIG=Documentation/kbuild/Kconfig.recursion-issue-02 allnoconfig
+#
+# The recursive limitations with Kconfig has some non intuitive implications on
+# kconfig sematics which are documented here. One known practical implication
+# of the recursive limitation is that drivers cannot negate features from other
+# drivers if they share a common core requirement and use disjoint semantics to
+# annotate those requirements, ie, some drivers use "depends on" while others
+# use "select". For instance it means if a driver A and driver B share the same
+# core requirement, and one uses "select" while the other uses "depends on" to
+# annotate this, all features that driver A selects cannot now be negated by
+# driver B.
+#
+# A perhaps not so obvious implication of this is that, if semantics on these
+# core requirements are not carefully synced, as drivers evolve features
+# they select or depend on end up becoming shared requirements which cannot be
+# negated by other drivers.
+#
+# The example provided in Documentation/kbuild/Kconfig.recursion-issue-02
+# describes a simple driver core layout of example features a kernel might
+# have. Let's assume we have some CORE functionality, then the kernel has a
+# series of bells and whistles it desires to implement, its not so advanced so
+# it only supports bells at this time: CORE_BELL_A and CORE_BELL_B. If
+# CORE_BELL_A has some advanced feature CORE_BELL_A_ADVANCED which selects
+# CORE_BELL_A then CORE_BELL_A ends up becoming a common BELL feature which
+# other bells in the system cannot negate. The reason for this issue is
+# due to the disjoint use of semantics on expressing each bell's relationship
+# with CORE, one uses "depends on" while the other uses "select". Another
+# more important reason is that kconfig does not check for dependencies listed
+# under 'select' for a symbol, when such symbols are selected kconfig them
+# as mandatory required symbols. For more details on the heavy handed nature
+# of select refer to Documentation/kbuild/Kconfig.select-break
+#
+# To fix this the "depends on CORE" must be changed to "select CORE", or the
+# "select CORE" must be changed to "depends on CORE".
+#
+# For an example real world scenario issue refer to the attempt to remove
+# "select FW_LOADER" [0], in the end the simple alternative solution to this
+# problem consisted on matching semantics with newly introduced features.
+#
+# [0] http://lkml.kernel.org/r/1432241149-8762-1-git-send-email-mcgrof@do-not-panic.com
+
+mainmenu "Simple example to demo cumulative kconfig recursive dependency implication"
+
+config CORE
+       tristate
+
+config CORE_BELL_A
+       tristate
+       depends on CORE
+
+config CORE_BELL_A_ADVANCED
+       tristate
+       select CORE_BELL_A
+
+config CORE_BELL_B
+       tristate
+       depends on !CORE_BELL_A
+       select CORE
diff --git a/Documentation/kbuild/Kconfig.select-break b/Documentation/kbuild/Kconfig.select-break
new file mode 100644 (file)
index 0000000..365ceb3
--- /dev/null
@@ -0,0 +1,33 @@
+# Select broken dependency issue
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+# Test with:
+#
+# make KBUILD_KCONFIG=Documentation/kbuild/Kconfig.select-break menuconfig
+#
+# kconfig will not complain and enable this layout for configuration. This is
+# currently a feature of kconfig, given select was designed to be heavy handed.
+# Kconfig currently does not check the list of symbols listed on a symbol's
+# "select" list, this is done on purpose to help load a set of known required
+# symbols. Because of this use of select should be used with caution. An
+# example of this issue is below.
+#
+# The option B and C are clearly contradicting with respect to A.
+# However, when A is set, C can be set as well because Kconfig does not
+# visit the dependencies of the select target (in this case B).  And since
+# Kconfig does not visit the dependencies, it breaks the dependencies of B
+# (!A).
+
+mainmenu "Simple example to demo kconfig select broken dependency issue"
+
+config A
+       bool "CONFIG A"
+
+config B
+       bool "CONFIG B"
+       depends on !A
+
+config C
+       bool "CONFIG C"
+       depends on A
+       select B
index 350f733bf2c7165fd13a960df68bbfebf4a34bf8..c52856da0cad555c7eeecd90c9738fccf941adb2 100644 (file)
@@ -393,3 +393,164 @@ config FOO
        depends on BAR && m
 
 limits FOO to module (=m) or disabled (=n).
+
+Kconfig recursive dependency limitations
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+If you've hit the Kconfig error: "recursive dependency detected" you've run
+into a recursive dependency issue with Kconfig, a recursive dependency can be
+summarized as a circular dependency. The kconfig tools need to ensure that
+Kconfig files comply with specified configuration requirements. In order to do
+that kconfig must determine the values that are possible for all Kconfig
+symbols, this is currently not possible if there is a circular relation
+between two or more Kconfig symbols. For more details refer to the "Simple
+Kconfig recursive issue" subsection below. Kconfig does not do recursive
+dependency resolution; this has a few implications for Kconfig file writers.
+We'll first explain why this issues exists and then provide an example
+technical limitation which this brings upon Kconfig developers. Eager
+developers wishing to try to address this limitation should read the next
+subsections.
+
+Simple Kconfig recursive issue
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Read: Documentation/kbuild/Kconfig.recursion-issue-01
+
+Test with:
+
+make KBUILD_KCONFIG=Documentation/kbuild/Kconfig.recursion-issue-01 allnoconfig
+
+Cumulative Kconfig recursive issue
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Read: Documentation/kbuild/Kconfig.recursion-issue-02
+
+Test with:
+
+make KBUILD_KCONFIG=Documentation/kbuild/Kconfig.recursion-issue-02 allnoconfig
+
+Practical solutions to kconfig recursive issue
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Developers who run into the recursive Kconfig issue have three options
+at their disposal. We document them below and also provide a list of
+historical issues resolved through these different solutions.
+
+  a) Remove any superfluous "select FOO" or "depends on FOO"
+  b) Match dependency semantics:
+       b1) Swap all "select FOO" to "depends on FOO" or,
+       b2) Swap all "depends on FOO" to "select FOO"
+
+The resolution to a) can be tested with the sample Kconfig file
+Documentation/kbuild/Kconfig.recursion-issue-01 through the removal
+of the "select CORE" from CORE_BELL_A_ADVANCED as that is implicit already
+since CORE_BELL_A depends on CORE. At times it may not be possible to remove
+some dependency criteria, for such cases you can work with solution b).
+
+The two different resolutions for b) can be tested in the sample Kconfig file
+Documentation/kbuild/Kconfig.recursion-issue-02.
+
+Below is a list of examples of prior fixes for these types of recursive issues;
+all errors appear to involve one or more select's and one or more "depends on".
+
+commit          fix
+======          ===
+06b718c01208    select A -> depends on A
+c22eacfe82f9    depends on A -> depends on B
+6a91e854442c    select A -> depends on A
+118c565a8f2e    select A -> select B
+f004e5594705    select A -> depends on A
+c7861f37b4c6    depends on A -> (null)
+80c69915e5fb    select A -> (null)              (1)
+c2218e26c0d0    select A -> depends on A        (1)
+d6ae99d04e1c    select A -> depends on A
+95ca19cf8cbf    select A -> depends on A
+8f057d7bca54    depends on A -> (null)
+8f057d7bca54    depends on A -> select A
+a0701f04846e    select A -> depends on A
+0c8b92f7f259    depends on A -> (null)
+e4e9e0540928    select A -> depends on A        (2)
+7453ea886e87    depends on A > (null)           (1)
+7b1fff7e4fdf    select A -> depends on A
+86c747d2a4f0    select A -> depends on A
+d9f9ab51e55e    select A -> depends on A
+0c51a4d8abd6    depends on A -> select A        (3)
+e98062ed6dc4    select A -> depends on A        (3)
+91e5d284a7f1    select A -> (null)
+
+(1) Partial (or no) quote of error.
+(2) That seems to be the gist of that fix.
+(3) Same error.
+
+Future kconfig work
+~~~~~~~~~~~~~~~~~~~
+
+Work on kconfig is welcomed on both areas of clarifying semantics and on
+evaluating the use of a full SAT solver for it. A full SAT solver can be
+desirable to enable more complex dependency mappings and / or queries,
+for instance on possible use case for a SAT solver could be that of handling
+the current known recursive dependency issues. It is not known if this would
+address such issues but such evaluation is desirable. If support for a full SAT
+solver proves too complex or that it cannot address recursive dependency issues
+Kconfig should have at least clear and well defined semantics which also
+addresses and documents limitations or requirements such as the ones dealing
+with recursive dependencies.
+
+Further work on both of these areas is welcomed on Kconfig. We elaborate
+on both of these in the next two subsections.
+
+Semantics of Kconfig
+~~~~~~~~~~~~~~~~~~~~
+
+The use of Kconfig is broad, Linux is now only one of Kconfig's users:
+one study has completed a broad analysis of Kconfig use in 12 projects [0].
+Despite its widespread use, and although this document does a reasonable job
+in documenting basic Kconfig syntax a more precise definition of Kconfig
+semantics is welcomed. One project deduced Kconfig semantics through
+the use of the xconfig configurator [1]. Work should be done to confirm if
+the deduced semantics matches our intended Kconfig design goals.
+
+Having well defined semantics can be useful for tools for practical
+evaluation of depenencies, for instance one such use known case was work to
+express in boolean abstraction of the inferred semantics of Kconfig to
+translate Kconfig logic into boolean formulas and run a SAT solver on this to
+find dead code / features (always inactive), 114 dead features were found in
+Linux using this methodology [1] (Section 8: Threats to validity).
+
+Confirming this could prove useful as Kconfig stands as one of the the leading
+industrial variability modeling languages [1] [2]. Its study would help
+evaluate practical uses of such languages, their use was only theoretical
+and real world requirements were not well understood. As it stands though
+only reverse engineering techniques have been used to deduce semantics from
+variability modeling languages such as Kconfig [3].
+
+[0] http://www.eng.uwaterloo.ca/~shshe/kconfig_semantics.pdf
+[1] http://gsd.uwaterloo.ca/sites/default/files/vm-2013-berger.pdf
+[2] http://gsd.uwaterloo.ca/sites/default/files/ase241-berger_0.pdf
+[3] http://gsd.uwaterloo.ca/sites/default/files/icse2011.pdf
+
+Full SAT solver for Kconfig
+~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Although SAT solvers [0] haven't yet been used by Kconfig directly, as noted in
+the previous subsection, work has been done however to express in boolean
+abstraction the inferred semantics of Kconfig to translate Kconfig logic into
+boolean formulas and run a SAT solver on it [1]. Another known related project
+is CADOS [2] (former VAMOS [3]) and the tools, mainly undertaker [4], which has
+been introduced first with [5].  The basic concept of undertaker is to exract
+variability models from Kconfig, and put them together with a propositional
+formula extracted from CPP #ifdefs and build-rules into a SAT solver in order
+to find dead code, dead files, and dead symbols. If using a SAT solver is
+desirable on Kconfig one approach would be to evaluate repurposing such efforts
+somehow on Kconfig. There is enough interest from mentors of existing projects
+to not only help advise how to integrate this work upstream but also help
+maintain it long term. Interested developers should visit:
+
+http://kernelnewbies.org/KernelProjects/kconfig-sat
+
+[0] http://www.cs.cornell.edu/~sabhar/chapters/SATSolvers-KR-Handbook.pdf
+[1] http://gsd.uwaterloo.ca/sites/default/files/vm-2013-berger.pdf
+[2] https://cados.cs.fau.de
+[3] https://vamos.cs.fau.de
+[4] https://undertaker.cs.fau.de
+[5] https://www4.cs.fau.de/Publications/2011/tartler_11_eurosys.pdf
index 135581f015e1eb4298c063ebd938ccf2ec2cb461..96da119a47e70fefa7844137c13ea33f070dc077 100644 (file)
@@ -596,9 +596,9 @@ skb pointer). All constraints and restrictions from bpf_check_classic() apply
 before a conversion to the new layout is being done behind the scenes!
 
 Currently, the classic BPF format is being used for JITing on most of the
-architectures. Only x86-64 performs JIT compilation from eBPF instruction set,
-however, future work will migrate other JIT compilers as well, so that they
-will profit from the very same benefits.
+architectures. x86-64, aarch64 and s390x perform JIT compilation from eBPF
+instruction set, however, future work will migrate other JIT compilers as well,
+so that they will profit from the very same benefits.
 
 Some core changes of the new internal format:
 
index 05915be862356cf75230851920af5d4738b095b5..2ea4c45cf1c8736ccd577eff75058bb32ed0ca95 100644 (file)
@@ -709,7 +709,7 @@ tcp_limit_output_bytes - INTEGER
        typical pfifo_fast qdiscs.
        tcp_limit_output_bytes limits the number of bytes on qdisc
        or device to reduce artificial RTT/cwnd and reduce bufferbloat.
-       Default: 131072
+       Default: 262144
 
 tcp_challenge_ack_limit - INTEGER
        Limits number of Challenge ACK sent per second, as recommended
index 3352f97430e4e1132f41b19dd2f00ce93b3846e4..13a0b7fb192f080fd8ad300973483eb2f3b37894 100644 (file)
@@ -22,15 +22,10 @@ Typically a SPI master is defined in the arch/.../mach-*/board-*.c as a
 found in include/linux/spi/pxa2xx_spi.h:
 
 struct pxa2xx_spi_master {
-       u32 clock_enable;
        u16 num_chipselect;
        u8 enable_dma;
 };
 
-The "pxa2xx_spi_master.clock_enable" field is used to enable/disable the
-corresponding SSP peripheral block in the "Clock Enable Register (CKEN"). See
-the "PXA2xx Developer Manual" section "Clocks and Power Management".
-
 The "pxa2xx_spi_master.num_chipselect" field is used to determine the number of
 slave device (chips) attached to this SPI master.
 
@@ -57,7 +52,6 @@ static struct resource pxa_spi_nssp_resources[] = {
 };
 
 static struct pxa2xx_spi_master pxa_nssp_master_info = {
-       .clock_enable = CKEN_NSSP, /* NSSP Peripheral clock */
        .num_chipselect = 1, /* Matches the number of chips attached to NSSP */
        .enable_dma = 1, /* Enables NSSP DMA */
 };
index 1a73c20bc400c9b3c1efec2bf4d39b58c7286e34..35fe7ae0492e066cfb716913fe2fa7b7cd2a9256 100644 (file)
@@ -789,6 +789,11 @@ S: Maintained
 F:     drivers/net/appletalk/
 F:     net/appletalk/
 
+APPLIED MICRO (APM) X-GENE DEVICE TREE SUPPORT
+M:     Duc Dang <dhdang@apm.com>
+S:     Supported
+F:     arch/arm64/boot/dts/apm/
+
 APPLIED MICRO (APM) X-GENE SOC ETHERNET DRIVER
 M:     Iyappan Subramanian <isubramanian@apm.com>
 M:     Keyur Chudgar <kchudgar@apm.com>
@@ -920,7 +925,7 @@ M:  Tsahee Zidenberg <tsahee@annapurnalabs.com>
 S:     Maintained
 F:     arch/arm/mach-alpine/
 
-ARM/ATMEL AT91RM9200 AND AT91SAM ARM ARCHITECTURES
+ARM/ATMEL AT91RM9200, AT91SAM9 AND SAMA5 SOC SUPPORT
 M:     Nicolas Ferre <nicolas.ferre@atmel.com>
 M:     Alexandre Belloni <alexandre.belloni@free-electrons.com>
 M:     Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
@@ -1233,6 +1238,13 @@ ARM/LPC18XX ARCHITECTURE
 M:     Joachim Eastwood <manabian@gmail.com>
 L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 S:     Maintained
+F:     arch/arm/boot/dts/lpc43*
+F:     drivers/clk/nxp/clk-lpc18xx*
+F:     drivers/clocksource/time-lpc32xx.c
+F:     drivers/i2c/busses/i2c-lpc2k.c
+F:     drivers/memory/pl172.c
+F:     drivers/mtd/spi-nor/nxp-spifi.c
+F:     drivers/rtc/rtc-lpc24xx.c
 N:     lpc18xx
 
 ARM/MAGICIAN MACHINE SUPPORT
@@ -1455,6 +1467,10 @@ F:       drivers/*/*s3c2410*
 F:     drivers/*/*/*s3c2410*
 F:     drivers/spi/spi-s3c*
 F:     sound/soc/samsung/*
+F:     Documentation/arm/Samsung/
+F:     Documentation/devicetree/bindings/arm/samsung/
+F:     Documentation/devicetree/bindings/sram/samsung-sram.txt
+F:     Documentation/devicetree/bindings/power/pd-samsung.txt
 N:     exynos
 
 ARM/SAMSUNG MOBILE MACHINE SUPPORT
@@ -1509,8 +1525,6 @@ F:        arch/arm/boot/dts/emev2*
 F:     arch/arm/boot/dts/r7s*
 F:     arch/arm/boot/dts/r8a*
 F:     arch/arm/boot/dts/sh*
-F:     arch/arm/configs/bockw_defconfig
-F:     arch/arm/configs/marzen_defconfig
 F:     arch/arm/configs/shmobile_defconfig
 F:     arch/arm/include/debug/renesas-scif.S
 F:     arch/arm/mach-shmobile/
@@ -1625,7 +1639,10 @@ M:       Masahiro Yamada <yamada.masahiro@socionext.com>
 L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 S:     Maintained
 F:     arch/arm/boot/dts/uniphier*
+F:     arch/arm/include/asm/hardware/cache-uniphier.h
 F:     arch/arm/mach-uniphier/
+F:     arch/arm/mm/cache-uniphier.c
+F:     drivers/i2c/busses/i2c-uniphier*
 F:     drivers/pinctrl/uniphier/
 F:     drivers/tty/serial/8250/8250_uniphier.c
 N:     uniphier
@@ -2387,19 +2404,27 @@ L:      linux-scsi@vger.kernel.org
 S:     Supported
 F:     drivers/scsi/bnx2i/
 
-BROADCOM CYGNUS/IPROC ARM ARCHITECTURE
+BROADCOM IPROC ARM ARCHITECTURE
 M:     Ray Jui <rjui@broadcom.com>
 M:     Scott Branden <sbranden@broadcom.com>
+M:     Jon Mason <jonmason@broadcom.com>
 L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 L:     bcm-kernel-feedback-list@broadcom.com
 T:     git git://github.com/broadcom/cygnus-linux.git
 S:     Maintained
 N:     iproc
 N:     cygnus
+N:     nsp
 N:     bcm9113*
 N:     bcm9583*
-N:     bcm583*
+N:     bcm9585*
+N:     bcm9586*
+N:     bcm988312
 N:     bcm113*
+N:     bcm583*
+N:     bcm585*
+N:     bcm586*
+N:     bcm88312
 
 BROADCOM BRCMSTB GPIO DRIVER
 M:     Gregory Fong <gregory.0xf0@gmail.com>
@@ -5163,6 +5188,7 @@ S:        Maintained
 F:     Documentation/devicetree/bindings/i2c/
 F:     Documentation/i2c/
 F:     drivers/i2c/
+F:     drivers/i2c/*/
 F:     include/linux/i2c.h
 F:     include/linux/i2c-*.h
 F:     include/uapi/linux/i2c.h
@@ -6968,7 +6994,7 @@ F:        Documentation/hwmon/menf21bmc
 METAG ARCHITECTURE
 M:     James Hogan <james.hogan@imgtec.com>
 L:     linux-metag@vger.kernel.org
-S:     Supported
+S:     Odd Fixes
 F:     arch/metag/
 F:     Documentation/metag/
 F:     Documentation/devicetree/bindings/metag/
@@ -8418,12 +8444,6 @@ M:       "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
 S:     Maintained
 F:     drivers/pnp/
 
-PNXxxxx I2C DRIVER
-M:     Vitaly Wool <vitalywool@gmail.com>
-L:     linux-i2c@vger.kernel.org
-S:     Maintained
-F:     drivers/i2c/busses/i2c-pnx.c
-
 PPP PROTOCOL DRIVERS AND COMPRESSORS
 M:     Paul Mackerras <paulus@samba.org>
 L:     linux-ppp@vger.kernel.org
@@ -9351,6 +9371,16 @@ W:       http://www.sunplus.com
 S:     Supported
 F:     arch/score/
 
+SYSTEM CONTROL & POWER INTERFACE (SCPI) Message Protocol drivers
+M:     Sudeep Holla <sudeep.holla@arm.com>
+L:     linux-arm-kernel@lists.infradead.org
+S:     Maintained
+F:     Documentation/devicetree/bindings/arm/arm,scpi.txt
+F:     drivers/clk/clk-scpi.c
+F:     drivers/cpufreq/scpi-cpufreq.c
+F:     drivers/firmware/arm_scpi.c
+F:     include/linux/scpi_protocol.h
+
 SCSI CDROM DRIVER
 M:     Jens Axboe <axboe@kernel.dk>
 L:     linux-scsi@vger.kernel.org
index 69be581e7c7ac9fdc2323230d241e1b6ced31f80..26de6c3298b1284c8971b47ec9271ea5d3adf90f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1077,6 +1077,9 @@ PHONY += kselftest
 kselftest:
        $(Q)$(MAKE) -C tools/testing/selftests run_tests
 
+kselftest-clean:
+       $(Q)$(MAKE) -C tools/testing/selftests clean
+
 # ---------------------------------------------------------------------------
 # Modules
 
@@ -1284,6 +1287,7 @@ help:
        @echo  '  kselftest       - Build and run kernel selftest (run as root)'
        @echo  '                    Build, install, and boot kernel before'
        @echo  '                    running kselftest on it'
+       @echo  '  kselftest-clean - Remove all generated kselftest files'
        @echo  ''
        @echo  'Kernel packaging:'
        @$(MAKE) $(build)=$(package-dir) help
index 9246bd7cc3cf063d06c1d9c8b6513d33870ca11c..0365cbbc917989853d87b8a84c8409ae268d6e33 100644 (file)
@@ -621,28 +621,6 @@ config ARCH_PXA
        help
          Support for Intel/Marvell's PXA2xx/PXA3xx processor line.
 
-config ARCH_SHMOBILE_LEGACY
-       bool "Renesas ARM SoCs (non-multiplatform)"
-       select ARCH_SHMOBILE
-       select ARM_PATCH_PHYS_VIRT if MMU
-       select CLKDEV_LOOKUP
-       select CPU_V7
-       select GENERIC_CLOCKEVENTS
-       select HAVE_ARM_SCU if SMP
-       select HAVE_ARM_TWD if SMP
-       select HAVE_SMP
-       select MIGHT_HAVE_CACHE_L2X0
-       select MULTI_IRQ_HANDLER
-       select NO_IOPORT_MAP
-       select PINCTRL
-       select PM_GENERIC_DOMAINS if PM
-       select SH_CLK_CPG
-       select SPARSE_IRQ
-       help
-         Support for Renesas ARM SoC platforms using a non-multiplatform
-         kernel. This includes the SH-Mobile, R-Mobile, EMMA-Mobile, R-Car
-         and RZ families.
-
 config ARCH_RPC
        bool "RiscPC"
        depends on MMU
@@ -1537,7 +1515,6 @@ config HZ_FIXED
        default 200 if ARCH_EBSA110 || ARCH_S3C24XX || \
                ARCH_S5PV210 || ARCH_EXYNOS4
        default 128 if SOC_AT91RM9200
-       default SHMOBILE_TIMER_HZ if ARCH_SHMOBILE_LEGACY
        default 0
 
 choice
@@ -1756,8 +1733,7 @@ config ARM_MODULE_PLTS
 source "mm/Kconfig"
 
 config FORCE_MAX_ZONEORDER
-       int "Maximum zone order" if ARCH_SHMOBILE_LEGACY
-       range 11 64 if ARCH_SHMOBILE_LEGACY
+       int "Maximum zone order"
        default "12" if SOC_AM33XX
        default "9" if SA1111 || ARCH_EFM32
        default "11"
index 0cfd7f947f6b9955bb4e16ee8e96fd8461a29474..259c0ca9c99a8f510410d3b1e9f2dd40707555ca 100644 (file)
@@ -123,29 +123,23 @@ choice
                    0x80020000      | 0xf0020000     | UART8
                    0x80024000      | 0xf0024000     | UART9
 
-       config AT91_DEBUG_LL_DBGU0
-               bool "Kernel low-level debugging on rm9200, 9260/9g20, 9261/9g10, 9rl, 9x5, 9n12"
-               select DEBUG_AT91_UART
+       config DEBUG_AT91_UART
+               bool "Kernel low-level debugging on Atmel SoCs"
                depends on ARCH_AT91
-               depends on SOC_AT91RM9200 || SOC_AT91SAM9
+               help
+                 Say Y here if you want the debug print routines to direct
+                 their output to the serial port on atmel devices.
 
-       config AT91_DEBUG_LL_DBGU1
-               bool "Kernel low-level debugging on 9263, 9g45 and sama5d3"
-               select DEBUG_AT91_UART
-               depends on ARCH_AT91
-               depends on SOC_AT91SAM9 || SOC_SAMA5
+                 SOC                  DEBUG_UART_PHYS   DEBUG_UART_VIRT  PORT
+                 rm9200, 9260/9g20,   0xfffff200        0xfefff200       DBGU
+                 9261/9g10, 9rl
+                 9263, 9g45, sama5d3  0xffffee00        0xfeffee00       DBGU
+                 sama5d4              0xfc00c000        0xfb00c000       USART3
+                 sama5d4              0xfc069000        0xfb069000       DBGU
+                 sama5d2              0xf8020000        0xf7020000       UART1
 
-       config AT91_DEBUG_LL_DBGU2
-               bool "Kernel low-level debugging on sama5d4"
-               select DEBUG_AT91_UART
-               depends on ARCH_AT91
-               depends on SOC_SAMA5
-
-       config AT91_DEBUG_LL_DBGU3
-               bool "Kernel low-level debugging on sama5d2"
-               select DEBUG_AT91_UART
-               depends on ARCH_AT91
-               depends on SOC_SAMA5
+                 Please adjust DEBUG_UART_PHYS configuration options based on
+                 your needs.
 
        config DEBUG_BCM2835
                bool "Kernel low-level debugging on BCM2835 PL011 UART"
@@ -1249,10 +1243,6 @@ choice
 
 endchoice
 
-config DEBUG_AT91_UART
-       bool
-       depends on ARCH_AT91
-
 config DEBUG_EXYNOS_UART
        bool
 
@@ -1485,7 +1475,8 @@ config DEBUG_UART_PHYS
                DEBUG_RMOBILE_SCIFA0 || DEBUG_RMOBILE_SCIFA1 || \
                DEBUG_RMOBILE_SCIFA4 || DEBUG_S3C24XX_UART || \
                DEBUG_UART_BCM63XX || DEBUG_ASM9260_UART || \
-               DEBUG_SIRFSOC_UART || DEBUG_DIGICOLOR_UA0
+               DEBUG_SIRFSOC_UART || DEBUG_DIGICOLOR_UA0 || \
+               DEBUG_AT91_UART
 
 config DEBUG_UART_VIRT
        hex "Virtual base address of debug UART"
@@ -1621,8 +1612,7 @@ config DEBUG_UNCOMPRESS
 config UNCOMPRESS_INCLUDE
        string
        default "debug/uncompress.h" if ARCH_MULTIPLATFORM || ARCH_MSM || \
-                                       PLAT_SAMSUNG || ARM_SINGLE_ARMV7M || \
-                                       ARCH_SHMOBILE_LEGACY
+                                       PLAT_SAMSUNG || ARM_SINGLE_ARMV7M
        default "mach/uncompress.h"
 
 config EARLY_PRINTK
index 6019f5d3ad7f7314c5664f41b6100fef556a6f49..30bbc3746130a56e54fa665a763894fe4ec02e6a 100644 (file)
@@ -58,7 +58,9 @@ dtb-$(CONFIG_ARCH_AXXIA) += \
        axm5516-amarillo.dtb
 dtb-$(CONFIG_ARCH_BCM2835) += \
        bcm2835-rpi-b.dtb \
-       bcm2835-rpi-b-plus.dtb
+       bcm2835-rpi-b-rev2.dtb \
+       bcm2835-rpi-b-plus.dtb \
+       bcm2835-rpi-a-plus.dtb
 dtb-$(CONFIG_ARCH_BCM_5301X) += \
        bcm4708-asus-rt-ac56u.dtb \
        bcm4708-asus-rt-ac68u.dtb \
@@ -72,6 +74,7 @@ dtb-$(CONFIG_ARCH_BCM_5301X) += \
        bcm47081-buffalo-wzr-900dhp.dtb \
        bcm4709-asus-rt-ac87u.dtb \
        bcm4709-buffalo-wxr-1900dhp.dtb \
+       bcm4709-netgear-r7000.dtb \
        bcm4709-netgear-r8000.dtb
 dtb-$(CONFIG_ARCH_BCM_63XX) += \
        bcm963138dvt.dtb
@@ -83,6 +86,8 @@ dtb-$(CONFIG_ARCH_BCM_CYGNUS) += \
 dtb-$(CONFIG_ARCH_BCM_MOBILE) += \
        bcm28155-ap.dtb \
        bcm21664-garnet.dtb
+dtb-$(CONFIG_ARCH_BCM_NSP) += \
+       bcm958625k.dtb
 dtb-$(CONFIG_ARCH_BERLIN) += \
        berlin2-sony-nsz-gs7.dtb \
        berlin2cd-google-chromecast.dtb \
@@ -115,6 +120,7 @@ dtb-$(CONFIG_ARCH_EXYNOS5) += \
        exynos5250-arndale.dtb \
        exynos5250-smdk5250.dtb \
        exynos5250-snow.dtb \
+       exynos5250-snow-rev5.dtb \
        exynos5250-spring.dtb \
        exynos5260-xyref5260.dtb \
        exynos5410-smdk5410.dtb \
@@ -123,6 +129,7 @@ dtb-$(CONFIG_ARCH_EXYNOS5) += \
        exynos5420-smdk5420.dtb \
        exynos5422-odroidxu3.dtb \
        exynos5422-odroidxu3-lite.dtb \
+       exynos5422-odroidxu4.dtb \
        exynos5440-sd5v1.dtb \
        exynos5440-ssdk5440.dtb \
        exynos5800-peach-pi.dtb
@@ -227,6 +234,9 @@ dtb-$(CONFIG_ARCH_MMP) += \
        pxa168-aspenite.dtb \
        pxa910-dkb.dtb \
        mmp2-brownstone.dtb
+dtb-$(CONFIG_MACH_MESON8B) += \
+       meson8b-mxq.dtb \
+       meson8b-odroidc1.dtb
 dtb-$(CONFIG_ARCH_MOXART) += \
        moxart-uc7112lx.dtb
 dtb-$(CONFIG_SOC_IMX1) += \
@@ -284,6 +294,7 @@ dtb-$(CONFIG_SOC_IMX6Q) += \
        imx6dl-gw551x.dtb \
        imx6dl-gw552x.dtb \
        imx6dl-hummingboard.dtb \
+       imx6dl-nit6xlite.dtb \
        imx6dl-nitrogen6x.dtb \
        imx6dl-phytec-pbab01.dtb \
        imx6dl-rex-basic.dtb \
@@ -313,6 +324,7 @@ dtb-$(CONFIG_SOC_IMX6Q) += \
        imx6q-gw552x.dtb \
        imx6q-hummingboard.dtb \
        imx6q-nitrogen6x.dtb \
+       imx6q-nitrogen6_max.dtb \
        imx6q-phytec-pbab01.dtb \
        imx6q-rex-pro.dtb \
        imx6q-sabreauto.dtb \
@@ -446,6 +458,7 @@ dtb-$(CONFIG_SOC_AM33XX) += \
        am335x-base0033.dtb \
        am335x-bone.dtb \
        am335x-boneblack.dtb \
+       am335x-bonegreen.dtb \
        am335x-sl50.dtb \
        am335x-evm.dtb \
        am335x-evmsk.dtb \
@@ -470,6 +483,7 @@ dtb-$(CONFIG_SOC_AM43XX) += \
        am437x-gp-evm.dtb
 dtb-$(CONFIG_SOC_OMAP5) += \
        omap5-cm-t54.dtb \
+       omap5-igep0050.dtb \
        omap5-sbc-t54.dtb \
        omap5-uevm.dtb
 dtb-$(CONFIG_SOC_DRA7XX) += \
@@ -506,7 +520,10 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += \
        rk3288-evb-rk808.dtb \
        rk3288-firefly-beta.dtb \
        rk3288-firefly.dtb \
+       rk3288-popmetal.dtb \
        rk3288-r89.dtb \
+       rk3288-rock2-square.dtb \
+       rk3288-veyron-jaq.dtb \
        rk3288-veyron-jerry.dtb \
        rk3288-veyron-minnie.dtb \
        rk3288-veyron-pinky.dtb \
@@ -522,9 +539,6 @@ dtb-$(CONFIG_ARCH_S5PV210) += \
        s5pv210-smdkc110.dtb \
        s5pv210-smdkv210.dtb \
        s5pv210-torbreck.dtb
-dtb-$(CONFIG_ARCH_SHMOBILE_LEGACY) += \
-       r8a7778-bockw.dtb \
-       r8a7778-bockw-reference.dtb
 dtb-$(CONFIG_ARCH_SHMOBILE_MULTI) += \
        emev2-kzm9d.dtb \
        r7s72100-genmai.dtb \
@@ -535,6 +549,7 @@ dtb-$(CONFIG_ARCH_SHMOBILE_MULTI) += \
        r8a7790-lager.dtb \
        r8a7791-henninger.dtb \
        r8a7791-koelsch.dtb \
+       r8a7791-porter.dtb \
        r8a7793-gose.dtb \
        r8a7794-alt.dtb \
        r8a7794-silk.dtb \
@@ -577,7 +592,9 @@ dtb-$(CONFIG_MACH_SUN4I) += \
        sun4i-a10-gemei-g9.dtb \
        sun4i-a10-hackberry.dtb \
        sun4i-a10-hyundai-a7hd.dtb \
+       sun4i-a10-inet1.dtb \
        sun4i-a10-inet97fv2.dtb \
+       sun4i-a10-inet9f-rev03.dtb \
        sun4i-a10-itead-iteaduino-plus.dtb \
        sun4i-a10-jesurun-q5.dtb \
        sun4i-a10-marsboard.dtb \
@@ -585,16 +602,23 @@ dtb-$(CONFIG_MACH_SUN4I) += \
        sun4i-a10-mk802.dtb \
        sun4i-a10-mk802ii.dtb \
        sun4i-a10-olinuxino-lime.dtb \
-       sun4i-a10-pcduino.dtb
+       sun4i-a10-pcduino.dtb \
+       sun4i-a10-pcduino2.dtb \
+       sun4i-a10-pov-protab2-ips9.dtb
 dtb-$(CONFIG_MACH_SUN5I) += \
+       sun5i-a10s-auxtek-t003.dtb \
        sun5i-a10s-auxtek-t004.dtb \
        sun5i-a10s-mk802.dtb \
        sun5i-a10s-olinuxino-micro.dtb \
        sun5i-a10s-r7-tv-dongle.dtb \
+       sun5i-a10s-wobo-i5.dtb \
        sun5i-a13-hsg-h702.dtb \
+       sun5i-a13-inet-98v-rev2.dtb \
        sun5i-a13-olinuxino.dtb \
        sun5i-a13-olinuxino-micro.dtb \
-       sun5i-a13-utoo-p66.dtb
+       sun5i-a13-q8-tablet.dtb \
+       sun5i-a13-utoo-p66.dtb \
+       sun5i-r8-chip.dtb
 dtb-$(CONFIG_MACH_SUN6I) += \
        sun6i-a31-app4-evb1.dtb \
        sun6i-a31-colombus.dtb \
@@ -602,7 +626,11 @@ dtb-$(CONFIG_MACH_SUN6I) += \
        sun6i-a31-i7.dtb \
        sun6i-a31-m9.dtb \
        sun6i-a31-mele-a1000g-quad.dtb \
-       sun6i-a31s-cs908.dtb
+       sun6i-a31s-cs908.dtb \
+       sun6i-a31s-primo81.dtb \
+       sun6i-a31s-sina31s.dtb \
+       sun6i-a31s-sinovoip-bpi-m2.dtb \
+       sun6i-a31s-yones-toptech-bs1078-v2.dtb
 dtb-$(CONFIG_MACH_SUN7I) += \
        sun7i-a20-bananapi.dtb \
        sun7i-a20-bananapro.dtb \
@@ -612,6 +640,7 @@ dtb-$(CONFIG_MACH_SUN7I) += \
        sun7i-a20-i12-tvbox.dtb \
        sun7i-a20-m3.dtb \
        sun7i-a20-mk808c.dtb \
+       sun7i-a20-olimex-som-evb.dtb \
        sun7i-a20-olinuxino-lime.dtb \
        sun7i-a20-olinuxino-lime2.dtb \
        sun7i-a20-olinuxino-micro.dtb \
@@ -619,14 +648,18 @@ dtb-$(CONFIG_MACH_SUN7I) += \
        sun7i-a20-orangepi-mini.dtb \
        sun7i-a20-pcduino3.dtb \
        sun7i-a20-pcduino3-nano.dtb \
-       sun7i-a20-wexler-tab7200.dtb
+       sun7i-a20-wexler-tab7200.dtb \
+       sun7i-a20-wits-pro-a20-dkt.dtb
 dtb-$(CONFIG_MACH_SUN8I) += \
        sun8i-a23-evb.dtb \
+       sun8i-a23-gt90h-v4.dtb \
        sun8i-a23-ippo-q8h-v5.dtb \
        sun8i-a23-ippo-q8h-v1.2.dtb \
+       sun8i-a23-q8-tablet.dtb \
        sun8i-a33-et-q8-v1.6.dtb \
        sun8i-a33-ga10h-v1.1.dtb \
        sun8i-a33-ippo-q8h-v1.2.dtb \
+       sun8i-a33-q8-tablet.dtb \
        sun8i-a33-sinlinx-sina33.dtb
 dtb-$(CONFIG_MACH_SUN9I) += \
        sun9i-a80-optimus.dtb \
@@ -672,7 +705,9 @@ dtb-$(CONFIG_ARCH_UNIPHIER) += \
        uniphier-ph1-ld6b-ref.dtb \
        uniphier-ph1-pro4-ref.dtb \
        uniphier-ph1-sld3-ref.dtb \
-       uniphier-ph1-sld8-ref.dtb 
+       uniphier-ph1-sld8-ref.dtb \
+       uniphier-proxstream2-gentil.dtb \
+       uniphier-proxstream2-vodka.dtb
 dtb-$(CONFIG_ARCH_VERSATILE) += \
        versatile-ab.dtb \
        versatile-pb.dtb
@@ -702,6 +737,10 @@ dtb-$(CONFIG_MACH_ARMADA_370) += \
        armada-370-netgear-rn102.dtb \
        armada-370-netgear-rn104.dtb \
        armada-370-rd.dtb \
+       armada-370-seagate-nas-2bay.dtb \
+       armada-370-seagate-nas-4bay.dtb \
+       armada-370-seagate-personal-cloud.dtb \
+       armada-370-seagate-personal-cloud-2bay.dtb \
        armada-370-synology-ds213j.dtb
 dtb-$(CONFIG_MACH_ARMADA_375) += \
        armada-375-db.dtb
index 72a9b3fc425111ec9924fb47defeffee169672e2..58a05f7d0b7cbc4fdd32879dfb9e900f7ad72dbb 100644 (file)
 &am33xx_pinmux {
        nxp_hdmi_pins: pinmux_nxp_hdmi_pins {
                pinctrl-single,pins = <
-                       0x1b0 (PIN_OUTPUT | MUX_MODE3)  /* xdma_event_intr0.clkout1 */
-                       0xa0 (PIN_OUTPUT | MUX_MODE0)   /* lcd_data0 */
-                       0xa4 (PIN_OUTPUT | MUX_MODE0)   /* lcd_data1 */
-                       0xa8 (PIN_OUTPUT | MUX_MODE0)   /* lcd_data2 */
-                       0xac (PIN_OUTPUT | MUX_MODE0)   /* lcd_data3 */
-                       0xb0 (PIN_OUTPUT | MUX_MODE0)   /* lcd_data4 */
-                       0xb4 (PIN_OUTPUT | MUX_MODE0)   /* lcd_data5 */
-                       0xb8 (PIN_OUTPUT | MUX_MODE0)   /* lcd_data6 */
-                       0xbc (PIN_OUTPUT | MUX_MODE0)   /* lcd_data7 */
-                       0xc0 (PIN_OUTPUT | MUX_MODE0)   /* lcd_data8 */
-                       0xc4 (PIN_OUTPUT | MUX_MODE0)   /* lcd_data9 */
-                       0xc8 (PIN_OUTPUT | MUX_MODE0)   /* lcd_data10 */
-                       0xcc (PIN_OUTPUT | MUX_MODE0)   /* lcd_data11 */
-                       0xd0 (PIN_OUTPUT | MUX_MODE0)   /* lcd_data12 */
-                       0xd4 (PIN_OUTPUT | MUX_MODE0)   /* lcd_data13 */
-                       0xd8 (PIN_OUTPUT | MUX_MODE0)   /* lcd_data14 */
-                       0xdc (PIN_OUTPUT | MUX_MODE0)   /* lcd_data15 */
-                       0xe0 (PIN_OUTPUT | MUX_MODE0)   /* lcd_vsync */
-                       0xe4 (PIN_OUTPUT | MUX_MODE0)   /* lcd_hsync */
-                       0xe8 (PIN_OUTPUT | MUX_MODE0)   /* lcd_pclk */
-                       0xec (PIN_OUTPUT | MUX_MODE0)   /* lcd_ac_bias_en */
+                       AM33XX_IOPAD(0x9b0, PIN_OUTPUT | MUX_MODE3)     /* xdma_event_intr0.clkout1 */
+                       AM33XX_IOPAD(0x8a0, PIN_OUTPUT | MUX_MODE0)     /* lcd_data0 */
+                       AM33XX_IOPAD(0x8a4, PIN_OUTPUT | MUX_MODE0)     /* lcd_data1 */
+                       AM33XX_IOPAD(0x8a8, PIN_OUTPUT | MUX_MODE0)     /* lcd_data2 */
+                       AM33XX_IOPAD(0x8ac, PIN_OUTPUT | MUX_MODE0)     /* lcd_data3 */
+                       AM33XX_IOPAD(0x8b0, PIN_OUTPUT | MUX_MODE0)     /* lcd_data4 */
+                       AM33XX_IOPAD(0x8b4, PIN_OUTPUT | MUX_MODE0)     /* lcd_data5 */
+                       AM33XX_IOPAD(0x8b8, PIN_OUTPUT | MUX_MODE0)     /* lcd_data6 */
+                       AM33XX_IOPAD(0x8bc, PIN_OUTPUT | MUX_MODE0)     /* lcd_data7 */
+                       AM33XX_IOPAD(0x8c0, PIN_OUTPUT | MUX_MODE0)     /* lcd_data8 */
+                       AM33XX_IOPAD(0x8c4, PIN_OUTPUT | MUX_MODE0)     /* lcd_data9 */
+                       AM33XX_IOPAD(0x8c8, PIN_OUTPUT | MUX_MODE0)     /* lcd_data10 */
+                       AM33XX_IOPAD(0x8cc, PIN_OUTPUT | MUX_MODE0)     /* lcd_data11 */
+                       AM33XX_IOPAD(0x8d0, PIN_OUTPUT | MUX_MODE0)     /* lcd_data12 */
+                       AM33XX_IOPAD(0x8d4, PIN_OUTPUT | MUX_MODE0)     /* lcd_data13 */
+                       AM33XX_IOPAD(0x8d8, PIN_OUTPUT | MUX_MODE0)     /* lcd_data14 */
+                       AM33XX_IOPAD(0x8dc, PIN_OUTPUT | MUX_MODE0)     /* lcd_data15 */
+                       AM33XX_IOPAD(0x8e0, PIN_OUTPUT | MUX_MODE0)     /* lcd_vsync */
+                       AM33XX_IOPAD(0x8e4, PIN_OUTPUT | MUX_MODE0)     /* lcd_hsync */
+                       AM33XX_IOPAD(0x8e8, PIN_OUTPUT | MUX_MODE0)     /* lcd_pclk */
+                       AM33XX_IOPAD(0x8ec, PIN_OUTPUT | MUX_MODE0)     /* lcd_ac_bias_en */
                >;
        };
        nxp_hdmi_off_pins: pinmux_nxp_hdmi_off_pins {
                pinctrl-single,pins = <
-                       0x1b0 (PIN_OUTPUT | MUX_MODE3)  /* xdma_event_intr0.clkout1 */
+                       AM33XX_IOPAD(0x9b0, PIN_OUTPUT | MUX_MODE3)     /* xdma_event_intr0.clkout1 */
                >;
        };
 
        leds_base_pins: pinmux_leds_base_pins {
                pinctrl-single,pins = <
-                       0x54 (PIN_OUTPUT_PULLDOWN | MUX_MODE7)  /* gpmc_a5.gpio1_21 */
-                       0x88 (PIN_OUTPUT_PULLDOWN | MUX_MODE7)  /* gpmc_csn3.gpio2_0 */
+                       AM33XX_IOPAD(0x854, PIN_OUTPUT_PULLDOWN | MUX_MODE7)    /* gpmc_a5.gpio1_21 */
+                       AM33XX_IOPAD(0x888, PIN_OUTPUT_PULLDOWN | MUX_MODE7)    /* gpmc_csn3.gpio2_0 */
                >;
        };
 };
index fec78349c1f3c895fbd1dcf36782d16b9c891d93..5d370d54bd30e18a42c675341ba57d9d82cf8783 100644 (file)
        bus-width = <0x4>;
        pinctrl-names = "default";
        pinctrl-0 = <&mmc1_pins>;
-       cd-gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>;
-       cd-inverted;
+       cd-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
 };
 
 &aes {
diff --git a/arch/arm/boot/dts/am335x-bonegreen.dts b/arch/arm/boot/dts/am335x-bonegreen.dts
new file mode 100644 (file)
index 0000000..0f65bda
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * 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.
+ */
+/dts-v1/;
+
+#include "am33xx.dtsi"
+#include "am335x-bone-common.dtsi"
+
+/ {
+       model = "TI AM335x BeagleBone Green";
+       compatible = "ti,am335x-bone-green", "ti,am335x-bone-black", "ti,am335x-bone", "ti,am33xx";
+};
+
+&ldo3_reg {
+       regulator-min-microvolt = <1800000>;
+       regulator-max-microvolt = <1800000>;
+       regulator-always-on;
+};
+
+&mmc1 {
+       vmmc-supply = <&vmmcsd_fixed>;
+};
+
+&mmc2 {
+       vmmc-supply = <&vmmcsd_fixed>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&emmc_pins>;
+       bus-width = <8>;
+       status = "okay";
+};
+
+&am33xx_pinmux {
+       uart2_pins: uart2_pins {
+               pinctrl-single,pins = <
+                       0x150 (PIN_INPUT | MUX_MODE1)   /* spi0_sclk.uart2_rxd */
+                       0x154 (PIN_OUTPUT | MUX_MODE1)  /* spi0_d0.uart2_txd */
+               >;
+       };
+};
+
+&uart2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart2_pins>;
+       status = "okay";
+};
+
+&rtc {
+       system-power-controller;
+};
index 1942a5c8132d74a3df239f99104ffd762a9b4f20..d9d00ab863a21735312ff2d53a6830c48ad425ff 100644 (file)
        bus-width = <4>;
        pinctrl-names = "default";
        pinctrl-0 = <&mmc1_pins>;
-       cd-gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>;
+       cd-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
 };
 
 &mmc3 {
index 315bb02c99207ffe1934bb4a81de32857b3ca560..89442e98a8375c965dc117fd2e04da3be6e8d2de 100644 (file)
        bus-width = <4>;
        pinctrl-names = "default";
        pinctrl-0 = <&mmc1_pins>;
-       cd-gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>;
+       cd-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
 };
 
 &sham {
index c0e1135256cca7b781504e4df587a2ebd7768294..54f113546ecc0fcd6a520ff8f19b576b14bc80f1 100644 (file)
 &am33xx_pinmux {
        i2c0_pins: pinmux_i2c0_pins {
                pinctrl-single,pins = <
-                       0x188 (PIN_INPUT_PULLUP | MUX_MODE0)    /* i2c0_sda.i2c0_sda */
-                       0x18c (PIN_INPUT_PULLUP | MUX_MODE0)    /* i2c0_scl.i2c0_scl */
+                       AM33XX_IOPAD(0x988, PIN_INPUT_PULLUP | MUX_MODE0)       /* i2c0_sda.i2c0_sda */
+                       AM33XX_IOPAD(0x98c, PIN_INPUT_PULLUP | MUX_MODE0)       /* i2c0_scl.i2c0_scl */
                >;
        };
 
        nandflash_pins: pinmux_nandflash_pins {
                pinctrl-single,pins = <
-                       0x0 (PIN_INPUT_PULLUP | MUX_MODE0)      /* gpmc_ad0.gpmc_ad0 */
-                       0x4 (PIN_INPUT_PULLUP | MUX_MODE0)      /* gpmc_ad1.gpmc_ad1 */
-                       0x8 (PIN_INPUT_PULLUP | MUX_MODE0)      /* gpmc_ad2.gpmc_ad2 */
-                       0xc (PIN_INPUT_PULLUP | MUX_MODE0)      /* gpmc_ad3.gpmc_ad3 */
-                       0x10 (PIN_INPUT_PULLUP | MUX_MODE0)     /* gpmc_ad4.gpmc_ad4 */
-                       0x14 (PIN_INPUT_PULLUP | MUX_MODE0)     /* gpmc_ad5.gpmc_ad5 */
-                       0x18 (PIN_INPUT_PULLUP | MUX_MODE0)     /* gpmc_ad6.gpmc_ad6 */
-                       0x1c (PIN_INPUT_PULLUP | MUX_MODE0)     /* gpmc_ad7.gpmc_ad7 */
-                       0x70 (PIN_INPUT_PULLUP | MUX_MODE0)     /* gpmc_wait0.gpmc_wait0 */
-                       0x74 (PIN_INPUT_PULLUP | MUX_MODE7)     /* gpmc_wpn.gpio0_30 */
-                       0x7c (PIN_OUTPUT | MUX_MODE0)           /* gpmc_csn0.gpmc_csn0 */
-                       0x90 (PIN_OUTPUT | MUX_MODE0)           /* gpmc_advn_ale.gpmc_advn_ale */
-                       0x94 (PIN_OUTPUT | MUX_MODE0)           /* gpmc_oen_ren.gpmc_oen_ren */
-                       0x98 (PIN_OUTPUT | MUX_MODE0)           /* gpmc_wen.gpmc_wen */
-                       0x9c (PIN_OUTPUT | MUX_MODE0)           /* gpmc_be0n_cle.gpmc_be0n_cle */
+                       AM33XX_IOPAD(0x800, PIN_INPUT_PULLUP | MUX_MODE0)       /* gpmc_ad0.gpmc_ad0 */
+                       AM33XX_IOPAD(0x804, PIN_INPUT_PULLUP | MUX_MODE0)       /* gpmc_ad1.gpmc_ad1 */
+                       AM33XX_IOPAD(0x808, PIN_INPUT_PULLUP | MUX_MODE0)       /* gpmc_ad2.gpmc_ad2 */
+                       AM33XX_IOPAD(0x80c, PIN_INPUT_PULLUP | MUX_MODE0)       /* gpmc_ad3.gpmc_ad3 */
+                       AM33XX_IOPAD(0x810, PIN_INPUT_PULLUP | MUX_MODE0)       /* gpmc_ad4.gpmc_ad4 */
+                       AM33XX_IOPAD(0x814, PIN_INPUT_PULLUP | MUX_MODE0)       /* gpmc_ad5.gpmc_ad5 */
+                       AM33XX_IOPAD(0x818, PIN_INPUT_PULLUP | MUX_MODE0)       /* gpmc_ad6.gpmc_ad6 */
+                       AM33XX_IOPAD(0x81c, PIN_INPUT_PULLUP | MUX_MODE0)       /* gpmc_ad7.gpmc_ad7 */
+                       AM33XX_IOPAD(0x870, PIN_INPUT_PULLUP | MUX_MODE0)       /* gpmc_wait0.gpmc_wait0 */
+                       AM33XX_IOPAD(0x874, PIN_INPUT_PULLUP | MUX_MODE7)       /* gpmc_wpn.gpio0_30 */
+                       AM33XX_IOPAD(0x87c, PIN_OUTPUT | MUX_MODE0)             /* gpmc_csn0.gpmc_csn0 */
+                       AM33XX_IOPAD(0x890, PIN_OUTPUT | MUX_MODE0)             /* gpmc_advn_ale.gpmc_advn_ale */
+                       AM33XX_IOPAD(0x894, PIN_OUTPUT | MUX_MODE0)             /* gpmc_oen_ren.gpmc_oen_ren */
+                       AM33XX_IOPAD(0x898, PIN_OUTPUT | MUX_MODE0)             /* gpmc_wen.gpmc_wen */
+                       AM33XX_IOPAD(0x89c, PIN_OUTPUT | MUX_MODE0)             /* gpmc_be0n_cle.gpmc_be0n_cle */
                >;
        };
 
        uart0_pins: pinmux_uart0_pins {
                pinctrl-single,pins = <
-                       0x170 (PIN_INPUT_PULLUP | MUX_MODE0)    /* uart0_rxd.uart0_rxd */
-                       0x174 (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* uart0_txd.uart0_txd */
+                       AM33XX_IOPAD(0x970, PIN_INPUT_PULLUP | MUX_MODE0)       /* uart0_rxd.uart0_rxd */
+                       AM33XX_IOPAD(0x974, PIN_OUTPUT_PULLDOWN | MUX_MODE0)    /* uart0_txd.uart0_txd */
                >;
        };
 
        leds_pins: pinmux_leds_pins {
                pinctrl-single,pins = <
-                       0x5c (PIN_OUTPUT_PULLDOWN | MUX_MODE7)  /* gpmc_a7.gpio1_23 */
+                       AM33XX_IOPAD(0x85c, PIN_OUTPUT_PULLDOWN | MUX_MODE7)    /* gpmc_a7.gpio1_23 */
                >;
        };
 };
index 5dd084f3c81c4a3dc1b927021f83bedd01f95c03..2f43e458ea4ad834889920669b26f970d03219d5 100644 (file)
                reg = <0x80000000 0x10000000>; /* 256 MB */
        };
 
-       vbat: fixedregulator@0 {
-               compatible = "regulator-fixed";
+       regulators {
+               compatible = "simple-bus";
+
+               vcc5v: fixedregulator@0 {
+                       compatible = "regulator-fixed";
+                       regulator-name = "vcc5v";
+                       regulator-min-microvolt = <5000000>;
+                       regulator-max-microvolt = <5000000>;
+                       regulator-boot-on;
+                       regulator-always-on;
+               };
        };
 };
 
 #include "tps65910.dtsi"
 
 &tps {
-       vcc1-supply = <&vbat>;
-       vcc2-supply = <&vbat>;
-       vcc3-supply = <&vbat>;
-       vcc4-supply = <&vbat>;
-       vcc5-supply = <&vbat>;
-       vcc6-supply = <&vbat>;
-       vcc7-supply = <&vbat>;
-       vccio-supply = <&vbat>;
+       vcc1-supply = <&vcc5v>;
+       vcc2-supply = <&vcc5v>;
+       vcc3-supply = <&vcc5v>;
+       vcc4-supply = <&vcc5v>;
+       vcc5-supply = <&vcc5v>;
+       vcc6-supply = <&vcc5v>;
+       vcc7-supply = <&vcc5v>;
+       vccio-supply = <&vcc5v>;
 
        regulators {
                vrtc_reg: regulator@0 {
        };
 };
 
-&vbat {
-       regulator-name = "vbat";
-       regulator-min-microvolt = <5000000>;
-       regulator-max-microvolt = <5000000>;
-       regulator-boot-on;
-};
-
 /* SPI Busses */
 &am33xx_pinmux {
        spi0_pins: pinmux_spi0 {
index 5e541bd1b45a9d5660ce054d8f13813a42240b25..2cecb3951e1bbae11e3fb22fea9bc2c95613fb7d 100644 (file)
        model = "Phytec AM335x phyBOARD-WEGA";
        compatible = "phytec,am335x-wega", "phytec,am335x-phycore-som", "ti,am33xx";
 
+       regulators {
+               compatible = "simple-bus";
+
+               vcc3v3: fixedregulator@1 {
+                       compatible = "regulator-fixed";
+                       regulator-name = "vcc3v3";
+                       regulator-min-microvolt = <3300000>;
+                       regulator-max-microvolt = <3300000>;
+                       regulator-boot-on;
+               };
+       };
 };
 
 /* CAN Busses */
@@ -80,7 +91,7 @@
 };
 
 &mmc1 {
-       vmmc-supply = <&vmmc_reg>;
+       vmmc-supply = <&vcc3v3>;
        bus-width = <4>;
        pinctrl-names = "default";
        pinctrl-0 = <&mmc1_pins>;
index 22038f21f2283a30cdac9235f0a6a2171813264e..d2450ab0a3805f1ceb841e5c5fa559602fa84d6b 100644 (file)
                >;
        };
 
+       dcan0_sleep: dcan0_sleep_pins {
+               pinctrl-single,pins = <
+                       0x178 (PIN_INPUT_PULLUP | MUX_MODE7)    /* uart1_ctsn.gpio0_12 */
+                       0x17c (PIN_INPUT_PULLUP | MUX_MODE7)    /* uart1_rtsn.gpio0_13 */
+               >;
+       };
+
        dcan1_default: dcan1_default_pins {
                pinctrl-single,pins = <
                        0x180 (PIN_OUTPUT | MUX_MODE2)          /* uart1_rxd.d_can1_tx */
                >;
        };
 
+       dcan1_sleep: dcan1_sleep_pins {
+               pinctrl-single,pins = <
+                       0x180 (PIN_INPUT_PULLUP | MUX_MODE7)    /* uart1_rxd.gpio0_14 */
+                       0x184 (PIN_INPUT_PULLUP | MUX_MODE7)    /* uart1_txd.gpio0_15 */
+               >;
+       };
+
        vpfe0_pins_default: vpfe0_pins_default {
                pinctrl-single,pins = <
                        0x1B0 (PIN_INPUT_PULLUP | MUX_MODE0)  /* cam0_hd mode 0*/
 
                attb-gpio = <&gpio3 22 GPIO_ACTIVE_HIGH>;
 
+               /*
+                * 0x264 represents the offset of padconf register of
+                * gpio3_22 from am43xx_pinmux base.
+                */
+               interrupts-extended = <&gpio3 22 IRQ_TYPE_NONE>,
+                                     <&am43xx_pinmux 0x264>;
+               interrupt-names = "tsc", "wakeup";
+
                touchscreen-size-x = <1024>;
                touchscreen-size-y = <600>;
+               wakeup-source;
        };
 
        ov2659@30 {
        bus-width = <4>;
        pinctrl-names = "default";
        pinctrl-0 = <&mmc1_pins>;
-       cd-gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>;
+       cd-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
 };
 
 /* eMMC sits on mmc2 */
 };
 
 &dcan0 {
-       pinctrl-names = "default";
+       pinctrl-names = "default", "sleep";
        pinctrl-0 = <&dcan0_default>;
+       pinctrl-1 = <&dcan0_sleep>;
        status = "okay";
 };
 
 &dcan1 {
-       pinctrl-names = "default";
+       pinctrl-names = "default", "sleep";
        pinctrl-0 = <&dcan1_default>;
+       pinctrl-1 = <&dcan1_sleep>;
        status = "okay";
 };
 
index af25801418b49ff322279d5147524c069c5ce9b5..337fb91ee74c02dc1193c3f40c6d5ae5a8dd07bd 100644 (file)
        pinctrl-1 = <&mmc1_pins_sleep>;
        vmmc-supply = <&v3_3d>;
        bus-width = <4>;
-       cd-gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>;
+       cd-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
 };
 
 &qspi {
index 0bb36e9af93623e6f3a6e4ee96ae64ce8c215e53..63de2a1b4315ef56e4329e4825410deb3ccf7c07 100644 (file)
 
        vmmc-supply = <&dcdc4>;
        bus-width = <4>;
-       cd-gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>;
+       cd-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
 };
 
 &usb2_phy1 {
index 86c2dfbe887561fd553f337cfff0e18b61551f96..47954ed990f8be83c9aabe38b3878911d21f92a2 100644 (file)
        bus-width = <4>;
        pinctrl-names = "default";
        pinctrl-0 = <&mmc1_pins>;
-       cd-gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>;
+       cd-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
 };
 
 &mac {
index d55e3ea89fda51ba1d6b45f69eeaa8849dad9487..d9ba6b879fc1b25e25f8d006c8b57ab722310c7d 100644 (file)
                regulator-max-microvolt = <3300000>;
        };
 
+       aic_dvdd: fixedregulator-aic_dvdd {
+               compatible = "regulator-fixed";
+               regulator-name = "aic_dvdd_fixed";
+               vin-supply = <&vdd_3v3>;
+               regulator-min-microvolt = <1800000>;
+               regulator-max-microvolt = <1800000>;
+       };
+
        vtt_fixed: fixedregulator-vtt {
                /* TPS51200 */
                compatible = "regulator-fixed";
                        };
                };
        };
+
+       sound0: sound@0 {
+               compatible = "simple-audio-card";
+               simple-audio-card,name = "BeagleBoard-X15";
+               simple-audio-card,widgets =
+                       "Line", "Line Out",
+                       "Line", "Line In";
+               simple-audio-card,routing =
+                       "Line Out",     "LLOUT",
+                       "Line Out",     "RLOUT",
+                       "MIC2L",        "Line In",
+                       "MIC2R",        "Line In";
+               simple-audio-card,format = "dsp_b";
+               simple-audio-card,bitclock-master = <&sound0_master>;
+               simple-audio-card,frame-master = <&sound0_master>;
+               simple-audio-card,bitclock-inversion;
+
+               simple-audio-card,cpu {
+                       sound-dai = <&mcasp3>;
+               };
+
+               sound0_master: simple-audio-card,codec {
+                       sound-dai = <&tlv320aic3104>;
+                       clocks = <&clkout2_clk>;
+               };
+       };
 };
 
 &dra7_pmx_core {
                        0x370 (PIN_OUTPUT | MUX_MODE14)         /* gpio6_28 LS_OE */
                >;
        };
+
+       clkout2_pins_default: clkout2_pins_default {
+               pinctrl-single,pins = <
+                       0x294 (PIN_OUTPUT_PULLDOWN | MUX_MODE9) /* xref_clk0.clkout2 */
+               >;
+       };
+
+       clkout2_pins_sleep: clkout2_pins_sleep {
+               pinctrl-single,pins = <
+                       0x294 (PIN_INPUT | MUX_MODE15)  /* xref_clk0.clkout2 */
+               >;
+       };
+
+       mcasp3_pins_default: mcasp3_pins_default {
+               pinctrl-single,pins = <
+                       0x324 (PIN_INPUT_PULLDOWN | MUX_MODE0) /* mcasp3_aclkx.mcasp3_aclkx */
+                       0x328 (PIN_INPUT_PULLDOWN | MUX_MODE0) /* mcasp3_fsx.mcasp3_fsx */
+                       0x32c (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* mcasp3_axr0.mcasp3_axr0 */
+                       0x330 (PIN_INPUT_PULLDOWN | MUX_MODE0) /* mcasp3_axr1.mcasp3_axr1 */
+               >;
+       };
+
+       mcasp3_pins_sleep: mcasp3_pins_sleep {
+               pinctrl-single,pins = <
+                       0x324 (PIN_INPUT | MUX_MODE15)
+                       0x328 (PIN_INPUT | MUX_MODE15)
+                       0x32c (PIN_INPUT | MUX_MODE15)
+                       0x330 (PIN_INPUT | MUX_MODE15)
+               >;
+       };
 };
 
 &i2c1 {
                interrupts = <16 IRQ_TYPE_LEVEL_LOW>;
                #thermal-sensor-cells = <1>;
        };
+
+       tlv320aic3104: tlv320aic3104@18 {
+               #sound-dai-cells = <0>;
+               compatible = "ti,tlv320aic3104";
+               reg = <0x18>;
+               pinctrl-names = "default", "sleep";
+               pinctrl-0 = <&clkout2_pins_default>;
+               pinctrl-1 = <&clkout2_pins_sleep>;
+               status = "okay";
+               adc-settle-ms = <40>;
+
+               AVDD-supply = <&vdd_3v3>;
+               IOVDD-supply = <&vdd_3v3>;
+               DRVDD-supply = <&vdd_3v3>;
+               DVDD-supply = <&aic_dvdd>;
+       };
 };
 
 &i2c3 {
 
        vmmc-supply = <&ldo1_reg>;
        bus-width = <4>;
-       cd-gpios = <&gpio6 27 0>; /* gpio 219 */
+       cd-gpios = <&gpio6 27 GPIO_ACTIVE_LOW>; /* gpio 219 */
 };
 
 &mmc2 {
 &pcie1 {
        gpios = <&gpio2 8 GPIO_ACTIVE_LOW>;
 };
+
+&mcasp3 {
+       #sound-dai-cells = <0>;
+       pinctrl-names = "default", "sleep";
+       pinctrl-0 = <&mcasp3_pins_default>;
+       pinctrl-1 = <&mcasp3_pins_sleep>;
+       status = "okay";
+
+       op-mode = <0>;  /* MCASP_IIS_MODE */
+       tdm-slots = <2>;
+       /* 4 serializers */
+       serial-dir = <  /* 0: INACTIVE, 1: TX, 2: RX */
+               1 2 0 0
+       >;
+};
+
+&mailbox5 {
+       status = "okay";
+       mbox_ipu1_ipc3x: mbox_ipu1_ipc3x {
+               status = "okay";
+       };
+       mbox_dsp1_ipc3x: mbox_dsp1_ipc3x {
+               status = "okay";
+       };
+};
+
+&mailbox6 {
+       status = "okay";
+       mbox_ipu2_ipc3x: mbox_ipu2_ipc3x {
+               status = "okay";
+       };
+       mbox_dsp2_ipc3x: mbox_dsp2_ipc3x {
+               status = "okay";
+       };
+};
index 03542f7b5b94a8f464754887e46ab03a6747c939..bb280de511dad269e2fa120f154d26c2f75f8129 100644 (file)
@@ -74,7 +74,8 @@
 
        soc {
                ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000
-                         MBUS_ID(0x01, 0xe0) 0 0xfff00000 0x100000>;
+                         MBUS_ID(0x01, 0xe0) 0 0xfff00000 0x100000
+                         MBUS_ID(0x09, 0x01) 0 0xf1100000 0x10000>;
 
                internal-regs {
                        serial@12000 {
index af4dc548c1c03b91561f7638b460a736d481d92c..e2a363b1dd8ad3778f361c0b93760f81d40995e8 100644 (file)
@@ -69,7 +69,8 @@
 
        soc {
                ranges = <MBUS_ID(0xf0, 0x01) 0 0xd0000000 0x100000
-                       MBUS_ID(0x01, 0xe0) 0 0xfff00000 0x100000>;
+                       MBUS_ID(0x01, 0xe0) 0 0xfff00000 0x100000
+                       MBUS_ID(0x09, 0x01) 0 0xf1100000 0x10000>;
 
                pcie-controller {
                        status = "okay";
index 0f40d5da28c3c30ec83a27bacbf9332d9ad23c41..3aa980ad64f0c47f7603d5144ffa04211578b2e1 100644 (file)
@@ -61,7 +61,8 @@
 
        soc {
                ranges = <MBUS_ID(0xf0, 0x01) 0 0xd0000000 0x100000
-                         MBUS_ID(0x01, 0xe0) 0 0xfff00000 0x100000>;
+                         MBUS_ID(0x01, 0xe0) 0 0xfff00000 0x100000
+                         MBUS_ID(0x09, 0x01) 0 0xf1100000 0x10000>;
 
                pcie-controller {
                        status = "okay";
                                phy-mode = "rgmii-id";
                        };
 
+                       crypto@90000 {
+                               status = "okay";
+                       };
+
                        mvsdio@d4000 {
                                pinctrl-0 = <&sdio_pins3>;
                                pinctrl-names = "default";
index a31207860f34ea385cee3d241c1c902a48d7d6a2..5555875f44f9983324266b6e66cda0c69c2e5d10 100644 (file)
@@ -63,7 +63,8 @@
 
        soc {
                ranges = <MBUS_ID(0xf0, 0x01) 0 0xd0000000 0x100000
-                         MBUS_ID(0x01, 0xe0) 0 0xfff00000 0x100000>;
+                         MBUS_ID(0x01, 0xe0) 0 0xfff00000 0x100000
+                         MBUS_ID(0x09, 0x01) 0 0xf1100000 0x10000>;
 
                pcie-controller {
                        status = "okay";
                };
 
                internal-regs {
+
+                       /* RTC is provided by Intersil ISL12057 I2C RTC chip */
+                       rtc@10300 {
+                               status = "disabled";
+                       };
+
                        serial@12000 {
                                status = "okay";
                        };
index 00540f292979c57e4107ca4b4b9ef51c89e28009..78b563c02f3c160d5a6ed58703523e1658d25cbd 100644 (file)
@@ -63,7 +63,8 @@
 
        soc {
                ranges = <MBUS_ID(0xf0, 0x01) 0 0xd0000000 0x100000
-                         MBUS_ID(0x01, 0xe0) 0 0xfff00000 0x100000>;
+                         MBUS_ID(0x01, 0xe0) 0 0xfff00000 0x100000
+                         MBUS_ID(0x09, 0x01) 0 0xf1100000 0x10000>;
 
                pcie-controller {
                        status = "okay";
                };
 
                internal-regs {
+
+                       /* RTC is provided by Intersil ISL12057 I2C RTC chip */
+                       rtc@10300 {
+                               status = "disabled";
+                       };
+
                        serial@12000 {
                                status = "okay";
                        };
index 19475e68b8e9246ef5220e0ec3857e5bee4b2192..fbef730e8d379df92d735c2e98fbaf2af0851cc9 100644 (file)
@@ -74,7 +74,8 @@
 
        soc {
                ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000
-                         MBUS_ID(0x01, 0xe0) 0 0xfff00000 0x100000>;
+                         MBUS_ID(0x01, 0xe0) 0 0xfff00000 0x100000
+                         MBUS_ID(0x09, 0x01) 0 0xf1100000 0x10000>;
 
                pcie-controller {
                        status = "okay";
diff --git a/arch/arm/boot/dts/armada-370-seagate-nas-2bay.dts b/arch/arm/boot/dts/armada-370-seagate-nas-2bay.dts
new file mode 100644 (file)
index 0000000..fef0110
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * Device Tree file for Seagate NAS 2-Bay (Armada 370 SoC).
+ *
+ * Copyright (C) 2015 Seagate
+ *
+ * Author: Vincent Donnefort <vdonnefort@gmail.com>
+ *
+ * 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.
+ */
+
+/*
+ * Here are some information allowing to identify the device:
+ *
+ * Product name                 : Seagate NAS 2-Bay
+ * Code name (board/PCB)        : Dart 2-Bay
+ * Model name (case sticker)    : SRPD20
+ * Material desc (product spec) : STCTxxxxxxx
+ */
+
+/dts-v1/;
+#include "armada-370-seagate-nas-xbay.dtsi"
+
+/ {
+       model = "Seagate NAS 2-Bay (Dart, SRPD20)";
+       compatible = "seagate,dart-2", "marvell,armada370", "marvell,armada-370-xp";
+
+       gpio-fan {
+               gpio-fan,speed-map =
+                       <   0 3
+                         950 2
+                        1400 1
+                        1800 0>;
+       };
+};
diff --git a/arch/arm/boot/dts/armada-370-seagate-nas-4bay.dts b/arch/arm/boot/dts/armada-370-seagate-nas-4bay.dts
new file mode 100644 (file)
index 0000000..ae2e1fe
--- /dev/null
@@ -0,0 +1,133 @@
+/*
+ * Device Tree file for Seagate NAS 4-Bay (Armada 370 SoC).
+ *
+ * Copyright (C) 2015 Seagate
+ *
+ * Author: Vincent Donnefort <vdonnefort@gmail.com>
+ *
+ * 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.
+ */
+
+/*
+ * Here are some information allowing to identify the device:
+ *
+ * Product name                 : Seagate NAS 4-Bay
+ * Code name (board/PCB)        : Dart 4-Bay
+ * Model name (case sticker)    : SRPD40
+ * Material desc (product spec) : STCUxxxxxxx
+ */
+
+/dts-v1/;
+#include "armada-370-seagate-nas-xbay.dtsi"
+#include <dt-bindings/leds/leds-ns2.h>
+
+/ {
+       model = "Seagate NAS 4-Bay (Dart, SRPD40)";
+       compatible = "seagate,dart-4", "marvell,armada370", "marvell,armada-370-xp";
+
+       soc {
+               pcie-controller {
+                       /* SATA AHCI controller 88SE9170 */
+                       pcie@1,0 {
+                               status = "okay";
+                       };
+               };
+
+               internal-regs {
+                       mdio {
+                               phy1: ethernet-phy@1 {
+                                       reg = <1>;
+                               };
+                       };
+
+                       ethernet@74000 {
+                               status = "okay";
+                               pinctrl-0 = <&ge1_rgmii_pins>;
+                               pinctrl-names = "default";
+                               phy = <&phy1>;
+                               phy-mode = "rgmii-id";
+                       };
+
+                       i2c@11000 {
+                               /* I2C GPIO expander (PCA9554A) */
+                               pca9554: pca9554@21 {
+                                       compatible = "nxp,pca9554";
+                                       reg = <0x21>;
+                                       #gpio-cells = <2>;
+                                       gpio-controller;
+                               };
+                       };
+               };
+       };
+
+       regulators {
+               regulator@3 {
+                       compatible = "regulator-fixed";
+                       reg = <3>;
+                       regulator-name = "SATA2 power";
+                       regulator-min-microvolt = <5000000>;
+                       regulator-max-microvolt = <5000000>;
+                       enable-active-high;
+                       regulator-always-on;
+                       regulator-boot-on;
+                       gpio = <&pca9554 6 GPIO_ACTIVE_HIGH>;
+               };
+               regulator@4 {
+                       compatible = "regulator-fixed";
+                       reg = <4>;
+                       regulator-name = "SATA3 power";
+                       regulator-min-microvolt = <5000000>;
+                       regulator-max-microvolt = <5000000>;
+                       enable-active-high;
+                       regulator-always-on;
+                       regulator-boot-on;
+                       gpio = <&pca9554 7 GPIO_ACTIVE_HIGH>;
+               };
+       };
+
+       gpio-leds {
+               red-sata2 {
+                       label = "dart:red:sata2";
+                       gpios = <&pca9554 0 GPIO_ACTIVE_LOW>;
+               };
+               red-sata3 {
+                       label = "dart:red:sata3";
+                       gpios = <&pca9554 3 GPIO_ACTIVE_LOW>;
+               };
+       };
+
+       leds-ns2 {
+               compatible = "lacie,ns2-leds";
+
+               white-sata2 {
+                       label = "dart:white:sata2";
+                       cmd-gpio = <&pca9554 1 GPIO_ACTIVE_HIGH>;
+                       slow-gpio = <&pca9554 2 GPIO_ACTIVE_HIGH>;
+                       num-modes = <4>;
+                       modes-map = <NS_V2_LED_SATA 0 0
+                                    NS_V2_LED_OFF  0 1
+                                    NS_V2_LED_ON   1 0
+                                    NS_V2_LED_ON   1 1>;
+               };
+               white-sata3 {
+                       label = "dart:white:sata3";
+                       cmd-gpio = <&pca9554 4 GPIO_ACTIVE_HIGH>;
+                       slow-gpio = <&pca9554 5 GPIO_ACTIVE_HIGH>;
+                       num-modes = <4>;
+                       modes-map = <NS_V2_LED_SATA 0 0
+                                    NS_V2_LED_OFF  0 1
+                                    NS_V2_LED_ON   1 0
+                                    NS_V2_LED_ON   1 1>;
+               };
+       };
+
+       gpio-fan {
+               gpio-fan,speed-map =
+                       <   0 3
+                         800 2
+                         1050 1
+                         1300 0>;
+       };
+};
diff --git a/arch/arm/boot/dts/armada-370-seagate-nas-xbay.dtsi b/arch/arm/boot/dts/armada-370-seagate-nas-xbay.dtsi
new file mode 100644 (file)
index 0000000..3036e25
--- /dev/null
@@ -0,0 +1,231 @@
+/*
+ * Device Tree common file for the Seagate NAS 2 and 4-bay (Armada 370 SoC).
+ *
+ * Copyright (C) 2015 Seagate
+ *
+ * Author: Vincent Donnefort <vdonnefort@gmail.com>
+ *
+ * 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.
+ */
+
+/*
+ * TODO: add support for the white SATA LEDs associated with HDD 0 and 1.
+ */
+
+#include "armada-370.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       memory {
+               device_type = "memory";
+               reg = <0x00000000 0x20000000>; /* 512 MB */
+       };
+
+       soc {
+               ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000
+                         MBUS_ID(0x01, 0xe0) 0 0xfff00000 0x100000>;
+
+               pcie-controller {
+                       status = "okay";
+
+                       /* USB 3.0 bridge ASM1042A */
+                       pcie@2,0 {
+                               status = "okay";
+                       };
+               };
+
+               internal-regs {
+                       serial@12000 {
+                               status = "okay";
+                       };
+
+                       sata@a0000 {
+                               nr-ports = <2>;
+                               status = "okay";
+                       };
+
+                       mdio {
+                               pinctrl-0 = <&mdio_pins>;
+                               pinctrl-names = "default";
+
+                               phy0: ethernet-phy@0 {
+                                       reg = <0>;
+                               };
+                       };
+
+                       ethernet@70000 {
+                               status = "okay";
+                               pinctrl-0 = <&ge0_rgmii_pins>;
+                               pinctrl-names = "default";
+                               phy = <&phy0>;
+                               phy-mode = "rgmii-id";
+                       };
+
+                       i2c@11000 {
+                               status = "okay";
+                               pinctrl-0 = <&i2c0_pins>;
+                               pinctrl-names = "default";
+                               clock-frequency = <100000>;
+
+                               /* RTC - NXP 8563T (second source) */
+                               rtc@51 {
+                                       compatible = "nxp,pcf8563";
+                                       reg = <0x51>;
+                                       interrupts = <110>;
+                               };
+                               /* RTC - MCP7940NT */
+                               rtc@6f {
+                                       compatible = "microchip,mcp7941x";
+                                       reg = <0x6f>;
+                                       interrupts = <110>;
+                               };
+                       };
+
+                       nand@d0000 {
+                               status = "okay";
+                               num-cs = <1>;
+                               marvell,nand-keep-config;
+                               marvell,nand-enable-arbiter;
+                               nand-on-flash-bbt;
+                               nand-ecc-strength = <4>;
+                               nand-ecc-step-size = <512>;
+
+                               partition@0 {
+                                       label = "u-boot";
+                                       reg = <0x0 0x300000>;
+                               };
+                               partition@300000 {
+                                       label = "device-tree";
+                                       reg = <0x300000 0x20000>;
+                               };
+                               partition@320000 {
+                                       label = "linux";
+                                       reg = <0x320000 0x2000000>;
+                               };
+                               partition@2320000 {
+                                       label = "rootfs";
+                                       reg = <0x2320000 0xdce0000>;
+                               };
+                       };
+               };
+
+       };
+
+       regulators {
+               compatible = "simple-bus";
+               #address-cells = <1>;
+               #size-cells = <0>;
+               pinctrl-names = "default";
+
+               regulator@1 {
+                       compatible = "regulator-fixed";
+                       reg = <1>;
+                       regulator-name = "SATA0 power";
+                       regulator-min-microvolt = <5000000>;
+                       regulator-max-microvolt = <5000000>;
+                       enable-active-high;
+                       regulator-always-on;
+                       regulator-boot-on;
+                       gpio = <&gpio1 18 GPIO_ACTIVE_HIGH>;
+               };
+               regulator@2 {
+                       compatible = "regulator-fixed";
+                       reg = <2>;
+                       regulator-name = "SATA1 power";
+                       regulator-min-microvolt = <5000000>;
+                       regulator-max-microvolt = <5000000>;
+                       enable-active-high;
+                       regulator-always-on;
+                       regulator-boot-on;
+                       gpio = <&gpio1 22 GPIO_ACTIVE_HIGH>;
+               };
+       };
+
+       gpio-fan {
+               compatible = "gpio-fan";
+               gpios = <&gpio2 0 GPIO_ACTIVE_HIGH
+                        &gpio2 1 GPIO_ACTIVE_HIGH>;
+       };
+
+       gpio-keys {
+               compatible = "gpio-keys";
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               button@1 {
+                       label = "Power button";
+                       linux,code = <KEY_POWER>;
+                       gpios = <&gpio1 19 GPIO_ACTIVE_LOW>;
+                       debounce-interval = <100>;
+               };
+               button@2 {
+                       label = "Backup button";
+                       linux,code = <KEY_OPTION>;
+                       gpios = <&gpio0 31 GPIO_ACTIVE_LOW>;
+                       debounce-interval = <100>;
+               };
+               button@3 {
+                       label = "Reset Button";
+                       linux,code = <KEY_RESTART>;
+                       gpios = <&gpio1 23 GPIO_ACTIVE_LOW>;
+                       debounce-interval = <100>;
+               };
+       };
+
+       gpio-leds {
+               compatible = "gpio-leds";
+
+               white-power {
+                       label = "dart:white:power";
+                       gpios = <&gpio1 28 GPIO_ACTIVE_HIGH>;
+                       linux,default-trigger = "timer";
+
+               };
+               red-power {
+                       label = "dart:red:power";
+                       gpios = <&gpio1 31 GPIO_ACTIVE_HIGH>;
+               };
+               red-sata0 {
+                       label = "dart:red:sata0";
+                       gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
+               };
+               red-sata1 {
+                       label = "dart:red:sata1";
+                       gpios = <&gpio1 21 GPIO_ACTIVE_LOW>;
+               };
+       };
+
+       gpio_poweroff {
+               compatible = "gpio-poweroff";
+               gpios = <&gpio1 30 GPIO_ACTIVE_LOW>;
+       };
+};
+
+&pinctrl {
+       pinctrl-0 = <&hdd0_led_sata_pin>, <&hdd1_led_sata_pin>;
+       pinctrl-names = "default";
+
+       hdd0_led_sata_pin: hdd0-led-sata-pin {
+               marvell,pins = "mpp48";
+               marvell,function = "sata1";
+       };
+       hdd0_led_gpio_pin: hdd0-led-gpio-pin {
+               marvell,pins = "mpp48";
+               marvell,function = "gpio";
+       };
+       hdd1_led_sata_pin: hdd1-led-sata-pin {
+               marvell,pins = "mpp57";
+               marvell,function = "sata0";
+       };
+       hdd1_led_gpio_pin: hdd1-led-gpio-pin {
+               marvell,pins = "mpp57";
+               marvell,function = "gpio";
+       };
+};
diff --git a/arch/arm/boot/dts/armada-370-seagate-personal-cloud-2bay.dts b/arch/arm/boot/dts/armada-370-seagate-personal-cloud-2bay.dts
new file mode 100644 (file)
index 0000000..3c91f98
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+ * Device Tree file for Seagate Personal Cloud NAS 2-Bay (Armada 370 SoC).
+ *
+ * Copyright (C) 2015 Seagate
+ *
+ * Author: Simon Guinot <simon.guinot@sequanux.org>
+ *
+ * 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.
+ */
+
+/*
+ * Here are some information allowing to identify the device:
+ *
+ * Product name                 : Seagate Personal Cloud 2-Bay
+ * Code name (board/PCB)        : Cumulus Max
+ * Model name (case sticker)    : SRN22C
+ * Material desc (product spec) : STCSxxxxxxx
+ */
+
+/dts-v1/;
+#include "armada-370-seagate-personal-cloud.dtsi"
+
+/ {
+       model = "Seagate Personal Cloud 2-Bay (Cumulus, SRN22C)";
+       compatible = "seagate,cumulus-max", "marvell,armada370", "marvell,armada-370-xp";
+
+       soc {
+               internal-regs {
+                       sata@a0000 {
+                               status = "okay";
+                               nr-ports = <2>;
+                       };
+               };
+       };
+
+       regulators {
+               regulator@2 {
+                       compatible = "regulator-fixed";
+                       reg = <2>;
+                       regulator-name = "SATA1 power";
+                       regulator-min-microvolt = <5000000>;
+                       regulator-max-microvolt = <5000000>;
+                       enable-active-high;
+                       regulator-always-on;
+                       regulator-boot-on;
+                       gpio = <&gpio1 22 GPIO_ACTIVE_HIGH>;
+               };
+       };
+};
diff --git a/arch/arm/boot/dts/armada-370-seagate-personal-cloud.dts b/arch/arm/boot/dts/armada-370-seagate-personal-cloud.dts
new file mode 100644 (file)
index 0000000..aad39e9
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * Device Tree file for Seagate Personal Cloud NAS (Armada 370 SoC).
+ *
+ * Copyright (C) 2015 Seagate
+ *
+ * Author: Simon Guinot <simon.guinot@sequanux.org>
+ *
+ * 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.
+ */
+
+/*
+ * Here are some information allowing to identify the device:
+ *
+ * Product name                 : Seagate Personal Cloud
+ * Code name (board/PCB)        : Cumulus
+ * Model name (case sticker)    : SRN21C
+ * Material desc (product spec) : STCRxxxxxxx
+ */
+
+/dts-v1/;
+#include "armada-370-seagate-personal-cloud.dtsi"
+
+/ {
+       model = "Seagate Personal Cloud (Cumulus, SRN21C)";
+       compatible = "seagate,cumulus", "marvell,armada370", "marvell,armada-370-xp";
+
+       soc {
+               internal-regs {
+                       sata@a0000 {
+                               status = "okay";
+                               nr-ports = <1>;
+                       };
+               };
+       };
+};
diff --git a/arch/arm/boot/dts/armada-370-seagate-personal-cloud.dtsi b/arch/arm/boot/dts/armada-370-seagate-personal-cloud.dtsi
new file mode 100644 (file)
index 0000000..1aba08e
--- /dev/null
@@ -0,0 +1,178 @@
+/*
+ * Device Tree common file for the Seagate Personal Cloud NAS 1 and 2-Bay
+ * (Armada 370 SoC).
+ *
+ * Copyright (C) 2015 Seagate
+ *
+ * Author: Simon Guinot <simon.guinot@sequanux.org>
+ *
+ * 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.
+ */
+
+/*
+ * TODO: add support for the white SATA LED.
+ */
+
+#include "armada-370.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       memory {
+               device_type = "memory";
+               reg = <0x00000000 0x20000000>; /* 512 MB */
+       };
+
+       soc {
+               ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000
+                         MBUS_ID(0x01, 0xe0) 0 0xfff00000 0x100000>;
+
+               pcie-controller {
+                       status = "okay";
+
+                       /* USB 3.0 Bridge ASM1042A */
+                       pcie@1,0 {
+                               status = "okay";
+                       };
+               };
+
+               internal-regs {
+                       coherency-fabric@20200 {
+                               broken-idle;
+                       };
+
+                       serial@12000 {
+                               status = "okay";
+                       };
+
+                       mdio {
+                               pinctrl-0 = <&mdio_pins>;
+                               pinctrl-names = "default";
+
+                               phy0: ethernet-phy@0 {
+                                       reg = <0>;
+                               };
+                       };
+
+                       ethernet@74000 {
+                               status = "okay";
+                               pinctrl-0 = <&ge1_rgmii_pins>;
+                               pinctrl-names = "default";
+                               phy = <&phy0>;
+                               phy-mode = "rgmii-id";
+                       };
+
+                       spi@10600 {
+                               status = "okay";
+                               pinctrl-0 = <&spi0_pins2>;
+                               pinctrl-names = "default";
+
+                               spi-flash@0 {
+                                       #address-cells = <1>;
+                                       #size-cells = <1>;
+                                       /* MX25L8006E */
+                                       compatible = "mxicy,mx25l8005", "jedec,spi-nor";
+                                       reg = <0>; /* Chip select 0 */
+                                       spi-max-frequency = <50000000>;
+
+                                       partition@0 {
+                                               label = "u-boot";
+                                               reg = <0x0 0x100000>;
+                                       };
+                               };
+                       };
+
+                       usb@50000 {
+                               status = "okay";
+                       };
+               };
+       };
+
+       regulators {
+               compatible = "simple-bus";
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               regulator@0 {
+                       compatible = "regulator-fixed";
+                       reg = <0>;
+                       regulator-name = "USB Power";
+                       regulator-min-microvolt = <5000000>;
+                       regulator-max-microvolt = <5000000>;
+                       regulator-always-on;
+                       regulator-boot-on;
+                       gpio = <&gpio1 27 GPIO_ACTIVE_LOW>;
+               };
+               regulator@1 {
+                       compatible = "regulator-fixed";
+                       reg = <1>;
+                       regulator-name = "SATA0 power";
+                       regulator-min-microvolt = <5000000>;
+                       regulator-max-microvolt = <5000000>;
+                       enable-active-high;
+                       regulator-always-on;
+                       regulator-boot-on;
+                       gpio = <&gpio1 18 GPIO_ACTIVE_HIGH>;
+               };
+       };
+
+       gpio-keys {
+               compatible = "gpio-keys";
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               button@1 {
+                       label = "Power button";
+                       linux,code = <KEY_POWER>;
+                       gpios = <&gpio1 19 GPIO_ACTIVE_HIGH>;
+                       debounce-interval = <100>;
+               };
+               button@2 {
+                       label = "Reset Button";
+                       linux,code = <KEY_RESTART>;
+                       gpios = <&gpio1 23 GPIO_ACTIVE_LOW>;
+                       debounce-interval = <100>;
+               };
+               button@3 {
+                       label = "USB VBUS error";
+                       linux,code = <KEY_UNKNOWN>;
+                       gpios = <&gpio1 21 GPIO_ACTIVE_LOW>;
+                       debounce-interval = <100>;
+               };
+       };
+
+       gpio-leds {
+               compatible = "gpio-leds";
+
+               red-sata0 {
+                       label = "cumulus:red:sata0";
+                       gpios = <&gpio1 26 GPIO_ACTIVE_HIGH>;
+                       default-state = "off";
+               };
+       };
+
+       gpio_poweroff {
+               compatible = "gpio-poweroff";
+               gpios = <&gpio1 25 GPIO_ACTIVE_HIGH>;
+       };
+};
+
+&pinctrl {
+       pinctrl-0 = <&sata_led_pin>;
+       pinctrl-names = "default";
+
+       sata_led_pin: sata-led-pin {
+               marvell,pins = "mpp60";
+               marvell,function = "sata0";
+       };
+       gpio_led_pin: gpio-led-pin {
+               marvell,pins = "mpp60";
+               marvell,function = "gpio";
+       };
+};
index 4f4924362bf0efc441dca115b23a606cb442d493..836bcc07afc5babe199baaea184b3149d6020dbd 100644 (file)
@@ -77,7 +77,8 @@
 
        soc {
                ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000
-                         MBUS_ID(0x01, 0xe0) 0 0xfff00000 0x100000>;
+                         MBUS_ID(0x01, 0xe0) 0 0xfff00000 0x100000
+                         MBUS_ID(0x09, 0x01) 0 0xf1100000 0x10000>;
 
                internal-regs {
 
index 53a1a5abe14739d5c71a64b9689147fa7f0c37cb..3b06aa835448084b04e5a4ddaf647110c3a87909 100644 (file)
                                reg = <0x20800 0x8>;
                        };
 
+                       cpu-config@21000 {
+                               compatible = "marvell,armada-370-cpu-config";
+                               reg = <0x21000 0x8>;
+                       };
+
                        audio_controller: audio-controller@30000 {
                                #sound-dai-cells = <1>;
                                compatible = "marvell,armada370-audio";
                        ethernet@74000 {
                                compatible = "marvell,armada-370-neta";
                        };
+
+                       crypto@90000 {
+                               compatible = "marvell,armada-370-crypto";
+                               reg = <0x90000 0x10000>;
+                               reg-names = "regs";
+                               interrupts = <48>;
+                               clocks = <&gateclk 23>;
+                               clock-names = "cesa0";
+                               marvell,crypto-srams = <&crypto_sram>;
+                               marvell,crypto-sram-size = <0x7e0>;
+                       };
+               };
+
+               crypto_sram: sa-sram {
+                       compatible = "mmio-sram";
+                       reg = <MBUS_ID(0x09, 0x01) 0 0x800>;
+                       reg-names = "sram";
+                       clocks = <&gateclk 23>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges = <0 MBUS_ID(0x09, 0x01) 0 0x800>;
+
+                       /*
+                        * The Armada 370 has an erratum preventing the use of
+                        * the standard workflow for CPU idle support (relying
+                        * on the BootROM code to enter/exit idle state).
+                        * Reserve some amount of the crypto SRAM to put the
+                        * cpuidle workaround.
+                        */
+                       idle-sram@0 {
+                               reg = <0x0 0x20>;
+                       };
                };
        };
 };
index 5711b97e876c1ceaa9e3a16da42709ebcf6b654a..cded5f0a262dfce4d47bd009ffdfaaaad1562036 100644 (file)
@@ -65,7 +65,9 @@
 
        soc {
                ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000
-                         MBUS_ID(0x01, 0x1d) 0 0xfff00000 0x100000>;
+                         MBUS_ID(0x01, 0x1d) 0 0xfff00000 0x100000
+                         MBUS_ID(0x09, 0x09) 0 0xf1100000 0x10000
+                         MBUS_ID(0x09, 0x05) 0 0xf1110000 0x10000>;
 
                internal-regs {
                        spi@10600 {
index e9a381741ce12e2eba5108aebf9517e6a4a1aa6c..7ccce7529b0c8debe46f6d4d28c9d51b143738cf 100644 (file)
                                };
                        };
 
+                       crypto@90000 {
+                               compatible = "marvell,armada-375-crypto";
+                               reg = <0x90000 0x10000>;
+                               reg-names = "regs";
+                               interrupts = <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>,
+                                            <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>;
+                               clocks = <&gateclk 30>, <&gateclk 31>,
+                                        <&gateclk 28>, <&gateclk 29>;
+                               clock-names = "cesa0", "cesa1",
+                                             "cesaz0", "cesaz1";
+                               marvell,crypto-srams = <&crypto_sram0>,
+                                                      <&crypto_sram1>;
+                               marvell,crypto-sram-size = <0x800>;
+                       };
+
                        sata@a0000 {
                                compatible = "marvell,orion-sata";
                                reg = <0xa0000 0x5000>;
                        };
 
                };
+
+               crypto_sram0: sa-sram0 {
+                       compatible = "mmio-sram";
+                       reg = <MBUS_ID(0x09, 0x09) 0 0x800>;
+                       clocks = <&gateclk 30>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges = <0 MBUS_ID(0x09, 0x09) 0 0x800>;
+               };
+
+               crypto_sram1: sa-sram1 {
+                       compatible = "mmio-sram";
+                       reg = <MBUS_ID(0x09, 0x05) 0 0x800>;
+                       clocks = <&gateclk 31>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges = <0 MBUS_ID(0x09, 0x05) 0 0x800>;
+               };
        };
 };
index 4047621b137e6b107f875dc2f7c82292752bf448..acd5b1519edb2be2f4cd58246fba337a7059ffa1 100644 (file)
@@ -59,7 +59,9 @@
 
        soc {
                ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000
-                         MBUS_ID(0x01, 0x1d) 0 0xfff00000 0x100000>;
+                         MBUS_ID(0x01, 0x1d) 0 0xfff00000 0x100000
+                         MBUS_ID(0x09, 0x19) 0 0xf1100000 0x10000
+                         MBUS_ID(0x09, 0x15) 0 0xf1110000 0x10000>;
 
                internal-regs {
                        spi1: spi@10680 {
index 74a9c6b54fa7c26c8ba24c1e2cfa08dd6259768d..3710755c6d76b52fe339ea8f8f71d7dd8a1dc0ec 100644 (file)
@@ -57,7 +57,9 @@
 
        soc {
                ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000
-                         MBUS_ID(0x01, 0x1d) 0 0xfff00000 0x100000>;
+                         MBUS_ID(0x01, 0x1d) 0 0xfff00000 0x100000
+                         MBUS_ID(0x09, 0x09) 0 0xf1100000 0x10000
+                         MBUS_ID(0x09, 0x05) 0 0xf1110000 0x10000>;
 
                internal-regs {
 
index 91ac8c118f37de9732495d3201d10dd1d63f7a2a..ff47af57f091afd342eed3987a8c40ea404fca7c 100644 (file)
@@ -64,7 +64,9 @@
 
        soc {
                ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000
-                         MBUS_ID(0x01, 0x1d) 0 0xfff00000 0x100000>;
+                         MBUS_ID(0x01, 0x1d) 0 0xfff00000 0x100000
+                         MBUS_ID(0x09, 0x19) 0 0xf1100000 0x10000
+                         MBUS_ID(0x09, 0x15) 0 0xf1110000 0x10000>;
 
                internal-regs {
                        spi@10600 {
index 353c92532e7af9770301daba7a588770cd90b1cd..a633be3defda4b5c6015ec0b85f5b74a7ad2d82e 100644 (file)
@@ -58,7 +58,9 @@
 
        soc {
                ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000
-                         MBUS_ID(0x01, 0x1d) 0 0xfff00000 0x100000>;
+                         MBUS_ID(0x01, 0x1d) 0 0xfff00000 0x100000
+                         MBUS_ID(0x09, 0x19) 0 0xf1100000 0x10000
+                         MBUS_ID(0x09, 0x15) 0 0xf1110000 0x10000>;
 
                internal-regs {
                        spi@10600 {
                        sdhci@d8000 {
                                pinctrl-names = "default";
                                pinctrl-0 = <&sdhci_pins>;
-                               cd-gpios = <&expander0 5 GPIO_ACTIVE_LOW>;
                                no-1-8-v;
+                               /*
+                                * A388-GP board v1.5 and higher replace
+                                * hitherto card detection method based on GPIO
+                                * with the one using DAT3 pin. As they are
+                                * incompatible, software-based polling is
+                                * enabled with 'broken-cd' property. For boards
+                                * older than v1.5 it can be replaced with:
+                                * 'cd-gpios = <&expander0 5 GPIO_ACTIVE_LOW>;',
+                                * whereas for the newer ones following can be
+                                * used instead:
+                                * 'dat3-cd;'
+                                * 'cd-inverted;'
+                                */
+                               broken-cd;
                                wp-inverted;
                                bus-width = <8>;
                                status = "okay";
index b657b1687e5f95fe3f35214a5eec0bd288192213..853f9735cc706a6858a2f95fca1f4e88e7bcf958 100644 (file)
@@ -65,7 +65,9 @@
 
        soc {
                ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000
-                         MBUS_ID(0x01, 0x1d) 0 0xfff00000 0x100000>;
+                         MBUS_ID(0x01, 0x1d) 0 0xfff00000 0x100000
+                         MBUS_ID(0x09, 0x19) 0 0xf1100000 0x10000
+                         MBUS_ID(0x09, 0x15) 0 0xf1110000 0x10000>;
 
                internal-regs {
                        spi@10600 {
index f9f2347d9995a824cb53a7ceb7bf3cf907e85685..c6a0e9d7f1a9bd0409b31bb4272bfbcb68f3b093 100644 (file)
                                clocks = <&gateclk 4>;
                        };
 
+                       crypto@90000 {
+                               compatible = "marvell,armada-38x-crypto";
+                               reg = <0x90000 0x10000>;
+                               reg-names = "regs";
+                               interrupts = <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>,
+                                            <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>;
+                               clocks = <&gateclk 23>, <&gateclk 21>,
+                                        <&gateclk 14>, <&gateclk 16>;
+                               clock-names = "cesa0", "cesa1",
+                                             "cesaz0", "cesaz1";
+                               marvell,crypto-srams = <&crypto_sram0>,
+                                                      <&crypto_sram1>;
+                               marvell,crypto-sram-size = <0x800>;
+                       };
+
                        rtc@a3800 {
                                compatible = "marvell,armada-380-rtc";
                                reg = <0xa3800 0x20>, <0x184a0 0x0c>;
                                status = "disabled";
                        };
                };
+
+               crypto_sram0: sa-sram0 {
+                       compatible = "mmio-sram";
+                       reg = <MBUS_ID(0x09, 0x19) 0 0x800>;
+                       clocks = <&gateclk 23>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges = <0 MBUS_ID(0x09, 0x19) 0 0x800>;
+               };
+
+               crypto_sram1: sa-sram1 {
+                       compatible = "mmio-sram";
+                       reg = <MBUS_ID(0x09, 0x15) 0 0x800>;
+                       clocks = <&gateclk 21>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges = <0 MBUS_ID(0x09, 0x15) 0 0x800>;
+               };
        };
 
        clocks {
index 60bbfe32bb802d89f016635134f1dfd2b108e902..23fc670c0427710168ce41ef012f9e37b8218eb6 100644 (file)
@@ -69,7 +69,9 @@
 
        soc {
                ranges = <MBUS_ID(0xf0, 0x01) 0 0 0xf1000000 0x100000
-                         MBUS_ID(0x01, 0x1d) 0 0 0xfff00000 0x100000>;
+                         MBUS_ID(0x01, 0x1d) 0 0 0xfff00000 0x100000
+                         MBUS_ID(0x09, 0x09) 0 0 0xf8100000 0x10000
+                         MBUS_ID(0x09, 0x05) 0 0 0xf8110000 0x10000>;
 
                pcie-controller {
                        status = "okay";
index 7dd900f158be6f9be4a5d4074f5bbc880a19bbba..f774101416a5522841c475252d0a86842e475b29 100644 (file)
@@ -75,7 +75,9 @@
        soc {
                ranges = <MBUS_ID(0xf0, 0x01) 0 0 0xf1000000 0x100000
                          MBUS_ID(0x01, 0x1d) 0 0 0xfff00000 0x100000
-                         MBUS_ID(0x01, 0x2f) 0 0 0xf0000000 0x1000000>;
+                         MBUS_ID(0x01, 0x2f) 0 0 0xf0000000 0x1000000
+                         MBUS_ID(0x09, 0x09) 0 0 0xf8100000 0x10000
+                         MBUS_ID(0x09, 0x05) 0 0 0xf8110000 0x10000>;
 
                devbus-bootcs {
                        status = "okay";
index bf724ca96a331fa7410e36b7c08169bf360efe92..4878d7353069fc2720e15d76af307618daced15c 100644 (file)
@@ -94,7 +94,9 @@
        soc {
                ranges = <MBUS_ID(0xf0, 0x01) 0 0 0xf1000000 0x100000
                          MBUS_ID(0x01, 0x1d) 0 0 0xfff00000 0x100000
-                         MBUS_ID(0x01, 0x2f) 0 0 0xf0000000 0x1000000>;
+                         MBUS_ID(0x01, 0x2f) 0 0 0xf0000000 0x1000000
+                         MBUS_ID(0x09, 0x09) 0 0 0xf8100000 0x10000
+                         MBUS_ID(0x09, 0x05) 0 0 0xf8110000 0x10000>;
 
                devbus-bootcs {
                        status = "okay";
index 06a6a6c1fdf709446ed713fd189a1471e6509fd3..58b500873bfd57f2787080a9229d58e5785acbe2 100644 (file)
@@ -64,7 +64,9 @@
 
        soc {
                ranges = <MBUS_ID(0xf0, 0x01) 0 0 0xd0000000 0x100000
-                       MBUS_ID(0x01, 0x1d) 0 0 0xfff00000 0x100000>;
+                       MBUS_ID(0x01, 0x1d) 0 0 0xfff00000 0x100000
+                       MBUS_ID(0x09, 0x09) 0 0 0xf8100000 0x10000
+                       MBUS_ID(0x09, 0x05) 0 0 0xf8110000 0x10000>;
 
                pcie-controller {
                        status = "okay";
index fdd187c55aa5f78b5ab61d15dc12c1ad001990d2..6e9820e141f8de5a850edcd7e74f0ea2a1acd1ed 100644 (file)
@@ -69,7 +69,9 @@
 
        soc {
                ranges = <MBUS_ID(0xf0, 0x01) 0 0 0xf1000000 0x100000
-                         MBUS_ID(0x01, 0x1d) 0 0 0xfff00000 0x100000>;
+                         MBUS_ID(0x01, 0x1d) 0 0 0xfff00000 0x100000
+                         MBUS_ID(0x09, 0x09) 0 0 0xf8100000 0x10000
+                         MBUS_ID(0x09, 0x05) 0 0 0xf8110000 0x10000>;
 
                pcie-controller {
                        status = "okay";
index f894bc83e957554a55a8a155cc0cdb0c1d1d0d0e..6ab33837a2b6d0a5aaf4e48763bb838451a346bd 100644 (file)
@@ -67,7 +67,9 @@
 
        soc {
                ranges = <MBUS_ID(0xf0, 0x01) 0 0 0xf1000000 0x100000
-                         MBUS_ID(0x01, 0x1d) 0 0 0xfff00000 0x100000>;
+                         MBUS_ID(0x01, 0x1d) 0 0 0xfff00000 0x100000
+                         MBUS_ID(0x09, 0x09) 0 0 0xf8100000 0x10000
+                         MBUS_ID(0x09, 0x05) 0 0 0xf8110000 0x10000>;
 
                internal-regs {
                        serial@12000 {
index 1516fc2627f99f0d068fbc2d96c897c9112dc0e7..6fe8972de0a219688fe76c1d0c0cb0944056270f 100644 (file)
@@ -63,7 +63,9 @@
 
        soc {
                ranges = <MBUS_ID(0xf0, 0x01) 0 0 0xd0000000 0x100000
-                         MBUS_ID(0x01, 0x1d) 0 0 0xfff00000 0x100000>;
+                         MBUS_ID(0x01, 0x1d) 0 0 0xfff00000 0x100000
+                         MBUS_ID(0x09, 0x09) 0 0 0xf8100000 0x10000
+                         MBUS_ID(0x09, 0x05) 0 0 0xf8110000 0x10000>;
 
                pcie-controller {
                        status = "okay";
                };
 
                internal-regs {
-                       /* Two rear eSATA ports */
-                       sata@a0000 {
-                               nr-ports = <2>;
-                               status = "okay";
-                       };
-
-                       serial@12000 {
-                               status = "okay";
-                       };
-
-                       mdio {
-                               phy0: ethernet-phy@0 { /* Marvell 88E1318 */
-                                       reg = <0>;
-                               };
-
-                               phy1: ethernet-phy@1 { /* Marvell 88E1318 */
-                                       reg = <1>;
-                               };
-                       };
-
-                       ethernet@70000 {
-                               status = "okay";
-                               phy = <&phy0>;
-                               phy-mode = "rgmii-id";
-                       };
 
-                       ethernet@74000 {
-                               status = "okay";
-                               phy = <&phy1>;
-                               phy-mode = "rgmii-id";
-                       };
-
-                       /* Front USB 2.0 port */
-                       usb@50000 {
-                               status = "okay";
+                       /* RTC is provided by Intersil ISL12057 I2C RTC chip */
+                       rtc@10300 {
+                               status = "disabled";
                        };
 
                        i2c@11000 {
                                clock-frequency = <400000>;
                                status = "okay";
 
-                               isl12057: isl12057@68 {
-                                       compatible = "isil,isl12057";
-                                       reg = <0x68>;
-                                       isil,irq2-can-wakeup-machine;
-                               };
-
                                /* Controller for rear fan #1 of 3 (Protechnic
                                 * MGT4012XB-O20, 8000RPM) near eSATA port */
                                g762_fan1: g762@3e {
                                        compatible = "gmt,g751";
                                        reg = <0x4c>;
                                };
+
+                               isl12057: isl12057@68 {
+                                       compatible = "isil,isl12057";
+                                       reg = <0x68>;
+                                       isil,irq2-can-wakeup-machine;
+                               };
+                       };
+
+                       serial@12000 {
+                               status = "okay";
+                       };
+
+                       /* Front USB 2.0 port */
+                       usb@50000 {
+                               status = "okay";
+                       };
+
+                       mdio {
+                               phy0: ethernet-phy@0 { /* Marvell 88E1318 */
+                                       reg = <0>;
+                               };
+
+                               phy1: ethernet-phy@1 { /* Marvell 88E1318 */
+                                       reg = <1>;
+                               };
+                       };
+
+                       ethernet@70000 {
+                               status = "okay";
+                               phy = <&phy0>;
+                               phy-mode = "rgmii-id";
+                       };
+
+                       ethernet@74000 {
+                               status = "okay";
+                               phy = <&phy1>;
+                               phy-mode = "rgmii-id";
+                       };
+
+                       /* Two rear eSATA ports */
+                       sata@a0000 {
+                               nr-ports = <2>;
+                               status = "okay";
                        };
 
                        nand@d0000 {
index 990e8a2100f0f3cff6c50989761d6b78838e4bd8..a5db17782e085662d01a22683c5c364be5c25c8c 100644 (file)
@@ -65,7 +65,9 @@
        soc {
                ranges = <MBUS_ID(0xf0, 0x01) 0 0 0xd0000000 0x100000
                          MBUS_ID(0x01, 0x1d) 0 0 0xfff00000 0x100000
-                         MBUS_ID(0x01, 0x2f) 0 0 0xf0000000 0x8000000>;
+                         MBUS_ID(0x01, 0x2f) 0 0 0xf0000000 0x8000000
+                         MBUS_ID(0x09, 0x09) 0 0 0xf8100000 0x10000
+                         MBUS_ID(0x09, 0x05) 0 0 0xf8110000 0x10000>;
 
                devbus-bootcs {
                        status = "okay";
index 20267ad2f61eb3679227e4e3afd527b80da87de4..2391b11dc546b859dd3ab23a700be5a8a63ea83b 100644 (file)
@@ -77,7 +77,9 @@
 
        soc {
                ranges = <MBUS_ID(0xf0, 0x01) 0 0 0xf1000000 0x100000
-                         MBUS_ID(0x01, 0x1d) 0 0 0xfff00000 0x100000>;
+                         MBUS_ID(0x01, 0x1d) 0 0 0xfff00000 0x100000
+                         MBUS_ID(0x09, 0x09) 0 0 0xf8100000 0x10000
+                         MBUS_ID(0x09, 0x05) 0 0 0xf8110000 0x10000>;
 
                pcie-controller {
                        status = "okay";
index 3de9b761cc1ab0fe7a8d3f0ea9caa7ca72e2a989..be23196829bbd7b492a192c85f3154ab26917b49 100644 (file)
                                reg = <0x20800 0x20>;
                        };
 
+                       cpu-config@21000 {
+                               compatible = "marvell,armada-xp-cpu-config";
+                               reg = <0x21000 0x8>;
+                       };
+
                        eth2: ethernet@30000 {
                                compatible = "marvell,armada-xp-neta";
                                reg = <0x30000 0x4000>;
                                compatible = "marvell,armada-xp-neta";
                        };
 
+                       crypto@90000 {
+                               compatible = "marvell,armada-xp-crypto";
+                               reg = <0x90000 0x10000>;
+                               reg-names = "regs";
+                               interrupts = <48>, <49>;
+                               clocks = <&gateclk 23>, <&gateclk 23>;
+                               clock-names = "cesa0", "cesa1";
+                               marvell,crypto-srams = <&crypto_sram0>,
+                                                      <&crypto_sram1>;
+                               marvell,crypto-sram-size = <0x800>;
+                       };
+
                        xor@f0900 {
                                compatible = "marvell,orion-xor";
                                reg = <0xF0900 0x100
                                };
                        };
                };
+
+               crypto_sram0: sa-sram0 {
+                       compatible = "mmio-sram";
+                       reg = <MBUS_ID(0x09, 0x09) 0 0x800>;
+                       clocks = <&gateclk 23>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges = <0 MBUS_ID(0x09, 0x09) 0 0x800>;
+               };
+
+               crypto_sram1: sa-sram1 {
+                       compatible = "mmio-sram";
+                       reg = <MBUS_ID(0x09, 0x05) 0 0x800>;
+                       clocks = <&gateclk 23>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges = <0 MBUS_ID(0x09, 0x05) 0 0x800>;
+               };
        };
 
        clocks {
index e8d63afdb135f1d9158149391020c5b71db50343..e07c2b206beba18c8a139574aa8bc83f74c23545 100644 (file)
@@ -44,6 +44,7 @@
  */
 /dts-v1/;
 #include "sama5d2.dtsi"
+#include "sama5d2-pinfunc.h"
 
 / {
        model = "Atmel SAMA5D2 Xplained";
@@ -92,6 +93,8 @@
 
                apb {
                        spi0: spi@f8000000 {
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&pinctrl_spi0_default>;
                                status = "okay";
 
                                m25p80@0 {
                        };
 
                        macb0: ethernet@f8008000 {
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&pinctrl_macb0_default>;
                                phy-mode = "rmii";
                                status = "okay";
                        };
 
                        uart1: serial@f8020000 {
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&pinctrl_uart1_default>;
                                status = "okay";
                        };
 
                        i2c0: i2c@f8028000 {
                                dmas = <0>, <0>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&pinctrl_i2c0_default>;
                                status = "okay";
+
+                               pmic: act8865@5b {
+                                       compatible = "active-semi,act8865";
+                                       reg = <0x5b>;
+                                       active-semi,vsel-high;
+                                       status = "okay";
+
+                                       regulators {
+                                               vdd_1v35_reg: DCDC_REG1 {
+                                                       regulator-name = "VDD_1V35";
+                                                       regulator-min-microvolt = <1350000>;
+                                                       regulator-max-microvolt = <1350000>;
+                                                       regulator-always-on;
+                                               };
+
+                                               vdd_1v2_reg: DCDC_REG2 {
+                                                       regulator-name = "VDD_1V2";
+                                                       regulator-min-microvolt = <1100000>;
+                                                       regulator-max-microvolt = <1300000>;
+                                                       regulator-always-on;
+                                               };
+
+                                               vdd_3v3_reg: DCDC_REG3 {
+                                                       regulator-name = "VDD_3V3";
+                                                       regulator-min-microvolt = <3300000>;
+                                                       regulator-max-microvolt = <3300000>;
+                                                       regulator-always-on;
+                                               };
+
+                                               vdd_fuse_reg: LDO_REG1 {
+                                                       regulator-name = "VDD_FUSE";
+                                                       regulator-min-microvolt = <2500000>;
+                                                       regulator-max-microvolt = <2500000>;
+                                                       regulator-always-on;
+                                               };
+
+                                               vdd_3v3_lp_reg: LDO_REG2 {
+                                                       regulator-name = "VDD_3V3_LP";
+                                                       regulator-min-microvolt = <3300000>;
+                                                       regulator-max-microvolt = <3300000>;
+                                                       regulator-always-on;
+                                               };
+
+                                               vdd_led_reg: LDO_REG3 {
+                                                       regulator-name = "VDD_LED";
+                                                       regulator-min-microvolt = <3300000>;
+                                                       regulator-max-microvolt = <3300000>;
+                                                       regulator-always-on;
+                                               };
+
+                                               vdd_sdhc_1v8_reg: LDO_REG4 {
+                                                       regulator-name = "VDD_SDHC_1V8";
+                                                       regulator-min-microvolt = <1800000>;
+                                                       regulator-max-microvolt = <1800000>;
+                                               };
+                                       };
+                               };
                        };
 
                        uart3: serial@fc008000 {
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&pinctrl_uart3_default>;
                                status = "okay";
                        };
 
                        i2c1: i2c@fc028000 {
                                dmas = <0>, <0>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&pinctrl_i2c1_default>;
                                status = "okay";
 
                                at24@54 {
                                        pagesize = <16>;
                                };
                        };
+
+                       pinctrl@fc038000 {
+                               pinctrl_i2c0_default: i2c0_default {
+                                       pinmux = <PIN_PD21__TWD0>,
+                                                <PIN_PD22__TWCK0>;
+                                       bias-disable;
+                               };
+
+                               pinctrl_i2c1_default: i2c1_default {
+                                       pinmux = <PIN_PD4__TWD1>,
+                                                <PIN_PD5__TWCK1>;
+                                       bias-disable;
+                               };
+
+                               pinctrl_macb0_default: macb0_default {
+                                       pinmux = <PIN_PB14__GTXCK>,
+                                                <PIN_PB15__GTXEN>,
+                                                <PIN_PB16__GRXDV>,
+                                                <PIN_PB17__GRXER>,
+                                                <PIN_PB18__GRX0>,
+                                                <PIN_PB19__GRX1>,
+                                                <PIN_PB20__GTX0>,
+                                                <PIN_PB21__GTX1>,
+                                                <PIN_PB22__GMDC>,
+                                                <PIN_PB23__GMDIO>;
+                                       bias-disable;
+                               };
+
+                               pinctrl_spi0_default: spi0_default {
+                                       pinmux = <PIN_PA14__SPI0_SPCK>,
+                                                <PIN_PA15__SPI0_MOSI>,
+                                                <PIN_PA16__SPI0_MISO>,
+                                                <PIN_PA17__SPI0_NPCS0>;
+                                       bias-disable;
+                               };
+
+                               pinctrl_uart1_default: uart1_default {
+                                       pinmux = <PIN_PD2__URXD1>,
+                                                <PIN_PD3__UTXD1>;
+                                       bias-disable;
+                               };
+
+                               pinctrl_uart3_default: uart3_default {
+                                       pinmux = <PIN_PB11__URXD3>,
+                                                <PIN_PB12__UTXD3>;
+                                       bias-disable;
+                               };
+                       };
                };
        };
 };
index d81474e0bcd6007eee98ac1a57525dd7cc08d1ac..8488ac53d22d3b4d6f0562ebd9018d3126ce5ee2 100644 (file)
@@ -76,7 +76,7 @@
                                pmic: act8865@5b {
                                        compatible = "active-semi,act8865";
                                        reg = <0x5b>;
-                                       status = "okay";
+                                       status = "disabled";
 
                                        regulators {
                                                vcc_1v8_reg: DCDC_REG1 {
index 07f46963335bb6c98e305e9e4c1fb9bb613344f2..45371a1b61b398b6b939292649b20d0315cd399b 100644 (file)
                d8 {
                        label = "d8";
                        gpios = <&pioD 30 GPIO_ACTIVE_HIGH>;
-                       status = "disabled";
+                       default-state = "on";
                };
 
                d10 {
index 49a59c7e4a5d1e3dcbac72585e799bbf00f0e78a..6d272c0125e365b64aad7dadbeec309c51c60fc6 100644 (file)
                                        clocks = <&pck2>;
                                        clock-names = "mclk";
                                };
+
+                               qt1070:keyboard@1b {
+                                       compatible = "qt1070";
+                                       reg = <0x1b>;
+                                       interrupt-parent = <&pioE>;
+                                       interrupts = <25 0x0>;
+                                       pinctrl-names = "default";
+                                       pinctrl-0 = <&pinctrl_qt1070_irq>;
+                                       wakeup-source;
+                               };
+
+                               atmel_mxt_ts@4c {
+                                       compatible = "atmel,atmel_mxt_ts";
+                                       reg = <0x4c>;
+                                       interrupt-parent = <&pioE>;
+                                       interrupts = <24 0x0>;
+                                       pinctrl-names = "default";
+                                       pinctrl-0 = <&pinctrl_mxt_ts>;
+                               };
                        };
 
                        macb0: ethernet@f8020000 {
                                                atmel,pins =
                                                        <AT91_PIOE 13 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP_DEGLITCH>; /* PE13 gpio */
                                        };
+                                       pinctrl_qt1070_irq: qt1070_irq {
+                                               atmel,pins =
+                                                       <AT91_PIOE 25 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP_DEGLITCH>;
+                                       };
+                                       pinctrl_mxt_ts: mxt_irq {
+                                               atmel,pins =
+                                                       <AT91_PIOE 24 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP_DEGLITCH>;
+                                       };
                                };
                        };
                };
index 60edd8baebb81a7d3a4291c7442c6cb618790352..f6cb7a80a2f55abdf23214fc3d5b58ec89b8dc80 100644 (file)
@@ -97,7 +97,7 @@
                        };
 
                        pmc: pmc@fffffc00 {
-                               compatible = "atmel,at91rm9200-pmc";
+                               compatible = "atmel,at91rm9200-pmc", "syscon";
                                reg = <0xfffffc00 0x100>;
                                interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
                                interrupt-controller;
                                pinctrl-0 = <&pinctrl_ssc0_tx &pinctrl_ssc0_rx>;
                                clocks = <&ssc0_clk>;
                                clock-names = "pclk";
-                               status = "disable";
+                               status = "disabled";
                        };
 
                        ssc1: ssc@fffd4000 {
                                pinctrl-0 = <&pinctrl_ssc1_tx &pinctrl_ssc1_rx>;
                                clocks = <&ssc1_clk>;
                                clock-names = "pclk";
-                               status = "disable";
+                               status = "disabled";
                        };
 
                        ssc2: ssc@fffd8000 {
                                pinctrl-0 = <&pinctrl_ssc2_tx &pinctrl_ssc2_rx>;
                                clocks = <&ssc2_clk>;
                                clock-names = "pclk";
-                               status = "disable";
+                               status = "disabled";
                        };
 
                        macb0: ethernet@fffbc000 {
index be9c027ddd979c75173a061ea4b574006083d8e5..d4884dd1c24394c6e5ac630164f8940742758a6e 100644 (file)
                        };
 
                        pmc: pmc@fffffc00 {
-                               compatible = "atmel,at91sam9260-pmc";
+                               compatible = "atmel,at91sam9260-pmc", "syscon";
                                reg = <0xfffffc00 0x100>;
                                interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
                                interrupt-controller;
index ce1e3e94a40c2084aa207f5332b2442334ba7d05..5e09de4eb9cdf12fdaa9c79c714b5212ab851be5 100644 (file)
                        };
 
                        pmc: pmc@fffffc00 {
-                               compatible = "atmel,at91rm9200-pmc";
+                               compatible = "atmel,at91rm9200-pmc", "syscon";
                                reg = <0xfffffc00 0x100>;
                                interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
                                interrupt-controller;
index f1f5fa3a9e6e276c17683a63f67106469ca8b9c0..93446420af258d795b874efde5b522aac1ab3e1a 100644 (file)
@@ -93,7 +93,7 @@
                        };
 
                        pmc: pmc@fffffc00 {
-                               compatible = "atmel,at91rm9200-pmc";
+                               compatible = "atmel,at91rm9200-pmc", "syscon";
                                reg = <0xfffffc00 0x100>;
                                interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
                                interrupt-controller;
index 18b8b9e2970430511922bbdf44c8f4d35fd2c9c1..af8b708ac312ad4dfd4b0f1a1f633d053721a9da 100644 (file)
                        };
 
                        pmc: pmc@fffffc00 {
-                               compatible = "atmel,at91sam9g45-pmc";
+                               compatible = "atmel,at91sam9g45-pmc", "syscon";
                                reg = <0xfffffc00 0x100>;
                                interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
                                interrupt-controller;
index d1ae60a855d492ad45209df921e5004e7998796e..9d16ef8453c556f7ad69a21f65d9526a90325115 100644 (file)
                                        isi_0: endpoint {
                                                remote-endpoint = <&ov2640_0>;
                                                bus-width = <8>;
+                                               vsync-active = <1>;
+                                               hsync-active = <1>;
                                        };
                                };
                        };
index 32bc9a189db0fcd86e2a7e6877475818ab3a4e93..95569a87b6c9dafeab2ef121ab2fd7bed66a3e5c 100644 (file)
@@ -97,7 +97,7 @@
                        };
 
                        pmc: pmc@fffffc00 {
-                               compatible = "atmel,at91sam9n12-pmc";
+                               compatible = "atmel,at91sam9n12-pmc", "syscon";
                                reg = <0xfffffc00 0x200>;
                                interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
                                interrupt-controller;
index efa75064d38a62b4694d8704892bae6f4948f4fa..acf3451a332da266f9a4e0ad5903a7ec11767587 100644 (file)
                                };
                        };
 
-                       i2c1: i2c@f8014000 {
-                               status = "okay";
-                       };
-
                        mmc0: mmc@f0008000 {
                                pinctrl-0 = <
                                        &pinctrl_board_mmc0
                };
 
                d9 {
-                       label = "d6";
+                       label = "d9";
                        gpios = <&pioB 5 GPIO_ACTIVE_LOW>;
                        linux,default-trigger = "nand-disk";
                };
 
                d10 {
-                       label = "d7";
+                       label = "d10";
                        gpios = <&pioB 6 GPIO_ACTIVE_HIGH>;
                        linux,default-trigger = "heartbeat";
                };
index a0b90aedd3b829f2a82cbca94081789171021aac..6d829db4e887ce36c01d50365f1a42e284491505 100644 (file)
                        };
 
                        pmc: pmc@fffffc00 {
-                               compatible = "atmel,at91sam9g45-pmc";
+                               compatible = "atmel,at91sam9g45-pmc", "syscon";
                                reg = <0xfffffc00 0x100>;
                                interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
                                interrupt-controller;
index 747d8f070a5c267e66edabc0dfede8858c03f102..0827d594b1f0ef3750146690c5ce11babf1fc65b 100644 (file)
@@ -68,7 +68,7 @@
                adc_op_clk: adc_op_clk{
                        compatible = "fixed-clock";
                        #clock-cells = <0>;
-                       clock-frequency = <5000000>;
+                       clock-frequency = <1000000>;
                };
        };
 
                        };
 
                        pmc: pmc@fffffc00 {
-                               compatible = "atmel,at91sam9x5-pmc";
+                               compatible = "atmel,at91sam9x5-pmc", "syscon";
                                reg = <0xfffffc00 0x100>;
                                interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
                                interrupt-controller;
                                atmel,adc-channels-used = <0xffff>;
                                atmel,adc-vref = <3300>;
                                atmel,adc-startup-time = <40>;
+                               atmel,adc-sample-hold-time = <11>;
                                atmel,adc-res = <8 10>;
                                atmel,adc-res-names = "lowres", "highres";
                                atmel,adc-use-res = "highres";
index d237c462dfc6b19ac7fc8089ec772aa9fa939631..52425a4ca97e878a903d5b578fa0990fecf46785 100644 (file)
@@ -66,6 +66,8 @@
                                        isi_0: endpoint@0 {
                                                remote-endpoint = <&ov2640_0>;
                                                bus-width = <8>;
+                                               vsync-active = <1>;
+                                               hsync-active = <1>;
                                        };
                                };
                        };
                                };
                        };
 
+                       adc0: adc@f804c000 {
+                               atmel,adc-ts-wires = <4>;
+                               atmel,adc-ts-pressure-threshold = <10000>;
+                               status = "okay";
+                       };
+
                        pinctrl@fffff400 {
                                camera_sensor {
                                        pinctrl_pck0_as_isi_mck: pck0_as_isi_mck-0 {
index 24c935c72e5e611f3f945744404eae6bd135175f..051ab3ba9a6526b008304aca8cd50083efdac26b 100644 (file)
@@ -89,4 +89,9 @@
                        regulator-name = "ldo5";
                };
        };
+
+       usb_power_supply: usb_power_supply {
+               compatible = "x-powers,axp202-usb-power-supply";
+               status = "disabled";
+       };
 };
diff --git a/arch/arm/boot/dts/axp22x.dtsi b/arch/arm/boot/dts/axp22x.dtsi
new file mode 100644 (file)
index 0000000..76302f5
--- /dev/null
@@ -0,0 +1,143 @@
+/*
+ * Copyright 2015 Chen-Yu Tsai
+ *
+ * Chen-Yu Tsai <wens@csie.org>
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This file 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; either version 2 of the
+ *     License, or (at your option) any later version.
+ *
+ *     This file is distributed in the hope that it will be useful,
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ * Or, alternatively,
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use,
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/*
+ * AXP221/221s/223 Integrated Power Management Chip
+ * http://www.x-powers.com/product/AXP22X.php
+ * http://dl.linux-sunxi.org/AXP/AXP221%20Datasheet%20V1.2%2020130326%20.pdf
+ */
+
+&axp22x {
+       interrupt-controller;
+       #interrupt-cells = <1>;
+
+       regulators {
+               /* Default work frequency for buck regulators */
+               x-powers,dcdc-freq = <3000>;
+
+               reg_dcdc1: dcdc1 {
+                       regulator-name = "dcdc1";
+               };
+
+               reg_dcdc2: dcdc2 {
+                       regulator-name = "dcdc2";
+               };
+
+               reg_dcdc3: dcdc3 {
+                       regulator-name = "dcdc3";
+               };
+
+               reg_dcdc4: dcdc4 {
+                       regulator-name = "dcdc4";
+               };
+
+               reg_dcdc5: dcdc5 {
+                       regulator-name = "dcdc5";
+               };
+
+               reg_dc1sw: dc1sw {
+                       regulator-name = "dc1sw";
+               };
+
+               reg_dc5ldo: dc5ldo {
+                       regulator-name = "dc5ldo";
+               };
+
+               reg_aldo1: aldo1 {
+                       regulator-name = "aldo1";
+               };
+
+               reg_aldo2: aldo2 {
+                       regulator-name = "aldo2";
+               };
+
+               reg_aldo3: aldo3 {
+                       regulator-name = "aldo3";
+               };
+
+               reg_dldo1: dldo1 {
+                       regulator-name = "dldo1";
+               };
+
+               reg_dldo2: dldo2 {
+                       regulator-name = "dldo2";
+               };
+
+               reg_dldo3: dldo3 {
+                       regulator-name = "dldo3";
+               };
+
+               reg_dldo4: dldo4 {
+                       regulator-name = "dldo4";
+               };
+
+               reg_eldo1: eldo1 {
+                       regulator-name = "eldo1";
+               };
+
+               reg_eldo2: eldo2 {
+                       regulator-name = "eldo2";
+               };
+
+               reg_eldo3: eldo3 {
+                       regulator-name = "eldo3";
+               };
+
+               reg_ldo_io0: ldo_io0 {
+                       regulator-name = "ldo_io0";
+               };
+
+               reg_ldo_io1: ldo_io1 {
+                       regulator-name = "ldo_io1";
+               };
+
+               reg_rtc_ldo: rtc_ldo {
+                       /* RTC_LDO is a fixed, always-on regulator */
+                       regulator-always-on;
+                       regulator-min-microvolt = <3000000>;
+                       regulator-max-microvolt = <3000000>;
+                       regulator-name = "rtc_ldo";
+               };
+       };
+};
index e1ac07a16f926e964c61888a2984d2ed037414f6..2778533502d9b7fcfdc1ac4ef074fafdd274c012 100644 (file)
@@ -32,6 +32,7 @@
 
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/interrupt-controller/irq.h>
+#include <dt-bindings/clock/bcm-cygnus.h>
 
 #include "skeleton.dtsi"
 
 
        /include/ "bcm-cygnus-clock.dtsi"
 
-       pinctrl: pinctrl@0x0301d0c8 {
-               compatible = "brcm,cygnus-pinmux";
-               reg = <0x0301d0c8 0x30>,
-                     <0x0301d24c 0x2c>;
-       };
-
-       gpio_crmu: gpio@03024800 {
-               compatible = "brcm,cygnus-crmu-gpio";
-               reg = <0x03024800 0x50>,
-                     <0x03024008 0x18>;
-               #gpio-cells = <2>;
-               gpio-controller;
-       };
-
-       gpio_ccm: gpio@1800a000 {
-               compatible = "brcm,cygnus-ccm-gpio";
-               reg = <0x1800a000 0x50>,
-                     <0x0301d164 0x20>;
-               #gpio-cells = <2>;
-               gpio-controller;
-               interrupts = <GIC_SPI 84 IRQ_TYPE_LEVEL_HIGH>;
-               interrupt-controller;
-       };
+       core {
+               compatible = "simple-bus";
+               ranges = <0x00000000 0x19000000 0x1000000>;
+               #address-cells = <1>;
+               #size-cells = <1>;
 
-       gpio_asiu: gpio@180a5000 {
-               compatible = "brcm,cygnus-asiu-gpio";
-               reg = <0x180a5000 0x668>;
-               #gpio-cells = <2>;
-               gpio-controller;
+               timer@20200 {
+                       compatible = "arm,cortex-a9-global-timer";
+                       reg = <0x20200 0x100>;
+                       interrupts = <GIC_PPI 11 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&periph_clk>;
+               };
 
-               pinmux = <&pinctrl>;
+               gic: interrupt-controller@21000 {
+                       compatible = "arm,cortex-a9-gic";
+                       #interrupt-cells = <3>;
+                       #address-cells = <0>;
+                       interrupt-controller;
+                       reg = <0x21000 0x1000>,
+                             <0x20100 0x100>;
+               };
 
-               interrupt-controller;
-               interrupts = <GIC_SPI 174 IRQ_TYPE_LEVEL_HIGH>;
+               L2: l2-cache {
+                       compatible = "arm,pl310-cache";
+                       reg = <0x22000 0x1000>;
+                       cache-unified;
+                       cache-level = <2>;
+               };
        };
 
-       amba {
+       axi {
+               compatible = "simple-bus";
+               ranges;
                #address-cells = <1>;
                #size-cells = <1>;
-               compatible = "arm,amba-bus", "simple-bus";
-               interrupt-parent = <&gic>;
-               ranges;
 
-               wdt@18009000 {
-                        compatible = "arm,sp805" , "arm,primecell";
-                        reg = <0x18009000 0x1000>;
-                        interrupts = <GIC_SPI 91 IRQ_TYPE_LEVEL_HIGH>;
-                        clocks = <&axi81_clk>;
-                        clock-names = "apb_pclk";
+               pinctrl: pinctrl@0x0301d0c8 {
+                       compatible = "brcm,cygnus-pinmux";
+                       reg = <0x0301d0c8 0x30>,
+                             <0x0301d24c 0x2c>;
                };
-       };
 
-       i2c0: i2c@18008000 {
-               compatible = "brcm,cygnus-iproc-i2c", "brcm,iproc-i2c";
-               reg = <0x18008000 0x100>;
-               #address-cells = <1>;
-               #size-cells = <0>;
-               interrupts = <GIC_SPI 85 IRQ_TYPE_NONE>;
-               clock-frequency = <100000>;
-               status = "disabled";
-       };
+               gpio_crmu: gpio@03024800 {
+                       compatible = "brcm,cygnus-crmu-gpio";
+                       reg = <0x03024800 0x50>,
+                             <0x03024008 0x18>;
+                       #gpio-cells = <2>;
+                       gpio-controller;
+               };
 
-       i2c1: i2c@1800b000 {
-               compatible = "brcm,cygnus-iproc-i2c", "brcm,iproc-i2c";
-               reg = <0x1800b000 0x100>;
-               #address-cells = <1>;
-               #size-cells = <0>;
-               interrupts = <GIC_SPI 86 IRQ_TYPE_NONE>;
-               clock-frequency = <100000>;
-               status = "disabled";
-       };
+               i2c0: i2c@18008000 {
+                       compatible = "brcm,cygnus-iproc-i2c", "brcm,iproc-i2c";
+                       reg = <0x18008000 0x100>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       interrupts = <GIC_SPI 85 IRQ_TYPE_NONE>;
+                       clock-frequency = <100000>;
+                       status = "disabled";
+               };
 
-       pcie0: pcie@18012000 {
-               compatible = "brcm,iproc-pcie";
-               reg = <0x18012000 0x1000>;
+               wdt0: wdt@18009000 {
+                       compatible = "arm,sp805" , "arm,primecell";
+                       reg = <0x18009000 0x1000>;
+                       interrupts = <GIC_SPI 91 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&axi81_clk>;
+                       clock-names = "apb_pclk";
+               };
 
-               #interrupt-cells = <1>;
-               interrupt-map-mask = <0 0 0 0>;
-               interrupt-map = <0 0 0 0 &gic GIC_SPI 100 IRQ_TYPE_NONE>;
+               gpio_ccm: gpio@1800a000 {
+                       compatible = "brcm,cygnus-ccm-gpio";
+                       reg = <0x1800a000 0x50>,
+                             <0x0301d164 0x20>;
+                       #gpio-cells = <2>;
+                       gpio-controller;
+                       interrupts = <GIC_SPI 84 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-controller;
+               };
 
-               linux,pci-domain = <0>;
+               i2c1: i2c@1800b000 {
+                       compatible = "brcm,cygnus-iproc-i2c", "brcm,iproc-i2c";
+                       reg = <0x1800b000 0x100>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       interrupts = <GIC_SPI 86 IRQ_TYPE_NONE>;
+                       clock-frequency = <100000>;
+                       status = "disabled";
+               };
 
-               bus-range = <0x00 0xff>;
+               pcie0: pcie@18012000 {
+                       compatible = "brcm,iproc-pcie";
+                       reg = <0x18012000 0x1000>;
 
-               #address-cells = <3>;
-               #size-cells = <2>;
-               device_type = "pci";
-               ranges = <0x81000000 0 0          0x28000000 0 0x00010000
-                         0x82000000 0 0x20000000 0x20000000 0 0x04000000>;
+                       #interrupt-cells = <1>;
+                       interrupt-map-mask = <0 0 0 0>;
+                       interrupt-map = <0 0 0 0 &gic GIC_SPI 100 IRQ_TYPE_NONE>;
 
-               status = "disabled";
-       };
+                       linux,pci-domain = <0>;
 
-       pcie1: pcie@18013000 {
-               compatible = "brcm,iproc-pcie";
-               reg = <0x18013000 0x1000>;
+                       bus-range = <0x00 0xff>;
 
-               #interrupt-cells = <1>;
-               interrupt-map-mask = <0 0 0 0>;
-               interrupt-map = <0 0 0 0 &gic GIC_SPI 106 IRQ_TYPE_NONE>;
+                       #address-cells = <3>;
+                       #size-cells = <2>;
+                       device_type = "pci";
+                       ranges = <0x81000000 0 0          0x28000000 0 0x00010000
+                                 0x82000000 0 0x20000000 0x20000000 0 0x04000000>;
 
-               linux,pci-domain = <1>;
+                       status = "disabled";
+               };
 
-               bus-range = <0x00 0xff>;
+               pcie1: pcie@18013000 {
+                       compatible = "brcm,iproc-pcie";
+                       reg = <0x18013000 0x1000>;
 
-               #address-cells = <3>;
-               #size-cells = <2>;
-               device_type = "pci";
-               ranges = <0x81000000 0 0          0x48000000 0 0x00010000
-                         0x82000000 0 0x40000000 0x40000000 0 0x04000000>;
+                       #interrupt-cells = <1>;
+                       interrupt-map-mask = <0 0 0 0>;
+                       interrupt-map = <0 0 0 0 &gic GIC_SPI 106 IRQ_TYPE_NONE>;
 
-               status = "disabled";
-       };
+                       linux,pci-domain = <1>;
 
-       uart0: serial@18020000 {
-               compatible = "snps,dw-apb-uart";
-               reg = <0x18020000 0x100>;
-               reg-shift = <2>;
-               reg-io-width = <4>;
-               interrupts = <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>;
-               clocks = <&axi81_clk>;
-               clock-frequency = <100000000>;
-               status = "disabled";
-       };
+                       bus-range = <0x00 0xff>;
 
-       uart1: serial@18021000 {
-               compatible = "snps,dw-apb-uart";
-               reg = <0x18021000 0x100>;
-               reg-shift = <2>;
-               reg-io-width = <4>;
-               interrupts = <GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH>;
-               clocks = <&axi81_clk>;
-               clock-frequency = <100000000>;
-               status = "disabled";
-       };
+                       #address-cells = <3>;
+                       #size-cells = <2>;
+                       device_type = "pci";
+                       ranges = <0x81000000 0 0          0x48000000 0 0x00010000
+                                 0x82000000 0 0x40000000 0x40000000 0 0x04000000>;
 
-       uart2: serial@18022000 {
-               compatible = "snps,dw-apb-uart";
-               reg = <0x18020000 0x100>;
-               reg-shift = <2>;
-               reg-io-width = <4>;
-               interrupts = <GIC_SPI 75 IRQ_TYPE_LEVEL_HIGH>;
-               clocks = <&axi81_clk>;
-               clock-frequency = <100000000>;
-               status = "disabled";
-       };
+                       status = "disabled";
+               };
 
-       uart3: serial@18023000 {
-               compatible = "snps,dw-apb-uart";
-               reg = <0x18023000 0x100>;
-               reg-shift = <2>;
-               reg-io-width = <4>;
-               interrupts = <GIC_SPI 76 IRQ_TYPE_LEVEL_HIGH>;
-               clocks = <&axi81_clk>;
-               clock-frequency = <100000000>;
-               status = "disabled";
-       };
+               uart0: serial@18020000 {
+                       compatible = "snps,dw-apb-uart";
+                       reg = <0x18020000 0x100>;
+                       reg-shift = <2>;
+                       reg-io-width = <4>;
+                       interrupts = <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&axi81_clk>;
+                       clock-frequency = <100000000>;
+                       status = "disabled";
+               };
 
-       nand: nand@18046000 {
-               compatible = "brcm,nand-iproc", "brcm,brcmnand-v6.1", "brcm,brcmnand";
-               reg = <0x18046000 0x600>, <0xf8105408 0x600>, <0x18046f00 0x20>;
-               reg-names = "nand", "iproc-idm", "iproc-ext";
-               interrupts = <GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>;
+               uart1: serial@18021000 {
+                       compatible = "snps,dw-apb-uart";
+                       reg = <0x18021000 0x100>;
+                       reg-shift = <2>;
+                       reg-io-width = <4>;
+                       interrupts = <GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&axi81_clk>;
+                       clock-frequency = <100000000>;
+                       status = "disabled";
+               };
 
-               #address-cells = <1>;
-               #size-cells = <0>;
+               uart2: serial@18022000 {
+                       compatible = "snps,dw-apb-uart";
+                       reg = <0x18020000 0x100>;
+                       reg-shift = <2>;
+                       reg-io-width = <4>;
+                       interrupts = <GIC_SPI 75 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&axi81_clk>;
+                       clock-frequency = <100000000>;
+                       status = "disabled";
+               };
 
-               brcm,nand-has-wp;
-       };
+               uart3: serial@18023000 {
+                       compatible = "snps,dw-apb-uart";
+                       reg = <0x18023000 0x100>;
+                       reg-shift = <2>;
+                       reg-io-width = <4>;
+                       interrupts = <GIC_SPI 76 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&axi81_clk>;
+                       clock-frequency = <100000000>;
+                       status = "disabled";
+               };
 
-       gic: interrupt-controller@19021000 {
-               compatible = "arm,cortex-a9-gic";
-               #interrupt-cells = <3>;
-               #address-cells = <0>;
-               interrupt-controller;
-               reg = <0x19021000 0x1000>,
-                     <0x19020100 0x100>;
-       };
+               nand: nand@18046000 {
+                       compatible = "brcm,nand-iproc", "brcm,brcmnand-v6.1";
+                       reg = <0x18046000 0x600>, <0xf8105408 0x600>,
+                             <0x18046f00 0x20>;
+                       reg-names = "nand", "iproc-idm", "iproc-ext";
+                       interrupts = <GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>;
 
-       L2: l2-cache {
-               compatible = "arm,pl310-cache";
-               reg = <0x19022000 0x1000>;
-               cache-unified;
-               cache-level = <2>;
-       };
+                       #address-cells = <1>;
+                       #size-cells = <0>;
 
-       timer@19020200 {
-               compatible = "arm,cortex-a9-global-timer";
-               reg = <0x19020200 0x100>;
-               interrupts = <GIC_PPI 11 IRQ_TYPE_LEVEL_HIGH>;
-               clocks = <&periph_clk>;
-       };
+                       brcm,nand-has-wp;
+               };
 
+               gpio_asiu: gpio@180a5000 {
+                       compatible = "brcm,cygnus-asiu-gpio";
+                       reg = <0x180a5000 0x668>;
+                       #gpio-cells = <2>;
+                       gpio-controller;
+
+                       pinmux = <&pinctrl>;
+
+                       interrupt-controller;
+                       interrupts = <GIC_SPI 174 IRQ_TYPE_LEVEL_HIGH>;
+               };
+
+               touchscreen: tsc@180a6000 {
+                       compatible = "brcm,iproc-touchscreen";
+                       reg = <0x180a6000 0x40>;
+                       clocks = <&asiu_clks BCM_CYGNUS_ASIU_ADC_CLK>;
+                       clock-names = "tsc_clk";
+                       interrupts = <GIC_SPI 164 IRQ_TYPE_LEVEL_HIGH>;
+                       status = "disabled";
+               };
+       };
 };
diff --git a/arch/arm/boot/dts/bcm-nsp.dtsi b/arch/arm/boot/dts/bcm-nsp.dtsi
new file mode 100644 (file)
index 0000000..58aca27
--- /dev/null
@@ -0,0 +1,119 @@
+/*
+ *  BSD LICENSE
+ *
+ *  Copyright(c) 2015 Broadcom Corporation.  All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions
+ *  are met:
+ *
+ *    * Redistributions of source code must retain the above copyright
+ *      notice, this list of conditions and the following disclaimer.
+ *    * Redistributions in binary form must reproduce the above copyright
+ *      notice, this list of conditions and the following disclaimer in
+ *      the documentation and/or other materials provided with the
+ *      distribution.
+ *    * Neither the name of Broadcom Corporation nor the names of its
+ *      contributors may be used to endorse or promote products derived
+ *      from this software without specific prior written permission.
+ *
+ *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+
+#include "skeleton.dtsi"
+
+/ {
+       compatible = "brcm,nsp";
+       model = "Broadcom Northstar Plus SoC";
+       interrupt-parent = <&gic>;
+
+       mpcore {
+               compatible = "simple-bus";
+               ranges = <0x00000000 0x19020000 0x00003000>;
+               #address-cells = <1>;
+               #size-cells = <1>;
+
+               cpus {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       cpu@0 {
+                               device_type = "cpu";
+                               compatible = "arm,cortex-a9";
+                               next-level-cache = <&L2>;
+                               reg = <0x0>;
+                       };
+               };
+
+               L2: l2-cache {
+                       compatible = "arm,pl310-cache";
+                       reg = <0x2000 0x1000>;
+                       cache-unified;
+                       cache-level = <2>;
+               };
+
+               gic: interrupt-controller@19021000 {
+                       compatible = "arm,cortex-a9-gic";
+                       #interrupt-cells = <3>;
+                       #address-cells = <0>;
+                       interrupt-controller;
+                       reg = <0x1000 0x1000>,
+                             <0x0100 0x100>;
+               };
+
+               timer@19020200 {
+                       compatible = "arm,cortex-a9-global-timer";
+                       reg = <0x0200 0x100>;
+                       interrupts = <GIC_PPI 11 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&periph_clk>;
+               };
+       };
+
+       clocks {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges;
+
+               periph_clk: periph_clk {
+                       compatible = "fixed-clock";
+                       #clock-cells = <0>;
+                       clock-frequency = <500000000>;
+               };
+       };
+
+       axi {
+               compatible = "simple-bus";
+               ranges = <0x00000000 0x18000000 0x00001000>;
+               #address-cells = <1>;
+               #size-cells = <1>;
+
+               uart0: serial@18000300 {
+                       compatible = "ns16550a";
+                       reg = <0x0300 0x100>;
+                       interrupts = <GIC_SPI 85 IRQ_TYPE_LEVEL_HIGH>;
+                       clock-frequency = <62499840>;
+                       status = "disabled";
+               };
+
+               uart1: serial@18000400 {
+                       compatible = "ns16550a";
+                       reg = <0x0400 0x100>;
+                       interrupts = <GIC_SPI 85 IRQ_TYPE_LEVEL_HIGH>;
+                       clock-frequency = <62499840>;
+                       status = "disabled";
+               };
+       };
+};
diff --git a/arch/arm/boot/dts/bcm2835-rpi-a-plus.dts b/arch/arm/boot/dts/bcm2835-rpi-a-plus.dts
new file mode 100644 (file)
index 0000000..b2bff43
--- /dev/null
@@ -0,0 +1,30 @@
+/dts-v1/;
+#include "bcm2835-rpi.dtsi"
+
+/ {
+       compatible = "raspberrypi,model-a-plus", "brcm,bcm2835";
+       model = "Raspberry Pi Model A+";
+
+       leds {
+               act {
+                       gpios = <&gpio 47 0>;
+               };
+
+               pwr {
+                       label = "PWR";
+                       gpios = <&gpio 35 0>;
+                       default-state = "keep";
+                       linux,default-trigger = "default-on";
+               };
+       };
+};
+
+&gpio {
+       pinctrl-0 = <&gpioout &alt0 &i2s_alt0 &alt3>;
+
+       /* I2S interface */
+       i2s_alt0: i2s_alt0 {
+               brcm,pins = <18 19 20 21>;
+               brcm,function = <BCM2835_FSEL_ALT0>;
+       };
+};
diff --git a/arch/arm/boot/dts/bcm2835-rpi-b-rev2.dts b/arch/arm/boot/dts/bcm2835-rpi-b-rev2.dts
new file mode 100644 (file)
index 0000000..eab8b59
--- /dev/null
@@ -0,0 +1,23 @@
+/dts-v1/;
+#include "bcm2835-rpi.dtsi"
+
+/ {
+       compatible = "raspberrypi,model-b-rev2", "brcm,bcm2835";
+       model = "Raspberry Pi Model B rev2";
+
+       leds {
+               act {
+                       gpios = <&gpio 16 1>;
+               };
+       };
+};
+
+&gpio {
+       pinctrl-0 = <&gpioout &alt0 &i2s_alt2 &alt3>;
+
+       /* I2S interface */
+       i2s_alt2: i2s_alt2 {
+               brcm,pins = <28 29 30 31>;
+               brcm,function = <BCM2835_FSEL_ALT2>;
+       };
+};
index ee89b79426cf4d8bdf17b37065e435cf5b1bd632..ff6b2d1c6c9077823ca3351b200c46cbf8b83a94 100644 (file)
 };
 
 &gpio {
-       pinctrl-0 = <&gpioout &alt0 &i2s_alt2 &alt3>;
-
-       /* I2S interface */
-       i2s_alt2: i2s_alt2 {
-               brcm,pins = <28 29 30 31>;
-               brcm,function = <BCM2835_FSEL_ALT2>;
-       };
+       pinctrl-0 = <&gpioout &alt0 &alt3>;
 };
index ab5474e5d1c80163061d1f0a69a472225be1e3bc..3572f0367baf2397a7f282a2574b2bbc76dc89d8 100644 (file)
        clock-frequency = <100000>;
 };
 
+&i2c2 {
+       status = "okay";
+};
+
 &sdhci {
        status = "okay";
        bus-width = <4>;
index 301c73f4ca333d9d1e74d95442cdfdc7165b4719..aef64de77495b4be5867dc6ee0fcc9892bdcea7e 100644 (file)
@@ -1,4 +1,5 @@
 #include <dt-bindings/pinctrl/bcm2835.h>
+#include <dt-bindings/clock/bcm2835.h>
 #include "skeleton.dtsi"
 
 / {
                        compatible = "brcm,bcm2835-system-timer";
                        reg = <0x7e003000 0x1000>;
                        interrupts = <1 0>, <1 1>, <1 2>, <1 3>;
+                       /* This could be a reference to BCM2835_CLOCK_TIMER,
+                        * but we don't have the driver using the common clock
+                        * support yet.
+                        */
                        clock-frequency = <1000000>;
                };
 
                        reg = <0x7e100000 0x28>;
                };
 
+               clocks: cprman@7e101000 {
+                       compatible = "brcm,bcm2835-cprman";
+                       #clock-cells = <1>;
+                       reg = <0x7e101000 0x2000>;
+
+                       /* CPRMAN derives everything from the platform's
+                        * oscillator.
+                        */
+                       clocks = <&clk_osc>;
+               };
+
                rng@7e104000 {
                        compatible = "brcm,bcm2835-rng";
                        reg = <0x7e104000 0x10>;
                        #interrupt-cells = <2>;
                };
 
-               uart@7e201000 {
+               uart0: uart@7e201000 {
                        compatible = "brcm,bcm2835-pl011", "arm,pl011", "arm,primecell";
                        reg = <0x7e201000 0x1000>;
                        interrupts = <2 25>;
-                       clock-frequency = <3000000>;
+                       clocks = <&clocks BCM2835_CLOCK_UART>,
+                                <&clocks BCM2835_CLOCK_VPU>;
+                       clock-names = "uartclk", "apb_pclk";
                        arm,primecell-periphid = <0x00241011>;
                };
 
                        compatible = "brcm,bcm2835-spi";
                        reg = <0x7e204000 0x1000>;
                        interrupts = <2 22>;
-                       clocks = <&clk_spi>;
+                       clocks = <&clocks BCM2835_CLOCK_VPU>;
                        #address-cells = <1>;
                        #size-cells = <0>;
                        status = "disabled";
                        compatible = "brcm,bcm2835-i2c";
                        reg = <0x7e205000 0x1000>;
                        interrupts = <2 21>;
-                       clocks = <&clk_i2c>;
+                       clocks = <&clocks BCM2835_CLOCK_VPU>;
                        #address-cells = <1>;
                        #size-cells = <0>;
                        status = "disabled";
                        compatible = "brcm,bcm2835-sdhci";
                        reg = <0x7e300000 0x100>;
                        interrupts = <2 30>;
-                       clocks = <&clk_mmc>;
+                       clocks = <&clocks BCM2835_CLOCK_EMMC>;
                        status = "disabled";
                };
 
                        compatible = "brcm,bcm2835-i2c";
                        reg = <0x7e804000 0x1000>;
                        interrupts = <2 21>;
-                       clocks = <&clk_i2c>;
+                       clocks = <&clocks BCM2835_CLOCK_VPU>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       status = "disabled";
+               };
+
+               i2c2: i2c@7e805000 {
+                       compatible = "brcm,bcm2835-i2c";
+                       reg = <0x7e805000 0x1000>;
+                       interrupts = <2 21>;
+                       clocks = <&clocks BCM2835_CLOCK_VPU>;
                        #address-cells = <1>;
                        #size-cells = <0>;
                        status = "disabled";
                #address-cells = <1>;
                #size-cells = <0>;
 
-               clk_mmc: clock@0 {
+               /* The oscillator is the root of the clock tree. */
+               clk_osc: clock@3 {
                        compatible = "fixed-clock";
-                       reg = <0>;
+                       reg = <3>;
                        #clock-cells = <0>;
-                       clock-output-names = "mmc";
-                       clock-frequency = <100000000>;
+                       clock-output-names = "osc";
+                       clock-frequency = <19200000>;
                };
 
-               clk_i2c: clock@1 {
-                       compatible = "fixed-clock";
-                       reg = <1>;
-                       #clock-cells = <0>;
-                       clock-output-names = "i2c";
-                       clock-frequency = <250000000>;
-               };
-
-               clk_spi: clock@2 {
-                       compatible = "fixed-clock";
-                       reg = <2>;
-                       #clock-cells = <0>;
-                       clock-output-names = "spi";
-                       clock-frequency = <250000000>;
-               };
        };
 };
index 64b8d10ccff8ce65bb318a6ed318cd98d97a8f0e..ca92bba6a8c5b2002eb4a63daeaebfb78c2da44a 100644 (file)
                reg = <0x00000000 0x08000000>;
        };
 
+       axi@18000000 {
+               usb3@23000 {
+                       reg = <0x00023000 0x1000>;
+
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+
+                       vcc-gpio = <&chipcommon 0 GPIO_ACTIVE_HIGH>;
+               };
+       };
+
        leds {
                compatible = "gpio-leds";
 
index aedf3c426e1f3f06253f6ae25de2408eefd3a0f9..8ade7def2e8aa1fbd4bbc18acaa7e3ef6ef75a0c 100644 (file)
@@ -10,6 +10,7 @@
 /dts-v1/;
 
 #include "bcm4708.dtsi"
+#include "bcm5301x-nand-cs0-bch8.dtsi"
 
 / {
        compatible = "asus,rt-ac87u", "brcm,bcm4709", "brcm,bcm4708";
diff --git a/arch/arm/boot/dts/bcm4709-netgear-r7000.dts b/arch/arm/boot/dts/bcm4709-netgear-r7000.dts
new file mode 100644 (file)
index 0000000..a22ed14
--- /dev/null
@@ -0,0 +1,106 @@
+/*
+ * Broadcom BCM470X / BCM5301X ARM platform code.
+ * DTS for Netgear R7000
+ *
+ * Copyright (C) 2015 RafaÅ‚ MiÅ‚ecki <zajec5@gmail.com>
+ *
+ * Licensed under the GNU/GPL. See COPYING for details.
+ */
+
+/dts-v1/;
+
+#include "bcm4708.dtsi"
+#include "bcm5301x-nand-cs0-bch8.dtsi"
+
+/ {
+       compatible = "netgear,r7000", "brcm,bcm4709", "brcm,bcm4708";
+       model = "Netgear R7000";
+
+       chosen {
+               bootargs = "console=ttyS0,115200";
+       };
+
+       memory {
+               reg = <0x00000000 0x08000000>;
+       };
+
+       leds {
+               compatible = "gpio-leds";
+
+               power-white {
+                       label = "bcm53xx:white:power";
+                       gpios = <&chipcommon 2 GPIO_ACTIVE_LOW>;
+                       linux,default-trigger = "default-on";
+               };
+
+               power-amber {
+                       label = "bcm53xx:amber:power";
+                       gpios = <&chipcommon 3 GPIO_ACTIVE_LOW>;
+                       linux,default-trigger = "default-off";
+               };
+
+               5ghz {
+                       label = "bcm53xx:white:5ghz";
+                       gpios = <&chipcommon 12 GPIO_ACTIVE_LOW>;
+                       linux,default-trigger = "default-off";
+               };
+
+               2ghz {
+                       label = "bcm53xx:white:2ghz";
+                       gpios = <&chipcommon 13 GPIO_ACTIVE_LOW>;
+                       linux,default-trigger = "default-off";
+               };
+
+               wps {
+                       label = "bcm53xx:white:wps";
+                       gpios = <&chipcommon 14 GPIO_ACTIVE_HIGH>;
+                       linux,default-trigger = "default-off";
+               };
+
+               wireless {
+                       label = "bcm53xx:white:wireless";
+                       gpios = <&chipcommon 15 GPIO_ACTIVE_HIGH>;
+                       linux,default-trigger = "default-off";
+               };
+
+               usb3 {
+                       label = "bcm53xx:white:usb3";
+                       gpios = <&chipcommon 17 GPIO_ACTIVE_LOW>;
+                       linux,default-trigger = "default-off";
+               };
+
+               usb2 {
+                       label = "bcm53xx:white:usb2";
+                       gpios = <&chipcommon 18 GPIO_ACTIVE_LOW>;
+                       linux,default-trigger = "default-off";
+               };
+       };
+
+       gpio-keys {
+               compatible = "gpio-keys";
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               wps {
+                       label = "WPS";
+                       linux,code = <KEY_WPS_BUTTON>;
+                       gpios = <&chipcommon 4 GPIO_ACTIVE_LOW>;
+               };
+
+               rfkill {
+                       label = "WiFi";
+                       linux,code = <KEY_RFKILL>;
+                       gpios = <&chipcommon 5 GPIO_ACTIVE_LOW>;
+               };
+
+               restart {
+                       label = "Reset";
+                       linux,code = <KEY_RESTART>;
+                       gpios = <&chipcommon 6 GPIO_ACTIVE_LOW>;
+               };
+       };
+};
+
+&uart0 {
+       status = "okay";
+};
index 3b6b1756068781a4e3a403446a388c9823c7ddaf..4791321969b3ff835b29bb8d9cf19472ca720da1 100644 (file)
                        brcm,irq-can-wake;
                };
 
+               aon-ctrl@410000 {
+                       compatible = "brcm,brcmstb-aon-ctrl";
+                       reg = <0x410000 0x200>, <0x410200 0x400>;
+                       reg-names = "aon-ctrl", "aon-sram";
+               };
+
                nand: nand@3e2800 {
                        status = "disabled";
                        #address-cells = <1>;
 
        };
 
+       memory_controllers {
+               compatible = "simple-bus";
+               ranges = <0x0 0x0 0xf1100000 0x200000>;
+               #address-cells = <1>;
+               #size-cells = <1>;
+
+               memc@0 {
+                       compatible = "brcm,brcmstb-memc", "simple-bus";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges = <0x0 0x0 0x80000>;
+
+                       memc-ddr@2000 {
+                               compatible = "brcm,brcmstb-memc-ddr";
+                               reg = <0x2000 0x800>;
+                       };
+
+                       ddr-phy@6000 {
+                               compatible = "brcm,brcmstb-ddr-phy-v240.1";
+                               reg = <0x6000 0x21c>;
+                               };
+
+                       shimphy@8000 {
+                               compatible = "brcm,brcmstb-ddr-shimphy-v1.0";
+                               reg = <0x8000 0xe4>;
+                       };
+               };
+
+               memc@1 {
+                       compatible = "brcm,brcmstb-memc", "simple-bus";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges = <0x0 0x80000 0x80000>;
+
+                       memc-ddr@2000 {
+                               compatible = "brcm,brcmstb-memc-ddr";
+                               reg = <0x2000 0x800>;
+                       };
+
+                       ddr-phy@6000 {
+                               compatible = "brcm,brcmstb-ddr-phy-v240.1";
+                               reg = <0x6000 0x21c>;
+                       };
+
+                       shimphy@8000 {
+                               compatible = "brcm,brcmstb-ddr-shimphy-v1.0";
+                               reg = <0x8000 0xe4>;
+                       };
+               };
+
+               memc@2 {
+                       compatible = "brcm,brcmstb-memc", "simple-bus";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges = <0x0 0x100000 0x80000>;
+
+                       memc-ddr@2000 {
+                               compatible = "brcm,brcmstb-memc-ddr";
+                               reg = <0x2000 0x800>;
+                       };
+
+                       ddr-phy@6000 {
+                               compatible = "brcm,brcmstb-ddr-phy-v240.1";
+                               reg = <0x6000 0x21c>;
+                       };
+
+                       shimphy@8000 {
+                               compatible = "brcm,brcmstb-ddr-shimphy-v1.0";
+                               reg = <0x8000 0xe4>;
+                       };
+               };
+       };
+
+       sram@ffe00000 {
+               compatible = "brcm,boot-sram", "mmio-sram";
+               reg = <0x0 0xffe00000 0x0 0x10000>;
+       };
+
        smpboot {
                compatible = "brcm,brcmstb-smpboot";
                syscon-cpu = <&hif_cpubiuctrl 0x88 0x178>;
index 7db484323fd62dc7ed9a988e6a3008597f59467f..8b3800f462882d3aaac6bd7e4aa4662e07c69533 100644 (file)
        model = "Cygnus Enterprise Phone (BCM911360_ENTPHN)";
        compatible = "brcm,bcm11360", "brcm,cygnus";
 
-       aliases {
-               serial0 = &uart3;
-       };
-
        chosen {
                stdout-path = &uart3;
                bootargs = "console=ttyS0,115200";
        };
 
-       uart3: serial@18023000 {
-               status = "okay";
-       };
-
        gpio_keys {
                compatible = "gpio-keys";
                #address-cells = <1>;
                };
        };
 };
+
+&uart3 {
+       status = "okay";
+};
+
+&nand {
+       nandcs@1 {
+               compatible = "brcm,nandcs";
+               reg = <0>;
+               nand-on-flash-bbt;
+
+               #address-cells = <1>;
+               #size-cells = <1>;
+
+               nand-ecc-strength = <24>;
+               nand-ecc-step-size = <1024>;
+
+               brcm,nand-oob-sector-size = <27>;
+       };
+};
index 9658d4f62d5926255630195eed8d295abdbbccd1..091c73a46e08bb5dccf15642820c843fe34984ac 100644 (file)
        };
 
        chosen {
-               stdout-path = &uart3;
-               bootargs = "console=ttyS0,115200";
+               stdout-path = "serial0:115200n8";
        };
+};
 
-       uart3: serial@18023000 {
-               status = "okay";
-       };
+&uart3 {
+       status = "okay";
 };
index 2f63052f9d483d8bd5823387beac17c3c1515d13..b4a1392bd5a6c6f2b59761164171242188539d90 100644 (file)
@@ -33,6 +33,7 @@
 /dts-v1/;
 
 #include "bcm-cygnus.dtsi"
+#include "bcm9hmidc.dtsi"
 
 / {
        model = "Cygnus SVK (BCM958300K)";
        };
 
        chosen {
-               stdout-path = &uart3;
-               bootargs = "console=ttyS0,115200";
+               stdout-path = "serial0:115200n8";
        };
+};
 
-       pcie0: pcie@18012000 {
-               status = "okay";
-       };
+&pcie0 {
+       status = "okay";
+};
 
-       pcie1: pcie@18013000 {
-               status = "okay";
-       };
+&pcie1 {
+       status = "okay";
+};
 
-       uart3: serial@18023000 {
-               status = "okay";
-       };
+&uart3 {
+       status = "okay";
+};
 
-       nand: nand@18046000 {
-               nandcs@1 {
-                       compatible = "brcm,nandcs";
-                       reg = <0>;
-                       nand-on-flash-bbt;
+&nand {
+       nandcs@1 {
+               compatible = "brcm,nandcs";
+               reg = <0>;
+               nand-on-flash-bbt;
 
-                       #address-cells = <1>;
-                       #size-cells = <1>;
+               #address-cells = <1>;
+               #size-cells = <1>;
 
-                       nand-ecc-strength = <24>;
-                       nand-ecc-step-size = <1024>;
+               nand-ecc-strength = <24>;
+               nand-ecc-step-size = <1024>;
 
-                       brcm,nand-oob-sector-size = <27>;
-               };
+               brcm,nand-oob-sector-size = <27>;
        };
 };
index 56b429abbedb9c1139d85dec79c5b1baf49ffd73..3378683321d3c88dcb0edab34a05cfe546cc5ac2 100644 (file)
@@ -33,6 +33,7 @@
 /dts-v1/;
 
 #include "bcm-cygnus.dtsi"
+#include "bcm9hmidc.dtsi"
 
 / {
        model = "Cygnus Wireless Audio (BCM958305K)";
        };
 
        chosen {
-               stdout-path = &uart3;
-               bootargs = "console=ttyS0,115200";
+               stdout-path = "serial0:115200n8";
        };
+};
+
+&i2c0 {
+       status = "okay";
+};
+
+&i2c1 {
+       status = "okay";
+};
+
+&pcie0 {
+       status = "okay";
+};
+
+&pcie1 {
+       status = "okay";
+};
+
+&uart3 {
+       status = "okay";
+};
+
+&nand {
+       nandcs@1 {
+               compatible = "brcm,nandcs";
+               reg = <0>;
+               nand-on-flash-bbt;
+
+               #address-cells = <1>;
+               #size-cells = <1>;
+
+               nand-ecc-strength = <24>;
+               nand-ecc-step-size = <1024>;
 
-       uart3: serial@18023000 {
-               status = "okay";
+               brcm,nand-oob-sector-size = <27>;
        };
 };
diff --git a/arch/arm/boot/dts/bcm958625k.dts b/arch/arm/boot/dts/bcm958625k.dts
new file mode 100644 (file)
index 0000000..16303db
--- /dev/null
@@ -0,0 +1,57 @@
+/*
+ *  BSD LICENSE
+ *
+ *  Copyright(c) 2015 Broadcom Corporation.  All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions
+ *  are met:
+ *
+ *    * Redistributions of source code must retain the above copyright
+ *      notice, this list of conditions and the following disclaimer.
+ *    * Redistributions in binary form must reproduce the above copyright
+ *      notice, this list of conditions and the following disclaimer in
+ *      the documentation and/or other materials provided with the
+ *      distribution.
+ *    * Neither the name of Broadcom Corporation nor the names of its
+ *      contributors may be used to endorse or promote products derived
+ *      from this software without specific prior written permission.
+ *
+ *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/dts-v1/;
+
+#include "bcm-nsp.dtsi"
+
+/ {
+       model = "NorthStar Plus SVK (BCM958625K)";
+       compatible = "brcm,bcm58625", "brcm,nsp";
+
+       aliases {
+               serial0 = &uart0;
+               serial1 = &uart1;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+};
+
+&uart0 {
+       status = "okay";
+};
+
+&uart1 {
+       status = "okay";
+};
diff --git a/arch/arm/boot/dts/bcm9hmidc.dtsi b/arch/arm/boot/dts/bcm9hmidc.dtsi
new file mode 100644 (file)
index 0000000..65397c0
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ *  BSD LICENSE
+ *
+ *  Copyright(c) 2015 Broadcom Corporation.  All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions
+ *  are met:
+ *
+ *    * Redistributions of source code must retain the above copyright
+ *      notice, this list of conditions and the following disclaimer.
+ *    * Redistributions in binary form must reproduce the above copyright
+ *      notice, this list of conditions and the following disclaimer in
+ *      the documentation and/or other materials provided with the
+ *      distribution.
+ *    * Neither the name of Broadcom Corporation nor the names of its
+ *      contributors may be used to endorse or promote products derived
+ *      from this software without specific prior written permission.
+ *
+ *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * Broadcom human machine interface daughter card (bcm9hmidc) installed on
+ * bcm958300k/bcm958305k boards
+ */
+
+&touchscreen {
+       touchscreen-inverted-x;
+       touchscreen-inverted-y;
+       status = "okay";
+};
index 5c99fb3a4d1058f172140714b3fad51af71148d3..3c0907b87fd6a61c3d62885b2de0111a8ea4652c 100644 (file)
@@ -45,7 +45,8 @@
        compatible = "sony,nsz-gs7", "marvell,berlin2", "marvell,berlin";
 
        chosen {
-               bootargs = "console=ttyS0,115200 earlyprintk";
+               bootargs = "earlyprintk";
+               stdout-path = "serial0:115200n8";
        };
 
        memory {
index ef811de0990812e08822e1912673fbaf08b55230..eaadac3bdd44233d138a542364c1db28bc1908e8 100644 (file)
        model = "Marvell Armada 1500 (BG2) SoC";
        compatible = "marvell,berlin2", "marvell,berlin";
 
+       aliases {
+               serial0 = &uart0;
+               serial1 = &uart1;
+               serial2 = &uart2;
+       };
+
        cpus {
                #address-cells = <1>;
                #size-cells = <0>;
                        device_type = "cpu";
                        next-level-cache = <&l2>;
                        reg = <0>;
+
+                       clocks = <&chip_clk CLKID_CPU>;
+                       clock-latency = <100000>;
+                       operating-points = <
+                               /* kHz    uV */
+                               1200000 1200000
+                               1000000 1200000
+                               800000  1200000
+                               600000  1200000
+                       >;
                };
 
                cpu@1 {
                        };
                };
 
+               pwm: pwm@f20000 {
+                       compatible = "marvell,berlin-pwm";
+                       reg = <0xf20000 0x40>;
+                       clocks = <&chip_clk CLKID_CFG>;
+                       #pwm-cells = <3>;
+               };
+
                apb@fc0000 {
                        compatible = "simple-bus";
                        #address-cells = <1>;
index 772165ad0a5266c24a8cc4ead194cf818aafb85a..8ba8b50ce9976cad5d971b1deabee57dc48fb6f2 100644 (file)
@@ -46,7 +46,8 @@
        compatible = "google,chromecast", "marvell,berlin2cd", "marvell,berlin";
 
        chosen {
-               bootargs = "console=ttyS0,115200 earlyprintk";
+               bootargs = "earlyprintk";
+               stdout-path = "serial0:115200n8";
        };
 
        memory {
index 900213d78a329aac9fd7f5404ce6c495d184a9c7..b16df157214d0271b37515434bcd7f93772a6434 100644 (file)
        model = "Marvell Armada 1500-mini (BG2CD) SoC";
        compatible = "marvell,berlin2cd", "marvell,berlin";
 
+       aliases {
+               serial0 = &uart0;
+               serial1 = &uart1;
+       };
+
        cpus {
                #address-cells = <1>;
                #size-cells = <0>;
                        device_type = "cpu";
                        next-level-cache = <&l2>;
                        reg = <0>;
+
+                       clocks = <&chip_clk CLKID_CPU>;
+                       clock-latency = <100000>;
+                       operating-points = <
+                               /* kHz    uV */
+                               800000  1200000
+                               600000  1200000
+                       >;
                };
        };
 
                        status = "disabled";
                };
 
+               pwm: pwm@f20000 {
+                       compatible = "marvell,berlin-pwm";
+                       reg = <0xf20000 0x40>;
+                       clocks = <&chip_clk CLKID_CFG>;
+                       #pwm-cells = <3>;
+               };
+
                apb@fc0000 {
                        compatible = "simple-bus";
                        #address-cells = <1>;
index 4a749e5b3b44be637c89e512c34ab9f62903d369..da28c9704a9d1dc741fcc71c89722428f2fd3653 100644 (file)
@@ -49,7 +49,8 @@
        };
 
        choosen {
-               bootargs = "console=ttyS0,115200 earlyprintk";
+               bootargs = "earlyprintk";
+               stdout-path = "serial0:115200n8";
        };
 
        regulators {
index d4dbd28d348c0b74ae4b23b5886b1dfb29dc3aa6..8ea177f375ddd652c98339ac2cc8ef8935396442 100644 (file)
        model = "Marvell Armada 1500 pro (BG2-Q) SoC";
        compatible = "marvell,berlin2q", "marvell,berlin";
 
+       aliases {
+               serial0 = &uart0;
+               serial1 = &uart1;
+       };
+
        cpus {
                #address-cells = <1>;
                #size-cells = <0>;
                        device_type = "cpu";
                        next-level-cache = <&l2>;
                        reg = <0>;
+
+                       clocks = <&chip_clk CLKID_CPU>;
+                       clock-latency = <100000>;
+                       /* Can be modified by the bootloader */
+                       operating-points = <
+                               /* kHz    uV */
+                               1200000 1200000
+                               1000000 1200000
+                               800000  1200000
+                               600000  1200000
+                       >;
                };
 
                cpu@1 {
                        status = "disabled";
                };
 
+               pwm: pwm@f20000 {
+                       compatible = "marvell,berlin-pwm";
+                       reg = <0xf20000 0x40>;
+                       clocks = <&chip_clk CLKID_CFG>;
+                       #pwm-cells = <3>;
+               };
+
                apb@fc0000 {
                        compatible = "simple-bus";
                        #address-cells = <1>;
index df4c6f1f93f9d8b49bf0b48129bc3fc228fe5805..a5a23c3764188c98720c6a8773868ec1e02652cb 100644 (file)
                timeout-sec = <15>;
        };
 
+       pinctrl: pinctrl@f0000e20 {
+               compatible = "cnxt,cx92755-pinctrl";
+               reg = <0xf0000e20 0x100>;
+               gpio-controller;
+               #gpio-cells = <2>;
+       };
+
        uc_regs: syscon@f00003a0 {
                compatible = "cnxt,cx92755-uc", "syscon";
                reg = <0xf00003a0 0x10>;
index 5da00806c41e43118a704f7ee8883b2b7d97477d..026f556c8c5033d3123c3d60d530d72cf0847035 100644 (file)
 
 &uart0 {
        status = "okay";
+       pinctrl-0 = <&uart0_default>;
+       pinctrl-names = "default";
 };
 
 &i2c {
        status = "okay";
 };
+
+&pinctrl {
+       uart0_default: uart0_active {
+               pins = "GP_O0", "GP_O1";
+               function = "client_b";
+       };
+};
index 179121630ad75a1456e7e4fc073d6f85977550d9..cd58c2e62757a06c8230ea6edf1547f198acc3ca 100644 (file)
                        };
 
                        crypto: crypto-engine@30000 {
-                               compatible = "marvell,orion-crypto";
-                               reg = <0x30000 0x10000>,
-                                     <0xffffe000 0x800>;
-                               reg-names = "regs", "sram";
+                               compatible = "marvell,dove-crypto";
+                               reg = <0x30000 0x10000>;
+                               reg-names = "regs";
                                interrupts = <31>;
                                clocks = <&gate_clk 15>;
+                               marvell,crypto-srams = <&crypto_sram>;
+                               marvell,crypto-sram-size = <0x800>;
                                status = "okay";
                        };
 
                                interrupts = <47>;
                                status = "disabled";
                        };
+
+                       crypto_sram: sa-sram@ffffe000 {
+                               compatible = "mmio-sram";
+                               reg = <0xffffe000 0x800>;
+                               clocks = <&gate_clk 15>;
+                               #address-cells = <1>;
+                               #size-cells = <1>;
+                       };
                };
        };
 };
index a6c82e5b64fe06d93e299f346457a1dfd7be0055..864f60020124e44181a66706797c0c16c6970044 100644 (file)
@@ -9,6 +9,8 @@
 
 #include "dra74x.dtsi"
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/clk/ti-dra7-atl.h>
+#include <dt-bindings/input/input.h>
 
 / {
        model = "TI DRA742";
                gpio = <&pcf_gpio_21 5 GPIO_ACTIVE_HIGH>;
        };
 
-       mmc2_3v3: fixedregulator-mmc2 {
+       evm_3v3_sw: fixedregulator-evm_3v3_sw {
                compatible = "regulator-fixed";
-               regulator-name = "mmc2_3v3";
+               regulator-name = "evm_3v3_sw";
                regulator-min-microvolt = <3300000>;
                regulator-max-microvolt = <3300000>;
        };
 
+       aic_dvdd: fixedregulator-aic_dvdd {
+               /* TPS77018DBVT */
+               compatible = "regulator-fixed";
+               regulator-name = "aic_dvdd";
+               vin-supply = <&evm_3v3_sw>;
+               regulator-min-microvolt = <1800000>;
+               regulator-max-microvolt = <1800000>;
+       };
+
        extcon_usb1: extcon_usb1 {
                compatible = "linux,extcon-usb-gpio";
                id-gpio = <&pcf_gpio_21 1 GPIO_ACTIVE_HIGH>;
                enable-active-high;
                gpio = <&gpio7 11 GPIO_ACTIVE_HIGH>;
        };
+
+       sound0: sound@0 {
+               compatible = "simple-audio-card";
+               simple-audio-card,name = "DRA7xx-EVM";
+               simple-audio-card,widgets =
+                       "Headphone", "Headphone Jack",
+                       "Line", "Line Out",
+                       "Microphone", "Mic Jack",
+                       "Line", "Line In";
+               simple-audio-card,routing =
+                       "Headphone Jack",       "HPLOUT",
+                       "Headphone Jack",       "HPROUT",
+                       "Line Out",             "LLOUT",
+                       "Line Out",             "RLOUT",
+                       "MIC3L",                "Mic Jack",
+                       "MIC3R",                "Mic Jack",
+                       "Mic Jack",             "Mic Bias",
+                       "LINE1L",               "Line In",
+                       "LINE1R",               "Line In";
+               simple-audio-card,format = "dsp_b";
+               simple-audio-card,bitclock-master = <&sound0_master>;
+               simple-audio-card,frame-master = <&sound0_master>;
+               simple-audio-card,bitclock-inversion;
+
+               sound0_master: simple-audio-card,cpu {
+                       sound-dai = <&mcasp3>;
+                       system-clock-frequency = <5644800>;
+               };
+
+               simple-audio-card,codec {
+                       sound-dai = <&tlv320aic3106>;
+                       clocks = <&atl_clkin2_ck>;
+               };
+       };
+
+       leds {
+               compatible = "gpio-leds";
+               led@0 {
+                       label = "dra7:usr1";
+                       gpios = <&pcf_lcd 4 GPIO_ACTIVE_LOW>;
+                       default-state = "off";
+               };
+
+               led@1 {
+                       label = "dra7:usr2";
+                       gpios = <&pcf_lcd 5 GPIO_ACTIVE_LOW>;
+                       default-state = "off";
+               };
+
+               led@2 {
+                       label = "dra7:usr3";
+                       gpios = <&pcf_lcd 6 GPIO_ACTIVE_LOW>;
+                       default-state = "off";
+               };
+
+               led@3 {
+                       label = "dra7:usr4";
+                       gpios = <&pcf_lcd 7 GPIO_ACTIVE_LOW>;
+                       default-state = "off";
+               };
+       };
+
+       gpio_keys {
+               compatible = "gpio-keys";
+               #address-cells = <1>;
+               #size-cells = <0>;
+               autorepeat;
+
+               USER1 {
+                       label = "btnUser1";
+                       linux,code = <BTN_0>;
+                       gpios = <&pcf_lcd 2 GPIO_ACTIVE_LOW>;
+               };
+
+               USER2 {
+                       label = "btnUser2";
+                       linux,code = <BTN_1>;
+                       gpios = <&pcf_lcd 3 GPIO_ACTIVE_LOW>;
+               };
+       };
 };
 
 &dra7_pmx_core {
                        0x418   (MUX_MODE15 | PULL_UP)  /* wakeup0.off */
                >;
        };
+
+       atl_pins: pinmux_atl_pins {
+               pinctrl-single,pins = <
+                       0x298 (PIN_OUTPUT | MUX_MODE5)  /* xref_clk1.atl_clk1 */
+                       0x29c (PIN_OUTPUT | MUX_MODE5)  /* xref_clk2.atl_clk2 */
+               >;
+       };
+
+       mcasp3_pins: pinmux_mcasp3_pins {
+               pinctrl-single,pins = <
+                       0x324 (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* mcasp3_aclkx */
+                       0x328 (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* mcasp3_fsx */
+                       0x32c (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* mcasp3_axr0 */
+                       0x330 (PIN_INPUT_PULLDOWN | MUX_MODE0)  /* mcasp3_axr1 */
+               >;
+       };
+
+       mcasp3_sleep_pins: pinmux_mcasp3_sleep_pins {
+               pinctrl-single,pins = <
+                       0x324 (MUX_MODE15)
+                       0x328 (MUX_MODE15)
+                       0x32c (MUX_MODE15)
+                       0x330 (MUX_MODE15)
+               >;
+       };
 };
 
 &i2c1 {
                };
        };
 
+       pcf_lcd: gpio@20 {
+               compatible = "nxp,pcf8575";
+               reg = <0x20>;
+               gpio-controller;
+               #gpio-cells = <2>;
+               interrupt-parent = <&gpio6>;
+               interrupts = <11 IRQ_TYPE_EDGE_FALLING>;
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
        pcf_gpio_21: gpio@21 {
                compatible = "ti,pcf8575";
                reg = <0x21>;
                #interrupt-cells = <2>;
        };
 
+       tlv320aic3106: tlv320aic3106@19 {
+               #sound-dai-cells = <0>;
+               compatible = "ti,tlv320aic3106";
+               reg = <0x19>;
+               adc-settle-ms = <40>;
+               ai3x-micbias-vg = <1>;          /* 2.0V */
+               status = "okay";
+
+               /* Regulators */
+               AVDD-supply = <&evm_3v3_sw>;
+               IOVDD-supply = <&evm_3v3_sw>;
+               DRVDD-supply = <&evm_3v3_sw>;
+               DVDD-supply = <&aic_dvdd>;
+       };
 };
 
 &i2c2 {
        pinctrl-names = "default";
        pinctrl-0 = <&i2c2_pins>;
        clock-frequency = <400000>;
+
+       pcf_hdmi: gpio@26 {
+               compatible = "nxp,pcf8575";
+               reg = <0x26>;
+               gpio-controller;
+               #gpio-cells = <2>;
+               p1 {
+                       /* vin6_sel_s0: high: VIN6, low: audio */
+                       gpio-hog;
+                       gpios = <1 GPIO_ACTIVE_HIGH>;
+                       output-low;
+                       line-name = "vin6_sel_s0";
+               };
+       };
 };
 
 &i2c3 {
         * SDCD signal is not being used here - using the fact that GPIO mode
         * is always hardwired.
         */
-       cd-gpios = <&gpio6 27 0>;
+       cd-gpios = <&gpio6 27 GPIO_ACTIVE_LOW>;
 };
 
 &mmc2 {
        status = "okay";
-       vmmc-supply = <&mmc2_3v3>;
+       vmmc-supply = <&evm_3v3_sw>;
        bus-width = <8>;
 };
 
        pinctrl-1 = <&dcan1_pins_sleep>;
        pinctrl-2 = <&dcan1_pins_default>;
 };
+
+&atl {
+       pinctrl-names = "default";
+       pinctrl-0 = <&atl_pins>;
+
+       assigned-clocks = <&abe_dpll_sys_clk_mux>,
+                         <&atl_gfclk_mux>,
+                         <&dpll_abe_ck>,
+                         <&dpll_abe_m2x2_ck>,
+                         <&atl_clkin2_ck>;
+       assigned-clock-parents = <&sys_clkin2>, <&dpll_abe_m2_ck>;
+       assigned-clock-rates = <0>, <0>, <180633600>, <361267200>, <5644800>;
+
+       status = "okay";
+
+       atl2 {
+               bws = <DRA7_ATL_WS_MCASP2_FSX>;
+               aws = <DRA7_ATL_WS_MCASP3_FSX>;
+       };
+};
+
+&mcasp3 {
+       #sound-dai-cells = <0>;
+       pinctrl-names = "default", "sleep";
+       pinctrl-0 = <&mcasp3_pins>;
+       pinctrl-1 = <&mcasp3_sleep_pins>;
+
+       assigned-clocks = <&mcasp3_ahclkx_mux>;
+       assigned-clock-parents = <&atl_clkin2_ck>;
+
+       status = "okay";
+
+       op-mode = <0>;          /* MCASP_IIS_MODE */
+       tdm-slots = <2>;
+       /* 4 serializer */
+       serial-dir = <  /* 0: INACTIVE, 1: TX, 2: RX */
+               1 2 0 0
+       >;
+};
+
+&mailbox5 {
+       status = "okay";
+       mbox_ipu1_ipc3x: mbox_ipu1_ipc3x {
+               status = "okay";
+       };
+       mbox_dsp1_ipc3x: mbox_dsp1_ipc3x {
+               status = "okay";
+       };
+};
+
+&mailbox6 {
+       status = "okay";
+       mbox_ipu2_ipc3x: mbox_ipu2_ipc3x {
+               status = "okay";
+       };
+       mbox_dsp2_ipc3x: mbox_dsp2_ipc3x {
+               status = "okay";
+       };
+};
index 8fedddc35999eef934131943c5696ea3af1a33ed..bc672fb91466a5635a29c0811c202ef5c418aeeb 100644 (file)
                                #thermal-sensor-cells = <1>;
                };
 
+               dsp1_system: dsp_system@40d00000 {
+                       compatible = "syscon";
+                       reg = <0x40d00000 0x100>;
+               };
+
                sdma: dma-controller@4a056000 {
                        compatible = "ti,omap4430-sdma";
                        reg = <0x4a056000 0x1000>;
                        status = "disabled";
                };
 
+               mmu0_dsp1: mmu@40d01000 {
+                       compatible = "ti,dra7-dsp-iommu";
+                       reg = <0x40d01000 0x100>;
+                       interrupts = <GIC_SPI 23 IRQ_TYPE_LEVEL_HIGH>;
+                       ti,hwmods = "mmu0_dsp1";
+                       #iommu-cells = <0>;
+                       ti,syscon-mmuconfig = <&dsp1_system 0x0>;
+                       status = "disabled";
+               };
+
+               mmu1_dsp1: mmu@40d02000 {
+                       compatible = "ti,dra7-dsp-iommu";
+                       reg = <0x40d02000 0x100>;
+                       interrupts = <GIC_SPI 145 IRQ_TYPE_LEVEL_HIGH>;
+                       ti,hwmods = "mmu1_dsp1";
+                       #iommu-cells = <0>;
+                       ti,syscon-mmuconfig = <&dsp1_system 0x1>;
+                       status = "disabled";
+               };
+
+               mmu_ipu1: mmu@58882000 {
+                       compatible = "ti,dra7-iommu";
+                       reg = <0x58882000 0x100>;
+                       interrupts = <GIC_SPI 395 IRQ_TYPE_LEVEL_HIGH>;
+                       ti,hwmods = "mmu_ipu1";
+                       #iommu-cells = <0>;
+                       ti,iommu-bus-err-back;
+                       status = "disabled";
+               };
+
+               mmu_ipu2: mmu@55082000 {
+                       compatible = "ti,dra7-iommu";
+                       reg = <0x55082000 0x100>;
+                       interrupts = <GIC_SPI 396 IRQ_TYPE_LEVEL_HIGH>;
+                       ti,hwmods = "mmu_ipu2";
+                       #iommu-cells = <0>;
+                       ti,iommu-bus-err-back;
+                       status = "disabled";
+               };
+
                abb_mpu: regulator-abb-mpu {
                        compatible = "ti,abb-v3";
                        regulator-name = "abb_mpu";
                        status = "disabled";
                };
 
+               mcasp3: mcasp@48468000 {
+                       compatible = "ti,dra7-mcasp-audio";
+                       ti,hwmods = "mcasp3";
+                       reg = <0x48468000 0x2000>;
+                       reg-names = "mpu";
+                       interrupts = <GIC_SPI 151 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 150 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "tx", "rx";
+                       dmas = <&sdma_xbar 133>, <&sdma_xbar 132>;
+                       dma-names = "tx", "rx";
+                       clocks = <&mcasp3_ahclkx_mux>;
+                       clock-names = "fck";
+                       status = "disabled";
+               };
+
                crossbar_mpu: crossbar@4a002a48 {
                        compatible = "ti,irq-crossbar";
                        reg = <0x4a002a48 0x130>;
index 6f6bd98c98dff2502ca3bb02b869e8d4ba79d950..d6104d5f0c0181ac8a880db0b67e29a3d65aaf19 100644 (file)
@@ -9,6 +9,7 @@
 
 #include "dra72x.dtsi"
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/clk/ti-dra7-atl.h>
 
 / {
        model = "TI DRA722";
                regulator-max-microvolt = <3300000>;
        };
 
+       aic_dvdd: fixedregulator-aic_dvdd {
+               /* TPS77018DBVT */
+               compatible = "regulator-fixed";
+               regulator-name = "aic_dvdd";
+               vin-supply = <&evm_3v3>;
+               regulator-min-microvolt = <1800000>;
+               regulator-max-microvolt = <1800000>;
+       };
+
        evm_3v3_sd: fixedregulator-sd {
                compatible = "regulator-fixed";
                regulator-name = "evm_3v3_sd";
                        };
                };
        };
+
+       sound0: sound@0 {
+               compatible = "simple-audio-card";
+               simple-audio-card,name = "DRA7xx-EVM";
+               simple-audio-card,widgets =
+                       "Headphone", "Headphone Jack",
+                       "Line", "Line Out",
+                       "Microphone", "Mic Jack",
+                       "Line", "Line In";
+               simple-audio-card,routing =
+                       "Headphone Jack",       "HPLOUT",
+                       "Headphone Jack",       "HPROUT",
+                       "Line Out",             "LLOUT",
+                       "Line Out",             "RLOUT",
+                       "MIC3L",                "Mic Jack",
+                       "MIC3R",                "Mic Jack",
+                       "Mic Jack",             "Mic Bias",
+                       "LINE1L",               "Line In",
+                       "LINE1R",               "Line In";
+               simple-audio-card,format = "dsp_b";
+               simple-audio-card,bitclock-master = <&sound0_master>;
+               simple-audio-card,frame-master = <&sound0_master>;
+               simple-audio-card,bitclock-inversion;
+
+               sound0_master: simple-audio-card,cpu {
+                       sound-dai = <&mcasp3>;
+                       system-clock-frequency = <5644800>;
+               };
+
+               simple-audio-card,codec {
+                       sound-dai = <&tlv320aic3106>;
+                       clocks = <&atl_clkin2_ck>;
+               };
+       };
 };
 
 &dra7_pmx_core {
                >;
        };
 
+       i2c5_pins: pinmux_i2c5_pins {
+               pinctrl-single,pins = <
+                       0x2b4 (PIN_INPUT | MUX_MODE10) /* mcasp1_axr0.i2c5_sda */
+                       0x2b8 (PIN_INPUT | MUX_MODE10) /* mcasp1_axr1.i2c5_scl */
+               >;
+       };
+
        nand_default: nand_default {
                pinctrl-single,pins = <
                        0x0     (PIN_INPUT  | MUX_MODE0) /* gpmc_ad0 */
                        0x3b8 (PIN_INPUT_PULLDOWN | MUX_MODE14) /* gpio7_12 HPD */
                >;
        };
+
+       atl_pins: pinmux_atl_pins {
+               pinctrl-single,pins = <
+                       0x298 (PIN_OUTPUT | MUX_MODE5)  /* xref_clk1.atl_clk1 */
+                       0x29c (PIN_OUTPUT | MUX_MODE5)  /* xref_clk2.atl_clk2 */
+               >;
+       };
+
+       mcasp3_pins: pinmux_mcasp3_pins {
+               pinctrl-single,pins = <
+                       0x324 (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* mcasp3_aclkx */
+                       0x328 (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* mcasp3_fsx */
+                       0x32c (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* mcasp3_axr0 */
+                       0x330 (PIN_INPUT_PULLDOWN | MUX_MODE0)  /* mcasp3_axr1 */
+               >;
+       };
+
+       mcasp3_sleep_pins: pinmux_mcasp3_sleep_pins {
+               pinctrl-single,pins = <
+                       0x324 (PIN_INPUT_PULLDOWN | MUX_MODE15)
+                       0x328 (PIN_INPUT_PULLDOWN | MUX_MODE15)
+                       0x32c (PIN_INPUT_PULLDOWN | MUX_MODE15)
+                       0x330 (PIN_INPUT_PULLDOWN | MUX_MODE15)
+               >;
+       };
 };
 
 &i2c1 {
                interrupts = <11 IRQ_TYPE_EDGE_FALLING>;
                interrupt-controller;
                #interrupt-cells = <2>;
+       };
 
-               cpsw_sel_s0 {
-                       gpio-hog;
-                       gpios = <4 GPIO_ACTIVE_HIGH>;
-                       output-low;
-               };
+       tlv320aic3106: tlv320aic3106@19 {
+               #sound-dai-cells = <0>;
+               compatible = "ti,tlv320aic3106";
+               reg = <0x19>;
+               adc-settle-ms = <40>;
+               ai3x-micbias-vg = <1>;          /* 2.0V */
+               status = "okay";
+
+               /* Regulators */
+               AVDD-supply = <&evm_3v3>;
+               IOVDD-supply = <&evm_3v3>;
+               DRVDD-supply = <&evm_3v3>;
+               DVDD-supply = <&aic_dvdd>;
        };
 };
 
                 * VIN6_SEL_S0 is low, thus selecting McASP3 over VIN6
                 */
                lines-initial-states = <0x0f2b>;
+
+               p1 {
+                       /* vin6_sel_s0: high: VIN6, low: audio */
+                       gpio-hog;
+                       gpios = <1 GPIO_ACTIVE_HIGH>;
+                       output-low;
+                       line-name = "vin6_sel_s0";
+               };
        };
 };
 
         * SDCD signal is not being used here - using the fact that GPIO mode
         * is a viable alternative
         */
-       cd-gpios = <&gpio6 27 0>;
+       cd-gpios = <&gpio6 27 GPIO_ACTIVE_LOW>;
        max-frequency = <192000000>;
 };
 
        pinctrl-0 = <&cpsw_default>;
        pinctrl-1 = <&cpsw_sleep>;
        slaves = <1>;
+       mode-gpios = <&pcf_gpio_21 4 GPIO_ACTIVE_HIGH>;
 };
 
 &cpsw_emac0 {
                };
        };
 };
+
+&atl {
+       pinctrl-names = "default";
+       pinctrl-0 = <&atl_pins>;
+
+       assigned-clocks = <&abe_dpll_sys_clk_mux>,
+                         <&atl_gfclk_mux>,
+                         <&dpll_abe_ck>,
+                         <&dpll_abe_m2x2_ck>,
+                         <&atl_clkin2_ck>;
+       assigned-clock-parents = <&sys_clkin2>, <&dpll_abe_m2_ck>;
+       assigned-clock-rates = <0>, <0>, <180633600>, <361267200>, <5644800>;
+
+       status = "okay";
+
+       atl2 {
+               bws = <DRA7_ATL_WS_MCASP2_FSX>;
+               aws = <DRA7_ATL_WS_MCASP3_FSX>;
+       };
+};
+
+&mcasp3 {
+       #sound-dai-cells = <0>;
+       pinctrl-names = "default", "sleep";
+       pinctrl-0 = <&mcasp3_pins>;
+       pinctrl-1 = <&mcasp3_sleep_pins>;
+
+       assigned-clocks = <&mcasp3_ahclkx_mux>;
+       assigned-clock-parents = <&atl_clkin2_ck>;
+
+       status = "okay";
+
+       op-mode = <0>;          /* MCASP_IIS_MODE */
+       tdm-slots = <2>;
+       /* 4 serializer */
+       serial-dir = <  /* 0: INACTIVE, 1: TX, 2: RX */
+               1 2 0 0
+       >;
+};
+
+&mailbox5 {
+       status = "okay";
+       mbox_ipu1_ipc3x: mbox_ipu1_ipc3x {
+               status = "okay";
+       };
+       mbox_dsp1_ipc3x: mbox_dsp1_ipc3x {
+               status = "okay";
+       };
+};
+
+&mailbox6 {
+       status = "okay";
+       mbox_ipu2_ipc3x: mbox_ipu2_ipc3x {
+               status = "okay";
+       };
+};
index eaca143faa7750c24c62c4fe6bebf58eed67fa48..70a217050a4c8603b6b285ecf34be4b762b072b6 100644 (file)
                 <&dss_video1_clk>;
        clock-names = "fck", "video1_clk";
 };
+
+&mailbox5 {
+       mbox_ipu1_ipc3x: mbox_ipu1_ipc3x {
+               ti,mbox-tx = <6 2 2>;
+               ti,mbox-rx = <4 2 2>;
+               status = "disabled";
+       };
+       mbox_dsp1_ipc3x: mbox_dsp1_ipc3x {
+               ti,mbox-tx = <5 2 2>;
+               ti,mbox-rx = <1 2 2>;
+               status = "disabled";
+       };
+};
+
+&mailbox6 {
+       mbox_ipu2_ipc3x: mbox_ipu2_ipc3x {
+               ti,mbox-tx = <6 2 2>;
+               ti,mbox-rx = <4 2 2>;
+               status = "disabled";
+       };
+};
index feea98e0a4b50ffb42a9a2238e7fb8fe81866bf4..8bcc47db1cd180f4e175f66ddcca7ba3103728cf 100644 (file)
        };
 
        ocp {
+               dsp2_system: dsp_system@41500000 {
+                       compatible = "syscon";
+                       reg = <0x41500000 0x100>;
+               };
+
                omap_dwc3_4: omap_dwc3_4@48940000 {
                        compatible = "ti,dwc3";
                        ti,hwmods = "usb_otg_ss4";
                                dr_mode = "otg";
                        };
                };
+
+               mmu0_dsp2: mmu@41501000 {
+                       compatible = "ti,dra7-dsp-iommu";
+                       reg = <0x41501000 0x100>;
+                       interrupts = <GIC_SPI 146 IRQ_TYPE_LEVEL_HIGH>;
+                       ti,hwmods = "mmu0_dsp2";
+                       #iommu-cells = <0>;
+                       ti,syscon-mmuconfig = <&dsp2_system 0x0>;
+                       status = "disabled";
+               };
+
+               mmu1_dsp2: mmu@41502000 {
+                       compatible = "ti,dra7-dsp-iommu";
+                       reg = <0x41502000 0x100>;
+                       interrupts = <GIC_SPI 147 IRQ_TYPE_LEVEL_HIGH>;
+                       ti,hwmods = "mmu1_dsp2";
+                       #iommu-cells = <0>;
+                       ti,syscon-mmuconfig = <&dsp2_system 0x1>;
+                       status = "disabled";
+               };
        };
 };
 
                 <&dss_video2_clk>;
        clock-names = "fck", "video1_clk", "video2_clk";
 };
+
+&mailbox5 {
+       mbox_ipu1_ipc3x: mbox_ipu1_ipc3x {
+               ti,mbox-tx = <6 2 2>;
+               ti,mbox-rx = <4 2 2>;
+               status = "disabled";
+       };
+       mbox_dsp1_ipc3x: mbox_dsp1_ipc3x {
+               ti,mbox-tx = <5 2 2>;
+               ti,mbox-rx = <1 2 2>;
+               status = "disabled";
+       };
+};
+
+&mailbox6 {
+       mbox_ipu2_ipc3x: mbox_ipu2_ipc3x {
+               ti,mbox-tx = <6 2 2>;
+               ti,mbox-rx = <4 2 2>;
+               status = "disabled";
+       };
+       mbox_dsp2_ipc3x: mbox_dsp2_ipc3x {
+               ti,mbox-tx = <5 2 2>;
+               ti,mbox-rx = <1 2 2>;
+               status = "disabled";
+       };
+};
index b4031fa4a567610b2a58086f98bddfaf253e77bd..504cf45d3cb8f5238d023ed7f3f0d982eda9a670 100644 (file)
@@ -26,7 +26,7 @@
                };
 
                i2c@4000a000 {
-                       efm32,location = <3>;
+                       energymicro,location = <3>;
                        status = "ok";
 
                        temp@48 {
@@ -43,7 +43,7 @@
 
                spi0: spi@4000c000 { /* USART0 */
                        cs-gpios = <&gpio 68 1>; // E4
-                       location = <1>;
+                       energymicro,location = <1>;
                        status = "ok";
 
                        microsd@0 {
@@ -57,7 +57,7 @@
 
                spi1: spi@4000c400 { /* USART1 */
                        cs-gpios = <&gpio 51 1>; // D3
-                       location = <1>;
+                       energymicro,location = <1>;
                        status = "ok";
 
                        ks8851@0 {
@@ -70,7 +70,7 @@
                };
 
                uart4: uart@4000e400 { /* UART1 */
-                       location = <2>;
+                       energymicro,location = <2>;
                        status = "ok";
                };
 
index 106d505c5d3d816fb096ab6c5e2e23843e134bfd..c747983771c7c504e58970848500cfd132e3c0b9 100644 (file)
@@ -23,7 +23,7 @@
 
        soc {
                adc: adc@40002000 {
-                       compatible = "efm32,adc";
+                       compatible = "energymicro,efm32-adc";
                        reg = <0x40002000 0x400>;
                        interrupts = <7>;
                        clocks = <&cmu clk_HFPERCLKADC0>;
@@ -31,7 +31,7 @@
                };
 
                gpio: gpio@40006000 {
-                       compatible = "efm32,gpio";
+                       compatible = "energymicro,efm32-gpio";
                        reg = <0x40006000 0x1000>;
                        interrupts = <1 11>;
                        gpio-controller;
@@ -45,7 +45,7 @@
                i2c0: i2c@4000a000 {
                        #address-cells = <1>;
                        #size-cells = <0>;
-                       compatible = "efm32,i2c";
+                       compatible = "energymicro,efm32-i2c";
                        reg = <0x4000a000 0x400>;
                        interrupts = <9>;
                        clocks = <&cmu clk_HFPERCLKI2C0>;
@@ -56,7 +56,7 @@
                i2c1: i2c@4000a400 {
                        #address-cells = <1>;
                        #size-cells = <0>;
-                       compatible = "efm32,i2c";
+                       compatible = "energymicro,efm32-i2c";
                        reg = <0x4000a400 0x400>;
                        interrupts = <10>;
                        clocks = <&cmu clk_HFPERCLKI2C1>;
@@ -67,7 +67,7 @@
                spi0: spi@4000c000 { /* USART0 */
                        #address-cells = <1>;
                        #size-cells = <0>;
-                       compatible = "efm32,spi";
+                       compatible = "energymicro,efm32-spi";
                        reg = <0x4000c000 0x400>;
                        interrupts = <3 4>;
                        clocks = <&cmu clk_HFPERCLKUSART0>;
@@ -77,7 +77,7 @@
                spi1: spi@4000c400 { /* USART1 */
                        #address-cells = <1>;
                        #size-cells = <0>;
-                       compatible = "efm32,spi";
+                       compatible = "energymicro,efm32-spi";
                        reg = <0x4000c400 0x400>;
                        interrupts = <15 16>;
                        clocks = <&cmu clk_HFPERCLKUSART1>;
@@ -87,7 +87,7 @@
                spi2: spi@4000c800 { /* USART2 */
                        #address-cells = <1>;
                        #size-cells = <0>;
-                       compatible = "efm32,spi";
+                       compatible = "energymicro,efm32-spi";
                        reg = <0x4000c800 0x400>;
                        interrupts = <18 19>;
                        clocks = <&cmu clk_HFPERCLKUSART2>;
@@ -95,7 +95,7 @@
                };
 
                uart0: uart@4000c000 { /* USART0 */
-                       compatible = "efm32,uart";
+                       compatible = "energymicro,efm32-uart";
                        reg = <0x4000c000 0x400>;
                        interrupts = <3 4>;
                        clocks = <&cmu clk_HFPERCLKUSART0>;
                };
 
                uart1: uart@4000c400 { /* USART1 */
-                       compatible = "efm32,uart";
+                       compatible = "energymicro,efm32-uart";
                        reg = <0x4000c400 0x400>;
                        interrupts = <15 16>;
                        clocks = <&cmu clk_HFPERCLKUSART1>;
                };
 
                uart2: uart@4000c800 { /* USART2 */
-                       compatible = "efm32,uart";
+                       compatible = "energymicro,efm32-uart";
                        reg = <0x4000c800 0x400>;
                        interrupts = <18 19>;
                        clocks = <&cmu clk_HFPERCLKUSART2>;
                };
 
                uart3: uart@4000e000 { /* UART0 */
-                       compatible = "efm32,uart";
+                       compatible = "energymicro,efm32-uart";
                        reg = <0x4000e000 0x400>;
                        interrupts = <20 21>;
                        clocks = <&cmu clk_HFPERCLKUART0>;
                };
 
                uart4: uart@4000e400 { /* UART1 */
-                       compatible = "efm32,uart";
+                       compatible = "energymicro,efm32-uart";
                        reg = <0x4000e400 0x400>;
                        interrupts = <22 23>;
                        clocks = <&cmu clk_HFPERCLKUART1>;
                };
 
                timer0: timer@40010000 {
-                       compatible = "efm32,timer";
+                       compatible = "energymicro,efm32-timer";
                        reg = <0x40010000 0x400>;
                        interrupts = <2>;
                        clocks = <&cmu clk_HFPERCLKTIMER0>;
                };
 
                timer1: timer@40010400 {
-                       compatible = "efm32,timer";
+                       compatible = "energymicro,efm32-timer";
                        reg = <0x40010400 0x400>;
                        interrupts = <12>;
                        clocks = <&cmu clk_HFPERCLKTIMER1>;
                };
 
                timer2: timer@40010800 {
-                       compatible = "efm32,timer";
+                       compatible = "energymicro,efm32-timer";
                        reg = <0x40010800 0x400>;
                        interrupts = <13>;
                        clocks = <&cmu clk_HFPERCLKTIMER2>;
                };
 
                timer3: timer@40010c00 {
-                       compatible = "efm32,timer";
+                       compatible = "energymicro,efm32-timer";
                        reg = <0x40010c00 0x400>;
                        interrupts = <14>;
                        clocks = <&cmu clk_HFPERCLKTIMER3>;
index 540a0adf2be6dcc94da5b487958cacca4348996d..443a350858460692d18bbe9f9470b0b3778d27a8 100644 (file)
                regulator-name = "V_EMMC_2.8V-fixed";
                regulator-min-microvolt = <2800000>;
                regulator-max-microvolt = <2800000>;
-               gpio = <&gpk0 2 0>;
+               gpio = <&gpk0 2 GPIO_ACTIVE_HIGH>;
                enable-active-high;
        };
 
        i2c_max77836: i2c-gpio-0 {
                compatible = "i2c-gpio";
-               gpios = <&gpd0 2 0>, <&gpd0 3 0>;
+               gpios = <&gpd0 2 GPIO_ACTIVE_HIGH>, <&gpd0 3 GPIO_ACTIVE_HIGH>;
                #address-cells = <1>;
                #size-cells = <0>;
 
 };
 
 &exynos_usbphy {
+       vbus-supply = <&safeout_reg>;
        status = "okay";
 };
 
                                regulator-name = "V_EMMC_1.8V";
                                regulator-min-microvolt = <1800000>;
                                regulator-max-microvolt = <1800000>;
-                               samsung,ext-control-gpios = <&gpk0 2 0>;
+                               samsung,ext-control-gpios = <&gpk0 2 GPIO_ACTIVE_HIGH>;
                        };
 
                        ldo12_reg: LDO12 {
                                regulator-name = "V_EMMC_2.8V";
                                regulator-min-microvolt = <2800000>;
                                regulator-max-microvolt = <2800000>;
-                               samsung,ext-control-gpios = <&gpk0 2 0>;
+                               samsung,ext-control-gpios = <&gpk0 2 GPIO_ACTIVE_HIGH>;
                        };
 
                        ldo13_reg: LDO13 {
index 41a5fafb9aa93a5393cc7b0930f376041f3a5fbb..3e64d5dcdd60c6abfc9a0a9249f71bb54cd77eb9 100644 (file)
@@ -49,7 +49,7 @@
 
        i2c_max77836: i2c-gpio-0 {
                compatible = "i2c-gpio";
-               gpios = <&gpd0 2 0>, <&gpd0 3 0>;
+               gpios = <&gpd0 2 GPIO_ACTIVE_HIGH>, <&gpd0 3 GPIO_ACTIVE_HIGH>;
                #address-cells = <1>;
                #size-cells = <0>;
 
 
 &exynos_usbphy {
        status = "okay";
+       vbus-supply = <&safeout_reg>;
 };
 
 &hsotg {
                reg = <0>;
                vdd3-supply = <&ldo16_reg>;
                vci-supply = <&ldo20_reg>;
-               reset-gpios = <&gpe0 1 0>;
-               te-gpios = <&gpx0 6 0>;
+               reset-gpios = <&gpe0 1 GPIO_ACTIVE_HIGH>;
+               te-gpios = <&gpx0 6 GPIO_ACTIVE_HIGH>;
                power-on-delay= <30>;
                power-off-delay= <120>;
                reset-delay = <5>;
                                regulator-name = "V_EMMC_1.8V";
                                regulator-min-microvolt = <1800000>;
                                regulator-max-microvolt = <1800000>;
-                               samsung,ext-control-gpios = <&gpk0 2 0>;
+                               samsung,ext-control-gpios = <&gpk0 2 GPIO_ACTIVE_HIGH>;
                        };
 
                        ldo12_reg: LDO12 {
                                regulator-name = "V_EMMC_2.8V";
                                regulator-min-microvolt = <2800000>;
                                regulator-max-microvolt = <2800000>;
-                               samsung,ext-control-gpios = <&gpk0 2 0>;
+                               samsung,ext-control-gpios = <&gpk0 2 GPIO_ACTIVE_HIGH>;
                        };
 
                        ldo13_reg: LDO13 {
index 033def482fc3d71693c48bd5a942eda4a7833bbf..2f30d632f1cca74c70e5b8b733047f242e608a13 100644 (file)
                };
 
                mshc_0: mshc@12510000 {
-                       compatible = "samsung,exynos5250-dw-mshc";
+                       compatible = "samsung,exynos5420-dw-mshc";
                        reg = <0x12510000 0x1000>;
                        interrupts = <0 142 0>;
                        clocks = <&cmu CLK_SDMMC0>, <&cmu CLK_SCLK_MMC0>;
                };
 
                mshc_1: mshc@12520000 {
-                       compatible = "samsung,exynos5250-dw-mshc";
+                       compatible = "samsung,exynos5420-dw-mshc";
                        reg = <0x12520000 0x1000>;
                        interrupts = <0 143 0>;
                        clocks = <&cmu CLK_SDMMC1>, <&cmu CLK_SCLK_MMC1>;
index 98c0a368b7778dc3b13ec9e07d476e5eebff9cbb..3184e10f260a39a9cace8e70d38ac58ef851afd8 100644 (file)
                interrupts = <0 52 0>;
                clocks = <&clock CLK_UART0>, <&clock CLK_SCLK_UART0>;
                clock-names = "uart", "clk_uart_baud0";
+               dmas = <&pdma0 15>, <&pdma0 16>;
+               dma-names = "rx", "tx";
                status = "disabled";
        };
 
                interrupts = <0 53 0>;
                clocks = <&clock CLK_UART1>, <&clock CLK_SCLK_UART1>;
                clock-names = "uart", "clk_uart_baud0";
+               dmas = <&pdma1 15>, <&pdma1 16>;
+               dma-names = "rx", "tx";
                status = "disabled";
        };
 
                interrupts = <0 54 0>;
                clocks = <&clock CLK_UART2>, <&clock CLK_SCLK_UART2>;
                clock-names = "uart", "clk_uart_baud0";
+               dmas = <&pdma0 17>, <&pdma0 18>;
+               dma-names = "rx", "tx";
                status = "disabled";
        };
 
                interrupts = <0 55 0>;
                clocks = <&clock CLK_UART3>, <&clock CLK_SCLK_UART3>;
                clock-names = "uart", "clk_uart_baud0";
+               dmas = <&pdma1 17>, <&pdma1 18>;
+               dma-names = "rx", "tx";
                status = "disabled";
        };
 
index e050d85cdacddf24268870988badefca45d75a88..b8f866991bdd4382f86e2d70c582bdbde66a7bd8 100644 (file)
@@ -16,6 +16,7 @@
 
 /dts-v1/;
 #include "exynos4210.dtsi"
+#include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
 
 / {
@@ -45,7 +46,7 @@
                        regulator-name = "VMEM_VDD_2.8V";
                        regulator-min-microvolt = <2800000>;
                        regulator-max-microvolt = <2800000>;
-                       gpio = <&gpx1 1 0>;
+                       gpio = <&gpx1 1 GPIO_ACTIVE_HIGH>;
                        enable-active-high;
                };
        };
 
                up {
                        label = "Up";
-                       gpios = <&gpx2 0 1>;
+                       gpios = <&gpx2 0 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_UP>;
                        gpio-key,wakeup;
                };
 
                down {
                        label = "Down";
-                       gpios = <&gpx2 1 1>;
+                       gpios = <&gpx2 1 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_DOWN>;
                        gpio-key,wakeup;
                };
 
                back {
                        label = "Back";
-                       gpios = <&gpx1 7 1>;
+                       gpios = <&gpx1 7 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_BACK>;
                        gpio-key,wakeup;
                };
 
                home {
                        label = "Home";
-                       gpios = <&gpx1 6 1>;
+                       gpios = <&gpx1 6 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_HOME>;
                        gpio-key,wakeup;
                };
 
                menu {
                        label = "Menu";
-                       gpios = <&gpx1 5 1>;
+                       gpios = <&gpx1 5 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_MENU>;
                        gpio-key,wakeup;
                };
@@ -94,7 +95,7 @@
        leds {
                compatible = "gpio-leds";
                status {
-                       gpios = <&gpx1 3 1>;
+                       gpios = <&gpx1 3 GPIO_ACTIVE_LOW>;
                        linux,default-trigger = "heartbeat";
                };
        };
index 043b03caff8f19489d8d0f287ef13612f49c41c5..bc1448ba95d3b135f99efdf2396e0242533ae44e 100644 (file)
@@ -16,6 +16,7 @@
 
 /dts-v1/;
 #include "exynos4210.dtsi"
+#include <dt-bindings/gpio/gpio.h>
 
 / {
        model = "Samsung smdkv310 evaluation board based on Exynos4210";
 };
 
 &spi_2 {
-       cs-gpios = <&gpc1 2 0>;
+       cs-gpios = <&gpc1 2 GPIO_ACTIVE_HIGH>;
        status = "okay";
 
        w25x80@0 {
index ba34886f8b65b6227f82ef93c530603b64910449..a50be640f1b03dd0422e6ad8556dcf60b6d5b707 100644 (file)
@@ -14,6 +14,7 @@
 
 /dts-v1/;
 #include "exynos4210.dtsi"
+#include <dt-bindings/gpio/gpio.h>
 
 / {
        model = "Samsung Trats based on Exynos4210";
@@ -39,7 +40,7 @@
                        regulator-name = "VMEM_VDD_2.8V";
                        regulator-min-microvolt = <2800000>;
                        regulator-max-microvolt = <2800000>;
-                       gpio = <&gpk0 2 0>;
+                       gpio = <&gpk0 2 GPIO_ACTIVE_HIGH>;
                        enable-active-high;
                };
 
@@ -48,7 +49,7 @@
                        regulator-name = "TSP_FIXED_VOLTAGES";
                        regulator-min-microvolt = <2800000>;
                        regulator-max-microvolt = <2800000>;
-                       gpio = <&gpl0 3 0>;
+                       gpio = <&gpl0 3 GPIO_ACTIVE_HIGH>;
                        enable-active-high;
                };
 
@@ -57,7 +58,7 @@
                        regulator-name = "8M_AF_2.8V_EN";
                        regulator-min-microvolt = <2800000>;
                        regulator-max-microvolt = <2800000>;
-                       gpio = <&gpk1 1 0>;
+                       gpio = <&gpk1 1 GPIO_ACTIVE_HIGH>;
                        enable-active-high;
                };
 
@@ -66,7 +67,7 @@
                        regulator-name = "CAM_IO_EN";
                        regulator-min-microvolt = <2800000>;
                        regulator-max-microvolt = <2800000>;
-                       gpio = <&gpe2 1 0>;
+                       gpio = <&gpe2 1 GPIO_ACTIVE_HIGH>;
                        enable-active-high;
                };
 
@@ -75,7 +76,7 @@
                        regulator-name = "8M_1.2V_EN";
                        regulator-min-microvolt = <1200000>;
                        regulator-max-microvolt = <1200000>;
-                       gpio = <&gpe2 5 0>;
+                       gpio = <&gpe2 5 GPIO_ACTIVE_HIGH>;
                        enable-active-high;
                };
 
@@ -84,7 +85,7 @@
                        regulator-name = "VT_CORE_1.5V";
                        regulator-min-microvolt = <1500000>;
                        regulator-max-microvolt = <1500000>;
-                       gpio = <&gpe2 2 0>;
+                       gpio = <&gpe2 2 GPIO_ACTIVE_HIGH>;
                        enable-active-high;
                };
        };
                compatible = "gpio-keys";
 
                vol-down-key {
-                       gpios = <&gpx2 1 1>;
+                       gpios = <&gpx2 1 GPIO_ACTIVE_LOW>;
                        linux,code = <114>;
                        label = "volume down";
                        debounce-interval = <10>;
                };
 
                vol-up-key {
-                       gpios = <&gpx2 0 1>;
+                       gpios = <&gpx2 0 GPIO_ACTIVE_LOW>;
                        linux,code = <115>;
                        label = "volume up";
                        debounce-interval = <10>;
                };
 
                power-key {
-                       gpios = <&gpx2 7 1>;
+                       gpios = <&gpx2 7 GPIO_ACTIVE_LOW>;
                        linux,code = <116>;
                        label = "power";
                        debounce-interval = <10>;
                };
 
                ok-key {
-                       gpios = <&gpx3 5 1>;
+                       gpios = <&gpx3 5 GPIO_ACTIVE_LOW>;
                        linux,code = <352>;
                        label = "ok";
                        debounce-interval = <10>;
                compatible = "samsung,s6e8aa0";
                vdd3-supply = <&vcclcd_reg>;
                vci-supply = <&vlcd_reg>;
-               reset-gpios = <&gpy4 5 0>;
+               reset-gpios = <&gpy4 5 GPIO_ACTIVE_HIGH>;
                power-on-delay= <50>;
                reset-delay = <100>;
                init-delay = <100>;
 
 &exynos_usbphy {
        status = "okay";
+       vbus-supply = <&safe1_sreg>;
 };
 
 &fimd {
                max8997,pmic-ignore-gpiodvs-side-effect;
                max8997,pmic-buck125-default-dvs-idx = <0>;
 
-               max8997,pmic-buck125-dvs-gpios = <&gpx0 5 0>,
-                                                <&gpx0 6 0>,
-                                                <&gpl0 0 0>;
+               max8997,pmic-buck125-dvs-gpios = <&gpx0 5 GPIO_ACTIVE_HIGH>,
+                                                <&gpx0 6 GPIO_ACTIVE_HIGH>,
+                                                <&gpl0 0 GPIO_ACTIVE_HIGH>;
 
                max8997,pmic-buck1-dvs-voltage = <1350000>, <1300000>,
                                                 <1250000>, <1200000>,
 
                        safe1_sreg: ESAFEOUT1 {
                             regulator-name = "SAFEOUT1";
-                            regulator-always-on;
                        };
 
                        safe2_sreg: ESAFEOUT2 {
index eb379526e23425f145daa1f20069f07292bc7f88..81b7ec7b3e3178e6bd81c91eb561790b17b4659f 100644 (file)
@@ -14,6 +14,7 @@
 
 /dts-v1/;
 #include "exynos4210.dtsi"
+#include <dt-bindings/gpio/gpio.h>
 
 / {
        model = "Samsung Universal C210 based on Exynos4210 rev0";
@@ -65,7 +66,7 @@
                regulator-name = "VMEM_VDD_2_8V";
                regulator-min-microvolt = <2800000>;
                regulator-max-microvolt = <2800000>;
-               gpio = <&gpe1 3 0>;
+               gpio = <&gpe1 3 GPIO_ACTIVE_HIGH>;
                enable-active-high;
        };
 
                compatible = "gpio-keys";
 
                vol-up-key {
-                       gpios = <&gpx2 0 1>;
+                       gpios = <&gpx2 0 GPIO_ACTIVE_LOW>;
                        linux,code = <115>;
                        label = "volume up";
                        debounce-interval = <1>;
                };
 
                vol-down-key {
-                       gpios = <&gpx2 1 1>;
+                       gpios = <&gpx2 1 GPIO_ACTIVE_LOW>;
                        linux,code = <114>;
                        label = "volume down";
                        debounce-interval = <1>;
                };
 
                config-key {
-                       gpios = <&gpx2 2 1>;
+                       gpios = <&gpx2 2 GPIO_ACTIVE_LOW>;
                        linux,code = <171>;
                        label = "config";
                        debounce-interval = <1>;
                };
 
                camera-key {
-                       gpios = <&gpx2 3 1>;
+                       gpios = <&gpx2 3 GPIO_ACTIVE_LOW>;
                        linux,code = <212>;
                        label = "camera";
                        debounce-interval = <1>;
                };
 
                power-key {
-                       gpios = <&gpx2 7 1>;
+                       gpios = <&gpx2 7 GPIO_ACTIVE_LOW>;
                        linux,code = <116>;
                        label = "power";
                        debounce-interval = <1>;
                };
 
                ok-key {
-                       gpios = <&gpx3 5 1>;
+                       gpios = <&gpx3 5 GPIO_ACTIVE_LOW>;
                        linux,code = <352>;
                        label = "ok";
                        debounce-interval = <1>;
                regulator-name = "TSP_2_8V";
                regulator-min-microvolt = <2800000>;
                regulator-max-microvolt = <2800000>;
-               gpio = <&gpe2 3 0>;
+               gpio = <&gpe2 3 GPIO_ACTIVE_HIGH>;
                enable-active-high;
        };
 
                #address-cells = <1>;
                #size-cells = <0>;
 
-               gpio-sck = <&gpy3 1 0>;
-               gpio-mosi = <&gpy3 3 0>;
+               gpio-sck = <&gpy3 1 GPIO_ACTIVE_HIGH>;
+               gpio-mosi = <&gpy3 3 GPIO_ACTIVE_HIGH>;
                num-chipselects = <1>;
-               cs-gpios = <&gpy4 3 0>;
+               cs-gpios = <&gpy4 3 GPIO_ACTIVE_HIGH>;
 
                lcd@0 {
                        compatible = "samsung,ld9040";
                        reg = <0>;
                        vdd3-supply = <&ldo7_reg>;
                        vci-supply = <&ldo17_reg>;
-                       reset-gpios = <&gpy4 5 0>;
+                       reset-gpios = <&gpy4 5 GPIO_ACTIVE_HIGH>;
                        spi-max-frequency = <1200000>;
                        spi-cpol;
                        spi-cpha;
                regulator-name = "HDMI_5V";
                regulator-min-microvolt = <5000000>;
                regulator-max-microvolt = <5000000>;
-               gpio = <&gpe0 1 0>;
+               gpio = <&gpe0 1 GPIO_ACTIVE_HIGH>;
                enable-active-high;
        };
 
        hdmi_ddc: i2c-ddc {
                compatible = "i2c-gpio";
-               gpios = <&gpe4 2 0 &gpe4 3 0>;
+               gpios = <&gpe4 2 GPIO_ACTIVE_HIGH &gpe4 3 GPIO_ACTIVE_HIGH>;
                i2c-gpio,delay-us = <100>;
                #address-cells = <1>;
                #size-cells = <0>;
 
 &exynos_usbphy {
        status = "okay";
+       vbus-supply = <&safeout1_reg>;
 };
 
 &fimd {
 };
 
 &hdmi {
-       hpd-gpio = <&gpx3 7 0>;
+       hpd-gpio = <&gpx3 7 GPIO_ACTIVE_HIGH>;
        pinctrl-names = "default";
        pinctrl-0 = <&hdmi_hpd>;
        hdmi-en-supply = <&hdmi_en>;
                compatible = "maxim,max8952";
                reg = <0x60>;
 
-               max8952,vid-gpios = <&gpx0 3 0>, <&gpx0 4 0>;
+               max8952,vid-gpios = <&gpx0 3 GPIO_ACTIVE_HIGH>,
+                                   <&gpx0 4 GPIO_ACTIVE_HIGH>;
                max8952,default-mode = <0>;
                max8952,dvs-mode-microvolt = <1250000>, <1200000>,
                                                <1050000>, <950000>;
                reg = <0x66>;
 
                max8998,pmic-buck1-default-dvs-idx = <0>;
-               max8998,pmic-buck1-dvs-gpios = <&gpx0 5 0>,
-                                               <&gpx0 6 0>;
+               max8998,pmic-buck1-dvs-gpios = <&gpx0 5 GPIO_ACTIVE_HIGH>,
+                                               <&gpx0 6 GPIO_ACTIVE_HIGH>;
                max8998,pmic-buck1-dvs-voltage = <1100000>, <1000000>,
                                                <1100000>, <1000000>;
 
                max8998,pmic-buck2-default-dvs-idx = <0>;
-               max8998,pmic-buck2-dvs-gpio = <&gpe2 0 0>;
+               max8998,pmic-buck2-dvs-gpio = <&gpe2 0 GPIO_ACTIVE_HIGH>;
                max8998,pmic-buck2-dvs-voltage = <1200000>, <1100000>;
 
                regulators {
 
                        safeout1_reg: ESAFEOUT1 {
                                regulator-name = "SAFEOUT1";
-                               regulator-always-on;
                        };
 
                        safeout2_reg: ESAFEOUT2 {
        pinctrl-0 = <&sd2_clk &sd2_cmd &sd2_bus4>;
        pinctrl-names = "default";
        vmmc-supply = <&ldo5_reg>;
-       cd-gpios = <&gpx3 4 0>;
+       cd-gpios = <&gpx3 4 GPIO_ACTIVE_HIGH>;
        cd-inverted;
        status = "okay";
 };
index db52841297a5744d29b86fc167b43dcf1c6a1db6..edf0fc8db6fffa4673a61834d20751757829b672 100644 (file)
@@ -11,6 +11,7 @@
 #include <dt-bindings/input/input.h>
 #include <dt-bindings/clock/maxim,max77686.h>
 #include "exynos4412.dtsi"
+#include <dt-bindings/gpio/gpio.h>
 
 / {
        chosen {
@@ -30,7 +31,7 @@
                power_key {
                        interrupt-parent = <&gpx1>;
                        interrupts = <3 0>;
-                       gpios = <&gpx1 3 1>;
+                       gpios = <&gpx1 3 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_POWER>;
                        label = "power key";
                        debounce-interval = <10>;
@@ -70,7 +71,7 @@
                pinctrl-0 = <&sd1_cd>;
                pinctrl-names = "default";
                compatible = "mmc-pwrseq-emmc";
-               reset-gpios = <&gpk1 2 1>;
+               reset-gpios = <&gpk1 2 GPIO_ACTIVE_LOW>;
        };
 
        camera {
 };
 
 &hdmi {
-       hpd-gpio = <&gpx3 7 0>;
+       hpd-gpio = <&gpx3 7 GPIO_ACTIVE_HIGH>;
        pinctrl-names = "default";
        pinctrl-0 = <&hdmi_hpd>;
        vdd-supply = <&ldo8_reg>;
 };
 
 &i2c_0 {
-       pinctrl-0 = <&i2c0_bus>;
-       pinctrl-names = "default";
        samsung,i2c-sda-delay = <100>;
        samsung,i2c-max-bus-freq = <400000>;
        status = "okay";
                compatible = "smsc,usb3503";
                reg = <0x08>;
 
-               intn-gpios = <&gpx3 0 0>;
-               connect-gpios = <&gpx3 4 0>;
-               reset-gpios = <&gpx3 5 0>;
+               intn-gpios = <&gpx3 0 GPIO_ACTIVE_HIGH>;
+               connect-gpios = <&gpx3 4 GPIO_ACTIVE_HIGH>;
+               reset-gpios = <&gpx3 5 GPIO_ACTIVE_HIGH>;
                initial-mode = <1>;
        };
 
                                regulator-always-on;
                        };
 
-                       ldo8_reg: ldo@8 {
-                               regulator-compatible = "LDO8";
+                       ldo8_reg: LDO8 {
                                regulator-name = "VDD10_HDMI_1.0V";
                                regulator-min-microvolt = <1000000>;
                                regulator-max-microvolt = <1000000>;
                        };
 
-                       ldo10_reg: ldo@10 {
-                               regulator-compatible = "LDO10";
+                       ldo10_reg: LDO10 {
                                regulator-name = "VDDQ_MIPIHSI_1.8V";
                                regulator-min-microvolt = <1800000>;
                                regulator-max-microvolt = <1800000>;
 };
 
 &i2c_1 {
-       pinctrl-names = "default";
-       pinctrl-0 = <&i2c1_bus>;
        status = "okay";
        max98090: max98090@10 {
                compatible = "maxim,max98090";
 
 &i2c_2 {
        status = "okay";
-       pinctrl-names = "default";
-       pinctrl-0 = <&i2c2_bus>;
 };
 
 &i2c_8 {
        pinctrl-0 = <&sd2_clk &sd2_cmd &sd2_cd &sd2_bus4>;
        pinctrl-names = "default";
        vmmc-supply = <&ldo4_reg &ldo21_reg>;
-       cd-gpios = <&gpk2 2 0>;
+       cd-gpios = <&gpk2 2 GPIO_ACTIVE_HIGH>;
        cd-inverted;
        status = "okay";
 };
index 8632f35c6c26892fcbea54b71d41cbed29820458..646ff0bd001a33e9cd1862d77bc4ef9f0a8bbb98 100644 (file)
                compatible = "gpio-leds";
                led1 {
                        label = "led1:heart";
-                       gpios = <&gpc1 0 1>;
+                       gpios = <&gpc1 0 GPIO_ACTIVE_LOW>;
                        default-state = "on";
                        linux,default-trigger = "heartbeat";
                };
        };
+
+       fan0: pwm-fan {
+               compatible = "pwm-fan";
+               pwms = <&pwm 0 10000 0>;
+               cooling-min-state = <0>;
+               cooling-max-state = <3>;
+               #cooling-cells = <2>;
+               cooling-levels = <0 102 170 230>;
+       };
+
+       thermal-zones {
+               cpu_thermal: cpu-thermal {
+                       cooling-maps {
+                               map0 {
+                                    trip = <&cpu_alert1>;
+                                    cooling-device = <&cpu0 7 7>;
+                               };
+                               map1 {
+                                    trip = <&cpu_alert2>;
+                                    cooling-device = <&cpu0 13 13>;
+                               };
+                               map2 {
+                                    trip = <&cpu_alert0>;
+                                    cooling-device = <&fan0 0 1>;
+                               };
+                               map3 {
+                                    trip = <&cpu_alert1>;
+                                    cooling-device = <&fan0 1 2>;
+                               };
+                               map4 {
+                                    trip = <&cpu_alert2>;
+                                    cooling-device = <&fan0 2 3>;
+                               };
+                       };
+               };
+       };
+};
+
+&pwm {
+       pinctrl-0 = <&pwm0_out>;
+       pinctrl-names = "default";
+       samsung,pwm-outputs = <0>;
+       status = "okay";
 };
 
 &usb3503 {
index 679ac103ebf6126b0a1e58a376188de8b39bb2df..b44bb682e976705aa23824f421c7cdf419d92151 100644 (file)
                compatible = "gpio-leds";
                led1 {
                        label = "led1:heart";
-                       gpios = <&gpc1 0 1>;
+                       gpios = <&gpc1 0 GPIO_ACTIVE_LOW>;
                        default-state = "on";
                        linux,default-trigger = "heartbeat";
                };
                led2 {
                        label = "led2:mmc0";
-                       gpios = <&gpc1 2 1>;
+                       gpios = <&gpc1 2 GPIO_ACTIVE_LOW>;
                        default-state = "on";
                        linux,default-trigger = "mmc0";
                };
@@ -44,7 +44,7 @@
                home_key {
                        interrupt-parent = <&gpx2>;
                        interrupts = <2 0>;
-                       gpios = <&gpx2 2 0>;
+                       gpios = <&gpx2 2 GPIO_ACTIVE_HIGH>;
                        linux,code = <KEY_HOME>;
                        label = "home key";
                        debounce-interval = <10>;
@@ -57,7 +57,7 @@
                regulator-name = "p3v3_en";
                regulator-min-microvolt = <3300000>;
                regulator-max-microvolt = <3300000>;
-               gpio = <&gpa1 1 1>;
+               gpio = <&gpa1 1 GPIO_ACTIVE_LOW>;
                enable-active-high;
                regulator-always-on;
        };
index 9d528af68c1a45ba8b35b4d8c8100abb27afecae..c8d86af2fb98d73419bae28ee021c36b97065869 100644 (file)
@@ -14,6 +14,7 @@
 
 /dts-v1/;
 #include "exynos4412.dtsi"
+#include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
 
 / {
@@ -45,7 +46,7 @@
                        regulator-name = "VMEM_VDD_2.8V";
                        regulator-min-microvolt = <2800000>;
                        regulator-max-microvolt = <2800000>;
-                       gpio = <&gpx1 1 0>;
+                       gpio = <&gpx1 1 GPIO_ACTIVE_HIGH>;
                        enable-active-high;
                };
        };
 
                s5m8767,pmic-buck-default-dvs-idx = <3>;
 
-               s5m8767,pmic-buck-dvs-gpios = <&gpx2 3 0>,
-                                                <&gpx2 4 0>,
-                                                <&gpx2 5 0>;
+               s5m8767,pmic-buck-dvs-gpios = <&gpx2 3 GPIO_ACTIVE_HIGH>,
+                                                <&gpx2 4 GPIO_ACTIVE_HIGH>,
+                                                <&gpx2 5 GPIO_ACTIVE_HIGH>;
 
-               s5m8767,pmic-buck-ds-gpios = <&gpm3 5 0>,
-                                               <&gpm3 6 0>,
-                                               <&gpm3 7 0>;
+               s5m8767,pmic-buck-ds-gpios = <&gpm3 5 GPIO_ACTIVE_HIGH>,
+                                               <&gpm3 6 GPIO_ACTIVE_HIGH>,
+                                               <&gpm3 7 GPIO_ACTIVE_HIGH>;
 
                s5m8767,pmic-buck2-dvs-voltage = <1250000>, <1200000>,
                                                 <1200000>, <1200000>,
index 525684ca8dc0ddfab9063c7bb5f69bb4b1c95ebc..4840bbdaa9ec053a99a95e21d3e75ba6e28fafb1 100644 (file)
@@ -13,6 +13,7 @@
 
 /dts-v1/;
 #include "exynos4412.dtsi"
+#include <dt-bindings/gpio/gpio.h>
 
 / {
        model = "FriendlyARM TINY4412 board based on Exynos4412";
 
                led1 {
                        label = "led1";
-                       gpios = <&gpm4 0 1>;
+                       gpios = <&gpm4 0 GPIO_ACTIVE_LOW>;
                        default-state = "off";
                        linux,default-trigger = "heartbeat";
                };
 
                led2 {
                        label = "led2";
-                       gpios = <&gpm4 1 1>;
+                       gpios = <&gpm4 1 GPIO_ACTIVE_LOW>;
                        default-state = "off";
                };
 
                led3 {
                        label = "led3";
-                       gpios = <&gpm4 2 1>;
+                       gpios = <&gpm4 2 GPIO_ACTIVE_LOW>;
                        default-state = "off";
                };
 
                led4 {
                        label = "led4";
-                       gpios = <&gpm4 3 1>;
+                       gpios = <&gpm4 3 GPIO_ACTIVE_LOW>;
                        default-state = "off";
                        linux,default-trigger = "mmc0";
                };
index 2a1ebb76ebe0084af6ff07a8617df2050675af0c..40a474c4374b6829e5737ec38e45a6e9bbb7cfca 100644 (file)
@@ -65,7 +65,7 @@
                        regulator-name = "CAM_SENSOR_A";
                        regulator-min-microvolt = <2800000>;
                        regulator-max-microvolt = <2800000>;
-                       gpio = <&gpm0 2 0>;
+                       gpio = <&gpm0 2 GPIO_ACTIVE_HIGH>;
                        enable-active-high;
                };
 
@@ -74,7 +74,7 @@
                        regulator-name = "LCD_VDD_2.2V";
                        regulator-min-microvolt = <2200000>;
                        regulator-max-microvolt = <2200000>;
-                       gpio = <&gpc0 1 0>;
+                       gpio = <&gpc0 1 GPIO_ACTIVE_HIGH>;
                        enable-active-high;
                };
 
@@ -83,7 +83,7 @@
                        regulator-name = "CAM_AF";
                        regulator-min-microvolt = <2800000>;
                        regulator-max-microvolt = <2800000>;
-                       gpio = <&gpm0 4 0>;
+                       gpio = <&gpm0 4 GPIO_ACTIVE_HIGH>;
                        enable-active-high;
                };
 
@@ -92,7 +92,7 @@
                        regulator-name = "LED_A_3.0V";
                        regulator-min-microvolt = <3000000>;
                        regulator-max-microvolt = <3000000>;
-                       gpio = <&gpj0 5 0>;
+                       gpio = <&gpj0 5 GPIO_ACTIVE_HIGH>;
                        enable-active-high;
                };
        };
                compatible = "gpio-keys";
 
                key-down {
-                       gpios = <&gpx3 3 1>;
+                       gpios = <&gpx3 3 GPIO_ACTIVE_LOW>;
                        linux,code = <114>;
                        label = "volume down";
                        debounce-interval = <10>;
                };
 
                key-up {
-                       gpios = <&gpx2 2 1>;
+                       gpios = <&gpx2 2 GPIO_ACTIVE_LOW>;
                        linux,code = <115>;
                        label = "volume up";
                        debounce-interval = <10>;
                };
 
                key-power {
-                       gpios = <&gpx2 7 1>;
+                       gpios = <&gpx2 7 GPIO_ACTIVE_LOW>;
                        linux,code = <116>;
                        label = "power";
                        debounce-interval = <10>;
                };
 
                key-ok {
-                       gpios = <&gpx0 1 1>;
+                       gpios = <&gpx0 1 GPIO_ACTIVE_LOW>;
                        linux,code = <139>;
                        label = "ok";
                        debounce-inteval = <10>;
 
        i2c_ak8975: i2c-gpio-0 {
                compatible = "i2c-gpio";
-               gpios = <&gpy2 4 0>, <&gpy2 5 0>;
+               gpios = <&gpy2 4 GPIO_ACTIVE_HIGH>, <&gpy2 5 GPIO_ACTIVE_HIGH>;
                i2c-gpio,delay-us = <2>;
                #address-cells = <1>;
                #size-cells = <0>;
                ak8975@0c {
                        compatible = "asahi-kasei,ak8975";
                        reg = <0x0c>;
-                       gpios = <&gpj0 7 0>;
+                       gpios = <&gpj0 7 GPIO_ACTIVE_HIGH>;
                };
        };
 
        i2c_cm36651: i2c-gpio-2 {
                compatible = "i2c-gpio";
-               gpios = <&gpf0 0 1>, <&gpf0 1 1>;
+               gpios = <&gpf0 0 GPIO_ACTIVE_LOW>, <&gpf0 1 GPIO_ACTIVE_LOW>;
                i2c-gpio,delay-us = <2>;
                #address-cells = <1>;
                #size-cells = <0>;
                reg = <0>;
                vdd3-supply = <&lcd_vdd3_reg>;
                vci-supply = <&ldo25_reg>;
-               reset-gpios = <&gpy4 5 0>;
+               reset-gpios = <&gpy4 5 GPIO_ACTIVE_HIGH>;
                power-on-delay= <50>;
                reset-delay = <100>;
                init-delay = <100>;
 };
 
 &exynos_usbphy {
+       vbus-supply = <&esafeout1_reg>;
        status = "okay";
 };
 
                        clocks = <&camera 1>;
                        clock-names = "extclk";
                        samsung,camclk-out = <1>;
-                       gpios = <&gpm1 6 0>;
+                       gpios = <&gpm1 6 GPIO_ACTIVE_HIGH>;
 
                        port {
                                is_s5k6a3_ep: endpoint {
        s5c73m3@3c {
                compatible = "samsung,s5c73m3";
                reg = <0x3c>;
-               standby-gpios = <&gpm0 1 1>;   /* ISP_STANDBY */
-               xshutdown-gpios = <&gpf1 3 1>; /* ISP_RESET */
+               standby-gpios = <&gpm0 1 GPIO_ACTIVE_LOW>;   /* ISP_STANDBY */
+               xshutdown-gpios = <&gpf1 3 GPIO_ACTIVE_LOW>; /* ISP_RESET */
                vdd-int-supply = <&buck9_reg>;
                vddio-cis-supply = <&ldo9_reg>;
                vdda-supply = <&ldo17_reg>;
                #clock-cells = <1>;
 
                voltage-regulators {
-                       ldo1_reg: ldo1 {
-                               regulator-compatible = "LDO1";
+                       ldo1_reg: LDO1 {
                                regulator-name = "VALIVE_1.0V_AP";
                                regulator-min-microvolt = <1000000>;
                                regulator-max-microvolt = <1000000>;
                                regulator-always-on;
                        };
 
-                       ldo2_reg: ldo2 {
-                               regulator-compatible = "LDO2";
+                       ldo2_reg: LDO2 {
                                regulator-name = "VM1M2_1.2V_AP";
                                regulator-min-microvolt = <1200000>;
                                regulator-max-microvolt = <1200000>;
                                };
                        };
 
-                       ldo3_reg: ldo3 {
-                               regulator-compatible = "LDO3";
+                       ldo3_reg: LDO3 {
                                regulator-name = "VCC_1.8V_AP";
                                regulator-min-microvolt = <1800000>;
                                regulator-max-microvolt = <1800000>;
                                regulator-always-on;
                        };
 
-                       ldo4_reg: ldo4 {
-                               regulator-compatible = "LDO4";
+                       ldo4_reg: LDO4 {
                                regulator-name = "VCC_2.8V_AP";
                                regulator-min-microvolt = <2800000>;
                                regulator-max-microvolt = <2800000>;
                                regulator-always-on;
                        };
 
-                       ldo5_reg: ldo5 {
-                               regulator-compatible = "LDO5";
+                       ldo5_reg: LDO5 {
                                regulator-name = "VCC_1.8V_IO";
                                regulator-min-microvolt = <1800000>;
                                regulator-max-microvolt = <1800000>;
                                regulator-always-on;
                        };
 
-                       ldo6_reg: ldo6 {
-                               regulator-compatible = "LDO6";
+                       ldo6_reg: LDO6 {
                                regulator-name = "VMPLL_1.0V_AP";
                                regulator-min-microvolt = <1000000>;
                                regulator-max-microvolt = <1000000>;
                                };
                        };
 
-                       ldo7_reg: ldo7 {
-                               regulator-compatible = "LDO7";
+                       ldo7_reg: LDO7 {
                                regulator-name = "VPLL_1.0V_AP";
                                regulator-min-microvolt = <1000000>;
                                regulator-max-microvolt = <1000000>;
                                };
                        };
 
-                       ldo8_reg: ldo8 {
-                               regulator-compatible = "LDO8";
+                       ldo8_reg: LDO8 {
                                regulator-name = "VMIPI_1.0V";
                                regulator-min-microvolt = <1000000>;
                                regulator-max-microvolt = <1000000>;
                                };
                        };
 
-                       ldo9_reg: ldo9 {
-                               regulator-compatible = "LDO9";
+                       ldo9_reg: LDO9 {
                                regulator-name = "CAM_ISP_MIPI_1.2V";
                                regulator-min-microvolt = <1200000>;
                                regulator-max-microvolt = <1200000>;
                        };
 
-                       ldo10_reg: ldo10 {
-                               regulator-compatible = "LDO10";
+                       ldo10_reg: LDO10 {
                                regulator-name = "VMIPI_1.8V";
                                regulator-min-microvolt = <1800000>;
                                regulator-max-microvolt = <1800000>;
                                };
                        };
 
-                       ldo11_reg: ldo11 {
-                               regulator-compatible = "LDO11";
+                       ldo11_reg: LDO11 {
                                regulator-name = "VABB1_1.95V";
                                regulator-min-microvolt = <1950000>;
                                regulator-max-microvolt = <1950000>;
                                };
                        };
 
-                       ldo12_reg: ldo12 {
-                               regulator-compatible = "LDO12";
+                       ldo12_reg: LDO12 {
                                regulator-name = "VUOTG_3.0V";
                                regulator-min-microvolt = <3000000>;
                                regulator-max-microvolt = <3000000>;
                                };
                        };
 
-                       ldo13_reg: ldo13 {
-                               regulator-compatible = "LDO13";
+                       ldo13_reg: LDO13 {
                                regulator-name = "NFC_AVDD_1.8V";
                                regulator-min-microvolt = <1800000>;
                                regulator-max-microvolt = <1800000>;
                        };
 
-                       ldo14_reg: ldo14 {
-                               regulator-compatible = "LDO14";
+                       ldo14_reg: LDO14 {
                                regulator-name = "VABB2_1.95V";
                                regulator-min-microvolt = <1950000>;
                                regulator-max-microvolt = <1950000>;
                                };
                        };
 
-                       ldo15_reg: ldo15 {
-                               regulator-compatible = "LDO15";
+                       ldo15_reg: LDO15 {
                                regulator-name = "VHSIC_1.0V";
                                regulator-min-microvolt = <1000000>;
                                regulator-max-microvolt = <1000000>;
                                };
                        };
 
-                       ldo16_reg: ldo16 {
-                               regulator-compatible = "LDO16";
+                       ldo16_reg: LDO16 {
                                regulator-name = "VHSIC_1.8V";
                                regulator-min-microvolt = <1800000>;
                                regulator-max-microvolt = <1800000>;
                                };
                        };
 
-                       ldo17_reg: ldo17 {
-                               regulator-compatible = "LDO17";
+                       ldo17_reg: LDO17 {
                                regulator-name = "CAM_SENSOR_CORE_1.2V";
                                regulator-min-microvolt = <1200000>;
                                regulator-max-microvolt = <1200000>;
                        };
 
-                       ldo18_reg: ldo18 {
-                               regulator-compatible = "LDO18";
+                       ldo18_reg: LDO18 {
                                regulator-name = "CAM_ISP_SEN_IO_1.8V";
                                regulator-min-microvolt = <1800000>;
                                regulator-max-microvolt = <1800000>;
                        };
 
-                       ldo19_reg: ldo19 {
-                               regulator-compatible = "LDO19";
+                       ldo19_reg: LDO19 {
                                regulator-name = "VT_CAM_1.8V";
                                regulator-min-microvolt = <1800000>;
                                regulator-max-microvolt = <1800000>;
                        };
 
-                       ldo20_reg: ldo20 {
-                               regulator-compatible = "LDO20";
+                       ldo20_reg: LDO20 {
                                regulator-name = "VDDQ_PRE_1.8V";
                                regulator-min-microvolt = <1800000>;
                                regulator-max-microvolt = <1800000>;
                        };
 
-                       ldo21_reg: ldo21 {
-                               regulator-compatible = "LDO21";
+                       ldo21_reg: LDO21 {
                                regulator-name = "VTF_2.8V";
                                regulator-min-microvolt = <2800000>;
                                regulator-max-microvolt = <2800000>;
                                maxim,ena-gpios = <&gpy2 0 GPIO_ACTIVE_HIGH>;
                        };
 
-                       ldo22_reg: ldo22 {
-                               regulator-compatible = "LDO22";
+                       ldo22_reg: LDO22 {
                                regulator-name = "VMEM_VDD_2.8V";
                                regulator-min-microvolt = <2800000>;
                                regulator-max-microvolt = <2800000>;
                                maxim,ena-gpios = <&gpk0 2 GPIO_ACTIVE_HIGH>;
                        };
 
-                       ldo23_reg: ldo23 {
-                               regulator-compatible = "LDO23";
+                       ldo23_reg: LDO23 {
                                regulator-name = "TSP_AVDD_3.3V";
                                regulator-min-microvolt = <3300000>;
                                regulator-max-microvolt = <3300000>;
                        };
 
-                       ldo24_reg: ldo24 {
-                               regulator-compatible = "LDO24";
+                       ldo24_reg: LDO24 {
                                regulator-name = "TSP_VDD_1.8V";
                                regulator-min-microvolt = <1800000>;
                                regulator-max-microvolt = <1800000>;
                        };
 
-                       ldo25_reg: ldo25 {
-                               regulator-compatible = "LDO25";
+                       ldo25_reg: LDO25 {
                                regulator-name = "LCD_VCC_3.3V";
                                regulator-min-microvolt = <2800000>;
                                regulator-max-microvolt = <2800000>;
                        };
 
-                       ldo26_reg: ldo26 {
-                               regulator-compatible = "LDO26";
+                       ldo26_reg: LDO26 {
                                regulator-name = "MOTOR_VCC_3.0V";
                                regulator-min-microvolt = <3000000>;
                                regulator-max-microvolt = <3000000>;
                        };
 
-                       buck1_reg: buck1 {
-                               regulator-compatible = "BUCK1";
+                       buck1_reg: BUCK1 {
                                regulator-name = "vdd_mif";
                                regulator-min-microvolt = <850000>;
                                regulator-max-microvolt = <1100000>;
                                };
                        };
 
-                       buck2_reg: buck2 {
-                               regulator-compatible = "BUCK2";
+                       buck2_reg: BUCK2 {
                                regulator-name = "vdd_arm";
                                regulator-min-microvolt = <850000>;
                                regulator-max-microvolt = <1500000>;
                                };
                        };
 
-                       buck3_reg: buck3 {
-                               regulator-compatible = "BUCK3";
+                       buck3_reg: BUCK3 {
                                regulator-name = "vdd_int";
                                regulator-min-microvolt = <850000>;
                                regulator-max-microvolt = <1150000>;
                                };
                        };
 
-                       buck4_reg: buck4 {
-                               regulator-compatible = "BUCK4";
+                       buck4_reg: BUCK4 {
                                regulator-name = "vdd_g3d";
                                regulator-min-microvolt = <850000>;
                                regulator-max-microvolt = <1150000>;
                                };
                        };
 
-                       buck5_reg: buck5 {
-                               regulator-compatible = "BUCK5";
+                       buck5_reg: BUCK5 {
                                regulator-name = "VMEM_1.2V_AP";
                                regulator-min-microvolt = <1200000>;
                                regulator-max-microvolt = <1200000>;
                                regulator-always-on;
                        };
 
-                       buck6_reg: buck6 {
-                               regulator-compatible = "BUCK6";
+                       buck6_reg: BUCK6 {
                                regulator-name = "VCC_SUB_1.35V";
                                regulator-min-microvolt = <1350000>;
                                regulator-max-microvolt = <1350000>;
                                regulator-always-on;
                        };
 
-                       buck7_reg: buck7 {
-                               regulator-compatible = "BUCK7";
+                       buck7_reg: BUCK7 {
                                regulator-name = "VCC_SUB_2.0V";
                                regulator-min-microvolt = <2000000>;
                                regulator-max-microvolt = <2000000>;
                                regulator-always-on;
                        };
 
-                       buck8_reg: buck8 {
-                               regulator-compatible = "BUCK8";
+                       buck8_reg: BUCK8 {
                                regulator-name = "VMEM_VDDF_3.0V";
                                regulator-min-microvolt = <2850000>;
                                regulator-max-microvolt = <2850000>;
                                maxim,ena-gpios = <&gpk0 2 GPIO_ACTIVE_HIGH>;
                        };
 
-                       buck9_reg: buck9 {
-                               regulator-compatible = "BUCK9";
+                       buck9_reg: BUCK9 {
                                regulator-name = "CAM_ISP_CORE_1.2V";
                                regulator-min-microvolt = <1000000>;
                                regulator-max-microvolt = <1200000>;
 
 &sdhci_2 {
        bus-width = <4>;
-       cd-gpios = <&gpx3 4 0>;
+       cd-gpios = <&gpx3 4 GPIO_ACTIVE_HIGH>;
        cd-inverted;
        pinctrl-0 = <&sd2_clk &sd2_cmd &sd2_bus4>;
        pinctrl-names = "default";
 &spi_1 {
        pinctrl-names = "default";
        pinctrl-0 = <&spi1_bus>;
-       cs-gpios = <&gpb 5 0>;
+       cs-gpios = <&gpb 5 GPIO_ACTIVE_HIGH>;
        status = "okay";
 
        s5c73m3_spi: s5c73m3 {
index db3f65f3eb45995d840a7ddc60284b0ff6e85457..c000532c14446db9cbcb6a942cd7c117a9d5e0aa 100644 (file)
        samsung,color-depth = <1>;
        samsung,link-rate = <0x0a>;
        samsung,lane-count = <4>;
-};
-
-&fimd {
-       status = "okay";
 
        display-timings {
                native-mode = <&timing0>;
        };
 };
 
+&fimd {
+       status = "okay";
+};
+
 &hdmi {
        hpd-gpio = <&gpx3 7 GPIO_ACTIVE_LOW>;
        vdd_osc-supply = <&ldo10_reg>;
index c625e71217aa94d74c640c113286a5292179b62a..0f5dcd418af8f5b3c31286518facdd34a6515bdd 100644 (file)
        pinctrl-names = "default";
        pinctrl-0 = <&dp_hpd>;
        status = "okay";
-};
-
-&ehci {
-       samsung,vbus-gpio = <&gpx2 6 GPIO_ACTIVE_HIGH>;
-};
-
-&fimd {
-       status = "okay";
 
        display-timings {
                native-mode = <&timing0>;
        };
 };
 
+&ehci {
+       samsung,vbus-gpio = <&gpx2 6 GPIO_ACTIVE_HIGH>;
+};
+
+&fimd {
+       status = "okay";
+};
+
 &hdmi {
        hpd-gpio = <&gpx3 7 GPIO_ACTIVE_HIGH>;
 };
diff --git a/arch/arm/boot/dts/exynos5250-snow-common.dtsi b/arch/arm/boot/dts/exynos5250-snow-common.dtsi
new file mode 100644 (file)
index 0000000..0a7f408
--- /dev/null
@@ -0,0 +1,684 @@
+/*
+ * Google Snow board device tree source
+ *
+ * Copyright (c) 2012 Google, Inc
+ *
+ * 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.
+ */
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/clock/maxim,max77686.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+#include <dt-bindings/input/input.h>
+#include "exynos5250.dtsi"
+
+/ {
+       aliases {
+               i2c104 = &i2c_104;
+       };
+
+       memory {
+               reg = <0x40000000 0x80000000>;
+       };
+
+       chosen {
+               bootargs = "console=tty1";
+               stdout-path = "serial3:115200n8";
+       };
+
+       gpio-keys {
+               compatible = "gpio-keys";
+               pinctrl-names = "default";
+               pinctrl-0 = <&power_key_irq &lid_irq>;
+
+               power {
+                       label = "Power";
+                       gpios = <&gpx1 3 GPIO_ACTIVE_LOW>;
+                       linux,code = <KEY_POWER>;
+                       gpio-key,wakeup;
+               };
+
+               lid-switch {
+                       label = "Lid";
+                       gpios = <&gpx3 5 GPIO_ACTIVE_LOW>;
+                       linux,input-type = <5>; /* EV_SW */
+                       linux,code = <0>; /* SW_LID */
+                       debounce-interval = <1>;
+                       gpio-key,wakeup;
+               };
+       };
+
+       vbat: vbat-fixed-regulator {
+               compatible = "regulator-fixed";
+               regulator-name = "vbat-supply";
+               regulator-boot-on;
+       };
+
+       i2c-arbitrator {
+               compatible = "i2c-arb-gpio-challenge";
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               i2c-parent = <&{/i2c@12CA0000}>;
+
+               our-claim-gpio = <&gpf0 3 GPIO_ACTIVE_LOW>;
+               their-claim-gpios = <&gpe0 4 GPIO_ACTIVE_LOW>;
+               slew-delay-us = <10>;
+               wait-retry-us = <3000>;
+               wait-free-us = <50000>;
+
+               pinctrl-names = "default";
+               pinctrl-0 = <&arb_our_claim &arb_their_claim>;
+
+               /* Use ID 104 as a hint that we're on physical bus 4 */
+               i2c_104: i2c@0 {
+                       reg = <0>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       battery: sbs-battery@b {
+                               compatible = "sbs,sbs-battery";
+                               reg = <0xb>;
+                               sbs,poll-retry-count = <1>;
+                       };
+
+                       cros_ec: embedded-controller {
+                               compatible = "google,cros-ec-i2c";
+                               reg = <0x1e>;
+                               interrupts = <6 IRQ_TYPE_NONE>;
+                               interrupt-parent = <&gpx1>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&ec_irq>;
+                               wakeup-source;
+                       };
+
+                       power-regulator {
+                               compatible = "ti,tps65090";
+                               reg = <0x48>;
+
+                               /*
+                                * Config irq to disable internal pulls
+                                * even though we run in polling mode.
+                                */
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&tps65090_irq>;
+
+                               vsys1-supply = <&vbat>;
+                               vsys2-supply = <&vbat>;
+                               vsys3-supply = <&vbat>;
+                               infet1-supply = <&vbat>;
+                               infet2-supply = <&vbat>;
+                               infet3-supply = <&vbat>;
+                               infet4-supply = <&vbat>;
+                               infet5-supply = <&vbat>;
+                               infet6-supply = <&vbat>;
+                               infet7-supply = <&vbat>;
+                               vsys-l1-supply = <&vbat>;
+                               vsys-l2-supply = <&vbat>;
+
+                               regulators {
+                                       dcdc1 {
+                                               ti,enable-ext-control;
+                                       };
+                                       dcdc2 {
+                                               ti,enable-ext-control;
+                                       };
+                                       dcdc3 {
+                                               ti,enable-ext-control;
+                                       };
+                                       fet1: fet1 {
+                                               regulator-name = "vcd_led";
+                                               ti,overcurrent-wait = <3>;
+                                       };
+                                       tps65090_fet2: fet2 {
+                                               regulator-name = "video_mid";
+                                               regulator-always-on;
+                                               ti,overcurrent-wait = <3>;
+                                       };
+                                       fet3 {
+                                               regulator-name = "wwan_r";
+                                               regulator-always-on;
+                                               ti,overcurrent-wait = <3>;
+                                       };
+                                       fet4 {
+                                               regulator-name = "sdcard";
+                                               ti,overcurrent-wait = <3>;
+                                       };
+                                       fet5 {
+                                               regulator-name = "camout";
+                                               regulator-always-on;
+                                               ti,overcurrent-wait = <3>;
+                                       };
+                                       fet6: fet6 {
+                                               regulator-name = "lcd_vdd";
+                                               ti,overcurrent-wait = <3>;
+                                       };
+                                       tps65090_fet7: fet7 {
+                                               regulator-name = "video_mid_1a";
+                                               regulator-always-on;
+                                               ti,overcurrent-wait = <3>;
+                                       };
+                                       ldo1 {
+                                       };
+                                       ldo2 {
+                                       };
+                               };
+
+                               charger {
+                                       compatible = "ti,tps65090-charger";
+                               };
+                       };
+               };
+       };
+
+       sound {
+               samsung,i2s-controller = <&i2s0>;
+       };
+
+       usb3_vbus_reg: regulator-usb3 {
+               compatible = "regulator-fixed";
+               regulator-name = "P5.0V_USB3CON";
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;
+               gpio = <&gpx2 7 GPIO_ACTIVE_HIGH>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&usb3_vbus_en>;
+               enable-active-high;
+       };
+
+       fixed-rate-clocks {
+               xxti {
+                       compatible = "samsung,clock-xxti";
+                       clock-frequency = <24000000>;
+               };
+       };
+
+       backlight: backlight {
+               compatible = "pwm-backlight";
+               pwms = <&pwm 0 1000000 0>;
+               brightness-levels = <0 100 500 1000 1500 2000 2500 2800>;
+               default-brightness-level = <7>;
+               enable-gpios = <&gpx3 0 GPIO_ACTIVE_HIGH>;
+               power-supply = <&fet1>;
+               pinctrl-0 = <&pwm0_out>;
+               pinctrl-names = "default";
+       };
+
+       panel: panel {
+               compatible = "auo,b116xw03";
+               power-supply = <&fet6>;
+               backlight = <&backlight>;
+
+               port {
+                       panel_in: endpoint {
+                               remote-endpoint = <&bridge_out>;
+                       };
+               };
+       };
+
+       mmc3_pwrseq: mmc3_pwrseq {
+               compatible = "mmc-pwrseq-simple";
+               reset-gpios = <&gpx0 2 GPIO_ACTIVE_LOW>, /* WIFI_RSTn */
+                             <&gpx0 1 GPIO_ACTIVE_LOW>; /* WIFI_EN */
+               clocks = <&max77686 MAX77686_CLK_PMIC>;
+               clock-names = "ext_clock";
+       };
+};
+
+&cpu0 {
+       cpu0-supply = <&buck2_reg>;
+};
+
+&dp {
+       status = "okay";
+       pinctrl-names = "default";
+       pinctrl-0 = <&dp_hpd>;
+       samsung,color-space = <0>;
+       samsung,dynamic-range = <0>;
+       samsung,ycbcr-coeff = <0>;
+       samsung,color-depth = <1>;
+       samsung,link-rate = <0x0a>;
+       samsung,lane-count = <2>;
+       samsung,hpd-gpio = <&gpx0 7 GPIO_ACTIVE_HIGH>;
+
+       ports {
+               port@0 {
+                       dp_out: endpoint {
+                               remote-endpoint = <&bridge_in>;
+                       };
+               };
+       };
+};
+
+&ehci {
+       samsung,vbus-gpio = <&gpx1 1 GPIO_ACTIVE_HIGH>;
+};
+
+&fimd {
+       status = "okay";
+       samsung,invert-vclk;
+};
+
+&hdmi {
+       hpd-gpio = <&gpx3 7 GPIO_ACTIVE_HIGH>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&hdmi_hpd_irq>;
+       phy = <&hdmiphy>;
+       ddc = <&i2c_2>;
+       hdmi-en-supply = <&tps65090_fet7>;
+       vdd-supply = <&ldo8_reg>;
+       vdd_osc-supply = <&ldo10_reg>;
+       vdd_pll-supply = <&ldo8_reg>;
+};
+
+&i2c_0 {
+       status = "okay";
+       samsung,i2c-sda-delay = <100>;
+       samsung,i2c-max-bus-freq = <378000>;
+
+       max77686: max77686@09 {
+               compatible = "maxim,max77686";
+               interrupt-parent = <&gpx3>;
+               interrupts = <2 IRQ_TYPE_NONE>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&max77686_irq>;
+               wakeup-source;
+               reg = <0x09>;
+               #clock-cells = <1>;
+
+               voltage-regulators {
+                       ldo1_reg: LDO1 {
+                               regulator-name = "P1.0V_LDO_OUT1";
+                               regulator-min-microvolt = <1000000>;
+                               regulator-max-microvolt = <1000000>;
+                               regulator-always-on;
+                       };
+
+                       ldo2_reg: LDO2 {
+                               regulator-name = "P1.8V_LDO_OUT2";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-always-on;
+                       };
+
+                       ldo3_reg: LDO3 {
+                               regulator-name = "P1.8V_LDO_OUT3";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-always-on;
+                       };
+
+                       ldo7_reg: LDO7 {
+                               regulator-name = "P1.1V_LDO_OUT7";
+                               regulator-min-microvolt = <1100000>;
+                               regulator-max-microvolt = <1100000>;
+                               regulator-always-on;
+                       };
+
+                       ldo8_reg: LDO8 {
+                               regulator-name = "P1.0V_LDO_OUT8";
+                               regulator-min-microvolt = <1000000>;
+                               regulator-max-microvolt = <1000000>;
+                               regulator-always-on;
+                       };
+
+                       ldo10_reg: LDO10 {
+                               regulator-name = "P1.8V_LDO_OUT10";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-always-on;
+                       };
+
+                       ldo12_reg: LDO12 {
+                               regulator-name = "P3.0V_LDO_OUT12";
+                               regulator-min-microvolt = <3000000>;
+                               regulator-max-microvolt = <3000000>;
+                               regulator-always-on;
+                       };
+
+                       ldo14_reg: LDO14 {
+                               regulator-name = "P1.8V_LDO_OUT14";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-always-on;
+                       };
+
+                       ldo15_reg: LDO15 {
+                               regulator-name = "P1.0V_LDO_OUT15";
+                               regulator-min-microvolt = <1000000>;
+                               regulator-max-microvolt = <1000000>;
+                               regulator-always-on;
+                       };
+
+                       ldo16_reg: LDO16 {
+                               regulator-name = "P1.8V_LDO_OUT16";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-always-on;
+                       };
+
+                       buck1_reg: BUCK1 {
+                               regulator-name = "vdd_mif";
+                               regulator-min-microvolt = <950000>;
+                               regulator-max-microvolt = <1300000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                       };
+
+                       buck2_reg: BUCK2 {
+                               regulator-name = "vdd_arm";
+                               regulator-min-microvolt = <850000>;
+                               regulator-max-microvolt = <1350000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                       };
+
+                       buck3_reg: BUCK3 {
+                               regulator-name = "vdd_int";
+                               regulator-min-microvolt = <900000>;
+                               regulator-max-microvolt = <1200000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                       };
+
+                       buck4_reg: BUCK4 {
+                               regulator-name = "vdd_g3d";
+                               regulator-min-microvolt = <850000>;
+                               regulator-max-microvolt = <1300000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                       };
+
+                       buck5_reg: BUCK5 {
+                               regulator-name = "P1.8V_BUCK_OUT5";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                       };
+
+                       buck6_reg: BUCK6 {
+                               regulator-name = "P1.35V_BUCK_OUT6";
+                               regulator-min-microvolt = <1350000>;
+                               regulator-max-microvolt = <1350000>;
+                               regulator-always-on;
+                       };
+
+                       buck7_reg: BUCK7 {
+                               regulator-name = "P2.0V_BUCK_OUT7";
+                               regulator-min-microvolt = <2000000>;
+                               regulator-max-microvolt = <2000000>;
+                               regulator-always-on;
+                       };
+
+                       buck8_reg: BUCK8 {
+                               regulator-name = "P2.85V_BUCK_OUT8";
+                               regulator-min-microvolt = <2850000>;
+                               regulator-max-microvolt = <2850000>;
+                               regulator-always-on;
+                       };
+               };
+       };
+};
+
+&i2c_1 {
+       status = "okay";
+       samsung,i2c-sda-delay = <100>;
+       samsung,i2c-max-bus-freq = <378000>;
+
+       trackpad {
+               reg = <0x67>;
+               compatible = "cypress,cyapa";
+               interrupts = <2 IRQ_TYPE_NONE>;
+               interrupt-parent = <&gpx1>;
+               wakeup-source;
+       };
+};
+
+/*
+ * Disabled pullups since external part has its own pullups and
+ * double-pulling gets us out of spec in some cases.
+ */
+&i2c2_bus {
+       samsung,pin-pud = <0>;
+};
+
+&i2c_2 {
+       status = "okay";
+       samsung,i2c-sda-delay = <100>;
+       samsung,i2c-max-bus-freq = <66000>;
+
+       hdmiddc@50 {
+               compatible = "samsung,exynos4210-hdmiddc";
+               reg = <0x50>;
+       };
+};
+
+&i2c_3 {
+       status = "okay";
+       samsung,i2c-sda-delay = <100>;
+       samsung,i2c-max-bus-freq = <66000>;
+};
+
+&i2c_4 {
+       status = "okay";
+       samsung,i2c-sda-delay = <100>;
+       samsung,i2c-max-bus-freq = <66000>;
+};
+
+&i2c_5 {
+       status = "okay";
+       samsung,i2c-sda-delay = <100>;
+       samsung,i2c-max-bus-freq = <66000>;
+};
+
+&i2c_7 {
+       status = "okay";
+       samsung,i2c-sda-delay = <100>;
+       samsung,i2c-max-bus-freq = <66000>;
+
+       ptn3460: lvds-bridge@20 {
+               compatible = "nxp,ptn3460";
+               reg = <0x20>;
+               powerdown-gpios = <&gpy2 5 GPIO_ACTIVE_HIGH>;
+               reset-gpios = <&gpx1 5 GPIO_ACTIVE_HIGH>;
+               edid-emulation = <5>;
+
+               ports {
+                       port@0 {
+                               bridge_out: endpoint {
+                                       remote-endpoint = <&panel_in>;
+                               };
+                       };
+
+                       port@1 {
+                               bridge_in: endpoint {
+                                       remote-endpoint = <&dp_out>;
+                               };
+                       };
+               };
+       };
+};
+
+&i2c_8 {
+       status = "okay";
+       samsung,i2c-sda-delay = <100>;
+       samsung,i2c-max-bus-freq = <378000>;
+
+       hdmiphy: hdmiphy@38 {
+               compatible = "samsung,exynos4212-hdmiphy";
+               reg = <0x38>;
+       };
+};
+
+&i2s0 {
+       status = "okay";
+};
+
+&mmc_0 {
+       status = "okay";
+       num-slots = <1>;
+       broken-cd;
+       card-detect-delay = <200>;
+       samsung,dw-mshc-ciu-div = <3>;
+       samsung,dw-mshc-sdr-timing = <2 3>;
+       samsung,dw-mshc-ddr-timing = <1 2>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&sd0_clk &sd0_cmd &sd0_cd &sd0_bus4 &sd0_bus8>;
+       bus-width = <8>;
+       cap-mmc-highspeed;
+};
+
+&mmc_2 {
+       status = "okay";
+       num-slots = <1>;
+       card-detect-delay = <200>;
+       samsung,dw-mshc-ciu-div = <3>;
+       samsung,dw-mshc-sdr-timing = <2 3>;
+       samsung,dw-mshc-ddr-timing = <1 2>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&sd2_clk &sd2_cmd &sd2_cd &sd2_bus4>;
+       bus-width = <4>;
+       wp-gpios = <&gpc2 1 GPIO_ACTIVE_HIGH>;
+       cap-sd-highspeed;
+};
+
+/*
+ * On Snow we've got SIP WiFi and so can keep drive strengths low to
+ * reduce EMI.
+ */
+&mmc_3 {
+       status = "okay";
+       num-slots = <1>;
+       broken-cd;
+       cap-sdio-irq;
+       keep-power-in-suspend;
+       card-detect-delay = <200>;
+       samsung,dw-mshc-ciu-div = <3>;
+       samsung,dw-mshc-sdr-timing = <2 3>;
+       samsung,dw-mshc-ddr-timing = <1 2>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&sd3_clk &sd3_cmd &sd3_bus4 &wifi_en &wifi_rst>;
+       bus-width = <4>;
+       cap-sd-highspeed;
+       mmc-pwrseq = <&mmc3_pwrseq>;
+};
+
+&pinctrl_0 {
+       wifi_en: wifi-en {
+               samsung,pins = "gpx0-1";
+               samsung,pin-function = <1>;
+               samsung,pin-pud = <0>;
+               samsung,pin-drv = <0>;
+       };
+
+       wifi_rst: wifi-rst {
+               samsung,pins = "gpx0-2";
+               samsung,pin-function = <1>;
+               samsung,pin-pud = <0>;
+               samsung,pin-drv = <0>;
+       };
+
+       power_key_irq: power-key-irq {
+               samsung,pins = "gpx1-3";
+               samsung,pin-function = <0xf>;
+               samsung,pin-pud = <0>;
+               samsung,pin-drv = <0>;
+       };
+
+       ec_irq: ec-irq {
+               samsung,pins = "gpx1-6";
+               samsung,pin-function = <0>;
+               samsung,pin-pud = <0>;
+               samsung,pin-drv = <0>;
+       };
+
+       tps65090_irq: tps65090-irq {
+               samsung,pins = "gpx2-6";
+               samsung,pin-function = <0>;
+               samsung,pin-pud = <0>;
+               samsung,pin-drv = <0>;
+       };
+
+       usb3_vbus_en: usb3-vbus-en {
+               samsung,pins = "gpx2-7";
+               samsung,pin-function = <1>;
+               samsung,pin-pud = <0>;
+               samsung,pin-drv = <0>;
+       };
+
+       max77686_irq: max77686-irq {
+               samsung,pins = "gpx3-2";
+               samsung,pin-function = <0>;
+               samsung,pin-pud = <0>;
+               samsung,pin-drv = <0>;
+       };
+
+       lid_irq: lid-irq {
+               samsung,pins = "gpx3-5";
+               samsung,pin-function = <0xf>;
+               samsung,pin-pud = <0>;
+               samsung,pin-drv = <0>;
+       };
+
+       hdmi_hpd_irq: hdmi-hpd-irq {
+               samsung,pins = "gpx3-7";
+               samsung,pin-function = <0>;
+               samsung,pin-pud = <1>;
+               samsung,pin-drv = <0>;
+       };
+};
+
+&pinctrl_1 {
+       arb_their_claim: arb-their-claim {
+               samsung,pins = "gpe0-4";
+               samsung,pin-function = <0>;
+               samsung,pin-pud = <3>;
+               samsung,pin-drv = <0>;
+       };
+
+       arb_our_claim: arb-our-claim {
+               samsung,pins = "gpf0-3";
+               samsung,pin-function = <1>;
+               samsung,pin-pud = <0>;
+               samsung,pin-drv = <0>;
+       };
+};
+
+&rtc {
+       status = "okay";
+       clocks = <&clock CLK_RTC>, <&max77686 MAX77686_CLK_AP>;
+       clock-names = "rtc", "rtc_src";
+};
+
+&sd3_bus4 {
+       samsung,pin-drv = <0>;
+};
+
+&sd3_clk {
+       samsung,pin-drv = <0>;
+};
+
+&sd3_cmd {
+       samsung,pin-pud = <3>;
+       samsung,pin-drv = <0>;
+};
+
+&spi_1 {
+       status = "okay";
+       samsung,spi-src-clk = <0>;
+       num-cs = <1>;
+       cs-gpios = <&gpa2 5 GPIO_ACTIVE_HIGH>;
+};
+
+&usbdrd_dwc3 {
+       dr_mode = "host";
+};
+
+&usbdrd_phy {
+       vbus-supply = <&usb3_vbus_reg>;
+};
+
+#include "cros-ec-keyboard.dtsi"
diff --git a/arch/arm/boot/dts/exynos5250-snow-rev5.dts b/arch/arm/boot/dts/exynos5250-snow-rev5.dts
new file mode 100644 (file)
index 0000000..f811dc8
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * Google Snow Rev 5+ board device tree source
+ *
+ * Copyright (c) 2012 Google, Inc
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ *             http://www.samsung.com
+ *
+ * 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.
+ */
+
+/dts-v1/;
+#include "exynos5250-snow-common.dtsi"
+
+/ {
+       model = "Google Snow Rev 5+";
+       compatible = "google,snow-rev5", "samsung,exynos5250",
+               "samsung,exynos5";
+
+       sound {
+               compatible = "google,snow-audio-max98090";
+
+               samsung,model = "Snow-I2S-MAX98090";
+               samsung,audio-codec = <&max98090>;
+       };
+};
+
+&i2c_7 {
+       max98090: codec@10 {
+               compatible = "maxim,max98090";
+               reg = <0x10>;
+               interrupts = <4 IRQ_TYPE_NONE>;
+               interrupt-parent = <&gpx0>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&max98090_irq>;
+       };
+};
+
+&pinctrl_0 {
+       max98090_irq: max98090-irq {
+               samsung,pins = "gpx0-4";
+               samsung,pin-function = <0>;
+               samsung,pin-pud = <0>;
+               samsung,pin-drv = <0>;
+       };
+};
index 0720caab5511112026a1d53156deae2cf6338345..995c7ce6c12bdc5c4e9eb5c07da7f0535ff6423b 100644 (file)
  */
 
 /dts-v1/;
-#include <dt-bindings/gpio/gpio.h>
-#include <dt-bindings/clock/maxim,max77686.h>
-#include <dt-bindings/interrupt-controller/irq.h>
-#include <dt-bindings/input/input.h>
-#include "exynos5250.dtsi"
+#include "exynos5250-snow-common.dtsi"
 
 / {
        model = "Google Snow";
-       compatible = "google,snow", "samsung,exynos5250", "samsung,exynos5";
-
-       aliases {
-               i2c104 = &i2c_104;
-       };
-
-       memory {
-               reg = <0x40000000 0x80000000>;
-       };
-
-       chosen {
-               bootargs = "console=tty1";
-               stdout-path = "serial3:115200n8";
-       };
-
-       gpio-keys {
-               compatible = "gpio-keys";
-               pinctrl-names = "default";
-               pinctrl-0 = <&power_key_irq &lid_irq>;
-
-               power {
-                       label = "Power";
-                       gpios = <&gpx1 3 GPIO_ACTIVE_LOW>;
-                       linux,code = <KEY_POWER>;
-                       gpio-key,wakeup;
-               };
-
-               lid-switch {
-                       label = "Lid";
-                       gpios = <&gpx3 5 GPIO_ACTIVE_LOW>;
-                       linux,input-type = <5>; /* EV_SW */
-                       linux,code = <0>; /* SW_LID */
-                       debounce-interval = <1>;
-                       gpio-key,wakeup;
-               };
-       };
-
-       vbat: vbat-fixed-regulator {
-               compatible = "regulator-fixed";
-               regulator-name = "vbat-supply";
-               regulator-boot-on;
-       };
-
-       i2c-arbitrator {
-               compatible = "i2c-arb-gpio-challenge";
-               #address-cells = <1>;
-               #size-cells = <0>;
-
-               i2c-parent = <&{/i2c@12CA0000}>;
-
-               our-claim-gpio = <&gpf0 3 GPIO_ACTIVE_LOW>;
-               their-claim-gpios = <&gpe0 4 GPIO_ACTIVE_LOW>;
-               slew-delay-us = <10>;
-               wait-retry-us = <3000>;
-               wait-free-us = <50000>;
-
-               pinctrl-names = "default";
-               pinctrl-0 = <&arb_our_claim &arb_their_claim>;
-
-               /* Use ID 104 as a hint that we're on physical bus 4 */
-               i2c_104: i2c@0 {
-                       reg = <0>;
-                       #address-cells = <1>;
-                       #size-cells = <0>;
-
-                       battery: sbs-battery@b {
-                               compatible = "sbs,sbs-battery";
-                               reg = <0xb>;
-                               sbs,poll-retry-count = <1>;
-                       };
-
-                       cros_ec: embedded-controller {
-                               compatible = "google,cros-ec-i2c";
-                               reg = <0x1e>;
-                               interrupts = <6 IRQ_TYPE_NONE>;
-                               interrupt-parent = <&gpx1>;
-                               pinctrl-names = "default";
-                               pinctrl-0 = <&ec_irq>;
-                               wakeup-source;
-                       };
-
-                       power-regulator {
-                               compatible = "ti,tps65090";
-                               reg = <0x48>;
-
-                               /*
-                                * Config irq to disable internal pulls
-                                * even though we run in polling mode.
-                                */
-                               pinctrl-names = "default";
-                               pinctrl-0 = <&tps65090_irq>;
-
-                               vsys1-supply = <&vbat>;
-                               vsys2-supply = <&vbat>;
-                               vsys3-supply = <&vbat>;
-                               infet1-supply = <&vbat>;
-                               infet2-supply = <&vbat>;
-                               infet3-supply = <&vbat>;
-                               infet4-supply = <&vbat>;
-                               infet5-supply = <&vbat>;
-                               infet6-supply = <&vbat>;
-                               infet7-supply = <&vbat>;
-                               vsys-l1-supply = <&vbat>;
-                               vsys-l2-supply = <&vbat>;
-
-                               regulators {
-                                       dcdc1 {
-                                               ti,enable-ext-control;
-                                       };
-                                       dcdc2 {
-                                               ti,enable-ext-control;
-                                       };
-                                       dcdc3 {
-                                               ti,enable-ext-control;
-                                       };
-                                       fet1: fet1 {
-                                               regulator-name = "vcd_led";
-                                               ti,overcurrent-wait = <3>;
-                                       };
-                                       tps65090_fet2: fet2 {
-                                               regulator-name = "video_mid";
-                                               regulator-always-on;
-                                               ti,overcurrent-wait = <3>;
-                                       };
-                                       fet3 {
-                                               regulator-name = "wwan_r";
-                                               regulator-always-on;
-                                               ti,overcurrent-wait = <3>;
-                                       };
-                                       fet4 {
-                                               regulator-name = "sdcard";
-                                               ti,overcurrent-wait = <3>;
-                                       };
-                                       fet5 {
-                                               regulator-name = "camout";
-                                               regulator-always-on;
-                                               ti,overcurrent-wait = <3>;
-                                       };
-                                       fet6: fet6 {
-                                               regulator-name = "lcd_vdd";
-                                               ti,overcurrent-wait = <3>;
-                                       };
-                                       tps65090_fet7: fet7 {
-                                               regulator-name = "video_mid_1a";
-                                               regulator-always-on;
-                                               ti,overcurrent-wait = <3>;
-                                       };
-                                       ldo1 {
-                                       };
-                                       ldo2 {
-                                       };
-                               };
-
-                               charger {
-                                       compatible = "ti,tps65090-charger";
-                               };
-                       };
-               };
-       };
+       compatible = "google,snow-rev4", "google,snow", "samsung,exynos5250",
+               "samsung,exynos5";
 
        sound {
                compatible = "google,snow-audio-max98095";
 
                samsung,model = "Snow-I2S-MAX98095";
-               samsung,i2s-controller = <&i2s0>;
                samsung,audio-codec = <&max98095>;
        };
-
-       usb3_vbus_reg: regulator-usb3 {
-               compatible = "regulator-fixed";
-               regulator-name = "P5.0V_USB3CON";
-               regulator-min-microvolt = <5000000>;
-               regulator-max-microvolt = <5000000>;
-               gpio = <&gpx2 7 GPIO_ACTIVE_HIGH>;
-               pinctrl-names = "default";
-               pinctrl-0 = <&usb3_vbus_en>;
-               enable-active-high;
-       };
-
-       fixed-rate-clocks {
-               xxti {
-                       compatible = "samsung,clock-xxti";
-                       clock-frequency = <24000000>;
-               };
-       };
-
-       backlight: backlight {
-               compatible = "pwm-backlight";
-               pwms = <&pwm 0 1000000 0>;
-               brightness-levels = <0 100 500 1000 1500 2000 2500 2800>;
-               default-brightness-level = <7>;
-               enable-gpios = <&gpx3 0 GPIO_ACTIVE_HIGH>;
-               power-supply = <&fet1>;
-               pinctrl-0 = <&pwm0_out>;
-               pinctrl-names = "default";
-       };
-
-       panel: panel {
-               compatible = "auo,b116xw03";
-               power-supply = <&fet6>;
-               backlight = <&backlight>;
-
-               port {
-                       panel_in: endpoint {
-                               remote-endpoint = <&bridge_out>;
-                       };
-               };
-       };
-
-       mmc3_pwrseq: mmc3_pwrseq {
-               compatible = "mmc-pwrseq-simple";
-               reset-gpios = <&gpx0 2 GPIO_ACTIVE_LOW>, /* WIFI_RSTn */
-                             <&gpx0 1 GPIO_ACTIVE_LOW>; /* WIFI_EN */
-               clocks = <&max77686 MAX77686_CLK_PMIC>;
-               clock-names = "ext_clock";
-       };
-};
-
-&cpu0 {
-       cpu0-supply = <&buck2_reg>;
-};
-
-&dp {
-       status = "okay";
-       pinctrl-names = "default";
-       pinctrl-0 = <&dp_hpd>;
-       samsung,color-space = <0>;
-       samsung,dynamic-range = <0>;
-       samsung,ycbcr-coeff = <0>;
-       samsung,color-depth = <1>;
-       samsung,link-rate = <0x0a>;
-       samsung,lane-count = <2>;
-       samsung,hpd-gpio = <&gpx0 7 GPIO_ACTIVE_HIGH>;
-
-       ports {
-               port@0 {
-                       dp_out: endpoint {
-                               remote-endpoint = <&bridge_in>;
-                       };
-               };
-       };
-};
-
-&ehci {
-       samsung,vbus-gpio = <&gpx1 1 GPIO_ACTIVE_HIGH>;
-};
-
-&fimd {
-       status = "okay";
-       samsung,invert-vclk;
-};
-
-&hdmi {
-       hpd-gpio = <&gpx3 7 GPIO_ACTIVE_HIGH>;
-       pinctrl-names = "default";
-       pinctrl-0 = <&hdmi_hpd_irq>;
-       phy = <&hdmiphy>;
-       ddc = <&i2c_2>;
-       hdmi-en-supply = <&tps65090_fet7>;
-       vdd-supply = <&ldo8_reg>;
-       vdd_osc-supply = <&ldo10_reg>;
-       vdd_pll-supply = <&ldo8_reg>;
-};
-
-&i2c_0 {
-       status = "okay";
-       samsung,i2c-sda-delay = <100>;
-       samsung,i2c-max-bus-freq = <378000>;
-
-       max77686: max77686@09 {
-               compatible = "maxim,max77686";
-               interrupt-parent = <&gpx3>;
-               interrupts = <2 IRQ_TYPE_NONE>;
-               pinctrl-names = "default";
-               pinctrl-0 = <&max77686_irq>;
-               wakeup-source;
-               reg = <0x09>;
-               #clock-cells = <1>;
-
-               voltage-regulators {
-                       ldo1_reg: LDO1 {
-                               regulator-name = "P1.0V_LDO_OUT1";
-                               regulator-min-microvolt = <1000000>;
-                               regulator-max-microvolt = <1000000>;
-                               regulator-always-on;
-                       };
-
-                       ldo2_reg: LDO2 {
-                               regulator-name = "P1.8V_LDO_OUT2";
-                               regulator-min-microvolt = <1800000>;
-                               regulator-max-microvolt = <1800000>;
-                               regulator-always-on;
-                       };
-
-                       ldo3_reg: LDO3 {
-                               regulator-name = "P1.8V_LDO_OUT3";
-                               regulator-min-microvolt = <1800000>;
-                               regulator-max-microvolt = <1800000>;
-                               regulator-always-on;
-                       };
-
-                       ldo7_reg: LDO7 {
-                               regulator-name = "P1.1V_LDO_OUT7";
-                               regulator-min-microvolt = <1100000>;
-                               regulator-max-microvolt = <1100000>;
-                               regulator-always-on;
-                       };
-
-                       ldo8_reg: LDO8 {
-                               regulator-name = "P1.0V_LDO_OUT8";
-                               regulator-min-microvolt = <1000000>;
-                               regulator-max-microvolt = <1000000>;
-                               regulator-always-on;
-                       };
-
-                       ldo10_reg: LDO10 {
-                               regulator-name = "P1.8V_LDO_OUT10";
-                               regulator-min-microvolt = <1800000>;
-                               regulator-max-microvolt = <1800000>;
-                               regulator-always-on;
-                       };
-
-                       ldo12_reg: LDO12 {
-                               regulator-name = "P3.0V_LDO_OUT12";
-                               regulator-min-microvolt = <3000000>;
-                               regulator-max-microvolt = <3000000>;
-                               regulator-always-on;
-                       };
-
-                       ldo14_reg: LDO14 {
-                               regulator-name = "P1.8V_LDO_OUT14";
-                               regulator-min-microvolt = <1800000>;
-                               regulator-max-microvolt = <1800000>;
-                               regulator-always-on;
-                       };
-
-                       ldo15_reg: LDO15 {
-                               regulator-name = "P1.0V_LDO_OUT15";
-                               regulator-min-microvolt = <1000000>;
-                               regulator-max-microvolt = <1000000>;
-                               regulator-always-on;
-                       };
-
-                       ldo16_reg: LDO16 {
-                               regulator-name = "P1.8V_LDO_OUT16";
-                               regulator-min-microvolt = <1800000>;
-                               regulator-max-microvolt = <1800000>;
-                               regulator-always-on;
-                       };
-
-                       buck1_reg: BUCK1 {
-                               regulator-name = "vdd_mif";
-                               regulator-min-microvolt = <950000>;
-                               regulator-max-microvolt = <1300000>;
-                               regulator-always-on;
-                               regulator-boot-on;
-                       };
-
-                       buck2_reg: BUCK2 {
-                               regulator-name = "vdd_arm";
-                               regulator-min-microvolt = <850000>;
-                               regulator-max-microvolt = <1350000>;
-                               regulator-always-on;
-                               regulator-boot-on;
-                       };
-
-                       buck3_reg: BUCK3 {
-                               regulator-name = "vdd_int";
-                               regulator-min-microvolt = <900000>;
-                               regulator-max-microvolt = <1200000>;
-                               regulator-always-on;
-                               regulator-boot-on;
-                       };
-
-                       buck4_reg: BUCK4 {
-                               regulator-name = "vdd_g3d";
-                               regulator-min-microvolt = <850000>;
-                               regulator-max-microvolt = <1300000>;
-                               regulator-always-on;
-                               regulator-boot-on;
-                       };
-
-                       buck5_reg: BUCK5 {
-                               regulator-name = "P1.8V_BUCK_OUT5";
-                               regulator-min-microvolt = <1800000>;
-                               regulator-max-microvolt = <1800000>;
-                               regulator-always-on;
-                               regulator-boot-on;
-                       };
-
-                       buck6_reg: BUCK6 {
-                               regulator-name = "P1.35V_BUCK_OUT6";
-                               regulator-min-microvolt = <1350000>;
-                               regulator-max-microvolt = <1350000>;
-                               regulator-always-on;
-                       };
-
-                       buck7_reg: BUCK7 {
-                               regulator-name = "P2.0V_BUCK_OUT7";
-                               regulator-min-microvolt = <2000000>;
-                               regulator-max-microvolt = <2000000>;
-                               regulator-always-on;
-                       };
-
-                       buck8_reg: BUCK8 {
-                               regulator-name = "P2.85V_BUCK_OUT8";
-                               regulator-min-microvolt = <2850000>;
-                               regulator-max-microvolt = <2850000>;
-                               regulator-always-on;
-                       };
-               };
-       };
-};
-
-&i2c_1 {
-       status = "okay";
-       samsung,i2c-sda-delay = <100>;
-       samsung,i2c-max-bus-freq = <378000>;
-
-       trackpad {
-               reg = <0x67>;
-               compatible = "cypress,cyapa";
-               interrupts = <2 IRQ_TYPE_NONE>;
-               interrupt-parent = <&gpx1>;
-               wakeup-source;
-       };
-};
-
-/*
- * Disabled pullups since external part has its own pullups and
- * double-pulling gets us out of spec in some cases.
- */
-&i2c2_bus {
-       samsung,pin-pud = <0>;
-};
-
-&i2c_2 {
-       status = "okay";
-       samsung,i2c-sda-delay = <100>;
-       samsung,i2c-max-bus-freq = <66000>;
-
-       hdmiddc@50 {
-               compatible = "samsung,exynos4210-hdmiddc";
-               reg = <0x50>;
-       };
-};
-
-&i2c_3 {
-       status = "okay";
-       samsung,i2c-sda-delay = <100>;
-       samsung,i2c-max-bus-freq = <66000>;
-};
-
-&i2c_4 {
-       status = "okay";
-       samsung,i2c-sda-delay = <100>;
-       samsung,i2c-max-bus-freq = <66000>;
-};
-
-&i2c_5 {
-       status = "okay";
-       samsung,i2c-sda-delay = <100>;
-       samsung,i2c-max-bus-freq = <66000>;
 };
 
 &i2c_7 {
-       status = "okay";
-       samsung,i2c-sda-delay = <100>;
-       samsung,i2c-max-bus-freq = <66000>;
-
-       ptn3460: lvds-bridge@20 {
-               compatible = "nxp,ptn3460";
-               reg = <0x20>;
-               powerdown-gpios = <&gpy2 5 GPIO_ACTIVE_HIGH>;
-               reset-gpios = <&gpx1 5 GPIO_ACTIVE_HIGH>;
-               edid-emulation = <5>;
-
-               ports {
-                       port@0 {
-                               bridge_out: endpoint {
-                                       remote-endpoint = <&panel_in>;
-                               };
-                       };
-
-                       port@1 {
-                               bridge_in: endpoint {
-                                       remote-endpoint = <&dp_out>;
-                               };
-                       };
-               };
-       };
-
        max98095: codec@11 {
                compatible = "maxim,max98095";
                reg = <0x11>;
-               pinctrl-0 = <&max98095_en>;
                pinctrl-names = "default";
+               pinctrl-0 = <&max98095_en>;
        };
 };
 
-&i2c_8 {
-       status = "okay";
-       samsung,i2c-sda-delay = <100>;
-       samsung,i2c-max-bus-freq = <378000>;
-
-       hdmiphy: hdmiphy@38 {
-               compatible = "samsung,exynos4212-hdmiphy";
-               reg = <0x38>;
-       };
-};
-
-&i2s0 {
-       status = "okay";
-};
-
-&mmc_0 {
-       status = "okay";
-       num-slots = <1>;
-       broken-cd;
-       card-detect-delay = <200>;
-       samsung,dw-mshc-ciu-div = <3>;
-       samsung,dw-mshc-sdr-timing = <2 3>;
-       samsung,dw-mshc-ddr-timing = <1 2>;
-       pinctrl-names = "default";
-       pinctrl-0 = <&sd0_clk &sd0_cmd &sd0_cd &sd0_bus4 &sd0_bus8>;
-       bus-width = <8>;
-       cap-mmc-highspeed;
-};
-
-&mmc_2 {
-       status = "okay";
-       num-slots = <1>;
-       card-detect-delay = <200>;
-       samsung,dw-mshc-ciu-div = <3>;
-       samsung,dw-mshc-sdr-timing = <2 3>;
-       samsung,dw-mshc-ddr-timing = <1 2>;
-       pinctrl-names = "default";
-       pinctrl-0 = <&sd2_clk &sd2_cmd &sd2_cd &sd2_bus4>;
-       bus-width = <4>;
-       wp-gpios = <&gpc2 1 GPIO_ACTIVE_HIGH>;
-       cap-sd-highspeed;
-};
-
-/*
- * On Snow we've got SIP WiFi and so can keep drive strengths low to
- * reduce EMI.
- */
-&mmc_3 {
-       status = "okay";
-       num-slots = <1>;
-       broken-cd;
-       cap-sdio-irq;
-       keep-power-in-suspend;
-       card-detect-delay = <200>;
-       samsung,dw-mshc-ciu-div = <3>;
-       samsung,dw-mshc-sdr-timing = <2 3>;
-       samsung,dw-mshc-ddr-timing = <1 2>;
-       pinctrl-names = "default";
-       pinctrl-0 = <&sd3_clk &sd3_cmd &sd3_bus4 &wifi_en &wifi_rst>;
-       bus-width = <4>;
-       cap-sd-highspeed;
-       mmc-pwrseq = <&mmc3_pwrseq>;
-};
-
 &pinctrl_0 {
-       wifi_en: wifi-en {
-               samsung,pins = "gpx0-1";
-               samsung,pin-function = <1>;
-               samsung,pin-pud = <0>;
-               samsung,pin-drv = <0>;
-       };
-
-       wifi_rst: wifi-rst {
-               samsung,pins = "gpx0-2";
-               samsung,pin-function = <1>;
-               samsung,pin-pud = <0>;
-               samsung,pin-drv = <0>;
-       };
-
-       power_key_irq: power-key-irq {
-               samsung,pins = "gpx1-3";
-               samsung,pin-function = <0xf>;
-               samsung,pin-pud = <0>;
-               samsung,pin-drv = <0>;
-       };
-
-       ec_irq: ec-irq {
-               samsung,pins = "gpx1-6";
-               samsung,pin-function = <0>;
-               samsung,pin-pud = <0>;
-               samsung,pin-drv = <0>;
-       };
-
        max98095_en: max98095-en {
                samsung,pins = "gpx1-7";
                samsung,pin-function = <0>;
                samsung,pin-pud = <3>;
                samsung,pin-drv = <0>;
        };
-
-       tps65090_irq: tps65090-irq {
-               samsung,pins = "gpx2-6";
-               samsung,pin-function = <0>;
-               samsung,pin-pud = <0>;
-               samsung,pin-drv = <0>;
-       };
-
-       usb3_vbus_en: usb3-vbus-en {
-               samsung,pins = "gpx2-7";
-               samsung,pin-function = <1>;
-               samsung,pin-pud = <0>;
-               samsung,pin-drv = <0>;
-       };
-
-       max77686_irq: max77686-irq {
-               samsung,pins = "gpx3-2";
-               samsung,pin-function = <0>;
-               samsung,pin-pud = <0>;
-               samsung,pin-drv = <0>;
-       };
-
-       lid_irq: lid-irq {
-               samsung,pins = "gpx3-5";
-               samsung,pin-function = <0xf>;
-               samsung,pin-pud = <0>;
-               samsung,pin-drv = <0>;
-       };
-
-       hdmi_hpd_irq: hdmi-hpd-irq {
-               samsung,pins = "gpx3-7";
-               samsung,pin-function = <0>;
-               samsung,pin-pud = <1>;
-               samsung,pin-drv = <0>;
-       };
-};
-
-&pinctrl_1 {
-       arb_their_claim: arb-their-claim {
-               samsung,pins = "gpe0-4";
-               samsung,pin-function = <0>;
-               samsung,pin-pud = <3>;
-               samsung,pin-drv = <0>;
-       };
-
-       arb_our_claim: arb-our-claim {
-               samsung,pins = "gpf0-3";
-               samsung,pin-function = <1>;
-               samsung,pin-pud = <0>;
-               samsung,pin-drv = <0>;
-       };
 };
-
-&rtc {
-       status = "okay";
-       clocks = <&clock CLK_RTC>, <&max77686 MAX77686_CLK_AP>;
-       clock-names = "rtc", "rtc_src";
-};
-
-&sd3_bus4 {
-       samsung,pin-drv = <0>;
-};
-
-&sd3_clk {
-       samsung,pin-drv = <0>;
-};
-
-&sd3_cmd {
-       samsung,pin-pud = <3>;
-       samsung,pin-drv = <0>;
-};
-
-&spi_1 {
-       status = "okay";
-       samsung,spi-src-clk = <0>;
-       num-cs = <1>;
-       cs-gpios = <&gpa2 5 GPIO_ACTIVE_HIGH>;
-};
-
-&usbdrd_dwc3 {
-       dr_mode = "host";
-};
-
-&usbdrd_phy {
-       vbus-supply = <&usb3_vbus_reg>;
-};
-
-#include "cros-ec-keyboard.dtsi"
index b24610ea8c2a93619bfe75770b63d1b67b61d680..88b9cf5f226f2ba27289e56642b1eb517ce69d96 100644 (file)
                compatible = "samsung,exynos4210-pd";
                reg = <0x100440A0 0x20>;
                #power-domain-cells = <0>;
+               clocks = <&clock CLK_FIN_PLL>,
+                        <&clock CLK_MOUT_ACLK200_DISP1_SUB>,
+                        <&clock CLK_MOUT_ACLK300_DISP1_SUB>;
+               clock-names = "oscclk", "clk0", "clk1";
        };
 
        clock: clock-controller@10010000 {
index eeb4ac22cfcebfb1933f91ed37a586345ad6d2fc..4ecef6981d5c4c7dd1332324e405fcd0d34ce4f0 100644 (file)
@@ -11,6 +11,7 @@
 
 /dts-v1/;
 #include "exynos5420.dtsi"
+#include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/interrupt-controller/irq.h>
 #include <dt-bindings/input/input.h>
 #include <dt-bindings/clock/samsung,s2mps11.h>
@@ -44,7 +45,7 @@
 
                wakeup {
                        label = "SW-TACT1";
-                       gpios = <&gpx2 7 1>;
+                       gpios = <&gpx2 7 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_WAKEUP>;
                        gpio-key,wakeup;
                };
index 1b95da79293c58a173ce833d2e72e995a7761cb0..72ba6f032ed72b0e664f42f6dba357dd3b2e9ffd 100644 (file)
@@ -94,7 +94,7 @@
                regulator-name = "P5.0V_USB3CON0";
                regulator-min-microvolt = <5000000>;
                regulator-max-microvolt = <5000000>;
-               gpio = <&gph0 0 0>;
+               gpio = <&gph0 0 GPIO_ACTIVE_HIGH>;
                pinctrl-names = "default";
                pinctrl-0 = <&usb300_vbus_en>;
                enable-active-high;
                regulator-name = "P5.0V_USB3CON1";
                regulator-min-microvolt = <5000000>;
                regulator-max-microvolt = <5000000>;
-               gpio = <&gph0 1 0>;
+               gpio = <&gph0 1 GPIO_ACTIVE_HIGH>;
                pinctrl-names = "default";
                pinctrl-0 = <&usb301_vbus_en>;
                enable-active-high;
        samsung,color-depth = <1>;
        samsung,link-rate = <0x06>;
        samsung,lane-count = <2>;
-       samsung,hpd-gpio = <&gpx2 6 0>;
+       samsung,hpd-gpio = <&gpx2 6 GPIO_ACTIVE_HIGH>;
 
        ports {
                port@0 {
        status = "okay";
        num-cs = <1>;
        samsung,spi-src-clk = <0>;
-       cs-gpios = <&gpb1 2 0>;
+       cs-gpios = <&gpb1 2 GPIO_ACTIVE_HIGH>;
 
        cros_ec: cros-ec@0 {
                compatible = "google,cros-ec-spi";
                pinctrl-0 = <&ec_spi_cs &ec_irq>;
                reg = <0>;
                spi-max-frequency = <3125000>;
+               google,has-vbc-nvram;
 
                controller-data {
                        samsung,spi-feedback-delay = <1>;
index 98871f972c8a770a28cdca898ff11ef1b134665a..ac35aefd320ff0acc0998f11b96c3375dc2454c5 100644 (file)
@@ -11,6 +11,7 @@
 
 /dts-v1/;
 #include "exynos5420.dtsi"
+#include <dt-bindings/gpio/gpio.h>
 
 / {
        model = "Samsung SMDK5420 board based on EXYNOS5420";
@@ -69,7 +70,7 @@
                regulator-name = "VBUS0";
                regulator-min-microvolt = <5000000>;
                regulator-max-microvolt = <5000000>;
-               gpio = <&gpg0 5 0>;
+               gpio = <&gpg0 5 GPIO_ACTIVE_HIGH>;
                pinctrl-names = "default";
                pinctrl-0 = <&usb300_vbus_en>;
                enable-active-high;
@@ -80,7 +81,7 @@
                regulator-name = "VBUS1";
                regulator-min-microvolt = <5000000>;
                regulator-max-microvolt = <5000000>;
-               gpio = <&gpg1 4 0>;
+               gpio = <&gpg1 4 GPIO_ACTIVE_HIGH>;
                pinctrl-names = "default";
                pinctrl-0 = <&usb301_vbus_en>;
                enable-active-high;
        samsung,link-rate = <0x0a>;
        samsung,lane-count = <4>;
        status = "okay";
-};
 
-&fimd {
-       status = "okay";
        display-timings {
                native-mode = <&timing0>;
                timing0: timing@0 {
        };
 };
 
+&fimd {
+       status = "okay";
+};
+
 &hdmi {
        status = "okay";
-       hpd-gpio = <&gpx3 7 0>;
+       hpd-gpio = <&gpx3 7 GPIO_ACTIVE_HIGH>;
        pinctrl-names = "default";
        pinctrl-0 = <&hdmi_hpd_irq>;
 };
diff --git a/arch/arm/boot/dts/exynos5422-odroidxu3-audio.dtsi b/arch/arm/boot/dts/exynos5422-odroidxu3-audio.dtsi
new file mode 100644 (file)
index 0000000..9493923
--- /dev/null
@@ -0,0 +1,61 @@
+/*
+ * Hardkernel Odroid XU3 Audio Codec device tree source
+ *
+ * Copyright (c) 2015 Krzysztof Kozlowski
+ * Copyright (c) 2014 Collabora Ltd.
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *             http://www.samsung.com
+ *
+ * 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.
+*/
+
+/ {
+       sound: sound {
+               compatible = "simple-audio-card";
+
+               simple-audio-card,name = "Odroid-XU3";
+               simple-audio-card,widgets =
+                       "Headphone", "Headphone Jack",
+                       "Speakers", "Speakers";
+               simple-audio-card,routing =
+                       "Headphone Jack", "HPL",
+                       "Headphone Jack", "HPR",
+                       "Headphone Jack", "MICBIAS",
+                       "IN1", "Headphone Jack",
+                       "Speakers", "SPKL",
+                       "Speakers", "SPKR";
+
+               simple-audio-card,format = "i2s";
+               simple-audio-card,bitclock-master = <&link0_codec>;
+               simple-audio-card,frame-master = <&link0_codec>;
+
+               simple-audio-card,cpu {
+                       sound-dai = <&i2s0 0>;
+                       system-clock-frequency = <19200000>;
+               };
+
+               link0_codec: simple-audio-card,codec {
+                       sound-dai = <&max98090>;
+                       clocks = <&i2s0 CLK_I2S_CDCLK>;
+               };
+       };
+};
+
+&hsi2c_5 {
+       status = "okay";
+       max98090: max98090@10 {
+               compatible = "maxim,max98090";
+               reg = <0x10>;
+               interrupt-parent = <&gpx3>;
+               interrupts = <2 0>;
+               clocks = <&i2s0 CLK_I2S_CDCLK>;
+               clock-names = "mclk";
+               #sound-dai-cells = <0>;
+       };
+};
+
+&i2s0 {
+       status = "okay";
+};
index 3b43e57845ae92bea4fc25b5c9af428c26ce2aa6..1af5bdc2bdb191fca33cba618ff909b87fdf2009 100644 (file)
                pinctrl-0 = <&emmc_nrst_pin>;
                pinctrl-names = "default";
                compatible = "mmc-pwrseq-emmc";
-               reset-gpios = <&gpd1 0 1>;
-       };
-
-       pwmleds {
-               compatible = "pwm-leds";
-
-               greenled {
-                       label = "green:mmc0";
-                       pwms = <&pwm 1 2000000 0>;
-                       pwm-names = "pwm1";
-                       /*
-                        * Green LED is much brighter than the others
-                        * so limit its max brightness
-                        */
-                       max_brightness = <127>;
-                       linux,default-trigger = "mmc0";
-               };
-
-               blueled {
-                       label = "blue:heartbeat";
-                       pwms = <&pwm 2 2000000 0>;
-                       pwm-names = "pwm2";
-                       max_brightness = <255>;
-                       linux,default-trigger = "heartbeat";
-               };
-       };
-
-       gpioleds {
-               compatible = "gpio-leds";
-               redled {
-                       label = "red:microSD";
-                       gpios = <&gpx2 3 GPIO_ACTIVE_HIGH>;
-                       default-state = "off";
-                       linux,default-trigger = "mmc1";
-               };
-       };
-
-       sound: sound {
-               compatible = "simple-audio-card";
-
-               simple-audio-card,name = "Odroid-XU3";
-               simple-audio-card,widgets =
-                       "Headphone", "Headphone Jack",
-                       "Speakers", "Speakers";
-               simple-audio-card,routing =
-                       "Headphone Jack", "HPL",
-                       "Headphone Jack", "HPR",
-                       "Headphone Jack", "MICBIAS",
-                       "IN1", "Headphone Jack",
-                       "Speakers", "SPKL",
-                       "Speakers", "SPKR";
-
-               simple-audio-card,format = "i2s";
-               simple-audio-card,bitclock-master = <&link0_codec>;
-               simple-audio-card,frame-master = <&link0_codec>;
-
-               simple-audio-card,cpu {
-                       sound-dai = <&i2s0 0>;
-                       system-clock-frequency = <19200000>;
-               };
-
-               link0_codec: simple-audio-card,codec {
-                       sound-dai = <&max98090>;
-                       clocks = <&i2s0 CLK_I2S_CDCLK>;
-               };
+               reset-gpios = <&gpd1 0 GPIO_ACTIVE_LOW>;
        };
 
        fan0: pwm-fan {
 
 &hdmi {
        status = "okay";
-       hpd-gpio = <&gpx3 7 0>;
+       hpd-gpio = <&gpx3 7 GPIO_ACTIVE_HIGH>;
        pinctrl-names = "default";
        pinctrl-0 = <&hdmi_hpd_irq>;
 
                s2mps11,buck2-ramp-enable = <1>;
                s2mps11,buck3-ramp-enable = <1>;
                s2mps11,buck4-ramp-enable = <1>;
+               samsung,s2mps11-acokb-ground;
 
                interrupt-parent = <&gpx0>;
                interrupts = <4 IRQ_TYPE_EDGE_FALLING>;
        };
 };
 
-&hsi2c_5 {
-       status = "okay";
-       max98090: max98090@10 {
-               compatible = "maxim,max98090";
-               reg = <0x10>;
-               interrupt-parent = <&gpx3>;
-               interrupts = <2 0>;
-               clocks = <&i2s0 CLK_I2S_CDCLK>;
-               clock-names = "mclk";
-               #sound-dai-cells = <0>;
-       };
-};
-
 &i2c_2 {
        samsung,i2c-sda-delay = <100>;
        samsung,i2c-max-bus-freq = <66000>;
        };
 };
 
-&i2s0 {
-       status = "okay";
-};
-
 &mfc {
        samsung,mfc-r = <0x43000000 0x800000>;
        samsung,mfc-l = <0x51000000 0x800000>;
        };
 };
 
-&pwm {
-       /*
-        * PWM 0 -- fan
-        * PWM 1 -- Green LED
-        * PWM 2 -- Blue LED
-        * PWM 3 -- on MIPI connector for backlight
-        */
-       pinctrl-0 = <&pwm0_out &pwm1_out &pwm2_out &pwm3_out>;
-       pinctrl-names = "default";
-       status = "okay";
-};
-
 &tmu_cpu0 {
        vtmu-supply = <&ldo7_reg>;
        status = "okay";
        dr_mode = "host";
 };
 
-&usbdrd_dwc3_1 {
-       dr_mode = "otg";
-};
+/* usbdrd_dwc3_1 mode customized in each board */
 
 &usbdrd3_0 {
        vdd33-supply = <&ldo9_reg>;
index c06882bbb8224a4a00dfeb615bfdf06bfa722d23..b1b36081f343960b61df6515fb2f90201b7f2d96 100644 (file)
 
 /dts-v1/;
 #include "exynos5422-odroidxu3-common.dtsi"
+#include "exynos5422-odroidxu3-audio.dtsi"
 
 / {
        model = "Hardkernel Odroid XU3 Lite";
        compatible = "hardkernel,odroid-xu3-lite", "samsung,exynos5800", "samsung,exynos5";
+
+       pwmleds {
+               compatible = "pwm-leds";
+
+               greenled {
+                       label = "green:mmc0";
+                       pwms = <&pwm 1 2000000 0>;
+                       pwm-names = "pwm1";
+                       /*
+                        * Green LED is much brighter than the others
+                        * so limit its max brightness
+                        */
+                       max_brightness = <127>;
+                       linux,default-trigger = "mmc0";
+               };
+
+               blueled {
+                       label = "blue:heartbeat";
+                       pwms = <&pwm 2 2000000 0>;
+                       pwm-names = "pwm2";
+                       max_brightness = <255>;
+                       linux,default-trigger = "heartbeat";
+               };
+       };
+
+       gpioleds {
+               compatible = "gpio-leds";
+               redled {
+                       label = "red:microSD";
+                       gpios = <&gpx2 3 GPIO_ACTIVE_HIGH>;
+                       default-state = "off";
+                       linux,default-trigger = "mmc1";
+               };
+       };
+};
+
+&pwm {
+       /*
+        * PWM 0 -- fan
+        * PWM 1 -- Green LED
+        * PWM 2 -- Blue LED
+        * PWM 3 -- on MIPI connector for backlight
+        */
+       pinctrl-0 = <&pwm0_out &pwm1_out &pwm2_out &pwm3_out>;
+       pinctrl-names = "default";
+       status = "okay";
+};
+
+&usbdrd_dwc3_1 {
+       dr_mode = "otg";
 };
index 78e6a502f320b527f315bfceaebfaed22c111789..0c0bbdbfd85f5b2761617aee9af82cb69a339b3c 100644 (file)
 
 /dts-v1/;
 #include "exynos5422-odroidxu3-common.dtsi"
+#include "exynos5422-odroidxu3-audio.dtsi"
 
 / {
        model = "Hardkernel Odroid XU3";
        compatible = "hardkernel,odroid-xu3", "samsung,exynos5800", "samsung,exynos5";
+
+       pwmleds {
+               compatible = "pwm-leds";
+
+               greenled {
+                       label = "green:mmc0";
+                       pwms = <&pwm 1 2000000 0>;
+                       pwm-names = "pwm1";
+                       /*
+                        * Green LED is much brighter than the others
+                        * so limit its max brightness
+                        */
+                       max_brightness = <127>;
+                       linux,default-trigger = "mmc0";
+               };
+
+               blueled {
+                       label = "blue:heartbeat";
+                       pwms = <&pwm 2 2000000 0>;
+                       pwm-names = "pwm2";
+                       max_brightness = <255>;
+                       linux,default-trigger = "heartbeat";
+               };
+       };
+
+       gpioleds {
+               compatible = "gpio-leds";
+               redled {
+                       label = "red:microSD";
+                       gpios = <&gpx2 3 GPIO_ACTIVE_HIGH>;
+                       default-state = "off";
+                       linux,default-trigger = "mmc1";
+               };
+       };
 };
 
 &i2c_0 {
                shunt-resistor = <10000>;
        };
 };
+
+&pwm {
+       /*
+        * PWM 0 -- fan
+        * PWM 1 -- Green LED
+        * PWM 2 -- Blue LED
+        * PWM 3 -- on MIPI connector for backlight
+        */
+       pinctrl-0 = <&pwm0_out &pwm1_out &pwm2_out &pwm3_out>;
+       pinctrl-names = "default";
+       status = "okay";
+};
+
+&usbdrd_dwc3_1 {
+       dr_mode = "otg";
+};
diff --git a/arch/arm/boot/dts/exynos5422-odroidxu4.dts b/arch/arm/boot/dts/exynos5422-odroidxu4.dts
new file mode 100644 (file)
index 0000000..2faf886
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * Hardkernel Odroid XU4 board device tree source
+ *
+ * Copyright (c) 2015 Krzysztof Kozlowski
+ * Copyright (c) 2014 Collabora Ltd.
+ * Copyright (c) 2013-2015 Samsung Electronics Co., Ltd.
+ *             http://www.samsung.com
+ *
+ * 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.
+*/
+
+/dts-v1/;
+#include "exynos5422-odroidxu3-common.dtsi"
+
+/ {
+       model = "Hardkernel Odroid XU4";
+       compatible = "hardkernel,odroid-xu4", "samsung,exynos5800", \
+                    "samsung,exynos5";
+
+       pwmleds {
+               compatible = "pwm-leds";
+
+               blueled {
+                       label = "blue:heartbeat";
+                       pwms = <&pwm 2 2000000 0>;
+                       pwm-names = "pwm2";
+                       max_brightness = <255>;
+                       linux,default-trigger = "heartbeat";
+               };
+       };
+};
+
+&pwm {
+       /*
+        * PWM 0 -- fan
+        * PWM 2 -- Blue LED
+        */
+       pinctrl-0 = <&pwm0_out &pwm2_out>;
+       pinctrl-names = "default";
+       samsung,pwm-outputs = <0>, <2>;
+       status = "okay";
+};
+
+&usbdrd_dwc3_1 {
+       dr_mode = "host";
+};
index e4443f4e65722e8058f2663dbe9a1420043269b0..6a0d802e87c88647e0b99c7adb3f34302b99808e 100644 (file)
@@ -11,6 +11,7 @@
 
 /dts-v1/;
 #include "exynos5440.dtsi"
+#include <dt-bindings/gpio/gpio.h>
 
 / {
        model = "SAMSUNG SSDK5440 board based on EXYNOS5440";
 };
 
 &pcie_0 {
-       reset-gpio = <&pin_ctrl 5 0>;
+       reset-gpio = <&pin_ctrl 5 GPIO_ACTIVE_HIGH>;
        status = "okay";
 };
 
 &pcie_1 {
-       reset-gpio = <&pin_ctrl 22 0>;
+       reset-gpio = <&pin_ctrl 22 GPIO_ACTIVE_HIGH>;
        status = "okay";
 };
 
index 8f40c7e549bd5ef48d77c4ee5c9dacaaae65d820..49a4f43e5ac25c8ad16742cca0ccdebf9f9d194c 100644 (file)
@@ -94,7 +94,7 @@
                regulator-name = "P5.0V_USB3CON0";
                regulator-min-microvolt = <5000000>;
                regulator-max-microvolt = <5000000>;
-               gpio = <&gph0 0 0>;
+               gpio = <&gph0 0 GPIO_ACTIVE_HIGH>;
                pinctrl-names = "default";
                pinctrl-0 = <&usb300_vbus_en>;
                enable-active-high;
                regulator-name = "P5.0V_USB3CON1";
                regulator-min-microvolt = <5000000>;
                regulator-max-microvolt = <5000000>;
-               gpio = <&gph0 1 0>;
+               gpio = <&gph0 1 GPIO_ACTIVE_HIGH>;
                pinctrl-names = "default";
                pinctrl-0 = <&usb301_vbus_en>;
                enable-active-high;
        samsung,color-depth = <1>;
        samsung,link-rate = <0x0a>;
        samsung,lane-count = <2>;
-       samsung,hpd-gpio = <&gpx2 6 0>;
+       samsung,hpd-gpio = <&gpx2 6 GPIO_ACTIVE_HIGH>;
        panel = <&panel>;
 };
 
        status = "okay";
        num-cs = <1>;
        samsung,spi-src-clk = <0>;
-       cs-gpios = <&gpb1 2 0>;
+       cs-gpios = <&gpb1 2 GPIO_ACTIVE_HIGH>;
 
        cros_ec: cros-ec@0 {
                compatible = "google,cros-ec-spi";
                pinctrl-0 = <&ec_spi_cs &ec_irq>;
                reg = <0>;
                spi-max-frequency = <3125000>;
+               google,has-vbc-nvram;
 
                controller-data {
                        samsung,spi-feedback-delay = <1>;
index fe623928f68794f73fc880fb15f47cf7ad66af87..a579fbf13b5f59ae3e14cd2e9ca0214cb51fd74d 100644 (file)
@@ -16,7 +16,8 @@
        compatible = "hisilicon,hi3620-hi4511";
 
        chosen {
-               bootargs = "console=ttyAMA0,115200 root=/dev/ram0 earlyprintk";
+               bootargs = "root=/dev/ram0";
+               stdout-path = "serial0:115200n8";
        };
 
        memory {
index 721b09238f58846746053b64f113ea327723c60e..d13af8437d1090e2e6ace885fa9201ff35eb95d6 100644 (file)
@@ -15,7 +15,7 @@
        compatible = "hisilicon,hix5hd2";
 
        chosen {
-               bootargs = "console=ttyAMA0,115200 earlyprintk";
+               stdout-path = "serial0:115200n8";
        };
 
        cpus {
index b995333ea22b1315cd3a322e7d840b9a9c653c36..1c6c07538a78e8fc72ce4e511922b40aee616ad3 100644 (file)
                        };
 
                        ocotp@8002c000 {
-                               compatible = "fsl,ocotp";
+                               compatible = "fsl,imx23-ocotp", "fsl,ocotp";
+                               #address-cells = <1>;
+                               #size-cells = <1>;
                                reg = <0x8002c000 0x2000>;
-                               status = "disabled";
+                               clocks = <&clks 15>;
                        };
 
                        axi-ahb@8002e000 {
index 279249b8c3f3b1c50e682abd8103c47b2b017bbb..e3ef94ac159f75b2df087be6b6c575ca71943107 100644 (file)
@@ -57,7 +57,7 @@
                                flash: m25p80@0 {
                                        #address-cells = <1>;
                                        #size-cells = <1>;
-                                       compatible = "sst,sst25vf016b";
+                                       compatible = "sst,sst25vf016b", "jedec,spi-nor";
                                        spi-max-frequency = <40000000>;
                                        reg = <0>;
                                };
index e35cc6ba3ca6ac660267b979ccf8ef939b2f1ff4..8d04e57039bcfcc1126c03db9e9dab588682ae8b 100644 (file)
@@ -41,7 +41,7 @@
                                flash: m25p80@0 {
                                        #address-cells = <1>;
                                        #size-cells = <1>;
-                                       compatible = "m25p80";
+                                       compatible = "m25p80", "jedec,spi-nor";
                                        spi-max-frequency = <40000000>;
                                        reg = <0>;
                                };
index 4e073e8547425ee189a6c91331ade03052e1d999..c5b57d4adadee9eb5094d620f57db28442ffee48 100644 (file)
                        };
 
                        ocotp: ocotp@8002c000 {
-                               compatible = "fsl,ocotp";
+                               compatible = "fsl,imx28-ocotp", "fsl,ocotp";
+                               #address-cells = <1>;
+                               #size-cells = <1>;
                                reg = <0x8002c000 0x2000>;
-                               status = "disabled";
+                               clocks = <&clks 25>;
                        };
 
                        axi-ahb@8002e000 {
index c34f82581248a98f1b3a83da99fa50eda502a42c..5fdb222636a7499a7a5df322ddb95ffcc7cc0e5e 100644 (file)
@@ -25,7 +25,7 @@
                #size-cells = <0>;
 
                cpu {
-                       compatible = "arm,arm1136";
+                       compatible = "arm,arm1136jf-s";
                        device_type = "cpu";
                };
        };
index e6540b5cfa4cac9c06d354be4fdea73c999cd85b..ed3dc3391d1c54e41803b32b059d06f82771aae9 100644 (file)
@@ -29,7 +29,7 @@
                #size-cells = <0>;
 
                cpu {
-                       compatible = "arm,arm1136";
+                       compatible = "arm,arm1136jf-s";
                        device_type = "cpu";
                };
        };
index 1b22512c91bd88b7c0c6fa3c63ff5e4121575c65..27d763c7a307d91e9efc282fb29c8e8e5de093c7 100644 (file)
@@ -33,7 +33,7 @@
        flash: m25p32@1 {
                #address-cells = <1>;
                #size-cells = <1>;
-               compatible = "m25p32", "m25p80";
+               compatible = "m25p32", "jedec,spi-nor";
                spi-max-frequency = <25000000>;
                reg = <1>;
 
index fc89ce1e5763a2b03d5da06b38e6e3896e56dd20..542ab9e697fb4c5a57f9db6523ed069b79cdfec4 100644 (file)
@@ -76,7 +76,7 @@
        flash: m25p32@1 {
                #address-cells = <1>;
                #size-cells = <1>;
-               compatible = "st,m25p32", "st,m25p";
+               compatible = "st,m25p32", "st,m25p", "jedec,spi-nor";
                spi-max-frequency = <20000000>;
                reg = <1>;
 
diff --git a/arch/arm/boot/dts/imx6dl-nit6xlite.dts b/arch/arm/boot/dts/imx6dl-nit6xlite.dts
new file mode 100644 (file)
index 0000000..e0161e4
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2015 Boundary Devices, Inc.
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This file 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.
+ *
+ *     This file is distributed in the hope that it will be useful
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ * Or, alternatively
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
+ */
+/dts-v1/;
+
+#include "imx6dl.dtsi"
+#include "imx6qdl-nit6xlite.dtsi"
+
+/ {
+       model = "Boundary Devices i.MX6 Solo Nitrogen6_Lite Board";
+       compatible = "boundary,imx6dl-nit6xlite", "fsl,imx6dl";
+};
index 5f4d33ccc4b3bed4896f1f5d59910a0386a82b37..8398f979b9129a2d0bc46c179dd54aacfa9967e8 100644 (file)
@@ -3,12 +3,42 @@
  * Copyright 2012 Freescale Semiconductor, Inc.
  * Copyright 2011 Linaro Ltd.
  *
- * The code contained herein is licensed under the GNU General Public
- * License. You may obtain a copy of the GNU General Public License
- * Version 2 or later at the following locations:
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
  *
- * http://www.opensource.org/licenses/gpl-license.html
- * http://www.gnu.org/copyleft/gpl.html
+ *  a) This file 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.
+ *
+ *     This file is distributed in the hope that it will be useful
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ * Or, alternatively
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
  */
 
 /dts-v1/;
@@ -16,6 +46,6 @@
 #include "imx6qdl-nitrogen6x.dtsi"
 
 / {
-       model = "Freescale i.MX6 DualLite Nitrogen6x Board";
-       compatible = "fsl,imx6dl-nitrogen6x", "fsl,imx6dl";
+       model = "Boundary Devices i.MX6 DualLite Nitrogen6x Board";
+       compatible = "boundary,imx6dl-nitrogen6x", "fsl,imx6dl";
 };
index b13845c2823b0a0f22448022121c7110f40b1ed8..c3a14a4330a2744698b2756af54d995d21c56daf 100644 (file)
@@ -23,7 +23,7 @@
 
 &ecspi3 {
        flash: m25p80@0 {
-               compatible = "sst,sst25vf016b";
+               compatible = "sst,sst25vf016b", "jedec,spi-nor";
                spi-max-frequency = <20000000>;
                reg = <0>;
        };
index 2de04479dc359dce0a57e6241c424a63515fddff..0f06ca5c914694f2c7483be4e5c2a6d56d5972c3 100644 (file)
@@ -2,12 +2,42 @@
  * Copyright 2011 Freescale Semiconductor, Inc.
  * Copyright 2011 Linaro Ltd.
  *
- * The code contained herein is licensed under the GNU General Public
- * License. You may obtain a copy of the GNU General Public License
- * Version 2 or later at the following locations:
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
  *
- * http://www.opensource.org/licenses/gpl-license.html
- * http://www.gnu.org/copyleft/gpl.html
+ *  a) This file 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.
+ *
+ *     This file is distributed in the hope that it will be useful
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ * Or, alternatively
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
  */
 
 /dts-v1/;
index 4fa25434779828806c49a0d0477a46cb15cd2544..364578d707a570a5f77ca691525aa271b8a89b1c 100644 (file)
        status = "okay";
 
        flash: m25p80@0 {
-               compatible = "m25p80";
+               compatible = "m25p80", "jedec,spi-nor";
                spi-max-frequency = <40000000>;
                reg = <0>;
        };
index 822ffb231c57833dac53abdea3347f1369ee1bb5..58adf176425a69fc48d16731973f93827b080bab 100644 (file)
        status = "okay";
 
        flash: m25p80@0 {
-               compatible = "sst,w25q256";
+               compatible = "sst,w25q256", "jedec,spi-nor";
                spi-max-frequency = <30000000>;
                reg = <0>;
        };
diff --git a/arch/arm/boot/dts/imx6q-nitrogen6_max.dts b/arch/arm/boot/dts/imx6q-nitrogen6_max.dts
new file mode 100644 (file)
index 0000000..d417457
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2015 Boundary Devices, Inc.
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This file 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.
+ *
+ *     This file is distributed in the hope that it will be useful
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ * Or, alternatively
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
+ */
+/dts-v1/;
+
+#include "imx6q.dtsi"
+#include "imx6qdl-nitrogen6_max.dtsi"
+
+/ {
+       model = "Boundary Devices i.MX6 Quad Nitrogen6_MAX Board";
+       compatible = "boundary,imx6q-nitrogen6_max", "fsl,imx6q";
+};
+
+&sata {
+       status = "okay";
+};
index a57866b2e97e91da2bc809eb68548e87ac2cadd6..d1686339dc480be00942aacfbfd5c40da9002557 100644 (file)
@@ -3,12 +3,42 @@
  * Copyright 2012 Freescale Semiconductor, Inc.
  * Copyright 2011 Linaro Ltd.
  *
- * The code contained herein is licensed under the GNU General Public
- * License. You may obtain a copy of the GNU General Public License
- * Version 2 or later at the following locations:
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
  *
- * http://www.opensource.org/licenses/gpl-license.html
- * http://www.gnu.org/copyleft/gpl.html
+ *  a) This file 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.
+ *
+ *     This file is distributed in the hope that it will be useful
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ * Or, alternatively
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
  */
 
 /dts-v1/;
@@ -16,8 +46,8 @@
 #include "imx6qdl-nitrogen6x.dtsi"
 
 / {
-       model = "Freescale i.MX6 Quad Nitrogen6x Board";
-       compatible = "fsl,imx6q-nitrogen6x", "fsl,imx6q";
+       model = "Boundary Devices i.MX6 Quad Nitrogen6x Board";
+       compatible = "boundary,imx6q-nitrogen6x", "fsl,imx6q";
 };
 
 &sata {
index 3c2852b16f78c9815ddc1da683566b1c1f09aa20..90ea61ae04e94400e9024a31d62216c2e7fa7a6f 100644 (file)
@@ -23,7 +23,7 @@
 
 &ecspi3 {
        flash: m25p80@0 {
-               compatible = "sst,sst25vf032b";
+               compatible = "sst,sst25vf032b", "jedec,spi-nor";
                spi-max-frequency = <20000000>;
                reg = <0>;
        };
index 96e4688be77c20423015883e4d0cec51bf8118ed..66d10d8d534ccad9db44ab26bb0569540fddfb4d 100644 (file)
@@ -2,12 +2,42 @@
  * Copyright 2011 Freescale Semiconductor, Inc.
  * Copyright 2011 Linaro Ltd.
  *
- * The code contained herein is licensed under the GNU General Public
- * License. You may obtain a copy of the GNU General Public License
- * Version 2 or later at the following locations:
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
  *
- * http://www.opensource.org/licenses/gpl-license.html
- * http://www.gnu.org/copyleft/gpl.html
+ *  a) This file 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.
+ *
+ *     This file is distributed in the hope that it will be useful
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ * Or, alternatively
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
  */
 
 /dts-v1/;
index f4d6ae564ead290cd9fc1e02d519573364c47af5..ecbc6eba6a2c14f912b3c30a39f7a5598fc2974e 100644 (file)
        flash: m25p80@0 {
                #address-cells = <1>;
                #size-cells = <1>;
-               compatible = "micron,n25q128a11";
+               compatible = "micron,n25q128a11", "jedec,spi-nor";
                spi-max-frequency = <20000000>;
                reg = <0>;
        };
index a47a0399a1728da0c1293a8312f30bef082fd349..7d81100e7d47572dc28a2dc669cfe742de1666da 100644 (file)
        flash: m25p80@1 {
                #address-cells = <1>;
                #size-cells = <1>;
-               compatible = "micron,n25q128a11";
+               compatible = "micron,n25q128a11", "jedec,spi-nor";
                spi-max-frequency = <20000000>;
                reg = <1>;
        };
index 45e7c39e80d584c73ade1523a3e4316e549c76d4..da1341d47b141d6e30d7e28d8e5d798e35c9c656 100644 (file)
@@ -38,7 +38,7 @@
        flash: m25p80@0 {
                #address-cells = <1>;
                #size-cells = <1>;
-               compatible = "sst,sst25vf040b", "m25p80";
+               compatible = "sst,sst25vf040b", "jedec,spi-nor";
                spi-max-frequency = <20000000>;
                reg = <0>;
        };
diff --git a/arch/arm/boot/dts/imx6qdl-nit6xlite.dtsi b/arch/arm/boot/dts/imx6qdl-nit6xlite.dtsi
new file mode 100644 (file)
index 0000000..24d7d3f
--- /dev/null
@@ -0,0 +1,630 @@
+/*
+ * Copyright 2015 Boundary Devices, Inc.
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This file 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.
+ *
+ *     This file is distributed in the hope that it will be useful
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ * Or, alternatively
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
+ */
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+       chosen {
+               stdout-path = &uart2;
+       };
+
+       memory {
+               reg = <0x10000000 0x20000000>;
+       };
+
+       regulators {
+               compatible = "simple-bus";
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               reg_2p5v: regulator@0 {
+                       compatible = "regulator-fixed";
+                       reg = <0>;
+                       regulator-name = "2P5V";
+                       regulator-min-microvolt = <2500000>;
+                       regulator-max-microvolt = <2500000>;
+                       regulator-always-on;
+               };
+
+               reg_3p3v: regulator@1 {
+                       compatible = "regulator-fixed";
+                       reg = <1>;
+                       regulator-name = "3P3V";
+                       regulator-min-microvolt = <3300000>;
+                       regulator-max-microvolt = <3300000>;
+                       regulator-always-on;
+               };
+
+               reg_usb_otg_vbus: regulator@2 {
+                       compatible = "regulator-fixed";
+                       reg = <2>;
+                       regulator-name = "usb_otg_vbus";
+                       regulator-min-microvolt = <5000000>;
+                       regulator-max-microvolt = <5000000>;
+                       gpio = <&gpio3 22 GPIO_ACTIVE_HIGH>;
+                       enable-active-high;
+               };
+
+               reg_wlan_vmmc: regulator@3 {
+                       compatible = "regulator-fixed";
+                       reg = <3>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&pinctrl_wlan_vmmc>;
+                       regulator-name = "reg_wlan_vmmc";
+                       regulator-min-microvolt = <1800000>;
+                       regulator-max-microvolt = <1800000>;
+                       gpio = <&gpio6 7 GPIO_ACTIVE_HIGH>;
+                       startup-delay-us = <70000>;
+                       enable-active-high;
+               };
+       };
+
+       bt_rfkill {
+               compatible = "rfkill-gpio";
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_bt_rfkill>;
+               gpios = <&gpio6 8 GPIO_ACTIVE_HIGH>;
+               name = "bt_rfkill";
+               type = <2>;
+       };
+
+       gpio-keys {
+               compatible = "gpio-keys";
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_gpio_keys>;
+
+               home {
+                       label = "Home";
+                       gpios = <&gpio7 13 IRQ_TYPE_LEVEL_LOW>;
+                       linux,code = <102>;
+               };
+
+               back {
+                       label = "Back";
+                       gpios = <&gpio4 5 IRQ_TYPE_LEVEL_LOW>;
+                       linux,code = <158>;
+               };
+       };
+
+       leds {
+               compatible = "gpio-leds";
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_leds>;
+
+               j14-pin1 {
+                       gpios = <&gpio1 2 GPIO_ACTIVE_LOW>;
+                       retain-state-suspended;
+                       default-state = "off";
+               };
+
+               j14-pin3 {
+                       gpios = <&gpio1 3 GPIO_ACTIVE_LOW>;
+                       retain-state-suspended;
+                       default-state = "off";
+               };
+
+               j14-pins8-9 {
+                       gpios = <&gpio3 29 GPIO_ACTIVE_LOW>;
+                       retain-state-suspended;
+                       default-state = "off";
+               };
+
+               j46-pin2 {
+                       gpios = <&gpio1 7 GPIO_ACTIVE_LOW>;
+                       retain-state-suspended;
+                       default-state = "off";
+               };
+
+               j46-pin3 {
+                       gpios = <&gpio1 8 GPIO_ACTIVE_LOW>;
+                       retain-state-suspended;
+                       default-state = "off";
+               };
+       };
+
+       backlight_lcd {
+               compatible = "pwm-backlight";
+               pwms = <&pwm1 0 5000000>;
+               brightness-levels = <0 4 8 16 32 64 128 255>;
+               default-brightness-level = <7>;
+               power-supply = <&reg_3p3v>;
+               status = "okay";
+       };
+
+       backlight_lvds0: backlight_lvds0 {
+               compatible = "pwm-backlight";
+               pwms = <&pwm4 0 5000000>;
+               brightness-levels = <0 4 8 16 32 64 128 255>;
+               default-brightness-level = <7>;
+               power-supply = <&reg_3p3v>;
+               status = "okay";
+       };
+
+       panel_lvds0 {
+               compatible = "hannstar,hsd100pxn1";
+               backlight = <&backlight_lvds0>;
+
+               port {
+                       panel_in_lvds0: endpoint {
+                               remote-endpoint = <&lvds0_out>;
+                       };
+               };
+       };
+
+       sound {
+               compatible = "fsl,imx6dl-nit6xlite-sgtl5000",
+                            "fsl,imx-audio-sgtl5000";
+               model = "imx6dl-nit6xlite-sgtl5000";
+               ssi-controller = <&ssi1>;
+               audio-codec = <&codec>;
+               audio-routing =
+                       "MIC_IN", "Mic Jack",
+                       "Mic Jack", "Mic Bias",
+                       "Headphone Jack", "HP_OUT";
+               mux-int-port = <1>;
+               mux-ext-port = <3>;
+       };
+};
+
+&audmux {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_audmux>;
+       status = "okay";
+};
+
+&clks {
+       assigned-clocks = <&clks IMX6QDL_CLK_LDB_DI0_SEL>,
+                         <&clks IMX6QDL_CLK_LDB_DI1_SEL>;
+       assigned-clock-parents = <&clks IMX6QDL_CLK_PLL3_USB_OTG>,
+                                <&clks IMX6QDL_CLK_PLL3_USB_OTG>;
+};
+
+&ecspi1 {
+       fsl,spi-num-chipselects = <1>;
+       cs-gpios = <&gpio3 19 GPIO_ACTIVE_LOW>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_ecspi1>;
+       status = "okay";
+
+       flash: m25p80@0 {
+               compatible = "microchip,sst25vf016b";
+               spi-max-frequency = <20000000>;
+               reg = <0>;
+       };
+};
+
+&fec {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_enet>;
+       phy-mode = "rgmii";
+       phy-reset-gpios = <&gpio1 27 GPIO_ACTIVE_LOW>;
+       txen-skew-ps = <0>;
+       txc-skew-ps = <3000>;
+       rxdv-skew-ps = <0>;
+       rxc-skew-ps = <3000>;
+       rxd0-skew-ps = <0>;
+       rxd1-skew-ps = <0>;
+       rxd2-skew-ps = <0>;
+       rxd3-skew-ps = <0>;
+       txd0-skew-ps = <0>;
+       txd1-skew-ps = <0>;
+       txd2-skew-ps = <0>;
+       txd3-skew-ps = <0>;
+       interrupts-extended = <&gpio1 6 IRQ_TYPE_LEVEL_HIGH>,
+                             <&intc 0 119 IRQ_TYPE_LEVEL_HIGH>;
+       status = "okay";
+};
+
+&hdmi {
+       ddc-i2c-bus = <&i2c2>;
+       status = "okay";
+};
+
+&i2c1 {
+       clock-frequency = <100000>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_i2c1>;
+       status = "okay";
+
+       codec: sgtl5000@0a {
+               compatible = "fsl,sgtl5000";
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_sgtl5000>;
+               reg = <0x0a>;
+               clocks = <&clks 201>;
+               VDDA-supply = <&reg_2p5v>;
+               VDDIO-supply = <&reg_3p3v>;
+       };
+};
+
+&i2c2 {
+       clock-frequency = <100000>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_i2c2>;
+       status = "okay";
+};
+
+&i2c3 {
+       clock-frequency = <100000>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_i2c3>;
+       status = "okay";
+
+       touchscreen@04 {
+               compatible = "eeti,egalax_ts";
+               reg = <0x04>;
+               interrupt-parent = <&gpio1>;
+               interrupts = <9 IRQ_TYPE_EDGE_FALLING>;
+               wakeup-gpios = <&gpio1 9 GPIO_ACTIVE_LOW>;
+       };
+
+       touchscreen@38 {
+               compatible = "edt,edt-ft5x06";
+               reg = <0x38>;
+               interrupt-parent = <&gpio1>;
+               interrupts = <9 IRQ_TYPE_EDGE_FALLING>;
+       };
+
+       rtc@6f {
+               compatible = "isil,isl1208";
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_rtc>;
+               reg = <0x6f>;
+               interrupts-extended = <&gpio2 26 IRQ_TYPE_LEVEL_LOW>;
+       };
+};
+
+&iomuxc {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_j10>;
+       pinctrl-1 = <&pinctrl_j28>;
+
+       imx6dl-nit6xlite {
+               pinctrl_audmux: audmuxgrp {
+                       fsl,pins = <
+                               MX6QDL_PAD_CSI0_DAT7__AUD3_RXD          0x130b0
+                               MX6QDL_PAD_CSI0_DAT4__AUD3_TXC          0x130b0
+                               MX6QDL_PAD_CSI0_DAT5__AUD3_TXD          0x110b0
+                               MX6QDL_PAD_CSI0_DAT6__AUD3_TXFS         0x130b0
+                       >;
+               };
+
+               pinctrl_bt_rfkill: bt_rfkillgrp {
+                       fsl,pins = <
+                               /* BT wake */
+                               MX6QDL_PAD_NANDF_D2__GPIO2_IO02         0x1b0b0
+                               /* BT reset */
+                               MX6QDL_PAD_NANDF_ALE__GPIO6_IO08        0x0b0b0
+                               /* BT reg en */
+                               MX6QDL_PAD_NANDF_CS2__GPIO6_IO15        0x1b0b0
+                               /* BT host wake irq */
+                               MX6QDL_PAD_NANDF_CS3__GPIO6_IO16        0x100b0
+                       >;
+               };
+
+               pinctrl_ecspi1: ecspi1grp {
+                       fsl,pins = <
+                               MX6QDL_PAD_EIM_D17__ECSPI1_MISO         0x100b1
+                               MX6QDL_PAD_EIM_D18__ECSPI1_MOSI         0x100b1
+                               MX6QDL_PAD_EIM_D16__ECSPI1_SCLK         0x100b1
+                               MX6QDL_PAD_EIM_D19__GPIO3_IO19          0x000b1
+                       >;
+               };
+
+               pinctrl_enet: enetgrp {
+                       fsl,pins = <
+                               MX6QDL_PAD_ENET_MDIO__ENET_MDIO         0x100b0
+                               MX6QDL_PAD_ENET_MDC__ENET_MDC           0x100b0
+                               MX6QDL_PAD_RGMII_TXC__RGMII_TXC         0x100b0
+                               MX6QDL_PAD_RGMII_TD0__RGMII_TD0         0x100b0
+                               MX6QDL_PAD_RGMII_TD1__RGMII_TD1         0x100b0
+                               MX6QDL_PAD_RGMII_TD2__RGMII_TD2         0x100b0
+                               MX6QDL_PAD_RGMII_TD3__RGMII_TD3         0x100b0
+                               MX6QDL_PAD_RGMII_TX_CTL__RGMII_TX_CTL   0x100b0
+                               MX6QDL_PAD_ENET_REF_CLK__ENET_TX_CLK    0x100b0
+                               MX6QDL_PAD_RGMII_RXC__RGMII_RXC         0x1b0b0
+                               MX6QDL_PAD_RGMII_RD0__RGMII_RD0         0x1b0b0
+                               MX6QDL_PAD_RGMII_RD1__RGMII_RD1         0x1b0b0
+                               MX6QDL_PAD_RGMII_RD2__RGMII_RD2         0x1b0b0
+                               MX6QDL_PAD_RGMII_RD3__RGMII_RD3         0x1b0b0
+                               MX6QDL_PAD_RGMII_RX_CTL__RGMII_RX_CTL   0x1b0b0
+                               /* Phy reset */
+                               MX6QDL_PAD_ENET_RXD0__GPIO1_IO27        0x0f0b0
+                               MX6QDL_PAD_ENET_TX_EN__GPIO1_IO28       0x1b0b0
+                               MX6QDL_PAD_GPIO_6__ENET_IRQ             0x000b1
+                       >;
+               };
+
+               pinctrl_gpio_keys: gpio_keysgrp {
+                       fsl,pins = <
+                               /* Home Button: J14 pin 5 */
+                               MX6QDL_PAD_GPIO_18__GPIO7_IO13          0x1b0b0
+                               /* Back Button: J14 pin 7 */
+                               MX6QDL_PAD_GPIO_19__GPIO4_IO05          0x1b0b0
+                       >;
+               };
+
+               pinctrl_i2c1: i2c1grp {
+                       fsl,pins = <
+                               MX6QDL_PAD_EIM_D21__I2C1_SCL    0x4001b8b1
+                               MX6QDL_PAD_EIM_D28__I2C1_SDA    0x4001b8b1
+                       >;
+               };
+
+               pinctrl_i2c2: i2c2grp {
+                       fsl,pins = <
+                               MX6QDL_PAD_KEY_COL3__I2C2_SCL   0x4001b8b1
+                               MX6QDL_PAD_KEY_ROW3__I2C2_SDA   0x4001b8b1
+                       >;
+               };
+
+               pinctrl_i2c3: i2c3grp {
+                       fsl,pins = <
+                               MX6QDL_PAD_GPIO_5__I2C3_SCL     0x4001b8b1
+                               MX6QDL_PAD_GPIO_16__I2C3_SDA    0x4001b8b1
+                               /* Touch IRQ: J7 pin 4 */
+                               MX6QDL_PAD_GPIO_9__GPIO1_IO09   0x1b0b0
+                               /* tcs2004 IRQ */
+                               MX6QDL_PAD_EIM_LBA__GPIO2_IO27  0x1b0b0
+                               /* tsc2004 reset */
+                               MX6QDL_PAD_KEY_COL2__GPIO4_IO10 0x0b0b0
+                       >;
+               };
+
+               pinctrl_j10: j10grp {
+                       fsl,pins = <
+                               /* Broadcom WiFi module pins */
+                               MX6QDL_PAD_NANDF_D0__GPIO2_IO00         0x1b0b0
+                               MX6QDL_PAD_NANDF_D1__GPIO2_IO01         0x1b0b0
+                               MX6QDL_PAD_NANDF_D3__GPIO2_IO03         0x1b0b0
+                               MX6QDL_PAD_NANDF_D4__GPIO2_IO04         0x1b0b0
+                               MX6QDL_PAD_NANDF_WP_B__GPIO6_IO09       0x0b0b0
+                               MX6QDL_PAD_NANDF_CS1__GPIO6_IO14        0x1b0b0
+                               MX6QDL_PAD_SD1_CLK__OSC32K_32K_OUT      0x000b0
+                       >;
+               };
+
+               pinctrl_j28: j28grp {
+                       fsl,pins = <
+                               MX6QDL_PAD_GPIO_4__GPIO1_IO04           0x1b0b0
+                       >;
+               };
+
+               pinctrl_leds: ledsgrp {
+                       fsl,pins = <
+                               MX6QDL_PAD_GPIO_2__GPIO1_IO02           0x0b0b0
+                               MX6QDL_PAD_GPIO_3__GPIO1_IO03           0x0b0b0
+                               MX6QDL_PAD_EIM_D29__GPIO3_IO29          0x030b0
+                               MX6QDL_PAD_GPIO_7__GPIO1_IO07           0x0b0b0
+                               MX6QDL_PAD_GPIO_8__GPIO1_IO08           0x0b0b0
+                       >;
+               };
+
+               pinctrl_pwm1: pwm1grp {
+                       fsl,pins = <
+                               MX6QDL_PAD_SD1_DAT3__PWM1_OUT           0x1b0b1
+                       >;
+               };
+
+               pinctrl_pwm3: pwm3grp {
+                       fsl,pins = <
+                               MX6QDL_PAD_SD1_DAT1__PWM3_OUT           0x1b0b1
+                       >;
+               };
+
+               pinctrl_pwm4: pwm4grp {
+                       fsl,pins = <
+                               MX6QDL_PAD_SD1_CMD__PWM4_OUT            0x1b0b1
+                       >;
+               };
+
+               pinctrl_wlan_vmmc: wlan_vmmcgrp {
+                       fsl,pins = <
+                               MX6QDL_PAD_NANDF_CLE__GPIO6_IO07        0x030b0
+                       >;
+               };
+
+               pinctrl_rtc: rtcgrp {
+                       fsl,pins = <
+                               MX6QDL_PAD_EIM_RW__GPIO2_IO26           0x1b0b0
+                       >;
+               };
+
+               pinctrl_sgtl5000: sgtl5000grp {
+                       fsl,pins = <
+                               MX6QDL_PAD_GPIO_0__CCM_CLKO1            0x000b0
+                               MX6QDL_PAD_EIM_A25__GPIO5_IO02          0x1b0b0
+                       >;
+               };
+
+               pinctrl_uart1: uart1grp {
+                       fsl,pins = <
+                               MX6QDL_PAD_SD3_DAT7__UART1_TX_DATA      0x1b0b1
+                               MX6QDL_PAD_SD3_DAT6__UART1_RX_DATA      0x1b0b1
+                       >;
+               };
+
+               pinctrl_uart2: uart2grp {
+                       fsl,pins = <
+                               MX6QDL_PAD_EIM_D26__UART2_TX_DATA       0x1b0b1
+                               MX6QDL_PAD_EIM_D27__UART2_RX_DATA       0x1b0b1
+                       >;
+               };
+
+               pinctrl_uart3: uart3grp {
+                       fsl,pins = <
+                               MX6QDL_PAD_EIM_D24__UART3_TX_DATA       0x1b0b1
+                               MX6QDL_PAD_EIM_D25__UART3_RX_DATA       0x1b0b1
+                               MX6QDL_PAD_EIM_D23__UART3_CTS_B         0x1b0b1
+                               MX6QDL_PAD_EIM_D31__UART3_RTS_B         0x1b0b1
+                       >;
+               };
+
+               pinctrl_usbotg: usbotggrp {
+                       fsl,pins = <
+                               MX6QDL_PAD_GPIO_1__USB_OTG_ID           0x17059
+                               MX6QDL_PAD_KEY_COL4__USB_OTG_OC         0x1b0b0
+                               /* power enable, high active */
+                               MX6QDL_PAD_EIM_D22__GPIO3_IO22          0x000b0
+                       >;
+               };
+
+               pinctrl_usdhc2: usdhc2grp {
+                       fsl,pins = <
+                               MX6QDL_PAD_SD2_CMD__SD2_CMD             0x17059
+                               MX6QDL_PAD_SD2_CLK__SD2_CLK             0x10059
+                               MX6QDL_PAD_SD2_DAT0__SD2_DATA0          0x17059
+                               MX6QDL_PAD_SD2_DAT1__SD2_DATA1          0x17059
+                               MX6QDL_PAD_SD2_DAT2__SD2_DATA2          0x17059
+                               MX6QDL_PAD_SD2_DAT3__SD2_DATA3          0x17059
+                       >;
+               };
+
+               pinctrl_usdhc3: usdhc3grp {
+                       fsl,pins = <
+                               MX6QDL_PAD_SD3_CMD__SD3_CMD             0x17059
+                               MX6QDL_PAD_SD3_CLK__SD3_CLK             0x10059
+                               MX6QDL_PAD_SD3_DAT0__SD3_DATA0          0x17059
+                               MX6QDL_PAD_SD3_DAT1__SD3_DATA1          0x17059
+                               MX6QDL_PAD_SD3_DAT2__SD3_DATA2          0x17059
+                               MX6QDL_PAD_SD3_DAT3__SD3_DATA3          0x17059
+                               MX6QDL_PAD_SD3_DAT5__GPIO7_IO00         0x1b0b0
+                       >;
+               };
+       };
+};
+
+&ldb {
+       status = "okay";
+
+       lvds-channel@0 {
+               fsl,data-mapping = "spwg";
+               fsl,data-width = <18>;
+               status = "okay";
+
+               port@4 {
+                       reg = <4>;
+
+                       lvds0_out: endpoint {
+                               remote-endpoint = <&panel_in_lvds0>;
+                       };
+               };
+       };
+};
+
+&pcie {
+       status = "okay";
+};
+
+&pwm1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_pwm1>;
+       status = "okay";
+};
+
+&pwm3 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_pwm3>;
+       status = "okay";
+};
+
+&pwm4 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_pwm4>;
+       status = "okay";
+};
+
+&ssi1 {
+       status = "okay";
+};
+
+&uart1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_uart1>;
+       status = "okay";
+};
+
+&uart2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_uart2>;
+       status = "okay";
+};
+
+&uart3 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_uart3>;
+       fsl,uart-has-rtscts;
+       status = "okay";
+};
+
+&usbh1 {
+       status = "okay";
+};
+
+&usbotg {
+       vbus-supply = <&reg_usb_otg_vbus>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_usbotg>;
+       disable-over-current;
+       status = "okay";
+};
+
+&usdhc2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_usdhc2>;
+       bus-width = <4>;
+       non-removable;
+       vmmc-supply = <&reg_3p3v>;
+       vqmmc-supply = <&reg_wlan_vmmc>;
+       vqmmc-1-8-v;
+       ocr-limit = <0x180>;     /* 1.65v - 2.1v */
+       cap-power-off-card;
+       keep-power-in-suspend;
+       status = "okay";
+};
+
+&usdhc3 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_usdhc3>;
+       cd-gpios = <&gpio7 0 GPIO_ACTIVE_LOW>;
+       vmmc-supply = <&reg_3p3v>;
+       status = "okay";
+};
diff --git a/arch/arm/boot/dts/imx6qdl-nitrogen6_max.dtsi b/arch/arm/boot/dts/imx6qdl-nitrogen6_max.dtsi
new file mode 100644 (file)
index 0000000..a35d54f
--- /dev/null
@@ -0,0 +1,873 @@
+/*
+ * Copyright 2015 Boundary Devices, Inc.
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This file 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.
+ *
+ *     This file is distributed in the hope that it will be useful
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ * Or, alternatively
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
+ */
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+       chosen {
+               stdout-path = &uart2;
+       };
+
+       memory {
+               reg = <0x10000000 0xF0000000>;
+       };
+
+       regulators {
+               compatible = "simple-bus";
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               reg_1p8v: regulator@0 {
+                       compatible = "regulator-fixed";
+                       reg = <0>;
+                       regulator-name = "1P8V";
+                       regulator-min-microvolt = <1800000>;
+                       regulator-max-microvolt = <1800000>;
+                       regulator-always-on;
+               };
+
+               reg_2p5v: regulator@1 {
+                       compatible = "regulator-fixed";
+                       reg = <1>;
+                       regulator-name = "2P5V";
+                       regulator-min-microvolt = <2500000>;
+                       regulator-max-microvolt = <2500000>;
+                       regulator-always-on;
+               };
+
+               reg_3p3v: regulator@2 {
+                       compatible = "regulator-fixed";
+                       reg = <2>;
+                       regulator-name = "3P3V";
+                       regulator-min-microvolt = <3300000>;
+                       regulator-max-microvolt = <3300000>;
+                       regulator-always-on;
+               };
+
+               reg_usb_otg_vbus: regulator@3 {
+                       compatible = "regulator-fixed";
+                       reg = <3>;
+                       regulator-name = "usb_otg_vbus";
+                       regulator-min-microvolt = <5000000>;
+                       regulator-max-microvolt = <5000000>;
+                       gpio = <&gpio3 22 GPIO_ACTIVE_HIGH>;
+                       enable-active-high;
+               };
+
+               reg_usb_h1_vbus: regulator@4 {
+                       compatible = "regulator-fixed";
+                       reg = <4>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&pinctrl_usbh1>;
+                       regulator-name = "usb_h1_vbus";
+                       regulator-min-microvolt = <3300000>;
+                       regulator-max-microvolt = <3300000>;
+                       gpio = <&gpio7 12 GPIO_ACTIVE_HIGH>;
+                       enable-active-high;
+               };
+
+               reg_wlan_vmmc: regulator@5 {
+                       compatible = "regulator-fixed";
+                       reg = <5>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&pinctrl_wlan_vmmc>;
+                       regulator-name = "reg_wlan_vmmc";
+                       regulator-min-microvolt = <3300000>;
+                       regulator-max-microvolt = <3300000>;
+                       gpio = <&gpio6 15 GPIO_ACTIVE_HIGH>;
+                       startup-delay-us = <70000>;
+                       enable-active-high;
+               };
+
+               reg_can_xcvr: regulator@6 {
+                       compatible = "regulator-fixed";
+                       reg = <6>;
+                       regulator-name = "CAN XCVR";
+                       regulator-min-microvolt = <3300000>;
+                       regulator-max-microvolt = <3300000>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&pinctrl_can_xcvr>;
+                       gpio = <&gpio1 2 GPIO_ACTIVE_LOW>;
+               };
+       };
+
+       gpio-keys {
+               compatible = "gpio-keys";
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_gpio_keys>;
+
+               power {
+                       label = "Power Button";
+                       gpios = <&gpio2 3 GPIO_ACTIVE_LOW>;
+                       linux,code = <KEY_POWER>;
+                       gpio-key,wakeup;
+               };
+
+               menu {
+                       label = "Menu";
+                       gpios = <&gpio2 1 GPIO_ACTIVE_LOW>;
+                       linux,code = <KEY_MENU>;
+               };
+
+               home {
+                       label = "Home";
+                       gpios = <&gpio2 4 GPIO_ACTIVE_LOW>;
+                       linux,code = <KEY_HOME>;
+               };
+
+               back {
+                       label = "Back";
+                       gpios = <&gpio2 2 GPIO_ACTIVE_LOW>;
+                       linux,code = <KEY_BACK>;
+               };
+
+               volume-up {
+                       label = "Volume Up";
+                       gpios = <&gpio7 13 GPIO_ACTIVE_LOW>;
+                       linux,code = <KEY_VOLUMEUP>;
+               };
+
+               volume-down {
+                       label = "Volume Down";
+                       gpios = <&gpio7 1 GPIO_ACTIVE_LOW>;
+                       linux,code = <KEY_VOLUMEDOWN>;
+               };
+       };
+
+       i2cmux@2 {
+               compatible = "i2c-mux-gpio";
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_i2c2mux>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+               mux-gpios = <&gpio3 20 GPIO_ACTIVE_HIGH
+                            &gpio4 15 GPIO_ACTIVE_HIGH>;
+               i2c-parent = <&i2c2>;
+               idle-state = <0>;
+
+               i2c2@1 {
+                       reg = <1>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+               };
+
+               i2c2@2 {
+                       reg = <2>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+               };
+       };
+
+       i2cmux@3 {
+               compatible = "i2c-mux-gpio";
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_i2c3mux>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+               mux-gpios = <&gpio2 25 GPIO_ACTIVE_HIGH>;
+               i2c-parent = <&i2c3>;
+               idle-state = <0>;
+
+               i2c3@1 {
+                       reg = <1>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+               };
+       };
+
+       leds {
+               compatible = "gpio-leds";
+
+               speaker-enable {
+                       gpios = <&gpio1 29 GPIO_ACTIVE_HIGH>;
+                       retain-state-suspended;
+                       default-state = "off";
+               };
+
+               ttymxc4-rs232 {
+                       gpios = <&gpio6 10 GPIO_ACTIVE_HIGH>;
+                       retain-state-suspended;
+                       default-state = "on";
+               };
+       };
+
+       backlight_lcd: backlight_lcd {
+               compatible = "pwm-backlight";
+               pwms = <&pwm1 0 5000000>;
+               brightness-levels = <0 4 8 16 32 64 128 255>;
+               default-brightness-level = <7>;
+               power-supply = <&reg_3p3v>;
+               status = "okay";
+       };
+
+       backlight_lvds0: backlight_lvds0 {
+               compatible = "pwm-backlight";
+               pwms = <&pwm4 0 5000000>;
+               brightness-levels = <0 4 8 16 32 64 128 255>;
+               default-brightness-level = <7>;
+               power-supply = <&reg_3p3v>;
+               status = "okay";
+       };
+
+       backlight_lvds1: backlight_lvds1 {
+               compatible = "pwm-backlight";
+               pwms = <&pwm2 0 5000000>;
+               brightness-levels = <0 4 8 16 32 64 128 255>;
+               default-brightness-level = <7>;
+               power-supply = <&reg_3p3v>;
+               status = "okay";
+       };
+
+       lcd_display: display@di0 {
+               compatible = "fsl,imx-parallel-display";
+               #address-cells = <1>;
+               #size-cells = <0>;
+               interface-pix-fmt = "bgr666";
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_j15>;
+               status = "okay";
+
+               port@0 {
+                       reg = <0>;
+
+                       lcd_display_in: endpoint {
+                               remote-endpoint = <&ipu1_di0_disp0>;
+                       };
+               };
+
+               port@1 {
+                       reg = <1>;
+
+                       lcd_display_out: endpoint {
+                               remote-endpoint = <&lcd_panel_in>;
+                       };
+               };
+       };
+
+       panel_lcd {
+               compatible = "okaya,rs800480t-7x0gp";
+               backlight = <&backlight_lcd>;
+
+               port {
+                       lcd_panel_in: endpoint {
+                               remote-endpoint = <&lcd_display_out>;
+                       };
+               };
+       };
+
+       panel_lvds0 {
+               compatible = "hannstar,hsd100pxn1";
+               backlight = <&backlight_lvds0>;
+
+               port {
+                       panel_in_lvds0: endpoint {
+                               remote-endpoint = <&lvds0_out>;
+                       };
+               };
+       };
+
+       panel_lvds1 {
+               compatible = "hannstar,hsd100pxn1";
+               backlight = <&backlight_lvds1>;
+
+               port {
+                       panel_in_lvds1: endpoint {
+                               remote-endpoint = <&lvds1_out>;
+                       };
+               };
+       };
+
+       sound {
+               compatible = "fsl,imx6q-nitrogen6_max-sgtl5000",
+                            "fsl,imx-audio-sgtl5000";
+               model = "imx6q-nitrogen6_max-sgtl5000";
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_sgtl5000>;
+               ssi-controller = <&ssi1>;
+               audio-codec = <&codec>;
+               audio-routing =
+                       "MIC_IN", "Mic Jack",
+                       "Mic Jack", "Mic Bias",
+                       "Headphone Jack", "HP_OUT";
+               mux-int-port = <1>;
+               mux-ext-port = <3>;
+       };
+};
+
+&audmux {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_audmux>;
+       status = "okay";
+};
+
+&can1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_can1>;
+       xceiver-supply = <&reg_can_xcvr>;
+       status = "okay";
+};
+
+&clks {
+       assigned-clocks = <&clks IMX6QDL_CLK_LDB_DI0_SEL>,
+                         <&clks IMX6QDL_CLK_LDB_DI1_SEL>;
+       assigned-clock-parents = <&clks IMX6QDL_CLK_PLL3_USB_OTG>,
+                                <&clks IMX6QDL_CLK_PLL3_USB_OTG>;
+};
+
+&ecspi1 {
+       fsl,spi-num-chipselects = <1>;
+       cs-gpios = <&gpio3 19 GPIO_ACTIVE_HIGH>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_ecspi1>;
+       status = "okay";
+
+       flash: m25p80@0 {
+               compatible = "microchip,sst25vf016b";
+               spi-max-frequency = <20000000>;
+               reg = <0>;
+       };
+};
+
+&fec {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_enet>;
+       phy-mode = "rgmii";
+       phy-reset-gpios = <&gpio1 27 GPIO_ACTIVE_LOW>;
+       txen-skew-ps = <0>;
+       txc-skew-ps = <3000>;
+       rxdv-skew-ps = <0>;
+       rxc-skew-ps = <3000>;
+       rxd0-skew-ps = <0>;
+       rxd1-skew-ps = <0>;
+       rxd2-skew-ps = <0>;
+       rxd3-skew-ps = <0>;
+       txd0-skew-ps = <0>;
+       txd1-skew-ps = <0>;
+       txd2-skew-ps = <0>;
+       txd3-skew-ps = <0>;
+       interrupts-extended = <&gpio1 6 IRQ_TYPE_LEVEL_HIGH>,
+                             <&intc 0 119 IRQ_TYPE_LEVEL_HIGH>;
+       status = "okay";
+};
+
+&hdmi {
+       ddc-i2c-bus = <&i2c2>;
+       status = "okay";
+};
+
+&i2c1 {
+       clock-frequency = <100000>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_i2c1>;
+       status = "okay";
+
+       codec: sgtl5000@0a {
+               compatible = "fsl,sgtl5000";
+               reg = <0x0a>;
+               clocks = <&clks 201>;
+               VDDA-supply = <&reg_2p5v>;
+               VDDIO-supply = <&reg_3p3v>;
+       };
+
+       rtc: rtc@68 {
+               compatible = "st,rv4162";
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_rv4162>;
+               reg = <0x68>;
+               interrupts-extended = <&gpio4 6 IRQ_TYPE_LEVEL_LOW>;
+       };
+};
+
+&i2c2 {
+       clock-frequency = <100000>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_i2c2>;
+       status = "okay";
+};
+
+&i2c3 {
+       clock-frequency = <100000>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_i2c3>;
+       status = "okay";
+
+       touchscreen@04 {
+               compatible = "eeti,egalax_ts";
+               reg = <0x04>;
+               interrupt-parent = <&gpio1>;
+               interrupts = <9 IRQ_TYPE_EDGE_FALLING>;
+               wakeup-gpios = <&gpio1 9 GPIO_ACTIVE_LOW>;
+       };
+
+       touchscreen@38 {
+               compatible = "edt,edt-ft5x06";
+               reg = <0x38>;
+               interrupt-parent = <&gpio1>;
+               interrupts = <9 IRQ_TYPE_EDGE_FALLING>;
+       };
+};
+
+&iomuxc {
+       imx6q-nitrogen6_max {
+               pinctrl_audmux: audmuxgrp {
+                       fsl,pins = <
+                               MX6QDL_PAD_CSI0_DAT7__AUD3_RXD          0x130b0
+                               MX6QDL_PAD_CSI0_DAT4__AUD3_TXC          0x130b0
+                               MX6QDL_PAD_CSI0_DAT5__AUD3_TXD          0x110b0
+                               MX6QDL_PAD_CSI0_DAT6__AUD3_TXFS         0x130b0
+                       >;
+               };
+
+               pinctrl_can1: can1grp {
+                       fsl,pins = <
+                               MX6QDL_PAD_KEY_COL2__FLEXCAN1_TX        0x1b0b0
+                               MX6QDL_PAD_KEY_ROW2__FLEXCAN1_RX        0x1b0b0
+                       >;
+               };
+
+               pinctrl_can_xcvr: can-xcvrgrp {
+                       fsl,pins = <
+                               /* Flexcan XCVR enable */
+                               MX6QDL_PAD_GPIO_2__GPIO1_IO02           0x1b0b0
+                       >;
+               };
+
+               pinctrl_ecspi1: ecspi1grp {
+                       fsl,pins = <
+                               MX6QDL_PAD_EIM_D17__ECSPI1_MISO         0x100b1
+                               MX6QDL_PAD_EIM_D18__ECSPI1_MOSI         0x100b1
+                               MX6QDL_PAD_EIM_D16__ECSPI1_SCLK         0x100b1
+                               MX6QDL_PAD_EIM_D19__GPIO3_IO19          0x000b1
+                       >;
+               };
+
+               pinctrl_enet: enetgrp {
+                       fsl,pins = <
+                               MX6QDL_PAD_ENET_MDIO__ENET_MDIO         0x100b0
+                               MX6QDL_PAD_ENET_MDC__ENET_MDC           0x100b0
+                               MX6QDL_PAD_RGMII_TXC__RGMII_TXC         0x100b0
+                               MX6QDL_PAD_RGMII_TD0__RGMII_TD0         0x100b0
+                               MX6QDL_PAD_RGMII_TD1__RGMII_TD1         0x100b0
+                               MX6QDL_PAD_RGMII_TD2__RGMII_TD2         0x100b0
+                               MX6QDL_PAD_RGMII_TD3__RGMII_TD3         0x100b0
+                               MX6QDL_PAD_RGMII_TX_CTL__RGMII_TX_CTL   0x100b0
+                               MX6QDL_PAD_ENET_REF_CLK__ENET_TX_CLK    0x100b0
+                               MX6QDL_PAD_RGMII_RXC__RGMII_RXC         0x1b0b0
+                               MX6QDL_PAD_RGMII_RD0__RGMII_RD0         0x1b0b0
+                               MX6QDL_PAD_RGMII_RD1__RGMII_RD1         0x1b0b0
+                               MX6QDL_PAD_RGMII_RD2__RGMII_RD2         0x1b0b0
+                               MX6QDL_PAD_RGMII_RD3__RGMII_RD3         0x1b0b0
+                               MX6QDL_PAD_RGMII_RX_CTL__RGMII_RX_CTL   0x1b0b0
+                               /* Phy reset */
+                               MX6QDL_PAD_ENET_RXD0__GPIO1_IO27        0x0f0b0
+                               MX6QDL_PAD_ENET_TX_EN__GPIO1_IO28       0x1b0b0
+                               MX6QDL_PAD_GPIO_6__ENET_IRQ             0x000b1
+                       >;
+               };
+
+               pinctrl_gpio_keys: gpio_keysgrp {
+                       fsl,pins = <
+                               /* Power Button */
+                               MX6QDL_PAD_NANDF_D3__GPIO2_IO03         0x1b0b0
+                               /* Menu Button */
+                               MX6QDL_PAD_NANDF_D1__GPIO2_IO01         0x1b0b0
+                               /* Home Button */
+                               MX6QDL_PAD_NANDF_D4__GPIO2_IO04         0x1b0b0
+                               /* Back Button */
+                               MX6QDL_PAD_NANDF_D2__GPIO2_IO02         0x1b0b0
+                               /* Volume Up Button */
+                               MX6QDL_PAD_GPIO_18__GPIO7_IO13          0x1b0b0
+                               /* Volume Down Button */
+                               MX6QDL_PAD_SD3_DAT4__GPIO7_IO01         0x1b0b0
+                       >;
+               };
+
+               pinctrl_i2c1: i2c1grp {
+                       fsl,pins = <
+                               MX6QDL_PAD_EIM_D21__I2C1_SCL    0x4001b8b1
+                               MX6QDL_PAD_EIM_D28__I2C1_SDA    0x4001b8b1
+                       >;
+               };
+
+               pinctrl_i2c2: i2c2grp {
+                       fsl,pins = <
+                               MX6QDL_PAD_KEY_COL3__I2C2_SCL   0x4001b8b1
+                               MX6QDL_PAD_KEY_ROW3__I2C2_SDA   0x4001b8b1
+                       >;
+               };
+
+               pinctrl_i2c2mux: i2c2muxgrp {
+                       fsl,pins = <
+                               /* ov5642 camera i2c enable */
+                               MX6QDL_PAD_EIM_D20__GPIO3_IO20  0x000b0
+                               /* ov5640_mipi camera i2c enable */
+                               MX6QDL_PAD_KEY_ROW4__GPIO4_IO15 0x000b0
+                       >;
+               };
+
+               pinctrl_i2c3: i2c3grp {
+                       fsl,pins = <
+                               MX6QDL_PAD_GPIO_5__I2C3_SCL     0x4001b8b1
+                               MX6QDL_PAD_GPIO_16__I2C3_SDA    0x4001b8b1
+                               MX6QDL_PAD_GPIO_9__GPIO1_IO09   0x1b0b0
+                       >;
+               };
+
+               pinctrl_i2c3mux: i2c3muxgrp {
+                       fsl,pins = <
+                               /* PCIe I2C enable */
+                               MX6QDL_PAD_EIM_OE__GPIO2_IO25   0x000b0
+                       >;
+               };
+
+               pinctrl_j15: j15grp {
+                       fsl,pins = <
+                               MX6QDL_PAD_DI0_DISP_CLK__IPU1_DI0_DISP_CLK 0x10
+                               MX6QDL_PAD_DI0_PIN15__IPU1_DI0_PIN15       0x10
+                               MX6QDL_PAD_DI0_PIN2__IPU1_DI0_PIN02        0x10
+                               MX6QDL_PAD_DI0_PIN3__IPU1_DI0_PIN03        0x10
+                               MX6QDL_PAD_DISP0_DAT0__IPU1_DISP0_DATA00   0x10
+                               MX6QDL_PAD_DISP0_DAT1__IPU1_DISP0_DATA01   0x10
+                               MX6QDL_PAD_DISP0_DAT2__IPU1_DISP0_DATA02   0x10
+                               MX6QDL_PAD_DISP0_DAT3__IPU1_DISP0_DATA03   0x10
+                               MX6QDL_PAD_DISP0_DAT4__IPU1_DISP0_DATA04   0x10
+                               MX6QDL_PAD_DISP0_DAT5__IPU1_DISP0_DATA05   0x10
+                               MX6QDL_PAD_DISP0_DAT6__IPU1_DISP0_DATA06   0x10
+                               MX6QDL_PAD_DISP0_DAT7__IPU1_DISP0_DATA07   0x10
+                               MX6QDL_PAD_DISP0_DAT8__IPU1_DISP0_DATA08   0x10
+                               MX6QDL_PAD_DISP0_DAT9__IPU1_DISP0_DATA09   0x10
+                               MX6QDL_PAD_DISP0_DAT10__IPU1_DISP0_DATA10  0x10
+                               MX6QDL_PAD_DISP0_DAT11__IPU1_DISP0_DATA11  0x10
+                               MX6QDL_PAD_DISP0_DAT12__IPU1_DISP0_DATA12  0x10
+                               MX6QDL_PAD_DISP0_DAT13__IPU1_DISP0_DATA13  0x10
+                               MX6QDL_PAD_DISP0_DAT14__IPU1_DISP0_DATA14  0x10
+                               MX6QDL_PAD_DISP0_DAT15__IPU1_DISP0_DATA15  0x10
+                               MX6QDL_PAD_DISP0_DAT16__IPU1_DISP0_DATA16  0x10
+                               MX6QDL_PAD_DISP0_DAT17__IPU1_DISP0_DATA17  0x10
+                               MX6QDL_PAD_DISP0_DAT18__IPU1_DISP0_DATA18  0x10
+                               MX6QDL_PAD_DISP0_DAT19__IPU1_DISP0_DATA19  0x10
+                               MX6QDL_PAD_DISP0_DAT20__IPU1_DISP0_DATA20  0x10
+                               MX6QDL_PAD_DISP0_DAT21__IPU1_DISP0_DATA21  0x10
+                               MX6QDL_PAD_DISP0_DAT22__IPU1_DISP0_DATA22  0x10
+                               MX6QDL_PAD_DISP0_DAT23__IPU1_DISP0_DATA23  0x10
+                       >;
+               };
+
+               pinctrl_pcie: pciegrp {
+                       fsl,pins = <
+                               /* PCIe reset */
+                               MX6QDL_PAD_EIM_BCLK__GPIO6_IO31 0x000b0
+                       >;
+               };
+
+               pinctrl_pwm1: pwm1grp {
+                       fsl,pins = <
+                               MX6QDL_PAD_SD1_DAT3__PWM1_OUT   0x1b0b1
+                       >;
+               };
+
+               pinctrl_pwm2: pwm2grp {
+                       fsl,pins = <
+                               MX6QDL_PAD_SD1_DAT2__PWM2_OUT   0x1b0b1
+                       >;
+               };
+
+               pinctrl_pwm3: pwm3grp {
+                       fsl,pins = <
+                               MX6QDL_PAD_SD1_DAT1__PWM3_OUT   0x1b0b1
+                       >;
+               };
+
+               pinctrl_pwm4: pwm4grp {
+                       fsl,pins = <
+                               MX6QDL_PAD_SD1_CMD__PWM4_OUT    0x1b0b1
+                       >;
+               };
+
+               pinctrl_rv4162: rv4162grp {
+                       fsl,pins = <
+                               MX6QDL_PAD_KEY_COL0__GPIO4_IO06 0x1b0b0
+                       >;
+               };
+
+               pinctrl_sgtl5000: sgtl5000grp {
+                       fsl,pins = <
+                               MX6QDL_PAD_GPIO_0__CCM_CLKO1            0x000b0
+                               MX6QDL_PAD_EIM_A25__GPIO5_IO02          0x1b0b0
+                               MX6QDL_PAD_ENET_TXD1__GPIO1_IO29        0x1b0b0
+                       >;
+               };
+
+               pinctrl_uart1: uart1grp {
+                       fsl,pins = <
+                               MX6QDL_PAD_SD3_DAT7__UART1_TX_DATA      0x1b0b1
+                               MX6QDL_PAD_SD3_DAT6__UART1_RX_DATA      0x1b0b1
+                       >;
+               };
+
+               pinctrl_uart2: uart2grp {
+                       fsl,pins = <
+                               MX6QDL_PAD_EIM_D26__UART2_TX_DATA       0x1b0b1
+                               MX6QDL_PAD_EIM_D27__UART2_RX_DATA       0x1b0b1
+                       >;
+               };
+
+               pinctrl_uart5: uart5grp {
+                       fsl,pins = <
+                               MX6QDL_PAD_KEY_ROW1__UART5_RX_DATA      0x130b1
+                               MX6QDL_PAD_KEY_COL1__UART5_TX_DATA      0x030b1
+                               /* RS485 RX Enable: pull up */
+                               MX6QDL_PAD_NANDF_RB0__GPIO6_IO10        0x1b0b1
+                               /* RS485 DEN: pull down */
+                               MX6QDL_PAD_NANDF_CLE__GPIO6_IO07        0x030b1
+                               /* RS485/!RS232 Select: pull down (rs232) */
+                               MX6QDL_PAD_EIM_CS1__GPIO2_IO24          0x030b1
+                               /* ON: pull down */
+                               MX6QDL_PAD_NANDF_ALE__GPIO6_IO08        0x030b1
+                       >;
+               };
+
+               pinctrl_usbh1: usbh1grp {
+                       fsl,pins = <
+                               MX6QDL_PAD_GPIO_17__GPIO7_IO12          0x0b0b0
+                       >;
+               };
+
+               pinctrl_usbotg: usbotggrp {
+                       fsl,pins = <
+                               MX6QDL_PAD_GPIO_1__USB_OTG_ID           0x17059
+                               MX6QDL_PAD_KEY_COL4__USB_OTG_OC         0x1b0b0
+                               /* power enable, high active */
+                               MX6QDL_PAD_EIM_D22__GPIO3_IO22          0x000b0
+                       >;
+               };
+
+               pinctrl_usdhc2: usdhc2grp {
+                       fsl,pins = <
+                               MX6QDL_PAD_SD2_CMD__SD2_CMD             0x17059
+                               MX6QDL_PAD_SD2_CLK__SD2_CLK             0x10059
+                               MX6QDL_PAD_SD2_DAT0__SD2_DATA0          0x17059
+                               MX6QDL_PAD_SD2_DAT1__SD2_DATA1          0x17059
+                               MX6QDL_PAD_SD2_DAT2__SD2_DATA2          0x17059
+                               MX6QDL_PAD_SD2_DAT3__SD2_DATA3          0x17059
+                       >;
+               };
+
+               pinctrl_usdhc3: usdhc3grp {
+                       fsl,pins = <
+                               MX6QDL_PAD_SD3_CMD__SD3_CMD             0x17059
+                               MX6QDL_PAD_SD3_CLK__SD3_CLK             0x10059
+                               MX6QDL_PAD_SD3_DAT0__SD3_DATA0          0x17059
+                               MX6QDL_PAD_SD3_DAT1__SD3_DATA1          0x17059
+                               MX6QDL_PAD_SD3_DAT2__SD3_DATA2          0x17059
+                               MX6QDL_PAD_SD3_DAT3__SD3_DATA3          0x17059
+                               MX6QDL_PAD_NANDF_CS1__SD3_VSELECT       0x100b0
+                               MX6QDL_PAD_SD3_DAT5__GPIO7_IO00         0x1b0b0
+                       >;
+               };
+
+               pinctrl_usdhc4: usdhc4grp {
+                       fsl,pins = <
+                               MX6QDL_PAD_SD4_CMD__SD4_CMD             0x17059
+                               MX6QDL_PAD_SD4_CLK__SD4_CLK             0x10059
+                               MX6QDL_PAD_SD4_DAT0__SD4_DATA0          0x17059
+                               MX6QDL_PAD_SD4_DAT1__SD4_DATA1          0x17059
+                               MX6QDL_PAD_SD4_DAT2__SD4_DATA2          0x17059
+                               MX6QDL_PAD_SD4_DAT3__SD4_DATA3          0x17059
+                               MX6QDL_PAD_SD4_DAT4__SD4_DATA4          0x17059
+                               MX6QDL_PAD_SD4_DAT5__SD4_DATA5          0x17059
+                               MX6QDL_PAD_SD4_DAT6__SD4_DATA6          0x17059
+                               MX6QDL_PAD_SD4_DAT7__SD4_DATA7          0x17059
+                       >;
+               };
+
+               pinctrl_wlan_vmmc: wlan_vmmcgrp {
+                       fsl,pins = <
+                               MX6QDL_PAD_NANDF_CS0__GPIO6_IO11        0x100b0
+                               MX6QDL_PAD_NANDF_CS2__GPIO6_IO15        0x000b0
+                               MX6QDL_PAD_NANDF_CS3__GPIO6_IO16        0x000b0
+                               MX6QDL_PAD_SD1_CLK__OSC32K_32K_OUT      0x000b0
+                       >;
+               };
+       };
+};
+
+&ipu1_di0_disp0 {
+       remote-endpoint = <&lcd_display_in>;
+};
+
+&ldb {
+       status = "okay";
+
+       lvds-channel@0 {
+               fsl,data-mapping = "spwg";
+               fsl,data-width = <18>;
+               status = "okay";
+
+               port@4 {
+                       reg = <4>;
+
+                       lvds0_out: endpoint {
+                               remote-endpoint = <&panel_in_lvds0>;
+                       };
+               };
+       };
+
+       lvds-channel@1 {
+               fsl,data-mapping = "spwg";
+               fsl,data-width = <18>;
+               status = "okay";
+
+               port@4 {
+                       reg = <4>;
+
+                       lvds1_out: endpoint {
+                               remote-endpoint = <&panel_in_lvds1>;
+                       };
+               };
+       };
+};
+
+&pcie {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_pcie>;
+       reset-gpio = <&gpio6 31 GPIO_ACTIVE_LOW>;
+       status = "okay";
+};
+
+&pwm1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_pwm1>;
+       status = "okay";
+};
+
+&pwm2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_pwm2>;
+       status = "okay";
+};
+
+&pwm3 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_pwm3>;
+       status = "okay";
+};
+
+&pwm4 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_pwm4>;
+       status = "okay";
+};
+
+&ssi1 {
+       status = "okay";
+};
+
+&uart1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_uart1>;
+       status = "okay";
+};
+
+&uart2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_uart2>;
+       status = "okay";
+};
+
+&uart5 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_uart5>;
+       status = "okay";
+};
+
+&usbh1 {
+       vbus-supply = <&reg_usb_h1_vbus>;
+       status = "okay";
+};
+
+&usbotg {
+       vbus-supply = <&reg_usb_otg_vbus>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_usbotg>;
+       disable-over-current;
+       status = "okay";
+};
+
+&usdhc2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_usdhc2>;
+       bus-width = <4>;
+       non-removable;
+       vmmc-supply = <&reg_wlan_vmmc>;
+       cap-power-off-card;
+       keep-power-in-suspend;
+       status = "okay";
+
+       #address-cells = <1>;
+       #size-cells = <0>;
+       wlcore: wlcore@2 {
+               compatible = "ti,wl1271";
+               reg = <2>;
+               interrupt-parent = <&gpio6>;
+               interrupts = <11 IRQ_TYPE_LEVEL_HIGH>;
+               ref-clock-frequency = <38400000>;
+       };
+};
+
+&usdhc3 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_usdhc3>;
+       cd-gpios = <&gpio7 0 GPIO_ACTIVE_LOW>;
+       bus-width = <4>;
+       vmmc-supply = <&reg_3p3v>;
+       status = "okay";
+};
+
+&usdhc4 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_usdhc4>;
+       bus-width = <8>;
+       non-removable;
+       vmmc-supply = <&reg_1p8v>;
+       keep-power-in-suspend;
+       status = "okay";
+};
index 340bc8e4265058c6165bb76640f3fe747d2a65c2..caeed56b74a391ae996b877dea9b0a325a14ff42 100644 (file)
@@ -3,12 +3,42 @@
  * Copyright 2011 Freescale Semiconductor, Inc.
  * Copyright 2011 Linaro Ltd.
  *
- * The code contained herein is licensed under the GNU General Public
- * License. You may obtain a copy of the GNU General Public License
- * Version 2 or later at the following locations:
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
  *
- * http://www.opensource.org/licenses/gpl-license.html
- * http://www.gnu.org/copyleft/gpl.html
+ *  a) This file 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.
+ *
+ *     This file is distributed in the hope that it will be useful
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ * Or, alternatively
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
  */
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
                        pinctrl-0 = <&pinctrl_can_xcvr>;
                        gpio = <&gpio1 2 GPIO_ACTIVE_LOW>;
                };
+
+               reg_wlan_vmmc: regulator@4 {
+                       compatible = "regulator-fixed";
+                       reg = <4>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&pinctrl_wlan_vmmc>;
+                       regulator-name = "reg_wlan_vmmc";
+                       regulator-min-microvolt = <3300000>;
+                       regulator-max-microvolt = <3300000>;
+                       gpio = <&gpio6 15 GPIO_ACTIVE_HIGH>;
+                       startup-delay-us = <70000>;
+                       enable-active-high;
+               };
        };
 
        gpio-keys {
                mux-ext-port = <3>;
        };
 
-       backlight_lcd {
+       backlight_lcd: backlight_lcd {
                compatible = "pwm-backlight";
                pwms = <&pwm1 0 5000000>;
                brightness-levels = <0 4 8 16 32 64 128 255>;
                status = "okay";
        };
 
+       lcd_display: display@di0 {
+               compatible = "fsl,imx-parallel-display";
+               #address-cells = <1>;
+               #size-cells = <0>;
+               interface-pix-fmt = "bgr666";
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_j15>;
+               status = "okay";
+
+               port@0 {
+                       reg = <0>;
+
+                       lcd_display_in: endpoint {
+                               remote-endpoint = <&ipu1_di0_disp0>;
+                       };
+               };
+
+               port@1 {
+                       reg = <1>;
+
+                       lcd_display_out: endpoint {
+                               remote-endpoint = <&lcd_panel_in>;
+                       };
+               };
+       };
+
+       lcd_panel {
+               compatible = "okaya,rs800480t-7x0gp";
+               backlight = <&backlight_lcd>;
+
+               port {
+                       lcd_panel_in: endpoint {
+                               remote-endpoint = <&lcd_display_out>;
+                       };
+               };
+       };
+
        panel {
                compatible = "hannstar,hsd100pxn1";
                backlight = <&backlight_lvds>;
        status = "okay";
 
        flash: m25p80@0 {
-               compatible = "sst,sst25vf016b";
+               compatible = "sst,sst25vf016b", "jedec,spi-nor";
                spi-max-frequency = <20000000>;
                reg = <0>;
        };
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_i2c3>;
        status = "okay";
+
+       touchscreen@04 {
+               compatible = "eeti,egalax_ts";
+               reg = <0x04>;
+               interrupt-parent = <&gpio1>;
+               interrupts = <9 IRQ_TYPE_EDGE_FALLING>;
+               wakeup-gpios = <&gpio1 9 GPIO_ACTIVE_LOW>;
+       };
+
+       touchscreen@38 {
+               compatible = "edt,edt-ft5x06";
+               reg = <0x38>;
+               interrupt-parent = <&gpio1>;
+               interrupts = <9 IRQ_TYPE_EDGE_FALLING>;
+       };
 };
 
 &iomuxc {
                        fsl,pins = <
                                /* SGTL5000 sys_mclk */
                                MX6QDL_PAD_GPIO_0__CCM_CLKO1    0x030b0
+                               MX6QDL_PAD_GPIO_9__GPIO1_IO09   0x1b0b0
                        >;
                };
 
                        >;
                };
 
+               pinctrl_j15: j15grp {
+                       fsl,pins = <
+                               MX6QDL_PAD_DI0_DISP_CLK__IPU1_DI0_DISP_CLK 0x10
+                               MX6QDL_PAD_DI0_PIN15__IPU1_DI0_PIN15       0x10
+                               MX6QDL_PAD_DI0_PIN2__IPU1_DI0_PIN02        0x10
+                               MX6QDL_PAD_DI0_PIN3__IPU1_DI0_PIN03        0x10
+                               MX6QDL_PAD_DISP0_DAT0__IPU1_DISP0_DATA00   0x10
+                               MX6QDL_PAD_DISP0_DAT1__IPU1_DISP0_DATA01   0x10
+                               MX6QDL_PAD_DISP0_DAT2__IPU1_DISP0_DATA02   0x10
+                               MX6QDL_PAD_DISP0_DAT3__IPU1_DISP0_DATA03   0x10
+                               MX6QDL_PAD_DISP0_DAT4__IPU1_DISP0_DATA04   0x10
+                               MX6QDL_PAD_DISP0_DAT5__IPU1_DISP0_DATA05   0x10
+                               MX6QDL_PAD_DISP0_DAT6__IPU1_DISP0_DATA06   0x10
+                               MX6QDL_PAD_DISP0_DAT7__IPU1_DISP0_DATA07   0x10
+                               MX6QDL_PAD_DISP0_DAT8__IPU1_DISP0_DATA08   0x10
+                               MX6QDL_PAD_DISP0_DAT9__IPU1_DISP0_DATA09   0x10
+                               MX6QDL_PAD_DISP0_DAT10__IPU1_DISP0_DATA10  0x10
+                               MX6QDL_PAD_DISP0_DAT11__IPU1_DISP0_DATA11  0x10
+                               MX6QDL_PAD_DISP0_DAT12__IPU1_DISP0_DATA12  0x10
+                               MX6QDL_PAD_DISP0_DAT13__IPU1_DISP0_DATA13  0x10
+                               MX6QDL_PAD_DISP0_DAT14__IPU1_DISP0_DATA14  0x10
+                               MX6QDL_PAD_DISP0_DAT15__IPU1_DISP0_DATA15  0x10
+                               MX6QDL_PAD_DISP0_DAT16__IPU1_DISP0_DATA16  0x10
+                               MX6QDL_PAD_DISP0_DAT17__IPU1_DISP0_DATA17  0x10
+                               MX6QDL_PAD_DISP0_DAT18__IPU1_DISP0_DATA18  0x10
+                               MX6QDL_PAD_DISP0_DAT19__IPU1_DISP0_DATA19  0x10
+                               MX6QDL_PAD_DISP0_DAT20__IPU1_DISP0_DATA20  0x10
+                               MX6QDL_PAD_DISP0_DAT21__IPU1_DISP0_DATA21  0x10
+                               MX6QDL_PAD_DISP0_DAT22__IPU1_DISP0_DATA22  0x10
+                               MX6QDL_PAD_DISP0_DAT23__IPU1_DISP0_DATA23  0x10
+                       >;
+               };
+
                pinctrl_pwm1: pwm1grp {
                        fsl,pins = <
                                MX6QDL_PAD_SD1_DAT3__PWM1_OUT 0x1b0b1
                        >;
                };
 
+               pinctrl_usdhc2: usdhc2grp {
+                       fsl,pins = <
+                               MX6QDL_PAD_SD2_CMD__SD2_CMD             0x17071
+                               MX6QDL_PAD_SD2_CLK__SD2_CLK             0x10071
+                               MX6QDL_PAD_SD2_DAT0__SD2_DATA0          0x17071
+                               MX6QDL_PAD_SD2_DAT1__SD2_DATA1          0x17071
+                               MX6QDL_PAD_SD2_DAT2__SD2_DATA2          0x17071
+                               MX6QDL_PAD_SD2_DAT3__SD2_DATA3          0x17071
+                               MX6QDL_PAD_NANDF_CS2__GPIO6_IO15        0x000b0
+                       >;
+               };
+
                pinctrl_usdhc3: usdhc3grp {
                        fsl,pins = <
                                MX6QDL_PAD_SD3_CMD__SD3_CMD             0x17059
                                MX6QDL_PAD_NANDF_D6__GPIO2_IO06 0x1b0b0 /* CD */
                        >;
                };
+
+               pinctrl_wlan_vmmc: wlan_vmmcgrp {
+                       fsl,pins = <
+                               MX6QDL_PAD_NANDF_CS0__GPIO6_IO11        0x100b0
+                               MX6QDL_PAD_NANDF_CS2__GPIO6_IO15        0x000b0
+                               MX6QDL_PAD_NANDF_CS3__GPIO6_IO16        0x000b0
+                               MX6QDL_PAD_SD1_CLK__OSC32K_32K_OUT      0x000b0
+                       >;
+               };
        };
 };
 
+&ipu1_di0_disp0 {
+       remote-endpoint = <&lcd_display_in>;
+};
+
 &ldb {
        status = "okay";
 
        status = "okay";
 };
 
+&usdhc2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_usdhc2>;
+       bus-width = <4>;
+       non-removable;
+       vmmc-supply = <&reg_wlan_vmmc>;
+       cap-power-off-card;
+       keep-power-in-suspend;
+       status = "okay";
+
+       #address-cells = <1>;
+       #size-cells = <0>;
+       wlcore: wlcore@2 {
+               compatible = "ti,wl1271";
+               reg = <2>;
+               interrupt-parent = <&gpio6>;
+               interrupts = <14 IRQ_TYPE_LEVEL_HIGH>;
+               ref-clock-frequency = <38400000>;
+       };
+};
+
 &usdhc3 {
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_usdhc3>;
index 9e6ecd99b472dbcb5ce707048fc4fb4775a25a77..d6d98d4263847e1ec6429d1a88fc2de40ebd36d0 100644 (file)
@@ -12,7 +12,7 @@
 #include <dt-bindings/gpio/gpio.h>
 
 / {
-       model = "Phytec phyFLEX-i.MX6 Ouad";
+       model = "Phytec phyFLEX-i.MX6 Quad";
        compatible = "phytec,imx6q-pfla02", "fsl,imx6q";
 
        memory {
@@ -80,7 +80,7 @@
        cs-gpios = <&gpio4 24 0>;
 
        flash@0 {
-               compatible = "m25p80";
+               compatible = "m25p80", "jedec,spi-nor";
                spi-max-frequency = <20000000>;
                reg = <0>;
        };
 };
 
 &pcie {
-       pinctrl-name = "default";
+       pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_pcie>;
        reset-gpio = <&gpio4 17 0>;
        status = "disabled";
index c37bb9ff9fac51c089845ec687594152a6a6840d..8263fc18a7d95ff88b470ae57fd5e2e89036f99f 100644 (file)
        flash: m25p80@0 {
                #address-cells = <1>;
                #size-cells = <1>;
-               compatible = "st,m25p32";
+               compatible = "st,m25p32", "jedec,spi-nor";
                spi-max-frequency = <20000000>;
                reg = <0>;
        };
index ce4c7313f5091617bd82836a1033a92de0feb1f6..1a69a3420ac8d14a8977a7f8d862decb546f87bd 100644 (file)
@@ -2,12 +2,42 @@
  * Copyright 2011 Freescale Semiconductor, Inc.
  * Copyright 2011 Linaro Ltd.
  *
- * The code contained herein is licensed under the GNU General Public
- * License. You may obtain a copy of the GNU General Public License
- * Version 2 or later at the following locations:
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
  *
- * http://www.opensource.org/licenses/gpl-license.html
- * http://www.gnu.org/copyleft/gpl.html
+ *  a) This file 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.
+ *
+ *     This file is distributed in the hope that it will be useful
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ * Or, alternatively
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
  */
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
                mux-ext-port = <4>;
        };
 
-       backlight_lcd {
+       backlight_lcd: backlight_lcd {
                compatible = "pwm-backlight";
                pwms = <&pwm1 0 5000000>;
                brightness-levels = <0 4 8 16 32 64 128 255>;
                status = "okay";
        };
 
+       lcd_display: display@di0 {
+               compatible = "fsl,imx-parallel-display";
+               #address-cells = <1>;
+               #size-cells = <0>;
+               interface-pix-fmt = "bgr666";
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_j15>;
+               status = "okay";
+
+               port@0 {
+                       reg = <0>;
+
+                       lcd_display_in: endpoint {
+                               remote-endpoint = <&ipu1_di0_disp0>;
+                       };
+               };
+
+               port@1 {
+                       reg = <1>;
+
+                       lcd_display_out: endpoint {
+                               remote-endpoint = <&lcd_panel_in>;
+                       };
+               };
+       };
+
+       lcd_panel {
+               compatible = "okaya,rs800480t-7x0gp";
+               backlight = <&backlight_lcd>;
+
+               port {
+                       lcd_panel_in: endpoint {
+                               remote-endpoint = <&lcd_display_out>;
+                       };
+               };
+       };
+
        panel {
                compatible = "hannstar,hsd100pxn1";
                backlight = <&backlight_lvds>;
        status = "okay";
 
        flash: m25p80@0 {
-               compatible = "sst,sst25vf016b";
+               compatible = "sst,sst25vf016b", "jedec,spi-nor";
                spi-max-frequency = <20000000>;
                reg = <0>;
        };
                        >;
                };
 
+               pinctrl_j15: j15grp {
+                       fsl,pins = <
+                               MX6QDL_PAD_DI0_DISP_CLK__IPU1_DI0_DISP_CLK 0x10
+                               MX6QDL_PAD_DI0_PIN15__IPU1_DI0_PIN15       0x10
+                               MX6QDL_PAD_DI0_PIN2__IPU1_DI0_PIN02        0x10
+                               MX6QDL_PAD_DI0_PIN3__IPU1_DI0_PIN03        0x10
+                               MX6QDL_PAD_DISP0_DAT0__IPU1_DISP0_DATA00   0x10
+                               MX6QDL_PAD_DISP0_DAT1__IPU1_DISP0_DATA01   0x10
+                               MX6QDL_PAD_DISP0_DAT2__IPU1_DISP0_DATA02   0x10
+                               MX6QDL_PAD_DISP0_DAT3__IPU1_DISP0_DATA03   0x10
+                               MX6QDL_PAD_DISP0_DAT4__IPU1_DISP0_DATA04   0x10
+                               MX6QDL_PAD_DISP0_DAT5__IPU1_DISP0_DATA05   0x10
+                               MX6QDL_PAD_DISP0_DAT6__IPU1_DISP0_DATA06   0x10
+                               MX6QDL_PAD_DISP0_DAT7__IPU1_DISP0_DATA07   0x10
+                               MX6QDL_PAD_DISP0_DAT8__IPU1_DISP0_DATA08   0x10
+                               MX6QDL_PAD_DISP0_DAT9__IPU1_DISP0_DATA09   0x10
+                               MX6QDL_PAD_DISP0_DAT10__IPU1_DISP0_DATA10  0x10
+                               MX6QDL_PAD_DISP0_DAT11__IPU1_DISP0_DATA11  0x10
+                               MX6QDL_PAD_DISP0_DAT12__IPU1_DISP0_DATA12  0x10
+                               MX6QDL_PAD_DISP0_DAT13__IPU1_DISP0_DATA13  0x10
+                               MX6QDL_PAD_DISP0_DAT14__IPU1_DISP0_DATA14  0x10
+                               MX6QDL_PAD_DISP0_DAT15__IPU1_DISP0_DATA15  0x10
+                               MX6QDL_PAD_DISP0_DAT16__IPU1_DISP0_DATA16  0x10
+                               MX6QDL_PAD_DISP0_DAT17__IPU1_DISP0_DATA17  0x10
+                               MX6QDL_PAD_DISP0_DAT18__IPU1_DISP0_DATA18  0x10
+                               MX6QDL_PAD_DISP0_DAT19__IPU1_DISP0_DATA19  0x10
+                               MX6QDL_PAD_DISP0_DAT20__IPU1_DISP0_DATA20  0x10
+                               MX6QDL_PAD_DISP0_DAT21__IPU1_DISP0_DATA21  0x10
+                               MX6QDL_PAD_DISP0_DAT22__IPU1_DISP0_DATA22  0x10
+                               MX6QDL_PAD_DISP0_DAT23__IPU1_DISP0_DATA23  0x10
+                       >;
+               };
+
                pinctrl_pwm1: pwm1grp {
                        fsl,pins = <
                                MX6QDL_PAD_SD1_DAT3__PWM1_OUT 0x1b0b1
        };
 };
 
+&ipu1_di0_disp0 {
+       remote-endpoint = <&lcd_display_in>;
+};
+
 &ldb {
        status = "okay";
 
index 2c07d3a86b614b1ab85c14c91afe285021b1625f..a6d445c17779cf5c39c26ff41170bb38eda31624 100644 (file)
        flash: m25p80@0 {
                #address-cells = <1>;
                #size-cells = <1>;
-               compatible = "st,m25p32";
+               compatible = "st,m25p32", "jedec,spi-nor";
                spi-max-frequency = <20000000>;
                reg = <0>;
        };
index e716e6f301c6420e4e1fd3bef63bdd1632f118b9..2b6cc8bf3c5cce97349f2385e5dfba1009b5df0a 100644 (file)
                                        dmas = <&sdma 14 18 0>,
                                               <&sdma 15 18 0>;
                                        dma-names = "rx", "tx";
-                                       clocks = <&clks IMX6QDL_CLK_SPDIF>, <&clks IMX6QDL_CLK_OSC>,
-                                                <&clks IMX6QDL_CLK_SPDIF>, <&clks IMX6QDL_CLK_DUMMY>,
-                                                <&clks IMX6QDL_CLK_DUMMY>, <&clks IMX6QDL_CLK_DUMMY>,
-                                                <&clks IMX6QDL_CLK_DUMMY>, <&clks IMX6QDL_CLK_DUMMY>,
-                                                <&clks IMX6QDL_CLK_DUMMY>;
+                                       clocks = <&clks IMX6QDL_CLK_SPDIF_GCLK>, <&clks IMX6QDL_CLK_OSC>,
+                                                <&clks IMX6QDL_CLK_SPDIF>, <&clks IMX6QDL_CLK_ASRC>,
+                                                <&clks IMX6QDL_CLK_DUMMY>, <&clks IMX6QDL_CLK_ESAI_EXTAL>,
+                                                <&clks IMX6QDL_CLK_IPG>, <&clks IMX6QDL_CLK_MLB>,
+                                                <&clks IMX6QDL_CLK_DUMMY>, <&clks IMX6QDL_CLK_SPBA>;
                                        clock-names = "core",  "rxtx0",
                                                      "rxtx1", "rxtx2",
                                                      "rxtx3", "rxtx4",
                                                      "rxtx5", "rxtx6",
-                                                     "rxtx7";
+                                                     "rxtx7", "dma";
                                        status = "disabled";
                                };
 
index b84dff2e94ea1e4e44c15a054d90e67f9d06bde6..be118820e9f7f2593908d04c3df11944b498369f 100644 (file)
        flash: m25p80@0 {
                #address-cells = <1>;
                #size-cells = <1>;
-               compatible = "st,m25p32";
+               compatible = "st,m25p32", "jedec,spi-nor";
                spi-max-frequency = <20000000>;
                reg = <0>;
        };
index 320a27f8889edc4e70ea215bbd54c5234fc2e771..d8ba99f1d87ba396b4e320ec52e63f903461d6bf 100644 (file)
                                ranges;
 
                                spdif: spdif@02004000 {
+                                       compatible = "fsl,imx6sl-spdif",
+                                               "fsl,imx35-spdif";
                                        reg = <0x02004000 0x4000>;
                                        interrupts = <0 52 IRQ_TYPE_LEVEL_HIGH>;
+                                       dmas = <&sdma 14 18 0>,
+                                               <&sdma 15 18 0>;
+                                       dma-names = "rx", "tx";
+                                       clocks = <&clks IMX6SL_CLK_SPDIF_GCLK>, <&clks IMX6SL_CLK_OSC>,
+                                                <&clks IMX6SL_CLK_SPDIF>, <&clks IMX6SL_CLK_DUMMY>,
+                                                <&clks IMX6SL_CLK_DUMMY>, <&clks IMX6SL_CLK_DUMMY>,
+                                                <&clks IMX6SL_CLK_IPG>, <&clks IMX6SL_CLK_DUMMY>,
+                                                <&clks IMX6SL_CLK_DUMMY>, <&clks IMX6SL_CLK_SPBA>;
+                                       clock-names = "core", "rxtx0",
+                                               "rxtx1", "rxtx2",
+                                               "rxtx3", "rxtx4",
+                                               "rxtx5", "rxtx6",
+                                               "rxtx7", "dma";
+                                       status = "disabled";
                                };
 
                                ecspi1: ecspi@02008000 {
                        };
 
                        dcp: dcp@020fc000 {
+                               compatible = "fsl,imx6sl-dcp", "fsl,imx28-dcp";
                                reg = <0x020fc000 0x4000>;
-                               interrupts = <0 99 IRQ_TYPE_LEVEL_HIGH>;
+                               interrupts = <0 99 IRQ_TYPE_LEVEL_HIGH>,
+                                            <0 100 IRQ_TYPE_LEVEL_HIGH>,
+                                            <0 101 IRQ_TYPE_LEVEL_HIGH>;
                        };
                };
 
index c76b87cba275fcb043289bc5eede363e6ab3c90c..71005478cdf06f29e9a0f4a04215e02d32fdba22 100644 (file)
                reg = <0>;
                #address-cells = <1>;
                #size-cells = <1>;
-               compatible = "spansion,s25fl128s";
+               compatible = "spansion,s25fl128s", "jedec,spi-nor";
                spi-max-frequency = <66000000>;
        };
 
                reg = <1>;
                #address-cells = <1>;
                #size-cells = <1>;
-               compatible = "spansion,s25fl128s";
+               compatible = "spansion,s25fl128s", "jedec,spi-nor";
                spi-max-frequency = <66000000>;
        };
 };
index 0bfc4e7865b2995fcd009fe6abc9f83f5129cb5d..0ad164ab5729d712c6618f90305b6181ea683df5 100644 (file)
        flash0: n25q256a@0 {
                #address-cells = <1>;
                #size-cells = <1>;
-               compatible = "micron,n25q256a";
+               compatible = "micron,n25q256a", "jedec,spi-nor";
                spi-max-frequency = <29000000>;
                reg = <0>;
        };
        flash1: n25q256a@1 {
                #address-cells = <1>;
                #size-cells = <1>;
-               compatible = "micron,n25q256a";
+               compatible = "micron,n25q256a", "jedec,spi-nor";
                spi-max-frequency = <29000000>;
                reg = <1>;
        };
index ac88c3467078ec92971324395101b7db785da005..94ac4005d9cd3904a9d0148d8f3e0214835fb067 100644 (file)
                        regulator-name = "peri_3v3";
                        regulator-min-microvolt = <3300000>;
                        regulator-max-microvolt = <3300000>;
-                       gpios = <&gpio4 16 GPIO_ACTIVE_HIGH>;
+                       gpio = <&gpio4 16 GPIO_ACTIVE_HIGH>;
                        enable-active-high;
                        regulator-always-on;
                };
index c94f2ea2316e74b20cde74f36c91e81f97889ff3..167f77b3bd43654c45d181e2a7f31965f6f1c946 100644 (file)
                                        dmas = <&sdma 14 18 0>,
                                               <&sdma 15 18 0>;
                                        dma-names = "rx", "tx";
-                                       clocks = <&clks IMX6SX_CLK_SPDIF>,
+                                       clocks = <&clks IMX6SX_CLK_SPDIF_GCLK>,
                                                 <&clks IMX6SX_CLK_OSC>,
                                                 <&clks IMX6SX_CLK_SPDIF>,
                                                 <&clks 0>, <&clks 0>, <&clks 0>,
index 25746b122ea650568a83a73cc18df060379546aa..6aaa5ec3d846eae6019e4414d4c925a5ebc2adc5 100644 (file)
        };
 };
 
+&snvs_poweroff {
+       status = "okay";
+};
+
+&tsc {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_tsc>;
+       xnur-gpio = <&gpio1 3 GPIO_ACTIVE_LOW>;
+       measure-delay-time = <0xffff>;
+       pre-charge-time = <0xfff>;
+       status = "okay";
+};
+
 &uart1 {
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_uart1>;
                >;
        };
 
+       pinctrl_tsc: tscgrp {
+               fsl,pins = <
+                       MX6UL_PAD_GPIO1_IO01__GPIO1_IO01                0xb0
+                       MX6UL_PAD_GPIO1_IO02__GPIO1_IO02                0xb0
+                       MX6UL_PAD_GPIO1_IO03__GPIO1_IO03                0xb0
+                       MX6UL_PAD_GPIO1_IO04__GPIO1_IO04                0xb0
+               >;
+       };
+
        pinctrl_uart1: uart1grp {
                fsl,pins = <
                        MX6UL_PAD_UART1_TX_DATA__UART1_DCE_TX 0x1b0b1
index 09edbedfd908ec46db4b39e599f28ad00e8d21ab..d00e994bdbd296e8c6c3ba1db019121de9e11cf3 100644 (file)
                        status = "disabled";
                };
 
+               ocram: sram@00900000 {
+                       compatible = "mmio-sram";
+                       reg = <0x00900000 0x20000>;
+               };
+
                aips1: aips-bus@02000000 {
                        compatible = "fsl,aips-bus", "simple-bus";
                        #address-cells = <1>;
                                                     <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>;
                                };
 
+                               snvs_poweroff: snvs-poweroff {
+                                       compatible = "syscon-poweroff";
+                                       regmap = <&snvs>;
+                                       offset = <0x38>;
+                                       mask = <0x60>;
+                                       status = "disabled";
+                               };
+
                                snvs_pwrkey: snvs-powerkey {
                                        compatible = "fsl,sec-v4.0-pwrkey";
                                        regmap = <&snvs>;
                                status = "disabled";
                        };
 
+                       tsc: tsc@02040000 {
+                               compatible = "fsl,imx6ul-tsc";
+                               reg = <0x02040000 0x4000>, <0x0219c000 0x4000>;
+                               interrupts = <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>,
+                                            <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>;
+                               clocks = <&clks IMX6UL_CLK_IPG>,
+                                        <&clks IMX6UL_CLK_ADC2>;
+                               clock-names = "tsc", "adc";
+                               status = "disabled";
+                       };
+
                        usdhc1: usdhc@02190000 {
                                compatible = "fsl,imx6ul-usdhc", "fsl,imx6sx-usdhc";
                                reg = <0x02190000 0x4000>;
                                status = "disabled";
                        };
 
+                       mmdc: mmdc@021b0000 {
+                               compatible = "fsl,imx6ul-mmdc", "fsl,imx6q-mmdc";
+                               reg = <0x021b0000 0x4000>;
+                       };
+
                        qspi: qspi@021e0000 {
                                #address-cells = <1>;
                                #size-cells = <0>;
index a8d81497edb3a33463cd116bb94768b6e03deed8..eeda7834761903fa330c1500de88fb2f0a5e916c 100644 (file)
  * <mux_reg conf_reg input_reg mux_mode input_val>
  */
 
+#define MX7D_PAD_GPIO1_IO00__GPIO1_IO0                            0x0000 0x0030 0x0000 0x0 0x0
+#define MX7D_PAD_GPIO1_IO00__PWM4_OUT                             0x0000 0x0030 0x0000 0x1 0x0
+#define MX7D_PAD_GPIO1_IO00__WDOD1_WDOG_ANY                       0x0000 0x0030 0x0000 0x2 0x0
+#define MX7D_PAD_GPIO1_IO00__WDOD1_WDOG_B                         0x0000 0x0030 0x0000 0x3 0x0
+#define MX7D_PAD_GPIO1_IO00__WDOD1_WDOG__RST_B_DEB                0x0000 0x0030 0x0000 0x4 0x0
+#define MX7D_PAD_GPIO1_IO01__GPIO1_IO1                            0x0004 0x0034 0x0000 0x0 0x0
+#define MX7D_PAD_GPIO1_IO01__PWM1_OUT                             0x0004 0x0034 0x0000 0x1 0x0
+#define MX7D_PAD_GPIO1_IO01__CCM_ENET_REF_CLK3                    0x0004 0x0034 0x0000 0x2 0x0
+#define MX7D_PAD_GPIO1_IO01__SAI1_MCLK                            0x0004 0x0034 0x0000 0x3 0x0
+#define MX7D_PAD_GPIO1_IO01__ANATOP_24M_OUT                       0x0004 0x0034 0x0000 0x4 0x0
+#define MX7D_PAD_GPIO1_IO01__OBSERVE0_OUT                         0x0004 0x0034 0x0000 0x6 0x0
+#define MX7D_PAD_GPIO1_IO02__GPIO1_IO2                            0x0008 0x0038 0x0000 0x0 0x0
+#define MX7D_PAD_GPIO1_IO02__PWM2_OUT                             0x0008 0x0038 0x0000 0x1 0x0
+#define MX7D_PAD_GPIO1_IO02__CCM_ENET_REF_CLK1                    0x0008 0x0038 0x0564 0x2 0x3
+#define MX7D_PAD_GPIO1_IO02__SAI2_MCLK                            0x0008 0x0038 0x0000 0x3 0x0
+#define MX7D_PAD_GPIO1_IO02__CCM_CLKO1                            0x0008 0x0038 0x0000 0x5 0x0
+#define MX7D_PAD_GPIO1_IO02__OBSERVE1_OUT                         0x0008 0x0038 0x0000 0x6 0x0
+#define MX7D_PAD_GPIO1_IO02__USB_OTG1_ID                          0x0008 0x0038 0x0734 0x7 0x3
+#define MX7D_PAD_GPIO1_IO03__GPIO1_IO3                            0x000C 0x003C 0x0000 0x0 0x0
+#define MX7D_PAD_GPIO1_IO03__PWM3_OUT                             0x000C 0x003C 0x0000 0x1 0x0
+#define MX7D_PAD_GPIO1_IO03__CCM_ENET_REF_CLK2                    0x000C 0x003C 0x0570 0x2 0x3
+#define MX7D_PAD_GPIO1_IO03__SAI3_MCLK                            0x000C 0x003C 0x0000 0x3 0x0
+#define MX7D_PAD_GPIO1_IO03__CCM_CLKO2                            0x000C 0x003C 0x0000 0x5 0x0
+#define MX7D_PAD_GPIO1_IO03__OBSERVE2_OUT                         0x000C 0x003C 0x0000 0x6 0x0
+#define MX7D_PAD_GPIO1_IO03__USB_OTG2_ID                          0x000C 0x003C 0x0730 0x7 0x3
+#define MX7D_PAD_GPIO1_IO04__GPIO1_IO4                            0x0010 0x0040 0x0000 0x0 0x0
+#define MX7D_PAD_GPIO1_IO04__USB_OTG1_OC                          0x0010 0x0040 0x072C 0x1 0x1
+#define MX7D_PAD_GPIO1_IO04__FLEXTIMER1_CH4                       0x0010 0x0040 0x0594 0x2 0x1
+#define MX7D_PAD_GPIO1_IO04__UART5_CTS_B                          0x0010 0x0040 0x0710 0x3 0x4
+#define MX7D_PAD_GPIO1_IO04__I2C1_SCL                             0x0010 0x0040 0x05D4 0x4 0x2
+#define MX7D_PAD_GPIO1_IO04__OBSERVE3_OUT                         0x0010 0x0040 0x0000 0x6 0x0
+#define MX7D_PAD_GPIO1_IO05__GPIO1_IO5                            0x0014 0x0044 0x0000 0x0 0x0
+#define MX7D_PAD_GPIO1_IO05__USB_OTG1_PWR                         0x0014 0x0044 0x0000 0x1 0x0
+#define MX7D_PAD_GPIO1_IO05__FLEXTIMER1_CH5                       0x0014 0x0044 0x0598 0x2 0x1
+#define MX7D_PAD_GPIO1_IO05__UART5_RTS_B                          0x0014 0x0044 0x0710 0x3 0x5
+#define MX7D_PAD_GPIO1_IO05__I2C1_SDA                             0x0014 0x0044 0x05D8 0x4 0x2
+#define MX7D_PAD_GPIO1_IO05__OBSERVE4_OUT                         0x0014 0x0044 0x0000 0x6 0x0
+#define MX7D_PAD_GPIO1_IO06__GPIO1_IO6                            0x0018 0x0048 0x0000 0x0 0x0
+#define MX7D_PAD_GPIO1_IO06__USB_OTG2_OC                          0x0018 0x0048 0x0728 0x1 0x1
+#define MX7D_PAD_GPIO1_IO06__FLEXTIMER1_CH6                       0x0018 0x0048 0x059C 0x2 0x1
+#define MX7D_PAD_GPIO1_IO06__UART5_RX_DATA                        0x0018 0x0048 0x0714 0x3 0x4
+#define MX7D_PAD_GPIO1_IO06__I2C2_SCL                             0x0018 0x0048 0x05DC 0x4 0x2
+#define MX7D_PAD_GPIO1_IO06__CCM_WAIT                             0x0018 0x0048 0x0000 0x5 0x0
+#define MX7D_PAD_GPIO1_IO06__KPP_ROW4                             0x0018 0x0048 0x0624 0x6 0x1
+#define MX7D_PAD_GPIO1_IO07__GPIO1_IO7                            0x001C 0x004C 0x0000 0x0 0x0
+#define MX7D_PAD_GPIO1_IO07__USB_OTG2_PWR                         0x001C 0x004C 0x0000 0x1 0x0
+#define MX7D_PAD_GPIO1_IO07__FLEXTIMER1_CH7                       0x001C 0x004C 0x05A0 0x2 0x1
+#define MX7D_PAD_GPIO1_IO07__UART5_TX_DATA                        0x001C 0x004C 0x0714 0x3 0x5
+#define MX7D_PAD_GPIO1_IO07__I2C2_SDA                             0x001C 0x004C 0x05E0 0x4 0x2
+#define MX7D_PAD_GPIO1_IO07__CCM_STOP                             0x001C 0x004C 0x0000 0x5 0x0
+#define MX7D_PAD_GPIO1_IO07__KPP_COL4                             0x001C 0x004C 0x0604 0x6 0x1
+#define MX7D_PAD_GPIO1_IO08__GPIO1_IO8                            0x0014 0x026C 0x0000 0x0 0x0
+#define MX7D_PAD_GPIO1_IO08__SD1_VSELECT                          0x0014 0x026C 0x0000 0x1 0x0
+#define MX7D_PAD_GPIO1_IO08__WDOG1_WDOG_B                         0x0014 0x026C 0x0000 0x2 0x0
+#define MX7D_PAD_GPIO1_IO08__UART3_DCE_RX                         0x0014 0x026C 0x0704 0x3 0x0
+#define MX7D_PAD_GPIO1_IO08__UART3_DTE_TX                         0x0014 0x026C 0x0000 0x3 0x0
+#define MX7D_PAD_GPIO1_IO08__I2C3_SCL                             0x0014 0x026C 0x05E4 0x4 0x0
+#define MX7D_PAD_GPIO1_IO08__KPP_COL5                             0x0014 0x026C 0x0608 0x6 0x0
+#define MX7D_PAD_GPIO1_IO08__PWM1_OUT                             0x0014 0x026C 0x0000 0x7 0x0
+#define MX7D_PAD_GPIO1_IO09__GPIO1_IO9                            0x0018 0x0270 0x0000 0x0 0x0
+#define MX7D_PAD_GPIO1_IO09__SD1_LCTL                             0x0018 0x0270 0x0000 0x1 0x0
+#define MX7D_PAD_GPIO1_IO09__CCM_ENET_REF_CLK3                    0x0018 0x0270 0x0000 0x2 0x0
+#define MX7D_PAD_GPIO1_IO09__UART3_DCE_TX                         0x0018 0x0270 0x0000 0x3 0x0
+#define MX7D_PAD_GPIO1_IO09__UART3_DTE_RX                         0x0018 0x0270 0x0704 0x3 0x1
+#define MX7D_PAD_GPIO1_IO09__I2C3_SDA                             0x0018 0x0270 0x05E8 0x4 0x0
+#define MX7D_PAD_GPIO1_IO09__CCM_PMIC_READY                       0x0018 0x0270 0x04F4 0x5 0x0
+#define MX7D_PAD_GPIO1_IO09__KPP_ROW5                             0x0018 0x0270 0x0628 0x6 0x0
+#define MX7D_PAD_GPIO1_IO09__PWM2_OUT                             0x0018 0x0270 0x0000 0x7 0x0
+#define MX7D_PAD_GPIO1_IO10__GPIO1_IO10                           0x001C 0x0274 0x0000 0x0 0x0
+#define MX7D_PAD_GPIO1_IO10__SD2_LCTL                             0x001C 0x0274 0x0000 0x1 0x0
+#define MX7D_PAD_GPIO1_IO10__ENET1_MDIO                           0x001C 0x0274 0x0568 0x2 0x0
+#define MX7D_PAD_GPIO1_IO10__UART3_DCE_RTS                        0x001C 0x0274 0x0700 0x3 0x0
+#define MX7D_PAD_GPIO1_IO10__UART3_DTE_CTS                        0x001C 0x0274 0x0000 0x3 0x0
+#define MX7D_PAD_GPIO1_IO10__I2C4_SCL                             0x001C 0x0274 0x05EC 0x4 0x0
+#define MX7D_PAD_GPIO1_IO10__FLEXTIMER1_PHA                       0x001C 0x0274 0x05A4 0x5 0x0
+#define MX7D_PAD_GPIO1_IO10__KPP_COL6                             0x001C 0x0274 0x060C 0x6 0x0
+#define MX7D_PAD_GPIO1_IO10__PWM3_OUT                             0x001C 0x0274 0x0000 0x7 0x0
+#define MX7D_PAD_GPIO1_IO11__GPIO1_IO11                           0x0020 0x0278 0x0000 0x0 0x0
+#define MX7D_PAD_GPIO1_IO11__SD3_LCTL                             0x0020 0x0278 0x0000 0x1 0x0
+#define MX7D_PAD_GPIO1_IO11__ENET1_MDC                            0x0020 0x0278 0x0000 0x2 0x0
+#define MX7D_PAD_GPIO1_IO11__UART3_DCE_CTS                        0x0020 0x0278 0x0000 0x3 0x0
+#define MX7D_PAD_GPIO1_IO11__UART3_DTE_RTS                        0x0020 0x0278 0x0700 0x3 0x1
+#define MX7D_PAD_GPIO1_IO11__I2C4_SDA                             0x0020 0x0278 0x05F0 0x4 0x0
+#define MX7D_PAD_GPIO1_IO11__FLEXTIMER1_PHB                       0x0020 0x0278 0x05A8 0x5 0x0
+#define MX7D_PAD_GPIO1_IO11__KPP_ROW6                             0x0020 0x0278 0x062C 0x6 0x0
+#define MX7D_PAD_GPIO1_IO11__PWM4_OUT                             0x0020 0x0278 0x0000 0x7 0x0
+#define MX7D_PAD_GPIO1_IO12__GPIO1_IO12                           0x0024 0x027C 0x0000 0x0 0x0
+#define MX7D_PAD_GPIO1_IO12__SD2_VSELECT                          0x0024 0x027C 0x0000 0x1 0x0
+#define MX7D_PAD_GPIO1_IO12__CCM_ENET_REF_CLK1                    0x0024 0x027C 0x0564 0x2 0x0
+#define MX7D_PAD_GPIO1_IO12__FLEXCAN1_RX                          0x0024 0x027C 0x04DC 0x3 0x0
+#define MX7D_PAD_GPIO1_IO12__CM4_NMI                              0x0024 0x027C 0x0000 0x4 0x0
+#define MX7D_PAD_GPIO1_IO12__CCM_EXT_CLK1                         0x0024 0x027C 0x04E4 0x5 0x0
+#define MX7D_PAD_GPIO1_IO12__SNVS_VIO_5                           0x0024 0x027C 0x0000 0x6 0x0
+#define MX7D_PAD_GPIO1_IO12__USB_OTG1_ID                          0x0024 0x027C 0x0734 0x7 0x0
+#define MX7D_PAD_GPIO1_IO13__GPIO1_IO13                           0x0028 0x0280 0x0000 0x0 0x0
+#define MX7D_PAD_GPIO1_IO13__SD3_VSELECT                          0x0028 0x0280 0x0000 0x1 0x0
+#define MX7D_PAD_GPIO1_IO13__CCM_ENET_REF_CLK2                    0x0028 0x0280 0x0570 0x2 0x0
+#define MX7D_PAD_GPIO1_IO13__FLEXCAN1_TX                          0x0028 0x0280 0x0000 0x3 0x0
+#define MX7D_PAD_GPIO1_IO13__CCM_PMIC_READY                       0x0028 0x0280 0x04F4 0x4 0x1
+#define MX7D_PAD_GPIO1_IO13__CCM_EXT_CLK2                         0x0028 0x0280 0x04E8 0x5 0x0
+#define MX7D_PAD_GPIO1_IO13__SNVS_VIO_5_CTL                       0x0028 0x0280 0x0000 0x6 0x0
+#define MX7D_PAD_GPIO1_IO13__USB_OTG2_ID                          0x0028 0x0280 0x0730 0x7 0x0
+#define MX7D_PAD_GPIO1_IO14__GPIO1_IO14                           0x002C 0x0284 0x0000 0x0 0x0
+#define MX7D_PAD_GPIO1_IO14__SD3_CD_B                             0x002C 0x0284 0x0738 0x1 0x0
+#define MX7D_PAD_GPIO1_IO14__ENET2_MDIO                           0x002C 0x0284 0x0574 0x2 0x0
+#define MX7D_PAD_GPIO1_IO14__FLEXCAN2_RX                          0x002C 0x0284 0x04E0 0x3 0x0
+#define MX7D_PAD_GPIO1_IO14__WDOG3_WDOG_B                         0x002C 0x0284 0x0000 0x4 0x0
+#define MX7D_PAD_GPIO1_IO14__CCM_EXT_CLK3                         0x002C 0x0284 0x04EC 0x5 0x0
+#define MX7D_PAD_GPIO1_IO14__SDMA_EXT_EVENT0                      0x002C 0x0284 0x06D8 0x6 0x0
+#define MX7D_PAD_GPIO1_IO15__GPIO1_IO15                           0x0030 0x0288 0x0000 0x0 0x0
+#define MX7D_PAD_GPIO1_IO15__SD3_WP                               0x0030 0x0288 0x073C 0x1 0x0
+#define MX7D_PAD_GPIO1_IO15__ENET2_MDC                            0x0030 0x0288 0x0000 0x2 0x0
+#define MX7D_PAD_GPIO1_IO15__FLEXCAN2_TX                          0x0030 0x0288 0x0000 0x3 0x0
+#define MX7D_PAD_GPIO1_IO15__WDOG4_WDOG_B                         0x0030 0x0288 0x0000 0x4 0x0
+#define MX7D_PAD_GPIO1_IO15__CCM_EXT_CLK4                         0x0030 0x0288 0x04F0 0x5 0x0
+#define MX7D_PAD_GPIO1_IO15__SDMA_EXT_EVENT1                      0x0030 0x0288 0x06DC 0x6 0x0
 #define MX7D_PAD_EPDC_DATA00__EPDC_DATA0                          0x0034 0x02A4 0x0000 0x0 0x0
 #define MX7D_PAD_EPDC_DATA00__SIM1_PORT2_TRXD                     0x0034 0x02A4 0x0000 0x1 0x0
 #define MX7D_PAD_EPDC_DATA00__QSPI_A_DATA0                        0x0034 0x02A4 0x0000 0x2 0x0
 #define MX7D_PAD_LCD_DATA23__EIM_ADDR26                           0x0124 0x0394 0x0000 0x4 0x0
 #define MX7D_PAD_LCD_DATA23__GPIO3_IO28                           0x0124 0x0394 0x0000 0x5 0x0
 #define MX7D_PAD_LCD_DATA23__I2C4_SDA                             0x0124 0x0394 0x05F0 0x6 0x1
-#define MX7D_PAD_UART1_RX_DATA__UART1_DCE_RX                      0x0128 0x0398 0x0000 0x0 0x0
+#define MX7D_PAD_UART1_RX_DATA__UART1_DCE_RX                      0x0128 0x0398 0x06F4 0x0 0x0
 #define MX7D_PAD_UART1_RX_DATA__UART1_DTE_TX                      0x0128 0x0398 0x0000 0x0 0x0
 #define MX7D_PAD_UART1_RX_DATA__I2C1_SCL                          0x0128 0x0398 0x05D4 0x1 0x0
 #define MX7D_PAD_UART1_RX_DATA__CCM_PMIC_READY                    0x0128 0x0398 0x0000 0x2 0x0
 #define MX7D_PAD_UART1_TX_DATA__ENET2_1588_EVENT0_OUT             0x012C 0x039C 0x0000 0x4 0x0
 #define MX7D_PAD_UART1_TX_DATA__GPIO4_IO1                         0x012C 0x039C 0x0000 0x5 0x0
 #define MX7D_PAD_UART1_TX_DATA__ENET1_MDC                         0x012C 0x039C 0x0000 0x6 0x0
-#define MX7D_PAD_UART2_RX_DATA__UART2_DCE_RX                      0x0130 0x03A0 0x0000 0x0 0x0
+#define MX7D_PAD_UART2_RX_DATA__UART2_DCE_RX                      0x0130 0x03A0 0x06FC 0x0 0x2
 #define MX7D_PAD_UART2_RX_DATA__UART2_DTE_TX                      0x0130 0x03A0 0x0000 0x0 0x0
 #define MX7D_PAD_UART2_RX_DATA__I2C2_SCL                          0x0130 0x03A0 0x05DC 0x1 0x0
 #define MX7D_PAD_UART2_RX_DATA__SAI3_RX_BCLK                      0x0130 0x03A0 0x0000 0x2 0x0
 #define MX7D_PAD_UART3_TX_DATA__ENET1_1588_EVENT0_OUT             0x013C 0x03AC 0x0000 0x4 0x0
 #define MX7D_PAD_UART3_TX_DATA__GPIO4_IO5                         0x013C 0x03AC 0x0000 0x5 0x0
 #define MX7D_PAD_UART3_TX_DATA__SD2_LCTL                          0x013C 0x03AC 0x0000 0x6 0x0
-#define MX7D_PAD_UART3_RTS_B__UART3_DCE_RTS                       0x0140 0x03B0 0x0000 0x0 0x0
+#define MX7D_PAD_UART3_RTS_B__UART3_DCE_RTS                       0x0140 0x03B0 0x0700 0x0 0x2
 #define MX7D_PAD_UART3_RTS_B__UART3_DTE_CTS                       0x0140 0x03B0 0x0000 0x0 0x0
 #define MX7D_PAD_UART3_RTS_B__USB_OTG2_OC                         0x0140 0x03B0 0x0728 0x1 0x0
 #define MX7D_PAD_UART3_RTS_B__SAI3_TX_DATA0                       0x0140 0x03B0 0x0000 0x2 0x0
index fdd1d7c9a5cc2608ac047f088f62e394d88db124..432aaf5d5ef7884382c1d3656ebd6785f6468431 100644 (file)
        arm-supply = <&sw1a_reg>;
 };
 
+&fec1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_enet1>;
+       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 = "rgmii";
+       phy-handle = <&ethphy0>;
+       fsl,magic-packet;
+       status = "okay";
+
+       mdio {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               ethphy0: ethernet-phy@0 {
+                       reg = <0>;
+               };
+
+               ethphy1: ethernet-phy@1 {
+                       reg = <1>;
+               };
+       };
+};
+
+&fec2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_enet2>;
+       assigned-clocks = <&clks IMX7D_ENET2_TIME_ROOT_SRC>,
+                         <&clks IMX7D_ENET2_TIME_ROOT_CLK>;
+       assigned-clock-parents = <&clks IMX7D_PLL_ENET_MAIN_100M_CLK>;
+       assigned-clock-rates = <0>, <100000000>;
+       phy-mode = "rgmii";
+       phy-handle = <&ethphy1>;
+       fsl,magic-packet;
+       status = "okay";
+};
+
 &i2c1 {
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_i2c1>;
        status = "okay";
 };
 
+&usbotg1 {
+       vbus-supply = <&reg_usb_otg1_vbus>;
+       status = "okay";
+};
+
+&usbotg2 {
+       vbus-supply = <&reg_usb_otg2_vbus>;
+       dr_mode = "host";
+       status = "okay";
+};
+
 &usdhc1 {
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_usdhc1>;
        status = "okay";
 };
 
+&usdhc3 {
+       pinctrl-names = "default", "state_100mhz", "state_200mhz";
+       pinctrl-0 = <&pinctrl_usdhc3>;
+       pinctrl-1 = <&pinctrl_usdhc3_100mhz>;
+       pinctrl-2 = <&pinctrl_usdhc3_200mhz>;
+       assigned-clocks = <&clks IMX7D_USDHC3_ROOT_CLK>;
+       assigned-clock-rates = <400000000>;
+       bus-width = <8>;
+       fsl,tuning-step = <2>;
+       non-removable;
+       status = "okay";
+};
+
 &iomuxc {
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_hog>;
 
        imx7d-sdb {
+               pinctrl_enet1: enet1grp {
+                       fsl,pins = <
+                               MX7D_PAD_GPIO1_IO10__ENET1_MDIO                 0x3
+                               MX7D_PAD_GPIO1_IO11__ENET1_MDC                  0x3
+                               MX7D_PAD_ENET1_RGMII_TXC__ENET1_RGMII_TXC       0x1
+                               MX7D_PAD_ENET1_RGMII_TD0__ENET1_RGMII_TD0       0x1
+                               MX7D_PAD_ENET1_RGMII_TD1__ENET1_RGMII_TD1       0x1
+                               MX7D_PAD_ENET1_RGMII_TD2__ENET1_RGMII_TD2       0x1
+                               MX7D_PAD_ENET1_RGMII_TD3__ENET1_RGMII_TD3       0x1
+                               MX7D_PAD_ENET1_RGMII_TX_CTL__ENET1_RGMII_TX_CTL 0x1
+                               MX7D_PAD_ENET1_RGMII_RXC__ENET1_RGMII_RXC       0x1
+                               MX7D_PAD_ENET1_RGMII_RD0__ENET1_RGMII_RD0       0x1
+                               MX7D_PAD_ENET1_RGMII_RD1__ENET1_RGMII_RD1       0x1
+                               MX7D_PAD_ENET1_RGMII_RD2__ENET1_RGMII_RD2       0x1
+                               MX7D_PAD_ENET1_RGMII_RD3__ENET1_RGMII_RD3       0x1
+                               MX7D_PAD_ENET1_RGMII_RX_CTL__ENET1_RGMII_RX_CTL 0x1
+                       >;
+               };
+
+               pinctrl_enet2: enet2grp {
+                       fsl,pins = <
+                               MX7D_PAD_EPDC_GDSP__ENET2_RGMII_TXC             0x1
+                               MX7D_PAD_EPDC_SDCE2__ENET2_RGMII_TD0            0x1
+                               MX7D_PAD_EPDC_SDCE3__ENET2_RGMII_TD1            0x1
+                               MX7D_PAD_EPDC_GDCLK__ENET2_RGMII_TD2            0x1
+                               MX7D_PAD_EPDC_GDOE__ENET2_RGMII_TD3             0x1
+                               MX7D_PAD_EPDC_GDRL__ENET2_RGMII_TX_CTL          0x1
+                               MX7D_PAD_EPDC_SDCE1__ENET2_RGMII_RXC            0x1
+                               MX7D_PAD_EPDC_SDCLK__ENET2_RGMII_RD0            0x1
+                               MX7D_PAD_EPDC_SDLE__ENET2_RGMII_RD1             0x1
+                               MX7D_PAD_EPDC_SDOE__ENET2_RGMII_RD2             0x1
+                               MX7D_PAD_EPDC_SDSHR__ENET2_RGMII_RD3            0x1
+                               MX7D_PAD_EPDC_SDCE0__ENET2_RGMII_RX_CTL         0x1
+                       >;
+               };
+
                pinctrl_hog: hoggrp {
                        fsl,pins = <
                                MX7D_PAD_UART3_CTS_B__GPIO4_IO7         0x14
                        >;
                };
 
-
                pinctrl_uart1: uart1grp {
                        fsl,pins = <
                                MX7D_PAD_UART1_TX_DATA__UART1_DCE_TX    0x79
index 6e444bb873f92ee28dd5cebec93d5947f3b8ea15..ebc053a06405e848c773fc9f66c2a779fce5780c 100644 (file)
                                status = "disabled";
                        };
 
+                       iomuxc_lpsr: iomuxc-lpsr@302c0000 {
+                               compatible = "fsl,imx7d-iomuxc-lpsr";
+                               reg = <0x302c0000 0x10000>;
+                               fsl,input-sel = <&iomuxc>;
+                       };
+
                        gpt1: gpt@302d0000 {
                                compatible = "fsl,imx7d-gpt", "fsl,imx6sx-gpt";
                                reg = <0x302d0000 0x10000>;
                        };
                };
 
+               aips2: aips-bus@30400000 {
+                       compatible = "fsl,aips-bus", "simple-bus";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       reg = <0x30400000 0x400000>;
+                       ranges;
+
+                       pwm1: pwm@30660000 {
+                               compatible = "fsl,imx7d-pwm", "fsl,imx27-pwm";
+                               reg = <0x30660000 0x10000>;
+                               interrupts = <GIC_SPI 81 IRQ_TYPE_LEVEL_HIGH>;
+                               clocks = <&clks IMX7D_PWM1_ROOT_CLK>,
+                                        <&clks IMX7D_PWM1_ROOT_CLK>;
+                               clock-names = "ipg", "per";
+                               #pwm-cells = <2>;
+                               status = "disabled";
+                       };
+
+                       pwm2: pwm@30670000 {
+                               compatible = "fsl,imx7d-pwm", "fsl,imx27-pwm";
+                               reg = <0x30670000 0x10000>;
+                               interrupts = <GIC_SPI 82 IRQ_TYPE_LEVEL_HIGH>;
+                               clocks = <&clks IMX7D_PWM2_ROOT_CLK>,
+                                        <&clks IMX7D_PWM2_ROOT_CLK>;
+                               clock-names = "ipg", "per";
+                               #pwm-cells = <2>;
+                               status = "disabled";
+                       };
+
+                       pwm3: pwm@30680000 {
+                               compatible = "fsl,imx7d-pwm", "fsl,imx27-pwm";
+                               reg = <0x30680000 0x10000>;
+                               interrupts = <GIC_SPI 83 IRQ_TYPE_LEVEL_HIGH>;
+                               clocks = <&clks IMX7D_PWM3_ROOT_CLK>,
+                                        <&clks IMX7D_PWM3_ROOT_CLK>;
+                               clock-names = "ipg", "per";
+                               #pwm-cells = <2>;
+                               status = "disabled";
+                       };
+
+                       pwm4: pwm@30690000 {
+                               compatible = "fsl,imx7d-pwm", "fsl,imx27-pwm";
+                               reg = <0x30690000 0x10000>;
+                               interrupts = <GIC_SPI 84 IRQ_TYPE_LEVEL_HIGH>;
+                               clocks = <&clks IMX7D_PWM4_ROOT_CLK>,
+                                        <&clks IMX7D_PWM4_ROOT_CLK>;
+                               clock-names = "ipg", "per";
+                               #pwm-cells = <2>;
+                               status = "disabled";
+                       };
+               };
+
                aips3: aips-bus@30800000 {
                        compatible = "fsl,aips-bus", "simple-bus";
                        #address-cells = <1>;
                                status = "disabled";
                        };
 
+                       usbotg1: usb@30b10000 {
+                               compatible = "fsl,imx7d-usb", "fsl,imx27-usb";
+                               reg = <0x30b10000 0x200>;
+                               interrupts = <GIC_SPI 43 IRQ_TYPE_LEVEL_HIGH>;
+                               clocks = <&clks IMX7D_USB_CTRL_CLK>;
+                               fsl,usbphy = <&usbphynop1>;
+                               fsl,usbmisc = <&usbmisc1 0>;
+                               phy-clkgate-delay-us = <400>;
+                               status = "disabled";
+                       };
+
+                       usbotg2: usb@30b20000 {
+                               compatible = "fsl,imx7d-usb", "fsl,imx27-usb";
+                               reg = <0x30b20000 0x200>;
+                               interrupts = <GIC_SPI 42 IRQ_TYPE_LEVEL_HIGH>;
+                               clocks = <&clks IMX7D_USB_CTRL_CLK>;
+                               fsl,usbphy = <&usbphynop2>;
+                               fsl,usbmisc = <&usbmisc2 0>;
+                               phy-clkgate-delay-us = <400>;
+                               status = "disabled";
+                       };
+
+                       usbh: usb@30b30000 {
+                               compatible = "fsl,imx7d-usb", "fsl,imx27-usb";
+                               reg = <0x30b30000 0x200>;
+                               interrupts = <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>;
+                               clocks = <&clks IMX7D_USB_CTRL_CLK>;
+                               fsl,usbphy = <&usbphynop3>;
+                               fsl,usbmisc = <&usbmisc3 0>;
+                               phy_type = "hsic";
+                               dr_mode = "host";
+                               phy-clkgate-delay-us = <400>;
+                               status = "disabled";
+                       };
+
+                       usbmisc1: usbmisc@30b10200 {
+                               #index-cells = <1>;
+                               compatible = "fsl,imx7d-usbmisc", "fsl,imx6q-usbmisc";
+                               reg = <0x30b10200 0x200>;
+                       };
+
+                       usbmisc2: usbmisc@30b20200 {
+                               #index-cells = <1>;
+                               compatible = "fsl,imx7d-usbmisc", "fsl,imx6q-usbmisc";
+                               reg = <0x30b20200 0x200>;
+                       };
+
+                       usbmisc3: usbmisc@30b30200 {
+                               #index-cells = <1>;
+                               compatible = "fsl,imx7d-usbmisc", "fsl,imx6q-usbmisc";
+                               reg = <0x30b30200 0x200>;
+                       };
+
+                       usbphynop1: usbphynop1 {
+                               compatible = "usb-nop-xceiv";
+                               clocks = <&clks IMX7D_USB_PHY1_CLK>;
+                               clock-names = "main_clk";
+                       };
+
+                       usbphynop2: usbphynop2 {
+                               compatible = "usb-nop-xceiv";
+                               clocks = <&clks IMX7D_USB_PHY2_CLK>;
+                               clock-names = "main_clk";
+                       };
+
+                       usbphynop3: usbphynop3 {
+                               compatible = "usb-nop-xceiv";
+                               clocks = <&clks IMX7D_USB_HSIC_ROOT_CLK>;
+                               clock-names = "main_clk";
+                       };
+
                        usdhc1: usdhc@30b40000 {
                                compatible = "fsl,imx7d-usdhc", "fsl,imx6sl-usdhc";
                                reg = <0x30b40000 0x10000>;
                                bus-width = <4>;
                                status = "disabled";
                        };
+
+                       fec1: ethernet@30be0000 {
+                               compatible = "fsl,imx7d-fec", "fsl,imx6sx-fec";
+                               reg = <0x30be0000 0x10000>;
+                               interrupts = <GIC_SPI 118 IRQ_TYPE_LEVEL_HIGH>,
+                                       <GIC_SPI 119 IRQ_TYPE_LEVEL_HIGH>,
+                                       <GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>;
+                               clocks = <&clks IMX7D_ENET_AXI_ROOT_CLK>,
+                                       <&clks IMX7D_ENET_AXI_ROOT_CLK>,
+                                       <&clks IMX7D_ENET1_TIME_ROOT_CLK>,
+                                       <&clks IMX7D_PLL_ENET_MAIN_125M_CLK>,
+                                       <&clks IMX7D_ENET_PHY_REF_ROOT_CLK>;
+                               clock-names = "ipg", "ahb", "ptp",
+                                       "enet_clk_ref", "enet_out";
+                               fsl,num-tx-queues=<3>;
+                               fsl,num-rx-queues=<3>;
+                               status = "disabled";
+                       };
+
+                       fec2: ethernet@30bf0000 {
+                               compatible = "fsl,imx7d-fec", "fsl,imx6sx-fec";
+                               reg = <0x30bf0000 0x10000>;
+                               interrupts = <GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>,
+                                       <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>,
+                                       <GIC_SPI 102 IRQ_TYPE_LEVEL_HIGH>;
+                               clocks = <&clks IMX7D_ENET_AXI_ROOT_CLK>,
+                                       <&clks IMX7D_ENET_AXI_ROOT_CLK>,
+                                       <&clks IMX7D_ENET2_TIME_ROOT_CLK>,
+                                       <&clks IMX7D_PLL_ENET_MAIN_125M_CLK>,
+                                       <&clks IMX7D_ENET_PHY_REF_ROOT_CLK>;
+                               clock-names = "ipg", "ahb", "ptp",
+                                       "enet_clk_ref", "enet_out";
+                               fsl,num-tx-queues=<3>;
+                               fsl,num-rx-queues=<3>;
+                               status = "disabled";
+                       };
                };
        };
 };
index 50c83c21d9118baa9b4f0ec2a2e30c20f8d64981..b7e99807f5c2014ad71ae26d0ebc0b06c3426011 100644 (file)
@@ -13,7 +13,7 @@
 #include "k2e.dtsi"
 
 / {
-       compatible =  "ti,k2e-evm","ti,keystone";
+       compatible = "ti,k2e-evm", "ti,k2e", "ti,keystone";
        model = "Texas Instruments Keystone 2 Edison EVM";
 
        soc {
index b13b3c94e7fc251eacc37a382f1d9f9c2f100c4b..ac990f6797253e074592c0060b60e4fb6f743226 100644 (file)
@@ -72,7 +72,17 @@ qmss: qmss@2a40000 {
                                qalloc-by-id;
                        };
                };
+               accumulator {
+                       acc-low-0 {
+                               qrange = <480 32>;
+                               accumulator = <0 47 16 2 50>;
+                               interrupts = <0 226 0xf01>;
+                               multi-queue;
+                               qalloc-by-id;
+                       };
+               };
        };
+
        descriptor-regions {
                #address-cells = <1>;
                #size-cells = <1>;
@@ -83,6 +93,19 @@ qmss: qmss@2a40000 {
                        link-index = <0x4000>;
                };
        };
+
+       pdsps {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges;
+               pdsp0@0x2a10000 {
+                       reg = <0x2a10000 0x1000    /*iram */
+                              0x2a0f000 0x100     /*reg*/
+                              0x2a0c000 0x3c8     /*intd */
+                              0x2a20000 0x4000>;  /*cmd*/
+                       id = <0>;
+               };
+       };
 }; /* qmss */
 
 knav_dmas: knav_dmas@0 {
index 675fb8e492c6aa0478a6d5df01b30fbe1e281b7d..1097dada56d2e8dc23be80ca63f10b81081e1380 100644 (file)
@@ -9,6 +9,9 @@
  */
 
 / {
+       compatible = "ti,k2e", "ti,keystone";
+       model = "Texas Instruments Keystone 2 Edison SoC";
+
        cpus {
                #address-cells = <1>;
                #size-cells = <0>;
index 660ebf58d547cf4f3f18396159fb7cd5ed7da550..8161bf53271b75242dd84d28f42572b9fe7b4515 100644 (file)
@@ -13,7 +13,7 @@
 #include "k2hk.dtsi"
 
 / {
-       compatible =  "ti,k2hk-evm","ti,keystone";
+       compatible =  "ti,k2hk-evm", "ti,k2hk", "ti,keystone";
        model = "Texas Instruments Keystone 2 Kepler/Hawking EVM";
 
        soc {
index 77a32c3c17e4c5b96a89cadffa655290ba6966e0..f86d6ddb832b59f41a088ae2d063ebbb73f2142b 100644 (file)
@@ -47,6 +47,7 @@ qmss: qmss@2a40000 {
                                    "region", "push", "pop";
                };
        };
+
        queue-pools {
                qpend {
                        qpend-0 {
@@ -88,7 +89,17 @@ qmss: qmss@2a40000 {
                                qalloc-by-id;
                        };
                };
+               accumulator {
+                       acc-low-0 {
+                               qrange = <480 32>;
+                               accumulator = <0 47 16 2 50>;
+                               interrupts = <0 226 0xf01>;
+                               multi-queue;
+                               qalloc-by-id;
+                       };
+               };
        };
+
        descriptor-regions {
                #address-cells = <1>;
                #size-cells = <1>;
@@ -99,6 +110,19 @@ qmss: qmss@2a40000 {
                        link-index = <0x4000>;
                };
        };
+
+       pdsps {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges;
+               pdsp0@0x2a10000 {
+                       reg = <0x2a10000 0x1000    /*iram */
+                              0x2a0f000 0x100     /*reg*/
+                              0x2a0c000 0x3c8     /*intd */
+                              0x2a20000 0x4000>;  /*cmd*/
+                       id = <0>;
+               };
+       };
 }; /* qmss */
 
 knav_dmas: knav_dmas@0 {
index d0810a5f296857394397c7f1c60bffa0011bb6e1..ada4c7ac96e73e6bff3d275379c1cc999bc2db9c 100644 (file)
@@ -9,6 +9,9 @@
  */
 
 / {
+       compatible = "ti,k2hk", "ti,keystone";
+       model = "Texas Instruments Keystone 2 Kepler/Hawking SoC";
+
        cpus {
                #address-cells = <1>;
                #size-cells = <0>;
index 9a69a6b553748bb5752bd12c7dbe9c251e8b7705..00861244d78873a224275a2dffbe052d80a8a901 100644 (file)
@@ -13,7 +13,7 @@
 #include "k2l.dtsi"
 
 / {
-       compatible =  "ti,k2l-evm","ti,keystone";
+       compatible = "ti,k2l-evm", "ti,k2l", "ti,keystone";
        model = "Texas Instruments Keystone 2 Lamarr EVM";
 
        soc {
index 6b95284d11d403a4229decb2cc336904c5542981..01aef230773d4052e19ba13b5c4a95df9ea08787 100644 (file)
@@ -72,7 +72,16 @@ qmss: qmss@2a40000 {
                                qalloc-by-id;
                        };
                };
+               accumulator {
+                       acc-low-0 {
+                               qrange = <480 32>;
+                               accumulator = <0 47 16 2 50>;
+                               interrupts = <0 226 0xf01>;
+                               multi-queue;
+                       };
+               };
        };
+
        descriptor-regions {
                #address-cells = <1>;
                #size-cells = <1>;
@@ -83,6 +92,20 @@ qmss: qmss@2a40000 {
                        link-index = <0x4000>;
                };
        };
+
+       pdsps {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges;
+               pdsp0@0x2a10000 {
+                       reg = <0x2a10000 0x1000    /*iram */
+                              0x2a0f000 0x100     /*reg*/
+                              0x2a0c000 0x3c8     /*intd */
+                              0x2a20000 0x4000>;  /*cmd*/
+                       id = <0>;
+               };
+       };
+
 }; /* qmss */
 
 knav_dmas: knav_dmas@0 {
index 49fd414f680c93ab50cf0dae72d2e9261181da21..4446da72b0aee89e221603698c088c3f481503d6 100644 (file)
@@ -9,6 +9,9 @@
  */
 
 / {
+       compatible = "ti,k2l", "ti,keystone";
+       model = "Texas Instruments Keystone 2 Lamarr SoC";
+
        cpus {
                #address-cells = <1>;
                #size-cells = <0>;
index 72816d65f7ec3fcf5d7c47ce792ae57db369754b..3f272826f537ae53535aeebcb42de1330ca00fd4 100644 (file)
@@ -12,6 +12,7 @@
 #include "skeleton.dtsi"
 
 / {
+       compatible = "ti,keystone";
        model = "Texas Instruments Keystone 2 SoC";
        #address-cells = <2>;
        #size-cells = <2>;
                };
 
                spi0: spi@21000400 {
-                       compatible = "ti,dm6441-spi";
+                       compatible = "ti,keystone-spi", "ti,dm6441-spi";
                        reg = <0x21000400 0x200>;
                        num-cs = <4>;
                        ti,davinci-spi-intr-line = <0>;
                };
 
                spi1: spi@21000600 {
-                       compatible = "ti,dm6441-spi";
+                       compatible = "ti,keystone-spi", "ti,dm6441-spi";
                        reg = <0x21000600 0x200>;
                        num-cs = <4>;
                        ti,davinci-spi-intr-line = <0>;
                };
 
                spi2: spi@21000800 {
-                       compatible = "ti,dm6441-spi";
+                       compatible = "ti,keystone-spi", "ti,dm6441-spi";
                        reg = <0x21000800 0x200>;
                        num-cs = <4>;
                        ti,davinci-spi-intr-line = <0>;
index 464f09a1a4a5bffebeb90eafcd0e251f962602c7..7b5a4a18f49cb6981064c213805652df0911cb90 100644 (file)
                pcie-mem-aperture = <0xe0000000 0x10000000>; /* 256 MiB memory space */
                pcie-io-aperture  = <0xf2000000 0x100000>;   /*   1 MiB    I/O space */
 
-               cesa: crypto@0301 {
-                       compatible = "marvell,orion-crypto";
-                       reg = <MBUS_ID(0xf0, 0x01) 0x30000 0x10000>,
-                             <MBUS_ID(0x03, 0x01) 0 0x800>;
-                       reg-names = "regs", "sram";
-                       interrupts = <22>;
-                       clocks = <&gate_clk 17>;
-                       status = "okay";
-               };
-
                nand: nand@012f {
                        #address-cells = <1>;
                        #size-cells = <1>;
                        pinctrl-names = "default";
                        status = "disabled";
                };
+
+               crypto_sram: sa-sram@0301 {
+                       compatible = "mmio-sram";
+                       reg = <MBUS_ID(0x03, 0x01) 0x0 0x800>;
+                       clocks = <&gate_clk 17>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+               };
        };
 
        ocp@f1000000 {
                        status = "okay";
                };
 
+               cesa: crypto@30000 {
+                       compatible = "marvell,kirkwood-crypto";
+                       reg = <0x30000 0x10000>;
+                       reg-names = "regs";
+                       interrupts = <22>;
+                       clocks = <&gate_clk 17>;
+                       marvell,crypto-srams = <&crypto_sram>;
+                       marvell,crypto-sram-size = <0x800>;
+                       status = "okay";
+               };
+
                usb0: ehci@50000 {
                        compatible = "marvell,orion-ehci";
                        reg = <0x50000 0x1000>;
index 2c569a6ddc9a549718991aeacdd63b9ea608b6c1..52591d83e8cd2759088421521abe184d32062abb 100644 (file)
        };
 
        soc {
+               sct_pwm: pwm@40000000 {
+                       compatible = "nxp,lpc1850-sct-pwm";
+                       reg = <0x40000000 0x1000>;
+                       clocks =<&ccu1 CLK_CPU_SCT>;
+                       clock-names = "pwm";
+                       resets = <&rgu 37>;
+                       #pwm-cells = <3>;
+                       status = "disabled";
+               };
+
+               dmac: dma-controller@40002000 {
+                       compatible = "arm,pl080", "arm,primecell";
+                       arm,primecell-periphid = <0x00041080>;
+                       reg = <0x40002000 0x1000>;
+                       interrupts = <2>;
+                       clocks = <&ccu1 CLK_CPU_DMA>;
+                       clock-names = "apb_pclk";
+                       resets = <&rgu 19>;
+                       #dma-cells = <2>;
+                       dma-channels = <8>;
+                       dma-requests = <16>;
+                       lli-bus-interface-ahb1;
+                       lli-bus-interface-ahb2;
+                       mem-bus-interface-ahb1;
+                       mem-bus-interface-ahb2;
+                       memcpy-burst-size = <256>;
+                       memcpy-bus-width = <32>;
+               };
+
+               spifi: flash-controller@40003000 {
+                       compatible = "nxp,lpc1773-spifi";
+                       reg = <0x40003000 0x1000>, <0x14000000 0x4000000>;
+                       reg-names = "spifi", "flash";
+                       interrupts = <30>;
+                       clocks = <&ccu1 CLK_SPIFI>, <&ccu1 CLK_CPU_SPIFI>;
+                       clock-names = "spifi", "reg";
+                       resets = <&rgu 53>;
+                       status = "disabled";
+               };
+
                mmcsd: mmcsd@40004000 {
                        compatible = "snps,dw-mshc";
                        reg = <0x40004000 0x1000>;
                        num-slots = <1>;
                        clocks = <&ccu2 CLK_SDIO>, <&ccu1 CLK_CPU_SDIO>;
                        clock-names = "ciu", "biu";
+                       resets = <&rgu 20>;
                        status = "disabled";
                };
 
                        reg = <0x40006100 0x100>;
                        interrupts = <8>;
                        clocks = <&ccu1 CLK_CPU_USB0>;
+                       resets = <&rgu 17>;
                        phys = <&usb0_otg_phy>;
                        phy-names = "usb";
                        has-transaction-translator;
                        reg = <0x40007100 0x100>;
                        interrupts = <9>;
                        clocks = <&ccu1 CLK_CPU_USB1>;
+                       resets = <&rgu 18>;
                        status = "disabled";
                };
 
                        reg = <0x40005000 0x1000>;
                        clocks = <&ccu1 CLK_CPU_EMCDIV>, <&ccu1 CLK_CPU_EMC>;
                        clock-names = "mpmcclk", "apb_pclk";
+                       resets = <&rgu 21>;
                        #address-cells = <2>;
                        #size-cells = <1>;
                        ranges = <0 0 0x1c000000 0x1000000
                        interrupt-names = "combined";
                        clocks = <&cgu BASE_LCD_CLK>, <&ccu1 CLK_CPU_LCD>;
                        clock-names = "clcdclk", "apb_pclk";
+                       resets = <&rgu 16>;
                        status = "disabled";
                };
 
                        interrupt-names = "macirq";
                        clocks = <&ccu1 CLK_CPU_ETHERNET>;
                        clock-names = "stmmaceth";
+                       resets = <&rgu 22>;
+                       reset-names = "stmmaceth";
                        status = "disabled";
                };
 
                        compatible = "nxp,lpc1850-creg", "syscon", "simple-mfd";
                        reg = <0x40043000 0x1000>;
                        clocks = <&ccu1 CLK_CPU_CREG>;
+                       resets = <&rgu 5>;
 
                        usb0_otg_phy: phy@004 {
                                compatible = "nxp,lpc1850-usb-otg-phy";
                                clocks = <&ccu1 CLK_USB0>;
                                #phy-cells = <0>;
                        };
+
+                       dmamux: dma-mux@11c {
+                               compatible = "nxp,lpc1850-dmamux";
+                               #dma-cells = <3>;
+                               dma-requests = <64>;
+                               dma-masters = <&dmac>;
+                       };
                };
 
                cgu: clock-controller@40050000 {
                                      "base_ssp0_clk",  "base_sdio_clk";
                };
 
+               rgu: reset-controller@40053000 {
+                       compatible = "nxp,lpc1850-rgu";
+                       reg = <0x40053000 0x1000>;
+                       clocks = <&cgu BASE_SAFE_CLK>, <&ccu1 CLK_CPU_BUS>;
+                       clock-names = "delay", "reg";
+                       #reset-cells = <1>;
+               };
+
+               watchdog@40080000 {
+                       compatible = "nxp,lpc1850-wwdt";
+                       reg = <0x40080000 0x24>;
+                       interrupts = <49>;
+                       clocks = <&cgu BASE_SAFE_CLK>, <&ccu1 CLK_CPU_WWDT>;
+                       clock-names = "wdtclk", "reg";
+               };
+
                uart0: serial@40081000 {
                        compatible = "nxp,lpc1850-uart", "ns16550a";
                        reg = <0x40081000 0x1000>;
                        interrupts = <24>;
                        clocks = <&ccu2 CLK_APB0_UART0>, <&ccu1 CLK_CPU_UART0>;
                        clock-names = "uartclk", "reg";
+                       resets = <&rgu 44>;
+                       dmas = <&dmamux  1 1 2
+                               &dmamux  2 1 2
+                               &dmamux 11 2 2
+                               &dmamux 12 2 2>;
+                       dma-names = "tx", "rx", "tx", "rx";
                        status = "disabled";
                };
 
                        interrupts = <25>;
                        clocks = <&ccu2 CLK_APB0_UART1>, <&ccu1 CLK_CPU_UART1>;
                        clock-names = "uartclk", "reg";
+                       resets = <&rgu 45>;
+                       dmas = <&dmamux 3 1 2
+                               &dmamux 4 1 2>;
+                       dma-names = "tx", "rx";
                        status = "disabled";
                };
 
                        interrupts = <22>;
                        clocks = <&ccu2 CLK_APB0_SSP0>, <&ccu1 CLK_CPU_SSP0>;
                        clock-names = "sspclk", "apb_pclk";
+                       resets = <&rgu 50>;
+                       dmas = <&dmamux  9 0 2
+                               &dmamux 10 0 2>;
+                       dma-names = "rx", "tx";
                        #address-cells = <1>;
                        #size-cells = <0>;
                        status = "disabled";
                        interrupts = <12>;
                        clocks = <&ccu1 CLK_CPU_TIMER0>;
                        clock-names = "timerclk";
+                       resets = <&rgu 32>;
                };
 
                timer1: timer@40085000 {
                        interrupts = <13>;
                        clocks = <&ccu1 CLK_CPU_TIMER1>;
                        clock-names = "timerclk";
+                       resets = <&rgu 33>;
                };
 
                pinctrl: pinctrl@40086000 {
                        clocks = <&ccu1 CLK_CPU_SCU>;
                };
 
+               i2c0: i2c@400a1000 {
+                       compatible = "nxp,lpc1788-i2c";
+                       reg = <0x400a1000 0x1000>;
+                       interrupts = <18>;
+                       clocks = <&ccu1 CLK_APB1_I2C0>;
+                       resets = <&rgu 48>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       status = "disabled";
+               };
+
                can1: can@400a4000 {
                        compatible = "bosch,c_can";
                        reg = <0x400a4000 0x1000>;
                        interrupts = <43>;
                        clocks = <&ccu1 CLK_APB1_CAN1>;
+                       resets = <&rgu 54>;
                        status = "disabled";
                };
 
                        interrupts = <26>;
                        clocks = <&ccu2 CLK_APB2_UART2>, <&ccu1 CLK_CPU_UART2>;
                        clock-names = "uartclk", "reg";
+                       resets = <&rgu 46>;
+                       dmas = <&dmamux 5 1 2
+                               &dmamux 6 1 2>;
+                       dma-names = "tx", "rx";
                        status = "disabled";
                };
 
                        interrupts = <27>;
                        clocks = <&ccu2 CLK_APB2_UART3>, <&ccu1 CLK_CPU_UART3>;
                        clock-names = "uartclk", "reg";
+                       resets = <&rgu 47>;
+                       dmas = <&dmamux  7 1 2
+                               &dmamux  8 1 2
+                               &dmamux 13 3 2
+                               &dmamux 14 3 2>;
+                       dma-names = "tx", "rx", "rx", "tx";
                        status = "disabled";
                };
 
                        interrupts = <14>;
                        clocks = <&ccu1 CLK_CPU_TIMER2>;
                        clock-names = "timerclk";
+                       resets = <&rgu 34>;
                };
 
                timer3: timer@400c4000 {
                        interrupts = <15>;
                        clocks = <&ccu1 CLK_CPU_TIMER3>;
                        clock-names = "timerclk";
+                       resets = <&rgu 35>;
                };
 
                ssp1: spi@400c5000 {
                        interrupts = <23>;
                        clocks = <&ccu2 CLK_APB2_SSP1>, <&ccu1 CLK_CPU_SSP1>;
                        clock-names = "sspclk", "apb_pclk";
+                       resets = <&rgu 51>;
+                       dmas = <&dmamux 11 2 2
+                               &dmamux 12 2 2
+                               &dmamux  3 3 2
+                               &dmamux  4 3 2
+                               &dmamux  5 2 2
+                               &dmamux  6 2 2
+                               &dmamux 13 2 2
+                               &dmamux 14 2 2>;
+                       dma-names = "rx", "tx", "tx", "rx",
+                                   "tx", "rx", "rx", "tx";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       status = "disabled";
+               };
+
+               i2c1: i2c@400e0000 {
+                       compatible = "nxp,lpc1788-i2c";
+                       reg = <0x400e0000 0x1000>;
+                       interrupts = <19>;
+                       clocks = <&ccu1 CLK_APB3_I2C1>;
+                       resets = <&rgu 49>;
                        #address-cells = <1>;
                        #size-cells = <0>;
                        status = "disabled";
                        reg = <0x400e2000 0x1000>;
                        interrupts = <51>;
                        clocks = <&ccu1 CLK_APB3_CAN0>;
+                       resets = <&rgu 55>;
                        status = "disabled";
                };
 
index 32bc7ff4eb2a02b97fd4d7ba26a70198131aed5d..022d495432c1bd7fda095427c446bc34a7a8e6af 100644 (file)
@@ -15,6 +15,9 @@
 #include "lpc18xx.dtsi"
 #include "lpc4350.dtsi"
 
+#include "dt-bindings/input/input.h"
+#include "dt-bindings/gpio/gpio.h"
+
 / {
        model = "Hitex LPC4350 Evaluation Board";
        compatible = "hitex,lpc4350-eval-board", "nxp,lpc4350";
                device_type = "memory";
                reg = <0x28000000 0x800000>; /* 8 MB */
        };
+
+       pca_buttons {
+               compatible = "gpio-keys-polled";
+               #address-cells = <1>;
+               #size-cells = <0>;
+               poll-interval = <100>;
+               autorepeat;
+
+               button@0 {
+                       label = "joy:right";
+                       linux,code = <KEY_RIGHT>;
+                       gpios = <&pca_gpio 8 GPIO_ACTIVE_LOW>;
+               };
+
+               button@1 {
+                       label = "joy:up";
+                       linux,code = <KEY_UP>;
+                       gpios = <&pca_gpio 9 GPIO_ACTIVE_LOW>;
+               };
+
+
+               button@2 {
+                       label = "joy:enter";
+                       linux,code = <KEY_ENTER>;
+                       gpios = <&pca_gpio 10 GPIO_ACTIVE_LOW>;
+               };
+
+               button@3 {
+                       label = "joy:left";
+                       linux,code = <KEY_LEFT>;
+                       gpios = <&pca_gpio 11 GPIO_ACTIVE_LOW>;
+               };
+
+               button@4 {
+                       label = "joy:down";
+                       linux,code = <KEY_DOWN>;
+                       gpios = <&pca_gpio 12 GPIO_ACTIVE_LOW>;
+               };
+
+               button@5 {
+                       label = "user:sw3";
+                       linux,code = <KEY_F1>;
+                       gpios = <&pca_gpio 13 GPIO_ACTIVE_LOW>;
+               };
+
+               button@6 {
+                       label = "user:sw4";
+                       linux,code = <KEY_F2>;
+                       gpios = <&pca_gpio 14 GPIO_ACTIVE_LOW>;
+               };
+
+               button@7 {
+                       label = "user:sw5";
+                       linux,code = <KEY_F3>;
+                       gpios = <&pca_gpio 15 GPIO_ACTIVE_LOW>;
+               };
+       };
+
+       pca_leds {
+               compatible = "gpio-leds";
+
+               led0 {
+                       label = "ext:led0";
+                       gpios = <&pca_gpio 0 GPIO_ACTIVE_LOW>;
+                       linux,default-trigger = "heartbeat";
+               };
+
+               led1 {
+                       label = "ext:led1";
+                       gpios = <&pca_gpio 1 GPIO_ACTIVE_LOW>;
+               };
+
+               led2 {
+                       label = "ext:led2";
+                       gpios = <&pca_gpio 2 GPIO_ACTIVE_LOW>;
+               };
+
+               led3 {
+                       label = "ext:led3";
+                       gpios = <&pca_gpio 3 GPIO_ACTIVE_LOW>;
+               };
+       };
 };
 
 &pinctrl {
                };
        };
 
+       i2c0_pins: i2c0-pins {
+               i2c0_pins_cfg {
+                       pins = "i2c0_scl", "i2c0_sda";
+                       function = "i2c0";
+                       input-enable;
+               };
+       };
+
+       spifi_pins: spifi-pins {
+               spifi_clk_cfg {
+                       pins = "p3_3";
+                       function = "spifi";
+                       slew-rate = <1>;
+                       bias-disable;
+                       input-enable;
+                       input-schmitt-disable;
+               };
+
+               spifi_mosi_miso_sio2_3_cfg {
+                       pins = "p3_7", "p3_6", "p3_5", "p3_4";
+                       function = "spifi";
+                       slew-rate = <1>;
+                       bias-disable;
+                       input-enable;
+                       input-schmitt-disable;
+               };
+
+               spifi_cs_cfg {
+                       pins = "p3_8";
+                       function = "spifi";
+                       slew-rate = <1>;
+                       bias-disable;
+                       input-enable;
+                       input-schmitt-disable;
+               };
+       };
+
        uart0_pins: uart0-pins {
                uart0_rx_cfg {
                        pins = "pf_11";
        clock-frequency = <25000000>;
 };
 
+&i2c0 {
+       status = "okay";
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c0_pins>;
+       clock-frequency = <400000>;
+
+       /* NXP SE97BTP with temperature sensor + eeprom */
+       sensor@18 {
+               compatible = "nxp,jc42";
+               reg = <0x18>;
+       };
+
+       eeprom@50 {
+               compatible = "nxp,24c02";
+               reg = <0x50>;
+       };
+
+       pca_gpio: gpio@24 {
+               compatible = "nxp,pca9673";
+               reg = <0x24>;
+               gpio-controller;
+               #gpio-cells = <2>;
+       };
+};
+
 &mac {
        status = "okay";
        phy-mode = "mii";
        pinctrl-0 = <&enet_mii_pins>;
 };
 
+&spifi {
+       status = "okay";
+       pinctrl-names = "default";
+       pinctrl-0 = <&spifi_pins>;
+
+       flash@0 {
+               compatible = "jedec,spi-nor";
+               spi-rx-bus-width = <4>;
+               #address-cells = <1>;
+               #size-cells = <1>;
+
+               partition@0 {
+                       label = "bootloader";
+                       reg = <0x000000 0x040000>; /* 256 KiB */
+               };
+
+               partition@1 {
+                       label = "kernel";
+                       reg = <0x040000 0x2c0000>; /* 2.75 MiB */
+               };
+
+               partition@2 {
+                       label = "rootfs";
+                       reg = <0x300000 0x500000>; /* 5 MiB */
+               };
+       };
+};
+
 &uart0 {
        status = "okay";
        pinctrl-names = "default";
index 5f7bdad80963c48881d59286f0f14c7f6bc2d2b2..391121d24daa390a46b1d431123a6ebdd59ac7ba 100644 (file)
                };
        };
 
+       i2c0_pins: i2c0-pins {
+               i2c0_pins_cfg {
+                       pins = "i2c0_scl", "i2c0_sda";
+                       function = "i2c0";
+                       input-enable;
+               };
+       };
+
        sdmmc_pins: sdmmc-pins {
                sdmmc_clk_cfg {
                        pins = "pc_0";
                };
        };
 
+       spifi_pins: spifi-pins {
+               spifi_clk_cfg {
+                       pins = "p3_3";
+                       function = "spifi";
+                       slew-rate = <1>;
+                       bias-disable;
+                       input-enable;
+                       input-schmitt-disable;
+               };
+
+               spifi_mosi_miso_sio2_3_cfg {
+                       pins = "p3_7", "p3_6", "p3_5", "p3_4";
+                       function = "spifi";
+                       slew-rate = <0>;
+                       bias-disable;
+                       input-enable;
+                       input-schmitt-disable;
+               };
+
+               spifi_cs_cfg {
+                       pins = "p3_8";
+                       function = "spifi";
+                       bias-disable;
+               };
+       };
+
+       ssp0_pins: ssp0-pins {
+               ssp0_sck_miso_mosi {
+                       pins = "pf_0", "pf_2", "pf_3";
+                       function = "ssp0";
+                       slew-rate = <1>;
+                       bias-pull-down;
+                       input-enable;
+                       input-schmitt-disable;
+               };
+
+               ssp0_ssel {
+                       pins = "pf_1";
+                       function = "ssp0";
+                       bias-pull-up;
+               };
+       };
+
        uart0_pins: uart0-pins {
                uart0_rx_cfg {
                        pins = "pf_11";
        };
 };
 
+&i2c0 {
+       status = "okay";
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c0_pins>;
+       clock-frequency = <400000>;
+
+       lm75@48 {
+               compatible = "nxp,lm75";
+               reg = <0x48>;
+       };
+
+       eeprom@57 {
+               compatible = "microchip,24c64";
+               reg = <0x57>;
+       };
+};
+
 &emc {
        status = "okay";
        pinctrl-names = "default";
        pinctrl-0 = <&sdmmc_pins>;
 };
 
+&spifi {
+       status = "okay";
+       pinctrl-names = "default";
+       pinctrl-0 = <&spifi_pins>;
+
+       flash@0 {
+               compatible = "jedec,spi-nor";
+               spi-cpol;
+               spi-cpha;
+               spi-rx-bus-width = <4>;
+               #address-cells = <1>;
+               #size-cells = <1>;
+
+               partition@0 {
+                       label = "data";
+                       reg = <0 0x200000>;
+               };
+       };
+};
+
+&ssp0 {
+       status = "okay";
+       pinctrl-names = "default";
+       pinctrl-0 = <&ssp0_pins>;
+       num-cs = <1>;
+};
+
 &uart0 {
        status = "okay";
        pinctrl-names = "default";
index e008f9367510dc6274693f849fe24ed09d7cffa0..fbb89d13401ea34e3b45198a062e06b230322e41 100644 (file)
 
 &i2c0 {
        status = "okay";
+
+       ina220@40 {
+               compatible = "ti,ina220";
+               reg = <0x40>;
+               shunt-resistor = <1000>;
+       };
+
+       ina220@41 {
+               compatible = "ti,ina220";
+               reg = <0x41>;
+               shunt-resistor = <1000>;
+       };
+
 };
 
 &i2c1 {
index 973a496207fc069bc8af040e16cbb74febcf1c5c..9430a99281992dec3f3502de556b8521db492c69 100644 (file)
@@ -53,6 +53,7 @@
        interrupt-parent = <&gic>;
 
        aliases {
+               crypto = &crypto;
                ethernet0 = &enet0;
                ethernet1 = &enet1;
                ethernet2 = &enet2;
                        big-endian;
                };
 
+               crypto: crypto@1700000 {
+                       compatible = "fsl,sec-v5.0", "fsl,sec-v4.0";
+                       fsl,sec-era = <7>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       reg              = <0x0 0x1700000 0x0 0x100000>;
+                       ranges           = <0x0 0x0 0x1700000 0x100000>;
+                       interrupts       = <GIC_SPI 107 IRQ_TYPE_LEVEL_HIGH>;
+
+                       sec_jr0: jr@10000 {
+                               compatible = "fsl,sec-v5.0-job-ring",
+                                    "fsl,sec-v4.0-job-ring";
+                               reg = <0x10000 0x10000>;
+                               interrupts = <GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>;
+                       };
+
+                       sec_jr1: jr@20000 {
+                               compatible = "fsl,sec-v5.0-job-ring",
+                                    "fsl,sec-v4.0-job-ring";
+                               reg = <0x20000 0x10000>;
+                               interrupts = <GIC_SPI 104 IRQ_TYPE_LEVEL_HIGH>;
+                       };
+
+                       sec_jr2: jr@30000 {
+                               compatible = "fsl,sec-v5.0-job-ring",
+                                    "fsl,sec-v4.0-job-ring";
+                               reg = <0x30000 0x10000>;
+                               interrupts = <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>;
+                       };
+
+                       sec_jr3: jr@40000 {
+                               compatible = "fsl,sec-v5.0-job-ring",
+                                    "fsl,sec-v4.0-job-ring";
+                               reg = <0x40000 0x10000>;
+                               interrupts = <GIC_SPI 106 IRQ_TYPE_LEVEL_HIGH>;
+                       };
+
+               };
+
                clockgen: clocking@1ee1000 {
                        #address-cells = <1>;
                        #size-cells = <1>;
                        model = "eTSEC";
                        fsl,magic-packet;
                        ranges;
+                       dma-coherent;
 
                        queue-group@2d10000 {
                                #address-cells = <2>;
                        interrupt-parent = <&gic>;
                        model = "eTSEC";
                        ranges;
+                       dma-coherent;
 
                        queue-group@2d50000  {
                                #address-cells = <2>;
                        interrupt-parent = <&gic>;
                        model = "eTSEC";
                        ranges;
+                       dma-coherent;
 
                        queue-group@2d90000  {
                                #address-cells = <2>;
                        reg = <0x0 0x3100000 0x0 0x10000>;
                        interrupts = <GIC_SPI 93 IRQ_TYPE_LEVEL_HIGH>;
                        dr_mode = "host";
+                       snps,quirk-frame-length-adjustment = <0x20>;
                };
        };
 };
diff --git a/arch/arm/boot/dts/meson8b-mxq.dts b/arch/arm/boot/dts/meson8b-mxq.dts
new file mode 100644 (file)
index 0000000..c7fdaea
--- /dev/null
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2015 Endless Mobile, Inc.
+ * Author: Carlo Caione <carlo@endlessm.com>
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This library 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; either version 2 of the
+ *     License, or (at your option) any later version.
+ *
+ *     This library is distributed in the hope that it will be useful,
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ *     You should have received a copy of the GNU General Public License
+ *     along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Or, alternatively,
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use,
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/dts-v1/;
+#include "meson8b.dtsi"
+
+/ {
+       model = "TRONFY MXQ S805";
+       compatible = "tronfy,mxq", "amlogic,meson8b";
+
+       aliases {
+               serial0 = &uart_AO;
+       };
+
+       memory {
+               reg = <0x40000000 0x40000000>;
+       };
+};
+
+&uart_AO {
+       status = "okay";
+       pinctrl-0 = <&uart_ao_a_pins>;
+       pinctrl-names = "default";
+};
diff --git a/arch/arm/boot/dts/meson8b-odroidc1.dts b/arch/arm/boot/dts/meson8b-odroidc1.dts
new file mode 100644 (file)
index 0000000..a8e2911
--- /dev/null
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2015 Endless Mobile, Inc.
+ * Author: Carlo Caione <carlo@endlessm.com>
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This library 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; either version 2 of the
+ *     License, or (at your option) any later version.
+ *
+ *     This library is distributed in the hope that it will be useful,
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ *     You should have received a copy of the GNU General Public License
+ *     along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Or, alternatively,
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use,
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/dts-v1/;
+#include "meson8b.dtsi"
+
+/ {
+       model = "Hardkernel ODROID-C1";
+       compatible = "hardkernel,odroid-c1", "amlogic,meson8b";
+
+       aliases {
+               serial0 = &uart_AO;
+       };
+
+       memory {
+               reg = <0x40000000 0x40000000>;
+       };
+};
+
+&uart_AO {
+       status = "okay";
+       pinctrl-0 = <&uart_ao_a_pins>;
+       pinctrl-names = "default";
+};
diff --git a/arch/arm/boot/dts/meson8b.dtsi b/arch/arm/boot/dts/meson8b.dtsi
new file mode 100644 (file)
index 0000000..ee352bf
--- /dev/null
@@ -0,0 +1,186 @@
+/*
+ * Copyright 2015 Endless Mobile, Inc.
+ * Author: Carlo Caione <carlo@endlessm.com>
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This library 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; either version 2 of the
+ *     License, or (at your option) any later version.
+ *
+ *     This library is distributed in the hope that it will be useful,
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ *     You should have received a copy of the GNU General Public License
+ *     along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Or, alternatively,
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use,
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#include <dt-bindings/clock/meson8b-clkc.h>
+#include <dt-bindings/gpio/meson8b-gpio.h>
+#include "skeleton.dtsi"
+
+/ {
+       interrupt-parent = <&gic>;
+
+       cpus {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               cpu@200 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a5";
+                       next-level-cache = <&L2>;
+                       reg = <0x200>;
+               };
+
+               cpu@201 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a5";
+                       next-level-cache = <&L2>;
+                       reg = <0x201>;
+               };
+
+               cpu@202 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a5";
+                       next-level-cache = <&L2>;
+                       reg = <0x202>;
+               };
+
+               cpu@203 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a5";
+                       next-level-cache = <&L2>;
+                       reg = <0x203>;
+               };
+       };
+
+       soc {
+               compatible = "simple-bus";
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges;
+
+               L2: l2-cache-controller@c4200000 {
+                       compatible = "arm,pl310-cache";
+                       reg = <0xc4200000 0x1000>;
+                       cache-unified;
+                       cache-level = <2>;
+               };
+
+               gic: interrupt-controller@c4301000 {
+                       compatible = "arm,cortex-a9-gic";
+                       reg = <0xc4301000 0x1000>,
+                             <0xc4300100 0x0100>;
+                       interrupt-controller;
+                       #interrupt-cells = <3>;
+               };
+
+               timer@c1109940 {
+                       compatible = "amlogic,meson6-timer";
+                       reg = <0xc1109940 0x18>;
+                       interrupts = <0 10 1>;
+               };
+
+               uart_AO: serial@c81004c0 {
+                       compatible = "amlogic,meson-uart";
+                       reg = <0xc81004c0 0x18>;
+                       interrupts = <0 90 1>;
+                       clocks = <&clkc CLKID_CLK81>;
+                       status = "disabled";
+               };
+
+               uart_A: serial@c11084c0 {
+                       compatible = "amlogic,meson-uart";
+                       reg = <0xc11084c0 0x18>;
+                       interrupts = <0 26 1>;
+                       clocks = <&clkc CLKID_CLK81>;
+                       status = "disabled";
+               };
+
+               uart_B: serial@c11084dc {
+                       compatible = "amlogic,meson-uart";
+                       reg = <0xc11084dc 0x18>;
+                       interrupts = <0 75 1>;
+                       clocks = <&clkc CLKID_CLK81>;
+                       status = "disabled";
+               };
+
+               uart_C: serial@c1108700 {
+                       compatible = "amlogic,meson-uart";
+                       reg = <0xc1108700 0x18>;
+                       interrupts = <0 93 1>;
+                       clocks = <&clkc CLKID_CLK81>;
+                       status = "disabled";
+               };
+
+               clkc: clock-controller@c1104000 {
+                       #clock-cells = <1>;
+                       compatible = "amlogic,meson8b-clkc";
+                       reg = <0xc1108000 0x4>, <0xc1104000 0x460>;
+               };
+
+               pinctrl: pinctrl@c1109880 {
+                       compatible = "amlogic,meson8b-pinctrl";
+                       reg = <0xc1109880 0x10>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges;
+
+                       gpio: banks@c11080b0 {
+                               reg = <0xc11080b0 0x28>,
+                                     <0xc11080e8 0x18>,
+                                     <0xc1108120 0x18>,
+                                     <0xc1108030 0x38>;
+                               reg-names = "mux", "pull", "pull-enable", "gpio";
+                               gpio-controller;
+                               #gpio-cells = <2>;
+                       };
+
+                       gpio_ao: ao-bank@c1108030 {
+                               reg = <0xc8100014 0x4>,
+                                     <0xc810002c 0x4>,
+                                     <0xc8100024 0x8>;
+                               reg-names = "mux", "pull", "gpio";
+                               gpio-controller;
+                               #gpio-cells = <2>;
+                       };
+
+                       uart_ao_a_pins: uart_ao_a {
+                               mux {
+                                       groups = "uart_tx_ao_a", "uart_rx_ao_a";
+                                       function = "uart_ao";
+                               };
+                       };
+               };
+       };
+}; /* end of / */
index ca3402e8240be1478568f23622c3bed965e06cfa..52086c8018e203648db36fd6b715d866935f3d34 100644 (file)
@@ -23,6 +23,7 @@
        cpus {
                #address-cells = <1>;
                #size-cells = <0>;
+               enable-method = "mediatek,mt81xx-tz-smp";
 
                cpu@0 {
                        device_type = "cpu";
 
        };
 
+       reserved-memory {
+               #address-cells = <2>;
+               #size-cells = <2>;
+               ranges;
+
+               trustzone-bootinfo@80002000 {
+                       compatible = "mediatek,trustzone-bootinfo";
+                       reg = <0 0x80002000 0 0x1000>;
+               };
+       };
+
        clocks {
                #address-cells = <2>;
                #size-cells = <2>;
                 };
        };
 
+       timer {
+               compatible = "arm,armv7-timer";
+               interrupt-parent = <&gic>;
+               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 = <13000000>;
+               arm,cpu-registers-not-fw-configured;
+       };
+
        soc {
                #address-cells = <2>;
                #size-cells = <2>;
index 357a91fc2d1d137607628242e536e6ebf673e2ed..460db6d05952985d705a96f1c2979f46d91bded1 100644 (file)
@@ -32,7 +32,6 @@
                        compatible = "mediatek,mt6397-regulator";
 
                        mt6397_vpca15_reg: buck_vpca15 {
-                               regulator-compatible = "buck_vpca15";
                                regulator-name = "vpca15";
                                regulator-min-microvolt = < 850000>;
                                regulator-max-microvolt = <1350000>;
@@ -41,7 +40,6 @@
                        };
 
                        mt6397_vpca7_reg: buck_vpca7 {
-                               regulator-compatible = "buck_vpca7";
                                regulator-name = "vpca7";
                                regulator-min-microvolt = < 850000>;
                                regulator-max-microvolt = <1350000>;
@@ -50,7 +48,6 @@
                        };
 
                        mt6397_vsramca15_reg: buck_vsramca15 {
-                               regulator-compatible = "buck_vsramca15";
                                regulator-name = "vsramca15";
                                regulator-min-microvolt = < 850000>;
                                regulator-max-microvolt = <1350000>;
@@ -59,7 +56,6 @@
                        };
 
                        mt6397_vsramca7_reg: buck_vsramca7 {
-                               regulator-compatible = "buck_vsramca7";
                                regulator-name = "vsramca7";
                                regulator-min-microvolt = < 850000>;
                                regulator-max-microvolt = <1350000>;
@@ -68,7 +64,6 @@
                        };
 
                        mt6397_vcore_reg: buck_vcore {
-                               regulator-compatible = "buck_vcore";
                                regulator-name = "vcore";
                                regulator-min-microvolt = < 850000>;
                                regulator-max-microvolt = <1350000>;
@@ -77,7 +72,6 @@
                        };
 
                        mt6397_vgpu_reg: buck_vgpu {
-                               regulator-compatible = "buck_vgpu";
                                regulator-name = "vgpu";
                                regulator-min-microvolt = < 700000>;
                                regulator-max-microvolt = <1350000>;
@@ -86,7 +80,6 @@
                        };
 
                        mt6397_vdrm_reg: buck_vdrm {
-                               regulator-compatible = "buck_vdrm";
                                regulator-name = "vdrm";
                                regulator-min-microvolt = <1200000>;
                                regulator-max-microvolt = <1400000>;
@@ -95,7 +88,6 @@
                        };
 
                        mt6397_vio18_reg: buck_vio18 {
-                               regulator-compatible = "buck_vio18";
                                regulator-name = "vio18";
                                regulator-min-microvolt = <1620000>;
                                regulator-max-microvolt = <1980000>;
                        };
 
                        mt6397_vtcxo_reg: ldo_vtcxo {
-                               regulator-compatible = "ldo_vtcxo";
                                regulator-name = "vtcxo";
                                regulator-always-on;
                        };
 
                        mt6397_va28_reg: ldo_va28 {
-                               regulator-compatible = "ldo_va28";
                                regulator-name = "va28";
                                regulator-always-on;
                        };
 
                        mt6397_vcama_reg: ldo_vcama {
-                               regulator-compatible = "ldo_vcama";
                                regulator-name = "vcama";
                                regulator-min-microvolt = <1500000>;
                                regulator-max-microvolt = <2800000>;
                        };
 
                        mt6397_vio28_reg: ldo_vio28 {
-                               regulator-compatible = "ldo_vio28";
                                regulator-name = "vio28";
                                regulator-always-on;
                        };
 
                        mt6397_vusb_reg: ldo_vusb {
-                               regulator-compatible = "ldo_vusb";
                                regulator-name = "vusb";
                        };
 
                        mt6397_vmc_reg: ldo_vmc {
-                               regulator-compatible = "ldo_vmc";
                                regulator-name = "vmc";
                                regulator-min-microvolt = <1800000>;
                                regulator-max-microvolt = <3300000>;
                        };
 
                        mt6397_vmch_reg: ldo_vmch {
-                               regulator-compatible = "ldo_vmch";
                                regulator-name = "vmch";
                                regulator-min-microvolt = <3000000>;
                                regulator-max-microvolt = <3300000>;
                        };
 
                        mt6397_vemc_3v3_reg: ldo_vemc3v3 {
-                               regulator-compatible = "ldo_vemc3v3";
                                regulator-name = "vemc_3v3";
                                regulator-min-microvolt = <3000000>;
                                regulator-max-microvolt = <3300000>;
                        };
 
                        mt6397_vgp1_reg: ldo_vgp1 {
-                               regulator-compatible = "ldo_vgp1";
                                regulator-name = "vcamd";
                                regulator-min-microvolt = <1220000>;
                                regulator-max-microvolt = <3300000>;
                        };
 
                        mt6397_vgp2_reg: ldo_vgp2 {
-                               regulator-compatible = "ldo_vgp2";
                                regulator-name = "vcamio";
                                regulator-min-microvolt = <1000000>;
                                regulator-max-microvolt = <3300000>;
                        };
 
                        mt6397_vgp3_reg: ldo_vgp3 {
-                               regulator-compatible = "ldo_vgp3";
                                regulator-name = "vcamaf";
                                regulator-min-microvolt = <1200000>;
                                regulator-max-microvolt = <3300000>;
                        };
 
                        mt6397_vgp4_reg: ldo_vgp4 {
-                               regulator-compatible = "ldo_vgp4";
                                regulator-name = "vgp4";
                                regulator-min-microvolt = <1200000>;
                                regulator-max-microvolt = <3300000>;
                        };
 
                        mt6397_vgp5_reg: ldo_vgp5 {
-                               regulator-compatible = "ldo_vgp5";
                                regulator-name = "vgp5";
                                regulator-min-microvolt = <1200000>;
                                regulator-max-microvolt = <3000000>;
                        };
 
                        mt6397_vgp6_reg: ldo_vgp6 {
-                               regulator-compatible = "ldo_vgp6";
                                regulator-name = "vgp6";
                                regulator-min-microvolt = <1200000>;
                                regulator-max-microvolt = <3300000>;
                        };
 
                        mt6397_vibr_reg: ldo_vibr {
-                               regulator-compatible = "ldo_vibr";
                                regulator-name = "vibr";
                                regulator-min-microvolt = <1300000>;
                                regulator-max-microvolt = <3300000>;
index 08371dbae543d8e8c07be0477db16d27ca46c559..cb99b02d2cccc19c0b5c60c4eed6d994424fb790 100644 (file)
@@ -46,6 +46,7 @@
        cpus {
                #address-cells = <1>;
                #size-cells = <0>;
+               enable-method = "mediatek,mt81xx-tz-smp";
 
                cpu0: cpu@0 {
                        device_type = "cpu";
                };
        };
 
+       reserved-memory {
+               #address-cells = <2>;
+               #size-cells = <2>;
+               ranges;
+
+               trustzone-bootinfo@80002000 {
+                       compatible = "mediatek,trustzone-bootinfo";
+                       reg = <0 0x80002000 0 0x1000>;
+               };
+       };
+
        clocks {
                #address-cells = <2>;
                #size-cells = <2>;
                };
        };
 
+       timer {
+               compatible = "arm,armv7-timer";
+               interrupt-parent = <&gic>;
+               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 = <13000000>;
+               arm,cpu-registers-not-fw-configured;
+       };
+
        soc {
                #address-cells = <2>;
                #size-cells = <2>;
index 390c91aea16d479e1b7cc10b6a82a278d2732c8f..ee5a0bb22354df10d9d3fc6d4179f7f8460fd933 100644 (file)
@@ -16,7 +16,7 @@
 
        cpus {
                cpu@0 {
-                       compatible = "arm,arm926ejs";
+                       compatible = "arm,arm926ej-s";
                };
        };
 
index c9f1e93a95aec34e86f6ee5bfa1cd78ae04792d0..8491f46c61b769a13b841dfce9502e2c6274c0e9 100644 (file)
@@ -9,9 +9,9 @@
        ocp {
                i2c@0 {
                        compatible = "i2c-cbus-gpio";
-                       gpios = <&gpio3 2 0 /* gpio66 clk */
-                                &gpio3 1 0 /* gpio65 dat */
-                                &gpio3 0 0 /* gpio64 sel */
+                       gpios = <&gpio3 2 GPIO_ACTIVE_HIGH /* gpio66 clk */
+                                &gpio3 1 GPIO_ACTIVE_HIGH /* gpio65 dat */
+                                &gpio3 0 GPIO_ACTIVE_HIGH /* gpio64 sel */
                                >;
                        #address-cells = <1>;
                        #size-cells = <0>;
index 7c4dca122a91d99a9848a691ce96a917294f59eb..73f1e3a8f62c436a0eea6dcae58958d07663a42d 100644 (file)
@@ -80,7 +80,7 @@
                regulator-name = "hsusb2_vbus";
                regulator-min-microvolt = <3300000>;
                regulator-max-microvolt = <3300000>;
-               gpio = <&twl_gpio 18 0>;        /* GPIO LEDA */
+               gpio = <&twl_gpio 18 GPIO_ACTIVE_HIGH>; /* GPIO LEDA */
                startup-delay-us = <70000>;
        };
 
index 67659a0ed13e12727e22c26703d29007e628bc99..274c2c482aaa2200d54861aeba1ca0d492609bbd 100644 (file)
@@ -55,7 +55,7 @@
                regulator-name = "hsusb2_vbus";
                regulator-min-microvolt = <3300000>;
                regulator-max-microvolt = <3300000>;
-               gpio = <&twl_gpio 18 0>;        /* GPIO LEDA */
+               gpio = <&twl_gpio 18 GPIO_ACTIVE_HIGH>; /* GPIO LEDA */
                startup-delay-us = <70000>;
        };
 
index 4d091ca43e259c938be3d4973edff15789a27c37..8c813e77b17f4237c0f262c44f396e0fca2e6d76 100644 (file)
 
                interrupt-parent = <&gpio2>;
                interrupts = <25 0>;            /* gpio_57 */
-               pendown-gpio = <&gpio2 25 0>;
+               pendown-gpio = <&gpio2 25 GPIO_ACTIVE_HIGH>;
 
                ti,x-min = /bits/ 16 <0x0>;
                ti,x-max = /bits/ 16 <0x0fff>;
index e84184de2a4aa2334d02ded31ba923af8abc6a95..4813e96157b3a62ce51a40ab1562fc5a5b440872 100644 (file)
@@ -54,7 +54,7 @@
 
                interrupt-parent = <&gpio1>;
                interrupts = <27 0>;            /* gpio_27 */
-               pendown-gpio = <&gpio1 27 0>;
+               pendown-gpio = <&gpio1 27 GPIO_ACTIVE_HIGH>;
 
                ti,x-min = /bits/ 16 <0x0>;
                ti,x-max = /bits/ 16 <0x0fff>;
index b2589f96d5f7c3a7b0b7cf29698482bc7b89df6f..090475083c2f2861136bb4b8f5187422dd6a187b 100644 (file)
@@ -26,7 +26,7 @@
                regulator-name = "vwl1271";
                regulator-min-microvolt = <1800000>;
                regulator-max-microvolt = <1800000>;
-               gpio = <&gpio5 22 0>;   /* gpio150 */
+               gpio = <&gpio5 22 GPIO_ACTIVE_HIGH>;    /* gpio150 */
                startup-delay-us = <70000>;
                enable-active-high;
                vin-supply = <&vmmc2>;
@@ -91,7 +91,7 @@
        tsc2046@0 {
                interrupt-parent = <&gpio6>;
                interrupts = <15 0>;            /* gpio175 */
-               pendown-gpio = <&gpio6 15 0>;
+               pendown-gpio = <&gpio6 15 GPIO_ACTIVE_HIGH>;
        };
 };
 
index 7166d8876ea85b89c0e417682c22afd14f5c086d..e14d15e5abc89bb245b5f29eb7833eeebe3ea667 100644 (file)
                pinctrl-names = "default";
                pinctrl-0 = <&spi_gpio_pins>;
 
-               gpio-sck = <&gpio1 12 0>;
-               gpio-miso = <&gpio1 18 0>;
-               gpio-mosi = <&gpio1 20 0>;
-               cs-gpios = <&gpio1 19 0>;
+               gpio-sck = <&gpio1 12 GPIO_ACTIVE_HIGH>;
+               gpio-miso = <&gpio1 18 GPIO_ACTIVE_HIGH>;
+               gpio-mosi = <&gpio1 20 GPIO_ACTIVE_HIGH>;
+               cs-gpios = <&gpio1 19 GPIO_ACTIVE_HIGH>;
                num-chipselects = <1>;
 
                /* lcd panel */
 
        tv_amp: opa362 {
                compatible = "ti,opa362";
-               enable-gpios = <&gpio1 23 0>;
+               enable-gpios = <&gpio1 23 GPIO_ACTIVE_HIGH>;
 
                ports {
                        #address-cells = <1>;
index 52b386f6865bd677ac31103bd64686dd2f823bf0..600b6ca5a1bdc03795a85855c6394e6f1f2bf397 100644 (file)
@@ -12,6 +12,6 @@
        model = "Goldelico GTA04A5";
 
        sound {
-               ti,jack-det-gpio = <&twl_gpio 2 0>;    /* GTA04A5 only */
+               ti,jack-det-gpio = <&twl_gpio 2 GPIO_ACTIVE_HIGH>;    /* GTA04A5 only */
        };
 };
index 2230e1c03320d1d4f4ce5c041f80126b3c9691f6..3caf062f882c69fd3d62edcf14b85c32359b8726 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Common device tree for IGEP boards based on AM/DM37x
  *
- * Copyright (C) 2012 Javier Martinez Canillas <javier@collabora.co.uk>
+ * Copyright (C) 2012 Javier Martinez Canillas <javier@osg.samsung.com>
  * Copyright (C) 2012 Enric Balletbo i Serra <eballetbo@gmail.com>
  *
  * This program is free software; you can redistribute it and/or modify
 &omap3_pmx_core {
        uart1_pins: pinmux_uart1_pins {
                pinctrl-single,pins = <
-                       0x152 (PIN_INPUT | MUX_MODE0)           /* uart1_rx.uart1_rx */
-                       0x14c (PIN_OUTPUT |MUX_MODE0)           /* uart1_tx.uart1_tx */
+                       OMAP3_CORE1_IOPAD(0x2182, PIN_INPUT | MUX_MODE0)        /* uart1_rx.uart1_rx */
+                       OMAP3_CORE1_IOPAD(0x217c, PIN_OUTPUT | MUX_MODE0)       /* uart1_tx.uart1_tx */
                >;
        };
 
        uart3_pins: pinmux_uart3_pins {
                pinctrl-single,pins = <
-                       0x16e (PIN_INPUT | MUX_MODE0)           /* uart3_rx.uart3_rx */
-                       0x170 (PIN_OUTPUT | MUX_MODE0)          /* uart3_tx.uart3_tx */
+                       OMAP3_CORE1_IOPAD(0x219e, PIN_INPUT | MUX_MODE0)        /* uart3_rx.uart3_rx */
+                       OMAP3_CORE1_IOPAD(0x21a0, PIN_OUTPUT | MUX_MODE0)       /* uart3_tx.uart3_tx */
                >;
        };
 
        mcbsp2_pins: pinmux_mcbsp2_pins {
                pinctrl-single,pins = <
-                       0x10c (PIN_INPUT | MUX_MODE0)           /* mcbsp2_fsx.mcbsp2_fsx */
-                       0x10e (PIN_INPUT | MUX_MODE0)           /* mcbsp2_clkx.mcbsp2_clkx */
-                       0x110 (PIN_INPUT | MUX_MODE0)           /* mcbsp2_dr.mcbsp2.dr */
-                       0x112 (PIN_OUTPUT | MUX_MODE0)          /* mcbsp2_dx.mcbsp2_dx */
+                       OMAP3_CORE1_IOPAD(0x213c, PIN_INPUT | MUX_MODE0)        /* mcbsp2_fsx.mcbsp2_fsx */
+                       OMAP3_CORE1_IOPAD(0x213e, PIN_INPUT | MUX_MODE0)        /* mcbsp2_clkx.mcbsp2_clkx */
+                       OMAP3_CORE1_IOPAD(0x2140, PIN_INPUT | MUX_MODE0)        /* mcbsp2_dr.mcbsp2.dr */
+                       OMAP3_CORE1_IOPAD(0x2142, PIN_OUTPUT | MUX_MODE0)       /* mcbsp2_dx.mcbsp2_dx */
                >;
        };
 
        mmc1_pins: pinmux_mmc1_pins {
                pinctrl-single,pins = <
-                       0x114 (PIN_INPUT_PULLUP | MUX_MODE0)    /* sdmmc1_clk.sdmmc1_clk */
-                       0x116 (PIN_INPUT_PULLUP | MUX_MODE0)    /* sdmmc1_cmd.sdmmc1_cmd */
-                       0x118 (PIN_INPUT_PULLUP | MUX_MODE0)    /* sdmmc1_dat0.sdmmc1_dat0 */
-                       0x11a (PIN_INPUT_PULLUP | MUX_MODE0)    /* sdmmc1_dat1.sdmmc1_dat1 */
-                       0x11c (PIN_INPUT_PULLUP | MUX_MODE0)    /* sdmmc1_dat2.sdmmc1_dat2 */
-                       0x11e (PIN_INPUT_PULLUP | MUX_MODE0)    /* sdmmc1_dat3.sdmmc1_dat3 */
+                       OMAP3_CORE1_IOPAD(0x2144, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc1_clk.sdmmc1_clk */
+                       OMAP3_CORE1_IOPAD(0x2146, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc1_cmd.sdmmc1_cmd */
+                       OMAP3_CORE1_IOPAD(0x2148, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc1_dat0.sdmmc1_dat0 */
+                       OMAP3_CORE1_IOPAD(0x214a, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc1_dat1.sdmmc1_dat1 */
+                       OMAP3_CORE1_IOPAD(0x214c, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc1_dat2.sdmmc1_dat2 */
+                       OMAP3_CORE1_IOPAD(0x214e, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc1_dat3.sdmmc1_dat3 */
                >;
        };
 
        mmc2_pins: pinmux_mmc2_pins {
                pinctrl-single,pins = <
-                       0x128 (PIN_INPUT_PULLUP | MUX_MODE0)    /* sdmmc2_clk.sdmmc2_clk */
-                       0x12a (PIN_INPUT_PULLUP | MUX_MODE0)    /* sdmmc2_cmd.sdmmc2_cmd */
-                       0x12c (PIN_INPUT_PULLUP | MUX_MODE0)    /* sdmmc2_dat0.sdmmc2_dat0 */
-                       0x12e (PIN_INPUT_PULLUP | MUX_MODE0)    /* sdmmc2_dat1.sdmmc2_dat1 */
-                       0x130 (PIN_INPUT_PULLUP | MUX_MODE0)    /* sdmmc2_dat2.sdmmc2_dat2 */
-                       0x132 (PIN_INPUT_PULLUP | MUX_MODE0)    /* sdmmc2_dat3.sdmmc2_dat3 */
+                       OMAP3_CORE1_IOPAD(0x2158, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_clk.sdmmc2_clk */
+                       OMAP3_CORE1_IOPAD(0x215a, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_cmd.sdmmc2_cmd */
+                       OMAP3_CORE1_IOPAD(0x215c, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_dat0.sdmmc2_dat0 */
+                       OMAP3_CORE1_IOPAD(0x215e, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_dat1.sdmmc2_dat1 */
+                       OMAP3_CORE1_IOPAD(0x2160, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_dat2.sdmmc2_dat2 */
+                       OMAP3_CORE1_IOPAD(0x2162, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_dat3.sdmmc2_dat3 */
                >;
        };
 
        i2c1_pins: pinmux_i2c1_pins {
                pinctrl-single,pins = <
-                       0x18a (PIN_INPUT | MUX_MODE0)   /* i2c1_scl.i2c1_scl */
-                       0x18c (PIN_INPUT | MUX_MODE0)   /* i2c1_sda.i2c1_sda */
+                       OMAP3_CORE1_IOPAD(0x21ba, PIN_INPUT | MUX_MODE0)        /* i2c1_scl.i2c1_scl */
+                       OMAP3_CORE1_IOPAD(0x21bc, PIN_INPUT | MUX_MODE0)        /* i2c1_sda.i2c1_sda */
                >;
        };
 
        i2c3_pins: pinmux_i2c3_pins {
                pinctrl-single,pins = <
-                       0x192 (PIN_INPUT | MUX_MODE0)   /* i2c3_scl.i2c3_scl */
-                       0x194 (PIN_INPUT | MUX_MODE0)   /* i2c3_sda.i2c3_sda */
+                       OMAP3_CORE1_IOPAD(0x21c2, PIN_INPUT | MUX_MODE0)        /* i2c3_scl.i2c3_scl */
+                       OMAP3_CORE1_IOPAD(0x21c4, PIN_INPUT | MUX_MODE0)        /* i2c3_sda.i2c3_sda */
                >;
        };
 };
                twl_audio: audio {
                        compatible = "ti,twl4030-audio";
                        codec {
-                             };
+                       };
                };
        };
 };
 };
 
 &mmc1 {
-      pinctrl-names = "default";
-      pinctrl-0 = <&mmc1_pins>;
-      vmmc-supply = <&vmmc1>;
-      vmmc_aux-supply = <&vsim>;
-      bus-width = <4>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&mmc1_pins>;
+       vmmc-supply = <&vmmc1>;
+       vmmc_aux-supply = <&vsim>;
+       bus-width = <4>;
 };
 
 &mmc3 {
 };
 
 &uart1 {
-       pinctrl-names = "default";
-       pinctrl-0 = <&uart1_pins>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart1_pins>;
 };
 
 &uart3 {
-       pinctrl-names = "default";
-       pinctrl-0 = <&uart3_pins>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart3_pins>;
 };
 
 &twl_gpio {
index 5ad688c57a0063faaabce22df06e3975fffbf931..d90f12c39307a14ba5a346ebe3b535bee9a455c7 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Common Device Tree Source for IGEPv2
  *
- * Copyright (C) 2014 Javier Martinez Canillas <javier@collabora.co.uk>
+ * Copyright (C) 2014 Javier Martinez Canillas <javier@osg.samsung.com>
  * Copyright (C) 2014 Enric Balletbo i Serra <eballetbo@gmail.com>
  *
  * This program is free software; you can redistribute it and/or modify
 
        tfp410_pins: pinmux_tfp410_pins {
                pinctrl-single,pins = <
-                       0x196 (PIN_OUTPUT | MUX_MODE4)   /* hdq_sio.gpio_170 */
+                       OMAP3_CORE1_IOPAD(0x21c6, PIN_OUTPUT | MUX_MODE4)   /* hdq_sio.gpio_170 */
                >;
        };
 
        dss_dpi_pins: pinmux_dss_dpi_pins {
                pinctrl-single,pins = <
-                       0x0a4 (PIN_OUTPUT | MUX_MODE0)   /* dss_pclk.dss_pclk */
-                       0x0a6 (PIN_OUTPUT | MUX_MODE0)   /* dss_hsync.dss_hsync */
-                       0x0a8 (PIN_OUTPUT | MUX_MODE0)   /* dss_vsync.dss_vsync */
-                       0x0aa (PIN_OUTPUT | MUX_MODE0)   /* dss_acbias.dss_acbias */
-                       0x0ac (PIN_OUTPUT | MUX_MODE0)   /* dss_data0.dss_data0 */
-                       0x0ae (PIN_OUTPUT | MUX_MODE0)   /* dss_data1.dss_data1 */
-                       0x0b0 (PIN_OUTPUT | MUX_MODE0)   /* dss_data2.dss_data2 */
-                       0x0b2 (PIN_OUTPUT | MUX_MODE0)   /* dss_data3.dss_data3 */
-                       0x0b4 (PIN_OUTPUT | MUX_MODE0)   /* dss_data4.dss_data4 */
-                       0x0b6 (PIN_OUTPUT | MUX_MODE0)   /* dss_data5.dss_data5 */
-                       0x0b8 (PIN_OUTPUT | MUX_MODE0)   /* dss_data6.dss_data6 */
-                       0x0ba (PIN_OUTPUT | MUX_MODE0)   /* dss_data7.dss_data7 */
-                       0x0bc (PIN_OUTPUT | MUX_MODE0)   /* dss_data8.dss_data8 */
-                       0x0be (PIN_OUTPUT | MUX_MODE0)   /* dss_data9.dss_data9 */
-                       0x0c0 (PIN_OUTPUT | MUX_MODE0)   /* dss_data10.dss_data10 */
-                       0x0c2 (PIN_OUTPUT | MUX_MODE0)   /* dss_data11.dss_data11 */
-                       0x0c4 (PIN_OUTPUT | MUX_MODE0)   /* dss_data12.dss_data12 */
-                       0x0c6 (PIN_OUTPUT | MUX_MODE0)   /* dss_data13.dss_data13 */
-                       0x0c8 (PIN_OUTPUT | MUX_MODE0)   /* dss_data14.dss_data14 */
-                       0x0ca (PIN_OUTPUT | MUX_MODE0)   /* dss_data15.dss_data15 */
-                       0x0cc (PIN_OUTPUT | MUX_MODE0)   /* dss_data16.dss_data16 */
-                       0x0ce (PIN_OUTPUT | MUX_MODE0)   /* dss_data17.dss_data17 */
-                       0x0d0 (PIN_OUTPUT | MUX_MODE0)   /* dss_data18.dss_data18 */
-                       0x0d2 (PIN_OUTPUT | MUX_MODE0)   /* dss_data19.dss_data19 */
-                       0x0d4 (PIN_OUTPUT | MUX_MODE0)   /* dss_data20.dss_data20 */
-                       0x0d6 (PIN_OUTPUT | MUX_MODE0)   /* dss_data21.dss_data21 */
-                       0x0d8 (PIN_OUTPUT | MUX_MODE0)   /* dss_data22.dss_data22 */
-                       0x0da (PIN_OUTPUT | MUX_MODE0)   /* dss_data23.dss_data23 */
+                       OMAP3_CORE1_IOPAD(0x20d4, PIN_OUTPUT | MUX_MODE0)   /* dss_pclk.dss_pclk */
+                       OMAP3_CORE1_IOPAD(0x20d6, PIN_OUTPUT | MUX_MODE0)   /* dss_hsync.dss_hsync */
+                       OMAP3_CORE1_IOPAD(0x20d8, PIN_OUTPUT | MUX_MODE0)   /* dss_vsync.dss_vsync */
+                       OMAP3_CORE1_IOPAD(0x20da, PIN_OUTPUT | MUX_MODE0)   /* dss_acbias.dss_acbias */
+                       OMAP3_CORE1_IOPAD(0x20dc, PIN_OUTPUT | MUX_MODE0)   /* dss_data0.dss_data0 */
+                       OMAP3_CORE1_IOPAD(0x20de, PIN_OUTPUT | MUX_MODE0)   /* dss_data1.dss_data1 */
+                       OMAP3_CORE1_IOPAD(0x20e0, PIN_OUTPUT | MUX_MODE0)   /* dss_data2.dss_data2 */
+                       OMAP3_CORE1_IOPAD(0x20e2, PIN_OUTPUT | MUX_MODE0)   /* dss_data3.dss_data3 */
+                       OMAP3_CORE1_IOPAD(0x20e4, PIN_OUTPUT | MUX_MODE0)   /* dss_data4.dss_data4 */
+                       OMAP3_CORE1_IOPAD(0x20e6, PIN_OUTPUT | MUX_MODE0)   /* dss_data5.dss_data5 */
+                       OMAP3_CORE1_IOPAD(0x20e8, PIN_OUTPUT | MUX_MODE0)   /* dss_data6.dss_data6 */
+                       OMAP3_CORE1_IOPAD(0x20ea, PIN_OUTPUT | MUX_MODE0)   /* dss_data7.dss_data7 */
+                       OMAP3_CORE1_IOPAD(0x20ec, PIN_OUTPUT | MUX_MODE0)   /* dss_data8.dss_data8 */
+                       OMAP3_CORE1_IOPAD(0x20ee, PIN_OUTPUT | MUX_MODE0)   /* dss_data9.dss_data9 */
+                       OMAP3_CORE1_IOPAD(0x20f0, PIN_OUTPUT | MUX_MODE0)   /* dss_data10.dss_data10 */
+                       OMAP3_CORE1_IOPAD(0x20f2, PIN_OUTPUT | MUX_MODE0)   /* dss_data11.dss_data11 */
+                       OMAP3_CORE1_IOPAD(0x20f4, PIN_OUTPUT | MUX_MODE0)   /* dss_data12.dss_data12 */
+                       OMAP3_CORE1_IOPAD(0x20f6, PIN_OUTPUT | MUX_MODE0)   /* dss_data13.dss_data13 */
+                       OMAP3_CORE1_IOPAD(0x20f8, PIN_OUTPUT | MUX_MODE0)   /* dss_data14.dss_data14 */
+                       OMAP3_CORE1_IOPAD(0x20fa, PIN_OUTPUT | MUX_MODE0)   /* dss_data15.dss_data15 */
+                       OMAP3_CORE1_IOPAD(0x20fc, PIN_OUTPUT | MUX_MODE0)   /* dss_data16.dss_data16 */
+                       OMAP3_CORE1_IOPAD(0x20fe, PIN_OUTPUT | MUX_MODE0)   /* dss_data17.dss_data17 */
+                       OMAP3_CORE1_IOPAD(0x2100, PIN_OUTPUT | MUX_MODE0)   /* dss_data18.dss_data18 */
+                       OMAP3_CORE1_IOPAD(0x2102, PIN_OUTPUT | MUX_MODE0)   /* dss_data19.dss_data19 */
+                       OMAP3_CORE1_IOPAD(0x2104, PIN_OUTPUT | MUX_MODE0)   /* dss_data20.dss_data20 */
+                       OMAP3_CORE1_IOPAD(0x2106, PIN_OUTPUT | MUX_MODE0)   /* dss_data21.dss_data21 */
+                       OMAP3_CORE1_IOPAD(0x2108, PIN_OUTPUT | MUX_MODE0)   /* dss_data22.dss_data22 */
+                       OMAP3_CORE1_IOPAD(0x210a, PIN_OUTPUT | MUX_MODE0)   /* dss_data23.dss_data23 */
                >;
        };
 
index 72f7cdc091fba03ca51b223ec4f49cc810be88f4..321c2b7a4e9fe1d067ce32d3fdf0409fdabffe91 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Device Tree Source for IGEPv2 Rev. F (TI OMAP AM/DM37x)
  *
- * Copyright (C) 2012 Javier Martinez Canillas <javier@collabora.co.uk>
+ * Copyright (C) 2012 Javier Martinez Canillas <javier@osg.samsung.com>
  * Copyright (C) 2012 Enric Balletbo i Serra <eballetbo@gmail.com>
  *
  * This program is free software; you can redistribute it and/or modify
index fea7f7edb45dcb2fc4b8145ce9432b4c048f3c50..3835e1569c292a952fdc2e29e0fb27e9cebfa2ee 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Device Tree Source for IGEPv2 Rev. C (TI OMAP AM/DM37x)
  *
- * Copyright (C) 2012 Javier Martinez Canillas <javier@collabora.co.uk>
+ * Copyright (C) 2012 Javier Martinez Canillas <javier@osg.samsung.com>
  * Copyright (C) 2012 Enric Balletbo i Serra <eballetbo@gmail.com>
  *
  * This program is free software; you can redistribute it and/or modify
                        OMAP3_CORE1_IOPAD(0x216a, PIN_OUTPUT | MUX_MODE4)       /* sdmmc2_dat7.gpio_139 - RST_N_B */
                >;
        };
-
-       uart2_pins: pinmux_uart2_pins {
-               pinctrl-single,pins = <
-                       OMAP3_CORE1_IOPAD(0x2174, PIN_INPUT | MUX_MODE0)        /* uart2_cts.uart2_cts */
-                       OMAP3_CORE1_IOPAD(0x2176, PIN_OUTPUT | MUX_MODE0)       /* uart2_rts .uart2_rts*/
-                       OMAP3_CORE1_IOPAD(0x2178, PIN_OUTPUT | MUX_MODE0)       /* uart2_tx.uart2_tx */
-                       OMAP3_CORE1_IOPAD(0x217a, PIN_INPUT | MUX_MODE0)        /* uart2_rx.uart2_rx */
-               >;
-       };
 };
 
 /* On board Wifi module */
index 0cb1527c39d4d64383bd104583f5795a7ed23339..640f0660396697997a877358c725b46e098116dc 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Common Device Tree Source for IGEP COM MODULE
  *
- * Copyright (C) 2014 Javier Martinez Canillas <javier@collabora.co.uk>
+ * Copyright (C) 2014 Javier Martinez Canillas <javier@osg.samsung.com>
  * Copyright (C) 2014 Enric Balletbo i Serra <eballetbo@gmail.com>
  *
  * This program is free software; you can redistribute it and/or modify
index b899e341874a3dc84e9e898748fea314be0b84e4..76dc08868bfb65b832c295ef06a4cf30f0a1566a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Device Tree Source for IGEP COM MODULE Rev. G (TI OMAP AM/DM37x)
  *
- * Copyright (C) 2014 Javier Martinez Canillas <javier@collabora.co.uk>
+ * Copyright (C) 2014 Javier Martinez Canillas <javier@osg.samsung.com>
  * Copyright (C) 2014 Enric Balletbo i Serra <eballetbo@gmail.com>
  *
  * This program is free software; you can redistribute it and/or modify
index 8150f47ccdf5b6cbba75c79affcd9108b498e303..468608dab30a690d11fd30377749f6c195a98199 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Device Tree Source for IGEP COM MODULE Rev. E (TI OMAP AM/DM37x)
  *
- * Copyright (C) 2012 Javier Martinez Canillas <javier@collabora.co.uk>
+ * Copyright (C) 2012 Javier Martinez Canillas <javier@osg.samsung.com>
  * Copyright (C) 2012 Enric Balletbo i Serra <eballetbo@gmail.com>
  *
  * This program is free software; you can redistribute it and/or modify
index bd6e6769c7ce0664008b815ff10b58d5debdaf15..d2fab8c0d4f87109f8994a64ff8653e6e3ef95f3 100644 (file)
        tsc2046@0 {
                interrupt-parent = <&gpio2>;
                interrupts = <22 0>;            /* gpio54 */
-               pendown-gpio = <&gpio2 22 0>;
+               pendown-gpio = <&gpio2 22 GPIO_ACTIVE_HIGH>;
        };
 };
 
index d0dd0365bfda5c2e5e873ae3c817bf414417cab5..57d7c93cc72bd750fdffc2d4c27a01591b6c5dae 100644 (file)
 };
 
 &mmc1 {
-       cd-gpios = <&gpio4 30 IRQ_TYPE_LEVEL_LOW>;
+       cd-gpios = <&gpio4 30 GPIO_ACTIVE_LOW>;
        cd-inverted;
        vmmc-supply = <&vmmc1>;
        bus-width = <4>;
                interrupt-parent = <&gpio1>;
                interrupts = <8 0>;   /* boot6 / gpio_8 */
                spi-max-frequency = <1000000>;
-               pendown-gpio = <&gpio1 8 0>;
+               pendown-gpio = <&gpio1 8 GPIO_ACTIVE_HIGH>;
                vcc-supply = <&reg_vcc3>;
                pinctrl-names = "default";
                pinctrl-0 = <&tsc2048_pins>;
index 834f7c65f62d6537ac3b09c3f2fab1cfe0630607..0e3c9812f4e3660768c85ec779477f15c50a0e1f 100644 (file)
        status = "okay";
        bus-width = <4>;
        vmmc-supply = <&vmmc1>;
-       cd-gpios = <&gpio6 4 0>;   /* gpio_164 */
-       wp-gpios = <&gpio6 3 0>;   /* gpio_163 */
+       cd-gpios = <&gpio6 4 GPIO_ACTIVE_HIGH>;   /* gpio_164 */
+       wp-gpios = <&gpio6 3 GPIO_ACTIVE_HIGH>;   /* gpio_163 */
        pinctrl-names = "default";
        pinctrl-0 = <&mmc2_pins>;
        ti,dual-volt;
index 800b379d368d54ca901fa25c1ab789287d6a30a0..e9ee1df0e467291ca49757225d6dcd0b2a61705d 100644 (file)
@@ -27,7 +27,7 @@
                regulator-name = "VEMMC";
                regulator-min-microvolt = <2900000>;
                regulator-max-microvolt = <2900000>;
-               gpio = <&gpio5 29 0>; /* gpio line 157 */
+               gpio = <&gpio5 29 GPIO_ACTIVE_HIGH>; /* gpio line 157 */
                startup-delay-us = <150>;
                enable-active-high;
        };
index 28430f1596f2a76d3f0b229b0ebc288b3d483c86..a29ad16cc9bbddec399cef41a00106bc636a14a0 100644 (file)
@@ -35,7 +35,7 @@
                regulator-name = "hsusb2_vbus";
                regulator-min-microvolt = <5000000>;
                regulator-max-microvolt = <5000000>;
-               gpio = <&gpio6 8 0>;                            /* gpio_168: vbus enable */
+               gpio = <&gpio6 8 GPIO_ACTIVE_HIGH>;             /* gpio_168: vbus enable */
                startup-delay-us = <70000>;
                enable-active-high;
        };
index 80d236ac64a5db209ecb9c69ddcf8aa483c39bad..b09cedf66117398d0a75f0c07027deac5c793ea1 100644 (file)
 
                interrupt-parent = <&gpio4>;
                interrupts = <18 0>;                    /* gpio_114 */
-               pendown-gpio = <&gpio4 18 0>;
+               pendown-gpio = <&gpio4 18 GPIO_ACTIVE_HIGH>;
 
                ti,x-min = /bits/ 16 <0x0>;
                ti,x-max = /bits/ 16 <0x0fff>;
index 048fd216970a9acf4627a8edd1f409b61180e2ac..5f979590571b9ded188a2c2f6a4e0e72808d5e96 100644 (file)
 
                interrupt-parent = <&gpio4>;
                interrupts = <18 0>;                    /* gpio_114 */
-               pendown-gpio = <&gpio4 18 0>;
+               pendown-gpio = <&gpio4 18 GPIO_ACTIVE_HIGH>;
 
                ti,x-min = /bits/ 16 <0x0>;
                ti,x-max = /bits/ 16 <0x0fff>;
index f2084e6d01e76f7c3fd552a729c308540f44aee7..cfe140c657e7c6b5d051f621536a565a99c41fe9 100644 (file)
                regulator-always-on;
                regulator-boot-on;
                enable-active-high;
-               gpio = <&gpio6 4 0>;    /* GPIO_164 */
+               gpio = <&gpio6 4 GPIO_ACTIVE_HIGH>;     /* GPIO_164 */
        };
 
        /* wg7210 (wifi+bt module) 32k clock buffer */
                pinctrl-0 = <&penirq_pins>;
                interrupt-parent = <&gpio3>;
                interrupts = <30 0>;    /* GPIO_94 */
-               pendown-gpio = <&gpio3 30 0>;
+               pendown-gpio = <&gpio3 30 GPIO_ACTIVE_HIGH>;
                vcc-supply = <&vaux4>;
 
                ti,x-min = /bits/ 16 <0>;
index 7bd8d9a4f67fbaece7239df36f5c141126c62a50..ae5dbbd9d569269c0e9b3344b77797aee408c144 100644 (file)
@@ -37,7 +37,7 @@
                regulator-name = "hsusb2_vbus";
                regulator-min-microvolt = <3300000>;
                regulator-max-microvolt = <3300000>;
-               gpio = <&twl_gpio 18 0>;        /* GPIO LEDA */
+               gpio = <&twl_gpio 18 GPIO_ACTIVE_HIGH>; /* GPIO LEDA */
                startup-delay-us = <70000>;
        };
 
        pinctrl-0 = <&mmc1_pins>;
        vmmc-supply = <&vmmc1>;
        vmmc_aux-supply = <&vsim>;
-       cd-gpios = <&twl_gpio 0 0>;
+       cd-gpios = <&twl_gpio 0 GPIO_ACTIVE_HIGH>;
        bus-width = <8>;
 };
 
index 131448d86e67bdd4bff337529d01a35e232c6326..7bc5fdd6981e25d76e3409533fbc46238177ce3f 100644 (file)
@@ -44,7 +44,7 @@
                regulator-name = "vwl1271";
                regulator-min-microvolt = <1800000>;
                regulator-max-microvolt = <1800000>;
-               gpio = <&gpio4 5 0>;    /* gpio101 */
+               gpio = <&gpio4 5 GPIO_ACTIVE_HIGH>;     /* gpio101 */
                startup-delay-us = <70000>;
                enable-active-high;
        };
index f1507bc8737ee61031d0166b915317c3bf16b238..18d096696fc0b8e69e560215560e4d0b2d68c1af 100644 (file)
@@ -68,7 +68,7 @@
                regulator-name = "hsusb1_vbus";
                regulator-min-microvolt = <3300000>;
                regulator-max-microvolt = <3300000>;
-               gpio = <&gpio1 1 0>;    /* gpio_1 */
+               gpio = <&gpio1 1 GPIO_ACTIVE_HIGH>;     /* gpio_1 */
                startup-delay-us = <70000>;
                enable-active-high;
                /*
@@ -98,7 +98,7 @@
                regulator-name = "vwl1271";
                regulator-min-microvolt = <1800000>;
                regulator-max-microvolt = <1800000>;
-               gpio = <&gpio2 11 0>;
+               gpio = <&gpio2 11 GPIO_ACTIVE_HIGH>;
                startup-delay-us = <70000>;
                enable-active-high;
        };
index dac86ed7481f477ba315f67aef7dd7de17a67408..f0bdc41f8eff0c7ac9b5fa05b1de59d2cf7cbde5 100644 (file)
@@ -30,7 +30,7 @@
                regulator-name = "VDD_ETH";
                regulator-min-microvolt = <3300000>;
                regulator-max-microvolt = <3300000>;
-               gpio = <&gpio2 16 0>;  /* gpio line 48 */
+               gpio = <&gpio2 16 GPIO_ACTIVE_HIGH>;  /* gpio line 48 */
                enable-active-high;
                regulator-boot-on;
        };
                regulator-name = "vwl1271";
                regulator-min-microvolt = <1800000>;
                regulator-max-microvolt = <1800000>;
-               gpio = <&gpio2 22 0>;
+               gpio = <&gpio2 22 GPIO_ACTIVE_HIGH>;
                startup-delay-us = <70000>;
                enable-active-high;
        };
 
                /* SPI = 0, IRQ# = 119, 4 = active high level-sensitive */
                interrupts = <GIC_SPI 119 IRQ_TYPE_LEVEL_HIGH>; /* IRQ_SYS_2N cascaded to gic */
-               ti,audpwron-gpio = <&gpio4 31 0>;  /* gpio line 127 */
+               ti,audpwron-gpio = <&gpio4 31 GPIO_ACTIVE_HIGH>;  /* gpio line 127 */
 
                vio-supply = <&v1v8>;
                v2v1-supply = <&v2v1>;
index 9bceeb7e1f0315d91d7aa8fe77bed9fdf5652064..1c5f6f35e1cf0bfcce3c077aea8919cc7a6bfc3c 100644 (file)
@@ -15,7 +15,7 @@
                regulator-name = "vwl1271";
                regulator-min-microvolt = <1800000>;
                regulator-max-microvolt = <1800000>;
-               gpio = <&gpio2 11 0>;   /* gpio 43 */
+               gpio = <&gpio2 11 GPIO_ACTIVE_HIGH>;    /* gpio 43 */
                startup-delay-us = <70000>;
                enable-active-high;
        };
index a4f1ba2e1903baead6b8be5f59ae8a87a157a109..49d032b846beb060b873669597a92fc98078a3d6 100644 (file)
 
                /* SPI = 0, IRQ# = 119, 4 = active high level-sensitive */
                interrupts = <GIC_SPI 119 IRQ_TYPE_LEVEL_HIGH>; /* IRQ_SYS_2N cascaded to gic */
-               ti,audpwron-gpio = <&gpio6 22 0>; /* gpio 182 */
+               ti,audpwron-gpio = <&gpio6 22 GPIO_ACTIVE_HIGH>; /* gpio 182 */
 
                vio-supply = <&v1v8>;
                v2v1-supply = <&v2v1>;
index 194f9ef0a009d933355c802250ebce85da1bf679..5fa68f191af7c5f381401e009bfc1b852b6a058a 100644 (file)
@@ -46,7 +46,7 @@
                               0x4a002378 0x18>;
                        compatible = "ti,omap4460-bandgap";
                        interrupts = <0 126 IRQ_TYPE_LEVEL_HIGH>; /* talert */
-                       gpios = <&gpio3 22 0>; /* tshut */
+                       gpios = <&gpio3 22 GPIO_ACTIVE_HIGH>; /* tshut */
 
                        #thermal-sensor-cells = <0>;
                };
diff --git a/arch/arm/boot/dts/omap5-board-common.dtsi b/arch/arm/boot/dts/omap5-board-common.dtsi
new file mode 100644 (file)
index 0000000..5cf76a1
--- /dev/null
@@ -0,0 +1,655 @@
+/*
+ * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * 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.
+ */
+#include "omap5.dtsi"
+#include <dt-bindings/interrupt-controller/irq.h>
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+
+/ {
+       aliases {
+               display0 = &hdmi0;
+       };
+
+       vmmcsd_fixed: fixedregulator-mmcsd {
+               compatible = "regulator-fixed";
+               regulator-name = "vmmcsd_fixed";
+               regulator-min-microvolt = <3000000>;
+               regulator-max-microvolt = <3000000>;
+       };
+
+       mmc3_pwrseq: sdhci0_pwrseq {
+               compatible = "mmc-pwrseq-simple";
+               clocks = <&clk32kgaudio>;
+               clock-names = "ext_clock";
+       };
+
+       vmmcsdio_fixed: fixedregulator-mmcsdio {
+               compatible = "regulator-fixed";
+               regulator-name = "vmmcsdio_fixed";
+               regulator-min-microvolt = <1800000>;
+               regulator-max-microvolt = <1800000>;
+               gpio = <&gpio5 12 GPIO_ACTIVE_HIGH>;    /* gpio140 WLAN_EN */
+               enable-active-high;
+               startup-delay-us = <70000>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&wlan_pins>;
+       };
+
+       /* HS USB Host PHY on PORT 2 */
+       hsusb2_phy: hsusb2_phy {
+               compatible = "usb-nop-xceiv";
+               reset-gpios = <&gpio3 16 GPIO_ACTIVE_LOW>; /* gpio3_80 HUB_NRESET */
+               clocks = <&auxclk1_ck>;
+               clock-names = "main_clk";
+               clock-frequency = <19200000>;
+       };
+
+       /* HS USB Host PHY on PORT 3 */
+       hsusb3_phy: hsusb3_phy {
+               compatible = "usb-nop-xceiv";
+               reset-gpios = <&gpio3 15 GPIO_ACTIVE_LOW>; /* gpio3_79 ETH_NRESET */
+       };
+
+       leds {
+               compatible = "gpio-leds";
+               led@1 {
+                       label = "omap5:blue:usr1";
+                       gpios = <&gpio5 25 GPIO_ACTIVE_HIGH>; /* gpio5_153 D1 LED */
+                       linux,default-trigger = "heartbeat";
+                       default-state = "off";
+               };
+       };
+
+       tpd12s015: encoder@0 {
+               compatible = "ti,tpd12s015";
+
+               pinctrl-names = "default";
+               pinctrl-0 = <&tpd12s015_pins>;
+
+               /* gpios defined in the board specific dts */
+
+               ports {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       port@0 {
+                               reg = <0>;
+
+                               tpd12s015_in: endpoint@0 {
+                                       remote-endpoint = <&hdmi_out>;
+                               };
+                       };
+
+                       port@1 {
+                               reg = <1>;
+
+                               tpd12s015_out: endpoint@0 {
+                                       remote-endpoint = <&hdmi_connector_in>;
+                               };
+                       };
+               };
+       };
+
+       hdmi0: connector@0 {
+               compatible = "hdmi-connector";
+               label = "hdmi";
+
+               type = "b";
+
+               port {
+                       hdmi_connector_in: endpoint {
+                               remote-endpoint = <&tpd12s015_out>;
+                       };
+               };
+       };
+
+       sound: sound {
+               compatible = "ti,abe-twl6040";
+               ti,model = "omap5-uevm";
+
+               ti,mclk-freq = <19200000>;
+
+               ti,mcpdm = <&mcpdm>;
+
+               ti,twl6040 = <&twl6040>;
+
+               /* Audio routing */
+               ti,audio-routing =
+                       "Headset Stereophone", "HSOL",
+                       "Headset Stereophone", "HSOR",
+                       "Line Out", "AUXL",
+                       "Line Out", "AUXR",
+                       "HSMIC", "Headset Mic",
+                       "Headset Mic", "Headset Mic Bias",
+                       "AFML", "Line In",
+                       "AFMR", "Line In";
+       };
+};
+
+&omap5_pmx_core {
+       pinctrl-names = "default";
+       pinctrl-0 = <
+                       &usbhost_pins
+                       &led_gpio_pins
+       >;
+
+       twl6040_pins: pinmux_twl6040_pins {
+               pinctrl-single,pins = <
+                       0x17e (PIN_OUTPUT | MUX_MODE6)  /* mcspi1_somi.gpio5_141 */
+               >;
+       };
+
+       mcpdm_pins: pinmux_mcpdm_pins {
+               pinctrl-single,pins = <
+                       0x142 (PIN_INPUT_PULLDOWN | MUX_MODE0)  /* abe_clks.abe_clks */
+                       0x15c (PIN_INPUT_PULLDOWN | MUX_MODE0)  /* abemcpdm_ul_data.abemcpdm_ul_data */
+                       0x15e (PIN_INPUT_PULLDOWN | MUX_MODE0)  /* abemcpdm_dl_data.abemcpdm_dl_data */
+                       0x160 (PIN_INPUT_PULLUP | MUX_MODE0)    /* abemcpdm_frame.abemcpdm_frame */
+                       0x162 (PIN_INPUT_PULLDOWN | MUX_MODE0)  /* abemcpdm_lb_clk.abemcpdm_lb_clk */
+               >;
+       };
+
+       mcbsp1_pins: pinmux_mcbsp1_pins {
+               pinctrl-single,pins = <
+                       0x14c (PIN_INPUT | MUX_MODE1)           /* abedmic_clk2.abemcbsp1_fsx */
+                       0x14e (PIN_OUTPUT_PULLDOWN | MUX_MODE1) /* abedmic_clk3.abemcbsp1_dx */
+                       0x150 (PIN_INPUT | MUX_MODE1)           /* abeslimbus1_clock.abemcbsp1_clkx */
+                       0x152 (PIN_INPUT_PULLDOWN | MUX_MODE1)  /* abeslimbus1_data.abemcbsp1_dr */
+               >;
+       };
+
+       mcbsp2_pins: pinmux_mcbsp2_pins {
+               pinctrl-single,pins = <
+                       0x154 (PIN_INPUT_PULLDOWN | MUX_MODE0)  /* abemcbsp2_dr.abemcbsp2_dr */
+                       0x156 (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* abemcbsp2_dx.abemcbsp2_dx */
+                       0x158 (PIN_INPUT | MUX_MODE0)           /* abemcbsp2_fsx.abemcbsp2_fsx */
+                       0x15a (PIN_INPUT | MUX_MODE0)           /* abemcbsp2_clkx.abemcbsp2_clkx */
+               >;
+       };
+
+       i2c1_pins: pinmux_i2c1_pins {
+               pinctrl-single,pins = <
+                       0x1b2 (PIN_INPUT_PULLUP | MUX_MODE0)    /* i2c1_scl */
+                       0x1b4 (PIN_INPUT_PULLUP | MUX_MODE0)    /* i2c1_sda */
+               >;
+       };
+
+       mcspi2_pins: pinmux_mcspi2_pins {
+               pinctrl-single,pins = <
+                       0xbc (PIN_INPUT | MUX_MODE0)            /*  mcspi2_clk */
+                       0xbe (PIN_INPUT | MUX_MODE0)            /*  mcspi2_simo */
+                       0xc0 (PIN_INPUT_PULLUP | MUX_MODE0)     /*  mcspi2_somi */
+                       0xc2 (PIN_OUTPUT | MUX_MODE0)           /*  mcspi2_cs0 */
+               >;
+       };
+
+       mcspi3_pins: pinmux_mcspi3_pins {
+               pinctrl-single,pins = <
+                       0x78 (PIN_INPUT | MUX_MODE1)            /*  mcspi3_somi */
+                       0x7a (PIN_INPUT | MUX_MODE1)            /*  mcspi3_cs0 */
+                       0x7c (PIN_INPUT | MUX_MODE1)            /*  mcspi3_simo */
+                       0x7e (PIN_INPUT | MUX_MODE1)            /*  mcspi3_clk */
+               >;
+       };
+
+       mmc3_pins: pinmux_mmc3_pins {
+               pinctrl-single,pins = <
+                       OMAP5_IOPAD(0x01a4, PIN_INPUT_PULLUP | MUX_MODE0) /* wlsdio_clk */
+                       OMAP5_IOPAD(0x01a6, PIN_INPUT_PULLUP | MUX_MODE0) /* wlsdio_cmd */
+                       OMAP5_IOPAD(0x01a8, PIN_INPUT_PULLUP | MUX_MODE0) /* wlsdio_data0 */
+                       OMAP5_IOPAD(0x01aa, PIN_INPUT_PULLUP | MUX_MODE0) /* wlsdio_data1 */
+                       OMAP5_IOPAD(0x01ac, PIN_INPUT_PULLUP | MUX_MODE0) /* wlsdio_data2 */
+                       OMAP5_IOPAD(0x01ae, PIN_INPUT_PULLUP | MUX_MODE0) /* wlsdio_data3 */
+               >;
+       };
+
+       wlan_pins: pinmux_wlan_pins {
+               pinctrl-single,pins = <
+                       OMAP5_IOPAD(0x1bc, PIN_OUTPUT | MUX_MODE6) /* mcspi1_clk.gpio5_140 */
+               >;
+       };
+
+       usbhost_pins: pinmux_usbhost_pins {
+               pinctrl-single,pins = <
+                       0x84 (PIN_INPUT | MUX_MODE0) /* usbb2_hsic_strobe */
+                       0x86 (PIN_INPUT | MUX_MODE0) /* usbb2_hsic_data */
+
+                       0x19e (PIN_INPUT | MUX_MODE0) /* usbb3_hsic_strobe */
+                       0x1a0 (PIN_INPUT | MUX_MODE0) /* usbb3_hsic_data */
+
+                       0x70 (PIN_OUTPUT | MUX_MODE6) /* gpio3_80 HUB_NRESET */
+                       0x6e (PIN_OUTPUT | MUX_MODE6) /* gpio3_79 ETH_NRESET */
+               >;
+       };
+
+       led_gpio_pins: pinmux_led_gpio_pins {
+               pinctrl-single,pins = <
+                       0x196 (PIN_OUTPUT | MUX_MODE6) /* uart3_cts_rctx.gpio5_153 */
+               >;
+       };
+
+       uart1_pins: pinmux_uart1_pins {
+               pinctrl-single,pins = <
+                       0x60 (PIN_OUTPUT | MUX_MODE0) /* uart1_tx.uart1_cts */
+                       0x62 (PIN_INPUT_PULLUP | MUX_MODE0) /* uart1_tx.uart1_cts */
+                       0x64 (PIN_INPUT_PULLUP | MUX_MODE0) /* uart1_rx.uart1_rts */
+                       0x66 (PIN_OUTPUT | MUX_MODE0) /* uart1_rx.uart1_rts */
+               >;
+       };
+
+       uart3_pins: pinmux_uart3_pins {
+               pinctrl-single,pins = <
+                       0x19a (PIN_OUTPUT | MUX_MODE0) /* uart3_rts_irsd.uart3_tx_irtx */
+                       0x19c (PIN_INPUT_PULLUP | MUX_MODE0) /* uart3_rx_irrx.uart3_usbb3_hsic */
+               >;
+       };
+
+       uart5_pins: pinmux_uart5_pins {
+               pinctrl-single,pins = <
+                       0x170 (PIN_INPUT_PULLUP | MUX_MODE0) /* uart5_rx.uart5_rx */
+                       0x172 (PIN_OUTPUT | MUX_MODE0) /* uart5_tx.uart5_tx */
+                       0x174 (PIN_INPUT_PULLUP | MUX_MODE0) /* uart5_cts.uart5_rts */
+                       0x176 (PIN_OUTPUT | MUX_MODE0) /* uart5_cts.uart5_rts */
+               >;
+       };
+
+       dss_hdmi_pins: pinmux_dss_hdmi_pins {
+               pinctrl-single,pins = <
+                       0x0fc (PIN_INPUT_PULLUP | MUX_MODE0)    /* hdmi_cec.hdmi_cec */
+                       0x100 (PIN_INPUT | MUX_MODE0)   /* hdmi_ddc_scl.hdmi_ddc_scl */
+                       0x102 (PIN_INPUT | MUX_MODE0)   /* hdmi_ddc_sda.hdmi_ddc_sda */
+               >;
+       };
+
+       tpd12s015_pins: pinmux_tpd12s015_pins {
+               pinctrl-single,pins = <
+                       0x0fe (PIN_INPUT_PULLDOWN | MUX_MODE6)  /* hdmi_hpd.gpio7_193 */
+               >;
+       };
+};
+
+&omap5_pmx_wkup {
+       pinctrl-names = "default";
+       pinctrl-0 = <
+                       &usbhost_wkup_pins
+       >;
+
+       usbhost_wkup_pins: pinmux_usbhost_wkup_pins {
+               pinctrl-single,pins = <
+                       0x1A (PIN_OUTPUT | MUX_MODE0) /* fref_clk1_out, USB hub clk */
+               >;
+       };
+
+       wlcore_irq_pin: pinmux_wlcore_irq_pin {
+               pinctrl-single,pins = <
+                       OMAP5_IOPAD(0x040, WAKEUP_EN | PIN_INPUT_PULLUP | MUX_MODE6)    /* llia_wakereqin.gpio1_wk14 */
+               >;
+       };
+};
+
+&mmc1 {
+       vmmc-supply = <&ldo9_reg>;
+       bus-width = <4>;
+};
+
+&mmc2 {
+       vmmc-supply = <&vmmcsd_fixed>;
+       bus-width = <8>;
+       ti,non-removable;
+};
+
+&mmc3 {
+       vmmc-supply = <&vmmcsdio_fixed>;
+       mmc-pwrseq = <&mmc3_pwrseq>;
+       bus-width = <4>;
+       non-removable;
+       cap-power-off-card;
+       pinctrl-names = "default";
+       pinctrl-0 = <&mmc3_pins &wlcore_irq_pin>;
+       interrupts-extended = <&gic GIC_SPI 94 IRQ_TYPE_LEVEL_HIGH
+                              &omap5_pmx_core 0x168>;
+
+       #address-cells = <1>;
+       #size-cells = <0>;
+       wlcore: wlcore@2 {
+               compatible = "ti,wl1271";
+               reg = <2>;
+               interrupt-parent = <&gpio1>;
+               interrupts = <14 IRQ_TYPE_LEVEL_HIGH>;  /* gpio 14 */
+               ref-clock-frequency = <26000000>;
+       };
+};
+
+&mmc4 {
+       status = "disabled";
+};
+
+&mmc5 {
+       status = "disabled";
+};
+
+&i2c1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c1_pins>;
+
+       clock-frequency = <400000>;
+
+       palmas: palmas@48 {
+               compatible = "ti,palmas";
+               interrupts = <GIC_SPI 7 IRQ_TYPE_NONE>; /* IRQ_SYS_1N */
+               reg = <0x48>;
+               interrupt-controller;
+               #interrupt-cells = <2>;
+               ti,system-power-controller;
+
+               extcon_usb3: palmas_usb {
+                       compatible = "ti,palmas-usb-vid";
+                       ti,enable-vbus-detection;
+                       ti,enable-id-detection;
+                       ti,wakeup;
+               };
+
+               clk32kgaudio: palmas_clk32k@1 {
+                       compatible = "ti,palmas-clk32kgaudio";
+                       #clock-cells = <0>;
+               };
+
+               palmas_pmic {
+                       compatible = "ti,palmas-pmic";
+                       interrupt-parent = <&palmas>;
+                       interrupts = <14 IRQ_TYPE_NONE>;
+                       interrupt-name = "short-irq";
+
+                       ti,ldo6-vibrator;
+
+                       regulators {
+                               smps123_reg: smps123 {
+                                       /* VDD_OPP_MPU */
+                                       regulator-name = "smps123";
+                                       regulator-min-microvolt = < 600000>;
+                                       regulator-max-microvolt = <1500000>;
+                                       regulator-always-on;
+                                       regulator-boot-on;
+                               };
+
+                               smps45_reg: smps45 {
+                                       /* VDD_OPP_MM */
+                                       regulator-name = "smps45";
+                                       regulator-min-microvolt = < 600000>;
+                                       regulator-max-microvolt = <1310000>;
+                                       regulator-always-on;
+                                       regulator-boot-on;
+                               };
+
+                               smps6_reg: smps6 {
+                                       /* VDD_DDR3 - over VDD_SMPS6 */
+                                       regulator-name = "smps6";
+                                       regulator-min-microvolt = <1200000>;
+                                       regulator-max-microvolt = <1200000>;
+                                       regulator-always-on;
+                                       regulator-boot-on;
+                               };
+
+                               smps7_reg: smps7 {
+                                       /* VDDS_1v8_OMAP over VDDS_1v8_MAIN */
+                                       regulator-name = "smps7";
+                                       regulator-min-microvolt = <1800000>;
+                                       regulator-max-microvolt = <1800000>;
+                                       regulator-always-on;
+                                       regulator-boot-on;
+                               };
+
+                               smps8_reg: smps8 {
+                                       /* VDD_OPP_CORE */
+                                       regulator-name = "smps8";
+                                       regulator-min-microvolt = < 600000>;
+                                       regulator-max-microvolt = <1310000>;
+                                       regulator-always-on;
+                                       regulator-boot-on;
+                               };
+
+                               smps9_reg: smps9 {
+                                       /* VDDA_2v1_AUD over VDD_2v1 */
+                                       regulator-name = "smps9";
+                                       regulator-min-microvolt = <2100000>;
+                                       regulator-max-microvolt = <2100000>;
+                                       ti,smps-range = <0x80>;
+                               };
+
+                               smps10_out2_reg: smps10_out2 {
+                                       /* VBUS_5V_OTG */
+                                       regulator-name = "smps10_out2";
+                                       regulator-min-microvolt = <5000000>;
+                                       regulator-max-microvolt = <5000000>;
+                                       regulator-always-on;
+                                       regulator-boot-on;
+                               };
+
+                               smps10_out1_reg: smps10_out1 {
+                                       /* VBUS_5V_OTG */
+                                       regulator-name = "smps10_out1";
+                                       regulator-min-microvolt = <5000000>;
+                                       regulator-max-microvolt = <5000000>;
+                               };
+
+                               ldo1_reg: ldo1 {
+                                       /* VDDAPHY_CAM: vdda_csiport */
+                                       regulator-name = "ldo1";
+                                       regulator-min-microvolt = <1500000>;
+                                       regulator-max-microvolt = <1800000>;
+                               };
+
+                               ldo2_reg: ldo2 {
+                                       /* VCC_2V8_DISP: Does not go anywhere */
+                                       regulator-name = "ldo2";
+                                       regulator-min-microvolt = <2800000>;
+                                       regulator-max-microvolt = <2800000>;
+                                       /* Unused */
+                                       status = "disabled";
+                               };
+
+                               ldo3_reg: ldo3 {
+                                       /* VDDAPHY_MDM: vdda_lli */
+                                       regulator-name = "ldo3";
+                                       regulator-min-microvolt = <1500000>;
+                                       regulator-max-microvolt = <1500000>;
+                                       regulator-boot-on;
+                                       /* Only if Modem is used */
+                                       status = "disabled";
+                               };
+
+                               ldo4_reg: ldo4 {
+                                       /* VDDAPHY_DISP: vdda_dsiport/hdmi */
+                                       regulator-name = "ldo4";
+                                       regulator-min-microvolt = <1500000>;
+                                       regulator-max-microvolt = <1800000>;
+                               };
+
+                               ldo5_reg: ldo5 {
+                                       /* VDDA_1V8_PHY: usb/sata/hdmi.. */
+                                       regulator-name = "ldo5";
+                                       regulator-min-microvolt = <1800000>;
+                                       regulator-max-microvolt = <1800000>;
+                                       regulator-always-on;
+                                       regulator-boot-on;
+                               };
+
+                               ldo6_reg: ldo6 {
+                                       /* VDDS_1V2_WKUP: hsic/ldo_emu_wkup */
+                                       regulator-name = "ldo6";
+                                       regulator-min-microvolt = <1200000>;
+                                       regulator-max-microvolt = <1200000>;
+                                       regulator-always-on;
+                                       regulator-boot-on;
+                               };
+
+                               ldo7_reg: ldo7 {
+                                       /* VDD_VPP: vpp1 */
+                                       regulator-name = "ldo7";
+                                       regulator-min-microvolt = <2000000>;
+                                       regulator-max-microvolt = <2000000>;
+                                       /* Only for efuse reprograming! */
+                                       status = "disabled";
+                               };
+
+                               ldo8_reg: ldo8 {
+                                       /* VDD_3v0: Does not go anywhere */
+                                       regulator-name = "ldo8";
+                                       regulator-min-microvolt = <3000000>;
+                                       regulator-max-microvolt = <3000000>;
+                                       regulator-boot-on;
+                                       /* Unused */
+                                       status = "disabled";
+                               };
+
+                               ldo9_reg: ldo9 {
+                                       /* VCC_DV_SDIO: vdds_sdcard */
+                                       regulator-name = "ldo9";
+                                       regulator-min-microvolt = <1800000>;
+                                       regulator-max-microvolt = <3000000>;
+                                       regulator-boot-on;
+                               };
+
+                               ldoln_reg: ldoln {
+                                       /* VDDA_1v8_REF: vdds_osc/mm_l4per.. */
+                                       regulator-name = "ldoln";
+                                       regulator-min-microvolt = <1800000>;
+                                       regulator-max-microvolt = <1800000>;
+                                       regulator-always-on;
+                                       regulator-boot-on;
+                               };
+
+                               ldousb_reg: ldousb {
+                                       /* VDDA_3V_USB: VDDA_USBHS33 */
+                                       regulator-name = "ldousb";
+                                       regulator-min-microvolt = <3250000>;
+                                       regulator-max-microvolt = <3250000>;
+                                       regulator-always-on;
+                                       regulator-boot-on;
+                               };
+
+                               regen3_reg: regen3 {
+                                       /* REGEN3 controls LDO9 supply to card */
+                                       regulator-name = "regen3";
+                                       regulator-always-on;
+                                       regulator-boot-on;
+                               };
+                       };
+               };
+
+               palmas_power_button: palmas_power_button {
+                       compatible = "ti,palmas-pwrbutton";
+                       interrupt-parent = <&palmas>;
+                       interrupts = <1 IRQ_TYPE_EDGE_FALLING>;
+                       wakeup-source;
+               };
+       };
+
+       twl6040: twl@4b {
+               compatible = "ti,twl6040";
+               reg = <0x4b>;
+
+               pinctrl-names = "default";
+               pinctrl-0 = <&twl6040_pins>;
+
+               interrupts = <GIC_SPI 119 IRQ_TYPE_NONE>; /* IRQ_SYS_2N cascaded to gic */
+               ti,audpwron-gpio = <&gpio5 13 GPIO_ACTIVE_HIGH>;  /* gpio line 141 */
+
+               vio-supply = <&smps7_reg>;
+               v2v1-supply = <&smps9_reg>;
+               enable-active-high;
+
+               clocks = <&clk32kgaudio>;
+               clock-names = "clk32k";
+       };
+};
+
+&mcpdm {
+       pinctrl-names = "default";
+       pinctrl-0 = <&mcpdm_pins>;
+       status = "okay";
+};
+
+&mcbsp1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&mcbsp1_pins>;
+       status = "okay";
+};
+
+&mcbsp2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&mcbsp2_pins>;
+       status = "okay";
+};
+
+&usbhshost {
+       port2-mode = "ehci-hsic";
+       port3-mode = "ehci-hsic";
+};
+
+&usbhsehci {
+       phys = <0 &hsusb2_phy &hsusb3_phy>;
+};
+
+&usb3 {
+       extcon = <&extcon_usb3>;
+       vbus-supply = <&smps10_out1_reg>;
+};
+
+&mcspi1 {
+
+};
+
+&mcspi2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&mcspi2_pins>;
+};
+
+&mcspi3 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&mcspi3_pins>;
+};
+
+&uart1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart1_pins>;
+};
+
+&uart3 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart3_pins>;
+       interrupts-extended = <&wakeupgen GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH>,
+                             <&omap5_pmx_core 0x19c>;
+};
+
+&uart5 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart5_pins>;
+};
+
+&cpu0 {
+       cpu0-supply = <&smps123_reg>;
+};
+
+&dss {
+       status = "ok";
+};
+
+&hdmi {
+       status = "ok";
+
+       /* vdda-supply populated in board specific dts file */
+
+       pinctrl-names = "default";
+       pinctrl-0 = <&dss_hdmi_pins>;
+
+       port {
+               hdmi_out: endpoint {
+                       remote-endpoint = <&tpd12s015_in>;
+               };
+       };
+};
index 61ad2ea347204bc9154b120ec861a7658f67f61b..3774b37be6c89dbc26b75114bf8891885ccd07c2 100644 (file)
 
                interrupt-parent = <&gpio1>;
                interrupts = <15 0>;                    /* gpio1_wk15 */
-               pendown-gpio = <&gpio1 15 0>;
+               pendown-gpio = <&gpio1 15 GPIO_ACTIVE_HIGH>;
 
 
                ti,x-min = /bits/ 16 <0x0>;
diff --git a/arch/arm/boot/dts/omap5-igep0050.dts b/arch/arm/boot/dts/omap5-igep0050.dts
new file mode 100644 (file)
index 0000000..46ecb1d
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2013 ISEE 2007 SL - http://www.isee.biz/
+ *
+ * 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.
+ */
+/dts-v1/;
+
+#include "omap5-board-common.dtsi"
+
+/ {
+       model = "IGEPv5";
+       compatible = "isee,omap5-igep0050", "ti,omap5";
+
+       memory {
+               device_type = "memory";
+               reg = <0x80000000 0x7f000000>; /* 2032 MB */
+       };
+};
+
+&hdmi {
+       vdda-supply = <&ldo7_reg>;
+};
+
+&i2c4 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c4_pins>;
+
+       tca6416: tca6416@21 {
+               compatible = "ti,tca6416";
+               reg = <0x21>;
+               gpio-controller;
+               #gpio-cells = <2>;
+       };
+};
+
+&omap5_pmx_core {
+       i2c4_pins: pinmux_i2c4_pins {
+               pinctrl-single,pins = <
+                       OMAP5_IOPAD(0x0f8, PIN_INPUT | MUX_MODE0)       /* i2c4_scl */
+                       OMAP5_IOPAD(0x0fa, PIN_INPUT | MUX_MODE0)       /* i2c4_sda */
+               >;
+       };
+};
+
+&tpd12s015 {
+       gpios = <&tca6416 11 0>,        /* TCA6416 P01, CT_CP_HDP */
+               <&tca6416 12 0>,        /* TCA6416 P00, LS_OE*/
+               <&gpio7 1 0>,           /* 193, HPD */
+               <&gpio7 2 0>,           /* 194, SCL */
+               <&gpio7 3 0>;           /* 195, SDA */
+};
+
index 3cb030f9d2c4dcc1e36d17b41616b18287d38611..05b1c1ebded8d1305f053427cb8e482d5ef6c00e 100644 (file)
@@ -7,9 +7,7 @@
  */
 /dts-v1/;
 
-#include "omap5.dtsi"
-#include <dt-bindings/interrupt-controller/irq.h>
-#include <dt-bindings/interrupt-controller/arm-gic.h>
+#include "omap5-board-common.dtsi"
 
 / {
        model = "TI OMAP5 uEVM board";
                device_type = "memory";
                reg = <0x80000000 0x7F000000>; /* 2032 MB */
        };
-
-       aliases {
-               display0 = &hdmi0;
-       };
-
-       vmmcsd_fixed: fixedregulator-mmcsd {
-               compatible = "regulator-fixed";
-               regulator-name = "vmmcsd_fixed";
-               regulator-min-microvolt = <3000000>;
-               regulator-max-microvolt = <3000000>;
-       };
-
-       /* HS USB Host PHY on PORT 2 */
-       hsusb2_phy: hsusb2_phy {
-               compatible = "usb-nop-xceiv";
-               reset-gpios = <&gpio3 16 GPIO_ACTIVE_LOW>; /* gpio3_80 HUB_NRESET */
-               clocks = <&auxclk1_ck>;
-               clock-names = "main_clk";
-               clock-frequency = <19200000>;
-       };
-
-       /* HS USB Host PHY on PORT 3 */
-       hsusb3_phy: hsusb3_phy {
-               compatible = "usb-nop-xceiv";
-               reset-gpios = <&gpio3 15 GPIO_ACTIVE_LOW>; /* gpio3_79 ETH_NRESET */
-       };
-
-       leds {
-               compatible = "gpio-leds";
-               led@1 {
-                       label = "omap5:blue:usr1";
-                       gpios = <&gpio5 25 GPIO_ACTIVE_HIGH>; /* gpio5_153 D1 LED */
-                       linux,default-trigger = "heartbeat";
-                       default-state = "off";
-               };
-       };
-
-       tpd12s015: encoder@0 {
-               compatible = "ti,tpd12s015";
-
-               pinctrl-names = "default";
-               pinctrl-0 = <&tpd12s015_pins>;
-
-               gpios = <&gpio9 0 GPIO_ACTIVE_HIGH>,    /* TCA6424A P01, CT CP HPD */
-                       <&gpio9 1 GPIO_ACTIVE_HIGH>,    /* TCA6424A P00, LS OE */
-                       <&gpio7 1 GPIO_ACTIVE_HIGH>;    /* GPIO 193, HPD */
-
-               ports {
-                       #address-cells = <1>;
-                       #size-cells = <0>;
-
-                       port@0 {
-                               reg = <0>;
-
-                               tpd12s015_in: endpoint@0 {
-                                       remote-endpoint = <&hdmi_out>;
-                               };
-                       };
-
-                       port@1 {
-                               reg = <1>;
-
-                               tpd12s015_out: endpoint@0 {
-                                       remote-endpoint = <&hdmi_connector_in>;
-                               };
-                       };
-               };
-       };
-
-       hdmi0: connector@0 {
-               compatible = "hdmi-connector";
-               label = "hdmi";
-
-               type = "b";
-
-               port {
-                       hdmi_connector_in: endpoint {
-                               remote-endpoint = <&tpd12s015_out>;
-                       };
-               };
-       };
-
-       sound: sound {
-               compatible = "ti,abe-twl6040";
-               ti,model = "omap5-uevm";
-
-               ti,mclk-freq = <19200000>;
-
-               ti,mcpdm = <&mcpdm>;
-
-               ti,twl6040 = <&twl6040>;
-
-               /* Audio routing */
-               ti,audio-routing =
-                       "Headset Stereophone", "HSOL",
-                       "Headset Stereophone", "HSOR",
-                       "Line Out", "AUXL",
-                       "Line Out", "AUXR",
-                       "HSMIC", "Headset Mic",
-                       "Headset Mic", "Headset Mic Bias",
-                       "AFML", "Line In",
-                       "AFMR", "Line In";
-       };
-};
-
-&omap5_pmx_core {
-       pinctrl-names = "default";
-       pinctrl-0 = <
-                       &usbhost_pins
-                       &led_gpio_pins
-       >;
-
-       twl6040_pins: pinmux_twl6040_pins {
-               pinctrl-single,pins = <
-                       0x17e (PIN_OUTPUT | MUX_MODE6)  /* mcspi1_somi.gpio5_141 */
-               >;
-       };
-
-       mcpdm_pins: pinmux_mcpdm_pins {
-               pinctrl-single,pins = <
-                       0x142 (PIN_INPUT_PULLDOWN | MUX_MODE0)  /* abe_clks.abe_clks */
-                       0x15c (PIN_INPUT_PULLDOWN | MUX_MODE0)  /* abemcpdm_ul_data.abemcpdm_ul_data */
-                       0x15e (PIN_INPUT_PULLDOWN | MUX_MODE0)  /* abemcpdm_dl_data.abemcpdm_dl_data */
-                       0x160 (PIN_INPUT_PULLUP | MUX_MODE0)    /* abemcpdm_frame.abemcpdm_frame */
-                       0x162 (PIN_INPUT_PULLDOWN | MUX_MODE0)  /* abemcpdm_lb_clk.abemcpdm_lb_clk */
-               >;
-       };
-
-       mcbsp1_pins: pinmux_mcbsp1_pins {
-               pinctrl-single,pins = <
-                       0x14c (PIN_INPUT | MUX_MODE1)           /* abedmic_clk2.abemcbsp1_fsx */
-                       0x14e (PIN_OUTPUT_PULLDOWN | MUX_MODE1) /* abedmic_clk3.abemcbsp1_dx */
-                       0x150 (PIN_INPUT | MUX_MODE1)           /* abeslimbus1_clock.abemcbsp1_clkx */
-                       0x152 (PIN_INPUT_PULLDOWN | MUX_MODE1)  /* abeslimbus1_data.abemcbsp1_dr */
-               >;
-       };
-
-       mcbsp2_pins: pinmux_mcbsp2_pins {
-               pinctrl-single,pins = <
-                       0x154 (PIN_INPUT_PULLDOWN | MUX_MODE0)  /* abemcbsp2_dr.abemcbsp2_dr */
-                       0x156 (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* abemcbsp2_dx.abemcbsp2_dx */
-                       0x158 (PIN_INPUT | MUX_MODE0)           /* abemcbsp2_fsx.abemcbsp2_fsx */
-                       0x15a (PIN_INPUT | MUX_MODE0)           /* abemcbsp2_clkx.abemcbsp2_clkx */
-               >;
-       };
-
-       i2c1_pins: pinmux_i2c1_pins {
-               pinctrl-single,pins = <
-                       0x1b2 (PIN_INPUT_PULLUP | MUX_MODE0)    /* i2c1_scl */
-                       0x1b4 (PIN_INPUT_PULLUP | MUX_MODE0)    /* i2c1_sda */
-               >;
-       };
-
-       i2c5_pins: pinmux_i2c5_pins {
-               pinctrl-single,pins = <
-                       0x186 (PIN_INPUT | MUX_MODE0)           /* i2c5_scl */
-                       0x188 (PIN_INPUT | MUX_MODE0)           /* i2c5_sda */
-               >;
-       };
-
-       mcspi2_pins: pinmux_mcspi2_pins {
-               pinctrl-single,pins = <
-                       0xbc (PIN_INPUT | MUX_MODE0)            /*  mcspi2_clk */
-                       0xbe (PIN_INPUT | MUX_MODE0)            /*  mcspi2_simo */
-                       0xc0 (PIN_INPUT_PULLUP | MUX_MODE0)     /*  mcspi2_somi */
-                       0xc2 (PIN_OUTPUT | MUX_MODE0)           /*  mcspi2_cs0 */
-               >;
-       };
-
-       mcspi3_pins: pinmux_mcspi3_pins {
-               pinctrl-single,pins = <
-                       0x78 (PIN_INPUT | MUX_MODE1)            /*  mcspi3_somi */
-                       0x7a (PIN_INPUT | MUX_MODE1)            /*  mcspi3_cs0 */
-                       0x7c (PIN_INPUT | MUX_MODE1)            /*  mcspi3_simo */
-                       0x7e (PIN_INPUT | MUX_MODE1)            /*  mcspi3_clk */
-               >;
-       };
-
-       mcspi4_pins: pinmux_mcspi4_pins {
-               pinctrl-single,pins = <
-                       0x164 (PIN_INPUT | MUX_MODE1)           /*  mcspi4_clk */
-                       0x168 (PIN_INPUT | MUX_MODE1)           /*  mcspi4_simo */
-                       0x16a (PIN_INPUT | MUX_MODE1)           /*  mcspi4_somi */
-                       0x16c (PIN_INPUT | MUX_MODE1)           /*  mcspi4_cs0 */
-               >;
-       };
-
-       usbhost_pins: pinmux_usbhost_pins {
-               pinctrl-single,pins = <
-                       0x84 (PIN_INPUT | MUX_MODE0) /* usbb2_hsic_strobe */
-                       0x86 (PIN_INPUT | MUX_MODE0) /* usbb2_hsic_data */
-
-                       0x19e (PIN_INPUT | MUX_MODE0) /* usbb3_hsic_strobe */
-                       0x1a0 (PIN_INPUT | MUX_MODE0) /* usbb3_hsic_data */
-
-                       0x70 (PIN_OUTPUT | MUX_MODE6) /* gpio3_80 HUB_NRESET */
-                       0x6e (PIN_OUTPUT | MUX_MODE6) /* gpio3_79 ETH_NRESET */
-               >;
-       };
-
-       led_gpio_pins: pinmux_led_gpio_pins {
-               pinctrl-single,pins = <
-                       0x196 (PIN_OUTPUT | MUX_MODE6) /* uart3_cts_rctx.gpio5_153 */
-               >;
-       };
-
-       uart1_pins: pinmux_uart1_pins {
-               pinctrl-single,pins = <
-                       0x60 (PIN_OUTPUT | MUX_MODE0) /* uart1_tx.uart1_cts */
-                       0x62 (PIN_INPUT_PULLUP | MUX_MODE0) /* uart1_tx.uart1_cts */
-                       0x64 (PIN_INPUT_PULLUP | MUX_MODE0) /* uart1_rx.uart1_rts */
-                       0x66 (PIN_OUTPUT | MUX_MODE0) /* uart1_rx.uart1_rts */
-               >;
-       };
-
-       uart3_pins: pinmux_uart3_pins {
-               pinctrl-single,pins = <
-                       0x19a (PIN_OUTPUT | MUX_MODE0) /* uart3_rts_irsd.uart3_tx_irtx */
-                       0x19c (PIN_INPUT_PULLUP | MUX_MODE0) /* uart3_rx_irrx.uart3_usbb3_hsic */
-               >;
-       };
-
-       uart5_pins: pinmux_uart5_pins {
-               pinctrl-single,pins = <
-                       0x170 (PIN_INPUT_PULLUP | MUX_MODE0) /* uart5_rx.uart5_rx */
-                       0x172 (PIN_OUTPUT | MUX_MODE0) /* uart5_tx.uart5_tx */
-                       0x174 (PIN_INPUT_PULLUP | MUX_MODE0) /* uart5_cts.uart5_rts */
-                       0x176 (PIN_OUTPUT | MUX_MODE0) /* uart5_cts.uart5_rts */
-               >;
-       };
-
-       dss_hdmi_pins: pinmux_dss_hdmi_pins {
-               pinctrl-single,pins = <
-                       0x0fc (PIN_INPUT_PULLUP | MUX_MODE0)    /* hdmi_cec.hdmi_cec */
-                       0x100 (PIN_INPUT | MUX_MODE0)   /* hdmi_ddc_scl.hdmi_ddc_scl */
-                       0x102 (PIN_INPUT | MUX_MODE0)   /* hdmi_ddc_sda.hdmi_ddc_sda */
-               >;
-       };
-
-       tpd12s015_pins: pinmux_tpd12s015_pins {
-               pinctrl-single,pins = <
-                       0x0fe (PIN_INPUT_PULLDOWN | MUX_MODE6)  /* hdmi_hpd.gpio7_193 */
-               >;
-       };
-};
-
-&omap5_pmx_wkup {
-       pinctrl-names = "default";
-       pinctrl-0 = <
-                       &usbhost_wkup_pins
-       >;
-
-       usbhost_wkup_pins: pinmux_usbhost_wkup_pins {
-               pinctrl-single,pins = <
-                       0x1A (PIN_OUTPUT | MUX_MODE0) /* fref_clk1_out, USB hub clk */
-               >;
-       };
-};
-
-&mmc1 {
-       vmmc-supply = <&ldo9_reg>;
-       bus-width = <4>;
-};
-
-&mmc2 {
-       vmmc-supply = <&vmmcsd_fixed>;
-       bus-width = <8>;
-       ti,non-removable;
-};
-
-&mmc3 {
-       bus-width = <4>;
-       ti,non-removable;
-};
-
-&mmc4 {
-       status = "disabled";
 };
 
-&mmc5 {
-       status = "disabled";
-};
-
-&i2c1 {
-       pinctrl-names = "default";
-       pinctrl-0 = <&i2c1_pins>;
-
-       clock-frequency = <400000>;
-
-       palmas: palmas@48 {
-               compatible = "ti,palmas";
-               interrupts = <GIC_SPI 7 IRQ_TYPE_NONE>; /* IRQ_SYS_1N */
-               reg = <0x48>;
-               interrupt-controller;
-               #interrupt-cells = <2>;
-               ti,system-power-controller;
-
-               extcon_usb3: palmas_usb {
-                       compatible = "ti,palmas-usb-vid";
-                       ti,enable-vbus-detection;
-                       ti,enable-id-detection;
-                       ti,wakeup;
-               };
-
-               clk32kgaudio: palmas_clk32k@1 {
-                       compatible = "ti,palmas-clk32kgaudio";
-                       #clock-cells = <0>;
-               };
-
-               palmas_pmic {
-                       compatible = "ti,palmas-pmic";
-                       interrupt-parent = <&palmas>;
-                       interrupts = <14 IRQ_TYPE_NONE>;
-                       interrupt-name = "short-irq";
-
-                       ti,ldo6-vibrator;
-
-                       regulators {
-                               smps123_reg: smps123 {
-                                       /* VDD_OPP_MPU */
-                                       regulator-name = "smps123";
-                                       regulator-min-microvolt = < 600000>;
-                                       regulator-max-microvolt = <1500000>;
-                                       regulator-always-on;
-                                       regulator-boot-on;
-                               };
-
-                               smps45_reg: smps45 {
-                                       /* VDD_OPP_MM */
-                                       regulator-name = "smps45";
-                                       regulator-min-microvolt = < 600000>;
-                                       regulator-max-microvolt = <1310000>;
-                                       regulator-always-on;
-                                       regulator-boot-on;
-                               };
-
-                               smps6_reg: smps6 {
-                                       /* VDD_DDR3 - over VDD_SMPS6 */
-                                       regulator-name = "smps6";
-                                       regulator-min-microvolt = <1200000>;
-                                       regulator-max-microvolt = <1200000>;
-                                       regulator-always-on;
-                                       regulator-boot-on;
-                               };
-
-                               smps7_reg: smps7 {
-                                       /* VDDS_1v8_OMAP over VDDS_1v8_MAIN */
-                                       regulator-name = "smps7";
-                                       regulator-min-microvolt = <1800000>;
-                                       regulator-max-microvolt = <1800000>;
-                                       regulator-always-on;
-                                       regulator-boot-on;
-                               };
-
-                               smps8_reg: smps8 {
-                                       /* VDD_OPP_CORE */
-                                       regulator-name = "smps8";
-                                       regulator-min-microvolt = < 600000>;
-                                       regulator-max-microvolt = <1310000>;
-                                       regulator-always-on;
-                                       regulator-boot-on;
-                               };
-
-                               smps9_reg: smps9 {
-                                       /* VDDA_2v1_AUD over VDD_2v1 */
-                                       regulator-name = "smps9";
-                                       regulator-min-microvolt = <2100000>;
-                                       regulator-max-microvolt = <2100000>;
-                                       ti,smps-range = <0x80>;
-                               };
-
-                               smps10_out2_reg: smps10_out2 {
-                                       /* VBUS_5V_OTG */
-                                       regulator-name = "smps10_out2";
-                                       regulator-min-microvolt = <5000000>;
-                                       regulator-max-microvolt = <5000000>;
-                                       regulator-always-on;
-                                       regulator-boot-on;
-                               };
-
-                               smps10_out1_reg: smps10_out1 {
-                                       /* VBUS_5V_OTG */
-                                       regulator-name = "smps10_out1";
-                                       regulator-min-microvolt = <5000000>;
-                                       regulator-max-microvolt = <5000000>;
-                               };
-
-                               ldo1_reg: ldo1 {
-                                       /* VDDAPHY_CAM: vdda_csiport */
-                                       regulator-name = "ldo1";
-                                       regulator-min-microvolt = <1500000>;
-                                       regulator-max-microvolt = <1800000>;
-                               };
-
-                               ldo2_reg: ldo2 {
-                                       /* VCC_2V8_DISP: Does not go anywhere */
-                                       regulator-name = "ldo2";
-                                       regulator-min-microvolt = <2800000>;
-                                       regulator-max-microvolt = <2800000>;
-                                       /* Unused */
-                                       status = "disabled";
-                               };
-
-                               ldo3_reg: ldo3 {
-                                       /* VDDAPHY_MDM: vdda_lli */
-                                       regulator-name = "ldo3";
-                                       regulator-min-microvolt = <1500000>;
-                                       regulator-max-microvolt = <1500000>;
-                                       regulator-boot-on;
-                                       /* Only if Modem is used */
-                                       status = "disabled";
-                               };
-
-                               ldo4_reg: ldo4 {
-                                       /* VDDAPHY_DISP: vdda_dsiport/hdmi */
-                                       regulator-name = "ldo4";
-                                       regulator-min-microvolt = <1500000>;
-                                       regulator-max-microvolt = <1800000>;
-                               };
-
-                               ldo5_reg: ldo5 {
-                                       /* VDDA_1V8_PHY: usb/sata/hdmi.. */
-                                       regulator-name = "ldo5";
-                                       regulator-min-microvolt = <1800000>;
-                                       regulator-max-microvolt = <1800000>;
-                                       regulator-always-on;
-                                       regulator-boot-on;
-                               };
-
-                               ldo6_reg: ldo6 {
-                                       /* VDDS_1V2_WKUP: hsic/ldo_emu_wkup */
-                                       regulator-name = "ldo6";
-                                       regulator-min-microvolt = <1200000>;
-                                       regulator-max-microvolt = <1200000>;
-                                       regulator-always-on;
-                                       regulator-boot-on;
-                               };
-
-                               ldo7_reg: ldo7 {
-                                       /* VDD_VPP: vpp1 */
-                                       regulator-name = "ldo7";
-                                       regulator-min-microvolt = <2000000>;
-                                       regulator-max-microvolt = <2000000>;
-                                       /* Only for efuse reprograming! */
-                                       status = "disabled";
-                               };
-
-                               ldo8_reg: ldo8 {
-                                       /* VDD_3v0: Does not go anywhere */
-                                       regulator-name = "ldo8";
-                                       regulator-min-microvolt = <3000000>;
-                                       regulator-max-microvolt = <3000000>;
-                                       regulator-boot-on;
-                                       /* Unused */
-                                       status = "disabled";
-                               };
-
-                               ldo9_reg: ldo9 {
-                                       /* VCC_DV_SDIO: vdds_sdcard */
-                                       regulator-name = "ldo9";
-                                       regulator-min-microvolt = <1800000>;
-                                       regulator-max-microvolt = <3000000>;
-                                       regulator-boot-on;
-                               };
-
-                               ldoln_reg: ldoln {
-                                       /* VDDA_1v8_REF: vdds_osc/mm_l4per.. */
-                                       regulator-name = "ldoln";
-                                       regulator-min-microvolt = <1800000>;
-                                       regulator-max-microvolt = <1800000>;
-                                       regulator-always-on;
-                                       regulator-boot-on;
-                               };
-
-                               ldousb_reg: ldousb {
-                                       /* VDDA_3V_USB: VDDA_USBHS33 */
-                                       regulator-name = "ldousb";
-                                       regulator-min-microvolt = <3250000>;
-                                       regulator-max-microvolt = <3250000>;
-                                       regulator-always-on;
-                                       regulator-boot-on;
-                               };
-
-                               regen3_reg: regen3 {
-                                       /* REGEN3 controls LDO9 supply to card */
-                                       regulator-name = "regen3";
-                                       regulator-always-on;
-                                       regulator-boot-on;
-                               };
-                       };
-               };
-
-               palmas_power_button: palmas_power_button {
-                       compatible = "ti,palmas-pwrbutton";
-                       interrupt-parent = <&palmas>;
-                       interrupts = <1 IRQ_TYPE_EDGE_FALLING>;
-                       wakeup-source;
-               };
-       };
-
-       twl6040: twl@4b {
-               compatible = "ti,twl6040";
-               reg = <0x4b>;
-
-               pinctrl-names = "default";
-               pinctrl-0 = <&twl6040_pins>;
-
-               interrupts = <GIC_SPI 119 IRQ_TYPE_NONE>; /* IRQ_SYS_2N cascaded to gic */
-               ti,audpwron-gpio = <&gpio5 13 0>;  /* gpio line 141 */
-
-               vio-supply = <&smps7_reg>;
-               v2v1-supply = <&smps9_reg>;
-               enable-active-high;
-
-               clocks = <&clk32kgaudio>;
-               clock-names = "clk32k";
-       };
+&hdmi {
+       vdda-supply = <&ldo4_reg>;
 };
 
 &i2c5 {
        };
 };
 
-&mcpdm {
-       pinctrl-names = "default";
-       pinctrl-0 = <&mcpdm_pins>;
-       status = "okay";
-};
-
-&mcbsp1 {
-       pinctrl-names = "default";
-       pinctrl-0 = <&mcbsp1_pins>;
-       status = "okay";
-};
-
-&mcbsp2 {
-       pinctrl-names = "default";
-       pinctrl-0 = <&mcbsp2_pins>;
-       status = "okay";
-};
-
-&usbhshost {
-       port2-mode = "ehci-hsic";
-       port3-mode = "ehci-hsic";
-};
-
-&usbhsehci {
-       phys = <0 &hsusb2_phy &hsusb3_phy>;
-};
-
-&usb3 {
-       extcon = <&extcon_usb3>;
-       vbus-supply = <&smps10_out1_reg>;
-};
-
-&mcspi1 {
-
-};
-
-&mcspi2 {
-       pinctrl-names = "default";
-       pinctrl-0 = <&mcspi2_pins>;
-};
-
-&mcspi3 {
-       pinctrl-names = "default";
-       pinctrl-0 = <&mcspi3_pins>;
-};
-
-&mcspi4 {
-       pinctrl-names = "default";
-       pinctrl-0 = <&mcspi4_pins>;
-};
-
-&uart1 {
-       pinctrl-names = "default";
-       pinctrl-0 = <&uart1_pins>;
-};
-
-&uart3 {
-       pinctrl-names = "default";
-       pinctrl-0 = <&uart3_pins>;
-       interrupts-extended = <&wakeupgen GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH>,
-                             <&omap5_pmx_core 0x19c>;
-};
-
-&uart5 {
-       pinctrl-names = "default";
-       pinctrl-0 = <&uart5_pins>;
-};
-
-&cpu0 {
-       cpu0-supply = <&smps123_reg>;
-};
-
-&dss {
-       status = "ok";
+&omap5_pmx_core {
+       i2c5_pins: pinmux_i2c5_pins {
+               pinctrl-single,pins = <
+                       0x186 (PIN_INPUT | MUX_MODE0)           /* i2c5_scl */
+                       0x188 (PIN_INPUT | MUX_MODE0)           /* i2c5_sda */
+               >;
+       };
 };
 
-&hdmi {
-       status = "ok";
-       vdda-supply = <&ldo4_reg>;
-
-       pinctrl-names = "default";
-       pinctrl-0 = <&dss_hdmi_pins>;
-
-       port {
-               hdmi_out: endpoint {
-                       remote-endpoint = <&tpd12s015_in>;
-               };
-       };
+&tpd12s015 {
+       gpios = <&gpio9 0 GPIO_ACTIVE_HIGH>,    /* TCA6424A P01, CT CP HPD */
+               <&gpio9 1 GPIO_ACTIVE_HIGH>,    /* TCA6424A P00, LS OE */
+               <&gpio7 1 GPIO_ACTIVE_HIGH>;    /* GPIO 193, HPD */
 };
index 75cd01bd60241d0e0f06f2a390941c63a925e7bf..e1b6d2a2ac49e6097d6fe0566274e5ab792aef83 100644 (file)
                                status = "disabled";
                        };
 
+                       cesa: crypto@90000 {
+                               compatible = "marvell,orion-crypto";
+                               reg = <0x90000 0x10000>;
+                               reg-names = "regs";
+                               interrupts = <28>;
+                               marvell,crypto-srams = <&crypto_sram>;
+                               marvell,crypto-sram-size = <0x800>;
+                               status = "okay";
+                       };
+
                        ehci1: ehci@a0000 {
                                compatible = "marvell,orion-ehci";
                                reg = <0xa0000 0x1000>;
                        };
                };
 
-               cesa: crypto@90000 {
-                       compatible = "marvell,orion-crypto";
-                       reg = <MBUS_ID(0xf0, 0x01) 0x90000 0x10000>,
-                             <MBUS_ID(0x09, 0x00) 0x0 0x800>;
-                       reg-names = "regs", "sram";
-                       interrupts = <28>;
-                       status = "okay";
+               crypto_sram: sa-sram {
+                       compatible = "mmio-sram";
+                       reg = <MBUS_ID(0x09, 0x00) 0x0 0x800>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
                };
        };
 };
index 47c0282bdfca7ce11a8ce0e05119f8df229b9a4f..03784f1366e593ef2b317568962d1ab17ae03363 100644 (file)
@@ -1,4 +1,6 @@
 #include "qcom-apq8064-v2.0.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
 
 / {
        model = "CompuLab CM-QS600";
                stdout-path = "serial0:115200n8";
        };
 
+       pwrseq {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges;
+               compatible = "simple-bus";
+
+               sdcc4_pwrseq: sdcc4_pwrseq {
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&wlan_default_gpios>;
+                       compatible = "mmc-pwrseq-simple";
+                       reset-gpios = <&pm8921_gpio 43 GPIO_ACTIVE_LOW>;
+               };
+       };
+
        soc {
                pinctrl@800000 {
-                       i2c1_pins: i2c1 {
+                       card_detect: card_detect {
                                mux {
-                                       pins = "gpio20", "gpio21";
-                                       function = "gsbi1";
+                                       pins = "gpio26";
+                                       function = "gpio";
+                                       bias-disable;
                                };
                        };
                };
                        i2c@12460000 {
                                status = "okay";
                                clock-frequency = <200000>;
-                               pinctrl-0 = <&i2c1_pins>;
-                               pinctrl-names = "default";
 
-                               eeprom: eeprom@50 {
+                               eeprom@50 {
                                        compatible = "24c02";
                                        reg = <0x50>;
                                        pagesize = <32>;
                        qcom,mode = <GSBI_PROT_I2C_UART>;
                        serial@16640000 {
                                status = "ok";
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&gsbi7_uart_2pins>;
                        };
                };
 
                        regulator-always-on;
                };
 
+               qcom,ssbi@500000 {
+                       pmic@0 {
+                               gpio@150 {
+                                       wlan_default_gpios: wlan-gpios {
+                                               pios {
+                                                       pins = "gpio43";
+                                                       function = "normal";
+                                                       bias-disable;
+                                                       power-source = <PM8921_GPIO_S4>;
+                                               };
+                                       };
+                               };
+                       };
+               };
+
                amba {
                        /* eMMC */
                        sdcc1: sdcc@12400000 {
                        sdcc3: sdcc@12180000 {
                                status = "okay";
                                vmmc-supply = <&v3p3_fixed>;
+                               pinctrl-names   = "default";
+                               pinctrl-0       = <&card_detect>;
+                               cd-gpios        = <&tlmm_pinmux 26 GPIO_ACTIVE_LOW>;
                        };
                        /* WLAN */
                        sdcc4: sdcc@121c0000 {
                                status = "okay";
                                vmmc-supply = <&v3p3_fixed>;
                                vqmmc-supply = <&v3p3_fixed>;
+                               mmc-pwrseq = <&sdcc4_pwrseq>;
                        };
                };
        };
index f3100da082b2a3cbe1a1229a1f6be0a21ab4ca5a..11ac608b6d50e716e6fc2aabf47839ce1b871d96 100644 (file)
@@ -1,5 +1,6 @@
 #include "qcom-apq8064-v2.0.dtsi"
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
 
 / {
        model = "Qualcomm APQ8064/IFC6410";
                stdout-path = "serial0:115200n8";
        };
 
+       pwrseq {
+               compatible = "simple-bus";
+
+               sdcc4_pwrseq: sdcc4_pwrseq {
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&wlan_default_gpios>;
+                       compatible = "mmc-pwrseq-simple";
+                       reset-gpios = <&pm8921_gpio 43 GPIO_ACTIVE_LOW>;
+               };
+       };
+
+       leds {
+               compatible = "gpio-leds";
+               pinctrl-names = "default";
+               pinctrl-0 = <&notify_led>;
+
+               led@1 {
+                       label = "apq8064:green:user1";
+                       gpios = <&pm8921_gpio 18 GPIO_ACTIVE_HIGH>;
+                       default-state = "on";
+               };
+       };
+
        soc {
                pinctrl@800000 {
                        card_detect: card_detect {
                        qcom,mode = <GSBI_PROT_I2C>;
                        i2c3: i2c@16280000 {
                                status = "okay";
-                               pinctrl-0 = <&i2c3_pins>;
-                               pinctrl-names = "default";
                        };
                };
 
                        i2c@12460000 {
                                status = "okay";
                                clock-frequency = <200000>;
-                               pinctrl-0 = <&i2c1_pins>;
-                               pinctrl-names = "default";
 
-                               eeprom: eeprom@52 {
+                               eeprom@52 {
                                        compatible = "atmel,24c128";
                                        reg = <0x52>;
                                        pagesize = <32>;
 
                        serial@16540000 {
                                status = "ok";
-
                                pinctrl-names = "default";
-                               pinctrl-0 = <&uart_pins>;
+                               pinctrl-0 = <&gsbi6_uart_4pins>;
                        };
                };
 
                        qcom,mode = <GSBI_PROT_I2C_UART>;
                        serial@16640000 {
                                status = "ok";
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&gsbi7_uart_2pins>;
                        };
                };
 
                        status = "okay";
                };
 
+               qcom,ssbi@500000 {
+                       pmic@0 {
+                               gpio@150 {
+                                       wlan_default_gpios: wlan-gpios {
+                                               pios {
+                                                       pins = "gpio43";
+                                                       function = "normal";
+                                                       bias-disable;
+                                                       power-source = <PM8921_GPIO_S4>;
+                                               };
+                                       };
+
+                                       notify_led: nled {
+                                               pios {
+                                                       pins = "gpio18";
+                                                       function = "normal";
+                                                       bias-disable;
+                                                       power-source = <PM8921_GPIO_S4>;
+                                               };
+                                       };
+                               };
+                       };
+               };
+
                amba {
                        /* eMMC */
                        sdcc1: sdcc@12400000 {
                                status = "okay";
                                vmmc-supply = <&ext_3p3v>;
                                vqmmc-supply = <&pm8921_lvs1>;
+                               mmc-pwrseq = <&sdcc4_pwrseq>;
                        };
                };
        };
index d2e94d647c27936c682c7a4d6bb9033c769173e7..a4c1762b53ea3712a46e5f8a04cff5783d93b14d 100644 (file)
                                };
                        };
 
-                       uart_pins: uart_pins {
+                       gsbi6_uart_2pins: gsbi6_uart_2pins {
+                               mux {
+                                       pins = "gpio14", "gpio15";
+                                       function = "gsbi6";
+                               };
+                       };
+
+                       gsbi6_uart_4pins: gsbi6_uart_4pins {
                                mux {
                                        pins = "gpio14", "gpio15", "gpio16", "gpio17";
                                        function = "gsbi6";
                                };
                        };
+
+                       gsbi7_uart_2pins: gsbi7_uart_2pins {
+                               mux {
+                                       pins = "gpio82", "gpio83";
+                                       function = "gsbi7";
+                               };
+                       };
+
+                       gsbi7_uart_4pins: gsbi7_uart_4pins {
+                               mux {
+                                       pins = "gpio82", "gpio83", "gpio84", "gpio85";
+                                       function = "gsbi7";
+                               };
+                       };
                };
 
                intc: interrupt-controller@2000000 {
 
                        i2c1: i2c@12460000 {
                                compatible = "qcom,i2c-qup-v1.1.1";
+                               pinctrl-0 = <&i2c1_pins>;
+                               pinctrl-names = "default";
                                reg = <0x12460000 0x1000>;
                                interrupts = <0 194 IRQ_TYPE_NONE>;
                                clocks = <&gcc GSBI1_QUP_CLK>, <&gcc GSBI1_H_CLK>;
                        ranges;
                        i2c3: i2c@16280000 {
                                compatible = "qcom,i2c-qup-v1.1.1";
+                               pinctrl-0 = <&i2c3_pins>;
+                               pinctrl-names = "default";
                                reg = <0x16280000 0x1000>;
                                interrupts = <GIC_SPI 151 IRQ_TYPE_NONE>;
                                clocks = <&gcc GSBI3_QUP_CLK>,
                                        <136 1>, <137 1>, <138 1>, <139 1>;
                                };
 
+                               rtc@11d {
+                                       compatible = "qcom,pm8921-rtc";
+                                       interrupt-parent = <&pmicintc>;
+                                       interrupts = <39 1>;
+                                       reg = <0x11d>;
+                                       allow-set-time;
+                               };
+
+                               pwrkey@1c {
+                                       compatible = "qcom,pm8921-pwrkey";
+                                       reg = <0x1c>;
+                                       interrupt-parent = <&pmicintc>;
+                                       interrupts = <50 1>, <51 1>;
+                                       debounce = <15625>;
+                                       pull-up;
+                               };
                        };
                };
 
index 0554fbd72c40ba78f0c7205cdd050821d8b52b43..fcffecae3e67a2bd58ab80c1494a8edefd0bbf62 100644 (file)
                        compatible = "qcom,gcc-apq8084";
                        #clock-cells = <1>;
                        #reset-cells = <1>;
+                       #power-domain-cells = <1>;
                        reg = <0xfc400000 0x4000>;
                };
 
index ab8e5725046809e53b9ef7ce39b1f6ca33d35dcc..753bdfddd46ea5d503c8409cc5c035b239efe47c 100644 (file)
                clock-frequency = <19200000>;
        };
 
+       smem {
+               compatible = "qcom,smem";
+
+               memory-region = <&smem_region>;
+               qcom,rpm-msg-ram = <&rpm_msg_ram>;
+
+               hwlocks = <&tcsr_mutex 3>;
+       };
+
        soc: soc {
                #address-cells = <1>;
                #size-cells = <1>;
                              <0xf9002000 0x1000>;
                };
 
+               apcs: syscon@f9011000 {
+                       compatible = "syscon";
+                       reg = <0xf9011000 0x1000>;
+               };
+
                timer@f9020000 {
                        #address-cells = <1>;
                        #size-cells = <1>;
                        compatible = "qcom,gcc-msm8974";
                        #clock-cells = <1>;
                        #reset-cells = <1>;
+                       #power-domain-cells = <1>;
                        reg = <0xfc400000 0x4000>;
                };
 
                        compatible = "qcom,mmcc-msm8974";
                        #clock-cells = <1>;
                        #reset-cells = <1>;
+                       #power-domain-cells = <1>;
                        reg = <0xfd8c0000 0x6000>;
                };
 
                        #hwlock-cells = <1>;
                };
 
-               smem@fa00000 {
-                       compatible = "qcom,smem";
-
-                       memory-region = <&smem_region>;
+               rpm_msg_ram: memory@fc428000 {
+                       compatible = "qcom,rpm-msg-ram";
                        reg = <0xfc428000 0x4000>;
-
-                       hwlocks = <&tcsr_mutex 3>;
                };
 
                blsp1_uart2: serial@f991e000 {
                };
 
                blsp_i2c11: i2c@f9967000 {
-                       status = "disable";
+                       status = "disabled";
                        compatible = "qcom,i2c-qup-v2.1.1";
                        reg = <0xf9967000 0x1000>;
                        interrupts = <0 105 IRQ_TYPE_NONE>;
                        #interrupt-cells = <4>;
                };
        };
+
+       smd {
+               compatible = "qcom,smd";
+
+               rpm {
+                       interrupts = <0 168 1>;
+                       qcom,ipc = <&apcs 8 0>;
+                       qcom,smd-edge = <15>;
+
+                       rpm_requests {
+                               compatible = "qcom,rpm-msm8974";
+                               qcom,smd-channels = "rpm_requests";
+
+                               pm8841-regulators {
+                                       compatible = "qcom,rpm-pm8841-regulators";
+
+                                       pm8841_s1: s1 {};
+                                       pm8841_s2: s2 {};
+                                       pm8841_s3: s3 {};
+                                       pm8841_s4: s4 {};
+                                       pm8841_s5: s5 {};
+                                       pm8841_s6: s6 {};
+                                       pm8841_s7: s7 {};
+                                       pm8841_s8: s8 {};
+                               };
+
+                               pm8941-regulators {
+                                       compatible = "qcom,rpm-pm8941-regulators";
+
+                                       pm8941_s1: s1 {};
+                                       pm8941_s2: s2 {};
+                                       pm8941_s3: s3 {};
+                                       pm8941_5v: s4 {};
+
+                                       pm8941_l1: l1 {};
+                                       pm8941_l2: l2 {};
+                                       pm8941_l3: l3 {};
+                                       pm8941_l4: l4 {};
+                                       pm8941_l5: l5 {};
+                                       pm8941_l6: l6 {};
+                                       pm8941_l7: l7 {};
+                                       pm8941_l8: l8 {};
+                                       pm8941_l9: l9 {};
+                                       pm8941_l10: l10 {};
+                                       pm8941_l11: l11 {};
+                                       pm8941_l12: l12 {};
+                                       pm8941_l13: l13 {};
+                                       pm8941_l14: l14 {};
+                                       pm8941_l15: l15 {};
+                                       pm8941_l16: l16 {};
+                                       pm8941_l17: l17 {};
+                                       pm8941_l18: l18 {};
+                                       pm8941_l19: l19 {};
+                                       pm8941_l20: l20 {};
+                                       pm8941_l21: l21 {};
+                                       pm8941_l22: l22 {};
+                                       pm8941_l23: l23 {};
+                                       pm8941_l24: l24 {};
+
+                                       pm8941_lvs1: lvs1 {};
+                                       pm8941_lvs2: lvs2 {};
+                                       pm8941_lvs3: lvs3 {};
+
+                                       pm8941_5vs1: 5vs1 {};
+                                       pm8941_5vs2: 5vs2 {};
+                               };
+                       };
+               };
+       };
 };
index 968f1043d4f599ce9438f61f094834c484e9e22d..b0d443999fcccb84d3301e7787c292830a596e86 100644 (file)
                        bias-pull-up;
                };
 
+               charger@1000 {
+                       compatible = "qcom,pm8941-charger";
+                       reg = <0x1000 0x700>;
+                       interrupts = <0x0 0x10 7 IRQ_TYPE_EDGE_BOTH>,
+                                    <0x0 0x10 5 IRQ_TYPE_EDGE_BOTH>,
+                                    <0x0 0x10 4 IRQ_TYPE_EDGE_BOTH>,
+                                    <0x0 0x12 1 IRQ_TYPE_EDGE_BOTH>,
+                                    <0x0 0x12 0 IRQ_TYPE_EDGE_BOTH>,
+                                    <0x0 0x13 2 IRQ_TYPE_EDGE_BOTH>,
+                                    <0x0 0x13 1 IRQ_TYPE_EDGE_BOTH>,
+                                    <0x0 0x14 1 IRQ_TYPE_EDGE_BOTH>;
+                       interrupt-names = "chg-done",
+                                         "chg-fast",
+                                         "chg-trkl",
+                                         "bat-temp-ok",
+                                         "bat-present",
+                                         "chg-gone",
+                                         "usb-valid",
+                                         "dc-valid";
+               };
+
                pm8941_gpios: gpios@c000 {
                        compatible = "qcom,pm8941-gpio";
                        reg = <0xc000 0x2400>;
 
                pm8941_iadc: iadc@3600 {
                        compatible = "qcom,pm8941-iadc", "qcom,spmi-iadc";
-                       reg = <0x3600 0x100>,
-                                 <0x12f1 0x1>;
+                       reg = <0x3600 0x100>;
                        interrupts = <0x0 0x36 0x0 IRQ_TYPE_EDGE_RISING>;
                        qcom,external-resistor-micro-ohms = <10000>;
                };
diff --git a/arch/arm/boot/dts/r8a7778-bockw-reference.dts b/arch/arm/boot/dts/r8a7778-bockw-reference.dts
deleted file mode 100644 (file)
index dffa6ff..0000000
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- * Reference Device Tree Source for the Bock-W board
- *
- * Copyright (C) 2013  Renesas Solutions Corp.
- * Copyright (C) 2013  Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
- *
- * based on r8a7779
- *
- * Copyright (C) 2013 Renesas Solutions Corp.
- * Copyright (C) 2013 Simon Horman
- *
- * 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.
- */
-
-/dts-v1/;
-#include "r8a7778.dtsi"
-#include <dt-bindings/interrupt-controller/irq.h>
-#include <dt-bindings/gpio/gpio.h>
-
-/ {
-       model = "bockw";
-       compatible = "renesas,bockw-reference", "renesas,r8a7778";
-
-       aliases {
-               serial0 = &scif0;
-       };
-
-       chosen {
-               bootargs = "ignore_loglevel root=/dev/nfs ip=dhcp rw";
-               stdout-path = &scif0;
-       };
-
-       memory {
-               device_type = "memory";
-               reg = <0x60000000 0x10000000>;
-       };
-
-       fixedregulator3v3: fixedregulator@0 {
-               compatible = "regulator-fixed";
-               regulator-name = "fixed-3.3V";
-               regulator-min-microvolt = <3300000>;
-               regulator-max-microvolt = <3300000>;
-               regulator-boot-on;
-               regulator-always-on;
-       };
-
-       ethernet@18300000 {
-               compatible = "smsc,lan9220", "smsc,lan9115";
-               reg = <0x18300000 0x1000>;
-
-               phy-mode = "mii";
-               interrupt-parent = <&irqpin>;
-               interrupts = <0 IRQ_TYPE_EDGE_FALLING>;
-               reg-io-width = <4>;
-               vddvario-supply = <&fixedregulator3v3>;
-               vdd33a-supply = <&fixedregulator3v3>;
-       };
-
-};
-
-&mmcif {
-       pinctrl-0 = <&mmc_pins>;
-       pinctrl-names = "default";
-
-       vmmc-supply = <&fixedregulator3v3>;
-       bus-width = <8>;
-       broken-cd;
-       status = "okay";
-};
-
-&irqpin {
-       status = "okay";
-};
-
-&tmu0 {
-       status = "okay";
-};
-
-&pfc {
-       scif0_pins: serial0 {
-               renesas,groups = "scif0_data_a", "scif0_ctrl";
-               renesas,function = "scif0";
-       };
-
-       mmc_pins: mmc {
-               renesas,groups = "mmc_data8", "mmc_ctrl";
-               renesas,function = "mmc";
-       };
-
-       sdhi0_pins: sd0 {
-               renesas,groups = "sdhi0_data4", "sdhi0_ctrl",
-                                 "sdhi0_cd";
-               renesas,function = "sdhi0";
-       };
-
-       hspi0_pins: hspi0 {
-               renesas,groups = "hspi0_a";
-               renesas,function = "hspi0";
-       };
-};
-
-&sdhi0 {
-       pinctrl-0 = <&sdhi0_pins>;
-       pinctrl-names = "default";
-
-       vmmc-supply = <&fixedregulator3v3>;
-       bus-width = <4>;
-       status = "okay";
-       wp-gpios = <&gpio3 18 GPIO_ACTIVE_HIGH>;
-};
-
-&hspi0 {
-       pinctrl-0 = <&hspi0_pins>;
-       pinctrl-names = "default";
-       status = "okay";
-
-       flash: flash@0 {
-               #address-cells = <1>;
-               #size-cells = <1>;
-               compatible = "spansion,s25fl008k", "jedec,spi-nor";
-               reg = <0>;
-               spi-max-frequency = <104000000>;
-               m25p,fast-read;
-
-               partition@0 {
-                       label = "data(spi)";
-                       reg = <0x00000000 0x00100000>;
-               };
-       };
-};
-
-&scif0 {
-       pinctrl-0 = <&scif0_pins>;
-       pinctrl-names = "default";
-
-       status = "okay";
-};
index 4b1fa9f42ad5457b841b288c205c0a202540e661..4f8e0781174642a3f94e970affd42044d7d98d11 100644 (file)
                #sound-dai-cells = <1>;
                compatible = "renesas,rcar_sound-r8a7778", "renesas,rcar_sound-gen1";
                reg =   <0xffd90000 0x1000>,    /* SRU */
-                       <0xffd91000 0x1240>,    /* SSI */
+                       <0xffd91000 0x240>,     /* SSI */
                        <0xfffe0000 0x24>;      /* ADG */
                clocks = <&mstp3_clks R8A7778_CLK_SSI8>,
                        <&mstp3_clks R8A7778_CLK_SSI7>,
index 20afea6f06ef6735d23c382a426e3a09438be457..fe396c8d58db798637a5fabaa74fe1f069c8089f 100644 (file)
        compatible = "renesas,marzen", "renesas,r8a7779";
 
        aliases {
-               serial2 = &scif2;
-               serial4 = &scif4;
+               serial0 = &scif2;
+               serial1 = &scif4;
        };
 
        chosen {
-               bootargs = "console=ttySC2,115200 ignore_loglevel root=/dev/nfs ip=on";
+               bootargs = "ignore_loglevel root=/dev/nfs ip=on";
                stdout-path = &scif2;
        };
 
index 37dec52694911ea39ed7f44fd7939c48110fa63c..c553abd711eeb3813f786ad7a95bafc76502ee1c 100644 (file)
                          1800000 0>;
        };
 
+       audio_clock: clock {
+               compatible = "fixed-clock";
+               #clock-cells = <0>;
+               clock-frequency = <11289600>;
+               clock-output-names = "audio_clock";
+       };
+
        rsnd_ak4643: sound {
                compatible = "simple-audio-card";
 
 
                sndcodec: simple-audio-card,codec {
                        sound-dai = <&ak4643>;
-                       system-clock-frequency = <11289600>;
+                       clocks = <&audio_clock>;
                };
        };
 
                renesas,function = "msiof1";
        };
 
+       iic0_pins: iic0 {
+               renesas,groups = "iic0";
+               renesas,function = "iic0";
+       };
+
        iic1_pins: iic1 {
                renesas,groups = "iic1";
                renesas,function = "iic1";
 
 &iic0  {
        status = "okay";
+       pinctrl-0 = <&iic0_pins>;
+       pinctrl-names = "default";
 };
 
 &iic1  {
index 4624d0f2a75425310a65b462221374eabde85210..e07ae5d45e19ffd5e05cb6ce1e6cdcb7c238b649 100644 (file)
                reg =   <0 0xec500000 0 0x1000>, /* SCU */
                        <0 0xec5a0000 0 0x100>,  /* ADG */
                        <0 0xec540000 0 0x1000>, /* SSIU */
-                       <0 0xec541000 0 0x1280>, /* SSI */
+                       <0 0xec541000 0 0x280>,  /* SSI */
                        <0 0xec740000 0 0x200>;  /* Audio DMAC peri peri*/
                reg-names = "scu", "adg", "ssiu", "ssi", "audmapp";
 
index dc158845afdc877a0d386d711c09b87fac17bc21..fc44ea361a4b72bc89b046c759a1ec78a077ff10 100644 (file)
                          1800000 0>;
        };
 
+       audio_clock: clock {
+               compatible = "fixed-clock";
+               #clock-cells = <0>;
+               clock-frequency = <11289600>;
+               clock-output-names = "audio_clock";
+       };
+
        rsnd_ak4643: sound {
                compatible = "simple-audio-card";
 
 
                sndcodec: simple-audio-card,codec {
                        sound-dai = <&ak4643>;
-                       system-clock-frequency = <11289600>;
+                       clocks = <&audio_clock>;
                };
        };
 
diff --git a/arch/arm/boot/dts/r8a7791-porter.dts b/arch/arm/boot/dts/r8a7791-porter.dts
new file mode 100644 (file)
index 0000000..fe0f12f
--- /dev/null
@@ -0,0 +1,282 @@
+/*
+ * Device Tree Source for the Porter board
+ *
+ * Copyright (C) 2015 Cogent Embedded, 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.
+ */
+
+/dts-v1/;
+#include "r8a7791.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+
+/ {
+       model = "Porter";
+       compatible = "renesas,porter", "renesas,r8a7791";
+
+       aliases {
+               serial0 = &scif0;
+       };
+
+       chosen {
+               bootargs = "ignore_loglevel rw root=/dev/nfs ip=dhcp";
+               stdout-path = &scif0;
+       };
+
+       memory@40000000 {
+               device_type = "memory";
+               reg = <0 0x40000000 0 0x40000000>;
+       };
+
+       memory@200000000 {
+               device_type = "memory";
+               reg = <2 0x00000000 0 0x40000000>;
+       };
+
+       vcc_sdhi0: regulator@0 {
+               compatible = "regulator-fixed";
+
+               regulator-name = "SDHI0 Vcc";
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+               regulator-always-on;
+       };
+
+       vccq_sdhi0: regulator@1 {
+               compatible = "regulator-gpio";
+
+               regulator-name = "SDHI0 VccQ";
+               regulator-min-microvolt = <1800000>;
+               regulator-max-microvolt = <3300000>;
+
+               gpios = <&gpio2 12 GPIO_ACTIVE_HIGH>;
+               gpios-states = <1>;
+               states = <3300000 1
+                         1800000 0>;
+       };
+
+       vcc_sdhi2: regulator@2 {
+               compatible = "regulator-fixed";
+
+               regulator-name = "SDHI2 Vcc";
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+               regulator-always-on;
+       };
+
+       vccq_sdhi2: regulator@3 {
+               compatible = "regulator-gpio";
+
+               regulator-name = "SDHI2 VccQ";
+               regulator-min-microvolt = <1800000>;
+               regulator-max-microvolt = <3300000>;
+
+               gpios = <&gpio2 26 GPIO_ACTIVE_HIGH>;
+               gpios-states = <1>;
+               states = <3300000 1
+                         1800000 0>;
+       };
+};
+
+&extal_clk {
+       clock-frequency = <20000000>;
+};
+
+&pfc {
+       scif0_pins: serial0 {
+               renesas,groups = "scif0_data_d";
+               renesas,function = "scif0";
+       };
+
+       ether_pins: ether {
+               renesas,groups = "eth_link", "eth_mdio", "eth_rmii";
+               renesas,function = "eth";
+       };
+
+       phy1_pins: phy1 {
+               renesas,groups = "intc_irq0";
+               renesas,function = "intc";
+       };
+
+       sdhi0_pins: sd0 {
+               renesas,groups = "sdhi0_data4", "sdhi0_ctrl";
+               renesas,function = "sdhi0";
+       };
+
+       sdhi2_pins: sd2 {
+               renesas,groups = "sdhi2_data4", "sdhi2_ctrl";
+               renesas,function = "sdhi2";
+       };
+
+       qspi_pins: spi0 {
+               renesas,groups = "qspi_ctrl", "qspi_data4";
+               renesas,function = "qspi";
+       };
+
+       i2c2_pins: i2c2 {
+               renesas,groups = "i2c2";
+               renesas,function = "i2c2";
+       };
+
+       usb0_pins: usb0 {
+               renesas,groups = "usb0";
+               renesas,function = "usb0";
+       };
+
+       usb1_pins: usb1 {
+               renesas,groups = "usb1";
+               renesas,function = "usb1";
+       };
+
+       vin0_pins: vin0 {
+               renesas,groups = "vin0_data8", "vin0_clk";
+               renesas,function = "vin0";
+       };
+};
+
+&scif0 {
+       pinctrl-0 = <&scif0_pins>;
+       pinctrl-names = "default";
+
+       status = "okay";
+};
+
+&ether {
+       pinctrl-0 = <&ether_pins &phy1_pins>;
+       pinctrl-names = "default";
+
+       phy-handle = <&phy1>;
+       renesas,ether-link-active-low;
+       status = "ok";
+
+       phy1: ethernet-phy@1 {
+               reg = <1>;
+               interrupt-parent = <&irqc0>;
+               interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
+               micrel,led-mode = <1>;
+       };
+};
+
+&sdhi0 {
+       pinctrl-0 = <&sdhi0_pins>;
+       pinctrl-names = "default";
+
+       vmmc-supply = <&vcc_sdhi0>;
+       vqmmc-supply = <&vccq_sdhi0>;
+       cd-gpios = <&gpio6 6 GPIO_ACTIVE_LOW>;
+       wp-gpios = <&gpio6 7 GPIO_ACTIVE_HIGH>;
+       status = "okay";
+};
+
+&sdhi2 {
+       pinctrl-0 = <&sdhi2_pins>;
+       pinctrl-names = "default";
+
+       vmmc-supply = <&vcc_sdhi2>;
+       vqmmc-supply = <&vccq_sdhi2>;
+       cd-gpios = <&gpio6 22 GPIO_ACTIVE_LOW>;
+       status = "okay";
+};
+
+&qspi {
+       pinctrl-0 = <&qspi_pins>;
+       pinctrl-names = "default";
+
+       status = "okay";
+
+       flash@0 {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "spansion,s25fl512s", "jedec,spi-nor";
+               reg = <0>;
+               spi-max-frequency = <30000000>;
+               spi-tx-bus-width = <4>;
+               spi-rx-bus-width = <4>;
+               m25p,fast-read;
+
+               partition@0 {
+                       label = "loader_prg";
+                       reg = <0x00000000 0x00040000>;
+                       read-only;
+               };
+               partition@40000 {
+                       label = "user_prg";
+                       reg = <0x00040000 0x00400000>;
+                       read-only;
+               };
+               partition@440000 {
+                       label = "flash_fs";
+                       reg = <0x00440000 0x03bc0000>;
+               };
+       };
+};
+
+&i2c2 {
+       pinctrl-0 = <&i2c2_pins>;
+       pinctrl-names = "default";
+
+       status = "okay";
+       clock-frequency = <400000>;
+
+       composite-in@20 {
+               compatible = "adi,adv7180";
+               reg = <0x20>;
+               remote = <&vin0>;
+
+               port {
+                       adv7180: endpoint {
+                               bus-width = <8>;
+                               remote-endpoint = <&vin0ep>;
+                       };
+               };
+       };
+};
+
+&sata0 {
+       status = "okay";
+};
+
+/* composite video input */
+&vin0 {
+       status = "ok";
+       pinctrl-0 = <&vin0_pins>;
+       pinctrl-names = "default";
+
+       port {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               vin0ep: endpoint {
+                       remote-endpoint = <&adv7180>;
+                       bus-width = <8>;
+               };
+       };
+};
+
+&pci0 {
+       pinctrl-0 = <&usb0_pins>;
+       pinctrl-names = "default";
+
+       status = "okay";
+};
+
+&pci1 {
+       pinctrl-0 = <&usb1_pins>;
+       pinctrl-names = "default";
+
+       status = "okay";
+};
+
+&usbphy {
+       status = "okay";
+};
+
+&pcie_bus_clk {
+       status = "okay";
+};
+
+&pciec {
+       status = "okay";
+};
index 1666c8a6b1432e4f1c8a1a822fb59cb7d5de7375..328f48bd15e711adb729450f4638afb24600bc99 100644 (file)
                reg =   <0 0xec500000 0 0x1000>, /* SCU */
                        <0 0xec5a0000 0 0x100>,  /* ADG */
                        <0 0xec540000 0 0x1000>, /* SSIU */
-                       <0 0xec541000 0 0x1280>, /* SSI */
+                       <0 0xec541000 0 0x280>,  /* SSI */
                        <0 0xec740000 0 0x200>;  /* Audio DMAC peri peri*/
                reg-names = "scu", "adg", "ssiu", "ssi", "audmapp";
 
index d4dd5a30ccdf30cfc1c19d84d206b5b75da16a40..48ff3e2958ae68d5e81b6713379cba6f2b100c3f 100644 (file)
                renesas,function = "intc";
        };
 
+       i2c1_pins: i2c1 {
+               renesas,groups = "i2c1";
+               renesas,function = "i2c1";
+       };
+
        mmcif0_pins: mmcif0 {
                renesas,groups = "mmc_data8", "mmc_ctrl";
                renesas,function = "mmc";
        };
+
+       qspi_pins: spi0 {
+               renesas,groups = "qspi_ctrl", "qspi_data4";
+               renesas,function = "qspi";
+       };
+
+       vin0_pins: vin0 {
+               renesas,groups = "vin0_data8", "vin0_clk";
+               renesas,function = "vin0";
+       };
+
+       usb0_pins: usb0 {
+               renesas,groups = "usb0";
+               renesas,function = "usb0";
+       };
+
+       usb1_pins: usb1 {
+               renesas,groups = "usb1";
+               renesas,function = "usb1";
+       };
 };
 
 &scif2 {
        };
 };
 
+&i2c1 {
+       pinctrl-0 = <&i2c1_pins>;
+       pinctrl-names = "default";
+
+       status = "okay";
+       clock-frequency = <400000>;
+
+       composite-in@20 {
+               compatible = "adi,adv7180";
+               reg = <0x20>;
+               remote = <&vin0>;
+
+               port {
+                       adv7180: endpoint {
+                               bus-width = <8>;
+                               remote-endpoint = <&vin0ep>;
+                       };
+               };
+       };
+};
+
 &mmcif0 {
        pinctrl-0 = <&mmcif0_pins>;
        pinctrl-names = "default";
        non-removable;
        status = "okay";
 };
+
+&qspi {
+       pinctrl-0 = <&qspi_pins>;
+       pinctrl-names = "default";
+
+       status = "okay";
+
+       flash@0 {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "spansion,s25fl512s", "jedec,spi-nor";
+               reg = <0>;
+               spi-max-frequency = <30000000>;
+               spi-tx-bus-width = <4>;
+               spi-rx-bus-width = <4>;
+               spi-cpol;
+               spi-cpha;
+               m25p,fast-read;
+
+               partition@0 {
+                       label = "loader";
+                       reg = <0x00000000 0x00040000>;
+                       read-only;
+               };
+               partition@40000 {
+                       label = "user";
+                       reg = <0x00040000 0x00400000>;
+                       read-only;
+               };
+               partition@440000 {
+                       label = "flash";
+                       reg = <0x00440000 0x03bc0000>;
+               };
+       };
+};
+
+/* composite video input */
+&vin0 {
+       status = "okay";
+       pinctrl-0 = <&vin0_pins>;
+       pinctrl-names = "default";
+
+       port {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               vin0ep: endpoint {
+                       remote-endpoint = <&adv7180>;
+                       bus-width = <8>;
+               };
+       };
+};
+
+&pci0 {
+       status = "okay";
+       pinctrl-0 = <&usb0_pins>;
+       pinctrl-names = "default";
+};
+
+&pci1 {
+       status = "okay";
+       pinctrl-0 = <&usb1_pins>;
+       pinctrl-names = "default";
+};
+
+&usbphy {
+       status = "okay";
+};
index 97c8e9ace5ebee1ee83d1e193eb985ebc7cc6f40..a9977d6ee81af21fbb3c2268a2deb8588c300ecf 100644 (file)
        #address-cells = <2>;
        #size-cells = <2>;
 
+       aliases {
+               i2c0 = &i2c0;
+               i2c1 = &i2c1;
+               i2c2 = &i2c2;
+               i2c3 = &i2c3;
+               i2c4 = &i2c4;
+               i2c5 = &i2c5;
+               spi0 = &qspi;
+               vin0 = &vin0;
+               vin1 = &vin1;
+       };
+
        cpus {
                #address-cells = <1>;
                #size-cells = <0>;
                interrupts = <1 9 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_HIGH)>;
        };
 
+       gpio0: gpio@e6050000 {
+               compatible = "renesas,gpio-r8a7794", "renesas,gpio-rcar";
+               reg = <0 0xe6050000 0 0x50>;
+               interrupts = <0 4 IRQ_TYPE_LEVEL_HIGH>;
+               #gpio-cells = <2>;
+               gpio-controller;
+               gpio-ranges = <&pfc 0 0 32>;
+               #interrupt-cells = <2>;
+               interrupt-controller;
+               clocks = <&mstp9_clks R8A7794_CLK_GPIO0>;
+               power-domains = <&cpg_clocks>;
+       };
+
+       gpio1: gpio@e6051000 {
+               compatible = "renesas,gpio-r8a7794", "renesas,gpio-rcar";
+               reg = <0 0xe6051000 0 0x50>;
+               interrupts = <0 5 IRQ_TYPE_LEVEL_HIGH>;
+               #gpio-cells = <2>;
+               gpio-controller;
+               gpio-ranges = <&pfc 0 32 26>;
+               #interrupt-cells = <2>;
+               interrupt-controller;
+               clocks = <&mstp9_clks R8A7794_CLK_GPIO1>;
+               power-domains = <&cpg_clocks>;
+       };
+
+       gpio2: gpio@e6052000 {
+               compatible = "renesas,gpio-r8a7794", "renesas,gpio-rcar";
+               reg = <0 0xe6052000 0 0x50>;
+               interrupts = <0 6 IRQ_TYPE_LEVEL_HIGH>;
+               #gpio-cells = <2>;
+               gpio-controller;
+               gpio-ranges = <&pfc 0 64 32>;
+               #interrupt-cells = <2>;
+               interrupt-controller;
+               clocks = <&mstp9_clks R8A7794_CLK_GPIO2>;
+               power-domains = <&cpg_clocks>;
+       };
+
+       gpio3: gpio@e6053000 {
+               compatible = "renesas,gpio-r8a7794", "renesas,gpio-rcar";
+               reg = <0 0xe6053000 0 0x50>;
+               interrupts = <0 7 IRQ_TYPE_LEVEL_HIGH>;
+               #gpio-cells = <2>;
+               gpio-controller;
+               gpio-ranges = <&pfc 0 96 32>;
+               #interrupt-cells = <2>;
+               interrupt-controller;
+               clocks = <&mstp9_clks R8A7794_CLK_GPIO3>;
+               power-domains = <&cpg_clocks>;
+       };
+
+       gpio4: gpio@e6054000 {
+               compatible = "renesas,gpio-r8a7794", "renesas,gpio-rcar";
+               reg = <0 0xe6054000 0 0x50>;
+               interrupts = <0 8 IRQ_TYPE_LEVEL_HIGH>;
+               #gpio-cells = <2>;
+               gpio-controller;
+               gpio-ranges = <&pfc 0 128 32>;
+               #interrupt-cells = <2>;
+               interrupt-controller;
+               clocks = <&mstp9_clks R8A7794_CLK_GPIO4>;
+               power-domains = <&cpg_clocks>;
+       };
+
+       gpio5: gpio@e6055000 {
+               compatible = "renesas,gpio-r8a7794", "renesas,gpio-rcar";
+               reg = <0 0xe6055000 0 0x50>;
+               interrupts = <0 9 IRQ_TYPE_LEVEL_HIGH>;
+               #gpio-cells = <2>;
+               gpio-controller;
+               gpio-ranges = <&pfc 0 160 28>;
+               #interrupt-cells = <2>;
+               interrupt-controller;
+               clocks = <&mstp9_clks R8A7794_CLK_GPIO5>;
+               power-domains = <&cpg_clocks>;
+       };
+
+       gpio6: gpio@e6055400 {
+               compatible = "renesas,gpio-r8a7794", "renesas,gpio-rcar";
+               reg = <0 0xe6055400 0 0x50>;
+               interrupts = <0 10 IRQ_TYPE_LEVEL_HIGH>;
+               #gpio-cells = <2>;
+               gpio-controller;
+               gpio-ranges = <&pfc 0 192 26>;
+               #interrupt-cells = <2>;
+               interrupt-controller;
+               clocks = <&mstp9_clks R8A7794_CLK_GPIO6>;
+               power-domains = <&cpg_clocks>;
+       };
+
        cmt0: timer@ffca0000 {
                compatible = "renesas,cmt-48-gen2";
                reg = <0 0xffca0000 0 0x1004>;
                status = "disabled";
        };
 
+       /* The memory map in the User's Manual maps the cores to bus numbers */
+       i2c0: i2c@e6508000 {
+               compatible = "renesas,i2c-r8a7794";
+               reg = <0 0xe6508000 0 0x40>;
+               interrupts = <0 287 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&mstp9_clks R8A7794_CLK_I2C0>;
+               power-domains = <&cpg_clocks>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+               status = "disabled";
+       };
+
+       i2c1: i2c@e6518000 {
+               compatible = "renesas,i2c-r8a7794";
+               reg = <0 0xe6518000 0 0x40>;
+               interrupts = <0 288 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&mstp9_clks R8A7794_CLK_I2C1>;
+               power-domains = <&cpg_clocks>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+               status = "disabled";
+       };
+
+       i2c2: i2c@e6530000 {
+               compatible = "renesas,i2c-r8a7794";
+               reg = <0 0xe6530000 0 0x40>;
+               interrupts = <0 286 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&mstp9_clks R8A7794_CLK_I2C2>;
+               power-domains = <&cpg_clocks>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+               status = "disabled";
+       };
+
+       i2c3: i2c@e6540000 {
+               compatible = "renesas,i2c-r8a7794";
+               reg = <0 0xe6540000 0 0x40>;
+               interrupts = <0 290 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&mstp9_clks R8A7794_CLK_I2C3>;
+               power-domains = <&cpg_clocks>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+               status = "disabled";
+       };
+
+       i2c4: i2c@e6520000 {
+               compatible = "renesas,i2c-r8a7794";
+               reg = <0 0xe6520000 0 0x40>;
+               interrupts = <0 19 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&mstp9_clks R8A7794_CLK_I2C4>;
+               power-domains = <&cpg_clocks>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+               status = "disabled";
+       };
+
+       i2c5: i2c@e6528000 {
+               compatible = "renesas,i2c-r8a7794";
+               reg = <0 0xe6528000 0 0x40>;
+               interrupts = <0 20 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&mstp9_clks R8A7794_CLK_I2C5>;
+               power-domains = <&cpg_clocks>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+               status = "disabled";
+       };
+
        mmcif0: mmc@ee200000 {
                compatible = "renesas,mmcif-r8a7794", "renesas,sh-mmcif";
                reg = <0 0xee200000 0 0x80>;
                status = "disabled";
        };
 
+       qspi: spi@e6b10000 {
+               compatible = "renesas,qspi-r8a7794", "renesas,qspi";
+               reg = <0 0xe6b10000 0 0x2c>;
+               interrupts = <0 184 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&mstp9_clks R8A7794_CLK_QSPI_MOD>;
+               dmas = <&dmac0 0x17>, <&dmac0 0x18>;
+               dma-names = "tx", "rx";
+               power-domains = <&cpg_clocks>;
+               num-cs = <1>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+               status = "disabled";
+       };
+
+       vin0: video@e6ef0000 {
+               compatible = "renesas,vin-r8a7794";
+               reg = <0 0xe6ef0000 0 0x1000>;
+               interrupts = <0 188 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&mstp8_clks R8A7794_CLK_VIN0>;
+               power-domains = <&cpg_clocks>;
+               status = "disabled";
+       };
+
+       vin1: video@e6ef1000 {
+               compatible = "renesas,vin-r8a7794";
+               reg = <0 0xe6ef1000 0 0x1000>;
+               interrupts = <0 189 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&mstp8_clks R8A7794_CLK_VIN1>;
+               power-domains = <&cpg_clocks>;
+               status = "disabled";
+       };
+
+       pci0: pci@ee090000 {
+               compatible = "renesas,pci-r8a7794";
+               device_type = "pci";
+               reg = <0 0xee090000 0 0xc00>,
+                     <0 0xee080000 0 0x1100>;
+               interrupts = <0 108 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&mstp7_clks R8A7794_CLK_EHCI>;
+               power-domains = <&cpg_clocks>;
+               status = "disabled";
+
+               bus-range = <0 0>;
+               #address-cells = <3>;
+               #size-cells = <2>;
+               #interrupt-cells = <1>;
+               ranges = <0x02000000 0 0xee080000 0 0xee080000 0 0x00010000>;
+               interrupt-map-mask = <0xff00 0 0 0x7>;
+               interrupt-map = <0x0000 0 0 1 &gic 0 108 IRQ_TYPE_LEVEL_HIGH
+                                0x0800 0 0 1 &gic 0 108 IRQ_TYPE_LEVEL_HIGH
+                                0x1000 0 0 2 &gic 0 108 IRQ_TYPE_LEVEL_HIGH>;
+
+               usb@0,1 {
+                       reg = <0x800 0 0 0 0>;
+                       device_type = "pci";
+                       phys = <&usb0 0>;
+                       phy-names = "usb";
+               };
+
+               usb@0,2 {
+                       reg = <0x1000 0 0 0 0>;
+                       device_type = "pci";
+                       phys = <&usb0 0>;
+                       phy-names = "usb";
+               };
+       };
+
+       pci1: pci@ee0d0000 {
+               compatible = "renesas,pci-r8a7794";
+               device_type = "pci";
+               reg = <0 0xee0d0000 0 0xc00>,
+                     <0 0xee0c0000 0 0x1100>;
+               interrupts = <0 113 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&mstp7_clks R8A7794_CLK_EHCI>;
+               power-domains = <&cpg_clocks>;
+               status = "disabled";
+
+               bus-range = <1 1>;
+               #address-cells = <3>;
+               #size-cells = <2>;
+               #interrupt-cells = <1>;
+               ranges = <0x02000000 0 0xee0c0000 0 0xee0c0000 0 0x00010000>;
+               interrupt-map-mask = <0xff00 0 0 0x7>;
+               interrupt-map = <0x0000 0 0 1 &gic 0 113 IRQ_TYPE_LEVEL_HIGH
+                                0x0800 0 0 1 &gic 0 113 IRQ_TYPE_LEVEL_HIGH
+                                0x1000 0 0 2 &gic 0 113 IRQ_TYPE_LEVEL_HIGH>;
+
+               usb@0,1 {
+                       reg = <0x800 0 0 0 0>;
+                       device_type = "pci";
+                       phys = <&usb2 0>;
+                       phy-names = "usb";
+               };
+
+               usb@0,2 {
+                       reg = <0x1000 0 0 0 0>;
+                       device_type = "pci";
+                       phys = <&usb2 0>;
+                       phy-names = "usb";
+               };
+       };
+
+       hsusb: usb@e6590000 {
+               compatible = "renesas,usbhs-r8a7794";
+               reg = <0 0xe6590000 0 0x100>;
+               interrupts = <0 107 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&mstp7_clks R8A7794_CLK_HSUSB>;
+               power-domains = <&cpg_clocks>;
+               renesas,buswait = <4>;
+               phys = <&usb0 1>;
+               phy-names = "usb";
+               status = "disabled";
+       };
+
+       usbphy: usb-phy@e6590100 {
+               compatible = "renesas,usb-phy-r8a7794";
+               reg = <0 0xe6590100 0 0x100>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+               clocks = <&mstp7_clks R8A7794_CLK_HSUSB>;
+               clock-names = "usbhs";
+               power-domains = <&cpg_clocks>;
+               status = "disabled";
+
+               usb0: usb-channel@0 {
+                       reg = <0>;
+                       #phy-cells = <1>;
+               };
+               usb2: usb-channel@2 {
+                       reg = <2>;
+                       #phy-cells = <1>;
+               };
+       };
+
        clocks {
                #address-cells = <2>;
                #size-cells = <2>;
                mstp9_clks: mstp9_clks@e6150994 {
                        compatible = "renesas,r8a7794-mstp-clocks", "renesas,cpg-mstp-clocks";
                        reg = <0 0xe6150994 0 4>, <0 0xe61509a4 0 4>;
-                       clocks = <&cpg_clocks R8A7794_CLK_QSPI>, <&hp_clk>, <&hp_clk>,
-                               <&hp_clk>, <&hp_clk>, <&hp_clk>, <&hp_clk>;
+                       clocks = <&cp_clk>, <&cp_clk>, <&cp_clk>, <&cp_clk>,
+                                <&cp_clk>, <&cp_clk>, <&cp_clk>,
+                                <&cpg_clocks R8A7794_CLK_QSPI>, <&hp_clk>, <&hp_clk>,
+                                <&hp_clk>, <&hp_clk>, <&hp_clk>, <&hp_clk>;
                        #clock-cells = <1>;
-                       clock-indices = <
-                               R8A7794_CLK_QSPI_MOD R8A7794_CLK_I2C5 R8A7794_CLK_I2C4
-                               R8A7794_CLK_I2C3 R8A7794_CLK_I2C2 R8A7794_CLK_I2C1
-                               R8A7794_CLK_I2C0
-                       >;
+                       clock-indices = <R8A7794_CLK_GPIO6 R8A7794_CLK_GPIO5
+                                        R8A7794_CLK_GPIO4 R8A7794_CLK_GPIO3
+                                        R8A7794_CLK_GPIO2 R8A7794_CLK_GPIO1
+                                        R8A7794_CLK_GPIO0 R8A7794_CLK_QSPI_MOD
+                                        R8A7794_CLK_I2C5 R8A7794_CLK_I2C4
+                                        R8A7794_CLK_I2C3 R8A7794_CLK_I2C2
+                                        R8A7794_CLK_I2C1 R8A7794_CLK_I2C0>;
                        clock-output-names =
-                               "qspi_mod", "i2c5", "i2c4", "i2c3", "i2c2", "i2c1", "i2c0";
+                               "gpio6", "gpio5", "gpio4", "gpio3", "gpio2",
+                               "gpio1", "gpio0", "qspi_mod",
+                               "i2c5", "i2c4", "i2c3", "i2c2", "i2c1", "i2c0";
                };
                mstp11_clks: mstp11_clks@e615099c {
                        compatible = "renesas,r8a7794-mstp-clocks", "renesas,cpg-mstp-clocks";
diff --git a/arch/arm/boot/dts/r8a77xx-aa121td01-panel.dtsi b/arch/arm/boot/dts/r8a77xx-aa121td01-panel.dtsi
new file mode 100644 (file)
index 0000000..a07ebf8
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * Common file for the AA121TD01 panel connected to Renesas R-Car boards
+ *
+ * Copyright (C) 2015 Renesas Electronics Corp.
+ *
+ * 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.
+ */
+
+/ {
+       panel {
+               compatible = "mitsubishi,aa121td01", "panel-dpi";
+
+               width-mm = <261>;
+               height-mm = <163>;
+
+               panel-timing {
+                       /* 1280x800 @60Hz */
+                       clock-frequency = <71000000>;
+                       hactive = <1280>;
+                       vactive = <800>;
+                       hsync-len = <70>;
+                       hfront-porch = <20>;
+                       hback-porch = <70>;
+                       vsync-len = <5>;
+                       vfront-porch = <3>;
+                       vback-porch = <15>;
+               };
+
+               port {
+                       panel_in: endpoint {
+                               remote-endpoint = <&lvds_connector>;
+                       };
+               };
+       };
+};
+
+&lvds_connector {
+       remote-endpoint = <&panel_in>;
+};
index c0273755431a118e2832fea298818da6032284e5..38c91a839795f3cf77103f56fdb7bb0185ad2854 100644 (file)
        pinctrl-0 = <&sd0_clk>, <&sd0_cmd>, <&sd0_cd>, <&sd0_bus4>;
        vmmc-supply = <&vcc_sd0>;
        bus-width = <4>;
+       cap-mmc-highspeed;
+       cap-sd-highspeed;
        disable-wp;
 };
 
index bae965c123c165d38fb8d8836667ae749893f283..7cdc308bfac54c1ec6e286f29c4ad0c846df41aa 100644 (file)
        };
 };
 
+&mmc0 {
+       status = "okay";
+
+       pinctrl-names = "default";
+       pinctrl-0 = <&sd0_clk>, <&sd0_cmd>, <&sd0_cd>, <&sd0_bus4>;
+       vmmc-supply = <&vcc_sd0>;
+};
+
 &pinctrl {
        lan8720a {
                phy_int: phy-int {
index e36383c701dc5a9ecbd8ae67345e587264b75d9f..341c1f87936a7d20114175802e79f0a3196e9a25 100644 (file)
        pinctrl-names = "default";
        pinctrl-0 = <&sd0_clk>, <&sd0_cmd>, <&sd0_cd>, <&sd0_bus4>;
        vmmc-supply = <&vcc_sd>;
+       cap-mmc-highspeed;
+       cap-sd-highspeed;
        status = "okay";
 };
 
index d2180e5d2b055c239cbf006f666ecc9358e69f8d..66fa87d1e2c2492f247b703fce10d3b34f2076e9 100644 (file)
                };
        };
 
+       sound {
+               compatible = "simple-audio-card";
+               simple-audio-card,name = "SPDIF";
+
+               simple-audio-card,dai-link@1 {  /* S/PDIF - S/PDIF */
+                       cpu { sound-dai = <&spdif>; };
+                       codec { sound-dai = <&spdif_out>; };
+               };
+       };
+
+       spdif_out: spdif-out {
+               compatible = "linux,spdif-dit";
+               #sound-dai-cells = <0>;
+       };
+
        ir_recv: gpio-ir-receiver {
                compatible = "gpio-ir-receiver";
                gpios = <&gpio0 10 1>;
        vmmc-supply = <&vcc_sd0>;
 
        bus-width = <4>;
+       cap-mmc-highspeed;
+       cap-sd-highspeed;
        disable-wp;
 };
 
        };
 };
 
+&spdif {
+       status = "okay";
+};
+
 &uart0 {
        status = "okay";
 };
index 3163042721185af85c80a32a1fa5b18e69574189..6399942f1840cc4ae485c07040f848d1bc630fea 100644 (file)
                status = "disabled";
        };
 
+       spdif: sound@1011e000 {
+               compatible = "rockchip,rk3188-spdif", "rockchip,rk3066-spdif";
+               reg = <0x1011e000 0x2000>;
+               #sound-dai-cells = <0>;
+               clock-names = "hclk", "mclk";
+               clocks = <&cru HCLK_SPDIF>, <&cru SCLK_SPDIF>;
+               dmas = <&dmac1_s 8>;
+               dma-names = "tx";
+               interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&spdif_tx>;
+               status = "disabled";
+       };
+
        cru: clock-controller@20000000 {
                compatible = "rockchip,rk3188-cru";
                reg = <0x20000000 0x1000>;
                                                <RK_GPIO1 21 RK_FUNC_1 &pcfg_pull_none>;
                        };
                };
+
+               spdif {
+                       spdif_tx: spdif-tx {
+                               rockchip,pins = <RK_GPIO1 14 RK_FUNC_1 &pcfg_pull_none>;
+                       };
+               };
        };
 };
 
index 20fa0ef0b96b8cd7523ca5f599f57e20f45c1ba3..4e3fd9aefe3497e464bc8fecdb10a688372460a6 100644 (file)
                reg = <0 0x80000000>;
        };
 
+       dovdd_1v8: dovdd-1v8-regulator {
+               compatible = "regulator-fixed";
+               regulator-name = "dovdd_1v8";
+               regulator-min-microvolt = <1800000>;
+               regulator-max-microvolt = <1800000>;
+               vin-supply = <&vcc28_dvp>;
+       };
+
        ext_gmac: external-gmac-clock {
                compatible = "fixed-clock";
                #clock-cells = <0>;
                clock-output-names = "ext_gmac";
        };
 
+       io_domains: io-domains {
+               compatible = "rockchip,rk3288-io-voltage-domain";
+               rockchip,grf = <&grf>;
+
+               audio-supply = <&vcca_33>;
+               bb-supply = <&vcc_io>;
+               dvp-supply = <&dovdd_1v8>;
+               flash0-supply = <&vcc_flash>;
+               flash1-supply = <&vcc_lan>;
+               gpio30-supply = <&vcc_io>;
+               gpio1830-supply = <&vcc_io>;
+               lcdc-supply = <&vcc_io>;
+               sdcard-supply = <&vccio_sd>;
+               wifi-supply = <&vccio_wl>;
+       };
+
        ir: ir-receiver {
                compatible = "gpio-ir-receiver";
                pinctrl-names = "default";
                };
        };
 
-       vcc_sys: vsys-regulator {
+       vbat_wl: vcc_sys: vsys-regulator {
                compatible = "regulator-fixed";
                regulator-name = "vcc_sys";
                regulator-min-microvolt = <5000000>;
                regulator-always-on;
                vin-supply = <&vcc_5v>;
        };
+
+       /*
+        * A TT8142 creates both dovdd_1v8 and vcc28_dvp, controlled
+        * by the dvp_pwr pin.
+        */
+       vcc28_dvp: vcc28-dvp-regulator {
+               compatible = "regulator-fixed";
+               enable-active-high;
+               gpio = <&gpio0 11 GPIO_ACTIVE_HIGH>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&dvp_pwr>;
+               regulator-name = "vcc28_dvp";
+               regulator-min-microvolt = <2800000>;
+               regulator-max-microvolt = <2800000>;
+               regulator-always-on;
+               vin-supply = <&vcc_io>;
+       };
 };
 
 &cpu0 {
                                regulator-always-on;
                        };
 
-                       vcc_18: REG11 {
+                       vccio_wl: vcc_18: REG11 {
                                regulator-name = "vcc_18";
                                regulator-min-microvolt = <1800000>;
                                regulator-max-microvolt = <1800000>;
                };
        };
 
+       dvp {
+               dvp_pwr: dvp-pwr {
+                       rockchip,pins = <0 11 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+       };
+
        gmac {
                phy_int: phy-int {
                        rockchip,pins = <0 9 RK_FUNC_GPIO &pcfg_pull_up>;
        num-slots = <1>;
        pinctrl-names = "default";
        pinctrl-0 = <&sdio0_bus4>, <&sdio0_cmd>, <&sdio0_clk>;
-       vmmc-supply = <&vcc_18>;
+       vmmc-supply = <&vbat_wl>;
+       vqmmc-supply = <&vccio_wl>;
        status = "okay";
 };
 
        pinctrl-names = "default";
        pinctrl-0 = <&sdmmc_clk>, <&sdmmc_cmd>, <&sdmmc_cd>, <&sdmmc_bus4>;
        vmmc-supply = <&vcc_sd>;
+       vqmmc-supply = <&vccio_sd>;
        status = "okay";
 };
 
index f82b956ebf17f83e7747a6c4a419f19800e37be1..65c475642d5a79196925a50498a567aad75f72ef 100644 (file)
                };
        };
 
+       io_domains: io-domains {
+               compatible = "rockchip,rk3288-io-voltage-domain";
+               rockchip,grf = <&grf>;
+
+               audio-supply = <&vcca_33>;
+               bb-supply = <&vcc_io>;
+               dvp-supply = <&vcc18_dvp>;
+               flash0-supply = <&vcc_flash>;
+               flash1-supply = <&vcc_lan>;
+               gpio30-supply = <&vcc_io>;
+               gpio1830-supply = <&vcc_io>;
+               lcdc-supply = <&vcc_io>;
+               sdcard-supply = <&vccio_sd>;
+               wifi-supply = <&vccio_wl>;
+       };
+
        ir: ir-receiver {
                compatible = "gpio-ir-receiver";
                gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
                pinctrl-0 = <&ir_int>;
        };
 
+       vcc_flash: flash-regulator {
+               compatible = "regulator-fixed";
+               regulator-name = "vcc_flash";
+               regulator-min-microvolt = <1800000>;
+               regulator-max-microvolt = <1800000>;
+               vin-supply = <&vcc_io>;
+       };
+
+       vcc_sd: sdmmc-regulator {
+               compatible = "regulator-fixed";
+               gpio = <&gpio7 11 GPIO_ACTIVE_LOW>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&sdmmc_pwr>;
+               regulator-name = "vcc_sd";
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+               startup-delay-us = <100000>;
+               vin-supply = <&vcc_io>;
+       };
+
        vcc_sys: vsys-regulator {
                compatible = "regulator-fixed";
                regulator-name = "vcc_sys";
                regulator-always-on;
                regulator-boot-on;
        };
+
+       /*
+        * A PT5128 creates both dovdd_1v8 and vcc28_dvp, controlled
+        * by the dvp_pwr pin.
+        */
+       vcc18_dvp: vcc18-dvp-regulator {
+               compatible = "regulator-fixed";
+               regulator-name = "vcc18-dvp";
+               regulator-min-microvolt = <1800000>;
+               regulator-max-microvolt = <1800000>;
+               vin-supply = <&vcc28_dvp>;
+       };
+
+       vcc28_dvp: vcc28-dvp-regulator {
+               compatible = "regulator-fixed";
+               enable-active-high;
+               gpio = <&gpio0 17 GPIO_ACTIVE_HIGH>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&dvp_pwr>;
+               regulator-name = "vcc28_dvp";
+               regulator-min-microvolt = <2800000>;
+               regulator-max-microvolt = <2800000>;
+               regulator-always-on;
+               vin-supply = <&vcc_io>;
+       };
 };
 
 &cpu0 {
        num-slots = <1>;
        pinctrl-names = "default";
        pinctrl-0 = <&emmc_clk &emmc_cmd &emmc_pwr &emmc_bus8>;
+       vmmc-supply = <&vcc_io>;
+       vqmmc-supply = <&vcc_flash>;
        status = "okay";
 };
 
        num-slots = <1>;
        pinctrl-names = "default";
        pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
+       vmmc-supply = <&vcc_sd>;
+       vqmmc-supply = <&vccio_sd>;
        status = "okay";
 };
 
                                };
                        };
 
-                       vcca_codec: LDO_REG8 {
+                       vcca_33: LDO_REG8 {
                                regulator-always-on;
                                regulator-boot-on;
                                regulator-min-microvolt = <3300000>;
                                regulator-max-microvolt = <3300000>;
-                               regulator-name = "vcca_codec";
+                               regulator-name = "vcca_33";
                                regulator-state-mem {
                                        regulator-on-in-suspend;
                                        regulator-suspend-microvolt = <3300000>;
                                };
                        };
 
-                       vcc_wl: SWITCH_REG1 {
+                       vccio_wl: SWITCH_REG1 {
                                regulator-always-on;
                                regulator-boot-on;
-                               regulator-name = "vcc_wl";
+                               regulator-name = "vccio_wl";
                                regulator-state-mem {
                                        regulator-on-in-suspend;
                                };
                };
        };
 
+       dvp {
+               dvp_pwr: dvp-pwr {
+                       rockchip,pins = <0 17 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+       };
+
        ir {
                ir_int: ir-int {
                        rockchip,pins = <0 6 RK_FUNC_GPIO &pcfg_pull_up>;
                        rockchip,pins = <RK_GPIO0 4 RK_FUNC_GPIO &pcfg_pull_up>;
                };
        };
+
+       sdmmc {
+               sdmmc_pwr: sdmmc-pwr {
+                       rockchip,pins = <7 11 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+       };
 };
 
 &tsadc {
diff --git a/arch/arm/boot/dts/rk3288-rock2-som.dtsi b/arch/arm/boot/dts/rk3288-rock2-som.dtsi
new file mode 100644 (file)
index 0000000..1813b7c
--- /dev/null
@@ -0,0 +1,277 @@
+/*
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This file 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; either version 2 of the
+ *     License, or (at your option) any later version.
+ *
+ *     This file is distributed in the hope that it will be useful,
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ * Or, alternatively,
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use,
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#include <dt-bindings/pwm/pwm.h>
+#include "rk3288.dtsi"
+
+/ {
+       memory {
+               reg = <0x0 0x80000000>;
+               device_type = "memory";
+       };
+
+       emmc_pwrseq: emmc-pwrseq {
+               compatible = "mmc-pwrseq-emmc";
+               pinctrl-0 = <&emmc_reset>;
+               pinctrl-names = "default";
+               reset-gpios = <&gpio3 9 GPIO_ACTIVE_LOW>;
+       };
+
+       ext_gmac: external-gmac-clock {
+               compatible = "fixed-clock";
+               #clock-cells = <0>;
+               clock-frequency = <125000000>;
+               clock-output-names = "ext_gmac";
+       };
+
+       vcc_sys: vsys-regulator {
+               compatible = "regulator-fixed";
+               regulator-name = "vcc_sys";
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;
+               regulator-always-on;
+               regulator-boot-on;
+       };
+};
+
+&cpu0 {
+       cpu0-supply = <&vdd_cpu>;
+};
+
+&emmc {
+       bus-width = <8>;
+       cap-mmc-highspeed;
+       disable-wp;
+       non-removable;
+       num-slots = <1>;
+       mmc-pwrseq = <&emmc_pwrseq>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&emmc_clk &emmc_cmd &emmc_bus8>;
+       vmmc-supply = <&vcc_io>;
+       status = "okay";
+};
+
+&gmac {
+       assigned-clocks = <&cru SCLK_MAC>;
+       assigned-clock-parents = <&ext_gmac>;
+       clock_in_out = "input";
+       phy-mode = "rgmii";
+       phy-supply = <&vccio_pmu>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&rgmii_pins &phy_rst>;
+       snps,reset-gpio = <&gpio4 8 GPIO_ACTIVE_LOW>;
+       snps,reset-active-low;
+       snps,reset-delays-us = <0 10000 30000>;
+       rx_delay = <0x10>;
+       tx_delay = <0x30>;
+};
+
+&i2c0 {
+       status = "okay";
+
+       act8846: act8846@5a {
+               compatible = "active-semi,act8846";
+               reg = <0x5a>;
+               inl1-supply = <&vcc_io>;
+               inl2-supply = <&vcc_sys>;
+               inl3-supply = <&vcc_20>;
+               vp1-supply = <&vcc_sys>;
+               vp2-supply = <&vcc_sys>;
+               vp3-supply = <&vcc_sys>;
+               vp4-supply = <&vcc_sys>;
+
+               regulators {
+                       vcc_ddr: REG1 {
+                               regulator-name = "VCC_DDR";
+                               regulator-min-microvolt = <1200000>;
+                               regulator-max-microvolt = <1200000>;
+                               regulator-always-on;
+                       };
+
+                       vcc_io: REG2 {
+                               regulator-name = "VCC_IO";
+                               regulator-min-microvolt = <3300000>;
+                               regulator-max-microvolt = <3300000>;
+                               regulator-always-on;
+                       };
+
+                       vdd_log: REG3 {
+                               regulator-name = "VDD_LOG";
+                               regulator-min-microvolt = <1000000>;
+                               regulator-max-microvolt = <1000000>;
+                               regulator-always-on;
+                       };
+
+                       vcc_20: REG4 {
+                               regulator-name = "VCC_20";
+                               regulator-min-microvolt = <2000000>;
+                               regulator-max-microvolt = <2000000>;
+                               regulator-always-on;
+                       };
+
+                       vccio_sd: REG5 {
+                               regulator-name = "VCCIO_SD";
+                               regulator-min-microvolt = <3300000>;
+                               regulator-max-microvolt = <3300000>;
+                               regulator-always-on;
+                       };
+
+                       vdd10_lcd: REG6 {
+                               regulator-name = "VDD10_LCD";
+                               regulator-min-microvolt = <1000000>;
+                               regulator-max-microvolt = <1000000>;
+                               regulator-always-on;
+                       };
+
+                       vcca_codec: REG7 {
+                               regulator-name = "VCCA_CODEC";
+                               regulator-min-microvolt = <3300000>;
+                               regulator-max-microvolt = <3300000>;
+                               regulator-always-on;
+                       };
+
+                       vcca_tp: REG8 {
+                               regulator-name = "VCCA_TP";
+                               regulator-min-microvolt = <3300000>;
+                               regulator-max-microvolt = <3300000>;
+                               regulator-always-on;
+                       };
+
+                       vccio_pmu: REG9 {
+                               regulator-name = "VCCIO_PMU";
+                               regulator-min-microvolt = <3300000>;
+                               regulator-max-microvolt = <3300000>;
+                               regulator-always-on;
+                       };
+
+                       vdd_10: REG10 {
+                               regulator-name = "VDD_10";
+                               regulator-min-microvolt = <1000000>;
+                               regulator-max-microvolt = <1000000>;
+                               regulator-always-on;
+                       };
+
+                       vcc_18: REG11 {
+                               regulator-name = "VCC_18";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-always-on;
+                       };
+
+                       vcc18_lcd: REG12 {
+                               regulator-name = "VCC18_LCD";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-always-on;
+                       };
+               };
+       };
+
+       vdd_cpu: syr827@40 {
+               compatible = "silergy,syr827";
+               reg = <0x40>;
+               fcs,suspend-voltage-selector = <1>;
+               regulator-always-on;
+               regulator-boot-on;
+               regulator-enable-ramp-delay = <300>;
+               regulator-name = "vdd_cpu";
+               regulator-min-microvolt = <850000>;
+               regulator-max-microvolt = <1350000>;
+               regulator-ramp-delay = <8000>;
+               vin-supply = <&vcc_sys>;
+       };
+
+       vdd_gpu: syr828@41 {
+               compatible = "silergy,syr828";
+               reg = <0x41>;
+               fcs,suspend-voltage-selector = <1>;
+               regulator-always-on;
+               regulator-enable-ramp-delay = <300>;
+               regulator-min-microvolt = <850000>;
+               regulator-max-microvolt = <1350000>;
+               regulator-name = "vdd_gpu";
+               regulator-ramp-delay = <8000>;
+               vin-supply = <&vcc_sys>;
+       };
+};
+
+&pinctrl {
+       pcfg_output_high: pcfg-output-high {
+               output-high;
+       };
+
+       emmc {
+                       emmc_reset: emmc-reset {
+                               rockchip,pins = <3 9 RK_FUNC_GPIO &pcfg_pull_none>;
+                       };
+       };
+
+       gmac {
+               phy_rst: phy-rst {
+                       rockchip,pins = <4 8 RK_FUNC_GPIO  &pcfg_output_high>;
+               };
+       };
+};
+
+&tsadc {
+       rockchip,hw-tshut-mode = <0>; /* tshut mode 0:CRU 1:GPIO */
+       rockchip,hw-tshut-polarity = <0>; /* tshut polarity 0:LOW 1:HIGH */
+       status = "okay";
+};
+
+&vopb {
+       status = "okay";
+};
+
+&vopb_mmu {
+       status = "okay";
+};
+
+&vopl {
+       status = "okay";
+};
+
+&vopl_mmu {
+       status = "okay";
+};
+
+&wdt {
+       status = "okay";
+};
diff --git a/arch/arm/boot/dts/rk3288-rock2-square.dts b/arch/arm/boot/dts/rk3288-rock2-square.dts
new file mode 100644 (file)
index 0000000..8af35c8
--- /dev/null
@@ -0,0 +1,167 @@
+/*
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This file 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; either version 2 of the
+ *     License, or (at your option) any later version.
+ *
+ *     This file is distributed in the hope that it will be useful,
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ * Or, alternatively,
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use,
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/dts-v1/;
+#include "rk3288-rock2-som.dtsi"
+
+/ {
+       model = "Radxa Rock 2 Square";
+       compatible = "radxa,rock2-square", "rockchip,rk3288";
+
+       chosen {
+               stdout-path = "serial2:115200n8";
+       };
+
+       sound {
+               compatible = "simple-audio-card";
+               simple-audio-card,name = "SPDIF";
+               simple-audio-card,dai-link@1 {  /* S/PDIF - S/PDIF */
+                       cpu { sound-dai = <&spdif>; };
+                       codec { sound-dai = <&spdif_out>; };
+               };
+       };
+
+       spdif_out: spdif-out {
+               compatible = "linux,spdif-dit";
+               #sound-dai-cells = <0>;
+       };
+
+       vcc_usb_host: vcc-host-regulator {
+               compatible = "regulator-fixed";
+               enable-active-high;
+               gpio = <&gpio0 14 GPIO_ACTIVE_HIGH>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&host_vbus_drv>;
+               /* Always on as the rockchip usb phy doesn't have a vbus-supply
+                * property
+                */
+               regulator-always-on;
+               regulator-name = "vcc_host";
+       };
+
+       vcc_sd: sdmmc-regulator {
+               compatible = "regulator-fixed";
+               gpio = <&gpio7 11 GPIO_ACTIVE_LOW>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&sdmmc_pwr>;
+               regulator-name = "vcc_sd";
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+               vin-supply = <&vcc_io>;
+       };
+};
+
+&sdmmc {
+       bus-width = <4>;
+       cap-mmc-highspeed;
+       cap-sd-highspeed;
+       card-detect-delay = <200>;
+       disable-wp;     /* wp not hooked up */
+       num-slots = <1>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
+       vmmc-supply = <&vcc_sd>;
+       vqmmc-supply = <&vccio_sd>;
+       status = "okay";
+};
+
+&gmac {
+       status = "ok";
+};
+
+&hdmi {
+       ddc-i2c-bus = <&i2c5>;
+       status = "okay";
+};
+
+&i2c0 {
+       hym8563@51 {
+               compatible = "haoyu,hym8563";
+               reg = <0x51>;
+               #clock-cells = <0>;
+               clock-frequency = <32768>;
+               clock-output-names = "xin32k";
+               interrupt-parent = <&gpio0>;
+               interrupts = <4 IRQ_TYPE_EDGE_FALLING>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&pmic_int>;
+
+       };
+};
+
+&i2c5 {
+       status = "okay";
+};
+
+&pinctrl {
+       pmic {
+               pmic_int: pmic-int {
+                       rockchip,pins = <0 4 RK_FUNC_GPIO &pcfg_pull_up>;
+               };
+       };
+
+       usb {
+               host_vbus_drv: host-vbus-drv {
+                       rockchip,pins = <0 14 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+       };
+
+       sdmmc {
+               sdmmc_pwr: sdmmc-pwr {
+                       rockchip,pins = <7 11 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+       };
+};
+
+&spdif {
+       status = "okay";
+};
+
+&uart2 {
+       status = "okay";
+};
+
+&usbphy {
+       status = "okay";
+};
+
+&usb_host0_ehci {
+       status = "okay";
+};
diff --git a/arch/arm/boot/dts/rk3288-veyron-jaq.dts b/arch/arm/boot/dts/rk3288-veyron-jaq.dts
new file mode 100644 (file)
index 0000000..c2f52cf
--- /dev/null
@@ -0,0 +1,176 @@
+/*
+ * Google Veyron Jaq Rev 1+ board device tree source
+ *
+ * Copyright 2015 Google, Inc
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This file 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; either version 2 of the
+ *     License, or (at your option) any later version.
+ *
+ *     This file is distributed in the hope that it will be useful,
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ *  Or, alternatively,
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use,
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/dts-v1/;
+
+#include "rk3288-veyron-chromebook.dtsi"
+#include "cros-ec-sbs.dtsi"
+
+/ {
+       model = "Google Jaq";
+       compatible = "google,veyron-jaq-rev5", "google,veyron-jaq-rev4",
+                    "google,veyron-jaq-rev3", "google,veyron-jaq-rev2",
+                    "google,veyron-jaq-rev1", "google,veyron-jaq",
+                    "google,veyron", "rockchip,rk3288";
+
+       panel_regulator: panel-regulator {
+               compatible = "regulator-fixed";
+               enable-active-high;
+               gpio = <&gpio7 14 GPIO_ACTIVE_HIGH>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&lcd_enable_h>;
+               regulator-name = "panel_regulator";
+               vin-supply = <&vcc33_sys>;
+       };
+
+       vcc18_lcd: vcc18-lcd {
+               compatible = "regulator-fixed";
+               enable-active-high;
+               gpio = <&gpio2 13 GPIO_ACTIVE_HIGH>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&avdd_1v8_disp_en>;
+               regulator-name = "vcc18_lcd";
+               regulator-always-on;
+               regulator-boot-on;
+               vin-supply = <&vcc18_wl>;
+       };
+
+       backlight_regulator: backlight-regulator {
+               compatible = "regulator-fixed";
+               enable-active-high;
+               gpio = <&gpio2 12 GPIO_ACTIVE_HIGH>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&bl_pwr_en>;
+               regulator-name = "backlight_regulator";
+               vin-supply = <&vcc33_sys>;
+               startup-delay-us = <15000>;
+       };
+};
+
+&rk808 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pmic_int_l &dvs_1 &dvs_2>;
+       dvs-gpios = <&gpio7 12 GPIO_ACTIVE_HIGH>,
+                   <&gpio7 15 GPIO_ACTIVE_HIGH>;
+
+       regulators {
+               mic_vcc: LDO_REG2 {
+                       regulator-name = "mic_vcc";
+                       regulator-always-on;
+                       regulator-boot-on;
+                       regulator-min-microvolt = <1800000>;
+                       regulator-max-microvolt = <1800000>;
+                       regulator-state-mem {
+                               regulator-off-in-suspend;
+                       };
+               };
+       };
+};
+
+&sdmmc {
+       disable-wp;
+       pinctrl-names = "default";
+       pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd_disabled &sdmmc_cd_gpio
+                       &sdmmc_bus4>;
+};
+
+&vcc_5v {
+       enable-active-high;
+       gpio = <&gpio7 21 GPIO_ACTIVE_HIGH>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&drv_5v>;
+};
+
+&vcc50_hdmi {
+       enable-active-high;
+       gpio = <&gpio5 19 GPIO_ACTIVE_HIGH>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&vcc50_hdmi_en>;
+};
+
+&pinctrl {
+       backlight {
+               bl_pwr_en: bl_pwr_en {
+                       rockchip,pins = <2 12 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+       };
+
+       buck-5v {
+               drv_5v: drv-5v {
+                       rockchip,pins = <7 21 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+       };
+
+       edp {
+               edp_hpd: edp_hpd {
+                       rockchip,pins = <7 11 RK_FUNC_2 &pcfg_pull_down>;
+               };
+       };
+
+       hdmi {
+               vcc50_hdmi_en: vcc50-hdmi-en {
+                       rockchip,pins = <5 19 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+       };
+
+       lcd {
+               lcd_enable_h: lcd-en {
+                       rockchip,pins = <7 14 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+
+               avdd_1v8_disp_en: avdd-1v8-disp-en {
+                       rockchip,pins = <2 13 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+       };
+
+       pmic {
+               dvs_1: dvs-1 {
+                       rockchip,pins = <7 12 RK_FUNC_GPIO &pcfg_pull_down>;
+               };
+
+               dvs_2: dvs-2 {
+                       rockchip,pins = <7 15 RK_FUNC_GPIO &pcfg_pull_down>;
+               };
+       };
+};
index 860cea0a7613166d64bfc5924a14af5a1dab8aeb..5e61f07724d42a5e6c40e41d8f5f72029feec3de 100644 (file)
                };
        };
 
-       /*
-        * On Marvell-based hardware this is a no-connect.  Make sure we enable
-        * the pullup so that the line doesn't float.  The pullup shouldn't
-        * hurt on Broadcom-based hardware since the other side is actively
-        * driving this signal.  As proof: we've already got a pullup on RX.
-        */
-       uart0 {
-               uart0_cts: uart0-cts {
-                       rockchip,pins = <4 18 RK_FUNC_1 &pcfg_pull_up>;
-               };
-       };
-
        write-protect {
                fw_wp_ap: fw-wp-ap {
                        rockchip,pins = <7 6 RK_FUNC_GPIO &pcfg_pull_none>;
index 4e7c6b7392afdb70974078c80154b10a052fb024..6a79c9c526b8809d9ea201d087d680851653e990 100644 (file)
@@ -44,6 +44,7 @@
 #include <dt-bindings/pinctrl/rockchip.h>
 #include <dt-bindings/clock/rk3288-cru.h>
 #include <dt-bindings/thermal/thermal.h>
+#include <dt-bindings/power/rk3288-power.h>
 #include "skeleton.dtsi"
 
 / {
        };
 
        pmu: power-management@ff730000 {
-               compatible = "rockchip,rk3288-pmu", "syscon";
+               compatible = "rockchip,rk3288-pmu", "syscon", "simple-mfd";
                reg = <0xff730000 0x100>;
+
+               power: power-controller {
+                       compatible = "rockchip,rk3288-power-controller";
+                       #power-domain-cells = <1>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       /*
+                        * Note: Although SCLK_* are the working clocks
+                        * of device without including on the NOC, needed for
+                        * synchronous reset.
+                        *
+                        * The clocks on the which NOC:
+                        * ACLK_IEP/ACLK_VIP/ACLK_VOP0 are on ACLK_VIO0_NIU.
+                        * ACLK_ISP/ACLK_VOP1 are on ACLK_VIO1_NIU.
+                        * ACLK_RGA is on ACLK_RGA_NIU.
+                        * The others (HCLK_*,PLCK_*) are on HCLK_VIO_NIU.
+                        *
+                        * Which clock are device clocks:
+                        *      clocks          devices
+                        *      *_IEP           IEP:Image Enhancement Processor
+                        *      *_ISP           ISP:Image Signal Processing
+                        *      *_VIP           VIP:Video Input Processor
+                        *      *_VOP*          VOP:Visual Output Processor
+                        *      *_RGA           RGA
+                        *      *_EDP*          EDP
+                        *      *_LVDS_*        LVDS
+                        *      *_HDMI          HDMI
+                        *      *_MIPI_*        MIPI
+                        */
+                       pd_vio {
+                               reg = <RK3288_PD_VIO>;
+                               clocks = <&cru ACLK_IEP>,
+                                        <&cru ACLK_ISP>,
+                                        <&cru ACLK_RGA>,
+                                        <&cru ACLK_VIP>,
+                                        <&cru ACLK_VOP0>,
+                                        <&cru ACLK_VOP1>,
+                                        <&cru DCLK_VOP0>,
+                                        <&cru DCLK_VOP1>,
+                                        <&cru HCLK_IEP>,
+                                        <&cru HCLK_ISP>,
+                                        <&cru HCLK_RGA>,
+                                        <&cru HCLK_VIP>,
+                                        <&cru HCLK_VOP0>,
+                                        <&cru HCLK_VOP1>,
+                                        <&cru PCLK_EDP_CTRL>,
+                                        <&cru PCLK_HDMI_CTRL>,
+                                        <&cru PCLK_LVDS_PHY>,
+                                        <&cru PCLK_MIPI_CSI>,
+                                        <&cru PCLK_MIPI_DSI0>,
+                                        <&cru PCLK_MIPI_DSI1>,
+                                        <&cru SCLK_EDP_24M>,
+                                        <&cru SCLK_EDP>,
+                                        <&cru SCLK_ISP_JPE>,
+                                        <&cru SCLK_ISP>,
+                                        <&cru SCLK_RGA>;
+                       };
+
+                       /*
+                        * Note: The following 3 are HEVC(H.265) clocks,
+                        * and on the ACLK_HEVC_NIU (NOC).
+                        */
+                       pd_hevc {
+                               reg = <RK3288_PD_HEVC>;
+                               clocks = <&cru ACLK_HEVC>,
+                                        <&cru SCLK_HEVC_CABAC>,
+                                        <&cru SCLK_HEVC_CORE>;
+                       };
+
+                       /*
+                        * Note: ACLK_VCODEC/HCLK_VCODEC are VCODEC
+                        * (video endecoder & decoder) clocks that on the
+                        * ACLK_VCODEC_NIU and HCLK_VCODEC_NIU (NOC).
+                        */
+                       pd_video {
+                               reg = <RK3288_PD_VIDEO>;
+                               clocks = <&cru ACLK_VCODEC>,
+                                        <&cru HCLK_VCODEC>;
+                       };
+
+                       /*
+                        * Note: ACLK_GPU is the GPU clock,
+                        * and on the ACLK_GPU_NIU (NOC).
+                        */
+                       pd_gpu {
+                               reg = <RK3288_PD_GPU>;
+                               clocks = <&cru ACLK_GPU>;
+                       };
+               };
        };
 
        sgrf: syscon@ff740000 {
                status = "disabled";
        };
 
+       spdif: sound@ff88b0000 {
+               compatible = "rockchip,rk3288-spdif", "rockchip,rk3066-spdif";
+               reg = <0xff8b0000 0x10000>;
+               #sound-dai-cells = <0>;
+               clock-names = "hclk", "mclk";
+               clocks = <&cru HCLK_SPDIF8CH>, <&cru SCLK_SPDIF8CH>;
+               dmas = <&dmac_bus_s 3>;
+               dma-names = "tx";
+               interrupts = <GIC_SPI 85 IRQ_TYPE_LEVEL_HIGH>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&spdif_tx>;
+               rockchip,grf = <&grf>;
+               status = "disabled";
+       };
+
        i2s: i2s@ff890000 {
                compatible = "rockchip,rk3288-i2s", "rockchip,rk3066-i2s";
                reg = <0xff890000 0x10000>;
                interrupts = <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>;
                clocks = <&cru ACLK_VOP0>, <&cru DCLK_VOP0>, <&cru HCLK_VOP0>;
                clock-names = "aclk_vop", "dclk_vop", "hclk_vop";
+               power-domains = <&power RK3288_PD_VIO>;
                resets = <&cru SRST_LCDC0_AXI>, <&cru SRST_LCDC0_AHB>, <&cru SRST_LCDC0_DCLK>;
                reset-names = "axi", "ahb", "dclk";
                iommus = <&vopb_mmu>;
                reg = <0xff930300 0x100>;
                interrupts = <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>;
                interrupt-names = "vopb_mmu";
+               power-domains = <&power RK3288_PD_VIO>;
                #iommu-cells = <0>;
                status = "disabled";
        };
                interrupts = <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>;
                clocks = <&cru ACLK_VOP1>, <&cru DCLK_VOP1>, <&cru HCLK_VOP1>;
                clock-names = "aclk_vop", "dclk_vop", "hclk_vop";
+               power-domains = <&power RK3288_PD_VIO>;
                resets = <&cru SRST_LCDC1_AXI>, <&cru SRST_LCDC1_AHB>, <&cru SRST_LCDC1_DCLK>;
                reset-names = "axi", "ahb", "dclk";
                iommus = <&vopl_mmu>;
                reg = <0xff940300 0x100>;
                interrupts = <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>;
                interrupt-names = "vopl_mmu";
+               power-domains = <&power RK3288_PD_VIO>;
                #iommu-cells = <0>;
                status = "disabled";
        };
                interrupts = <GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>;
                clocks = <&cru  PCLK_HDMI_CTRL>, <&cru SCLK_HDMI_HDCP>;
                clock-names = "iahb", "isfr";
+               power-domains = <&power RK3288_PD_VIO>;
                status = "disabled";
 
                ports {
                        #interrupt-cells = <2>;
                };
 
+               hdmi {
+                       hdmi_ddc: hdmi-ddc {
+                               rockchip,pins = <7 19 RK_FUNC_2 &pcfg_pull_none>,
+                                               <7 20 RK_FUNC_2 &pcfg_pull_none>;
+                       };
+               };
+
                pcfg_pull_up: pcfg-pull-up {
                        bias-pull-up;
                };
                        };
 
                        uart0_cts: uart0-cts {
-                               rockchip,pins = <4 18 RK_FUNC_1 &pcfg_pull_none>;
+                               rockchip,pins = <4 18 RK_FUNC_1 &pcfg_pull_up>;
                        };
 
                        uart0_rts: uart0-rts {
                        };
 
                        uart1_cts: uart1-cts {
-                               rockchip,pins = <5 10 RK_FUNC_1 &pcfg_pull_none>;
+                               rockchip,pins = <5 10 RK_FUNC_1 &pcfg_pull_up>;
                        };
 
                        uart1_rts: uart1-rts {
                        };
 
                        uart3_cts: uart3-cts {
-                               rockchip,pins = <7 9 RK_FUNC_1 &pcfg_pull_none>;
+                               rockchip,pins = <7 9 RK_FUNC_1 &pcfg_pull_up>;
                        };
 
                        uart3_rts: uart3-rts {
                        };
 
                        uart4_cts: uart4-cts {
-                               rockchip,pins = <5 14 3 &pcfg_pull_none>;
+                               rockchip,pins = <5 14 3 &pcfg_pull_up>;
                        };
 
                        uart4_rts: uart4-rts {
                                                <4 3 3 &pcfg_pull_none>;
                        };
                };
+
+               spdif {
+                       spdif_tx: spdif-tx {
+                               rockchip,pins = <RK_GPIO6 11 RK_FUNC_1 &pcfg_pull_none>;
+                       };
+               };
        };
 };
index a5184ff56933c8812eb87f48d5a9b87ba743b4d2..80f0075503246336adf448cee3c3398959fbe3dd 100644 (file)
@@ -25,7 +25,7 @@
                #size-cells = <0>;
 
                cpu {
-                       compatible = "arm,arm926ejs";
+                       compatible = "arm,arm926ej-s";
                };
        };
 
index f00cea7aca2fa60aae25723189c5158a8d24b880..aa64faa72970113a887c22836f9ddb5da5aa6e68 100644 (file)
@@ -46,7 +46,7 @@
                        regulator-name = "V_TF_2.8V";
                        regulator-min-microvolt = <2800000>;
                        regulator-max-microvolt = <2800000>;
-                       gpios = <&mp05 4 0>;
+                       gpio = <&mp05 4 0>;
                        enable-active-high;
                };
 
index a3d4643b202e7552ed780370a2455ffbb51b990a..3b76eeeb8410a66a31ff33018df38e2ba2ce990e 100644 (file)
@@ -47,7 +47,7 @@
                        regulator-min-microvolt = <2800000>;
                        regulator-max-microvolt = <2800000>;
                        reg = <0>;
-                       gpios = <&mp05 4 0>;
+                       gpio = <&mp05 4 0>;
                        enable-active-high;
                };
 
@@ -73,7 +73,7 @@
                        regulator-min-microvolt = <2800000>;
                        regulator-max-microvolt = <2800000>;
                        reg = <3>;
-                       gpios = <&gpj1 3 0>;
+                       gpio = <&gpj1 3 0>;
                        enable-active-high;
                };
        };
diff --git a/arch/arm/boot/dts/sama5d2-pinfunc.h b/arch/arm/boot/dts/sama5d2-pinfunc.h
new file mode 100644 (file)
index 0000000..1afe246
--- /dev/null
@@ -0,0 +1,880 @@
+#define PINMUX_PIN(no, func, ioset) \
+(((no) & 0xffff) | (((func) & 0xf) << 16) | (((ioset) & 0xff) << 20))
+
+#define PIN_PA0                                0
+#define PIN_PA0__GPIO                  PINMUX_PIN(PIN_PA0, 0, 0)
+#define PIN_PA0__SDMMC0_CK             PINMUX_PIN(PIN_PA0, 1, 1)
+#define PIN_PA0__QSPI0_SCK             PINMUX_PIN(PIN_PA0, 2, 1)
+#define PIN_PA0__D0                    PINMUX_PIN(PIN_PA0, 6, 2)
+#define PIN_PA1                                1
+#define PIN_PA1__GPIO                  PINMUX_PIN(PIN_PA1, 0, 0)
+#define PIN_PA1__SDMMC0_CMD            PINMUX_PIN(PIN_PA1, 1, 1)
+#define PIN_PA1__QSPI0_CS              PINMUX_PIN(PIN_PA1, 2, 1)
+#define PIN_PA1__D1                    PINMUX_PIN(PIN_PA1, 6, 2)
+#define PIN_PA2                                2
+#define PIN_PA2__GPIO                  PINMUX_PIN(PIN_PA2, 0, 0)
+#define PIN_PA2__SDMMC0_DAT0           PINMUX_PIN(PIN_PA2, 1, 1)
+#define PIN_PA2__QSPI0_IO0             PINMUX_PIN(PIN_PA2, 2, 1)
+#define PIN_PA2__D2                    PINMUX_PIN(PIN_PA2, 6, 2)
+#define PIN_PA3                                3
+#define PIN_PA3__GPIO                  PINMUX_PIN(PIN_PA3, 0, 0)
+#define PIN_PA3__SDMMC0_DAT1           PINMUX_PIN(PIN_PA3, 1, 1)
+#define PIN_PA3__QSPI0_IO1             PINMUX_PIN(PIN_PA3, 2, 1)
+#define PIN_PA3__D3                    PINMUX_PIN(PIN_PA3, 6, 2)
+#define PIN_PA4                                4
+#define PIN_PA4__GPIO                  PINMUX_PIN(PIN_PA4, 0, 0)
+#define PIN_PA4__SDMMC0_DAT2           PINMUX_PIN(PIN_PA4, 1, 1)
+#define PIN_PA4__QSPI0_IO2             PINMUX_PIN(PIN_PA4, 2, 1)
+#define PIN_PA4__D4                    PINMUX_PIN(PIN_PA4, 6, 2)
+#define PIN_PA5                                5
+#define PIN_PA5__GPIO                  PINMUX_PIN(PIN_PA5, 0, 0)
+#define PIN_PA5__SDMMC0_DAT3           PINMUX_PIN(PIN_PA5, 1, 1)
+#define PIN_PA5__QSPI0_IO3             PINMUX_PIN(PIN_PA5, 2, 1)
+#define PIN_PA5__D5                    PINMUX_PIN(PIN_PA5, 6, 2)
+#define PIN_PA6                                6
+#define PIN_PA6__GPIO                  PINMUX_PIN(PIN_PA6, 0, 0)
+#define PIN_PA6__SDMMC0_DAT4           PINMUX_PIN(PIN_PA6, 1, 1)
+#define PIN_PA6__QSPI1_SCK             PINMUX_PIN(PIN_PA6, 2, 1)
+#define PIN_PA6__TIOA5                 PINMUX_PIN(PIN_PA6, 4, 1)
+#define PIN_PA6__FLEXCOM2_IO0          PINMUX_PIN(PIN_PA6, 5, 1)
+#define PIN_PA6__D6                    PINMUX_PIN(PIN_PA6, 6, 2)
+#define PIN_PA7                                7
+#define PIN_PA7__GPIO                  PINMUX_PIN(PIN_PA7, 0, 0)
+#define PIN_PA7__SDMMC0_DAT5           PINMUX_PIN(PIN_PA7, 1, 1)
+#define PIN_PA7__QSPI1_IO0             PINMUX_PIN(PIN_PA7, 2, 1)
+#define PIN_PA7__TIOB5                 PINMUX_PIN(PIN_PA7, 4, 1)
+#define PIN_PA7__FLEXCOM2_IO1          PINMUX_PIN(PIN_PA7, 5, 1)
+#define PIN_PA7__D7                    PINMUX_PIN(PIN_PA7, 6, 2)
+#define PIN_PA8                                8
+#define PIN_PA8__GPIO                  PINMUX_PIN(PIN_PA8, 0, 0)
+#define PIN_PA8__SDMMC0_DAT6           PINMUX_PIN(PIN_PA8, 1, 1)
+#define PIN_PA8__QSPI1_IO1             PINMUX_PIN(PIN_PA8, 2, 1)
+#define PIN_PA8__TCLK5                 PINMUX_PIN(PIN_PA8, 4, 1)
+#define PIN_PA8__FLEXCOM2_IO2          PINMUX_PIN(PIN_PA8, 5, 1)
+#define PIN_PA8__NWE_NANDWE            PINMUX_PIN(PIN_PA8, 6, 2)
+#define PIN_PA9                                9
+#define PIN_PA9__GPIO                  PINMUX_PIN(PIN_PA9, 0, 0)
+#define PIN_PA9__SDMMC0_DAT7           PINMUX_PIN(PIN_PA9, 1, 1)
+#define PIN_PA9__QSPI1_IO2             PINMUX_PIN(PIN_PA9, 2, 1)
+#define PIN_PA9__TIOA4                 PINMUX_PIN(PIN_PA9, 4, 1)
+#define PIN_PA9__FLEXCOM2_IO3          PINMUX_PIN(PIN_PA9, 5, 1)
+#define PIN_PA9__NCS3                  PINMUX_PIN(PIN_PA9, 6, 2)
+#define PIN_PA10                       10
+#define PIN_PA10__GPIO                 PINMUX_PIN(PIN_PA10, 0, 0)
+#define PIN_PA10__SDMMC0_RSTN          PINMUX_PIN(PIN_PA10, 1, 1)
+#define PIN_PA10__QSPI1_IO3            PINMUX_PIN(PIN_PA10, 2, 1)
+#define PIN_PA10__TIOB4                        PINMUX_PIN(PIN_PA10, 4, 1)
+#define PIN_PA10__FLEXCOM2_IO4         PINMUX_PIN(PIN_PA10, 5, 1)
+#define PIN_PA10__A21_NANDALE          PINMUX_PIN(PIN_PA10, 6, 2)
+#define PIN_PA11                       11
+#define PIN_PA11__GPIO                 PINMUX_PIN(PIN_PA11, 0, 0)
+#define PIN_PA11__SDMMC0_VDDSEL                PINMUX_PIN(PIN_PA11, 1, 1)
+#define PIN_PA11__QSPI1_CS             PINMUX_PIN(PIN_PA11, 2, 1)
+#define PIN_PA11__TCLK4                        PINMUX_PIN(PIN_PA11, 4, 1)
+#define PIN_PA11__A22_NANDCLE          PINMUX_PIN(PIN_PA11, 6, 2)
+#define PIN_PA12                       12
+#define PIN_PA12__GPIO                 PINMUX_PIN(PIN_PA12, 0, 0)
+#define PIN_PA12__SDMMC0_WP            PINMUX_PIN(PIN_PA12, 1, 1)
+#define PIN_PA12__IRQ                  PINMUX_PIN(PIN_PA12, 2, 1)
+#define PIN_PA12__NRD_NANDOE           PINMUX_PIN(PIN_PA12, 6, 2)
+#define PIN_PA13                       13
+#define PIN_PA13__GPIO                 PINMUX_PIN(PIN_PA13, 0, 0)
+#define PIN_PA13__SDMMC0_CD            PINMUX_PIN(PIN_PA13, 1, 1)
+#define PIN_PA13__FLEXCOM3_IO1         PINMUX_PIN(PIN_PA13, 5, 1)
+#define PIN_PA13__D8                   PINMUX_PIN(PIN_PA13, 6, 2)
+#define PIN_PA14                       14
+#define PIN_PA14__GPIO                 PINMUX_PIN(PIN_PA14, 0, 0)
+#define PIN_PA14__SPI0_SPCK            PINMUX_PIN(PIN_PA14, 1, 1)
+#define PIN_PA14__TK1                  PINMUX_PIN(PIN_PA14, 2, 1)
+#define PIN_PA14__QSPI0_SCK            PINMUX_PIN(PIN_PA14, 3, 2)
+#define PIN_PA14__I2SC1_MCK            PINMUX_PIN(PIN_PA14, 4, 2)
+#define PIN_PA14__FLEXCOM3_IO2         PINMUX_PIN(PIN_PA14, 5, 1)
+#define PIN_PA14__D9                   PINMUX_PIN(PIN_PA14, 6, 2)
+#define PIN_PA15                       14
+#define PIN_PA15__GPIO                 PINMUX_PIN(PIN_PA15, 0, 0)
+#define PIN_PA15__SPI0_MOSI            PINMUX_PIN(PIN_PA15, 1, 1)
+#define PIN_PA15__TF1                  PINMUX_PIN(PIN_PA15, 2, 1)
+#define PIN_PA15__QSPI0_CS             PINMUX_PIN(PIN_PA15, 3, 2)
+#define PIN_PA15__I2SC1_CK             PINMUX_PIN(PIN_PA15, 4, 2)
+#define PIN_PA15__FLEXCOM3_IO0         PINMUX_PIN(PIN_PA15, 5, 1)
+#define PIN_PA15__D10                  PINMUX_PIN(PIN_PA15, 6, 2)
+#define PIN_PA16                       16
+#define PIN_PA16__GPIO                 PINMUX_PIN(PIN_PA16, 0, 0)
+#define PIN_PA16__SPI0_MISO            PINMUX_PIN(PIN_PA16, 1, 1)
+#define PIN_PA16__TD1                  PINMUX_PIN(PIN_PA16, 2, 1)
+#define PIN_PA16__QSPI0_IO0            PINMUX_PIN(PIN_PA16, 3, 2)
+#define PIN_PA16__I2SC1_WS             PINMUX_PIN(PIN_PA16, 4, 2)
+#define PIN_PA16__FLEXCOM3_IO3         PINMUX_PIN(PIN_PA16, 5, 1)
+#define PIN_PA16__D11                  PINMUX_PIN(PIN_PA16, 6, 2)
+#define PIN_PA17                       17
+#define PIN_PA17__GPIO                 PINMUX_PIN(PIN_PA17, 0, 0)
+#define PIN_PA17__SPI0_NPCS0           PINMUX_PIN(PIN_PA17, 1, 1)
+#define PIN_PA17__RD1                  PINMUX_PIN(PIN_PA17, 2, 1)
+#define PIN_PA17__QSPI0_IO1            PINMUX_PIN(PIN_PA17, 3, 2)
+#define PIN_PA17__I2SC1_DI0            PINMUX_PIN(PIN_PA17, 4, 2)
+#define PIN_PA17__FLEXCOM3_IO4         PINMUX_PIN(PIN_PA17, 5, 1)
+#define PIN_PA17__D12                  PINMUX_PIN(PIN_PA17, 6, 2)
+#define PIN_PA18                       18
+#define PIN_PA18__GPIO                 PINMUX_PIN(PIN_PA18, 0, 0)
+#define PIN_PA18__SPI0_NPCS1           PINMUX_PIN(PIN_PA18, 1, 1)
+#define PIN_PA18__RK1                  PINMUX_PIN(PIN_PA18, 2, 1)
+#define PIN_PA18__QSPI0_IO2            PINMUX_PIN(PIN_PA18, 3, 2)
+#define PIN_PA18__I2SC1_DO0            PINMUX_PIN(PIN_PA18, 4, 2)
+#define PIN_PA18__SDMMC1_DAT0          PINMUX_PIN(PIN_PA18, 5, 1)
+#define PIN_PA18__D13                  PINMUX_PIN(PIN_PA18, 6, 2)
+#define PIN_PA19                       19
+#define PIN_PA19__GPIO                 PINMUX_PIN(PIN_PA19, 0, 0)
+#define PIN_PA19__SPI0_NPCS2           PINMUX_PIN(PIN_PA19, 1, 1)
+#define PIN_PA19__RF1                  PINMUX_PIN(PIN_PA19, 2, 1)
+#define PIN_PA19__QSPI0_IO3            PINMUX_PIN(PIN_PA19, 3, 2)
+#define PIN_PA19__TIOA0                        PINMUX_PIN(PIN_PA19, 4, 1)
+#define PIN_PA19__SDMMC1_DAT1          PINMUX_PIN(PIN_PA19, 5, 1)
+#define PIN_PA19__D14                  PINMUX_PIN(PIN_PA19, 6, 2)
+#define PIN_PA20                       20
+#define PIN_PA20__GPIO                 PINMUX_PIN(PIN_PA20, 0, 0)
+#define PIN_PA20__SPI0_NPCS3           PINMUX_PIN(PIN_PA20, 1, 1)
+#define PIN_PA20__TIOB0                        PINMUX_PIN(PIN_PA20, 4, 1)
+#define PIN_PA20__SDMMC1_DAT2          PINMUX_PIN(PIN_PA20, 5, 1)
+#define PIN_PA20__D15                  PINMUX_PIN(PIN_PA20, 6, 2)
+#define PIN_PA21                       21
+#define PIN_PA21__GPIO                 PINMUX_PIN(PIN_PA21, 0, 0)
+#define PIN_PA21__IRQ                  PINMUX_PIN(PIN_PA21, 1, 2)
+#define PIN_PA21__PCK2                 PINMUX_PIN(PIN_PA21, 2, 3)
+#define PIN_PA21__TCLK0                        PINMUX_PIN(PIN_PA21, 4, 1)
+#define PIN_PA21__SDMMC1_DAT3          PINMUX_PIN(PIN_PA21, 5, 1)
+#define PIN_PA21__NANDRDY              PINMUX_PIN(PIN_PA21, 6, 2)
+#define PIN_PA22                       22
+#define PIN_PA22__GPIO                 PINMUX_PIN(PIN_PA22, 0, 0)
+#define PIN_PA22__FLEXCOM1_IO2         PINMUX_PIN(PIN_PA22, 1, 1)
+#define PIN_PA22__D0                   PINMUX_PIN(PIN_PA22, 2, 1)
+#define PIN_PA22__TCK                  PINMUX_PIN(PIN_PA22, 3, 4)
+#define PIN_PA22__SPI1_SPCK            PINMUX_PIN(PIN_PA22, 4, 2)
+#define PIN_PA22__SDMMC1_CK            PINMUX_PIN(PIN_PA22, 5, 1)
+#define PIN_PA22__QSPI0_SCK            PINMUX_PIN(PIN_PA22, 6, 3)
+#define PIN_PA23                       23
+#define PIN_PA23__GPIO                 PINMUX_PIN(PIN_PA23, 0, 0)
+#define PIN_PA23__FLEXCOM1_IO1         PINMUX_PIN(PIN_PA23, 1, 1)
+#define PIN_PA23__D1                   PINMUX_PIN(PIN_PA23, 2, 1)
+#define PIN_PA23__TDI                  PINMUX_PIN(PIN_PA23, 3, 4)
+#define PIN_PA23__SPI1_MOSI            PINMUX_PIN(PIN_PA23, 4, 2)
+#define PIN_PA23__QSPI0_CS             PINMUX_PIN(PIN_PA23, 6, 3)
+#define PIN_PA24                       24
+#define PIN_PA24__GPIO                 PINMUX_PIN(PIN_PA24, 0, 0)
+#define PIN_PA24__FLEXCOM1_IO0         PINMUX_PIN(PIN_PA24, 1, 1)
+#define PIN_PA24__D2                   PINMUX_PIN(PIN_PA24, 2, 1)
+#define PIN_PA24__TDO                  PINMUX_PIN(PIN_PA24, 3, 4)
+#define PIN_PA24__SPI1_MISO            PINMUX_PIN(PIN_PA24, 4, 2)
+#define PIN_PA24__QSPI0_IO0            PINMUX_PIN(PIN_PA24, 6, 3)
+#define PIN_PA25                       25
+#define PIN_PA25__GPIO                 PINMUX_PIN(PIN_PA25, 0, 0)
+#define PIN_PA25__FLEXCOM1_IO3         PINMUX_PIN(PIN_PA25, 1, 1)
+#define PIN_PA25__D3                   PINMUX_PIN(PIN_PA25, 2, 1)
+#define PIN_PA25__TMS                  PINMUX_PIN(PIN_PA25, 3, 4)
+#define PIN_PA25__SPI1_NPCS0           PINMUX_PIN(PIN_PA25, 4, 2)
+#define PIN_PA25__QSPI0_IO1            PINMUX_PIN(PIN_PA25, 6, 3)
+#define PIN_PA26                       26
+#define PIN_PA26__GPIO                 PINMUX_PIN(PIN_PA26, 0, 0)
+#define PIN_PA26__FLEXCOM1_IO4         PINMUX_PIN(PIN_PA26, 1, 1)
+#define PIN_PA26__D4                   PINMUX_PIN(PIN_PA26, 2, 1)
+#define PIN_PA26__NTRST                        PINMUX_PIN(PIN_PA26, 3, 4)
+#define PIN_PA26__SPI1_NPCS1           PINMUX_PIN(PIN_PA26, 4, 2)
+#define PIN_PA26__QSPI0_IO2            PINMUX_PIN(PIN_PA26, 6, 3)
+#define PIN_PA27                       27
+#define PIN_PA27__GPIO                 PINMUX_PIN(PIN_PA27, 0, 0)
+#define PIN_PA27__TIOA1                        PINMUX_PIN(PIN_PA27, 1, 2)
+#define PIN_PA27__D5                   PINMUX_PIN(PIN_PA27, 2, 1)
+#define PIN_PA27__SPI0_NPCS2           PINMUX_PIN(PIN_PA27, 3, 2)
+#define PIN_PA27__SPI1_NPCS2           PINMUX_PIN(PIN_PA27, 4, 2)
+#define PIN_PA27__SDMMC1_RSTN          PINMUX_PIN(PIN_PA27, 5, 1)
+#define PIN_PA27__QSPI0_IO3            PINMUX_PIN(PIN_PA27, 6, 3)
+#define PIN_PA28                       28
+#define PIN_PA28__GPIO                 PINMUX_PIN(PIN_PA28, 0, 0)
+#define PIN_PA28__TIOB1                        PINMUX_PIN(PIN_PA28, 1, 2)
+#define PIN_PA28__D6                   PINMUX_PIN(PIN_PA28, 2, 1)
+#define PIN_PA28__SPI0_NPCS3           PINMUX_PIN(PIN_PA28, 3, 2)
+#define PIN_PA28__SPI1_NPCS3           PINMUX_PIN(PIN_PA28, 4, 2)
+#define PIN_PA28__SDMMC1_CMD           PINMUX_PIN(PIN_PA28, 5, 1)
+#define PIN_PA28__CLASSD_L0            PINMUX_PIN(PIN_PA28, 6, 1)
+#define PIN_PA29                       29
+#define PIN_PA29__GPIO                 PINMUX_PIN(PIN_PA29, 0, 0)
+#define PIN_PA29__TCLK1                        PINMUX_PIN(PIN_PA29, 1, 2)
+#define PIN_PA29__D7                   PINMUX_PIN(PIN_PA29, 2, 1)
+#define PIN_PA29__SPI0_NPCS1           PINMUX_PIN(PIN_PA29, 3, 2)
+#define PIN_PA29__SDMMC1_WP            PINMUX_PIN(PIN_PA29, 5, 1)
+#define PIN_PA29__CLASSD_L1            PINMUX_PIN(PIN_PA29, 6, 1)
+#define PIN_PA30                       30
+#define PIN_PA30__GPIO                 PINMUX_PIN(PIN_PA30, 0, 0)
+#define PIN_PA30__NWE_NANDWE           PINMUX_PIN(PIN_PA30, 2, 1)
+#define PIN_PA30__SPI0_NPCS0           PINMUX_PIN(PIN_PA30, 3, 2)
+#define PIN_PA30__PWMH0                        PINMUX_PIN(PIN_PA30, 4, 1)
+#define PIN_PA30__SDMMC1_CD            PINMUX_PIN(PIN_PA30, 5, 1)
+#define PIN_PA30__CLASSD_L2            PINMUX_PIN(PIN_PA30, 6, 1)
+#define PIN_PA31                       31
+#define PIN_PA31__GPIO                 PINMUX_PIN(PIN_PA31, 0, 0)
+#define PIN_PA31__NCS3                 PINMUX_PIN(PIN_PA31, 2, 1)
+#define PIN_PA31__SPI0_MISO            PINMUX_PIN(PIN_PA31, 3, 2)
+#define PIN_PA31__PWML0                        PINMUX_PIN(PIN_PA31, 4, 1)
+#define PIN_PA31__CLASSD_L3            PINMUX_PIN(PIN_PA31, 6, 1)
+#define PIN_PB0                                32
+#define PIN_PB0__GPIO                  PINMUX_PIN(PIN_PB0, 0, 0)
+#define PIN_PB0__A21_NANDALE           PINMUX_PIN(PIN_PB0, 2, 1)
+#define PIN_PB0__SPI0_MOSI             PINMUX_PIN(PIN_PB0, 3, 2)
+#define PIN_PB0__PWMH1                 PINMUX_PIN(PIN_PB0, 4, 1)
+#define PIN_PB1                                33
+#define PIN_PB1__GPIO                  PINMUX_PIN(PIN_PB1, 0, 0)
+#define PIN_PB1__A22_NANDCLE           PINMUX_PIN(PIN_PB1, 2, 1)
+#define PIN_PB1__SPI0_SPCK             PINMUX_PIN(PIN_PB1, 3, 2)
+#define PIN_PB1__PWML1                 PINMUX_PIN(PIN_PB1, 4, 1)
+#define PIN_PB1__CLASSD_R0             PINMUX_PIN(PIN_PB1, 6, 1)
+#define PIN_PB2                                34
+#define PIN_PB2__GPIO                  PINMUX_PIN(PIN_PB2, 0, 0)
+#define PIN_PB2__NRD_NANDOE            PINMUX_PIN(PIN_PB2, 2, 1)
+#define PIN_PB2__PWMFI0                        PINMUX_PIN(PIN_PB2, 4, 1)
+#define PIN_PB2__CLASSD_R1             PINMUX_PIN(PIN_PB2, 6, 1)
+#define PIN_PB3                                35
+#define PIN_PB3__GPIO                  PINMUX_PIN(PIN_PB3, 0, 0)
+#define PIN_PB3__URXD4                 PINMUX_PIN(PIN_PB3, 1, 1)
+#define PIN_PB3__D8                    PINMUX_PIN(PIN_PB3, 2, 1)
+#define PIN_PB3__IRQ                   PINMUX_PIN(PIN_PB3, 3, 3)
+#define PIN_PB3__PWMEXTRG0             PINMUX_PIN(PIN_PB3, 4, 1)
+#define PIN_PB3__CLASSD_R2             PINMUX_PIN(PIN_PB3, 6, 1)
+#define PIN_PB4                                36
+#define PIN_PB4__GPIO                  PINMUX_PIN(PIN_PB4, 0, 0)
+#define PIN_PB4__UTXD4                 PINMUX_PIN(PIN_PB4, 1, 1)
+#define PIN_PB4__D9                    PINMUX_PIN(PIN_PB4, 2, 1)
+#define PIN_PB4__FIQ                   PINMUX_PIN(PIN_PB4, 3, 4)
+#define PIN_PB4__CLASSD_R3             PINMUX_PIN(PIN_PB4, 6, 1)
+#define PIN_PB5                                37
+#define PIN_PB5__GPIO                  PINMUX_PIN(PIN_PB5, 0, 0)
+#define PIN_PB5__TCLK2                 PINMUX_PIN(PIN_PB5, 1, 1)
+#define PIN_PB5__D10                   PINMUX_PIN(PIN_PB5, 2, 1)
+#define PIN_PB5__PWMH2                 PINMUX_PIN(PIN_PB5, 3, 1)
+#define PIN_PB5__QSPI1_SCK             PINMUX_PIN(PIN_PB5, 4, 2)
+#define PIN_PB5__GTSUCOMP              PINMUX_PIN(PIN_PB5, 6, 3)
+#define PIN_PB6                                38
+#define PIN_PB6__GPIO                  PINMUX_PIN(PIN_PB6, 0, 0)
+#define PIN_PB6__TIOA2                 PINMUX_PIN(PIN_PB6, 1, 1)
+#define PIN_PB6__D11                   PINMUX_PIN(PIN_PB6, 2, 1)
+#define PIN_PB6__PWML2                 PINMUX_PIN(PIN_PB6, 3, 1)
+#define PIN_PB6__QSPI1_CS              PINMUX_PIN(PIN_PB6, 4, 2)
+#define PIN_PB6__GTXER                 PINMUX_PIN(PIN_PB6, 6, 3)
+#define PIN_PB7                                39
+#define PIN_PB7__GPIO                  PINMUX_PIN(PIN_PB7, 0, 0)
+#define PIN_PB7__TIOB2                 PINMUX_PIN(PIN_PB7, 1, 1)
+#define PIN_PB7__D12                   PINMUX_PIN(PIN_PB7, 2, 1)
+#define PIN_PB7__PWMH3                 PINMUX_PIN(PIN_PB7, 3, 1)
+#define PIN_PB7__QSPI1_IO0             PINMUX_PIN(PIN_PB7, 4, 2)
+#define PIN_PB7__GRXCK                 PINMUX_PIN(PIN_PB7, 6, 3)
+#define PIN_PB8                                40
+#define PIN_PB8__GPIO                  PINMUX_PIN(PIN_PB8, 0, 0)
+#define PIN_PB8__TCLK3                 PINMUX_PIN(PIN_PB8, 1, 1)
+#define PIN_PB8__D13                   PINMUX_PIN(PIN_PB8, 2, 1)
+#define PIN_PB8__PWML3                 PINMUX_PIN(PIN_PB8, 3, 1)
+#define PIN_PB8__QSPI1_IO1             PINMUX_PIN(PIN_PB8, 4, 2)
+#define PIN_PB8__GCRS                  PINMUX_PIN(PIN_PB8, 6, 3)
+#define PIN_PB9                                41
+#define PIN_PB9__GPIO                  PINMUX_PIN(PIN_PB9, 0, 0)
+#define PIN_PB9__TIOA3                 PINMUX_PIN(PIN_PB9, 1, 1)
+#define PIN_PB9__D14                   PINMUX_PIN(PIN_PB9, 2, 1)
+#define PIN_PB9__PWMFI1                        PINMUX_PIN(PIN_PB9, 3, 1)
+#define PIN_PB9__QSPI1_IO2             PINMUX_PIN(PIN_PB9, 4, 2)
+#define PIN_PB9__GCOL                  PINMUX_PIN(PIN_PB9, 6, 3)
+#define PIN_PB10                       42
+#define PIN_PB10__GPIO                 PINMUX_PIN(PIN_PB10, 0, 0)
+#define PIN_PB10__TIOB3                        PINMUX_PIN(PIN_PB10, 1, 1)
+#define PIN_PB10__D15                  PINMUX_PIN(PIN_PB10, 2, 1)
+#define PIN_PB10__PWMEXTRG1            PINMUX_PIN(PIN_PB10, 3, 1)
+#define PIN_PB10__QSPI1_IO3            PINMUX_PIN(PIN_PB10, 4, 2)
+#define PIN_PB10__GRX2                 PINMUX_PIN(PIN_PB10, 6, 3)
+#define PIN_PB11                       43
+#define PIN_PB11__GPIO                 PINMUX_PIN(PIN_PB11, 0, 0)
+#define PIN_PB11__LCDDAT0              PINMUX_PIN(PIN_PB11, 1, 1)
+#define PIN_PB11__A0_NBS0              PINMUX_PIN(PIN_PB11, 2, 1)
+#define PIN_PB11__URXD3                        PINMUX_PIN(PIN_PB11, 3, 3)
+#define PIN_PB11__PDMIC_DAT            PINMUX_PIN(PIN_PB11, 4, 2)
+#define PIN_PB11__GRX3                 PINMUX_PIN(PIN_PB11, 6, 3)
+#define PIN_PB12                       44
+#define PIN_PB12__GPIO                 PINMUX_PIN(PIN_PB12, 0, 0)
+#define PIN_PB12__LCDDAT1              PINMUX_PIN(PIN_PB12, 1, 1)
+#define PIN_PB12__A1                   PINMUX_PIN(PIN_PB12, 2, 1)
+#define PIN_PB12__UTXD3                        PINMUX_PIN(PIN_PB12, 3, 3)
+#define PIN_PB12__PDMIC_CLK            PINMUX_PIN(PIN_PB12, 4, 2)
+#define PIN_PB12__GTX2                 PINMUX_PIN(PIN_PB12, 6, 3)
+#define PIN_PB13                       45
+#define PIN_PB13__GPIO                 PINMUX_PIN(PIN_PB13, 0, 0)
+#define PIN_PB13__LCDDAT2              PINMUX_PIN(PIN_PB13, 1, 1)
+#define PIN_PB13__A2                   PINMUX_PIN(PIN_PB13, 2, 1)
+#define PIN_PB13__PCK1                 PINMUX_PIN(PIN_PB13, 3, 3)
+#define PIN_PB13__GTX3                 PINMUX_PIN(PIN_PB13, 6, 3)
+#define PIN_PB14                       46
+#define PIN_PB14__GPIO                 PINMUX_PIN(PIN_PB14, 0, 0)
+#define PIN_PB14__LCDDAT3              PINMUX_PIN(PIN_PB14, 1, 1)
+#define PIN_PB14__A3                   PINMUX_PIN(PIN_PB14, 2, 1)
+#define PIN_PB14__TK1                  PINMUX_PIN(PIN_PB14, 3, 2)
+#define PIN_PB14__I2SC1_MCK            PINMUX_PIN(PIN_PB14, 4, 1)
+#define PIN_PB14__QSPI1_SCK            PINMUX_PIN(PIN_PB14, 5, 3)
+#define PIN_PB14__GTXCK                        PINMUX_PIN(PIN_PB14, 6, 3)
+#define PIN_PB15                       47
+#define PIN_PB15__GPIO                 PINMUX_PIN(PIN_PB15, 0, 0)
+#define PIN_PB15__LCDDAT4              PINMUX_PIN(PIN_PB15, 1, 1)
+#define PIN_PB15__A4                   PINMUX_PIN(PIN_PB15, 2, 1)
+#define PIN_PB15__TF1                  PINMUX_PIN(PIN_PB15, 3, 2)
+#define PIN_PB15__I2SC1_CK             PINMUX_PIN(PIN_PB15, 4, 1)
+#define PIN_PB15__QSPI1_CS             PINMUX_PIN(PIN_PB15, 5, 3)
+#define PIN_PB15__GTXEN                        PINMUX_PIN(PIN_PB15, 6, 3)
+#define PIN_PB16                       48
+#define PIN_PB16__GPIO                 PINMUX_PIN(PIN_PB16, 0, 0)
+#define PIN_PB16__LCDDAT5              PINMUX_PIN(PIN_PB16, 1, 1)
+#define PIN_PB16__A5                   PINMUX_PIN(PIN_PB16, 2, 1)
+#define PIN_PB16__TD1                  PINMUX_PIN(PIN_PB16, 3, 2)
+#define PIN_PB16__I2SC1_WS             PINMUX_PIN(PIN_PB16, 4, 1)
+#define PIN_PB16__QSPI1_IO0            PINMUX_PIN(PIN_PB16, 5, 3)
+#define PIN_PB16__GRXDV                        PINMUX_PIN(PIN_PB16, 6, 3)
+#define PIN_PB17                       49
+#define PIN_PB17__GPIO                 PINMUX_PIN(PIN_PB17, 0, 0)
+#define PIN_PB17__LCDDAT6              PINMUX_PIN(PIN_PB17, 1, 1)
+#define PIN_PB17__A6                   PINMUX_PIN(PIN_PB17, 2, 1)
+#define PIN_PB17__RD1                  PINMUX_PIN(PIN_PB17, 3, 2)
+#define PIN_PB17__I2SC1_DI0            PINMUX_PIN(PIN_PB17, 4, 1)
+#define PIN_PB17__QSPI1_IO1            PINMUX_PIN(PIN_PB17, 5, 3)
+#define PIN_PB17__GRXER                        PINMUX_PIN(PIN_PB17, 6, 3)
+#define PIN_PB18                       50
+#define PIN_PB18__GPIO                 PINMUX_PIN(PIN_PB18, 0, 0)
+#define PIN_PB18__LCDDAT7              PINMUX_PIN(PIN_PB18, 1, 1)
+#define PIN_PB18__A7                   PINMUX_PIN(PIN_PB18, 2, 1)
+#define PIN_PB18__RK1                  PINMUX_PIN(PIN_PB18, 3, 2)
+#define PIN_PB18__I2SC1_DO0            PINMUX_PIN(PIN_PB18, 4, 1)
+#define PIN_PB18__QSPI1_IO2            PINMUX_PIN(PIN_PB18, 5, 3)
+#define PIN_PB18__GRX0                 PINMUX_PIN(PIN_PB18, 6, 3)
+#define PIN_PB19                       51
+#define PIN_PB19__GPIO                 PINMUX_PIN(PIN_PB19, 0, 0)
+#define PIN_PB19__LCDDAT8              PINMUX_PIN(PIN_PB19, 1, 1)
+#define PIN_PB19__A8                   PINMUX_PIN(PIN_PB19, 2, 1)
+#define PIN_PB19__RF1                  PINMUX_PIN(PIN_PB19, 3, 2)
+#define PIN_PB19__TIOA3                        PINMUX_PIN(PIN_PB19, 4, 2)
+#define PIN_PB19__QSPI1_IO3            PINMUX_PIN(PIN_PB19, 5, 3)
+#define PIN_PB19__GRX1                 PINMUX_PIN(PIN_PB19, 6, 3)
+#define PIN_PB20                       52
+#define PIN_PB20__GPIO                 PINMUX_PIN(PIN_PB20, 0, 0)
+#define PIN_PB20__LCDDAT9              PINMUX_PIN(PIN_PB20, 1, 1)
+#define PIN_PB20__A9                   PINMUX_PIN(PIN_PB20, 2, 1)
+#define PIN_PB20__TK0                  PINMUX_PIN(PIN_PB20, 3, 1)
+#define PIN_PB20__TIOB3                        PINMUX_PIN(PIN_PB20, 4, 2)
+#define PIN_PB20__PCK1                 PINMUX_PIN(PIN_PB20, 5, 4)
+#define PIN_PB20__GTX0                 PINMUX_PIN(PIN_PB20, 6, 3)
+#define PIN_PB21                       53
+#define PIN_PB21__GPIO                 PINMUX_PIN(PIN_PB21, 0, 0)
+#define PIN_PB21__LCDDAT10             PINMUX_PIN(PIN_PB21, 1, 1)
+#define PIN_PB21__A10                  PINMUX_PIN(PIN_PB21, 2, 1)
+#define PIN_PB21__TF0                  PINMUX_PIN(PIN_PB21, 3, 1)
+#define PIN_PB21__TCLK3                        PINMUX_PIN(PIN_PB21, 4, 2)
+#define PIN_PB21__FLEXCOM3_IO2         PINMUX_PIN(PIN_PB21, 5, 3)
+#define PIN_PB21__GTX1                 PINMUX_PIN(PIN_PB21, 6, 3)
+#define PIN_PB22                       54
+#define PIN_PB22__GPIO                 PINMUX_PIN(PIN_PB22, 0, 0)
+#define PIN_PB22__LCDDAT11             PINMUX_PIN(PIN_PB22, 1, 1)
+#define PIN_PB22__A11                  PINMUX_PIN(PIN_PB22, 2, 1)
+#define PIN_PB22__TDO                  PINMUX_PIN(PIN_PB22, 3, 1)
+#define PIN_PB22__TIOA2                        PINMUX_PIN(PIN_PB22, 4, 2)
+#define PIN_PB22__FLEXCOM3_IO1         PINMUX_PIN(PIN_PB22, 5, 3)
+#define PIN_PB22__GMDC                 PINMUX_PIN(PIN_PB22, 6, 3)
+#define PIN_PB23                       55
+#define PIN_PB23__GPIO                 PINMUX_PIN(PIN_PB23, 0, 0)
+#define PIN_PB23__LCDDAT12             PINMUX_PIN(PIN_PB23, 1, 1)
+#define PIN_PB23__A12                  PINMUX_PIN(PIN_PB23, 2, 1)
+#define PIN_PB23__RD0                  PINMUX_PIN(PIN_PB23, 3, 1)
+#define PIN_PB23__TIOB2                        PINMUX_PIN(PIN_PB23, 4, 2)
+#define PIN_PB23__FLEXCOM3_IO0         PINMUX_PIN(PIN_PB23, 5, 3)
+#define PIN_PB23__GMDIO                        PINMUX_PIN(PIN_PB23, 6, 3)
+#define PIN_PB24                       56
+#define PIN_PB24__GPIO                 PINMUX_PIN(PIN_PB24, 0, 0)
+#define PIN_PB24__LCDDAT13             PINMUX_PIN(PIN_PB24, 1, 1)
+#define PIN_PB24__A13                  PINMUX_PIN(PIN_PB24, 2, 1)
+#define PIN_PB24__RK0                  PINMUX_PIN(PIN_PB24, 3, 1)
+#define PIN_PB24__TCLK2                        PINMUX_PIN(PIN_PB24, 4, 2)
+#define PIN_PB24__FLEXCOM3_IO3         PINMUX_PIN(PIN_PB24, 5, 3)
+#define PIN_PB24__ISC_D10              PINMUX_PIN(PIN_PB24, 6, 3)
+#define PIN_PB25                       57
+#define PIN_PB25__GPIO                 PINMUX_PIN(PIN_PB25, 0, 0)
+#define PIN_PB25__LCDDAT14             PINMUX_PIN(PIN_PB25, 1, 1)
+#define PIN_PB25__A14                  PINMUX_PIN(PIN_PB25, 2, 1)
+#define PIN_PB25__RF0                  PINMUX_PIN(PIN_PB25, 3, 1)
+#define PIN_PB25__FLEXCOM3_IO4         PINMUX_PIN(PIN_PB25, 5, 3)
+#define PIN_PB25__ISC_D11              PINMUX_PIN(PIN_PB25, 6, 3)
+#define PIN_PB26                       58
+#define PIN_PB26__GPIO                 PINMUX_PIN(PIN_PB26, 0, 0)
+#define PIN_PB26__LCDDAT15             PINMUX_PIN(PIN_PB26, 1, 1)
+#define PIN_PB26__A15                  PINMUX_PIN(PIN_PB26, 2, 1)
+#define PIN_PB26__URXD0                        PINMUX_PIN(PIN_PB26, 3, 1)
+#define PIN_PB26__PDMIC_DAT            PINMUX_PIN(PIN_PB26, 4, 1)
+#define PIN_PB26__ISC_D0               PINMUX_PIN(PIN_PB26, 6, 3)
+#define PIN_PB27                       59
+#define PIN_PB27__GPIO                 PINMUX_PIN(PIN_PB27, 0, 0)
+#define PIN_PB27__LCDDAT16             PINMUX_PIN(PIN_PB27, 1, 1)
+#define PIN_PB27__A16                  PINMUX_PIN(PIN_PB27, 2, 1)
+#define PIN_PB27__UTXD0                        PINMUX_PIN(PIN_PB27, 3, 1)
+#define PIN_PB27__PDMIC_CLK            PINMUX_PIN(PIN_PB27, 4, 1)
+#define PIN_PB27__ISC_D1               PINMUX_PIN(PIN_PB27, 6, 3)
+#define PIN_PB28                       60
+#define PIN_PB28__GPIO                 PINMUX_PIN(PIN_PB28, 0, 0)
+#define PIN_PB28__LCDDAT17             PINMUX_PIN(PIN_PB28, 1, 1)
+#define PIN_PB28__A17                  PINMUX_PIN(PIN_PB28, 2, 1)
+#define PIN_PB28__FLEXCOM0_IO0         PINMUX_PIN(PIN_PB28, 3, 1)
+#define PIN_PB28__TIOA5                        PINMUX_PIN(PIN_PB28, 4, 2)
+#define PIN_PB28__ISC_D2               PINMUX_PIN(PIN_PB28, 6, 3)
+#define PIN_PB29                       61
+#define PIN_PB29__GPIO                 PINMUX_PIN(PIN_PB29, 0, 0)
+#define PIN_PB29__LCDDAT18             PINMUX_PIN(PIN_PB29, 1, 1)
+#define PIN_PB29__A18                  PINMUX_PIN(PIN_PB29, 2, 1)
+#define PIN_PB29__FLEXCOM0_IO1         PINMUX_PIN(PIN_PB29, 3, 1)
+#define PIN_PB29__TIOB5                        PINMUX_PIN(PIN_PB29, 4, 2)
+#define PIN_PB29__ISC_D3               PINMUX_PIN(PIN_PB29, 7, 3)
+#define PIN_PB30                       62
+#define PIN_PB30__GPIO                 PINMUX_PIN(PIN_PB30, 0, 0)
+#define PIN_PB30__LCDDAT19             PINMUX_PIN(PIN_PB30, 1, 1)
+#define PIN_PB30__A19                  PINMUX_PIN(PIN_PB30, 2, 1)
+#define PIN_PB30__FLEXCOM0_IO2         PINMUX_PIN(PIN_PB30, 3, 1)
+#define PIN_PB30__TCLK5                        PINMUX_PIN(PIN_PB30, 4, 2)
+#define PIN_PB30__ISC_D4               PINMUX_PIN(PIN_PB30, 6, 3)
+#define PIN_PB31                       63
+#define PIN_PB31__GPIO                 PINMUX_PIN(PIN_PB31, 0, 0)
+#define PIN_PB31__LCDDAT20             PINMUX_PIN(PIN_PB31, 1, 1)
+#define PIN_PB31__A20                  PINMUX_PIN(PIN_PB31, 2, 1)
+#define PIN_PB31__FLEXCOM0_IO3         PINMUX_PIN(PIN_PB31, 3, 1)
+#define PIN_PB31__TWD0                 PINMUX_PIN(PIN_PB31, 4, 1)
+#define PIN_PB31__ISC_D5               PINMUX_PIN(PIN_PB31, 6, 3)
+#define PIN_PC0                                64
+#define PIN_PC0__GPIO                  PINMUX_PIN(PIN_PC0, 0, 0)
+#define PIN_PC0__LCDDAT21              PINMUX_PIN(PIN_PC0, 1, 1)
+#define PIN_PC0__A23                   PINMUX_PIN(PIN_PC0, 2, 1)
+#define PIN_PC0__FLEXCOM0_IO4          PINMUX_PIN(PIN_PC0, 3, 1)
+#define PIN_PC0__TWCK0                 PINMUX_PIN(PIN_PC0, 4, 1)
+#define PIN_PC0__ISC_D6                        PINMUX_PIN(PIN_PC0, 6, 3)
+#define PIN_PC1                                65
+#define PIN_PC1__GPIO                  PINMUX_PIN(PIN_PC1, 0, 0)
+#define PIN_PC1__LCDDAT22              PINMUX_PIN(PIN_PC1, 1, 1)
+#define PIN_PC1__A24                   PINMUX_PIN(PIN_PC1, 2, 1)
+#define PIN_PC1__CANTX0                        PINMUX_PIN(PIN_PC1, 3, 1)
+#define PIN_PC1__SPI1_SPCK             PINMUX_PIN(PIN_PC1, 4, 1)
+#define PIN_PC1__I2SC0_CK              PINMUX_PIN(PIN_PC1, 5, 1)
+#define PIN_PC1__ISC_D7                        PINMUX_PIN(PIN_PC1, 6, 3)
+#define PIN_PC2                                66
+#define PIN_PC2__GPIO                  PINMUX_PIN(PIN_PC2, 0, 0)
+#define PIN_PC2__LCDDAT23              PINMUX_PIN(PIN_PC2, 1, 1)
+#define PIN_PC2__A25                   PINMUX_PIN(PIN_PC2, 2, 1)
+#define PIN_PC2__CANRX0                        PINMUX_PIN(PIN_PC2, 3, 1)
+#define PIN_PC2__SPI1_MOSI             PINMUX_PIN(PIN_PC2, 4, 1)
+#define PIN_PC2__I2SC0_MCK             PINMUX_PIN(PIN_PC2, 5, 1)
+#define PIN_PC2__ISC_D8                        PINMUX_PIN(PIN_PC2, 6, 3)
+#define PIN_PC3                                67
+#define PIN_PC3__GPIO                  PINMUX_PIN(PIN_PC3, 0, 0)
+#define PIN_PC3__LCDPWM                        PINMUX_PIN(PIN_PC3, 1, 1)
+#define PIN_PC3__NWAIT                 PINMUX_PIN(PIN_PC3, 2, 1)
+#define PIN_PC3__TIOA1                 PINMUX_PIN(PIN_PC3, 3, 1)
+#define PIN_PC3__SPI1_MISO             PINMUX_PIN(PIN_PC3, 4, 1)
+#define PIN_PC3__I2SC0_WS              PINMUX_PIN(PIN_PC3, 5, 1)
+#define PIN_PC3__ISC_D9                        PINMUX_PIN(PIN_PC3, 6, 3)
+#define PIN_PC4                                68
+#define PIN_PC4__GPIO                  PINMUX_PIN(PIN_PC4, 0, 0)
+#define PIN_PC4__LCDDISP               PINMUX_PIN(PIN_PC4, 1, 1)
+#define PIN_PC4__NWR1_NBS1             PINMUX_PIN(PIN_PC4, 2, 1)
+#define PIN_PC4__TIOB1                 PINMUX_PIN(PIN_PC4, 3, 1)
+#define PIN_PC4__SPI1_NPCS0            PINMUX_PIN(PIN_PC4, 4, 1)
+#define PIN_PC4__I2SC0_DI0             PINMUX_PIN(PIN_PC4, 5, 1)
+#define PIN_PC4__ISC_PCK               PINMUX_PIN(PIN_PC4, 6, 3)
+#define PIN_PC5                                69
+#define PIN_PC5__GPIO                  PINMUX_PIN(PIN_PC5, 0, 0)
+#define PIN_PC5__LCDVSYNC              PINMUX_PIN(PIN_PC5, 1, 1)
+#define PIN_PC5__NCS0                  PINMUX_PIN(PIN_PC5, 2, 1)
+#define PIN_PC5__TCLK1                 PINMUX_PIN(PIN_PC5, 3, 1)
+#define PIN_PC5__SPI1_NPCS1            PINMUX_PIN(PIN_PC5, 4, 1)
+#define PIN_PC5__I2SC0_DO0             PINMUX_PIN(PIN_PC5, 5, 1)
+#define PIN_PC5__ISC_VSYNC             PINMUX_PIN(PIN_PC5, 6, 3)
+#define PIN_PC6                                70
+#define PIN_PC6__GPIO                  PINMUX_PIN(PIN_PC6, 0, 0)
+#define PIN_PC6__LCDHSYNC              PINMUX_PIN(PIN_PC6, 1, 1)
+#define PIN_PC6__NCS1                  PINMUX_PIN(PIN_PC6, 2, 1)
+#define PIN_PC6__TWD1                  PINMUX_PIN(PIN_PC6, 3, 1)
+#define PIN_PC6__SPI1_NPCS2            PINMUX_PIN(PIN_PC6, 4, 1)
+#define PIN_PC6__ISC_HSYNC             PINMUX_PIN(PIN_PC6, 6, 3)
+#define PIN_PC7                                71
+#define PIN_PC7__GPIO                  PINMUX_PIN(PIN_PC7, 0, 0)
+#define PIN_PC7__LCDPCK                        PINMUX_PIN(PIN_PC7, 1, 1)
+#define PIN_PC7__NCS2                  PINMUX_PIN(PIN_PC7, 2, 1)
+#define PIN_PC7__TWCK1                 PINMUX_PIN(PIN_PC7, 3, 1)
+#define PIN_PC7__SPI1_NPCS3            PINMUX_PIN(PIN_PC7, 4, 1)
+#define PIN_PC7__URXD1                 PINMUX_PIN(PIN_PC7, 5, 2)
+#define PIN_PC7__ISC_MCK               PINMUX_PIN(PIN_PC7, 6, 3)
+#define PIN_PC8                                72
+#define PIN_PC8__GPIO                  PINMUX_PIN(PIN_PC8, 0, 0)
+#define PIN_PC8__LCDDEN                        PINMUX_PIN(PIN_PC8, 1, 1)
+#define PIN_PC8__NANDRDY               PINMUX_PIN(PIN_PC8, 2, 1)
+#define PIN_PC8__FIQ                   PINMUX_PIN(PIN_PC8, 3, 1)
+#define PIN_PC8__PCK0                  PINMUX_PIN(PIN_PC8, 4, 3)
+#define PIN_PC8__UTXD1                 PINMUX_PIN(PIN_PC8, 5, 2)
+#define PIN_PC8__ISC_FIELD             PINMUX_PIN(PIN_PC8, 6, 3)
+#define PIN_PC9                                73
+#define PIN_PC9__GPIO                  PINMUX_PIN(PIN_PC9, 0, 0)
+#define PIN_PC9__FIQ                   PINMUX_PIN(PIN_PC9, 1, 3)
+#define PIN_PC9__GTSUCOMP              PINMUX_PIN(PIN_PC9, 2, 1)
+#define PIN_PC9__ISC_D0                        PINMUX_PIN(PIN_PC9, 2, 1)
+#define PIN_PC9__TIOA4                 PINMUX_PIN(PIN_PC9, 4, 2)
+#define PIN_PC10                       74
+#define PIN_PC10__GPIO                 PINMUX_PIN(PIN_PC10, 0, 0)
+#define PIN_PC10__LCDDAT2              PINMUX_PIN(PIN_PC10, 1, 2)
+#define PIN_PC10__GTXCK                        PINMUX_PIN(PIN_PC10, 2, 1)
+#define PIN_PC10__ISC_D1               PINMUX_PIN(PIN_PC10, 3, 1)
+#define PIN_PC10__TIOB4                        PINMUX_PIN(PIN_PC10, 4, 2)
+#define PIN_PC10__CANTX0               PINMUX_PIN(PIN_PC10, 5, 2)
+#define PIN_PC11                       75
+#define PIN_PC11__GPIO                 PINMUX_PIN(PIN_PC11, 0, 0)
+#define PIN_PC11__LCDDAT3              PINMUX_PIN(PIN_PC11, 1, 2)
+#define PIN_PC11__GTXEN                        PINMUX_PIN(PIN_PC11, 2, 1)
+#define PIN_PC11__ISC_D2               PINMUX_PIN(PIN_PC11, 3, 1)
+#define PIN_PC11__TCLK4                        PINMUX_PIN(PIN_PC11, 4, 2)
+#define PIN_PC11__CANRX0               PINMUX_PIN(PIN_PC11, 5, 2)
+#define PIN_PC11__A0_NBS0              PINMUX_PIN(PIN_PC11, 6, 2)
+#define PIN_PC12                       76
+#define PIN_PC12__GPIO                 PINMUX_PIN(PIN_PC12, 0, 0)
+#define PIN_PC12__LCDDAT4              PINMUX_PIN(PIN_PC12, 1, 2)
+#define PIN_PC12__GRXDV                        PINMUX_PIN(PIN_PC12, 2, 1)
+#define PIN_PC12__ISC_D3               PINMUX_PIN(PIN_PC12, 3, 1)
+#define PIN_PC12__URXD3                        PINMUX_PIN(PIN_PC12, 4, 1)
+#define PIN_PC12__TK0                  PINMUX_PIN(PIN_PC12, 5, 2)
+#define PIN_PC12__A1                   PINMUX_PIN(PIN_PC12, 6, 2)
+#define PIN_PC13                       77
+#define PIN_PC13__GPIO                 PINMUX_PIN(PIN_PC13, 0, 0)
+#define PIN_PC13__LCDDAT5              PINMUX_PIN(PIN_PC13, 1, 2)
+#define PIN_PC13__GRXER                        PINMUX_PIN(PIN_PC13, 2, 1)
+#define PIN_PC13__ISC_D4               PINMUX_PIN(PIN_PC13, 3, 1)
+#define PIN_PC13__UTXD3                        PINMUX_PIN(PIN_PC13, 4, 1)
+#define PIN_PC13__TF0                  PINMUX_PIN(PIN_PC13, 5, 2)
+#define PIN_PC13__A2                   PINMUX_PIN(PIN_PC13, 6, 2)
+#define PIN_PC14                       78
+#define PIN_PC14__GPIO                 PINMUX_PIN(PIN_PC14, 0, 0)
+#define PIN_PC14__LCDDAT6              PINMUX_PIN(PIN_PC14, 1, 2)
+#define PIN_PC14__GRX0                 PINMUX_PIN(PIN_PC14, 2, 1)
+#define PIN_PC14__ISC_D5               PINMUX_PIN(PIN_PC14, 3, 1)
+#define PIN_PC14__TDO                  PINMUX_PIN(PIN_PC14, 5, 2)
+#define PIN_PC14__A3                   PINMUX_PIN(PIN_PC14, 6, 2)
+#define PIN_PC15                       79
+#define PIN_PC15__GPIO                 PINMUX_PIN(PIN_PC15, 0, 0)
+#define PIN_PC15__LCDDAT7              PINMUX_PIN(PIN_PC15, 1, 2)
+#define PIN_PC15__GRX1                 PINMUX_PIN(PIN_PC15, 2, 1)
+#define PIN_PC15__ISC_D6               PINMUX_PIN(PIN_PC15, 3, 1)
+#define PIN_PC15__RD0                  PINMUX_PIN(PIN_PC15, 5, 2)
+#define PIN_PC15__A4                   PINMUX_PIN(PIN_PC15, 6, 2)
+#define PIN_PC16                       80
+#define PIN_PC16__GPIO                 PINMUX_PIN(PIN_PC16, 0, 0)
+#define PIN_PC16__LCDDAT10             PINMUX_PIN(PIN_PC16, 1, 2)
+#define PIN_PC16__GTX0                 PINMUX_PIN(PIN_PC16, 2, 1)
+#define PIN_PC16__ISC_D7               PINMUX_PIN(PIN_PC16, 3, 1)
+#define PIN_PC16__RK0                  PINMUX_PIN(PIN_PC16, 5, 2)
+#define PIN_PC16__A5                   PINMUX_PIN(PIN_PC16, 6, 2)
+#define PIN_PC17                       81
+#define PIN_PC17__GPIO                 PINMUX_PIN(PIN_PC17, 0, 0)
+#define PIN_PC17__LCDDAT11             PINMUX_PIN(PIN_PC17, 1, 2)
+#define PIN_PC17__GTX1                 PINMUX_PIN(PIN_PC17, 2, 1)
+#define PIN_PC17__ISC_D8               PINMUX_PIN(PIN_PC17, 3, 1)
+#define PIN_PC17__RF0                  PINMUX_PIN(PIN_PC17, 5, 2)
+#define PIN_PC17__A6                   PINMUX_PIN(PIN_PC17, 6, 2)
+#define PIN_PC18                       82
+#define PIN_PC18__GPIO                 PINMUX_PIN(PIN_PC18, 0, 0)
+#define PIN_PC18__LCDDAT12             PINMUX_PIN(PIN_PC18, 1, 2)
+#define PIN_PC18__GMDC                 PINMUX_PIN(PIN_PC18, 2, 1)
+#define PIN_PC18__ISC_D9               PINMUX_PIN(PIN_PC18, 3, 1)
+#define PIN_PC18__FLEXCOM3_IO2         PINMUX_PIN(PIN_PC18, 5, 2)
+#define PIN_PC18__A7                   PINMUX_PIN(PIN_PC18, 6, 2)
+#define PIN_PC19                       83
+#define PIN_PC19__GPIO                 PINMUX_PIN(PIN_PC19, 0, 0)
+#define PIN_PC19__LCDDAT13             PINMUX_PIN(PIN_PC19, 1, 2)
+#define PIN_PC19__GMDIO                        PINMUX_PIN(PIN_PC19, 2, 1)
+#define PIN_PC19__ISC_D10              PINMUX_PIN(PIN_PC19, 3, 1)
+#define PIN_PC19__FLEXCOM3_IO1         PINMUX_PIN(PIN_PC19, 5, 2)
+#define PIN_PC19__A8                   PINMUX_PIN(PIN_PC19, 6, 2)
+#define PIN_PC20                       84
+#define PIN_PC20__GPIO                 PINMUX_PIN(PIN_PC20, 0, 0)
+#define PIN_PC20__LCDDAT14             PINMUX_PIN(PIN_PC20, 1, 2)
+#define PIN_PC20__GRXCK                        PINMUX_PIN(PIN_PC20, 2, 1)
+#define PIN_PC20__ISC_D11              PINMUX_PIN(PIN_PC20, 3, 1)
+#define PIN_PC20__FLEXCOM3_IO0         PINMUX_PIN(PIN_PC20, 5, 2)
+#define PIN_PC20__A9                   PINMUX_PIN(PIN_PC20, 6, 2)
+#define PIN_PC21                       85
+#define PIN_PC21__GPIO                 PINMUX_PIN(PIN_PC21, 0, 0)
+#define PIN_PC21__LCDDAT15             PINMUX_PIN(PIN_PC21, 1, 2)
+#define PIN_PC21__GTXER                        PINMUX_PIN(PIN_PC21, 2, 1)
+#define PIN_PC21__ISC_PCK              PINMUX_PIN(PIN_PC21, 3, 1)
+#define PIN_PC21__FLEXCOM3_IO3         PINMUX_PIN(PIN_PC21, 5, 2)
+#define PIN_PC21__A10                  PINMUX_PIN(PIN_PC21, 6, 2)
+#define PIN_PC22                       86
+#define PIN_PC22__GPIO                 PINMUX_PIN(PIN_PC22, 0, 0)
+#define PIN_PC22__LCDDAT18             PINMUX_PIN(PIN_PC22, 1, 2)
+#define PIN_PC22__GCRS                 PINMUX_PIN(PIN_PC22, 2, 1)
+#define PIN_PC22__ISC_VSYNC            PINMUX_PIN(PIN_PC22, 3, 1)
+#define PIN_PC22__FLEXCOM3_IO4         PINMUX_PIN(PIN_PC22, 5, 2)
+#define PIN_PC22__A11                  PINMUX_PIN(PIN_PC22, 6, 2)
+#define PIN_PC23                       87
+#define PIN_PC23__GPIO                 PINMUX_PIN(PIN_PC23, 0, 0)
+#define PIN_PC23__LCDDAT19             PINMUX_PIN(PIN_PC23, 1, 2)
+#define PIN_PC23__GCOL                 PINMUX_PIN(PIN_PC23, 2, 1)
+#define PIN_PC23__ISC_HSYNC            PINMUX_PIN(PIN_PC23, 3, 1)
+#define PIN_PC23__A12                  PINMUX_PIN(PIN_PC23, 6, 2)
+#define PIN_PC24                       88
+#define PIN_PC24__GPIO                 PINMUX_PIN(PIN_PC24, 0, 0)
+#define PIN_PC24__LCDDAT20             PINMUX_PIN(PIN_PC24, 1, 2)
+#define PIN_PC24__GRX2                 PINMUX_PIN(PIN_PC24, 2, 1)
+#define PIN_PC24__ISC_MCK              PINMUX_PIN(PIN_PC24, 3, 1)
+#define PIN_PC24__A13                  PINMUX_PIN(PIN_PC24, 6, 2)
+#define PIN_PC25                       89
+#define PIN_PC25__GPIO                 PINMUX_PIN(PIN_PC25, 0, 0)
+#define PIN_PC25__LCDDAT21             PINMUX_PIN(PIN_PC25, 1, 2)
+#define PIN_PC25__GRX3                 PINMUX_PIN(PIN_PC25, 2, 1)
+#define PIN_PC25__ISC_FIELD            PINMUX_PIN(PIN_PC25, 3, 1)
+#define PIN_PC25__A14                  PINMUX_PIN(PIN_PC25, 6, 2)
+#define PIN_PC26                       90
+#define PIN_PC26__GPIO                 PINMUX_PIN(PIN_PC26, 0, 0)
+#define PIN_PC26__LCDDAT22             PINMUX_PIN(PIN_PC26, 1, 2)
+#define PIN_PC26__GTX2                 PINMUX_PIN(PIN_PC26, 2, 1)
+#define PIN_PC26__CANTX1               PINMUX_PIN(PIN_PC26, 4, 1)
+#define PIN_PC26__A15                  PINMUX_PIN(PIN_PC26, 6, 2)
+#define PIN_PC27                       91
+#define PIN_PC27__GPIO                 PINMUX_PIN(PIN_PC27, 0, 0)
+#define PIN_PC27__LCDDAT23             PINMUX_PIN(PIN_PC27, 1, 2)
+#define PIN_PC27__GTX3                 PINMUX_PIN(PIN_PC27, 2, 1)
+#define PIN_PC27__PCK1                 PINMUX_PIN(PIN_PC27, 3, 2)
+#define PIN_PC27__CANRX1               PINMUX_PIN(PIN_PC27, 4, 1)
+#define PIN_PC27__TWD0                 PINMUX_PIN(PIN_PC27, 5, 2)
+#define PIN_PC27__A16                  PINMUX_PIN(PIN_PC27, 6, 2)
+#define PIN_PC28                       92
+#define PIN_PC28__GPIO                 PINMUX_PIN(PIN_PC28, 0, 0)
+#define PIN_PC28__LCDPWM               PINMUX_PIN(PIN_PC28, 1, 2)
+#define PIN_PC28__FLEXCOM4_IO0         PINMUX_PIN(PIN_PC28, 2, 1)
+#define PIN_PC28__PCK2                 PINMUX_PIN(PIN_PC28, 3, 2)
+#define PIN_PC28__TWCK0                        PINMUX_PIN(PIN_PC28, 5, 2)
+#define PIN_PC28__A17                  PINMUX_PIN(PIN_PC28, 6, 2)
+#define PIN_PC29                       93
+#define PIN_PC29__GPIO                 PINMUX_PIN(PIN_PC29, 0, 0)
+#define PIN_PC29__LCDDISP              PINMUX_PIN(PIN_PC29, 1, 2)
+#define PIN_PC29__FLEXCOM4_IO1         PINMUX_PIN(PIN_PC29, 2, 1)
+#define PIN_PC29__A18                  PINMUX_PIN(PIN_PC29, 6, 2)
+#define PIN_PC30                       94
+#define PIN_PC30__GPIO                 PINMUX_PIN(PIN_PC30, 0, 0)
+#define PIN_PC30__LCDVSYNC             PINMUX_PIN(PIN_PC30, 1, 2)
+#define PIN_PC30__FLEXCOM4_IO2         PINMUX_PIN(PIN_PC30, 2, 1)
+#define PIN_PC30__A19                  PINMUX_PIN(PIN_PC30, 6, 2)
+#define PIN_PC31                       95
+#define PIN_PC31__GPIO                 PINMUX_PIN(PIN_PC31, 0, 0)
+#define PIN_PC31__LCDHSYNC             PINMUX_PIN(PIN_PC31, 1, 2)
+#define PIN_PC31__FLEXCOM4_IO3         PINMUX_PIN(PIN_PC31, 2, 1)
+#define PIN_PC31__URXD3                        PINMUX_PIN(PIN_PC31, 3, 2)
+#define PIN_PC31__A20                  PINMUX_PIN(PIN_PC31, 6, 2)
+#define PIN_PD0                                96
+#define PIN_PD0__GPIO                  PINMUX_PIN(PIN_PD0, 0, 0)
+#define PIN_PD0__LCDPCK                        PINMUX_PIN(PIN_PD0, 1, 2)
+#define PIN_PD0__FLEXCOM4_IO4          PINMUX_PIN(PIN_PD0, 2, 1)
+#define PIN_PD0__UTXD3                 PINMUX_PIN(PIN_PD0, 3, 2)
+#define PIN_PD0__GTSUCOMP              PINMUX_PIN(PIN_PD0, 4, 2)
+#define PIN_PD0__A23                   PINMUX_PIN(PIN_PD0, 6, 2)
+#define PIN_PD1                                97
+#define PIN_PD1__GPIO                  PINMUX_PIN(PIN_PD1, 0, 0)
+#define PIN_PD1__LCDDEN                        PINMUX_PIN(PIN_PD1, 1, 2)
+#define PIN_PD1__GRXCK                 PINMUX_PIN(PIN_PD1, 4, 2)
+#define PIN_PD1__A24                   PINMUX_PIN(PIN_PD1, 6, 2)
+#define PIN_PD2                                98
+#define PIN_PD2__GPIO                  PINMUX_PIN(PIN_PD2, 0, 0)
+#define PIN_PD2__URXD1                 PINMUX_PIN(PIN_PD2, 1, 1)
+#define PIN_PD2__GTXER                 PINMUX_PIN(PIN_PD2, 4, 2)
+#define PIN_PD2__ISC_MCK               PINMUX_PIN(PIN_PD2, 5, 2)
+#define PIN_PD2__A25                   PINMUX_PIN(PIN_PD2, 6, 2)
+#define PIN_PD3                                99
+#define PIN_PD3__GPIO                  PINMUX_PIN(PIN_PD3, 0, 0)
+#define PIN_PD3__UTXD1                 PINMUX_PIN(PIN_PD3, 1, 1)
+#define PIN_PD3__FIQ                   PINMUX_PIN(PIN_PD3, 2, 2)
+#define PIN_PD3__GCRS                  PINMUX_PIN(PIN_PD3, 4, 2)
+#define PIN_PD3__ISC_D11               PINMUX_PIN(PIN_PD3, 5, 2)
+#define PIN_PD3__NWAIT                 PINMUX_PIN(PIN_PD3, 6, 2)
+#define PIN_PD4                                100
+#define PIN_PD4__GPIO                  PINMUX_PIN(PIN_PD4, 0, 0)
+#define PIN_PD4__TWD1                  PINMUX_PIN(PIN_PD4, 1, 2)
+#define PIN_PD4__URXD2                 PINMUX_PIN(PIN_PD4, 2, 1)
+#define PIN_PD4__GCOL                  PINMUX_PIN(PIN_PD4, 4, 2)
+#define PIN_PD4__ISC_D10               PINMUX_PIN(PIN_PD4, 5, 2)
+#define PIN_PD4__NCS0                  PINMUX_PIN(PIN_PD4, 6, 2)
+#define PIN_PD5                                101
+#define PIN_PD5__GPIO                  PINMUX_PIN(PIN_PD5, 0, 0)
+#define PIN_PD5__TWCK1                 PINMUX_PIN(PIN_PD5, 1, 2)
+#define PIN_PD5__UTXD2                 PINMUX_PIN(PIN_PD5, 2, 1)
+#define PIN_PD5__GRX2                  PINMUX_PIN(PIN_PD5, 4, 2)
+#define PIN_PD5__ISC_D9                        PINMUX_PIN(PIN_PD5, 5, 2)
+#define PIN_PD5__NCS1                  PINMUX_PIN(PIN_PD5, 6, 2)
+#define PIN_PD6                                102
+#define PIN_PD6__GPIO                  PINMUX_PIN(PIN_PD6, 0, 0)
+#define PIN_PD6__TCK                   PINMUX_PIN(PIN_PD6, 1, 2)
+#define PIN_PD6__PCK1                  PINMUX_PIN(PIN_PD6, 2, 1)
+#define PIN_PD6__GRX3                  PINMUX_PIN(PIN_PD6, 4, 2)
+#define PIN_PD6__ISC_D8                        PINMUX_PIN(PIN_PD6, 5, 2)
+#define PIN_PD6__NCS2                  PINMUX_PIN(PIN_PD6, 6, 2)
+#define PIN_PD7                                103
+#define PIN_PD7__GPIO                  PINMUX_PIN(PIN_PD7, 0, 0)
+#define PIN_PD7__TDI                   PINMUX_PIN(PIN_PD7, 1, 2)
+#define PIN_PD7__UTMI_RXVAL            PINMUX_PIN(PIN_PD7, 3, 1)
+#define PIN_PD7__GTX2                  PINMUX_PIN(PIN_PD7, 4, 2)
+#define PIN_PD7__ISC_D0                        PINMUX_PIN(PIN_PD7, 5, 2)
+#define PIN_PD7__NWR1_NBS1             PINMUX_PIN(PIN_PD7, 6, 2)
+#define PIN_PD8                                104
+#define PIN_PD8__GPIO                  PINMUX_PIN(PIN_PD8, 0, 0)
+#define PIN_PD8__TDO                   PINMUX_PIN(PIN_PD8, 1, 2)
+#define PIN_PD8__UTMI_RXERR            PINMUX_PIN(PIN_PD8, 3, 1)
+#define PIN_PD8__GTX3                  PINMUX_PIN(PIN_PD8, 4, 2)
+#define PIN_PD8__ISC_D1                        PINMUX_PIN(PIN_PD8, 5, 2)
+#define PIN_PD8__NANDRDY               PINMUX_PIN(PIN_PD8, 6, 2)
+#define PIN_PD9                                105
+#define PIN_PD9__GPIO                  PINMUX_PIN(PIN_PD9, 0, 0)
+#define PIN_PD9__TMS                   PINMUX_PIN(PIN_PD9, 1, 2)
+#define PIN_PD9__UTMI_RXACT            PINMUX_PIN(PIN_PD9, 3, 1)
+#define PIN_PD9__GTXCK                 PINMUX_PIN(PIN_PD9, 4, 2)
+#define PIN_PD9__ISC_D2                        PINMUX_PIN(PIN_PD9, 5, 2)
+#define PIN_PD10                       106
+#define PIN_PD10__GPIO                 PINMUX_PIN(PIN_PD10, 0, 0)
+#define PIN_PD10__NTRST                        PINMUX_PIN(PIN_PD10, 1, 2)
+#define PIN_PD10__UTMI_HDIS            PINMUX_PIN(PIN_PD10, 3, 1)
+#define PIN_PD10__GTXEN                        PINMUX_PIN(PIN_PD10, 4, 2)
+#define PIN_PD10__ISC_D3               PINMUX_PIN(PIN_PD10, 5, 2)
+#define PIN_PD11                       107
+#define PIN_PD11__GPIO                 PINMUX_PIN(PIN_PD11, 0, 0)
+#define PIN_PD11__TIOA1                        PINMUX_PIN(PIN_PD11, 1, 3)
+#define PIN_PD11__PCK2                 PINMUX_PIN(PIN_PD11, 2, 2)
+#define PIN_PD11__UTMI_LS0             PINMUX_PIN(PIN_PD11, 3, 1)
+#define PIN_PD11__GRXDV                        PINMUX_PIN(PIN_PD11, 4, 2)
+#define PIN_PD11__ISC_D4               PINMUX_PIN(PIN_PD11, 5, 2)
+#define PIN_PD11__ISC_MCK              PINMUX_PIN(PIN_PD11, 7, 4)
+#define PIN_PD12                       108
+#define PIN_PD12__GPIO                 PINMUX_PIN(PIN_PD12, 0, 0)
+#define PIN_PD12__TIOB1                        PINMUX_PIN(PIN_PD12, 1, 3)
+#define PIN_PD12__FLEXCOM4_IO0         PINMUX_PIN(PIN_PD12, 2, 2)
+#define PIN_PD12__UTMI_LS1             PINMUX_PIN(PIN_PD12, 3, 1)
+#define PIN_PD12__GRXER                        PINMUX_PIN(PIN_PD12, 4, 2)
+#define PIN_PD12__ISC_D5               PINMUX_PIN(PIN_PD12, 5, 2)
+#define PIN_PD12__ISC_D4               PINMUX_PIN(PIN_PD12, 6, 4)
+#define PIN_PD13                       109
+#define PIN_PD13__GPIO                 PINMUX_PIN(PIN_PD13, 0, 0)
+#define PIN_PD13__TCLK1                        PINMUX_PIN(PIN_PD13, 1, 3)
+#define PIN_PD13__FLEXCOM4_IO1         PINMUX_PIN(PIN_PD13, 2, 2)
+#define PIN_PD13__UTMI_CDRPCSEL0       PINMUX_PIN(PIN_PD13, 3, 1)
+#define PIN_PD13__GRX0                 PINMUX_PIN(PIN_PD13, 4, 2)
+#define PIN_PD13__ISC_D6               PINMUX_PIN(PIN_PD13, 5, 2)
+#define PIN_PD13__ISC_D5               PINMUX_PIN(PIN_PD13, 6, 4)
+#define PIN_PD14                       110
+#define PIN_PD14__GPIO                 PINMUX_PIN(PIN_PD14, 0, 0)
+#define PIN_PD14__TCK                  PINMUX_PIN(PIN_PD14, 1, 1)
+#define PIN_PD14__FLEXCOM4_IO2         PINMUX_PIN(PIN_PD14, 2, 2)
+#define PIN_PD14__UTMI_CDRPCSEL1       PINMUX_PIN(PIN_PD14, 3, 1)
+#define PIN_PD14__GRX1                 PINMUX_PIN(PIN_PD14, 4, 2)
+#define PIN_PD14__ISC_D7               PINMUX_PIN(PIN_PD14, 5, 2)
+#define PIN_PD14__ISC_D6               PINMUX_PIN(PIN_PD14, 6, 4)
+#define PIN_PD15                       111
+#define PIN_PD15__GPIO                 PINMUX_PIN(PIN_PD15, 0, 0)
+#define PIN_PD15__TDI                  PINMUX_PIN(PIN_PD15, 1, 1)
+#define PIN_PD15__FLEXCOM4_IO3         PINMUX_PIN(PIN_PD15, 2, 2)
+#define PIN_PD15__UTMI_CDRCPDIVEN      PINMUX_PIN(PIN_PD15, 3, 1)
+#define PIN_PD15__GTX0                 PINMUX_PIN(PIN_PD15, 4, 2)
+#define PIN_PD15__ISC_PCK              PINMUX_PIN(PIN_PD15, 5, 2)
+#define PIN_PD15__ISC_D7               PINMUX_PIN(PIN_PD15, 6, 4)
+#define PIN_PD16                       112
+#define PIN_PD16__GPIO                 PINMUX_PIN(PIN_PD16, 0, 0)
+#define PIN_PD16__TDO                  PINMUX_PIN(PIN_PD16, 1, 1)
+#define PIN_PD16__FLEXCOM4_IO4         PINMUX_PIN(PIN_PD16, 2, 2)
+#define PIN_PD16__UTMI_CDRBISTEN       PINMUX_PIN(PIN_PD16, 3, 1)
+#define PIN_PD16__GTX1                 PINMUX_PIN(PIN_PD16, 4, 2)
+#define PIN_PD16__ISC_VSYNC            PINMUX_PIN(PIN_PD16, 5, 2)
+#define PIN_PD16__ISC_D8               PINMUX_PIN(PIN_PD16, 6, 4)
+#define PIN_PD17                       113
+#define PIN_PD17__GPIO                 PINMUX_PIN(PIN_PD17, 0, 0)
+#define PIN_PD17__TMS                  PINMUX_PIN(PIN_PD17, 1, 1)
+#define PIN_PD17__UTMI_CDRCPSELDIV     PINMUX_PIN(PIN_PD17, 3, 1)
+#define PIN_PD17__GMDC                 PINMUX_PIN(PIN_PD17, 4, 2)
+#define PIN_PD17__ISC_HSYNC            PINMUX_PIN(PIN_PD17, 5, 2)
+#define PIN_PD17__ISC_D9               PINMUX_PIN(PIN_PD17, 6, 4)
+#define PIN_PD18                       114
+#define PIN_PD18__GPIO                 PINMUX_PIN(PIN_PD18, 0, 0)
+#define PIN_PD18__NTRST                        PINMUX_PIN(PIN_PD18, 1, 1)
+#define PIN_PD18__GMDIO                        PINMUX_PIN(PIN_PD18, 4, 2)
+#define PIN_PD18__ISC_FIELD            PINMUX_PIN(PIN_PD18, 5, 2)
+#define PIN_PD18__ISC_D10              PINMUX_PIN(PIN_PD18, 6, 4)
+#define PIN_PD19                       115
+#define PIN_PD19__GPIO                 PINMUX_PIN(PIN_PD19, 0, 0)
+#define PIN_PD19__PCK0                 PINMUX_PIN(PIN_PD19, 1, 1)
+#define PIN_PD19__TWD1                 PINMUX_PIN(PIN_PD19, 2, 3)
+#define PIN_PD19__URXD2                        PINMUX_PIN(PIN_PD19, 3, 3)
+#define PIN_PD19__I2SC0_CK             PINMUX_PIN(PIN_PD19, 5, 2)
+#define PIN_PD19__ISC_D11              PINMUX_PIN(PIN_PD19, 6, 4)
+#define PIN_PD20                       116
+#define PIN_PD20__GPIO                 PINMUX_PIN(PIN_PD20, 0, 0)
+#define PIN_PD20__TIOA2                        PINMUX_PIN(PIN_PD20, 1, 3)
+#define PIN_PD20__TWCK1                        PINMUX_PIN(PIN_PD20, 2, 3)
+#define PIN_PD20__UTXD2                        PINMUX_PIN(PIN_PD20, 3, 3)
+#define PIN_PD20__I2SC0_MCK            PINMUX_PIN(PIN_PD20, 5, 2)
+#define PIN_PD20__ISC_PCK              PINMUX_PIN(PIN_PD20, 6, 4)
+#define PIN_PD21                       117
+#define PIN_PD21__GPIO                 PINMUX_PIN(PIN_PD21, 0, 0)
+#define PIN_PD21__TIOB2                        PINMUX_PIN(PIN_PD21, 1, 3)
+#define PIN_PD21__TWD0                 PINMUX_PIN(PIN_PD21, 2, 4)
+#define PIN_PD21__FLEXCOM4_IO0         PINMUX_PIN(PIN_PD21, 3, 3)
+#define PIN_PD21__I2SC0_WS             PINMUX_PIN(PIN_PD21, 5, 2)
+#define PIN_PD21__ISC_VSYNC            PINMUX_PIN(PIN_PD21, 6, 4)
+#define PIN_PD22                       118
+#define PIN_PD22__GPIO                 PINMUX_PIN(PIN_PD22, 0, 0)
+#define PIN_PD22__TCLK2                        PINMUX_PIN(PIN_PD22, 1, 3)
+#define PIN_PD22__TWCK0                        PINMUX_PIN(PIN_PD22, 2, 4)
+#define PIN_PD22__FLEXCOM4_IO1         PINMUX_PIN(PIN_PD22, 3, 3)
+#define PIN_PD22__I2SC0_DI0            PINMUX_PIN(PIN_PD22, 5, 2)
+#define PIN_PD22__ISC_HSYNC            PINMUX_PIN(PIN_PD22, 6, 4)
+#define PIN_PD23                       119
+#define PIN_PD23__GPIO                 PINMUX_PIN(PIN_PD23, 0, 0)
+#define PIN_PD23__URXD2                        PINMUX_PIN(PIN_PD23, 1, 2)
+#define PIN_PD23__FLEXCOM4_IO2         PINMUX_PIN(PIN_PD23, 3, 3)
+#define PIN_PD23__I2SC0_DO0            PINMUX_PIN(PIN_PD23, 5, 2)
+#define PIN_PD23__ISC_FIELD            PINMUX_PIN(PIN_PD23, 6, 4)
+#define PIN_PD24                       120
+#define PIN_PD24__GPIO                 PINMUX_PIN(PIN_PD24, 0, 0)
+#define PIN_PD24__UTXD2                        PINMUX_PIN(PIN_PD23, 1, 2)
+#define PIN_PD24__FLEXCOM4_IO3         PINMUX_PIN(PIN_PD23, 3, 3)
+#define PIN_PD25                       121
+#define PIN_PD25__GPIO                 PINMUX_PIN(PIN_PD25, 0, 0)
+#define PIN_PD25__SPI1_SPCK            PINMUX_PIN(PIN_PD25, 1, 3)
+#define PIN_PD25__FLEXCOM4_IO4         PINMUX_PIN(PIN_PD25, 3, 3)
+#define PIN_PD26                       122
+#define PIN_PD26__GPIO                 PINMUX_PIN(PIN_PD26, 0, 0)
+#define PIN_PD26__SPI1_MOSI            PINMUX_PIN(PIN_PD26, 1, 3)
+#define PIN_PD26__FLEXCOM2_IO0         PINMUX_PIN(PIN_PD26, 3, 2)
+#define PIN_PD27                       123
+#define PIN_PD27__GPIO                 PINMUX_PIN(PIN_PD27, 0, 0)
+#define PIN_PD27__SPI1_MISO            PINMUX_PIN(PIN_PD27, 1, 3)
+#define PIN_PD27__TCK                  PINMUX_PIN(PIN_PD27, 2, 3)
+#define PIN_PD27__FLEXCOM2_IO1         PINMUX_PIN(PIN_PD27, 3, 2)
+#define PIN_PD28                       124
+#define PIN_PD28__GPIO                 PINMUX_PIN(PIN_PD28, 0, 0)
+#define PIN_PD28__SPI1_NPCS0           PINMUX_PIN(PIN_PD28, 1, 3)
+#define PIN_PD28__TCI                  PINMUX_PIN(PIN_PD28, 2, 3)
+#define PIN_PD28__FLEXCOM2_IO2         PINMUX_PIN(PIN_PD28, 3, 2)
+#define PIN_PD29                       125
+#define PIN_PD29__GPIO                 PINMUX_PIN(PIN_PD29, 0, 0)
+#define PIN_PD29__SPI1_NPCS1           PINMUX_PIN(PIN_PD29, 1, 3)
+#define PIN_PD29__TDO                  PINMUX_PIN(PIN_PD29, 2, 3)
+#define PIN_PD29__FLEXCOM2_IO3         PINMUX_PIN(PIN_PD29, 3, 2)
+#define PIN_PD29__TIOA3                        PINMUX_PIN(PIN_PD29, 4, 3)
+#define PIN_PD29__TWD0                 PINMUX_PIN(PIN_PD29, 5, 3)
+#define PIN_PD30                       126
+#define PIN_PD30__GPIO                 PINMUX_PIN(PIN_PD30, 0, 0)
+#define PIN_PD30__SPI1_NPCS2           PINMUX_PIN(PIN_PD30, 1, 3)
+#define PIN_PD30__TMS                  PINMUX_PIN(PIN_PD30, 2, 3)
+#define PIN_PD30__FLEXCOM2_IO4         PINMUX_PIN(PIN_PD30, 3, 2)
+#define PIN_PD30__TIOB3                        PINMUX_PIN(PIN_PD30, 4, 3)
+#define PIN_PD30__TWCK0                        PINMUX_PIN(PIN_PD30, 5, 3)
+#define PIN_PD31                       127
+#define PIN_PD31__GPIO                 PINMUX_PIN(PIN_PD31, 0, 0)
+#define PIN_PD31__ADTRG                        PINMUX_PIN(PIN_PD31, 1, 1)
+#define PIN_PD31__NTRST                        PINMUX_PIN(PIN_PD31, 2, 3)
+#define PIN_PD31__IRQ                  PINMUX_PIN(PIN_PD31, 3, 4)
+#define PIN_PD31__TCLK3                        PINMUX_PIN(PIN_PD31, 4, 3)
+#define PIN_PD31__PCK0                 PINMUX_PIN(PIN_PD31, 5, 2)
index cc05cde0f9a4145436f5b3807d78e056b140094e..4dfca8fc49b3db0777e5d262c2d8eb0a3f02f6f0 100644 (file)
                        cache-level = <2>;
                };
 
+               sdmmc0: sdio-host@a0000000 {
+                       compatible = "atmel,sama5d2-sdhci";
+                       reg = <0xa0000000 0x300>;
+                       interrupts = <31 IRQ_TYPE_LEVEL_HIGH 0>;
+                       clocks = <&sdmmc0_hclk>, <&sdmmc0_gclk>, <&main>;
+                       clock-names = "hclock", "multclk", "baseclk";
+                       status = "disabled";
+               };
+
+               sdmmc1: sdio-host@b0000000 {
+                       compatible = "atmel,sama5d2-sdhci";
+                       reg = <0xb0000000 0x300>;
+                       interrupts = <32 IRQ_TYPE_LEVEL_HIGH 0>;
+                       clocks = <&sdmmc1_hclk>, <&sdmmc1_gclk>, <&main>;
+                       clock-names = "hclock", "multclk", "baseclk";
+                       status = "disabled";
+               };
+
                apb {
                        compatible = "simple-bus";
                        #address-cells = <1>;
                        };
 
                        pmc: pmc@f0014000 {
-                               compatible = "atmel,sama5d2-pmc";
+                               compatible = "atmel,sama5d2-pmc", "syscon";
                                reg = <0xf0014000 0x160>;
                                interrupts = <74 IRQ_TYPE_LEVEL_HIGH 7>;
                                interrupt-controller;
                                                atmel,clk-output-range = <0 83000000>;
                                        };
 
+                                       i2s0_clk: i2s0_clk {
+                                               #clock-cells = <0>;
+                                               reg = <54>;
+                                               atmel,clk-output-range = <0 83000000>;
+                                       };
+
+                                       i2s1_clk: i2s1_clk {
+                                               #clock-cells = <0>;
+                                               reg = <55>;
+                                               atmel,clk-output-range = <0 83000000>;
+                                       };
+
                                        classd_clk: classd_clk {
                                                #clock-cells = <0>;
                                                reg = <59>;
                                                reg = <53>;
                                        };
                                };
+
+                               gck {
+                                       compatible = "atmel,sama5d2-clk-generated";
+                                       #address-cells = <1>;
+                                       #size-cells = <0>;
+                                       interrupt-parent = <&pmc>;
+                                       clocks = <&clk32k>, <&main>, <&plladiv>, <&utmi>, <&mck>;
+
+                                       sdmmc0_gclk: sdmmc0_gclk {
+                                               #clock-cells = <0>;
+                                               reg = <31>;
+                                       };
+
+                                       sdmmc1_gclk: sdmmc1_gclk {
+                                               #clock-cells = <0>;
+                                               reg = <32>;
+                                       };
+
+                                       tcb0_gclk: tcb0_gclk {
+                                               #clock-cells = <0>;
+                                               reg = <35>;
+                                               atmel,clk-output-range = <0 83000000>;
+                                       };
+
+                                       tcb1_gclk: tcb1_gclk {
+                                               #clock-cells = <0>;
+                                               reg = <36>;
+                                               atmel,clk-output-range = <0 83000000>;
+                                       };
+
+                                       pwm_gclk: pwm_gclk {
+                                               #clock-cells = <0>;
+                                               reg = <38>;
+                                               atmel,clk-output-range = <0 83000000>;
+                                       };
+
+                                       i2s0_gclk: i2s0_gclk {
+                                               #clock-cells = <0>;
+                                               reg = <54>;
+                                       };
+
+                                       i2s1_gclk: i2s1_gclk {
+                                               #clock-cells = <0>;
+                                               reg = <55>;
+                                       };
+                               };
                        };
 
                        sha@f0028000 {
                                dma-names = "tx";
                                clocks = <&sha_clk>;
                                clock-names = "sha_clk";
-                               status = "disabled";
+                               status = "okay";
                        };
 
                        aes@f002c000 {
                                dma-names = "tx", "rx";
                                clocks = <&aes_clk>;
                                clock-names = "aes_clk";
-                               status = "disabled";
+                               status = "okay";
                        };
 
                        spi0: spi@f8000000 {
                                status = "disabled";
                        };
 
+                       flx0: flexcom@f8034000 {
+                               compatible = "atmel,sama5d2-flexcom";
+                               reg = <0xf8034000 0x200>;
+                               clocks = <&flx0_clk>;
+                               #address-cells = <1>;
+                               #size-cells = <1>;
+                               ranges = <0x0 0xf8034000 0x800>;
+                               status = "disabled";
+                       };
+
+                       flx1: flexcom@f8038000 {
+                               compatible = "atmel,sama5d2-flexcom";
+                               reg = <0xf8038000 0x200>;
+                               clocks = <&flx1_clk>;
+                               #address-cells = <1>;
+                               #size-cells = <1>;
+                               ranges = <0x0 0xf8038000 0x800>;
+                               status = "disabled";
+                       };
+
+                       rstc@f8048000 {
+                               compatible = "atmel,sama5d3-rstc";
+                               reg = <0xf8048000 0x10>;
+                               clocks = <&clk32k>;
+                       };
+
                        pit: timer@f8048030 {
                                compatible = "atmel,at91sam9260-pit";
                                reg = <0xf8048030 0x10>;
                                status = "disabled";
                        };
 
+                       flx2: flexcom@fc010000 {
+                               compatible = "atmel,sama5d2-flexcom";
+                               reg = <0xfc010000 0x200>;
+                               clocks = <&flx2_clk>;
+                               #address-cells = <1>;
+                               #size-cells = <1>;
+                               ranges = <0x0 0xfc010000 0x800>;
+                               status = "disabled";
+                       };
+
+                       flx3: flexcom@fc014000 {
+                               compatible = "atmel,sama5d2-flexcom";
+                               reg = <0xfc014000 0x200>;
+                               clocks = <&flx3_clk>;
+                               #address-cells = <1>;
+                               #size-cells = <1>;
+                               ranges = <0x0 0xfc014000 0x800>;
+                               status = "disabled";
+                       };
+
+                       flx4: flexcom@fc018000 {
+                               compatible = "atmel,sama5d2-flexcom";
+                               reg = <0xfc018000 0x200>;
+                               clocks = <&flx4_clk>;
+                               #address-cells = <1>;
+                               #size-cells = <1>;
+                               ranges = <0x0 0xfc018000 0x800>;
+                               status = "disabled";
+                       };
+
                        aic: interrupt-controller@fc020000 {
                                #interrupt-cells = <3>;
                                compatible = "atmel,sama5d2-aic";
                                #gpio-cells = <2>;
                                clocks = <&pioA_clk>;
                        };
+
+                       tdes@fc044000 {
+                               compatible = "atmel,at91sam9g46-tdes";
+                               reg = <0xfc044000 0x100>;
+                               interrupts = <11 IRQ_TYPE_LEVEL_HIGH 0>;
+                               dmas = <&dma0
+                                       (AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1) |
+                                        AT91_XDMAC_DT_PERID(28))>,
+                                      <&dma0
+                                       (AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1) |
+                                        AT91_XDMAC_DT_PERID(29))>;
+                               dma-names = "tx", "rx";
+                               clocks = <&tdes_clk>;
+                               clock-names = "tdes_clk";
+                               status = "okay";
+                       };
                };
        };
 };
index 7fa276515f11b6a6e522cb54ed18b057ff1bdeab..a53279160f9833945e2dedc37fd1f019e919e8c3 100644 (file)
@@ -75,7 +75,7 @@
                adc_op_clk: adc_op_clk{
                        compatible = "fixed-clock";
                        #clock-cells = <0>;
-                       clock-frequency = <20000000>;
+                       clock-frequency = <1000000>;
                };
        };
 
                                atmel,adc-use-external-triggers;
                                atmel,adc-vref = <3000>;
                                atmel,adc-res = <10 12>;
+                               atmel,adc-sample-hold-time = <11>;
                                atmel,adc-res-names = "lowres", "highres";
                                status = "disabled";
 
                        };
 
                        pmc: pmc@fffffc00 {
-                               compatible = "atmel,sama5d3-pmc";
+                               compatible = "atmel,sama5d3-pmc", "syscon";
                                reg = <0xfffffc00 0x120>;
                                interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
                                interrupt-controller;
index 026b252f09b3e6b2db4b6310fe19969f3332798e..e21099a1aef9c17f8fce7d61205f98e3c5e0a26f 100644 (file)
@@ -24,9 +24,9 @@
                                        };
                                        pinctrl_mmc2_dat1_3: mmc2_dat1_3 {
                                                atmel,pins =
-                                                       <AT91_PIOC 12 AT91_PERIPH_A AT91_PINCTRL_NONE   /* PC12 periph A MCI2_DA1 with pullup, conflicts with TIOA1 */
-                                                        AT91_PIOC 13 AT91_PERIPH_A AT91_PINCTRL_NONE   /* PC13 periph A MCI2_DA2 with pullup, conflicts with TIOB1 */
-                                                        AT91_PIOC 14 AT91_PERIPH_A AT91_PINCTRL_NONE>; /* PC14 periph A MCI2_DA3 with pullup, conflicts with TCLK1 */
+                                                       <AT91_PIOC 12 AT91_PERIPH_A AT91_PINCTRL_PULL_UP        /* PC12 periph A MCI2_DA1 with pullup, conflicts with TIOA1 */
+                                                        AT91_PIOC 13 AT91_PERIPH_A AT91_PINCTRL_PULL_UP        /* PC13 periph A MCI2_DA2 with pullup, conflicts with TIOB1 */
+                                                        AT91_PIOC 14 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>;      /* PC14 periph A MCI2_DA3 with pullup, conflicts with TCLK1 */
                                        };
                                };
                        };
index 83bee7a3a617d06dcfb083771d1ecf3abe38add1..89010422812d6ade002d1c133713f07c73399f3f 100644 (file)
@@ -87,6 +87,8 @@
                                        isi_0: endpoint {
                                                remote-endpoint = <&ov2640_0>;
                                                bus-width = <8>;
+                                               vsync-active = <1>;
+                                               hsync-active = <1>;
                                        };
                                };
                        };
index 8d1de29e8da107ab8d6e746877b16032c3fb8d0b..15bbaf690047dfb9ab0082d31b83142b63228e09 100644 (file)
                        };
 
                        pmc: pmc@f0018000 {
-                               compatible = "atmel,sama5d3-pmc";
+                               compatible = "atmel,sama5d3-pmc", "syscon";
                                reg = <0xf0018000 0x120>;
                                interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
                                interrupt-controller;
                                reg = <0xf8018000 0x4000>;
                                interrupts = <33 IRQ_TYPE_LEVEL_HIGH 6>;
                                dmas = <&dma1
-                                       (AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1))
-                                       AT91_XDMAC_DT_PERID(4)>,
+                                       (AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1)
+                                       | AT91_XDMAC_DT_PERID(4))>,
                                       <&dma1
-                                       (AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1))
-                                       AT91_XDMAC_DT_PERID(5)>;
+                                       (AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1)
+                                       | AT91_XDMAC_DT_PERID(5))>;
                                dma-names = "tx", "rx";
                                pinctrl-names = "default";
                                pinctrl-0 = <&pinctrl_i2c1>;
                                clock-names = "t0_clk", "slow_clk";
                        };
 
+                       macb1: ethernet@fc028000 {
+                               compatible = "atmel,sama5d4-gem";
+                               reg = <0xfc028000 0x100>;
+                               interrupts = <55 IRQ_TYPE_LEVEL_HIGH 3>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&pinctrl_macb1_rmii>;
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               clocks = <&macb1_clk>, <&macb1_clk>;
+                               clock-names = "hclk", "pclk";
+                               status = "disabled";
+                       };
+
                        adc0: adc@fc034000 {
                                compatible = "atmel,at91sam9x5-adc";
                                reg = <0xfc034000 0x100>;
                                dma-names = "tx", "rx";
                                clocks = <&aes_clk>;
                                clock-names = "aes_clk";
-                               status = "disabled";
+                               status = "okay";
                        };
 
                        tdes@fc04c000 {
                                dma-names = "tx", "rx";
                                clocks = <&tdes_clk>;
                                clock-names = "tdes_clk";
-                               status = "disabled";
+                               status = "okay";
                        };
 
                        sha@fc050000 {
                                dma-names = "tx";
                                clocks = <&sha_clk>;
                                clock-names = "sha_clk";
-                               status = "disabled";
+                               status = "okay";
                        };
 
                        rstc@fc068600 {
                                        0xffffffff 0x3ffcfe7c 0x1c010101        /* pioA */
                                        0x7fffffff 0xfffccc3a 0x3f00cc3a        /* pioB */
                                        0xffffffff 0x3ff83fff 0xff00ffff        /* pioC */
-                                       0x00000000 0x00000000 0x00000000        /* pioD */
+                                       0x0003ff00 0x8002a800 0x00000000        /* pioD */
                                        0xffffffff 0x7fffffff 0x76fff1bf        /* pioE */
                                        >;
 
                                        interrupt-controller;
                                        #interrupt-cells = <2>;
                                        clocks = <&pioD_clk>;
-                                       status = "disabled";
                                };
 
                                pioE: gpio@fc06d000 {
                                        };
                                };
 
+                               macb1 {
+                                       pinctrl_macb1_rmii: macb1_rmii-0 {
+                                               atmel,pins =
+                                                       <AT91_PIOA 14 AT91_PERIPH_B AT91_PINCTRL_NONE   /* G1_TX0 */
+                                                        AT91_PIOA 15 AT91_PERIPH_B AT91_PINCTRL_NONE   /* G1_TX1 */
+                                                        AT91_PIOA 12 AT91_PERIPH_B AT91_PINCTRL_NONE   /* G1_RX0 */
+                                                        AT91_PIOA 13 AT91_PERIPH_B AT91_PINCTRL_NONE   /* G1_RX1 */
+                                                        AT91_PIOA 10 AT91_PERIPH_B AT91_PINCTRL_NONE   /* G1_RXDV */
+                                                        AT91_PIOA 11 AT91_PERIPH_B AT91_PINCTRL_NONE   /* G1_RXER */
+                                                        AT91_PIOA  4 AT91_PERIPH_B AT91_PINCTRL_NONE   /* G1_TXEN */
+                                                        AT91_PIOA  2 AT91_PERIPH_B AT91_PINCTRL_NONE   /* G1_TXCK */
+                                                        AT91_PIOA 22 AT91_PERIPH_B AT91_PINCTRL_NONE   /* G1_MDC */
+                                                        AT91_PIOA 23 AT91_PERIPH_B AT91_PINCTRL_NONE   /* G1_MDIO */
+                                                       >;
+                                       };
+                               };
+
                                mmc0 {
                                        pinctrl_mmc0_clk_cmd_dat0: mmc0_clk_cmd_dat0 {
                                                atmel,pins =
index 24b4cd24dceb2f9eca1df72cf2138e9db0e85dbf..7fc5602810ad0da1d55a776a1fad926f1e332194 100644 (file)
        };
 
        accelerometer@1d {
-               compatible = "adi,adxl34x";
+               compatible = "adi,adxl345";
                reg = <0x1d>;
                interrupt-parent = <&irqpin3>;
                interrupts = <2 IRQ_TYPE_LEVEL_HIGH>,
index 314e589cfa00893a47b513053c3586ec263a6da4..39c470e291f96fa42c6d7b3740d63a96b2131194 100644 (file)
                                };
                };
 
+               fpgamgr0: fpgamgr@ff706000 {
+                       compatible = "altr,socfpga-fpga-mgr";
+                       reg = <0xff706000 0x1000
+                              0xffb90000 0x1000>;
+                       interrupts = <0 175 4>;
+               };
+
                gmac0: ethernet@ff700000 {
                        compatible = "altr,socfpga-stmmac", "snps,dwmac-3.70a", "snps,dwmac";
                        altr,sysmgr-syscon = <&sysmgr 0x60 0>;
                        status = "disabled";
                };
 
-               i2c0: i2c@ffc04000 {
-                       #address-cells = <1>;
-                       #size-cells = <0>;
-                       compatible = "snps,designware-i2c";
-                       reg = <0xffc04000 0x1000>;
-                       clocks = <&l4_sp_clk>;
-                       interrupts = <0 158 0x4>;
-                       status = "disabled";
-               };
-
-               i2c1: i2c@ffc05000 {
-                       #address-cells = <1>;
-                       #size-cells = <0>;
-                       compatible = "snps,designware-i2c";
-                       reg = <0xffc05000 0x1000>;
-                       clocks = <&l4_sp_clk>;
-                       interrupts = <0 159 0x4>;
-                       status = "disabled";
-               };
-
-               i2c2: i2c@ffc06000 {
-                       #address-cells = <1>;
-                       #size-cells = <0>;
-                       compatible = "snps,designware-i2c";
-                       reg = <0xffc06000 0x1000>;
-                       clocks = <&l4_sp_clk>;
-                       interrupts = <0 160 0x4>;
-                       status = "disabled";
-               };
-
-               i2c3: i2c@ffc07000 {
-                       #address-cells = <1>;
-                       #size-cells = <0>;
-                       compatible = "snps,designware-i2c";
-                       reg = <0xffc07000 0x1000>;
-                       clocks = <&l4_sp_clk>;
-                       interrupts = <0 161 0x4>;
-                       status = "disabled";
-               };
-
                gpio0: gpio@ff708000 {
                        #address-cells = <1>;
                        #size-cells = <0>;
                        };
                };
 
-               sdr: sdr@ffc25000 {
-                       compatible = "syscon";
-                       reg = <0xffc25000 0x1000>;
+               i2c0: i2c@ffc04000 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "snps,designware-i2c";
+                       reg = <0xffc04000 0x1000>;
+                       clocks = <&l4_sp_clk>;
+                       interrupts = <0 158 0x4>;
+                       status = "disabled";
                };
 
-               sdramedac {
-                       compatible = "altr,sdram-edac";
-                       altr,sdr-syscon = <&sdr>;
-                       interrupts = <0 39 4>;
+               i2c1: i2c@ffc05000 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "snps,designware-i2c";
+                       reg = <0xffc05000 0x1000>;
+                       clocks = <&l4_sp_clk>;
+                       interrupts = <0 159 0x4>;
+                       status = "disabled";
+               };
+
+               i2c2: i2c@ffc06000 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "snps,designware-i2c";
+                       reg = <0xffc06000 0x1000>;
+                       clocks = <&l4_sp_clk>;
+                       interrupts = <0 160 0x4>;
+                       status = "disabled";
+               };
+
+               i2c3: i2c@ffc07000 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "snps,designware-i2c";
+                       reg = <0xffc07000 0x1000>;
+                       clocks = <&l4_sp_clk>;
+                       interrupts = <0 161 0x4>;
+                       status = "disabled";
                };
 
                L2: l2-cache@fffef000 {
                        reg = <0xffff0000 0x10000>;
                };
 
+               rst: rstmgr@ffd05000 {
+                       #reset-cells = <1>;
+                       compatible = "altr,rst-mgr";
+                       reg = <0xffd05000 0x1000>;
+                       altr,modrst-offset = <0x10>;
+               };
+
+               scu: snoop-control-unit@fffec000 {
+                       compatible = "arm,cortex-a9-scu";
+                       reg = <0xfffec000 0x100>;
+               };
+
+               sdr: sdr@ffc25000 {
+                       compatible = "syscon";
+                       reg = <0xffc25000 0x1000>;
+               };
+
+               sdramedac {
+                       compatible = "altr,sdram-edac";
+                       altr,sdr-syscon = <&sdr>;
+                       interrupts = <0 39 4>;
+               };
+
                spi0: spi@fff00000 {
                        compatible = "snps,dw-apb-ssi";
                        #address-cells = <1>;
                        status = "disabled";
                };
 
-               scu: snoop-control-unit@fffec000 {
-                       compatible = "arm,cortex-a9-scu";
-                       reg = <0xfffec000 0x100>;
-               };
-
                spi1: spi@fff01000 {
                        compatible = "snps,dw-apb-ssi";
                        #address-cells = <1>;
                        status = "disabled";
                };
 
+               sysmgr: sysmgr@ffd08000 {
+                       compatible = "altr,sys-mgr", "syscon";
+                       reg = <0xffd08000 0x4000>;
+               };
+
                /* Local timer */
                timer@fffec600 {
                        compatible = "arm,cortex-a9-twd-timer";
                        dma-names = "tx", "rx";
                };
 
-               rst: rstmgr@ffd05000 {
-                       #reset-cells = <1>;
-                       compatible = "altr,rst-mgr";
-                       reg = <0xffd05000 0x1000>;
-                       altr,modrst-offset = <0x10>;
-               };
-
                usbphy0: usbphy@0 {
                        #phy-cells = <0>;
                        compatible = "usb-nop-xceiv";
                        clocks = <&osc1>;
                        status = "disabled";
                };
-
-               sysmgr: sysmgr@ffd08000 {
-                       compatible = "altr,sys-mgr", "syscon";
-                       reg = <0xffd08000 0x4000>;
-               };
        };
 };
index 2340fcb2b53545fc7a79fc99c4dcc795eb86b739..cce9e50acf68a62274b080ee15dba03d203263fe 100644 (file)
                        compatible = "snps,designware-i2c";
                        reg = <0xffc02200 0x100>;
                        interrupts = <0 105 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&l4_sp_clk>;
                        status = "disabled";
                };
 
                        compatible = "snps,designware-i2c";
                        reg = <0xffc02300 0x100>;
                        interrupts = <0 106 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&l4_sp_clk>;
                        status = "disabled";
                };
 
                        compatible = "snps,designware-i2c";
                        reg = <0xffc02400 0x100>;
                        interrupts = <0 107 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&l4_sp_clk>;
                        status = "disabled";
                };
 
                        compatible = "snps,designware-i2c";
                        reg = <0xffc02500 0x100>;
                        interrupts = <0 108 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&l4_sp_clk>;
                        status = "disabled";
                };
 
                        compatible = "snps,designware-i2c";
                        reg = <0xffc02600 0x100>;
                        interrupts = <0 109 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&l4_sp_clk>;
                        status = "disabled";
                };
 
                        interrupts = <0 110 IRQ_TYPE_LEVEL_HIGH>;
                        reg-shift = <2>;
                        reg-io-width = <4>;
+                       clocks = <&l4_sp_clk>;
                        status = "disabled";
                };
 
                        compatible = "snps,dwc2";
                        reg = <0xffb40000 0xffff>;
                        interrupts = <0 96 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&usb_clk>;
+                       clock-names = "otg";
                        phys = <&usbphy0>;
                        phy-names = "usb2-phy";
                        status = "disabled";
index 99aa9a1c8af0b6950fbd999e432ace134c7b285d..567df98f1bb5da3d422fae0ddcb15b97b9a68396 100644 (file)
        status = "okay";
 };
 
+&i2c1 {
+       speed-mode = <0>;
+       status = "okay";
+
+       /*
+        * adjust the falling times to decrease the i2c frequency to 50Khz
+        * because the LCD module does not work at the standard 100Khz
+        */
+       i2c-sda-falling-time-ns = <6000>;
+       i2c-scl-falling-time-ns = <6000>;
+
+       eeprom@51 {
+               compatible = "atmel,24c32";
+               reg = <0x51>;
+               pagesize = <32>;
+       };
+
+       rtc@68 {
+               compatible = "dallas,ds1339";
+               reg = <0x68>;
+       };
+};
+
 &uart1 {
        status = "okay";
 };
+
+&usb0 {
+       status = "okay";
+};
index 6d93475be5546afaff1fde83bae34afe7f638cec..c8ad905d03094008501e3bc42ade018e61eb0264 100644 (file)
@@ -25,6 +25,7 @@
 
        aliases {
                ttyAS0 = &sbc_serial0;
+               ethernet0 = &ethernet0;
        };
 
 };
index 0c24fcb0357703df59ca41588a9061f1da4f4bd0..81f81214cdf9580a0cb19ce01d8bfc5e01417252 100644 (file)
                                        <ST_IRQ_SYSCFG_DISABLED>;
                };
 
+               /* Display */
+               vtg_main: sti-vtg-main@8d02800 {
+                       compatible = "st,vtg";
+                       reg = <0x8d02800 0x200>;
+                       interrupts = <GIC_SPI 108 IRQ_TYPE_NONE>;
+               };
+
+               vtg_aux: sti-vtg-aux@8d00200 {
+                       compatible = "st,vtg";
+                       reg = <0x8d00200 0x100>;
+                       interrupts = <GIC_SPI 109 IRQ_TYPE_NONE>;
+               };
+
                serial@9830000 {
                        compatible = "st,asc";
                        reg = <0x9830000 0x2c>;
                        interrupts = <GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH>;
                        clocks = <&clk_s_c0_flexgen CLK_EXT2F_A9>;
                        clock-names = "ssc";
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&pinctrl_spi1_default>;
 
                        status = "disabled";
                };
                        interrupts = <GIC_SPI 114 IRQ_TYPE_LEVEL_HIGH>;
                        clocks = <&clk_s_c0_flexgen CLK_EXT2F_A9>;
                        clock-names = "ssc";
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&pinctrl_spi2_default>;
 
                        status = "disabled";
                };
                        interrupts = <GIC_SPI 115 IRQ_TYPE_LEVEL_HIGH>;
                        clocks = <&clk_s_c0_flexgen CLK_EXT2F_A9>;
                        clock-names = "ssc";
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&pinctrl_spi3_default>;
 
                        status = "disabled";
                };
                        interrupts = <GIC_SPI 116 IRQ_TYPE_LEVEL_HIGH>;
                        clocks = <&clk_s_c0_flexgen CLK_EXT2F_A9>;
                        clock-names = "ssc";
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&pinctrl_spi4_default>;
 
                        status = "disabled";
                };
                        interrupts = <GIC_SPI 135 IRQ_TYPE_LEVEL_HIGH>;
                        clocks = <&clk_sysin>;
                        clock-names = "ssc";
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&pinctrl_spi10_default>;
 
                        status = "disabled";
                };
                        interrupts = <GIC_SPI 136 IRQ_TYPE_LEVEL_HIGH>;
                        clocks = <&clk_sysin>;
                        clock-names = "ssc";
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&pinctrl_spi11_default>;
 
                        status = "disabled";
                };
                        interrupts = <GIC_SPI 137 IRQ_TYPE_LEVEL_HIGH>;
                        clocks = <&clk_sysin>;
                        clock-names = "ssc";
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&pinctrl_spi12_default>;
 
                        status = "disabled";
                };
                /* COMMS PWM Module */
                pwm0: pwm@9810000 {
                        compatible      = "st,sti-pwm";
-                       status          = "okay";
                        #pwm-cells      = <2>;
                        reg             = <0x9810000 0x68>;
                        pinctrl-names   = "default";
                        clock-names     = "pwm";
                        clocks          = <&clk_sysin>;
                        st,pwm-num-chan = <1>;
+
+                       status          = "disabled";
                };
 
                /* SBC PWM Module */
                pwm1: pwm@9510000 {
                        compatible      = "st,sti-pwm";
-                       status          = "okay";
                        #pwm-cells      = <2>;
                        reg             = <0x9510000 0x68>;
                        pinctrl-names   = "default";
                        clock-names     = "pwm";
                        clocks          = <&clk_sysin>;
                        st,pwm-num-chan = <4>;
+
+                       status          = "disabled";
+               };
+
+               rng10: rng@08a89000 {
+                       compatible      = "st,rng";
+                       reg             = <0x08a89000 0x1000>;
+                       clocks          = <&clk_sysin>;
+                       status          = "okay";
+               };
+
+               rng11: rng@08a8a000 {
+                       compatible      = "st,rng";
+                       reg             = <0x08a8a000 0x1000>;
+                       clocks          = <&clk_sysin>;
+                       status          = "okay";
+               };
+
+               ethernet0: dwmac@9630000 {
+                       device_type = "network";
+                       status = "disabled";
+                       compatible = "st,stih407-dwmac", "snps,dwmac", "snps,dwmac-3.710";
+                       reg = <0x9630000 0x8000>, <0x80 0x4>;
+                       reg-names = "stmmaceth", "sti-ethconf";
+
+                       st,syscon = <&syscfg_sbc_reg 0x80>;
+                       st,gmac_en;
+                       resets = <&softreset STIH407_ETH1_SOFTRESET>;
+                       reset-names = "stmmaceth";
+
+                       interrupts = <GIC_SPI 98 IRQ_TYPE_NONE>,
+                                    <GIC_SPI 99 IRQ_TYPE_NONE>;
+                       interrupt-names = "macirq", "eth_wake_irq";
+
+                       /* DMA Bus Mode */
+                       snps,pbl = <8>;
+
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&pinctrl_rgmii1>;
+
+                       clock-names = "stmmaceth", "sti-ethclk";
+                       clocks = <&clk_s_c0_flexgen CLK_EXT2F_A9>,
+                                <&clk_s_c0_flexgen CLK_ETH_PHY>;
                };
 
                rng10: rng@08a89000 {
index 1683debd08545af577ed50fbd60271017f44efc5..a538ae52d32b7cbbd8272b6aeadc25f65bf65919 100644 (file)
@@ -53,7 +53,7 @@
                        reg = <0x0961f080 0x4>;
                        reg-names = "irqmux";
                        interrupts = <GIC_SPI 188 IRQ_TYPE_NONE>;
-                       interrupts-names = "irqmux";
+                       interrupt-names = "irqmux";
                        ranges = <0 0x09610000 0x6000>;
 
                        pio0: gpio@09610000 {
                                st,retime-pin-mask = <0x3f>;
                        };
 
+                       cec0 {
+                               pinctrl_cec0_default: cec0-default {
+                                       st,pins {
+                                               hdmi_cec = <&pio2 4 ALT1 BIDIR>;
+                                       };
+                               };
+                       };
+
                        rc {
                                pinctrl_ir: ir0 {
                                        st,pins {
                                                ir = <&pio4 0 ALT2 IN>;
                                        };
                                };
+
+                               pinctrl_uhf: uhf0 {
+                                       st,pins {
+                                               ir = <&pio4 1 ALT2 IN>;
+                                       };
+                               };
+
+                               pinctrl_tx: tx0 {
+                                       st,pins {
+                                               tx = <&pio4 2 ALT2 OUT>;
+                                       };
+                               };
+
+                               pinctrl_tx_od: tx_od0 {
+                                       st,pins {
+                                               tx_od = <&pio4 3 ALT2 OUT>;
+                                       };
+                               };
                        };
 
                        /* SBC_ASC0 - UART10 */
                                                rxd2 = <&pio1 6 ALT1 IN DE_IO 0 CLK_A>;
                                                rxd3 = <&pio1 7 ALT1 IN DE_IO 0 CLK_A>;
                                                rxdv = <&pio2 0 ALT1 IN DE_IO 0 CLK_A>;
-                                               rxclk = <&pio2 2 ALT1 IN NICLK 500 CLK_A>;
+                                               rxclk = <&pio2 2 ALT1 IN NICLK 0 CLK_A>;
                                                clk125 = <&pio3 7 ALT4 IN NICLK 0 CLK_A>;
-                                               phyclk = <&pio2 3 ALT4 OUT NICLK 1750 CLK_B>;
+                                               phyclk = <&pio2 3 ALT4 OUT NICLK 1250 CLK_B>;
                                        };
                                };
 
                                                phyclk = <&pio2 3 ALT1 OUT NICLK 0 CLK_A>;
                                        };
                                };
+
+                               pinctrl_rmii1: rmii1-0 {
+                                       st,pins {
+                                               txd0 = <&pio0 0 ALT1 OUT SE_NICLK_IO 0 CLK_A>;
+                                               txd1 = <&pio0 1 ALT1 OUT SE_NICLK_IO 0 CLK_A>;
+                                               txen = <&pio0 5 ALT1 OUT SE_NICLK_IO 0 CLK_A>;
+                                               mdio = <&pio1 0 ALT1 OUT BYPASS 0>;
+                                               mdc = <&pio1 1 ALT1 OUT NICLK 0 CLK_A>;
+                                               mdint = <&pio1 3 ALT1 IN BYPASS 0>;
+                                               rxd0 = <&pio1 4 ALT1 IN SE_NICLK_IO 0 CLK_B>;
+                                               rxd1 = <&pio1 5 ALT1 IN SE_NICLK_IO 0 CLK_B>;
+                                               rxdv = <&pio2 0 ALT1 IN SE_NICLK_IO 0 CLK_B>;
+                                               rx_er = <&pio2 1 ALT1 IN SE_NICLK_IO 0 CLK_A>;
+                                       };
+                               };
+
+                               pinctrl_rmii1_phyclk: rmii1_phyclk {
+                                       st,pins {
+                                               phyclk = <&pio2 3 ALT1 OUT NICLK 0 CLK_A>;
+                                       };
+                               };
+
+                               pinctrl_rmii1_phyclk_ext: rmii1_phyclk_ext {
+                                       st,pins {
+                                               phyclk = <&pio2 3 ALT2 IN NICLK 0 CLK_A>;
+                                       };
+                               };
                        };
 
                        pwm1 {
                                        };
                                };
                        };
+
+                       spi10 {
+                               pinctrl_spi10_default: spi10-4w-alt1-0 {
+                                       st,pins {
+                                               mtsr = <&pio4 6 ALT1 OUT>;
+                                               mrst = <&pio4 7 ALT1 IN>;
+                                               scl = <&pio4 5 ALT1 OUT>;
+                                       };
+                               };
+
+                               pinctrl_spi10_3w_alt1_0: spi10-3w-alt1-0 {
+                                       st,pins {
+                                               mtsr = <&pio4 6 ALT1 BIDIR_PU>;
+                                               scl = <&pio4 5 ALT1 OUT>;
+                                       };
+                               };
+                       };
+
+                       spi11 {
+                               pinctrl_spi11_default: spi11-4w-alt2-0 {
+                                       st,pins {
+                                               mtsr = <&pio3 1 ALT2 OUT>;
+                                               mrst = <&pio3 0 ALT2 IN>;
+                                               scl = <&pio3 2 ALT2 OUT>;
+                                       };
+                               };
+
+                               pinctrl_spi11_3w_alt2_0: spi11-3w-alt2-0 {
+                                       st,pins {
+                                               mtsr = <&pio3 1 ALT2 BIDIR_PU>;
+                                               scl = <&pio3 2 ALT2 OUT>;
+                                       };
+                               };
+                       };
+
+                       spi12 {
+                               pinctrl_spi12_default: spi12-4w-alt2-0 {
+                                       st,pins {
+                                               mtsr = <&pio3 6 ALT2 OUT>;
+                                               mrst = <&pio3 4 ALT2 IN>;
+                                               scl = <&pio3 7 ALT2 OUT>;
+                                       };
+                               };
+
+                               pinctrl_spi12_3w_alt2_0: spi12-3w-alt2-0 {
+                                       st,pins {
+                                               mtsr = <&pio3 6 ALT2 BIDIR_PU>;
+                                               scl = <&pio3 7 ALT2 OUT>;
+                                       };
+                               };
+                       };
                };
 
                pin-controller-front0 {
                        reg = <0x0920f080 0x4>;
                        reg-names = "irqmux";
                        interrupts = <GIC_SPI 189 IRQ_TYPE_NONE>;
-                       interrupts-names = "irqmux";
+                       interrupt-names = "irqmux";
                        ranges = <0 0x09200000 0x10000>;
 
                        pio10: pio@09200000 {
                        };
 
                        i2c3 {
-                               pinctrl_i2c3_default: i2c3-default {
+                               pinctrl_i2c3_default: i2c3-alt1-0 {
                                        st,pins {
                                                sda = <&pio18 6 ALT1 BIDIR>;
                                                scl = <&pio18 5 ALT1 BIDIR>;
                                        };
                                };
+                               pinctrl_i2c3_alt1_1: i2c3-alt1-1 {
+                                       st,pins {
+                                               sda = <&pio17 7 ALT1 BIDIR>;
+                                               scl = <&pio17 6 ALT1 BIDIR>;
+                                       };
+                               };
+                               pinctrl_i2c3_alt3_0: i2c3-alt3-0 {
+                                       st,pins {
+                                               sda = <&pio13 6 ALT3 BIDIR>;
+                                               scl = <&pio13 5 ALT3 BIDIR>;
+                                       };
+                               };
                        };
 
                        spi0 {
-                               pinctrl_spi0_default: spi0-default {
+                               pinctrl_spi0_default: spi0-4w-alt2-0 {
+                                       st,pins {
+                                               mtsr = <&pio10 6 ALT2 OUT>;
+                                               mrst = <&pio10 7 ALT2 IN>;
+                                               scl = <&pio10 5 ALT2 OUT>;
+                                       };
+                               };
+
+                               pinctrl_spi0_3w_alt2_0: spi0-3w-alt2-0 {
+                                       st,pins {
+                                               mtsr = <&pio10 6 ALT2 BIDIR_PU>;
+                                               scl = <&pio10 5 ALT2 OUT>;
+                                       };
+                               };
+
+                               pinctrl_spi0_4w_alt1_0: spi0-4w-alt1-0 {
+                                       st,pins {
+                                               mtsr = <&pio19 7 ALT1 OUT>;
+                                               mrst = <&pio19 5 ALT1 IN>;
+                                               scl = <&pio19 6 ALT1 OUT>;
+                                       };
+                               };
+
+                               pinctrl_spi0_3w_alt1_0: spi0-3w-alt1-0 {
+                                       st,pins {
+                                               mtsr = <&pio19 7 ALT1 BIDIR_PU>;
+                                               scl = <&pio19 6 ALT1 OUT>;
+                                       };
+                               };
+                       };
+
+                       spi1 {
+                               pinctrl_spi1_default: spi1-4w-alt2-0 {
+                                       st,pins {
+                                               mtsr = <&pio11 1 ALT2 OUT>;
+                                               mrst = <&pio11 2 ALT2 IN>;
+                                               scl = <&pio11 0 ALT2 OUT>;
+                                       };
+                               };
+
+                               pinctrl_spi1_3w_alt2_0: spi1-3w-alt2-0 {
+                                       st,pins {
+                                               mtsr = <&pio11 1 ALT2 BIDIR_PU>;
+                                               scl = <&pio11 0 ALT2 OUT>;
+                                       };
+                               };
+
+                               pinctrl_spi1_4w_alt1_0: spi1-4w-alt1-0 {
                                        st,pins {
-                                               mtsr = <&pio12 6 ALT2 BIDIR>;
-                                               mrst = <&pio12 7 ALT2 BIDIR>;
-                                               scl = <&pio12 5 ALT2 BIDIR>;
+                                               mtsr = <&pio14 3 ALT1 OUT>;
+                                               mrst = <&pio14 4 ALT1 IN>;
+                                               scl = <&pio14 2 ALT1 OUT>;
+                                       };
+                               };
+
+                               pinctrl_spi1_3w_alt1_0: spi1-3w-alt1-0 {
+                                       st,pins {
+                                               mtsr = <&pio14 3 ALT1 BIDIR_PU>;
+                                               scl = <&pio14 2 ALT1 OUT>;
+                                       };
+                               };
+                       };
+
+                       spi2 {
+                               pinctrl_spi2_default: spi2-4w-alt2-0 {
+                                       st,pins {
+                                               mtsr = <&pio12 6 ALT2 OUT>;
+                                               mrst = <&pio12 7 ALT2 IN>;
+                                               scl = <&pio12 5 ALT2 OUT>;
+                                       };
+                               };
+
+                               pinctrl_spi2_3w_alt2_0: spi2-3w-alt2-0 {
+                                       st,pins {
+                                               mtsr = <&pio12 6 ALT2 BIDIR_PU>;
+                                               scl = <&pio12 5 ALT2 OUT>;
+                                       };
+                               };
+
+                               pinctrl_spi2_4w_alt1_0: spi2-4w-alt1-0 {
+                                       st,pins {
+                                               mtsr = <&pio14 6 ALT1 OUT>;
+                                               mrst = <&pio14 7 ALT1 IN>;
+                                               scl = <&pio14 5 ALT1 OUT>;
+                                       };
+                               };
+
+                               pinctrl_spi2_3w_alt1_0: spi2-3w-alt1-0 {
+                                       st,pins {
+                                               mtsr = <&pio14 6 ALT1 BIDIR_PU>;
+                                               scl = <&pio14 5 ALT1 OUT>;
+                                       };
+                               };
+
+                               pinctrl_spi2_4w_alt2_1: spi2-4w-alt2-1 {
+                                       st,pins {
+                                               mtsr = <&pio15 6 ALT2 OUT>;
+                                               mrst = <&pio15 7 ALT2 IN>;
+                                               scl = <&pio15 5 ALT2 OUT>;
+                                       };
+                               };
+
+                               pinctrl_spi2_3w_alt2_1: spi2-3w-alt2-1 {
+                                       st,pins {
+                                               mtsr = <&pio15 6 ALT2 BIDIR_PU>;
+                                               scl = <&pio15 5 ALT2 OUT>;
+                                       };
+                               };
+                       };
+
+                       spi3 {
+                               pinctrl_spi3_default: spi3-4w-alt3-0 {
+                                       st,pins {
+                                               mtsr = <&pio13 6 ALT3 OUT>;
+                                               mrst = <&pio13 7 ALT3 IN>;
+                                               scl = <&pio13 5 ALT3 OUT>;
+                                       };
+                               };
+
+                               pinctrl_spi3_3w_alt3_0: spi3-3w-alt3-0 {
+                                       st,pins {
+                                               mtsr = <&pio13 6 ALT3 BIDIR_PU>;
+                                               scl = <&pio13 5 ALT3 OUT>;
+                                       };
+                               };
+
+                               pinctrl_spi3_4w_alt1_0: spi3-4w-alt1-0 {
+                                       st,pins {
+                                               mtsr = <&pio17 7 ALT1 OUT>;
+                                               mrst = <&pio17 5 ALT1 IN>;
+                                               scl = <&pio17 6 ALT1 OUT>;
+                                       };
+                               };
+
+                               pinctrl_spi3_3w_alt1_0: spi3-3w-alt1-0 {
+                                       st,pins {
+                                               mtsr = <&pio17 7 ALT1 BIDIR_PU>;
+                                               scl = <&pio17 6 ALT1 OUT>;
+                                       };
+                               };
+
+                               pinctrl_spi3_4w_alt1_1: spi3-4w-alt1-1 {
+                                       st,pins {
+                                               mtsr = <&pio18 6 ALT1 OUT>;
+                                               mrst = <&pio18 7 ALT1 IN>;
+                                               scl = <&pio18 5 ALT1 OUT>;
+                                       };
+                               };
+
+                               pinctrl_spi3_3w_alt1_1: spi3-3w-alt1-1 {
+                                       st,pins {
+                                               mtsr = <&pio18 6 ALT1 BIDIR_PU>;
+                                               scl = <&pio18 5 ALT1 OUT>;
                                        };
                                };
                        };
                                        };
                                };
                        };
+
+                       systrace {
+                               pinctrl_systrace_default: systrace-default {
+                                       st,pins {
+                                               trc_data0 = <&pio11 3 ALT5 OUT>;
+                                               trc_data1 = <&pio11 4 ALT5 OUT>;
+                                               trc_data2 = <&pio11 5 ALT5 OUT>;
+                                               trc_data3 = <&pio11 6 ALT5 OUT>;
+                                               trc_clk   = <&pio11 7 ALT5 OUT>;
+                                       };
+                               };
+                       };
                };
 
                pin-controller-front1 {
                        reg = <0x0921f080 0x4>;
                        reg-names = "irqmux";
                        interrupts = <GIC_SPI 190 IRQ_TYPE_NONE>;
-                       interrupts-names = "irqmux";
+                       interrupt-names = "irqmux";
                        ranges = <0 0x09210000 0x10000>;
 
                        tsin4 {
                        reg = <0x0922f080 0x4>;
                        reg-names = "irqmux";
                        interrupts = <GIC_SPI 191 IRQ_TYPE_NONE>;
-                       interrupts-names = "irqmux";
+                       interrupt-names = "irqmux";
                        ranges = <0 0x09220000 0x6000>;
 
                        pio30: gpio@09220000 {
                                        };
                                };
                        };
+
+                       spi4 {
+                               pinctrl_spi4_default: spi4-4w-alt1-0 {
+                                       st,pins {
+                                               mtsr = <&pio30 1 ALT1 OUT>;
+                                               mrst = <&pio30 2 ALT1 IN>;
+                                               scl = <&pio30 0 ALT1 OUT>;
+                                       };
+                               };
+
+                               pinctrl_spi4_3w_alt1_0: spi4-3w-alt1-0 {
+                                       st,pins {
+                                               mtsr = <&pio30 1 ALT1 BIDIR_PU>;
+                                               scl = <&pio30 0 ALT1 OUT>;
+                                       };
+                               };
+
+                               pinctrl_spi4_4w_alt3_0: spi4-4w-alt3-0 {
+                                       st,pins {
+                                               mtsr = <&pio34 1 ALT3 OUT>;
+                                               mrst = <&pio34 2 ALT3 IN>;
+                                               scl = <&pio34 0 ALT3 OUT>;
+                                       };
+                               };
+
+                               pinctrl_spi4_3w_alt3_0: spi4-3w-alt3-0 {
+                                       st,pins {
+                                               mtsr = <&pio34 1 ALT3 BIDIR_PU>;
+                                               scl = <&pio34 0 ALT3 OUT>;
+                                       };
+                               };
+                       };
+
+                       serial3 {
+                               pinctrl_serial3: serial3-0 {
+                                       st,pins {
+                                               tx = <&pio31 3 ALT1 OUT>;
+                                               rx = <&pio31 4 ALT1 IN>;
+                                       };
+                               };
+                       };
                };
 
                pin-controller-flash {
                                                emmc_d7 = <&pio41 7 ALT1 BIDIR_PU>;
                                        };
                                };
+                               pinctrl_sd0: sd0-0 {
+                                       st,pins {
+                                               sd_clk = <&pio40 6 ALT1 BIDIR>;
+                                               sd_cmd = <&pio40 7 ALT1 BIDIR_PU>;
+                                               sd_dat0 = <&pio41 0 ALT1 BIDIR_PU>;
+                                               sd_dat1 = <&pio41 1 ALT1 BIDIR_PU>;
+                                               sd_dat2 = <&pio41 2 ALT1 BIDIR_PU>;
+                                               sd_dat3 = <&pio41 3 ALT1 BIDIR_PU>;
+                                               sd_led = <&pio42 0 ALT2 OUT>;
+                                               sd_pwren = <&pio42 2 ALT2 OUT>;
+                                               sd_vsel = <&pio42 3 ALT2 OUT>;
+                                               sd_cd = <&pio42 4 ALT2 IN>;
+                                               sd_wp = <&pio42 5 ALT2 IN>;
+                                       };
+                               };
+                       };
+
+                       fsm {
+                               pinctrl_fsm: fsm {
+                                       st,pins {
+                                               spi-fsm-clk = <&pio40 1 ALT1 OUT>;
+                                               spi-fsm-cs = <&pio40 0 ALT1 OUT>;
+                                               spi-fsm-mosi = <&pio40 2 ALT1 OUT>;
+                                               spi-fsm-miso = <&pio40 3 ALT1 IN>;
+                                               spi-fsm-hol = <&pio40 5 ALT1 OUT>;
+                                               spi-fsm-wp = <&pio40 4 ALT1 OUT>;
+                                       };
+                               };
+                       };
+
+                       nand {
+                               pinctrl_nand: nand {
+                                       st,pins {
+                                               nand_cs1 = <&pio40 6 ALT3 OUT>;
+                                               nand_cs0 = <&pio40 7 ALT3 OUT>;
+                                               nand_d0 = <&pio41 0 ALT3 BIDIR>;
+                                               nand_d1 = <&pio41 1 ALT3 BIDIR>;
+                                               nand_d2 = <&pio41 2 ALT3 BIDIR>;
+                                               nand_d3 = <&pio41 3 ALT3 BIDIR>;
+                                               nand_d4 = <&pio41 4 ALT3 BIDIR>;
+                                               nand_d5 = <&pio41 5 ALT3 BIDIR>;
+                                               nand_d6 = <&pio41 6 ALT3 BIDIR>;
+                                               nand_d7 = <&pio41 7 ALT3 BIDIR>;
+                                               nand_we = <&pio42 0 ALT3 OUT>;
+                                               nand_dqs = <&pio42 1 ALT3 OUT>;
+                                               nand_ale = <&pio42 2 ALT3 OUT>;
+                                               nand_cle = <&pio42 3 ALT3 OUT>;
+                                               nand_rnb = <&pio42 4 ALT3 IN>;
+                                               nand_oe = <&pio42 5 ALT3 OUT>;
+                                       };
+                               };
                        };
                };
        };
index 6b914e4bb0994de2a60327972329fb3d9010b627..d60f0d8add2661647a6a3ad27e9a60151e50032c 100644 (file)
 #include "stih407-family.dtsi"
 / {
        soc {
-               /* Display */
-               vtg_main: sti-vtg-main@8d02800 {
-                       compatible = "st,vtg";
-                       reg = <0x8d02800 0x200>;
-                       interrupts = <GIC_SPI 108 IRQ_TYPE_NONE>;
-               };
-
-               vtg_aux: sti-vtg-aux@8d00200 {
-                       compatible = "st,vtg";
-                       reg = <0x8d00200 0x100>;
-                       interrupts = <GIC_SPI 109 IRQ_TYPE_NONE>;
-               };
-
                sti-display-subsystem {
                        compatible = "st,sti-display-subsystem";
                        #address-cells = <1>;
index 16f02c5e33a4682b690dc21288e0f6d88e4e9e3e..118ac284fc4b65f50e2a5479171b90cde498faeb 100644 (file)
@@ -25,6 +25,7 @@
 
        aliases {
                ttyAS0 = &sbc_serial0;
+               ethernet0 = &ethernet0;
        };
 
        soc {
                        sd-uhs-sdr104;
                        sd-uhs-ddr50;
                };
+
+               usb2_picophy1: phy2 {
+                       status = "okay";
+               };
+
+               usb2_picophy2: phy3 {
+                       status = "okay";
+               };
+
+               ohci0: usb@9a03c00 {
+                       status = "okay";
+               };
+
+               ehci0: usb@9a03e00 {
+                       status = "okay";
+               };
+
+               ohci1: usb@9a83c00 {
+                       status = "okay";
+               };
+
+               ehci1: usb@9a83e00 {
+                       status = "okay";
+               };
        };
 };
index 8c6e61a272346a0d5573c3c57475f9b338ca7219..18ed1ad10d32bbb251746e3011c541f9cfcbc861 100644 (file)
@@ -22,6 +22,8 @@
                        resets = <&softreset STIH407_PICOPHY_SOFTRESET>,
                                 <&picophyreset STIH407_PICOPHY0_RESET>;
                        reset-names = "global", "port";
+
+                       status = "disabled";
                };
 
                usb2_picophy2: phy3 {
@@ -31,6 +33,8 @@
                        resets = <&softreset STIH407_PICOPHY_SOFTRESET>,
                                 <&picophyreset STIH407_PICOPHY1_RESET>;
                        reset-names = "global", "port";
+
+                       status = "disabled";
                };
 
                ohci0: usb@9a03c00 {
@@ -43,6 +47,8 @@
                        reset-names = "power", "softreset";
                        phys = <&usb2_picophy1>;
                        phy-names = "usb";
+
+                       status = "disabled";
                };
 
                ehci0: usb@9a03e00 {
@@ -57,6 +63,8 @@
                        reset-names = "power", "softreset";
                        phys = <&usb2_picophy1>;
                        phy-names = "usb";
+
+                       status = "disabled";
                };
 
                ohci1: usb@9a83c00 {
@@ -69,6 +77,8 @@
                        reset-names = "power", "softreset";
                        phys = <&usb2_picophy2>;
                        phy-names = "usb";
+
+                       status = "disabled";
                };
 
                ehci1: usb@9a83e00 {
                        reset-names = "power", "softreset";
                        phys = <&usb2_picophy2>;
                        phy-names = "usb";
-               };
-
-               /* Display */
-               vtg_main: sti-vtg-main@8d02800 {
-                       compatible = "st,vtg";
-                       reg = <0x8d02800 0x200>;
-                       interrupts = <GIC_SPI 108 IRQ_TYPE_NONE>;
-               };
 
-               vtg_aux: sti-vtg-aux@8d00200 {
-                       compatible = "st,vtg";
-                       reg = <0x8d00200 0x100>;
-                       interrupts = <GIC_SPI 109 IRQ_TYPE_NONE>;
+                       status = "disabled";
                };
 
                sti-display-subsystem {
index 82eee39ccb310b79d1079a59c4adc9f77b16622f..772d2bb07e5f91c8a27156744601a6eb682679d7 100644 (file)
@@ -24,6 +24,7 @@
 
        aliases {
                ttyAS0 = &sbc_serial0;
+               ethernet0 = &ethernet0;
        };
 
        soc {
                st_dwc3: dwc3@8f94000 {
                        status = "okay";
                };
+
+               ethernet0: dwmac@9630000 {
+                       st,tx-retime-src = "clkgen";
+                       status = "okay";
+                       phy-mode = "rgmii";
+                       fixed-link = <0 1 1000 0 0>;
+               };
        };
 };
index 148e1772465f7f6f04995641f2b206d4de29eb10..ae6d9978ea19ad88a0c5bfcdee2d3129bc1c0ee0 100644 (file)
@@ -44,7 +44,7 @@
 
                        clockgen_a9_pll: clockgen-a9-pll {
                                #clock-cells = <1>;
-                               compatible = "st,stih407-plls-c32-a9", "st,clkgen-plls-c32";
+                               compatible = "st,stih418-plls-c28-a9", "st,clkgen-plls-c32";
 
                                clocks = <&clk_sysin>;
 
index 8160a75539a4e56a10bc814d92f47c277acf1b9f..965f88160718ebe5b224f48acaf55175151a7e91 100644 (file)
                        phys = <&usb2_picophy2>;
                        phy-names = "usb";
                };
+
+               mmc0: sdhci@09060000 {
+                       assigned-clocks = <&clk_s_c0_flexgen CLK_MMC_0>;
+                       assigned-clock-parents = <&clk_s_c0_pll1 0>;
+                       assigned-clock-rates = <200000000>;
+               };
        };
 };
index f589fe487f13f2ad41af93506ed9c968c8398150..ad21a4293a339c28446056b189e6c3059266c15c 100644 (file)
                        };
                };
 
+               pwm0: pwm@9810000 {
+                       status = "okay";
+               };
+
+               pwm1: pwm@9510000 {
+                       status = "okay";
+               };
+
                i2c@9842000 {
                        status = "okay";
                };
                        status = "okay";
                };
 
+               ethernet0: dwmac@9630000 {
+                       st,tx-retime-src = "clkgen";
+                       status = "okay";
+                       phy-mode = "rgmii";
+                       fixed-link = <0 1 1000 0 0>;
+               };
        };
 };
index 2630d78d9e0456b58039723151ca26128c6065d4..97570cb7f2fcdb37cac323d3da1529a246314d2c 100644 (file)
        status = "okay";
 };
 
+&codec {
+       status = "okay";
+};
+
 &ehci0 {
        status = "okay";
 };
index 1430568726501e6283cca376d8619a548952f27c..53660894ea95ebb953446caf650f43526e0f7a8a 100644 (file)
        };
 };
 
+&i2c1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c1_pins_a>;
+       status = "okay";
+};
+
+&i2c2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c2_pins_a>;
+       status = "okay";
+};
+
 &lradc {
        vref-supply = <&reg_vcc3v0>;
        status = "okay";
index 046a84d9719d6cffb34e76398b359567a6134668..710e2ef516a8da080e77664d3d523ab5e9209edb 100644 (file)
        status = "okay";
 };
 
+&codec {
+       status = "okay";
+};
+
 &cpu0 {
        cpu-supply = <&reg_dcdc2>;
 };
index 570754d8df67750a77325aa01d5c21397e486841..3f0aeb8288cd2364ab16cdae8211ddd978adda92 100644 (file)
@@ -47,6 +47,7 @@
 #include "sunxi-common-regulators.dtsi"
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
+#include <dt-bindings/interrupt-controller/irq.h>
 
 / {
        model = "Gemei G9 Tablet";
@@ -64,7 +65,7 @@
 /*
  * TODO:
  *   2x cameras via CSI
- *   bma250 IRQs
+ *   audio
  *   AXP battery management
  *   NAND
  *   OTG
        bma250@18 {
                compatible = "bosch,bma250";
                reg = <0x18>;
-
-               /*
-                * TODO: interrupt pins:
-                * int1 - PH00
-                * int2 - PI10
-                */
+               interrupt-parent = <&pio>;
+               interrupts = <7 0 IRQ_TYPE_EDGE_RISING>; /* PH00 / EINT0 */
        };
 };
 
diff --git a/arch/arm/boot/dts/sun4i-a10-inet1.dts b/arch/arm/boot/dts/sun4i-a10-inet1.dts
new file mode 100644 (file)
index 0000000..487ce63
--- /dev/null
@@ -0,0 +1,226 @@
+/*
+ * Copyright 2015 Hans de Goede <hdegoede@redhat.com>
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This file 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; either version 2 of the
+ *     License, or (at your option) any later version.
+ *
+ *     This file is distributed in the hope that it will be useful,
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ * Or, alternatively,
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use,
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/dts-v1/;
+#include "sun4i-a10.dtsi"
+#include "sunxi-common-regulators.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+#include <dt-bindings/pinctrl/sun4i-a10.h>
+
+/ {
+       model = "iNet-1";
+       compatible = "inet-tek,inet1", "allwinner,sun4i-a10";
+
+       aliases {
+               serial0 = &uart0;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+};
+
+&cpu0 {
+       cpu-supply = <&reg_dcdc2>;
+};
+
+&ehci0  {
+       status = "okay";
+};
+
+&ehci1 {
+       status = "okay";
+};
+
+&i2c0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c0_pins_a>;
+       status = "okay";
+
+       axp209: pmic@34 {
+               reg = <0x34>;
+               interrupts = <0>;
+       };
+};
+
+#include "axp209.dtsi"
+
+&i2c1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c1_pins_a>;
+       status = "okay";
+
+       /* Accelerometer */
+       bma250@18 {
+               compatible = "bosch,bma250";
+               reg = <0x18>;
+               interrupt-parent = <&pio>;
+               interrupts = <7 0 IRQ_TYPE_EDGE_RISING>; /* PH0 / EINT0 */
+       };
+};
+
+&i2c2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c2_pins_a>;
+       status = "okay";
+};
+
+&lradc {
+       vref-supply = <&reg_ldo2>;
+       status = "okay";
+
+       button@200 {
+               label = "Volume Up";
+               linux,code = <KEY_VOLUMEUP>;
+               channel = <0>;
+               voltage = <200000>;
+       };
+
+       button@1000 {
+               label = "Volume Down";
+               linux,code = <KEY_VOLUMEDOWN>;
+               channel = <0>;
+               voltage = <1000000>;
+       };
+
+       button@1200 {
+               label = "Home";
+               linux,code = <KEY_HOMEPAGE>;
+               channel = <0>;
+               voltage = <1200000>;
+       };
+};
+
+&mmc0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>;
+       vmmc-supply = <&reg_vcc3v3>;
+       bus-width = <4>;
+       cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */
+       cd-inverted;
+       status = "okay";
+};
+
+&ohci0  {
+       status = "okay";
+};
+
+&otg_sram {
+       status = "okay";
+};
+
+&pio {
+       usb0_id_detect_pin: usb0_id_detect_pin@0 {
+               allwinner,pins = "PH4";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+       };
+
+       usb0_vbus_detect_pin: usb0_vbus_detect_pin@0 {
+               allwinner,pins = "PH5";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_PULL_DOWN>;
+       };
+};
+
+&reg_dcdc2 {
+       regulator-always-on;
+       regulator-min-microvolt = <1000000>;
+       regulator-max-microvolt = <1400000>;
+       regulator-name = "vdd-cpu";
+};
+
+&reg_dcdc3 {
+       regulator-always-on;
+       regulator-min-microvolt = <1250000>;
+       regulator-max-microvolt = <1250000>;
+       regulator-name = "vdd-int-dll";
+};
+
+&reg_ldo1 {
+       regulator-name = "vdd-rtc";
+};
+
+&reg_ldo2 {
+       regulator-always-on;
+       regulator-min-microvolt = <3000000>;
+       regulator-max-microvolt = <3000000>;
+       regulator-name = "avcc";
+};
+
+&reg_usb0_vbus {
+       status = "okay";
+};
+
+&reg_usb1_vbus {
+       status = "okay";
+};
+
+&reg_usb2_vbus {
+       status = "okay";
+};
+
+&uart0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart0_pins_a>;
+       status = "okay";
+};
+
+&usb_otg {
+       dr_mode = "otg";
+       status = "okay";
+};
+
+&usbphy {
+       pinctrl-names = "default";
+       pinctrl-0 = <&usb0_id_detect_pin>, <&usb0_vbus_detect_pin>;
+       usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
+       usb0_vbus_det-gpio = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH5 */
+       usb0_vbus-supply = <&reg_usb0_vbus>;
+       usb1_vbus-supply = <&reg_usb1_vbus>;
+       usb2_vbus-supply = <&reg_usb2_vbus>;
+       status = "okay";
+};
index 6c927a824ba20f4ac9f9c89b484fe978618a6cdc..77c31dab86b137d44fac84aec557587b0b594fe7 100644 (file)
@@ -47,6 +47,7 @@
 #include "sunxi-common-regulators.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
 
 / {
        model = "INet-97F Rev 02";
@@ -61,8 +62,8 @@
        };
 };
 
-&ehci0 {
-       status = "okay";
+&cpu0 {
+       cpu-supply = <&reg_dcdc2>;
 };
 
 &ehci1 {
        status = "okay";
 
        axp209: pmic@34 {
-               compatible = "x-powers,axp209";
                reg = <0x34>;
                interrupts = <0>;
+       };
+};
+
+#include "axp209.dtsi"
+
+&i2c1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c1_pins_a>;
+       status = "okay";
+};
+
+&i2c2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c2_pins_a>;
+       status = "okay";
+};
+
+&lradc {
+       vref-supply = <&reg_ldo2>;
+       status = "okay";
+
+       button@200 {
+               label = "Menu";
+               linux,code = <KEY_MENU>;
+               channel = <0>;
+               voltage = <200000>;
+       };
+
+       button@600 {
+               label = "Volume Up";
+               linux,code = <KEY_VOLUMEUP>;
+               channel = <0>;
+               voltage = <600000>;
+       };
+
+       button@800 {
+               label = "Volume Down";
+               linux,code = <KEY_VOLUMEDOWN>;
+               channel = <0>;
+               voltage = <800000>;
+       };
+
+       button@1000 {
+               label = "Home";
+               linux,code = <KEY_HOMEPAGE>;
+               channel = <0>;
+               voltage = <1000000>;
+       };
 
-               interrupt-controller;
-               #interrupt-cells = <1>;
+       button@1200 {
+               label = "Esc";
+               linux,code = <KEY_ESC>;
+               channel = <0>;
+               voltage = <1200000>;
        };
 };
 
        status = "okay";
 };
 
-&ohci0 {
+&otg_sram {
        status = "okay";
 };
 
-&ohci1 {
-       status = "okay";
+&pio {
+       usb0_id_detect_pin: usb0_id_detect_pin@0 {
+               allwinner,pins = "PH4";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+       };
+
+       usb0_vbus_detect_pin: usb0_vbus_detect_pin@0 {
+               allwinner,pins = "PH5";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_PULL_DOWN>;
+       };
 };
 
-&reg_usb1_vbus {
+&reg_dcdc2 {
+       regulator-always-on;
+       regulator-min-microvolt = <1000000>;
+       regulator-max-microvolt = <1400000>;
+       regulator-name = "vdd-cpu";
+};
+
+&reg_dcdc3 {
+       regulator-always-on;
+       regulator-min-microvolt = <1250000>;
+       regulator-max-microvolt = <1250000>;
+       regulator-name = "vdd-int-dll";
+};
+
+&reg_ldo1 {
+       regulator-name = "vdd-rtc";
+};
+
+&reg_ldo2 {
+       regulator-always-on;
+       regulator-min-microvolt = <3000000>;
+       regulator-max-microvolt = <3000000>;
+       regulator-name = "avcc";
+};
+
+&reg_usb0_vbus {
        status = "okay";
 };
 
        status = "okay";
 };
 
+&usb_otg {
+       dr_mode = "otg";
+       status = "okay";
+};
+
 &usbphy {
-       usb1_vbus-supply = <&reg_usb1_vbus>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&usb0_id_detect_pin>, <&usb0_vbus_detect_pin>;
+       usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
+       usb0_vbus_det-gpio = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH5 */
+       usb0_vbus-supply = <&reg_usb0_vbus>;
        usb2_vbus-supply = <&reg_usb2_vbus>;
        status = "okay";
 };
diff --git a/arch/arm/boot/dts/sun4i-a10-inet9f-rev03.dts b/arch/arm/boot/dts/sun4i-a10-inet9f-rev03.dts
new file mode 100644 (file)
index 0000000..2fffc04
--- /dev/null
@@ -0,0 +1,227 @@
+/*
+ * Copyright 2015 Hans de Goede <hdegoede@redhat.com>
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This file 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; either version 2 of the
+ *     License, or (at your option) any later version.
+ *
+ *     This file is distributed in the hope that it will be useful,
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ * Or, alternatively,
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use,
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/dts-v1/;
+#include "sun4i-a10.dtsi"
+#include "sunxi-common-regulators.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+#include <dt-bindings/pinctrl/sun4i-a10.h>
+
+/ {
+       model = "iNet-9F Rev 03";
+       compatible = "inet-tek,inet9f-rev03", "allwinner,sun4i-a10";
+
+       aliases {
+               serial0 = &uart0;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+};
+
+&cpu0 {
+       cpu-supply = <&reg_dcdc2>;
+};
+
+&ehci1 {
+       status = "okay";
+};
+
+&i2c0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c0_pins_a>;
+       status = "okay";
+
+       axp209: pmic@34 {
+               reg = <0x34>;
+               interrupts = <0>;
+       };
+};
+
+#include "axp209.dtsi"
+
+&i2c1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c1_pins_a>;
+       status = "okay";
+
+       /* Accelerometer */
+       bma250@18 {
+               compatible = "bosch,bma250";
+               reg = <0x18>;
+               interrupt-parent = <&pio>;
+               interrupts = <7 0 IRQ_TYPE_EDGE_RISING>; /* PH0 / EINT0 */
+       };
+};
+
+&i2c2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c2_pins_a>;
+       status = "okay";
+};
+
+&lradc {
+       vref-supply = <&reg_ldo2>;
+       status = "okay";
+
+       button@200 {
+               label = "Menu";
+               linux,code = <KEY_MENU>;
+               channel = <0>;
+               voltage = <200000>;
+       };
+
+       button@600 {
+               label = "Volume Up";
+               linux,code = <KEY_VOLUMEUP>;
+               channel = <0>;
+               voltage = <600000>;
+       };
+
+       button@800 {
+               label = "Volume Down";
+               linux,code = <KEY_VOLUMEDOWN>;
+               channel = <0>;
+               voltage = <800000>;
+       };
+
+       button@1000 {
+               label = "Home";
+               linux,code = <KEY_HOMEPAGE>;
+               channel = <0>;
+               voltage = <1000000>;
+       };
+
+       button@1200 {
+               label = "Esc";
+               linux,code = <KEY_ESC>;
+               channel = <0>;
+               voltage = <1200000>;
+       };
+};
+
+&mmc0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>;
+       vmmc-supply = <&reg_vcc3v3>;
+       bus-width = <4>;
+       cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */
+       cd-inverted;
+       status = "okay";
+};
+
+&otg_sram {
+       status = "okay";
+};
+
+&pio {
+       usb0_id_detect_pin: usb0_id_detect_pin@0 {
+               allwinner,pins = "PH4";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+       };
+
+       usb0_vbus_detect_pin: usb0_vbus_detect_pin@0 {
+               allwinner,pins = "PH5";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_PULL_DOWN>;
+       };
+};
+
+&reg_dcdc2 {
+       regulator-always-on;
+       regulator-min-microvolt = <1000000>;
+       regulator-max-microvolt = <1400000>;
+       regulator-name = "vdd-cpu";
+};
+
+&reg_dcdc3 {
+       regulator-always-on;
+       regulator-min-microvolt = <1250000>;
+       regulator-max-microvolt = <1250000>;
+       regulator-name = "vdd-int-dll";
+};
+
+&reg_ldo1 {
+       regulator-name = "vdd-rtc";
+};
+
+&reg_ldo2 {
+       regulator-always-on;
+       regulator-min-microvolt = <3000000>;
+       regulator-max-microvolt = <3000000>;
+       regulator-name = "avcc";
+};
+
+&reg_usb0_vbus {
+       status = "okay";
+};
+
+&reg_usb2_vbus {
+       status = "okay";
+};
+
+&uart0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart0_pins_a>;
+       status = "okay";
+};
+
+&usb_otg {
+       dr_mode = "otg";
+       status = "okay";
+};
+
+&usbphy {
+       pinctrl-names = "default";
+       pinctrl-0 = <&usb0_id_detect_pin>, <&usb0_vbus_detect_pin>;
+       usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
+       usb0_vbus_det-gpio = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH5 */
+       usb0_vbus-supply = <&reg_usb0_vbus>;
+       usb2_vbus-supply = <&reg_usb2_vbus>;
+       status = "okay";
+};
index dc2f2aeaff07895c999d354bcd294e376d785058..7afc7a64eef1df3e0af47f01b2a26f9f34cefd37 100644 (file)
        status = "okay";
 };
 
+&otg_sram {
+       status = "okay";
+};
+
 &pio {
        emac_power_pin_q5: emac_power_pin@0 {
                allwinner,pins = "PH19";
        };
 };
 
+&reg_usb0_vbus {
+       regulator-boot-on;
+       status = "okay";
+};
+
 &reg_usb1_vbus {
        status = "okay";
 };
        status = "okay";
 };
 
+&usb_otg {
+       dr_mode = "host";
+       status = "okay";
+};
+
 &usbphy {
+       usb0_vbus-supply = <&reg_usb0_vbus>;
        usb1_vbus-supply = <&reg_usb1_vbus>;
        usb2_vbus-supply = <&reg_usb2_vbus>;
        status = "okay";
index 02158bcd64ee50c19cd45d845f666c52c496484d..8e50723dbe02bae14fed5785547dc229dc061d9e 100644 (file)
        status = "okay";
 };
 
+&codec {
+       status = "okay";
+};
+
 &ehci0 {
        status = "okay";
 };
        status = "okay";
 };
 
+&otg_sram {
+       status = "okay";
+};
+
 &pio {
        led_pins_marsboard: led_pins@0 {
                allwinner,pins = "PB5", "PB6", "PB7", "PB8";
                allwinner,drive = <SUN4I_PINCTRL_10_MA>;
                allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
        };
+
+       usb0_id_detect_pin: usb0_id_detect_pin@0 {
+               allwinner,pins = "PH4";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+       };
 };
 
 &reg_usb1_vbus {
        status = "okay";
 };
 
+&usb_otg {
+       dr_mode = "otg";
+       status = "okay";
+};
+
 &usbphy {
+       pinctrl-names = "default";
+       pinctrl-0 = <&usb0_id_detect_pin>;
+       usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
        usb1_vbus-supply = <&reg_usb1_vbus>;
        usb2_vbus-supply = <&reg_usb2_vbus>;
        status = "okay";
index 28e32ad705cd25848e087f1ee4a9ad08c986740d..b350448c7217c0f959e2efb0ec08f95c615276cb 100644 (file)
        };
 };
 
+&i2c1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c1_pins_a>;
+       status = "okay";
+
+       eeprom: eeprom@50 {
+               compatible = "atmel,24c16";
+               reg = <0x50>;
+               pagesize = <16>;
+       };
+};
+
 &mdio {
        status = "okay";
 
index 4e3e1b9d8217e356c9c11953ff84eb2eee4f48ad..39034aa8e1ae8c65fd3a051e5a328fbb7e5abaeb 100644 (file)
        };
 };
 
+&cpu0 {
+       cpu-supply = <&reg_dcdc2>;
+};
+
 &ehci0 {
        status = "okay";
 };
        status = "okay";
 
        axp209: pmic@34 {
-               compatible = "x-powers,axp209";
                reg = <0x34>;
                interrupts = <0>;
-
-               interrupt-controller;
-               #interrupt-cells = <1>;
        };
 };
 
        status = "okay";
 };
 
+&otg_sram {
+       status = "okay";
+};
+
 &pio {
        led_pins_pcduino: led_pins@0 {
                allwinner,pins = "PH15", "PH16";
                allwinner,drive = <SUN4I_PINCTRL_10_MA>;
                allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
        };
+
+       usb0_id_detect_pin: usb0_id_detect_pin@0 {
+               allwinner,pins = "PH4";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+       };
 };
 
-&reg_usb1_vbus {
-       status = "okay";
+#include "axp209.dtsi"
+
+&reg_dcdc2 {
+       regulator-always-on;
+       regulator-min-microvolt = <1000000>;
+       regulator-max-microvolt = <1400000>;
+       regulator-name = "vdd-cpu";
 };
 
-&reg_usb2_vbus {
-       status = "okay";
+&reg_dcdc3 {
+       regulator-always-on;
+       regulator-min-microvolt = <1000000>;
+       regulator-max-microvolt = <1400000>;
+       regulator-name = "vdd-int-dll";
+};
+
+&reg_ldo1 {
+       regulator-name = "vdd-rtc";
+};
+
+&reg_ldo2 {
+       regulator-always-on;
+       regulator-min-microvolt = <3000000>;
+       regulator-max-microvolt = <3000000>;
+       regulator-name = "avcc";
 };
 
 &uart0 {
        status = "okay";
 };
 
+&usb_otg {
+       dr_mode = "otg";
+       status = "okay";
+};
+
 &usbphy {
-       usb1_vbus-supply = <&reg_usb1_vbus>;
-       usb2_vbus-supply = <&reg_usb2_vbus>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&usb0_id_detect_pin>;
+       usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
+       usb1_vbus-supply = <&reg_vcc5v0>; /* USB1 VBUS is always on */
+       usb2_vbus-supply = <&reg_vcc5v0>; /* USB2 VBUS is always on */
        status = "okay";
 };
diff --git a/arch/arm/boot/dts/sun4i-a10-pcduino2.dts b/arch/arm/boot/dts/sun4i-a10-pcduino2.dts
new file mode 100644 (file)
index 0000000..de483a1
--- /dev/null
@@ -0,0 +1,78 @@
+/*
+ * Copyright 2015 Siarhei Siamashka <siarhei.siamashka@gmail.com>
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This file 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; either version 2 of the
+ *     License, or (at your option) any later version.
+ *
+ *     This file is distributed in the hope that it will be useful,
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ * Or, alternatively,
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use,
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/*
+ * The LinkSprite pcDuino2 board is almost identical to the older
+ * LinkSprite pcDuino1 board. The only software visible difference
+ * is that the pcDuino2 board got a USB VBUS voltage regulator, which
+ * is controlled by the PD2 pin (pulled-up by default). Also one of
+ * the USB host ports has been replaced with a USB WIFI chip.
+ */
+
+#include "sun4i-a10-pcduino.dts"
+
+/ {
+       model = "LinkSprite pcDuino2";
+       compatible = "linksprite,a10-pcduino2", "allwinner,sun4i-a10";
+};
+
+&pio {
+       usb2_vbus_pin_pcduino2: usb2_vbus_pin@0 {
+               allwinner,pins = "PD2";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+       };
+};
+
+&reg_usb2_vbus {
+       pinctrl-names = "default";
+       pinctrl-0 = <&usb2_vbus_pin_pcduino2>;
+       gpio = <&pio 3 2 GPIO_ACTIVE_HIGH>;
+       status = "okay";
+};
+
+&usbphy {
+       usb1_vbus-supply = <&reg_vcc3v3>; /* USB WIFI is always on */
+       usb2_vbus-supply = <&reg_usb2_vbus>;
+       status = "okay";
+};
diff --git a/arch/arm/boot/dts/sun4i-a10-pov-protab2-ips9.dts b/arch/arm/boot/dts/sun4i-a10-pov-protab2-ips9.dts
new file mode 100644 (file)
index 0000000..82e69c3
--- /dev/null
@@ -0,0 +1,199 @@
+/*
+ * Copyright 2015 Hans de Goede <hdegoede@redhat.com>
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This file 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; either version 2 of the
+ *     License, or (at your option) any later version.
+ *
+ *     This file is distributed in the hope that it will be useful,
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ * Or, alternatively,
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use,
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/dts-v1/;
+#include "sun4i-a10.dtsi"
+#include "sunxi-common-regulators.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+#include <dt-bindings/pinctrl/sun4i-a10.h>
+
+/ {
+       model = "Point of View Protab2-IPS9";
+       compatible = "pov,protab2-ips9", "allwinner,sun4i-a10";
+
+       aliases {
+               serial0 = &uart0;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+};
+
+&cpu0 {
+       cpu-supply = <&reg_dcdc2>;
+};
+
+&ehci0 {
+       status = "okay";
+};
+
+&i2c0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c0_pins_a>;
+       status = "okay";
+
+       axp209: pmic@34 {
+               reg = <0x34>;
+               interrupts = <0>;
+       };
+};
+
+#include "axp209.dtsi"
+
+&i2c1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c1_pins_a>;
+       /* pull-ups and devices require AXP209 LDO3 */
+       status = "failed";
+};
+
+&i2c2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c2_pins_a>;
+       status = "okay";
+};
+
+&lradc {
+       vref-supply = <&reg_ldo2>;
+       status = "okay";
+
+       button@400 {
+               label = "Volume Up";
+               linux,code = <KEY_VOLUMEUP>;
+               channel = <0>;
+               voltage = <400000>;
+       };
+
+       button@800 {
+               label = "Volume Down";
+               linux,code = <KEY_VOLUMEDOWN>;
+               channel = <0>;
+               voltage = <800000>;
+       };
+};
+
+&mmc0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>;
+       vmmc-supply = <&reg_vcc3v3>;
+       bus-width = <4>;
+       cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */
+       cd-inverted;
+       status = "okay";
+};
+
+&otg_sram {
+       status = "okay";
+};
+
+&pio {
+       usb0_id_detect_pin: usb0_id_detect_pin@0 {
+               allwinner,pins = "PH4";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+       };
+
+       usb0_vbus_detect_pin: usb0_vbus_detect_pin@0 {
+               allwinner,pins = "PH5";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_PULL_DOWN>;
+       };
+};
+
+&reg_dcdc2 {
+       regulator-always-on;
+       regulator-min-microvolt = <1000000>;
+       regulator-max-microvolt = <1400000>;
+       regulator-name = "vdd-cpu";
+};
+
+&reg_dcdc3 {
+       regulator-always-on;
+       regulator-min-microvolt = <1250000>;
+       regulator-max-microvolt = <1250000>;
+       regulator-name = "vdd-int-dll";
+};
+
+&reg_ldo1 {
+       regulator-name = "vdd-rtc";
+};
+
+&reg_ldo2 {
+       regulator-always-on;
+       regulator-min-microvolt = <3000000>;
+       regulator-max-microvolt = <3000000>;
+       regulator-name = "avcc";
+};
+
+&reg_usb0_vbus {
+       status = "okay";
+};
+
+&reg_usb1_vbus {
+       status = "okay";
+};
+
+&uart0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart0_pins_a>;
+       status = "okay";
+};
+
+&usb_otg {
+       dr_mode = "otg";
+       status = "okay";
+};
+
+&usbphy {
+       pinctrl-names = "default";
+       pinctrl-0 = <&usb0_id_detect_pin>, <&usb0_vbus_detect_pin>;
+       usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
+       usb0_vbus_det-gpio = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH5 */
+       usb0_vbus-supply = <&reg_usb0_vbus>;
+       usb1_vbus-supply = <&reg_usb1_vbus>;
+       status = "okay";
+};
index 1f3c51a08113a7ecd058389f4ca75dc486ba8efb..aa90f319309bac5486e072efdd57792907e5d440 100644 (file)
@@ -45,6 +45,7 @@
 
 #include <dt-bindings/thermal/thermal.h>
 
+#include <dt-bindings/clock/sun4i-a10-pll2.h>
 #include <dt-bindings/dma/sun4i-a10.h>
 #include <dt-bindings/pinctrl/sun4i-a10.h>
 
                        clock-output-names = "pll1";
                };
 
+               pll2: clk@01c20008 {
+                       #clock-cells = <1>;
+                       compatible = "allwinner,sun4i-a10-pll2-clk";
+                       reg = <0x01c20008 0x8>;
+                       clocks = <&osc24M>;
+                       clock-output-names = "pll2-1x", "pll2-2x",
+                                            "pll2-4x", "pll2-8x";
+               };
+
                pll4: clk@01c20018 {
                        #clock-cells = <0>;
                        compatible = "allwinner,sun4i-a10-pll1-clk";
                        clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
                        clock-output-names = "spi3";
                };
+
+               codec_clk: clk@01c20140 {
+                       #clock-cells = <0>;
+                       compatible = "allwinner,sun4i-a10-codec-clk";
+                       reg = <0x01c20140 0x4>;
+                       clocks = <&pll2 SUN4I_A10_PLL2_1X>;
+                       clock-output-names = "codec";
+               };
        };
 
        soc@01c00000 {
                        status = "disabled";
                };
 
+               codec: codec@01c22c00 {
+                       #sound-dai-cells = <0>;
+                       compatible = "allwinner,sun4i-a10-codec";
+                       reg = <0x01c22c00 0x40>;
+                       interrupts = <30>;
+                       clocks = <&apb0_gates 0>, <&codec_clk>;
+                       clock-names = "apb", "codec";
+                       dmas = <&dma SUN4I_DMA_NORMAL 19>,
+                              <&dma SUN4I_DMA_NORMAL 19>;
+                       dma-names = "rx", "tx";
+                       status = "disabled";
+               };
+
                sid: eeprom@01c23800 {
                        compatible = "allwinner,sun4i-a10-sid";
                        reg = <0x01c23800 0x10>;
diff --git a/arch/arm/boot/dts/sun5i-a10s-auxtek-t003.dts b/arch/arm/boot/dts/sun5i-a10s-auxtek-t003.dts
new file mode 100644 (file)
index 0000000..d4ad021
--- /dev/null
@@ -0,0 +1,159 @@
+/*
+ * Copyright 2015 Hans de Goede <hdegoede@redhat.com>
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This file 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; either version 2 of the
+ *     License, or (at your option) any later version.
+ *
+ *     This file is distributed in the hope that it will be useful,
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ * Or, alternatively,
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use,
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/dts-v1/;
+#include "sun5i-a10s.dtsi"
+#include "sunxi-common-regulators.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/pinctrl/sun4i-a10.h>
+
+/ {
+       model = "Auxtek t003 A10s hdmi tv-stick";
+       compatible = "allwinner,auxtek-t003", "allwinner,sun5i-a10s";
+
+       aliases {
+               serial0 = &uart0;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       leds {
+               compatible = "gpio-leds";
+               pinctrl-names = "default";
+               pinctrl-0 = <&led_pins_t003>;
+
+               red {
+                       label = "t003-tv-dongle:red:usr";
+                       gpios = <&pio 1 2 GPIO_ACTIVE_HIGH>; /* PB2 */
+                       default-state = "on";
+               };
+       };
+};
+
+&ehci0 {
+       status = "okay";
+};
+
+&i2c0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c0_pins_a>;
+       status = "okay";
+
+       axp152: pmic@30 {
+               compatible = "x-powers,axp152";
+               reg = <0x30>;
+               interrupts = <0>;
+               interrupt-controller;
+               #interrupt-cells = <1>;
+       };
+};
+
+&mmc0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_t003>;
+       vmmc-supply = <&reg_vcc3v3>;
+       bus-width = <4>;
+       cd-gpios = <&pio 6 1 GPIO_ACTIVE_HIGH>; /* PG1 */
+       cd-inverted;
+       status = "okay";
+};
+
+&ohci0 {
+       status = "okay";
+};
+
+&otg_sram {
+       status = "okay";
+};
+
+&pio {
+       mmc0_cd_pin_t003: mmc0_cd_pin@0 {
+               allwinner,pins = "PG1";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+       };
+
+       led_pins_t003: led_pins@0 {
+               allwinner,pins = "PB2";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_20_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+       };
+};
+
+&reg_usb0_vbus {
+       gpio = <&pio 6 13 GPIO_ACTIVE_HIGH>; /* PG13 */
+       status = "okay";
+};
+
+&reg_usb1_vbus {
+       gpio = <&pio 1 10 GPIO_ACTIVE_HIGH>; /* PB10 */
+       status = "okay";
+};
+
+&uart0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart0_pins_a>;
+       status = "okay";
+};
+
+&usb0_vbus_pin_a {
+       allwinner,pins = "PG13";
+};
+
+&usb1_vbus_pin_a {
+       allwinner,pins = "PB10";
+};
+
+&usb_otg {
+       dr_mode = "host";
+       status = "okay";
+};
+
+&usbphy {
+       usb0_vbus-supply = <&reg_usb0_vbus>;
+       usb1_vbus-supply = <&reg_usb1_vbus>;
+       status = "okay";
+};
index 5a422c1ff725d875ceca0f2b61eeea696b117323..86d046a502e6f89a95ab985d7d2b61050c18d210 100644 (file)
        status = "okay";
 
        at24@50 {
-               compatible = "at,24c16";
+               compatible = "atmel,24c16";
                pagesize = <16>;
                reg = <0x50>;
                read-only;
diff --git a/arch/arm/boot/dts/sun5i-a10s-wobo-i5.dts b/arch/arm/boot/dts/sun5i-a10s-wobo-i5.dts
new file mode 100644 (file)
index 0000000..9fea918
--- /dev/null
@@ -0,0 +1,224 @@
+/*
+ * Copyright 2015 Jelle van der Waa <jelle@vdwaa.nl>
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This file 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; either version 2 of the
+ *     License, or (at your option) any later version.
+ *
+ *     This file is distributed in the hope that it will be useful,
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ * Or, alternatively,
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use,
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/dts-v1/;
+#include "sun5i-a10s.dtsi"
+#include "sunxi-common-regulators.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+#include <dt-bindings/pinctrl/sun4i-a10.h>
+
+/ {
+       model = "A10s-Wobo i5";
+       compatible = "wobo,a10s-wobo-i5", "allwinner,sun5i-a10s";
+
+       aliases {
+               serial0 = &uart0;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       leds {
+               compatible = "gpio-leds";
+               pinctrl-names = "default";
+               pinctrl-0 = <&led_pins_wobo_i5>;
+
+               blue {
+                       label = "a10s-wobo-i5:blue:usr";
+                       gpios = <&pio 1 2 GPIO_ACTIVE_HIGH>;
+                       default-state = "on";
+               };
+       };
+
+       reg_emac_3v3: emac-3v3 {
+               compatible = "regulator-fixed";
+               pinctrl-names = "default";
+               pinctrl-0 = <&emac_power_pin_wobo>;
+               regulator-name = "emac-3v3";
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+               enable-active-high;
+               gpio = <&pio 0 2 GPIO_ACTIVE_HIGH>;
+       };
+};
+
+&cpu0 {
+       cpu-supply = <&reg_dcdc2>;
+};
+
+&ehci0 {
+       status = "okay";
+};
+
+&emac {
+       pinctrl-names = "default";
+       pinctrl-0 = <&emac_pins_b>;
+       phy = <&phy1>;
+       status = "okay";
+};
+
+&emac_sram {
+       status = "okay";
+};
+
+&i2c0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c0_pins_a>;
+       status = "okay";
+
+       axp209: pmic@34 {
+               reg = <0x34>;
+               interrupts = <0>;
+       };
+};
+
+#include "axp209.dtsi"
+
+&mdio {
+       phy-supply = <&reg_emac_3v3>;
+       status = "okay";
+
+       phy1: ethernet-phy@1 {
+               reg = <1>;
+       };
+};
+
+&mmc0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_wobo_i5>;
+       vmmc-supply = <&reg_vcc3v3>;
+       bus-width = <4>;
+       cd-gpios = <&pio 1 3 GPIO_ACTIVE_HIGH>; /* PB3 */
+       cd-inverted;
+       status = "okay";
+};
+
+&ohci0 {
+       status = "okay";
+};
+
+&otg_sram {
+       status = "okay";
+};
+
+&pio {
+       led_pins_wobo_i5: led_pins@0 {
+               allwinner,pins = "PB2";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+       };
+
+       mmc0_cd_pin_wobo_i5: mmc0_cd_pin@0 {
+               allwinner,pins = "PB3";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+       };
+
+       emac_power_pin_wobo: emac_power_pin@0 {
+               allwinner,pins = "PA02";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+       };
+};
+
+&reg_dcdc2 {
+       regulator-always-on;
+       regulator-min-microvolt = <1000000>;
+       regulator-max-microvolt = <1400000>;
+       regulator-name = "vdd-cpu";
+};
+
+&reg_dcdc3 {
+       regulator-always-on;
+       regulator-min-microvolt = <1250000>;
+       regulator-max-microvolt = <1250000>;
+       regulator-name = "vdd-int-dll";
+};
+
+&reg_ldo1 {
+       regulator-name = "vdd-rtc";
+};
+
+&reg_ldo2 {
+       regulator-always-on;
+       regulator-min-microvolt = <3000000>;
+       regulator-max-microvolt = <3000000>;
+       regulator-name = "avcc";
+};
+
+&reg_ldo3 {
+       regulator-always-on;
+       regulator-min-microvolt = <3300000>;
+       regulator-max-microvolt = <3300000>;
+       regulator-name = "vcc-wifi";
+};
+
+&reg_usb1_vbus {
+       gpio = <&pio 6 12 GPIO_ACTIVE_HIGH>;
+       status = "okay";
+};
+
+&uart0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart0_pins_a>;
+       status = "okay";
+};
+
+&usb_otg {
+       dr_mode = "host";
+       status = "okay";
+};
+
+&usb1_vbus_pin_a {
+       allwinner,pins = "PG12";
+};
+
+&usbphy {
+       usb1_vbus-supply = <&reg_usb1_vbus>;
+       status = "okay";
+};
index a513b416a80773c970105920cecd8878d46a2dfc..bddd0de88af6be1d3e68b027b644a56e5e0ee61b 100644 (file)
                        clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 44>;
                        status = "disabled";
                };
+
+               framebuffer@2 {
+                       compatible = "allwinner,simple-framebuffer",
+                                    "simple-framebuffer";
+                       allwinner,pipeline = "de_be0-lcd0-tve0";
+                       clocks = <&pll5 1>, <&ahb_gates 34>, <&ahb_gates 36>,
+                                <&ahb_gates 44>;
+                       status = "disabled";
+               };
        };
 
        clocks {
                        #size-cells = <0>;
                };
 
+               pwm: pwm@01c20e00 {
+                       compatible = "allwinner,sun5i-a10s-pwm";
+                       reg = <0x01c20e00 0xc>;
+                       clocks = <&osc24M>;
+                       #pwm-cells = <3>;
+                       status = "disabled";
+               };
+
                uart0: serial@01c28000 {
                        compatible = "snps,dw-apb-uart";
                        reg = <0x01c28000 0x400>;
                allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
        };
 
-       uart3_pins_a: uart3@0 {
-               allwinner,pins = "PG9", "PG10";
-               allwinner,function = "uart3";
-               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-       };
-
        emac_pins_a: emac0@0 {
                allwinner,pins = "PA0", "PA1", "PA2",
                                "PA3", "PA4", "PA5", "PA6",
                allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
        };
 
+       emac_pins_b: emac0@1 {
+               allwinner,pins = "PD6", "PD7", "PD10",
+                               "PD11", "PD12", "PD13", "PD14",
+                               "PD15", "PD18", "PD19", "PD20",
+                               "PD21", "PD22", "PD23", "PD24",
+                               "PD25", "PD26", "PD27";
+               allwinner,function = "emac";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+       };
+
        mmc1_pins_a: mmc1@0 {
                allwinner,pins = "PG3", "PG4", "PG5",
                                 "PG6", "PG7", "PG8";
diff --git a/arch/arm/boot/dts/sun5i-a13-inet-98v-rev2.dts b/arch/arm/boot/dts/sun5i-a13-inet-98v-rev2.dts
new file mode 100644 (file)
index 0000000..6fa54b6
--- /dev/null
@@ -0,0 +1,227 @@
+/*
+ * Copyright 2015 Hans de Goede <hdegoede@redhat.com>
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This file 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; either version 2 of the
+ *     License, or (at your option) any later version.
+ *
+ *     This file is distributed in the hope that it will be useful,
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ * Or, alternatively,
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use,
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/dts-v1/;
+#include "sun5i-a13.dtsi"
+#include "sunxi-common-regulators.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+#include <dt-bindings/pinctrl/sun4i-a10.h>
+
+/ {
+       model = "INet-98V Rev 02";
+       compatible = "primux,inet98v-rev2", "allwinner,sun5i-a13";
+
+       aliases {
+               serial0 = &uart1;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+};
+
+&cpu0 {
+       cpu-supply = <&reg_dcdc2>;
+};
+
+&ehci0 {
+       status = "okay";
+};
+
+&i2c0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c0_pins_a>;
+       status = "okay";
+
+       axp209: pmic@34 {
+               reg = <0x34>;
+               interrupts = <0>;
+       };
+};
+
+#include "axp209.dtsi"
+
+&i2c1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c1_pins_a>;
+       status = "okay";
+
+       pcf8563: rtc@51 {
+               compatible = "nxp,pcf8563";
+               reg = <0x51>;
+       };
+};
+
+&lradc {
+       vref-supply = <&reg_ldo2>;
+       status = "okay";
+
+       button@200 {
+               label = "Volume Up";
+               linux,code = <KEY_VOLUMEUP>;
+               channel = <0>;
+               voltage = <200000>;
+       };
+
+       button@400 {
+               label = "Volume Down";
+               linux,code = <KEY_VOLUMEDOWN>;
+               channel = <0>;
+               voltage = <400000>;
+       };
+};
+
+&mmc0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_inet98fv2>;
+       vmmc-supply = <&reg_vcc3v3>;
+       bus-width = <4>;
+       cd-gpios = <&pio 6 0 GPIO_ACTIVE_HIGH>; /* PG0 */
+       cd-inverted;
+       status = "okay";
+};
+
+&mmc2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&mmc2_pins_a>;
+       vmmc-supply = <&reg_vcc3v3>;
+       bus-width = <8>;
+       non-removable;
+       status = "okay";
+
+       mmccard: mmccard@0 {
+               reg = <0>;
+               compatible = "mmc-card";
+               broken-hpi;
+       };
+};
+
+&otg_sram {
+       status = "okay";
+};
+
+&pio {
+       mmc0_cd_pin_inet98fv2: mmc0_cd_pin@0 {
+               allwinner,pins = "PG0";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+       };
+
+       usb0_vbus_detect_pin: usb0_vbus_detect_pin@0 {
+               allwinner,pins = "PG1";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_PULL_DOWN>;
+       };
+
+       usb0_id_detect_pin: usb0_id_detect_pin@0 {
+               allwinner,pins = "PG2";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+       };
+};
+
+&reg_dcdc2 {
+       regulator-always-on;
+       regulator-min-microvolt = <1000000>;
+       regulator-max-microvolt = <1400000>;
+       regulator-name = "vdd-cpu";
+};
+
+&reg_dcdc3 {
+       regulator-always-on;
+       regulator-min-microvolt = <1250000>;
+       regulator-max-microvolt = <1250000>;
+       regulator-name = "vdd-int-pll";
+};
+
+&reg_ldo1 {
+       regulator-name = "vdd-rtc";
+};
+
+&reg_ldo2 {
+       regulator-always-on;
+       regulator-min-microvolt = <3000000>;
+       regulator-max-microvolt = <3000000>;
+       regulator-name = "avcc";
+};
+
+&reg_ldo3 {
+       regulator-min-microvolt = <3300000>;
+       regulator-max-microvolt = <3300000>;
+       regulator-name = "vcc-wifi";
+};
+
+&reg_usb0_vbus {
+       gpio = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */
+       status = "okay";
+};
+
+&uart1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart1_pins_b>;
+       status = "okay";
+};
+
+&usb_otg {
+       dr_mode = "otg";
+       status = "okay";
+};
+
+&usb0_vbus_pin_a {
+       allwinner,pins = "PG12";
+};
+
+&usbphy {
+       pinctrl-names = "default";
+       pinctrl-0 = <&usb0_id_detect_pin>, <&usb0_vbus_detect_pin>;
+       usb0_id_det-gpio = <&pio 6 2 GPIO_ACTIVE_HIGH>; /* PG2 */
+       usb0_vbus_det-gpio = <&pio 6 1 GPIO_ACTIVE_HIGH>; /* PG1 */
+       usb0_vbus-supply = <&reg_usb0_vbus>;
+       usb1_vbus-supply = <&reg_ldo3>;
+       status = "okay";
+};
diff --git a/arch/arm/boot/dts/sun5i-a13-q8-tablet.dts b/arch/arm/boot/dts/sun5i-a13-q8-tablet.dts
new file mode 100644 (file)
index 0000000..72e93ac
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2015 Hans de Goede <hdegoede@redhat.com>
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This file 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; either version 2 of the
+ *     License, or (at your option) any later version.
+ *
+ *     This file is distributed in the hope that it will be useful,
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ * Or, alternatively,
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use,
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/dts-v1/;
+#include "sun5i-a13.dtsi"
+#include "sun5i-q8-common.dtsi"
+
+/ {
+       model = "Q8 A13 Tablet";
+       compatible = "allwinner,q8-a13", "allwinner,sun5i-a13";
+};
+
+&reg_ldo3 {
+       regulator-min-microvolt = <3300000>;
+       regulator-max-microvolt = <3300000>;
+       regulator-name = "vcc-wifi";
+};
+
+&usbphy {
+       usb1_vbus-supply = <&reg_ldo3>;
+};
index f3631c9c6fa2616e8b5ef209df59ca9ac9ee0ad3..d910d3a6c41c573c83e6c20898cabf072a79ae9b 100644 (file)
                                             "apb1_uart3";
                };
        };
+
+       soc@01c00000 {
+               pwm: pwm@01c20e00 {
+                       compatible = "allwinner,sun5i-a13-pwm";
+                       reg = <0x01c20e00 0xc>;
+                       clocks = <&osc24M>;
+                       #pwm-cells = <3>;
+                       status = "disabled";
+               };
+       };
 };
 
 &cpu0 {
diff --git a/arch/arm/boot/dts/sun5i-q8-common.dtsi b/arch/arm/boot/dts/sun5i-q8-common.dtsi
new file mode 100644 (file)
index 0000000..a78e189
--- /dev/null
@@ -0,0 +1,180 @@
+/*
+ * Copyright 2015 Hans de Goede <hdegoede@redhat.com>
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This file 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; either version 2 of the
+ *     License, or (at your option) any later version.
+ *
+ *     This file is distributed in the hope that it will be useful,
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ * Or, alternatively,
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use,
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
+ */
+#include "sunxi-q8-common.dtsi"
+
+#include <dt-bindings/pwm/pwm.h>
+
+/ {
+       aliases {
+               serial0 = &uart1;
+       };
+
+       backlight: backlight {
+               compatible = "pwm-backlight";
+               pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>;
+               brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>;
+               default-brightness-level = <8>;
+               /* TODO: backlight uses axp gpio1 as enable pin */
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+};
+
+&cpu0 {
+       cpu-supply = <&reg_dcdc2>;
+};
+
+&ehci0 {
+       status = "okay";
+};
+
+&i2c0 {
+       axp209: pmic@34 {
+               reg = <0x34>;
+               interrupts = <0>;
+       };
+};
+
+&i2c1 {
+       pcf8563: rtc@51 {
+               compatible = "nxp,pcf8563";
+               reg = <0x51>;
+       };
+};
+
+#include "axp209.dtsi"
+
+&mmc0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_q8>;
+       vmmc-supply = <&reg_vcc3v0>;
+       bus-width = <4>;
+       cd-gpios = <&pio 6 0 GPIO_ACTIVE_HIGH>; /* PG0 */
+       cd-inverted;
+       status = "okay";
+};
+
+&otg_sram {
+       status = "okay";
+};
+
+&pio {
+       mmc0_cd_pin_q8: mmc0_cd_pin@0 {
+               allwinner,pins = "PG0";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+       };
+
+       usb0_vbus_detect_pin: usb0_vbus_detect_pin@0 {
+               allwinner,pins = "PG1";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_PULL_DOWN>;
+       };
+
+       usb0_id_detect_pin: usb0_id_detect_pin@0 {
+               allwinner,pins = "PG2";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+       };
+
+       usb0_vbus_pin_a: usb0_vbus_pin@0 {
+               allwinner,pins = "PG12";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+       };
+};
+
+&reg_dcdc2 {
+       regulator-always-on;
+       regulator-min-microvolt = <1000000>;
+       regulator-max-microvolt = <1500000>;
+       regulator-name = "vdd-cpu";
+};
+
+&reg_dcdc3 {
+       regulator-always-on;
+       regulator-min-microvolt = <1000000>;
+       regulator-max-microvolt = <1400000>;
+       regulator-name = "vdd-int-pll";
+};
+
+&reg_ldo1 {
+       regulator-name = "vdd-rtc";
+};
+
+&reg_ldo2 {
+       regulator-always-on;
+       regulator-min-microvolt = <3000000>;
+       regulator-max-microvolt = <3000000>;
+       regulator-name = "avcc";
+};
+
+&reg_usb0_vbus {
+       gpio = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */
+       status = "okay";
+};
+
+&uart1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart1_pins_b>;
+       status = "okay";
+};
+
+&usb_otg {
+       dr_mode = "otg";
+       status = "okay";
+};
+
+&usbphy {
+       pinctrl-names = "default";
+       pinctrl-0 = <&usb0_id_detect_pin>, <&usb0_vbus_detect_pin>;
+       usb0_id_det-gpio = <&pio 6 2 GPIO_ACTIVE_HIGH>; /* PG2 */
+       usb0_vbus_det-gpio = <&pio 6 1 GPIO_ACTIVE_HIGH>; /* PG1 */
+       usb0_vbus-supply = <&reg_usb0_vbus>;
+       status = "okay";
+};
diff --git a/arch/arm/boot/dts/sun5i-r8-chip.dts b/arch/arm/boot/dts/sun5i-r8-chip.dts
new file mode 100644 (file)
index 0000000..530ab28
--- /dev/null
@@ -0,0 +1,218 @@
+/*
+ * Copyright 2015 Free Electrons
+ * Copyright 2015 NextThing Co
+ *
+ * Maxime Ripard <maxime.ripard@free-electrons.com>
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This file 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; either version 2 of the
+ *     License, or (at your option) any later version.
+ *
+ *     This file is distributed in the hope that it will be useful,
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ * Or, alternatively,
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use,
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/dts-v1/;
+#include "sun5i-r8.dtsi"
+#include "sunxi-common-regulators.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+
+/ {
+       model = "NextThing C.H.I.P.";
+       compatible = "nextthing,chip", "allwinner,sun5i-r8";
+
+       aliases {
+               i2c0 = &i2c0;
+               i2c2 = &i2c2;
+               serial0 = &uart1;
+               serial1 = &uart3;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+};
+
+&codec {
+       status = "okay";
+};
+
+&ehci0 {
+       status = "okay";
+};
+
+&i2c0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c0_pins_a>;
+       status = "okay";
+
+       axp209: pmic@34 {
+               reg = <0x34>;
+
+               /*
+                * The interrupt is routed through the "External Fast
+                * Interrupt Request" pin (ball G13 of the module)
+                * directly to the main interrupt controller, without
+                * any other controller interfering.
+                */
+               interrupts = <0>;
+       };
+};
+
+#include "axp209.dtsi"
+
+&i2c2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c2_pins_a>;
+       status = "okay";
+
+       xio: gpio@38 {
+               compatible = "nxp,pcf8574a";
+               reg = <0x38>;
+
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-parent = <&pio>;
+               interrupts = <6 0 IRQ_TYPE_EDGE_FALLING>;
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+};
+
+&mmc0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&mmc0_pins_a>;
+       vmmc-supply = <&reg_vcc3v3>;
+       bus-width = <4>;
+       non-removable;
+       status = "okay";
+};
+
+&ohci0 {
+       status = "okay";
+};
+
+&otg_sram {
+       status = "okay";
+};
+
+&pio {
+       chip_vbus_pin: chip_vbus_pin@0 {
+               allwinner,pins = "PB10";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+       };
+
+       chip_id_det_pin: chip_id_det_pin@0 {
+               allwinner,pins = "PG2";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+       };
+};
+
+&reg_dcdc2 {
+       regulator-min-microvolt = <1000000>;
+       regulator-max-microvolt = <1400000>;
+       regulator-name = "cpuvdd";
+       regulator-always-on;
+};
+
+&reg_dcdc3 {
+       regulator-min-microvolt = <1000000>;
+       regulator-max-microvolt = <1300000>;
+       regulator-name = "corevdd";
+       regulator-always-on;
+};
+
+&reg_ldo1 {
+       regulator-name = "rtcvdd";
+};
+
+&reg_ldo2 {
+       regulator-min-microvolt = <2700000>;
+       regulator-max-microvolt = <3300000>;
+       regulator-name = "avcc";
+       regulator-always-on;
+};
+
+&reg_ldo5 {
+       regulator-min-microvolt = <1800000>;
+       regulator-max-microvolt = <1800000>;
+       regulator-name = "vcc-1v8";
+};
+
+&reg_usb0_vbus {
+       pinctrl-0 = <&chip_vbus_pin>;
+       vin-supply = <&reg_vcc5v0>;
+       gpio = <&pio 1 10 GPIO_ACTIVE_HIGH>; /* PB10 */
+       status = "okay";
+};
+
+&uart1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart1_pins_b>;
+       status = "okay";
+};
+
+&uart3 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart3_pins_a>,
+                   <&uart3_pins_cts_rts_a>;
+       status = "okay";
+};
+
+&usb_otg {
+       dr_mode = "otg";
+       status = "okay";
+};
+
+&usb_power_supply {
+       status = "okay";
+};
+
+&usbphy {
+       pinctrl-names = "default";
+       pinctrl-0 = <&chip_id_det_pin>;
+       status = "okay";
+
+       usb0_id_det-gpio = <&pio 6 2 GPIO_ACTIVE_HIGH>; /* PG2 */
+       usb0_vbus_power-supply = <&usb_power_supply>;
+       usb0_vbus-supply = <&reg_usb0_vbus>;
+       usb1_vbus-supply = <&reg_vcc5v0>;
+};
diff --git a/arch/arm/boot/dts/sun5i-r8.dtsi b/arch/arm/boot/dts/sun5i-r8.dtsi
new file mode 100644 (file)
index 0000000..0ef8656
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2015 Free Electrons
+ * Copyright 2015 NextThing Co
+ *
+ * Maxime Ripard <maxime.ripard@free-electrons.com>
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This file 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; either version 2 of the
+ *     License, or (at your option) any later version.
+ *
+ *     This file is distributed in the hope that it will be useful,
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ * Or, alternatively,
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use,
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#include "sun5i-a13.dtsi"
+
+/ {
+       chosen {
+               framebuffer@1 {
+                       compatible = "allwinner,simple-framebuffer",
+                                    "simple-framebuffer";
+                       allwinner,pipeline = "de_be0-lcd0-tve0";
+                       clocks = <&pll5 1>, <&ahb_gates 34>, <&ahb_gates 36>,
+                                <&ahb_gates 44>;
+                       status = "disabled";
+               };
+       };
+};
index 78b993abbaa3976ac8582dedd12583e62a912826..59a9426e3bd4ed68aefa8b3aca7469dd3e27f5dc 100644 (file)
@@ -44,6 +44,7 @@
 
 #include "skeleton.dtsi"
 
+#include <dt-bindings/clock/sun4i-a10-pll2.h>
 #include <dt-bindings/dma/sun4i-a10.h>
 #include <dt-bindings/pinctrl/sun4i-a10.h>
 
                        clock-output-names = "pll1";
                };
 
+               pll2: clk@01c20008 {
+                       #clock-cells = <1>;
+                       compatible = "allwinner,sun5i-a13-pll2-clk";
+                       reg = <0x01c20008 0x8>;
+                       clocks = <&osc24M>;
+                       clock-output-names = "pll2-1x", "pll2-2x",
+                                            "pll2-4x", "pll2-8x";
+               };
+
                pll4: clk@01c20018 {
                        #clock-cells = <0>;
                        compatible = "allwinner,sun4i-a10-pll1-clk";
                        clock-output-names = "usb_ohci0", "usb_phy";
                };
 
+               codec_clk: clk@01c20140 {
+                       #clock-cells = <0>;
+                       compatible = "allwinner,sun4i-a10-codec-clk";
+                       reg = <0x01c20140 0x4>;
+                       clocks = <&pll2 SUN4I_A10_PLL2_1X>;
+                       clock-output-names = "codec";
+               };
+
                mbus_clk: clk@01c2015c {
                        #clock-cells = <0>;
                        compatible = "allwinner,sun5i-a13-mbus-clk";
                                allwinner,drive = <SUN4I_PINCTRL_30_MA>;
                                allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
                        };
+
+                       uart3_pins_a: uart3@0 {
+                               allwinner,pins = "PG9", "PG10";
+                               allwinner,function = "uart3";
+                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+                       };
+
+                       uart3_pins_cts_rts_a: uart3-cts-rts@0 {
+                               allwinner,pins = "PG11", "PG12";
+                               allwinner,function = "uart3";
+                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+                       };
+
+                       pwm0_pins: pwm0 {
+                               allwinner,pins = "PB2";
+                               allwinner,function = "pwm";
+                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+                       };
                };
 
                timer@01c20c00 {
                        status = "disabled";
                };
 
+               codec: codec@01c22c00 {
+                       #sound-dai-cells = <0>;
+                       compatible = "allwinner,sun4i-a10-codec";
+                       reg = <0x01c22c00 0x40>;
+                       interrupts = <30>;
+                       clocks = <&apb0_gates 0>, <&codec_clk>;
+                       clock-names = "apb", "codec";
+                       dmas = <&dma SUN4I_DMA_NORMAL 19>,
+                              <&dma SUN4I_DMA_NORMAL 19>;
+                       dma-names = "rx", "tx";
+                       status = "disabled";
+               };
+
                sid: eeprom@01c23800 {
                        compatible = "allwinner,sun4i-a10-sid";
                        reg = <0x01c23800 0x10>;
index 0cf9926d1e93bebdc333c45f83c2dfe7610f50b9..f9cf36888d93a6f3673d563dbc6f8cb25ad882df 100644 (file)
        chosen {
                stdout-path = "serial0:115200n8";
        };
+
+       i2c_lcd: i2c@0 {
+               /* The lcd panel i2c interface is hooked up via gpios */
+               compatible = "i2c-gpio";
+               pinctrl-names = "default";
+               pinctrl-0 = <&i2c_lcd_pins>;
+               gpios = <&pio 0 23 GPIO_ACTIVE_HIGH>, /* PA23, sda */
+                       <&pio 0 24 GPIO_ACTIVE_HIGH>; /* PA24, scl */
+               i2c-gpio,delay-us = <5>;
+       };
 };
 
 &ehci1 {
        status = "okay";
 };
 
+&gmac {
+       pinctrl-names = "default";
+       pinctrl-0 = <&gmac_pins_rgmii_a>;
+       phy = <&phy1>;
+       phy-mode = "rgmii";
+       status = "okay";
+
+       phy1: ethernet-phy@1 {
+               reg = <1>;
+       };
+};
+
 &i2c0 {
        pinctrl-names = "default";
        pinctrl-0 = <&i2c0_pins_a>;
        pinctrl-names = "default";
        pinctrl-0 = <&i2c2_pins_a>;
        status = "okay";
+
+       mma8452: mma8452@1d {
+               compatible = "fsl,mma8452";
+               reg = <0x1d>;
+               interrupt-parent = <&pio>;
+               interrupts = <0 9 IRQ_TYPE_LEVEL_LOW>; /* PA9 */
+       };
 };
 
 &mmc0 {
                allwinner,drive = <SUN4I_PINCTRL_10_MA>;
                allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
        };
+
+       i2c_lcd_pins: i2c_lcd_pin@0 {
+               allwinner,pins = "PA23", "PA24";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+       };
 };
 
 &reg_usb2_vbus {
index d0cfadac0691ddfe179f879eab18c54544db45bd..9a74637f677f3481c0ec615a2266b37ec08186d4 100644 (file)
@@ -54,6 +54,8 @@
        compatible = "merrii,a31-hummingbird", "allwinner,sun6i-a31";
 
        aliases {
+               rtc0 = &pcf8563;
+               rtc1 = &rtc;
                serial0 = &uart0;
        };
 
        };
 };
 
+&cpu0 {
+       cpu-supply = <&reg_dcdc3>;
+};
+
 &ehci0 {
        status = "okay";
 };
 
 &gmac {
        pinctrl-names = "default";
-       pinctrl-0 = <&gmac_pins_rgmii_a>;
+       pinctrl-0 = <&gmac_pins_rgmii_a>, <&gmac_phy_reset_pin_hummingbird>;
        phy = <&phy1>;
        phy-mode = "rgmii";
        snps,reset-gpio = <&pio 0 21 GPIO_ACTIVE_HIGH>;
 &mmc0 {
        pinctrl-names = "default";
        pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_hummingbird>;
-       vmmc-supply = <&vcc_3v0>;
+       vmmc-supply = <&reg_dcdc1>;
        bus-width = <4>;
        cd-gpios = <&pio 0 8 GPIO_ACTIVE_HIGH>; /* PA8 */
        cd-inverted;
 &mmc1 {
        pinctrl-names = "default";
        pinctrl-0 = <&mmc1_pins_a>, <&wifi_reset_pin_hummingbird>;
-       vmmc-supply = <&vcc_wifi>;
+       vmmc-supply = <&reg_aldo1>;
        mmc-pwrseq = <&wifi_pwrseq>;
        bus-width = <4>;
        non-removable;
 };
 
 &pio {
+       gmac_phy_reset_pin_hummingbird: gmac_phy_reset_pin@0 {
+               allwinner,pins = "PA21";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+       };
+
        mmc0_cd_pin_hummingbird: mmc0_cd_pin@0 {
                allwinner,pins = "PA8";
                allwinner,function = "gpio_in";
 &p2wi {
        status = "okay";
 
-       axp221: pmic@68 {
+       axp22x: pmic@68 {
                compatible = "x-powers,axp221";
                reg = <0x68>;
                interrupt-parent = <&nmi_intc>;
                interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
-               interrupt-controller;
-               #interrupt-cells = <1>;
-               dcdc1-supply = <&vcc_3v0>;
-               dcdc5-supply = <&vcc_dram>;
-
-               regulators {
-                       x-powers,dcdc-freq = <3000>;
-
-                       vcc_3v0: dcdc1 {
-                               regulator-always-on;
-                               regulator-min-microvolt = <3000000>;
-                               regulator-max-microvolt = <3000000>;
-                               regulator-name = "vcc-3v0";
-                       };
-
-                       vdd_cpu: dcdc2 {
-                               regulator-always-on;
-                               regulator-min-microvolt = <700000>;
-                               regulator-max-microvolt = <1320000>;
-                               regulator-name = "vdd-cpu";
-                       };
-
-                       vdd_gpu: dcdc3 {
-                               regulator-always-on;
-                               regulator-min-microvolt = <700000>;
-                               regulator-max-microvolt = <1320000>;
-                               regulator-name = "vdd-gpu";
-                       };
-
-                       vdd_sys_dll: dcdc4 {
-                               regulator-always-on;
-                               regulator-min-microvolt = <1100000>;
-                               regulator-max-microvolt = <1100000>;
-                               regulator-name = "vdd-sys-dll";
-                       };
-
-                       vcc_dram: dcdc5 {
-                               regulator-always-on;
-                               regulator-min-microvolt = <1500000>;
-                               regulator-max-microvolt = <1500000>;
-                               regulator-name = "vcc-dram";
-                       };
-
-                       vcc_wifi: aldo1 {
-                               regulator-min-microvolt = <3300000>;
-                               regulator-max-microvolt = <3300000>;
-                               regulator-name = "vcc_wifi";
-                       };
-
-                       avcc: aldo3 {
-                               regulator-always-on;
-                               regulator-min-microvolt = <3000000>;
-                               regulator-max-microvolt = <3000000>;
-                               regulator-name = "avcc";
-                       };
-               };
        };
 };
 
+#include "axp22x.dtsi"
+
+&reg_aldo1 {
+       regulator-min-microvolt = <3300000>;
+       regulator-max-microvolt = <3300000>;
+       regulator-name = "vcc-wifi";
+};
+
+&reg_aldo3 {
+       regulator-always-on;
+       regulator-min-microvolt = <2700000>;
+       regulator-max-microvolt = <3300000>;
+       regulator-name = "avcc";
+};
+
+&reg_dc5ldo {
+       regulator-min-microvolt = <700000>;
+       regulator-max-microvolt = <1320000>;
+       regulator-name = "vdd-cpus";
+};
+
+&reg_dcdc1 {
+       regulator-always-on;
+       regulator-min-microvolt = <3000000>;
+       regulator-max-microvolt = <3000000>;
+       regulator-name = "vcc-3v0";
+};
+
+&reg_dcdc2 {
+       regulator-min-microvolt = <700000>;
+       regulator-max-microvolt = <1320000>;
+       regulator-name = "vdd-gpu";
+};
+
+&reg_dcdc3 {
+       regulator-always-on;
+       regulator-min-microvolt = <700000>;
+       regulator-max-microvolt = <1320000>;
+       regulator-name = "vdd-cpu";
+};
+
+&reg_dcdc4 {
+       regulator-always-on;
+       regulator-min-microvolt = <700000>;
+       regulator-max-microvolt = <1320000>;
+       regulator-name = "vdd-sys-dll";
+};
+
+&reg_dcdc5 {
+       regulator-always-on;
+       regulator-min-microvolt = <1500000>;
+       regulator-max-microvolt = <1500000>;
+       regulator-name = "vcc-dram";
+};
+
 &reg_usb1_vbus {
        gpio = <&pio 7 24 GPIO_ACTIVE_HIGH>; /* PH24 */
        status = "okay";
index 54bb83b58f421aaad351efef14743fcbb24f0648..b6ad7850fac6931ee1eb6f1716418c16b849eae4 100644 (file)
@@ -61,7 +61,7 @@
                #size-cells = <1>;
                ranges;
 
-               framebuffer@0 {
+               simplefb_hdmi: framebuffer@0 {
                        compatible = "allwinner,simple-framebuffer",
                                     "simple-framebuffer";
                        allwinner,pipeline = "de_be0-lcd0-hdmi";
@@ -69,7 +69,7 @@
                        status = "disabled";
                };
 
-               framebuffer@1 {
+               simplefb_lcd: framebuffer@1 {
                        compatible = "allwinner,simple-framebuffer",
                                     "simple-framebuffer";
                        allwinner,pipeline = "de_be0-lcd0";
                                allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
                        };
 
+                       mmc2_pins_a: mmc2@0 {
+                               allwinner,pins = "PC6", "PC7", "PC8", "PC9",
+                                                "PC10", "PC11";
+                               allwinner,function = "mmc2";
+                               allwinner,drive = <SUN4I_PINCTRL_30_MA>;
+                               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+                       };
+
+                       mmc2_8bit_emmc_pins: mmc2@1 {
+                               allwinner,pins = "PC6", "PC7", "PC8", "PC9",
+                                                "PC10", "PC11", "PC12",
+                                                "PC13", "PC14", "PC15",
+                                                "PC24";
+                               allwinner,function = "mmc2";
+                               allwinner,drive = <SUN4I_PINCTRL_30_MA>;
+                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+                       };
+
                        gmac_pins_mii_a: gmac_mii@0 {
                                allwinner,pins = "PA0", "PA1", "PA2", "PA3",
                                                "PA8", "PA9", "PA11",
                        reg = <0x01c20ca0 0x20>;
                };
 
+               lradc: lradc@01c22800 {
+                       compatible = "allwinner,sun4i-a10-lradc-keys";
+                       reg = <0x01c22800 0x100>;
+                       interrupts = <GIC_SPI 30 IRQ_TYPE_LEVEL_HIGH>;
+                       status = "disabled";
+               };
+
                rtp: rtp@01c25000 {
                        compatible = "allwinner,sun6i-a31-ts";
                        reg = <0x01c25000 0x100>;
                        resets = <&apb0_rst 0>;
                        gpio-controller;
                        interrupt-controller;
-                       #interrupt-cells = <2>;
+                       #interrupt-cells = <3>;
                        #size-cells = <0>;
                        #gpio-cells = <3>;
 
diff --git a/arch/arm/boot/dts/sun6i-a31s-primo81.dts b/arch/arm/boot/dts/sun6i-a31s-primo81.dts
new file mode 100644 (file)
index 0000000..2d4250b
--- /dev/null
@@ -0,0 +1,255 @@
+/*
+ * Copyright 2014 Siarhei Siamashka <siarhei.siamashka@gmail.com>
+ * Copyright 2015 Karsten Merker <merker@debian.org>
+ * Copyright 2015 Chen-Yu Tsai <wens@csie.org>
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This file 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; either version 2 of the
+ *     License, or (at your option) any later version.
+ *
+ *     This file is distributed in the hope that it will be useful,
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ * Or, alternatively,
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use,
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/dts-v1/;
+#include "sun6i-a31s.dtsi"
+#include "sunxi-common-regulators.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/pinctrl/sun4i-a10.h>
+
+/ {
+       model = "MSI Primo81 tablet";
+       compatible = "msi,primo81", "allwinner,sun6i-a31s";
+};
+
+&cpu0 {
+       cpu-supply = <&reg_dcdc3>;
+};
+
+&ehci0 {
+       /* rtl8188etv wifi is connected here */
+       status = "okay";
+};
+
+&i2c0 {
+       /* pull-ups and device VDDIO use AXP221 DLDO3 */
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c0_pins_a>;
+       status = "failed";
+};
+
+&i2c1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c1_pins_a>;
+       status = "okay";
+
+       ctp@5d {
+               pinctrl-names = "default";
+               pinctrl-0 = <&gt911_int_primo81>;
+               compatible = "goodix,gt911";
+               reg = <0x5d>;
+               interrupt-parent = <&pio>;
+               interrupts = <0 3 IRQ_TYPE_LEVEL_HIGH>; /* PA3 */
+       };
+};
+
+&i2c2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c2_pins_a>;
+       status = "okay";
+
+       accelerometer@1c {
+               pinctrl-names = "default";
+               pinctrl-0 = <&mma8452_int_primo81>;
+               compatible = "fsl,mma8452";
+               reg = <0x1c>;
+               interrupt-parent = <&pio>;
+               interrupts = <0 9 IRQ_TYPE_LEVEL_HIGH>; /* PA9 */
+               #io-channel-cells = <1>;
+       };
+};
+
+&lradc {
+       vref-supply = <&reg_aldo3>;
+       status = "okay";
+
+       button@158 {
+               label = "Volume Up";
+               linux,code = <KEY_VOLUMEUP>;
+               channel = <0>;
+               voltage = <158730>;
+       };
+
+       button@349 {
+               label = "Volume Down";
+               linux,code = <KEY_VOLUMEDOWN>;
+               channel = <0>;
+               voltage = <349206>;
+       };
+};
+
+&mmc0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_primo81>;
+       vmmc-supply = <&reg_dcdc1>;
+       bus-width = <4>;
+       cd-gpios = <&pio 0 8 GPIO_ACTIVE_HIGH>; /* PA8 */
+       cd-inverted;
+       status = "okay";
+};
+
+&pio {
+       gt911_int_primo81: gt911_int_pin@0 {
+               allwinner,pins = "PA3";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+       };
+
+       mma8452_int_primo81: mma8452_int_pin@0 {
+               allwinner,pins = "PA9";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+       };
+
+       mmc0_cd_pin_primo81: mmc0_cd_pin@0 {
+               allwinner,pins = "PA8";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+       };
+};
+
+&p2wi {
+       status = "okay";
+
+       axp22x: pmic@68 {
+               compatible = "x-powers,axp221";
+               reg = <0x68>;
+               interrupt-parent = <&nmi_intc>;
+               interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
+       };
+};
+
+#include "axp22x.dtsi"
+
+&reg_aldo3 {
+       regulator-always-on;
+       regulator-min-microvolt = <2700000>;
+       regulator-max-microvolt = <3300000>;
+       regulator-name = "avcc";
+};
+
+&reg_dc1sw {
+       regulator-min-microvolt = <3000000>;
+       regulator-max-microvolt = <3000000>;
+       regulator-name = "vcc-lcd";
+};
+
+&reg_dc5ldo {
+       regulator-min-microvolt = <700000>;
+       regulator-max-microvolt = <1320000>;
+       regulator-name = "vdd-cpus"; /* This is an educated guess */
+};
+
+&reg_dcdc1 {
+       regulator-always-on;
+       regulator-min-microvolt = <3000000>;
+       regulator-max-microvolt = <3000000>;
+       regulator-name = "vcc-3v0";
+};
+
+&reg_dcdc2 {
+       regulator-min-microvolt = <700000>;
+       regulator-max-microvolt = <1320000>;
+       regulator-name = "vdd-gpu";
+};
+
+&reg_dcdc3 {
+       regulator-always-on;
+       regulator-min-microvolt = <700000>;
+       regulator-max-microvolt = <1320000>;
+       regulator-name = "vdd-cpu";
+};
+
+&reg_dcdc4 {
+       regulator-always-on;
+       regulator-min-microvolt = <700000>;
+       regulator-max-microvolt = <1320000>;
+       regulator-name = "vdd-sys-dll";
+};
+
+&reg_dcdc5 {
+       regulator-always-on;
+       regulator-min-microvolt = <1500000>;
+       regulator-max-microvolt = <1500000>;
+       regulator-name = "vcc-dram";
+};
+
+&reg_dldo1 {
+       regulator-min-microvolt = <3300000>;
+       regulator-max-microvolt = <3300000>;
+       regulator-name = "vcc-wifi";
+};
+
+&reg_dldo3 {
+       regulator-min-microvolt = <2800000>;
+       regulator-max-microvolt = <2800000>;
+       regulator-name = "vddio-csi";
+};
+
+&reg_eldo3 {
+       regulator-min-microvolt = <1080000>;
+       regulator-max-microvolt = <1320000>;
+       regulator-name = "vdd-mipi-bridge";
+};
+
+&simplefb_lcd {
+       vcc-lcd-supply = <&reg_dc1sw>;
+       vdd-mipi-bridge-supply = <&reg_eldo3>;
+};
+
+&usb_otg {
+       /* otg support requires support for AXP221 usb-power-supply and GPIO */
+       dr_mode = "host";
+       status = "okay";
+};
+
+&usbphy {
+       usb1_vbus-supply = <&reg_dldo1>;
+       status = "okay";
+};
diff --git a/arch/arm/boot/dts/sun6i-a31s-sina31s-core.dtsi b/arch/arm/boot/dts/sun6i-a31s-sina31s-core.dtsi
new file mode 100644 (file)
index 0000000..ea69fb8
--- /dev/null
@@ -0,0 +1,140 @@
+/*
+ * Copyright 2015 Chen-Yu Tsai <wens@csie.org>
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This file 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; either version 2 of the
+ *     License, or (at your option) any later version.
+ *
+ *     This file is distributed in the hope that it will be useful,
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ * Or, alternatively,
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use,
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/dts-v1/;
+#include "sun6i-a31s.dtsi"
+#include "sunxi-common-regulators.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/pinctrl/sun4i-a10.h>
+
+/ {
+       model = "Sinlinx SinA31s Core Board";
+       compatible = "sinlinx,sina31s", "allwinner,sun6i-a31s";
+
+       aliases {
+               serial0 = &uart0;
+       };
+};
+
+&cpu0 {
+       cpu-supply = <&reg_dcdc3>;
+};
+
+/* eMMC on core board */
+&mmc2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&mmc2_8bit_emmc_pins>;
+       vmmc-supply = <&reg_dcdc1>;
+       bus-width = <8>;
+       non-removable;
+       status = "okay";
+};
+
+/* AXP221s PMIC on core board */
+&p2wi {
+       status = "okay";
+
+       axp22x: pmic@68 {
+               compatible = "x-powers,axp221";
+               reg = <0x68>;
+               interrupt-parent = <&nmi_intc>;
+               interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
+       };
+};
+
+#include "axp22x.dtsi"
+
+&reg_aldo3 {
+       regulator-always-on;
+       regulator-min-microvolt = <2700000>;
+       regulator-max-microvolt = <3300000>;
+       regulator-name = "avcc";
+};
+
+&reg_dc5ldo {
+       regulator-min-microvolt = <700000>;
+       regulator-max-microvolt = <1320000>;
+       regulator-name = "vdd-cpus";
+};
+
+&reg_dcdc1 {
+       regulator-always-on;
+       regulator-min-microvolt = <3000000>;
+       regulator-max-microvolt = <3000000>;
+       regulator-name = "vcc-3v0";
+};
+
+&reg_dcdc2 {
+       regulator-min-microvolt = <700000>;
+       regulator-max-microvolt = <1320000>;
+       regulator-name = "vdd-gpu";
+};
+
+&reg_dcdc3 {
+       regulator-always-on;
+       regulator-min-microvolt = <700000>;
+       regulator-max-microvolt = <1320000>;
+       regulator-name = "vdd-cpu";
+};
+
+&reg_dcdc4 {
+       regulator-always-on;
+       regulator-min-microvolt = <700000>;
+       regulator-max-microvolt = <1320000>;
+       regulator-name = "vdd-sys-dll";
+};
+
+&reg_dcdc5 {
+       regulator-always-on;
+       regulator-min-microvolt = <1500000>;
+       regulator-max-microvolt = <1500000>;
+       regulator-name = "vcc-dram";
+};
+
+/* UART0 pads available on core board */
+&uart0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart0_pins_a>;
+       status = "okay";
+};
+
diff --git a/arch/arm/boot/dts/sun6i-a31s-sina31s.dts b/arch/arm/boot/dts/sun6i-a31s-sina31s.dts
new file mode 100644 (file)
index 0000000..6ead2f5
--- /dev/null
@@ -0,0 +1,153 @@
+/*
+ * Copyright 2015 Chen-Yu Tsai <wens@csie.org>
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This file 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; either version 2 of the
+ *     License, or (at your option) any later version.
+ *
+ *     This file is distributed in the hope that it will be useful,
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ * Or, alternatively,
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use,
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/* The SinA31s development board has the SinA31s core board soldered on */
+#include "sun6i-a31s-sina31s-core.dtsi"
+
+#include <dt-bindings/input/input.h>
+
+/ {
+       model = "Sinlinx SinA31s Development Board";
+       compatible = "sinlinx,sina31s-sdk", "allwinner,sun6i-a31s";
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       leds {
+               compatible = "gpio-leds";
+               pinctrl-names = "default";
+               pinctrl-0 = <&led_pin_sina31s>;
+
+               status {
+                       label = "sina31s:status:usr";
+                       gpios = <&pio 7 13 GPIO_ACTIVE_HIGH>; /* PH13 */
+               };
+       };
+};
+
+&ehci0 {
+       /* USB 2.0 4 port hub IC */
+       status = "okay";
+};
+
+&ehci1 {
+       status = "okay";
+};
+
+&gmac {
+       pinctrl-names = "default";
+       pinctrl-0 = <&gmac_pins_mii_a>;
+       phy = <&phy1>;
+       phy-mode = "mii";
+       phy-supply = <&reg_dldo1>;
+       status = "okay";
+
+       phy1: ethernet-phy@1 {
+               reg = <1>;
+       };
+};
+
+&ir {
+       pinctrl-names = "default";
+       pinctrl-0 = <&ir_pins_a>;
+       status = "okay";
+};
+
+&lradc {
+       vref-supply = <&reg_aldo3>;
+       status = "okay";
+
+       button@158 {
+               label = "Volume Up";
+               linux,code = <KEY_VOLUMEUP>;
+               channel = <0>;
+               voltage = <158730>;
+       };
+
+       button@349 {
+               label = "Volume Down";
+               linux,code = <KEY_VOLUMEDOWN>;
+               channel = <0>;
+               voltage = <349206>;
+       };
+};
+
+&mmc0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_sina31s>;
+       vmmc-supply = <&reg_dcdc1>;
+       bus-width = <4>;
+       cd-gpios = <&pio 0 4 GPIO_ACTIVE_HIGH>; /* PA4 */
+       cd-inverted;
+       status = "okay";
+};
+
+&ohci1 {
+       status = "okay";
+};
+
+&pio {
+       led_pin_sina31s: led_pin@0 {
+               allwinner,pins = "PH13";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+       };
+
+       mmc0_cd_pin_sina31s: mmc0_cd_pin@0 {
+               allwinner,pins = "PA4";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+       };
+};
+
+&reg_dldo1 {
+       regulator-min-microvolt = <3300000>;
+       regulator-max-microvolt = <3300000>;
+       regulator-name = "vcc-gmac-phy";
+};
+
+&usbphy {
+       status = "okay";
+};
diff --git a/arch/arm/boot/dts/sun6i-a31s-sinovoip-bpi-m2.dts b/arch/arm/boot/dts/sun6i-a31s-sinovoip-bpi-m2.dts
new file mode 100644 (file)
index 0000000..db7fa13
--- /dev/null
@@ -0,0 +1,194 @@
+/*
+ * Copyright 2015 Hans de Goede <hdegoede@redhat.com>
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This library 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; either version 2 of the
+ *     License, or (at your option) any later version.
+ *
+ *     This library is distributed in the hope that it will be useful,
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ * Or, alternatively,
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use,
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/dts-v1/;
+#include "sun6i-a31s.dtsi"
+#include "sunxi-common-regulators.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+
+/ {
+       model = "Sinovoip BPI-M2";
+       compatible = "sinovoip,bpi-m2", "allwinner,sun6i-a31s";
+
+       aliases {
+               serial0 = &uart0;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       leds {
+               compatible = "gpio-leds";
+               pinctrl-names = "default";
+               pinctrl-0 = <&led_pins_bpi_m2>;
+
+               blue {
+                       label = "bpi-m2:blue:usr";
+                       gpios = <&pio 6 11 GPIO_ACTIVE_HIGH>; /* PG11 */
+               };
+
+               green {
+                       label = "bpi-m2:green:usr";
+                       gpios = <&pio 6 10 GPIO_ACTIVE_HIGH>; /* PG10 */
+               };
+
+               red {
+                       label = "bpi-m2:red:usr";
+                       gpios = <&pio 6 5 GPIO_ACTIVE_HIGH>; /* PG5 */
+               };
+       };
+
+       mmc2_pwrseq: mmc2_pwrseq {
+               compatible = "mmc-pwrseq-simple";
+               pinctrl-names = "default";
+               pinctrl-0 = <&mmc2_pwrseq_pin_bpi_m2>;
+               reset-gpios = <&r_pio 0 8 GPIO_ACTIVE_LOW>; /* PL8 WIFI_EN */
+       };
+};
+
+&ehci0 {
+       status = "okay";
+};
+
+&gmac {
+       pinctrl-names = "default";
+       pinctrl-0 = <&gmac_pins_rgmii_a>, <&gmac_phy_reset_pin_bpi_m2>;
+       phy = <&phy1>;
+       phy-mode = "rgmii";
+       snps,reset-gpio = <&pio 0 21 GPIO_ACTIVE_HIGH>; /* PA21 */
+       snps,reset-active-low;
+       snps,reset-delays-us = <0 10000 30000>;
+       status = "okay";
+
+       phy1: ethernet-phy@1 {
+               reg = <1>;
+       };
+};
+
+&ir {
+       pinctrl-names = "default";
+       pinctrl-0 = <&ir_pins_a>;
+       status = "okay";
+};
+
+&mmc0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_bpi_m2>;
+       vmmc-supply = <&reg_vcc3v0>;
+       bus-width = <4>;
+       cd-gpios = <&pio 0 4 GPIO_ACTIVE_HIGH>; /* PA4 */
+       cd-inverted;
+       status = "okay";
+};
+
+&mmc0_pins_a {
+       allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+};
+
+&mmc2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&mmc2_pins_a>;
+       vmmc-supply = <&reg_vcc3v0>;
+       mmc-pwrseq = <&mmc2_pwrseq>;
+       bus-width = <4>;
+       non-removable;
+       status = "okay";
+
+       brcmf: bcrmf@1 {
+               reg = <1>;
+               compatible = "brcm,bcm4329-fmac";
+               interrupt-parent = <&r_pio>;
+               interrupts = <0 5 IRQ_TYPE_LEVEL_LOW>; /* PL5 */
+               interrupt-names = "host-wake";
+       };
+};
+
+&mmc2_pins_a {
+       allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+};
+
+&ohci0 {
+       status = "okay";
+};
+
+&pio {
+       gmac_phy_reset_pin_bpi_m2: gmac_phy_reset_pin@0 {
+               allwinner,pins = "PA21";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+       };
+
+       led_pins_bpi_m2: led_pins@0 {
+               allwinner,pins = "PG5", "PG10", "PG11";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+       };
+
+       mmc0_cd_pin_bpi_m2: mmc0_cd_pin@0 {
+               allwinner,pins = "PA4";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+       };
+};
+
+&r_pio {
+       mmc2_pwrseq_pin_bpi_m2: mmc2_pwrseq_pin@0 {
+               allwinner,pins = "PL8";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+       };
+};
+
+&uart0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart0_pins_a>;
+       status = "okay";
+};
+
+&usbphy {
+       status = "okay";
+};
diff --git a/arch/arm/boot/dts/sun6i-a31s-yones-toptech-bs1078-v2.dts b/arch/arm/boot/dts/sun6i-a31s-yones-toptech-bs1078-v2.dts
new file mode 100644 (file)
index 0000000..b199020
--- /dev/null
@@ -0,0 +1,134 @@
+/*
+ * Copyright 2015 Lawrence Yu <lyu@micile.com>
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This file 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; either version 2 of the
+ *     License, or (at your option) any later version.
+ *
+ *     This file is distributed in the hope that it will be useful,
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ * Or, alternatively,
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use,
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/dts-v1/;
+#include "sun6i-a31s.dtsi"
+#include "sunxi-common-regulators.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/pinctrl/sun4i-a10.h>
+
+/ {
+       model = "Yones TopTech BS1078 v2 Tablet";
+       compatible = "yones-toptech,bs1078-v2", "allwinner,sun6i-a31s";
+
+       aliases {
+               serial0 = &uart0;
+               i2c1 = &i2c1;
+               i2c2 = &i2c2;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+};
+
+&i2c1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c1_pins_a>;
+       status = "okay";
+};
+
+&i2c2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c2_pins_a>;
+       status = "okay";
+};
+
+&ehci0 {
+       status = "okay";
+};
+
+&ehci1 {
+       status = "okay";
+};
+
+&ohci0 {
+       status = "okay";
+};
+
+&ohci1 {
+       status = "okay";
+};
+
+&pio {
+       mmc0_cd_pin_bs1078v2: mmc0_cd_pin@0 {
+               allwinner,pins = "PA8";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+       };
+};
+
+&mmc0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_bs1078v2>;
+       vmmc-supply = <&reg_vcc3v0>;
+       bus-width = <4>;
+       cd-gpios = <&pio 0 8 GPIO_ACTIVE_HIGH>; /* PA8 */
+       cd-inverted;
+       status = "okay";
+};
+
+&mmc0_pins_a {
+       allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+};
+
+&reg_usb1_vbus {
+       gpio = <&pio 7 27 GPIO_ACTIVE_HIGH>;
+       status = "okay";
+};
+
+&usb1_vbus_pin_a {
+       allwinner,pins = "PH27";
+};
+
+&usbphy {
+       usb1_vbus-supply = <&reg_usb1_vbus>;
+       status = "okay";
+};
+
+&uart0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart0_pins_a>;
+       status = "okay";
+};
index 9f7b472e6725606cfd850cf1fc69b961ea6d6e20..fd7594ff90d5e6cddd2622e912c26bfdc25fea94 100644 (file)
        status = "okay";
 };
 
+&cpu0 {
+       cpu-supply = <&reg_dcdc2>;
+       operating-points = <
+               /* kHz    uV */
+               960000  1400000
+               912000  1400000
+               864000  1350000
+               720000  1250000
+               528000  1150000
+               312000  1100000
+               144000  1050000
+               >;
+};
+
 &ehci0 {
        status = "okay";
 };
        status = "okay";
 
        axp209: pmic@34 {
-               compatible = "x-powers,axp209";
                reg = <0x34>;
                interrupt-parent = <&nmi_intc>;
                interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
-
-               interrupt-controller;
-               #interrupt-cells = <1>;
        };
 };
 
        status = "okay";
 };
 
+&otg_sram {
+       status = "okay";
+};
+
 &pio {
+       usb0_id_detect_pin: usb0_id_detect_pin@0 {
+               allwinner,pins = "PH4";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+       };
+
        mmc0_cd_pin_bananapi: mmc0_cd_pin@0 {
                allwinner,pins = "PH10";
                allwinner,function = "gpio_in";
        };
 };
 
+#include "axp209.dtsi"
+
+&reg_dcdc2 {
+       regulator-always-on;
+       regulator-min-microvolt = <1000000>;
+       regulator-max-microvolt = <1400000>;
+       regulator-name = "vdd-cpu";
+};
+
+&reg_dcdc3 {
+       regulator-always-on;
+       regulator-min-microvolt = <1000000>;
+       regulator-max-microvolt = <1400000>;
+       regulator-name = "vdd-int-dll";
+};
+
+&reg_ldo1 {
+       regulator-name = "vdd-rtc";
+};
+
+&reg_ldo2 {
+       regulator-always-on;
+       regulator-min-microvolt = <3000000>;
+       regulator-max-microvolt = <3000000>;
+       regulator-name = "avcc";
+};
+
+&reg_usb0_vbus {
+       status = "okay";
+};
+
 &reg_usb1_vbus {
        status = "okay";
 };
        status = "okay";
 };
 
+&usb_otg {
+       dr_mode = "otg";
+       status = "okay";
+};
+
+&usb_power_supply {
+       status = "okay";
+};
+
 &usbphy {
+       pinctrl-names = "default";
+       pinctrl-0 = <&usb0_id_detect_pin>;
+       usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
+       usb0_vbus_power-supply = <&usb_power_supply>;
+       usb0_vbus-supply = <&reg_usb0_vbus>;
        usb1_vbus-supply = <&reg_usb1_vbus>;
        usb2_vbus-supply = <&reg_usb2_vbus>;
        status = "okay";
index 39a51d5143f73b075d8dc4d4e7781d3ea919a2c5..1fa832d7b469829636c18ca22c60a06a56ddfd06 100644 (file)
        status = "okay";
 };
 
+&codec {
+       status = "okay";
+};
+
 &cpu0 {
        cpu-supply = <&reg_dcdc2>;
 };
        status = "okay";
 };
 
+&otg_sram {
+       status = "okay";
+};
+
 &pio {
        led_pins_cubieboard2: led_pins@0 {
                allwinner,pins = "PH20", "PH21";
                allwinner,drive = <SUN4I_PINCTRL_10_MA>;
                allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
        };
+
+       usb0_id_detect_pin: usb0_id_detect_pin@0 {
+               allwinner,pins = "PH4";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+       };
 };
 
 &reg_ahci_5v {
        status = "okay";
 };
 
+&usb_otg {
+       dr_mode = "otg";
+       status = "okay";
+};
+
 #include "axp209.dtsi"
 
 &reg_dcdc2 {
 };
 
 &usbphy {
+       pinctrl-names = "default";
+       pinctrl-0 = <&usb0_id_detect_pin>;
+       usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
        usb1_vbus-supply = <&reg_usb1_vbus>;
        usb2_vbus-supply = <&reg_usb2_vbus>;
        status = "okay";
index e6b019232a9e880ea48a9b7f9dd975f6846be84e..8da939ab835001ab79b0be8409324210a0bc4fa7 100644 (file)
        status = "okay";
 };
 
+&codec {
+       status = "okay";
+};
+
 &cpu0 {
        cpu-supply = <&reg_dcdc2>;
 };
diff --git a/arch/arm/boot/dts/sun7i-a20-olimex-som-evb.dts b/arch/arm/boot/dts/sun7i-a20-olimex-som-evb.dts
new file mode 100644 (file)
index 0000000..b7fe102
--- /dev/null
@@ -0,0 +1,198 @@
+/*
+ * Copyright 2015 - Marcus Cooper <codekipper@gmail.com>
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This file 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; either version 2 of the
+ *     License, or (at your option) any later version.
+ *
+ *     This file is distributed in the hope that it will be useful,
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ * Or, alternatively,
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use,
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/dts-v1/;
+#include "sun7i-a20.dtsi"
+#include "sunxi-common-regulators.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+#include <dt-bindings/pinctrl/sun4i-a10.h>
+
+/ {
+       model = "Olimex A20-Olimex-SOM-EVB";
+       compatible = "olimex,a20-olimex-som-evb", "allwinner,sun7i-a20";
+
+       aliases {
+               serial0 = &uart0;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       leds {
+               compatible = "gpio-leds";
+               pinctrl-names = "default";
+               pinctrl-0 = <&led_pins_olimex_som_evb>;
+
+               green {
+                       label = "a20-olimex-som-evb:green:usr";
+                       gpios = <&pio 7 2 GPIO_ACTIVE_HIGH>;
+                       default-state = "on";
+               };
+       };
+};
+
+&ahci {
+       target-supply = <&reg_ahci_5v>;
+       status = "okay";
+};
+
+&ehci0 {
+       status = "okay";
+};
+
+&ehci1 {
+       status = "okay";
+};
+
+&gmac {
+       pinctrl-names = "default";
+       pinctrl-0 = <&gmac_pins_rgmii_a>;
+       phy = <&phy1>;
+       phy-mode = "rgmii";
+       status = "okay";
+
+       phy1: ethernet-phy@1 {
+               reg = <1>;
+       };
+};
+
+&i2c0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c0_pins_a>;
+       status = "okay";
+
+       axp209: pmic@34 {
+               reg = <0x34>;
+               interrupt-parent = <&nmi_intc>;
+               interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
+       };
+};
+
+&mmc0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>;
+       vmmc-supply = <&reg_vcc3v3>;
+       bus-width = <4>;
+       cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */
+       cd-inverted;
+       status = "okay";
+};
+
+&ohci0 {
+       status = "okay";
+};
+
+&ohci1 {
+       status = "okay";
+};
+
+&pio {
+       ahci_pwr_pin_olimex_som_evb: ahci_pwr_pin@1 {
+               allwinner,pins = "PC3";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+       };
+
+       led_pins_olimex_som_evb: led_pins@0 {
+               allwinner,pins = "PH2";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_20_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+       };
+};
+
+&reg_ahci_5v {
+       pinctrl-0 = <&ahci_pwr_pin_olimex_som_evb>;
+       gpio = <&pio 2 3 GPIO_ACTIVE_HIGH>;
+       status = "okay";
+};
+
+#include "axp209.dtsi"
+
+&reg_dcdc2 {
+       regulator-always-on;
+       regulator-min-microvolt = <1000000>;
+       regulator-max-microvolt = <1400000>;
+       regulator-name = "vdd-cpu";
+};
+
+&reg_dcdc3 {
+       regulator-always-on;
+       regulator-min-microvolt = <1000000>;
+       regulator-max-microvolt = <1400000>;
+       regulator-name = "vdd-int-dll";
+};
+
+&reg_ldo1 {
+       regulator-name = "vdd-rtc";
+};
+
+&reg_ldo2 {
+       regulator-always-on;
+       regulator-min-microvolt = <3000000>;
+       regulator-max-microvolt = <3000000>;
+       regulator-name = "avcc";
+};
+
+&reg_usb1_vbus {
+       status = "okay";
+};
+
+&reg_usb2_vbus {
+       status = "okay";
+};
+
+&uart0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart0_pins_a>;
+       status = "okay";
+};
+
+&usbphy {
+       usb1_vbus-supply = <&reg_usb1_vbus>;
+       usb2_vbus-supply = <&reg_usb2_vbus>;
+       status = "okay";
+};
index 04237085dc394423add52ff8d23486a183c5d55d..35ad7006c53ce7ea88d514977ce891aa2be5a92c 100644 (file)
        };
 };
 
+&i2c1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c1_pins_a>;
+       status = "okay";
+
+       eeprom: eeprom@50 {
+               compatible = "atmel,24c16";
+               reg = <0x50>;
+               pagesize = <16>;
+       };
+};
+
 &mmc0 {
        pinctrl-names = "default";
        pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>;
index 8acff78272b7fe571f38758ef4d335a9ff32c28e..d5c796c8d16f272ac6925438f95b6ec9616a50ee 100644 (file)
        pinctrl-names = "default";
        pinctrl-0 = <&i2c1_pins_a>;
        status = "okay";
+
+       eeprom: eeprom@50 {
+               compatible = "atmel,24c16";
+               reg = <0x50>;
+               pagesize = <16>;
+       };
 };
 
 &mmc0 {
        status = "okay";
 };
 
+&otg_sram {
+       status = "okay";
+};
+
 &pio {
        ahci_pwr_pin_olinuxinolime: ahci_pwr_pin@1 {
                allwinner,pins = "PC3";
                allwinner,drive = <SUN4I_PINCTRL_20_MA>;
                allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
        };
+
+       usb0_id_detect_pin: usb0_id_detect_pin@0 {
+               allwinner,pins = "PH4";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+       };
+
+       usb0_vbus_detect_pin: usb0_vbus_detect_pin@0 {
+               allwinner,pins = "PH5";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_PULL_DOWN>;
+       };
+
+       usb0_vbus_pin_lime2: usb0_vbus_pin@0 {
+               allwinner,pins = "PC17";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+       };
 };
 
 &reg_ahci_5v {
        status = "okay";
 };
 
+&reg_usb0_vbus {
+       pinctrl-0 = <&usb0_vbus_pin_lime2>;
+       gpio = <&pio 2 17 GPIO_ACTIVE_HIGH>;
+       status = "okay";
+};
+
 &reg_usb1_vbus {
        status = "okay";
 };
        status = "okay";
 };
 
+&usb_otg {
+       dr_mode = "otg";
+       status = "okay";
+};
+
 &usbphy {
+       pinctrl-names = "default";
+       pinctrl-0 = <&usb0_id_detect_pin>, <&usb0_vbus_detect_pin>;
+       usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
+       usb0_vbus_det-gpio = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH5 */
+       usb0_vbus-supply = <&reg_usb0_vbus>;
        usb1_vbus-supply = <&reg_usb1_vbus>;
        usb2_vbus-supply = <&reg_usb2_vbus>;
        status = "okay";
index c5d70caade8238179f136f5326adb25fa8454c41..7e3006f6a775acbad79841fd74084c3aac0ce01a 100644 (file)
        pinctrl-names = "default";
        pinctrl-0 = <&i2c1_pins_a>;
        status = "okay";
+
+       eeprom: eeprom@50 {
+               compatible = "atmel,24c16";
+               reg = <0x50>;
+               pagesize = <16>;
+       };
 };
 
 &i2c2 {
index 73cd81ee02e3d526bf571cb0d41e09f689a96ca5..4f65664e5dfef0de42cbc52545da44c9429c693e 100644 (file)
        status = "okay";
 };
 
+&otg_sram {
+       status = "okay";
+};
+
 &pio {
+       usb0_id_detect_pin: usb0_id_detect_pin@0 {
+               allwinner,pins = "PH4";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+       };
+
        mmc0_cd_pin_orangepi: mmc0_cd_pin@0 {
                allwinner,pins = "PH10";
                allwinner,function = "gpio_in";
        regulator-name = "avcc";
 };
 
+&reg_usb0_vbus {
+       status = "okay";
+};
+
 &reg_usb1_vbus {
        pinctrl-0 = <&usb1_vbus_pin_bananapro>;
        gpio = <&pio 7 26 GPIO_ACTIVE_HIGH>; /* PH26 */
        status = "okay";
 };
 
+&usb_otg {
+       dr_mode = "otg";
+       status = "okay";
+};
+
+&usb_power_supply {
+       status = "okay";
+};
+
 &usbphy {
+       pinctrl-names = "default";
+       pinctrl-0 = <&usb0_id_detect_pin>;
+       usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
+       usb0_vbus_power-supply = <&usb_power_supply>;
+       usb0_vbus-supply = <&reg_usb0_vbus>;
        usb1_vbus-supply = <&reg_usb1_vbus>;
        usb2_vbus-supply = <&reg_usb2_vbus>;
        status = "okay";
index 55a06ceb80ec2176f4c686e48ba2efc791dd4d0f..71125bf6457513db6b2b606cc856572035d3f091 100644 (file)
        status = "okay";
 };
 
+&otg_sram {
+       status = "okay";
+};
+
 &pio {
+       usb0_id_detect_pin: usb0_id_detect_pin@0 {
+               allwinner,pins = "PH4";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+       };
+
        mmc0_cd_pin_orangepi: mmc0_cd_pin@0 {
                allwinner,pins = "PH10";
                allwinner,function = "gpio_in";
        regulator-name = "avcc";
 };
 
+&reg_usb0_vbus {
+       status = "okay";
+};
+
 &reg_usb1_vbus {
        pinctrl-0 = <&usb1_vbus_pin_bananapro>;
        gpio = <&pio 7 26 GPIO_ACTIVE_HIGH>; /* PH26 */
        status = "okay";
 };
 
+&usb_otg {
+       dr_mode = "otg";
+       status = "okay";
+};
+
+&usb_power_supply {
+       status = "okay";
+};
+
 &usbphy {
+       pinctrl-names = "default";
+       pinctrl-0 = <&usb0_id_detect_pin>;
+       usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
+       usb0_vbus_power-supply = <&usb_power_supply>;
+       usb0_vbus-supply = <&reg_usb0_vbus>;
        usb1_vbus-supply = <&reg_usb1_vbus>;
        usb2_vbus-supply = <&reg_usb2_vbus>;
        status = "okay";
index 5361fce26b45ce53a527f141feb1507ffd54abc3..1757a6ad74e9c80ea59e527d7c568fb87828b950 100644 (file)
        status = "okay";
 };
 
+&cpu0 {
+       cpu-supply = <&reg_dcdc2>;
+};
+
 &ehci0 {
        status = "okay";
 };
        status = "okay";
 
        axp209: pmic@34 {
-               compatible = "x-powers,axp209";
                reg = <0x34>;
                interrupt-parent = <&nmi_intc>;
                interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
-
-               interrupt-controller;
-               #interrupt-cells = <1>;
        };
 };
 
        status = "okay";
 };
 
+&otg_sram {
+       status = "okay";
+};
+
 &pio {
        ahci_pwr_pin_pcduino3_nano: ahci_pwr_pin@0 {
                allwinner,pins = "PH2";
                allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
        };
 
+       usb0_id_detect_pin: usb0_id_detect_pin@0 {
+               allwinner,pins = "PH4";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+       };
+
        usb1_vbus_pin_pcduino3_nano: usb1_vbus_pin@0 {
-               allwinner,pins = "PH11";
+               allwinner,pins = "PD2";
                allwinner,function = "gpio_out";
                allwinner,drive = <SUN4I_PINCTRL_10_MA>;
                allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
        status = "okay";
 };
 
-&reg_usb1_vbus {
-       pinctrl-0 = <&usb1_vbus_pin_pcduino3_nano>;
-       gpio = <&pio 7 11 GPIO_ACTIVE_HIGH>; /* PH11 */
-       status = "okay";
+#include "axp209.dtsi"
+
+&reg_dcdc2 {
+       regulator-always-on;
+       regulator-min-microvolt = <1000000>;
+       regulator-max-microvolt = <1400000>;
+       regulator-name = "vdd-cpu";
 };
 
-&reg_usb2_vbus {
+&reg_dcdc3 {
+       regulator-always-on;
+       regulator-min-microvolt = <1000000>;
+       regulator-max-microvolt = <1400000>;
+       regulator-name = "vdd-int-pll";
+};
+
+&reg_ldo1 {
+       regulator-name = "vdd-rtc";
+};
+
+&reg_ldo2 {
+       regulator-always-on;
+       regulator-min-microvolt = <3000000>;
+       regulator-max-microvolt = <3000000>;
+       regulator-name = "avcc";
+};
+
+/* A single regulator (U24) powers both USB host ports. */
+&reg_usb1_vbus {
+       pinctrl-0 = <&usb1_vbus_pin_pcduino3_nano>;
+       gpio = <&pio 3 2 GPIO_ACTIVE_HIGH>; /* PD2 */
        status = "okay";
 };
 
        status = "okay";
 };
 
+&usb_otg {
+       dr_mode = "otg";
+       status = "okay";
+};
+
 &usbphy {
+       pinctrl-names = "default";
+       pinctrl-0 = <&usb0_id_detect_pin>;
+       usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
        usb1_vbus-supply = <&reg_usb1_vbus>;
-       usb2_vbus-supply = <&reg_usb2_vbus>;
+       usb2_vbus-supply = <&reg_usb1_vbus>;
        status = "okay";
 };
index afc9ecebed21a6c4c89b9981d1d71a1eb1b0641f..861a4a66fb19db62a7649584be9313227283ba39 100644 (file)
        allwinner,pins = "PH2";
 };
 
+&cpu0 {
+       cpu-supply = <&reg_dcdc2>;
+};
+
 &ehci0 {
        status = "okay";
 };
        status = "okay";
 
        axp209: pmic@34 {
-               compatible = "x-powers,axp209";
                reg = <0x34>;
                interrupt-parent = <&nmi_intc>;
                interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
-
-               interrupt-controller;
-               #interrupt-cells = <1>;
        };
 };
 
+#include "axp209.dtsi"
+
 &ir0 {
        pinctrl-names = "default";
        pinctrl-0 = <&ir0_rx_pins_a>;
        status = "okay";
 };
 
+&otg_sram {
+       status = "okay";
+};
+
 &pio {
        led_pins_pcduino3: led_pins@0 {
                allwinner,pins = "PH15", "PH16";
                allwinner,drive = <SUN4I_PINCTRL_10_MA>;
                allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
        };
+
+       usb0_id_detect_pin: usb0_id_detect_pin@0 {
+               allwinner,pins = "PH4";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+       };
 };
 
 &reg_ahci_5v {
        status = "okay";
 };
 
+&reg_dcdc2 {
+       regulator-always-on;
+       regulator-min-microvolt = <1000000>;
+       regulator-max-microvolt = <1400000>;
+       regulator-name = "vdd-cpu";
+};
+
+&reg_dcdc3 {
+       regulator-always-on;
+       regulator-min-microvolt = <1000000>;
+       regulator-max-microvolt = <1400000>;
+       regulator-name = "vdd-int-pll";
+};
+
+&reg_ldo1 {
+       regulator-name = "vdd-rtc";
+};
+
+&reg_ldo2 {
+       regulator-always-on;
+       regulator-min-microvolt = <3000000>;
+       regulator-max-microvolt = <3000000>;
+       regulator-name = "avcc";
+};
+
 &reg_usb1_vbus {
        status = "okay";
 };
        status = "okay";
 };
 
+&usb_otg {
+       dr_mode = "otg";
+       status = "okay";
+};
+
 &usbphy {
+       pinctrl-names = "default";
+       pinctrl-0 = <&usb0_id_detect_pin>;
+       usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
        usb1_vbus-supply = <&reg_usb1_vbus>;
        usb2_vbus-supply = <&reg_usb2_vbus>;
        status = "okay";
index 83c6d3f872ffa2a5cdb512c3c8c4e5d3019d5519..78239ad988e729fc51187b2c4237258a9edddbfb 100644 (file)
@@ -86,6 +86,8 @@
        };
 };
 
+#include "axp209.dtsi"
+
 &i2c1 {
        pinctrl-names = "default";
        pinctrl-0 = <&i2c1_pins_a>;
        status = "okay";
 };
 
-#include "axp209.dtsi"
+&otg_sram {
+       status = "okay";
+};
+
+&pio {
+       usb0_id_detect_pin: usb0_id_detect_pin@0 {
+               allwinner,pins = "PH4";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+       };
+};
 
 &reg_dcdc2 {
        regulator-always-on;
        regulator-name = "avcc";
 };
 
+&reg_usb0_vbus {
+       status = "okay";
+};
+
 &reg_usb1_vbus {
        status = "okay";
 };
        status = "okay";
 };
 
+&usb_otg {
+       dr_mode = "otg";
+       status = "okay";
+};
+
+&usb_power_supply {
+       status = "okay";
+};
+
 &usbphy {
+       pinctrl-names = "default";
+       pinctrl-0 = <&usb0_id_detect_pin>;
+       usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
+       usb0_vbus_power-supply = <&usb_power_supply>;
+       usb0_vbus-supply = <&reg_usb0_vbus>;
        usb1_vbus-supply = <&reg_usb1_vbus>;
        usb2_vbus-supply = <&reg_usb2_vbus>;
        status = "okay";
diff --git a/arch/arm/boot/dts/sun7i-a20-wits-pro-a20-dkt.dts b/arch/arm/boot/dts/sun7i-a20-wits-pro-a20-dkt.dts
new file mode 100644 (file)
index 0000000..85b500d
--- /dev/null
@@ -0,0 +1,226 @@
+/*
+ * Copyright 2015 Jelle de Jong <jelledejong@powercraft.nl>
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This file 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; either version 2 of the
+ *     License, or (at your option) any later version.
+ *
+ *     This file is distributed in the hope that it will be useful,
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ * Or, alternatively,
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use,
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/dts-v1/;
+#include "sun7i-a20.dtsi"
+#include "sunxi-common-regulators.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+
+/ {
+       model = "Wits Pro A20 DKT";
+       compatible = "wits,pro-a20-dkt", "allwinner,sun7i-a20";
+
+       aliases {
+               serial0 = &uart0;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       mmc3_pwrseq: mmc3_pwrseq {
+               compatible = "mmc-pwrseq-simple";
+               pinctrl-names = "default";
+               pinctrl-0 = <&vmmc3_pin_ap6xxx_wl_regon>;
+               reset-gpios = <&pio 7 9 GPIO_ACTIVE_LOW>; /* PH9 WIFI_EN */
+       };
+};
+
+&cpu0 {
+       cpu-supply = <&reg_dcdc2>;
+};
+
+&ehci0 {
+       status = "okay";
+};
+
+&ehci1 {
+       status = "okay";
+};
+
+&i2c0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c0_pins_a>;
+       status = "okay";
+
+       axp209: pmic@34 {
+               reg = <0x34>;
+               interrupt-parent = <&nmi_intc>;
+               interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
+       };
+};
+
+&i2c1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c1_pins_a>;
+       status = "okay";
+};
+
+&i2c2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c2_pins_a>;
+       status = "okay";
+};
+
+#include "axp209.dtsi"
+
+&mmc0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>;
+       vmmc-supply = <&reg_vcc3v3>;
+       bus-width = <4>;
+       cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */
+       cd-inverted;
+       status = "okay";
+};
+
+&mmc3 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&mmc3_pins_a>;
+       vmmc-supply = <&reg_vcc3v3>;
+       mmc-pwrseq = <&mmc3_pwrseq>;
+       bus-width = <4>;
+       non-removable;
+       status = "okay";
+
+       brcmf: bcrmf@1 {
+               reg = <1>;
+               compatible = "brcm,bcm4329-fmac";
+               interrupt-parent = <&pio>;
+               interrupts = <7 10 IRQ_TYPE_LEVEL_LOW>; /* PH10 / EINT10 */
+               interrupt-names = "host-wake";
+       };
+};
+
+&ohci0 {
+       status = "okay";
+};
+
+&ohci1 {
+       status = "okay";
+};
+
+&otg_sram {
+       status = "okay";
+};
+
+&pio {
+       vmmc3_pin_ap6xxx_wl_regon: vmmc3_pin@0 {
+               allwinner,pins = "PH9";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+       };
+
+       usb0_id_detect_pin: usb0_id_detect_pin@0 {
+               allwinner,pins = "PH4";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+       };
+};
+
+&reg_dcdc2 {
+       regulator-always-on;
+       regulator-min-microvolt = <1000000>;
+       regulator-max-microvolt = <1450000>;
+       regulator-name = "vdd-cpu";
+};
+
+&reg_dcdc3 {
+       regulator-always-on;
+       regulator-min-microvolt = <1000000>;
+       regulator-max-microvolt = <1400000>;
+       regulator-name = "vdd-int-dll";
+};
+
+&reg_ldo1 {
+       regulator-name = "vdd-rtc";
+};
+
+&reg_ldo2 {
+       regulator-always-on;
+       regulator-min-microvolt = <3000000>;
+       regulator-max-microvolt = <3000000>;
+       regulator-name = "avcc";
+};
+
+&reg_usb0_vbus {
+       status = "okay";
+};
+
+&reg_usb1_vbus {
+       status = "okay";
+};
+
+&reg_usb2_vbus {
+       status = "okay";
+};
+
+&uart0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart0_pins_a>;
+       status = "okay";
+};
+
+&usb_otg {
+       dr_mode = "otg";
+       status = "okay";
+};
+
+&usb_power_supply {
+       status = "okay";
+};
+
+&usbphy {
+       pinctrl-names = "default";
+       pinctrl-0 = <&usb0_id_detect_pin>;
+       usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
+       usb0_vbus_power-supply = <&usb_power_supply>;
+       usb0_vbus-supply = <&reg_usb0_vbus>;
+       usb1_vbus-supply = <&reg_usb1_vbus>;
+       usb2_vbus-supply = <&reg_usb2_vbus>;
+       status = "okay";
+};
index 391230c3dc938fb1a0a4c92ea91e05a209319baa..e02eb720c4fc1ab192bd76ba0aab0893282ee553 100644 (file)
@@ -47,6 +47,7 @@
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/thermal/thermal.h>
 
+#include <dt-bindings/clock/sun4i-a10-pll2.h>
 #include <dt-bindings/dma/sun4i-a10.h>
 #include <dt-bindings/pinctrl/sun4i-a10.h>
 
                        clock-output-names = "pll1";
                };
 
+               pll2: clk@01c20008 {
+                       #clock-cells = <1>;
+                       compatible = "allwinner,sun4i-a10-pll2-clk";
+                       reg = <0x01c20008 0x8>;
+                       clocks = <&osc24M>;
+                       clock-output-names = "pll2-1x", "pll2-2x",
+                                            "pll2-4x", "pll2-8x";
+               };
+
                pll4: clk@01c20018 {
                        #clock-cells = <0>;
                        compatible = "allwinner,sun7i-a20-pll4-clk";
                        clock-output-names = "ir1";
                };
 
+               keypad_clk: clk@01c200c4 {
+                       #clock-cells = <0>;
+                       compatible = "allwinner,sun4i-a10-mod0-clk";
+                       reg = <0x01c200c4 0x4>;
+                       clocks = <&osc24M>;
+                       clock-output-names = "keypad";
+               };
+
                usb_clk: clk@01c200cc {
                        #clock-cells = <1>;
                        #reset-cells = <1>;
                        clock-output-names = "spi3";
                };
 
+               codec_clk: clk@01c20140 {
+                       #clock-cells = <0>;
+                       compatible = "allwinner,sun4i-a10-codec-clk";
+                       reg = <0x01c20140 0x4>;
+                       clocks = <&pll2 SUN4I_A10_PLL2_1X>;
+                       clock-output-names = "codec";
+               };
+
                mbus_clk: clk@01c2015c {
                        #clock-cells = <0>;
                        compatible = "allwinner,sun5i-a13-mbus-clk";
                        status = "disabled";
                };
 
+               codec: codec@01c22c00 {
+                       #sound-dai-cells = <0>;
+                       compatible = "allwinner,sun7i-a20-codec";
+                       reg = <0x01c22c00 0x40>;
+                       interrupts = <GIC_SPI 30 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&apb0_gates 0>, <&codec_clk>;
+                       clock-names = "apb", "codec";
+                       dmas = <&dma SUN4I_DMA_NORMAL 19>,
+                              <&dma SUN4I_DMA_NORMAL 19>;
+                       dma-names = "rx", "tx";
+                       status = "disabled";
+               };
+
                sid: eeprom@01c23800 {
                        compatible = "allwinner,sun7i-a20-sid";
                        reg = <0x01c23800 0x200>;
index 27a925ec17d2df346ebb80efa0bc37f4e300e8c8..0c0964d4fa1f81b2a18791f76664012cce3d5c61 100644 (file)
                        clock-output-names = "apb1";
                };
 
-               ahb1_gates: clk@01c20060 {
-                       #clock-cells = <1>;
-                       compatible = "allwinner,sun8i-a23-ahb1-gates-clk";
-                       reg = <0x01c20060 0x8>;
-                       clocks = <&ahb1>;
-                       clock-indices = <1>, <6>,
-                                       <8>, <9>, <10>,
-                                       <13>, <14>,
-                                       <19>, <20>,
-                                       <21>, <24>, <26>,
-                                       <29>, <32>, <36>,
-                                       <40>, <44>, <46>,
-                                       <52>, <54>,
-                                       <57>;
-                       clock-output-names = "ahb1_mipidsi", "ahb1_dma",
-                                       "ahb1_mmc0", "ahb1_mmc1", "ahb1_mmc2",
-                                       "ahb1_nand", "ahb1_sdram",
-                                       "ahb1_hstimer", "ahb1_spi0",
-                                       "ahb1_spi1", "ahb1_otg", "ahb1_ehci",
-                                       "ahb1_ohci", "ahb1_ve", "ahb1_lcd",
-                                       "ahb1_csi", "ahb1_be",  "ahb1_fe",
-                                       "ahb1_gpu", "ahb1_spinlock",
-                                       "ahb1_drc";
-               };
-
                apb1_gates: clk@01c20068 {
                        #clock-cells = <1>;
                        compatible = "allwinner,sun8i-a23-apb1-gates-clk";
                                allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
                        };
 
+                       pwm0_pins: pwm0 {
+                               allwinner,pins = "PH0";
+                               allwinner,function = "pwm0";
+                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+                       };
+
                        i2c0_pins_a: i2c0@0 {
                                allwinner,pins = "PH2", "PH3";
                                allwinner,function = "i2c0";
                        interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>;
                };
 
+               pwm: pwm@01c21400 {
+                       compatible = "allwinner,sun7i-a20-pwm";
+                       reg = <0x01c21400 0xc>;
+                       clocks = <&osc24M>;
+                       #pwm-cells = <3>;
+                       status = "disabled";
+               };
+
                lradc: lradc@01c22800 {
                        compatible = "allwinner,sun4i-a10-lradc-keys";
                        reg = <0x01c22800 0x100>;
                                     <GIC_SPI 41 IRQ_TYPE_LEVEL_HIGH>;
                };
 
+               nmi_intc: interrupt-controller@01f00c0c {
+                       compatible = "allwinner,sun6i-a31-sc-nmi";
+                       interrupt-controller;
+                       #interrupt-cells = <2>;
+                       reg = <0x01f00c0c 0x38>;
+                       interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
+               };
+
                prcm@01f01400 {
                        compatible = "allwinner,sun8i-a23-prcm";
                        reg = <0x01f01400 0x200>;
                        resets = <&apb0_rst 0>;
                        gpio-controller;
                        interrupt-controller;
+                       #interrupt-cells = <3>;
                        #address-cells = <1>;
                        #size-cells = <0>;
                        #gpio-cells = <3>;
 
+                       r_rsb_pins: r_rsb {
+                               allwinner,pins = "PL0", "PL1";
+                               allwinner,function = "s_rsb";
+                               allwinner,drive = <SUN4I_PINCTRL_20_MA>;
+                               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+                       };
+
                        r_uart_pins_a: r_uart@0 {
                                allwinner,pins = "PL2", "PL3";
                                allwinner,function = "s_uart";
                                allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
                        };
                };
+
+               r_rsb: rsb@01f03400 {
+                       compatible = "allwinner,sun8i-a23-rsb";
+                       reg = <0x01f03400 0x400>;
+                       interrupts = <GIC_SPI 39 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&apb0_gates 3>;
+                       clock-frequency = <3000000>;
+                       resets = <&apb0_rst 3>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&r_rsb_pins>;
+                       status = "disabled";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+               };
        };
 };
diff --git a/arch/arm/boot/dts/sun8i-a23-gt90h-v4.dts b/arch/arm/boot/dts/sun8i-a23-gt90h-v4.dts
new file mode 100644 (file)
index 0000000..1aeb06c
--- /dev/null
@@ -0,0 +1,145 @@
+/*
+ * Copyright 2015 Hans de Goede <hdegoede@redhat.com>
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This file 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; either version 2 of the
+ *     License, or (at your option) any later version.
+ *
+ *     This file is distributed in the hope that it will be useful,
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ * Or, alternatively,
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use,
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/dts-v1/;
+#include "sun8i-a23.dtsi"
+#include "sunxi-common-regulators.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/pinctrl/sun4i-a10.h>
+
+/ {
+       model = "Allwinner GT90H Quad Core Tablet (v4)";
+       compatible = "allwinner,gt90h-v4", "allwinner,sun8i-a33";
+
+       aliases {
+               serial0 = &r_uart;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+};
+
+&ehci0 {
+       status = "okay";
+};
+
+&i2c0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c0_pins_a>;
+       status = "okay";
+};
+
+&i2c1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c1_pins_a>;
+       status = "okay";
+};
+
+&lradc {
+       vref-supply = <&reg_vcc3v0>;
+       status = "okay";
+
+       button@200 {
+               label = "Volume Up";
+               linux,code = <KEY_VOLUMEUP>;
+               channel = <0>;
+               voltage = <200000>;
+       };
+
+       button@400 {
+               label = "Volume Down";
+               linux,code = <KEY_VOLUMEDOWN>;
+               channel = <0>;
+               voltage = <400000>;
+       };
+
+       button@600 {
+               label = "Back";
+               linux,code = <KEY_BACK>;
+               channel = <0>;
+               voltage = <600000>;
+       };
+};
+
+&mmc0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_gt90h>;
+       /* FIXME this really is aldo1, correct once we've pmic support */
+       vmmc-supply = <&reg_vcc3v0>;
+       bus-width = <4>;
+       cd-gpios = <&pio 1 4 GPIO_ACTIVE_HIGH>; /* PB4 */
+       cd-inverted;
+       status = "okay";
+};
+
+&pio {
+       mmc0_cd_pin_gt90h: mmc0_cd_pin@0 {
+               allwinner,pins = "PB4";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+       };
+};
+
+&r_uart {
+       pinctrl-names = "default";
+       pinctrl-0 = <&r_uart_pins_a>;
+       status = "okay";
+};
+
+/*
+ * FIXME for now we only support host mode and rely on u-boot to have
+ * turned on Vbus which is controlled by the axp223 pmic on the board.
+ *
+ * Once we have axp223 support we should switch to fully supporting otg.
+ */
+&usb_otg {
+       dr_mode = "host";
+       status = "okay";
+};
+
+&usbphy {
+       status = "okay";
+};
deleted file mode 100644 (file)
index 382d64c3b78e6dcf05614dda6f6994d7bbd0d948..0000000000000000000000000000000000000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright 2015 Hans de Goede <hdegoede@redhat.com>
- *
- * This file is dual-licensed: you can use it either under the terms
- * of the GPL or the X11 license, at your option. Note that this dual
- * licensing only applies to this file, and not this project as a
- * whole.
- *
- *  a) This file 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; either version 2 of the
- *     License, or (at your option) any later version.
- *
- *     This file is distributed in the hope that it will be useful,
- *     but WITHOUT ANY WARRANTY; without even the implied warranty of
- *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *     GNU General Public License for more details.
- *
- * Or, alternatively,
- *
- *  b) Permission is hereby granted, free of charge, to any person
- *     obtaining a copy of this software and associated documentation
- *     files (the "Software"), to deal in the Software without
- *     restriction, including without limitation the rights to use,
- *     copy, modify, merge, publish, distribute, sublicense, and/or
- *     sell copies of the Software, and to permit persons to whom the
- *     Software is furnished to do so, subject to the following
- *     conditions:
- *
- *     The above copyright notice and this permission notice shall be
- *     included in all copies or substantial portions of the Software.
- *
- *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- *     OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/*
- * The Ippo Q8H v1.2 is almost identical to the v5, still it needs a separate
- * dtb file since some gpio-s surrounding the wlan/bluetooth are different,
- * and it uses different camera sensors.
- */
-
-#include "sun8i-a23-ippo-q8h-v5.dts"
-
-/ {
-       model = "Ippo Q8H Dual Core Tablet (v1.2)";
-       compatible = "ippo,q8h-v1.2", "allwinner,sun8i-a23";
-};
new file mode 120000 (symlink)
index 0000000000000000000000000000000000000000..c2f22fc3381107322545a350fa5b9620ba8647af
--- /dev/null
@@ -0,0 +1 @@
+sun8i-a23-q8-tablet.dts
\ No newline at end of file
deleted file mode 100644 (file)
index 8d9da6886a4c975113ffd916de447a552295401e..0000000000000000000000000000000000000000
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * Copyright 2014 Chen-Yu Tsai
- *
- * Chen-Yu Tsai <wens@csie.org>
- *
- * This file is dual-licensed: you can use it either under the terms
- * of the GPL or the X11 license, at your option. Note that this dual
- * licensing only applies to this file, and not this project as a
- * whole.
- *
- *  a) This file 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; either version 2 of the
- *     License, or (at your option) any later version.
- *
- *     This file is distributed in the hope that it will be useful,
- *     but WITHOUT ANY WARRANTY; without even the implied warranty of
- *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *     GNU General Public License for more details.
- *
- * Or, alternatively,
- *
- *  b) Permission is hereby granted, free of charge, to any person
- *     obtaining a copy of this software and associated documentation
- *     files (the "Software"), to deal in the Software without
- *     restriction, including without limitation the rights to use,
- *     copy, modify, merge, publish, distribute, sublicense, and/or
- *     sell copies of the Software, and to permit persons to whom the
- *     Software is furnished to do so, subject to the following
- *     conditions:
- *
- *     The above copyright notice and this permission notice shall be
- *     included in all copies or substantial portions of the Software.
- *
- *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- *     OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/dts-v1/;
-#include "sun8i-a23.dtsi"
-#include "sunxi-common-regulators.dtsi"
-
-#include <dt-bindings/gpio/gpio.h>
-#include <dt-bindings/input/input.h>
-#include <dt-bindings/pinctrl/sun4i-a10.h>
-
-/ {
-       model = "Ippo Q8H Dual Core Tablet (v5)";
-       compatible = "ippo,q8h-v5", "allwinner,sun8i-a23";
-
-       aliases {
-               serial0 = &r_uart;
-       };
-
-       chosen {
-               stdout-path = "serial0:115200n8";
-       };
-};
-
-&i2c0 {
-       pinctrl-names = "default";
-       pinctrl-0 = <&i2c0_pins_a>;
-       status = "okay";
-};
-
-&i2c1 {
-       pinctrl-names = "default";
-       pinctrl-0 = <&i2c1_pins_a>;
-       status = "okay";
-};
-
-&i2c2 {
-       pinctrl-names = "default";
-       pinctrl-0 = <&i2c2_pins_a>;
-       /* pull-ups and devices require PMIC regulator */
-       status = "failed";
-};
-
-&lradc {
-       vref-supply = <&reg_vcc3v0>;
-       status = "okay";
-
-       button@200 {
-               label = "Volume Up";
-               linux,code = <KEY_VOLUMEUP>;
-               channel = <0>;
-               voltage = <200000>;
-       };
-
-       button@400 {
-               label = "Volume Down";
-               linux,code = <KEY_VOLUMEDOWN>;
-               channel = <0>;
-               voltage = <400000>;
-       };
-};
-
-&mmc0 {
-       pinctrl-names = "default";
-       pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_q8h>;
-       vmmc-supply = <&reg_vcc3v0>;
-       bus-width = <4>;
-       cd-gpios = <&pio 1 4 GPIO_ACTIVE_HIGH>; /* PB4 */
-       cd-inverted;
-       status = "okay";
-};
-
-&pio {
-       mmc0_cd_pin_q8h: mmc0_cd_pin@0 {
-               allwinner,pins = "PB4";
-               allwinner,function = "gpio_in";
-               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
-       };
-};
-
-&r_uart {
-       pinctrl-names = "default";
-       pinctrl-0 = <&r_uart_pins_a>;
-       status = "okay";
-};
-
-&usb_otg {
-       dr_mode = "host";
-       status = "okay";
-};
-
-&usbphy {
-       status = "okay";
-};
new file mode 120000 (symlink)
index 0000000000000000000000000000000000000000..c2f22fc3381107322545a350fa5b9620ba8647af
--- /dev/null
@@ -0,0 +1 @@
+sun8i-a23-q8-tablet.dts
\ No newline at end of file
diff --git a/arch/arm/boot/dts/sun8i-a23-q8-tablet.dts b/arch/arm/boot/dts/sun8i-a23-q8-tablet.dts
new file mode 100644 (file)
index 0000000..6062ea7
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ * Copyright 2015 Hans de Goede <hdegoede@redhat.com>
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This file 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; either version 2 of the
+ *     License, or (at your option) any later version.
+ *
+ *     This file is distributed in the hope that it will be useful,
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ * Or, alternatively,
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use,
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/dts-v1/;
+#include "sun8i-a23.dtsi"
+#include "sun8i-q8-common.dtsi"
+
+/ {
+       model = "Q8 A23 Tablet";
+       compatible = "allwinner,q8-a23", "allwinner,sun8i-a23";
+};
+
+/*
+ * FIXME for now we only support host mode and rely on u-boot to have
+ * turned on Vbus which is controlled by the axp223 pmic on the board.
+ *
+ * Once we have axp223 support we should switch to fully supporting otg.
+ */
+&usb_otg {
+       dr_mode = "host";
+       status = "okay";
+};
+
+&usbphy {
+       status = "okay";
+};
index 2cc27c7a59dc389b7cf835fcaa9d7c23fd073291..92e6616979ea42868b3a6bcb77f76ed7ea8083bd 100644 (file)
        };
 
        clocks {
+               ahb1_gates: clk@01c20060 {
+                       #clock-cells = <1>;
+                       compatible = "allwinner,sun8i-a23-ahb1-gates-clk";
+                       reg = <0x01c20060 0x8>;
+                       clocks = <&ahb1>;
+                       clock-indices = <1>, <6>,
+                                       <8>, <9>, <10>,
+                                       <13>, <14>,
+                                       <19>, <20>,
+                                       <21>, <24>, <26>,
+                                       <29>, <32>, <36>,
+                                       <40>, <44>, <46>,
+                                       <52>, <53>,
+                                       <54>, <57>;
+                       clock-output-names = "ahb1_mipidsi", "ahb1_dma",
+                                       "ahb1_mmc0", "ahb1_mmc1", "ahb1_mmc2",
+                                       "ahb1_nand", "ahb1_sdram",
+                                       "ahb1_hstimer", "ahb1_spi0",
+                                       "ahb1_spi1", "ahb1_otg", "ahb1_ehci",
+                                       "ahb1_ohci", "ahb1_ve", "ahb1_lcd",
+                                       "ahb1_csi", "ahb1_be",  "ahb1_fe",
+                                       "ahb1_gpu", "ahb1_msgbox",
+                                       "ahb1_spinlock", "ahb1_drc";
+               };
+
                mbus_clk: clk@01c2015c {
                        #clock-cells = <0>;
                        compatible = "allwinner,sun8i-a23-mbus-clk";
deleted file mode 100644 (file)
index 19db844863bbb6a88b17c5a316c2e934565dd4a8..0000000000000000000000000000000000000000
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Copyright 2015 Vishnu Patekar
- * Vishnu Patekar <vishnupatekar0510@gmail.com>
- *
- * This file is dual-licensed: you can use it either under the terms
- * of the GPL or the X11 license, at your option. Note that this dual
- * licensing only applies to this file, and not this project as a
- * whole.
- *
- *  a) This file 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; either version 2 of the
- *     License, or (at your option) any later version.
- *
- *     This file is distributed in the hope that it will be useful,
- *     but WITHOUT ANY WARRANTY; without even the implied warranty of
- *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *     GNU General Public License for more details.
- *
- * Or, alternatively,
- *
- *  b) Permission is hereby granted, free of charge, to any person
- *     obtaining a copy of this software and associated documentation
- *     files (the "Software"), to deal in the Software without
- *     restriction, including without limitation the rights to use,
- *     copy, modify, merge, publish, distribute, sublicense, and/or
- *     sell copies of the Software, and to permit persons to whom the
- *     Software is furnished to do so, subject to the following
- *     conditions:
- *
- *     The above copyright notice and this permission notice shall be
- *     included in all copies or substantial portions of the Software.
- *
- *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- *     OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/dts-v1/;
-#include "sun8i-a33.dtsi"
-#include "sunxi-common-regulators.dtsi"
-
-#include <dt-bindings/gpio/gpio.h>
-#include <dt-bindings/input/input.h>
-#include <dt-bindings/pinctrl/sun4i-a10.h>
-
-/ {
-       model = "ET Q8 Quad Core Tablet (v1.6)";
-       compatible = "et,q8-v1.6", "allwinner,sun8i-a33";
-
-       aliases {
-               serial0 = &uart0;
-       };
-
-       chosen {
-               stdout-path = "serial0:115200n8";
-       };
-};
-
-&lradc {
-       vref-supply = <&reg_vcc3v0>;
-       status = "okay";
-
-       button@200 {
-               label = "Volume Up";
-               linux,code = <KEY_VOLUMEUP>;
-               channel = <0>;
-               voltage = <200000>;
-       };
-
-       button@400 {
-               label = "Volume Down";
-               linux,code = <KEY_VOLUMEDOWN>;
-               channel = <0>;
-               voltage = <400000>;
-       };
-};
-
-&uart0 {
-       pinctrl-names = "default";
-       pinctrl-0 = <&uart0_pins_a>;
-       status = "okay";
-};
new file mode 120000 (symlink)
index 0000000000000000000000000000000000000000..4519fd791a8f9077bfb769c88027b0b0df47f627
--- /dev/null
@@ -0,0 +1 @@
+sun8i-a33-q8-tablet.dts
\ No newline at end of file
deleted file mode 100644 (file)
index a43897515fb65dd4b71fe167acf0ba98df632041..0000000000000000000000000000000000000000
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * Copyright 2015 Hans de Goede <hdegoede@redhat.com>
- *
- * This file is dual-licensed: you can use it either under the terms
- * of the GPL or the X11 license, at your option. Note that this dual
- * licensing only applies to this file, and not this project as a
- * whole.
- *
- *  a) This file 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; either version 2 of the
- *     License, or (at your option) any later version.
- *
- *     This file is distributed in the hope that it will be useful,
- *     but WITHOUT ANY WARRANTY; without even the implied warranty of
- *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *     GNU General Public License for more details.
- *
- * Or, alternatively,
- *
- *  b) Permission is hereby granted, free of charge, to any person
- *     obtaining a copy of this software and associated documentation
- *     files (the "Software"), to deal in the Software without
- *     restriction, including without limitation the rights to use,
- *     copy, modify, merge, publish, distribute, sublicense, and/or
- *     sell copies of the Software, and to permit persons to whom the
- *     Software is furnished to do so, subject to the following
- *     conditions:
- *
- *     The above copyright notice and this permission notice shall be
- *     included in all copies or substantial portions of the Software.
- *
- *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- *     OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/dts-v1/;
-#include "sun8i-a33.dtsi"
-#include "sunxi-common-regulators.dtsi"
-
-#include <dt-bindings/gpio/gpio.h>
-#include <dt-bindings/input/input.h>
-#include <dt-bindings/pinctrl/sun4i-a10.h>
-
-/ {
-       model = "Ippo Q8H Quad Core Tablet (v1.2)";
-       compatible = "ippo,a33-q8h-v1.2", "allwinner,sun8i-a33";
-
-       aliases {
-               serial0 = &r_uart;
-       };
-
-       chosen {
-               stdout-path = "serial0:115200n8";
-       };
-};
-
-&i2c0 {
-       pinctrl-names = "default";
-       pinctrl-0 = <&i2c0_pins_a>;
-       status = "okay";
-};
-
-&i2c1 {
-       pinctrl-names = "default";
-       pinctrl-0 = <&i2c1_pins_a>;
-       status = "okay";
-};
-
-&lradc {
-       vref-supply = <&reg_vcc3v0>;
-       status = "okay";
-
-       button@200 {
-               label = "Volume Up";
-               linux,code = <KEY_VOLUMEUP>;
-               channel = <0>;
-               voltage = <200000>;
-       };
-
-       button@400 {
-               label = "Volume Down";
-               linux,code = <KEY_VOLUMEDOWN>;
-               channel = <0>;
-               voltage = <400000>;
-       };
-};
-
-&mmc0 {
-       pinctrl-names = "default";
-       pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_q8h>;
-       vmmc-supply = <&reg_vcc3v0>;
-       bus-width = <4>;
-       cd-gpios = <&pio 1 4 GPIO_ACTIVE_HIGH>; /* PB4 */
-       cd-inverted;
-       status = "okay";
-};
-
-&pio {
-       mmc0_cd_pin_q8h: mmc0_cd_pin@0 {
-               allwinner,pins = "PB4";
-               allwinner,function = "gpio_in";
-               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
-       };
-};
-
-&r_uart {
-       pinctrl-names = "default";
-       pinctrl-0 = <&r_uart_pins_a>;
-       status = "okay";
-};
-
-/*
- * FIXME for now we only support host mode and rely on u-boot to have
- * turned on Vbus which is controlled by the axp223 pmic on the board.
- *
- * Once we have axp223 support we should switch to fully supporting otg.
- */
-&usb_otg {
-       dr_mode = "host";
-       status = "okay";
-};
-
-&usbphy {
-       status = "okay";
-};
new file mode 120000 (symlink)
index 0000000000000000000000000000000000000000..4519fd791a8f9077bfb769c88027b0b0df47f627
--- /dev/null
@@ -0,0 +1 @@
+sun8i-a33-q8-tablet.dts
\ No newline at end of file
diff --git a/arch/arm/boot/dts/sun8i-a33-q8-tablet.dts b/arch/arm/boot/dts/sun8i-a33-q8-tablet.dts
new file mode 100644 (file)
index 0000000..44b3229
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ * Copyright 2015 Hans de Goede <hdegoede@redhat.com>
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This file 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; either version 2 of the
+ *     License, or (at your option) any later version.
+ *
+ *     This file is distributed in the hope that it will be useful,
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ * Or, alternatively,
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use,
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/dts-v1/;
+#include "sun8i-a33.dtsi"
+#include "sun8i-q8-common.dtsi"
+
+/ {
+       model = "Q8 A33 Tablet";
+       compatible = "allwinner,q8-a33", "allwinner,sun8i-a33";
+};
+
+/*
+ * FIXME for now we only support host mode and rely on u-boot to have
+ * turned on Vbus which is controlled by the axp223 pmic on the board.
+ *
+ * Once we have axp223 support we should switch to fully supporting otg.
+ */
+&usb_otg {
+       dr_mode = "host";
+       status = "okay";
+};
+
+&usbphy {
+       status = "okay";
+};
index 1d5390d4e03aadd44965918d43c0672c070de9f9..13ce68f06dd6e0ab7c7b9a5ba6e05562e4df3868 100644 (file)
        };
 };
 
+&r_rsb {
+       status = "okay";
+};
+
 &uart0 {
        pinctrl-names = "default";
        pinctrl-0 = <&uart0_pins_b>;
index faa7d3c1fceacdc9eb80d396e23807bccb4d7aa1..001d8402ca1845bca126adab131d69d439ceab6a 100644 (file)
                        clock-output-names = "pll11";
                };
 
+               ahb1_gates: clk@01c20060 {
+                       #clock-cells = <1>;
+                       compatible = "allwinner,sun8i-a33-ahb1-gates-clk";
+                       reg = <0x01c20060 0x8>;
+                       clocks = <&ahb1>;
+                       clock-indices = <1>, <5>,
+                                       <6>, <8>, <9>,
+                                       <10>, <13>, <14>,
+                                       <19>, <20>,
+                                       <21>, <24>, <26>,
+                                       <29>, <32>, <36>,
+                                       <40>, <44>, <46>,
+                                       <52>, <53>,
+                                       <54>, <57>,
+                                       <58>;
+                       clock-output-names = "ahb1_mipidsi", "ahb1_ss",
+                                       "ahb1_dma","ahb1_mmc0", "ahb1_mmc1",
+                                       "ahb1_mmc2", "ahb1_nand", "ahb1_sdram",
+                                       "ahb1_hstimer", "ahb1_spi0",
+                                       "ahb1_spi1", "ahb1_otg", "ahb1_ehci",
+                                       "ahb1_ohci", "ahb1_ve", "ahb1_lcd",
+                                       "ahb1_csi", "ahb1_be",  "ahb1_fe",
+                                       "ahb1_gpu", "ahb1_msgbox",
+                                       "ahb1_spinlock", "ahb1_drc",
+                                       "ahb1_sat";
+               };
+
+               ss_clk: clk@01c2009c {
+                       #clock-cells = <0>;
+                       compatible = "allwinner,sun4i-a10-mod0-clk";
+                       reg = <0x01c2009c 0x4>;
+                       clocks = <&osc24M>, <&pll6 0>;
+                       clock-output-names = "ss";
+               };
+
                mbus_clk: clk@01c2015c {
                        #clock-cells = <0>;
                        compatible = "allwinner,sun8i-a23-mbus-clk";
        };
 
        soc@01c00000 {
+               crypto: crypto-engine@01c15000 {
+                       compatible = "allwinner,sun4i-a10-crypto";
+                       reg = <0x01c15000 0x1000>;
+                       interrupts = <GIC_SPI 80 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&ahb1_gates 5>, <&ss_clk>;
+                       clock-names = "ahb", "mod";
+                       resets = <&ahb1_rst 5>;
+                       reset-names = "ahb";
+               };
+
                usb_otg: usb@01c19000 {
                        compatible = "allwinner,sun8i-a33-musb";
                        reg = <0x01c19000 0x0400>;
diff --git a/arch/arm/boot/dts/sun8i-q8-common.dtsi b/arch/arm/boot/dts/sun8i-q8-common.dtsi
new file mode 100644 (file)
index 0000000..1a69231
--- /dev/null
@@ -0,0 +1,101 @@
+/*
+ * Copyright 2015 Hans de Goede <hdegoede@redhat.com>
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This file 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; either version 2 of the
+ *     License, or (at your option) any later version.
+ *
+ *     This file is distributed in the hope that it will be useful,
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ * Or, alternatively,
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use,
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
+ */
+#include "sunxi-q8-common.dtsi"
+
+#include <dt-bindings/pwm/pwm.h>
+
+/ {
+       aliases {
+               serial0 = &r_uart;
+       };
+
+       backlight: backlight {
+               compatible = "pwm-backlight";
+               pinctrl-names = "default";
+               pinctrl-0 = <&bl_en_pin_q8>;
+               pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>;
+               brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>;
+               default-brightness-level = <8>;
+               enable-gpios = <&pio 7 6 GPIO_ACTIVE_HIGH>; /* PH6 */
+               /* backlight is powered by AXP223 DC1SW */
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+};
+
+&mmc0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_q8>;
+       vmmc-supply = <&reg_vcc3v0>;
+       bus-width = <4>;
+       cd-gpios = <&pio 1 4 GPIO_ACTIVE_HIGH>; /* PB4 */
+       cd-inverted;
+       status = "okay";
+};
+
+&pio {
+       bl_en_pin_q8: bl_en_pin@0 {
+               allwinner,pins = "PH6";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+       };
+
+       mmc0_cd_pin_q8: mmc0_cd_pin@0 {
+               allwinner,pins = "PB4";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+       };
+};
+
+&r_rsb {
+       status = "okay";
+};
+
+&r_uart {
+       pinctrl-names = "default";
+       pinctrl-0 = <&r_uart_pins_a>;
+       status = "okay";
+};
index 5908e3dcf9658544e1f45b38d0fcd46a6c3a58a6..1118bf5cc4fbe95e9f4d6485d1cc317b774f25d1 100644 (file)
                        clocks = <&apb0_gates 5>;
                        gpio-controller;
                        interrupt-controller;
-                       #interrupt-cells = <2>;
+                       #interrupt-cells = <3>;
                        #size-cells = <0>;
                        #gpio-cells = <3>;
 
diff --git a/arch/arm/boot/dts/sunxi-q8-common.dtsi b/arch/arm/boot/dts/sunxi-q8-common.dtsi
new file mode 100644 (file)
index 0000000..b824146
--- /dev/null
@@ -0,0 +1,83 @@
+/*
+ * Copyright 2015 Hans de Goede <hdegoede@redhat.com>
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This file 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; either version 2 of the
+ *     License, or (at your option) any later version.
+ *
+ *     This file is distributed in the hope that it will be useful,
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ * Or, alternatively,
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use,
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/pinctrl/sun4i-a10.h>
+#include "sunxi-common-regulators.dtsi"
+
+&i2c0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c0_pins_a>;
+       status = "okay";
+};
+
+&i2c1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c1_pins_a>;
+       status = "okay";
+};
+
+&lradc {
+       vref-supply = <&reg_vcc3v0>;
+       status = "okay";
+
+       button@200 {
+               label = "Volume Up";
+               linux,code = <KEY_VOLUMEUP>;
+               channel = <0>;
+               voltage = <200000>;
+       };
+
+       button@400 {
+               label = "Volume Down";
+               linux,code = <KEY_VOLUMEDOWN>;
+               channel = <0>;
+               voltage = <400000>;
+       };
+};
+
+&pwm {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pwm0_pins>;
+       status = "okay";
+};
index a9aec23e06f2c60a3a1d0bc6cc2846a8380fb548..40c23a0b7cfc2adf8517e28ac51b0078423a0c61 100644 (file)
                                vin-ldo9-10-supply = <&vdd_5v0_sys>;
                                vin-ldo11-supply = <&vdd_3v3_run>;
 
-                               sd0 {
+                               vdd_cpu: sd0 {
                                        regulator-name = "+VDD_CPU_AP";
                                        regulator-min-microvolt = <700000>;
                                        regulator-max-microvolt = <1350000>;
                non-removable;
        };
 
+       /* CPU DFLL clock */
+       clock@0,70110000 {
+               status = "okay";
+               vdd-cpu-supply = <&vdd_cpu>;
+               nvidia,i2c-fs-rate = <400000>;
+       };
+
        ahub@0,70300000 {
                i2s@0,70301100 {
                        status = "okay";
                };
        };
 
+       cpus {
+               cpu@0 {
+                       vdd-cpu-supply = <&vdd_cpu>;
+               };
+       };
+
        gpio-keys {
                compatible = "gpio-keys";
 
index 819e2ae2cabe28b09952807ca2f0249c1aa82b7f..68669f791c8baa5ec9fd9d27a37e6ef716006861 100644 (file)
 
        sata@0,70020000 {
                compatible = "nvidia,tegra124-ahci";
-
                reg = <0x0 0x70027000 0x0 0x2000>, /* AHCI */
-                       <0x0 0x70020000 0x0 0x7000>; /* SATA */
-
+                     <0x0 0x70020000 0x0 0x7000>; /* SATA */
                interrupts = <GIC_SPI 23 IRQ_TYPE_LEVEL_HIGH>;
-
                clocks = <&tegra_car TEGRA124_CLK_SATA>,
-                       <&tegra_car TEGRA124_CLK_SATA_OOB>,
-                       <&tegra_car TEGRA124_CLK_CML1>,
-                       <&tegra_car TEGRA124_CLK_PLL_E>;
+                        <&tegra_car TEGRA124_CLK_SATA_OOB>,
+                        <&tegra_car TEGRA124_CLK_CML1>,
+                        <&tegra_car TEGRA124_CLK_PLL_E>;
                clock-names = "sata", "sata-oob", "cml1", "pll_e";
-
                resets = <&tegra_car 124>,
-                       <&tegra_car 123>,
-                       <&tegra_car 129>;
+                        <&tegra_car 123>,
+                        <&tegra_car 129>;
                reset-names = "sata", "sata-oob", "sata-cold";
-
                phys = <&padctl TEGRA_XUSB_PADCTL_SATA>;
                phy-names = "sata-phy";
-
                status = "disabled";
        };
 
                reg = <0x0 0x70030000 0x0 0x10000>;
                interrupts = <GIC_SPI 81 IRQ_TYPE_LEVEL_HIGH>;
                clocks = <&tegra_car TEGRA124_CLK_HDA>,
-                        <&tegra_car TEGRA124_CLK_HDA2HDMI>,
+                        <&tegra_car TEGRA124_CLK_HDA2HDMI>,
                         <&tegra_car TEGRA124_CLK_HDA2CODEC_2X>;
                clock-names = "hda", "hda2hdmi", "hda2codec_2x";
                resets = <&tegra_car 125>, /* hda */
index 969b828505ae4404846ff169ce17ad7ffd178ec2..33173e1bace9cd289eda8b67679ab0df7d777c9d 100644 (file)
                         <&tegra_car TEGRA20_CLK_PLL_E>;
                clock-names = "pex", "afi", "pll_e";
                resets = <&tegra_car 70>,
-                        <&tegra_car 72>,
-                        <&tegra_car 74>;
+                        <&tegra_car 72>,
+                        <&tegra_car 74>;
                reset-names = "pex", "afi", "pcie_x";
                status = "disabled";
 
index 6236bdecb48ba08891896f6967199aba6e2a6680..f2879cfcca6253f0a86bcd562cbcd3d75307f6ae 100644 (file)
                };
        };
 
+       hda@70030000 {
+               status = "okay";
+       };
+
        sd1: sdhci@78000000 {
                status = "okay";
                bus-width = <4>;
 
        usb-phy@7d000000 {
                status = "okay";
+               dr_mode = "otg";
                vbus-supply = <&usbo1_vbus_reg>;
        };
 
        backlight: backlight {
                compatible = "pwm-backlight";
 
-               /* PWM0 */
+               /* PWM_BKL1 */
                pwms = <&pwm 0 5000000>;
                brightness-levels = <255 231 223 207 191 159 127 0>;
                default-brightness-level = <6>;
        gpio-keys {
                compatible = "gpio-keys";
 
-               power {
-                       label = "Power";
+               wakeup {
+                       label = "WAKE1_MICO";
                        gpios = <&gpio TEGRA_GPIO(V, 1) GPIO_ACTIVE_LOW>;
-                       linux,code = <KEY_POWER>;
+                       linux,code = <KEY_WAKEUP>;
                        debounce-interval = <10>;
                        gpio-key,wakeup;
                };
index a5446cba9804d3c6c24f7c2207642820869ccaa8..bf361277fe105e0ab307d2cee628b5e7c6085a89 100644 (file)
@@ -1,8 +1,9 @@
 #include "tegra30.dtsi"
 
 /*
- * Toradex Apalis T30 Device Tree
- * Compatible for Revisions 1GB: V1.0A; 2GB: V1.0B, V1.0C
+ * Toradex Apalis T30 Module Device Tree
+ * Compatible for Revisions 1GB: V1.0A, V1.1A; 1GB IT: V1.1A;
+ * 2GB: V1.0B, V1.0C, V1.0E, V1.1A
  */
 / {
        model = "Toradex Apalis T30";
@@ -33,8 +34,8 @@
 
        host1x@50000000 {
                hdmi@54280000 {
-                       vdd-supply = <&sys_3v3_reg>;
-                       pll-supply = <&vio_reg>;
+                       vdd-supply = <&avdd_hdmi_3v3_reg>;
+                       pll-supply = <&avdd_hdmi_pll_1v8_reg>;
 
                        nvidia,hpd-gpio =
                                <&gpio TEGRA_GPIO(N, 7) GPIO_ACTIVE_HIGH>;
 
                        /* Apalis BKL1_PWM */
                        uart3_rts_n_pc0 {
-                               nvidia,pins =   "uart3_rts_n_pc0";
+                               nvidia,pins = "uart3_rts_n_pc0";
                                nvidia,function = "pwm0";
                                nvidia,pull = <TEGRA_PIN_PULL_NONE>;
                                nvidia,tristate = <TEGRA_PIN_DISABLE>;
                        };
                        /* BKL1_PWM_EN#, disable TPS65911 PMIC PWM backlight */
                        uart3_cts_n_pa1 {
-                               nvidia,pins =   "uart3_cts_n_pa1";
-                               nvidia,function = "rsvd1";
+                               nvidia,pins = "uart3_cts_n_pa1";
+                               nvidia,function = "rsvd2";
                                nvidia,pull = <TEGRA_PIN_PULL_UP>;
                                nvidia,tristate = <TEGRA_PIN_DISABLE>;
                        };
 
                        /* Apalis CAN1 on SPI6 */
                        spi2_cs0_n_px3 {
-                               nvidia,pins =   "spi2_cs0_n_px3",
-                                               "spi2_miso_px1",
-                                               "spi2_mosi_px0",
-                                               "spi2_sck_px2";
+                               nvidia,pins = "spi2_cs0_n_px3",
+                                             "spi2_miso_px1",
+                                             "spi2_mosi_px0",
+                                             "spi2_sck_px2";
                                nvidia,function = "spi6";
                                nvidia,pull = <TEGRA_PIN_PULL_NONE>;
                                nvidia,tristate = <TEGRA_PIN_DISABLE>;
 
                        /* Apalis CAN2 on SPI4 */
                        gmi_a16_pj7 {
-                               nvidia,pins =   "gmi_a16_pj7",
-                                               "gmi_a17_pb0",
-                                               "gmi_a18_pb1",
-                                               "gmi_a19_pk7";
+                               nvidia,pins = "gmi_a16_pj7",
+                                             "gmi_a17_pb0",
+                                             "gmi_a18_pb1",
+                                             "gmi_a19_pk7";
                                nvidia,function = "spi4";
                                nvidia,pull = <TEGRA_PIN_PULL_NONE>;
                                nvidia,tristate = <TEGRA_PIN_DISABLE>;
                                nvidia,enable-input = <TEGRA_PIN_ENABLE>;
                        };
 
+                       /* Apalis Digital Audio */
+                       clk1_req_pee2 {
+                               nvidia,pins = "clk1_req_pee2";
+                               nvidia,function = "hda";
+                               nvidia,pull = <TEGRA_PIN_PULL_NONE>;
+                               nvidia,tristate = <TEGRA_PIN_DISABLE>;
+                       };
+                       clk2_out_pw5 {
+                               nvidia,pins = "clk2_out_pw5";
+                               nvidia,function = "extperiph2";
+                               nvidia,pull = <TEGRA_PIN_PULL_NONE>;
+                               nvidia,tristate = <TEGRA_PIN_DISABLE>;
+                               nvidia,enable-input = <TEGRA_PIN_DISABLE>;
+                       };
+                       dap1_fs_pn0 {
+                               nvidia,pins = "dap1_fs_pn0",
+                                             "dap1_din_pn1",
+                                             "dap1_dout_pn2",
+                                             "dap1_sclk_pn3";
+                               nvidia,function = "hda";
+                               nvidia,pull = <TEGRA_PIN_PULL_NONE>;
+                               nvidia,tristate = <TEGRA_PIN_DISABLE>;
+                       };
+
                        /* Apalis I2C3 */
                        cam_i2c_scl_pbb1 {
                                nvidia,pins = "cam_i2c_scl_pbb1",
 
                        /* Apalis MMC1 */
                        sdmmc3_clk_pa6 {
-                               nvidia,pins =   "sdmmc3_clk_pa6",
-                                               "sdmmc3_cmd_pa7";
+                               nvidia,pins = "sdmmc3_clk_pa6",
+                                             "sdmmc3_cmd_pa7";
                                nvidia,function = "sdmmc3";
                                nvidia,pull = <TEGRA_PIN_PULL_NONE>;
                                nvidia,tristate = <TEGRA_PIN_DISABLE>;
                        };
                        sdmmc3_dat0_pb7 {
-                               nvidia,pins =   "sdmmc3_dat0_pb7",
-                                               "sdmmc3_dat1_pb6",
-                                               "sdmmc3_dat2_pb5",
-                                               "sdmmc3_dat3_pb4",
-                                               "sdmmc3_dat4_pd1",
-                                               "sdmmc3_dat5_pd0",
-                                               "sdmmc3_dat6_pd3",
-                                               "sdmmc3_dat7_pd4";
+                               nvidia,pins = "sdmmc3_dat0_pb7",
+                                             "sdmmc3_dat1_pb6",
+                                             "sdmmc3_dat2_pb5",
+                                             "sdmmc3_dat3_pb4",
+                                             "sdmmc3_dat4_pd1",
+                                             "sdmmc3_dat5_pd0",
+                                             "sdmmc3_dat6_pd3",
+                                             "sdmmc3_dat7_pd4";
                                nvidia,function = "sdmmc3";
                                nvidia,pull = <TEGRA_PIN_PULL_UP>;
                                nvidia,tristate = <TEGRA_PIN_DISABLE>;
                        };
 
                        /* Apalis PWM1 */
-                       gpio_pu6 {
-                               nvidia,pins =   "gpio_pu6";
+                       pu6 {
+                               nvidia,pins = "pu6";
                                nvidia,function = "pwm3";
                                nvidia,pull = <TEGRA_PIN_PULL_NONE>;
                                nvidia,tristate = <TEGRA_PIN_DISABLE>;
                        };
 
                        /* Apalis PWM2 */
-                       gpio_pu5 {
-                               nvidia,pins =   "gpio_pu5";
+                       pu5 {
+                               nvidia,pins = "pu5";
                                nvidia,function = "pwm2";
                                nvidia,pull = <TEGRA_PIN_PULL_NONE>;
                                nvidia,tristate = <TEGRA_PIN_DISABLE>;
                        };
 
                        /* Apalis PWM3 */
-                       gpio_pu4 {
-                               nvidia,pins =   "gpio_pu4";
+                       pu4 {
+                               nvidia,pins = "pu4";
                                nvidia,function = "pwm1";
                                nvidia,pull = <TEGRA_PIN_PULL_NONE>;
                                nvidia,tristate = <TEGRA_PIN_DISABLE>;
                        };
 
                        /* Apalis PWM4 */
-                       gpio_pu3 {
-                               nvidia,pins =   "gpio_pu3";
+                       pu3 {
+                               nvidia,pins = "pu3";
                                nvidia,function = "pwm0";
                                nvidia,pull = <TEGRA_PIN_PULL_NONE>;
                                nvidia,tristate = <TEGRA_PIN_DISABLE>;
                                nvidia,tristate = <TEGRA_PIN_DISABLE>;
                        };
                        sdmmc1_cmd_pz1 {
-                               nvidia,pins =   "sdmmc1_cmd_pz1",
-                                               "sdmmc1_dat0_py7",
-                                               "sdmmc1_dat1_py6",
-                                               "sdmmc1_dat2_py5",
-                                               "sdmmc1_dat3_py4";
+                               nvidia,pins = "sdmmc1_cmd_pz1",
+                                             "sdmmc1_dat0_py7",
+                                             "sdmmc1_dat1_py6",
+                                             "sdmmc1_dat2_py5",
+                                             "sdmmc1_dat3_py4";
                                nvidia,function = "sdmmc1";
                                nvidia,pull = <TEGRA_PIN_PULL_UP>;
                                nvidia,tristate = <TEGRA_PIN_DISABLE>;
 
                        /* Apalis SPI1 */
                        spi1_sck_px5 {
-                               nvidia,pins =   "spi1_sck_px5",
-                                               "spi1_mosi_px4",
-                                               "spi1_miso_px7",
-                                               "spi1_cs0_n_px6";
+                               nvidia,pins = "spi1_sck_px5",
+                                             "spi1_mosi_px4",
+                                             "spi1_miso_px7",
+                                             "spi1_cs0_n_px6";
                                nvidia,function = "spi1";
                                nvidia,pull = <TEGRA_PIN_PULL_NONE>;
                                nvidia,tristate = <TEGRA_PIN_DISABLE>;
 
                        /* Apalis SPI2 */
                        lcd_sck_pz4 {
-                               nvidia,pins =   "lcd_sck_pz4",
-                                               "lcd_sdout_pn5",
-                                               "lcd_sdin_pz2",
-                                               "lcd_cs0_n_pn4";
+                               nvidia,pins = "lcd_sck_pz4",
+                                             "lcd_sdout_pn5",
+                                             "lcd_sdin_pz2",
+                                             "lcd_cs0_n_pn4";
                                nvidia,function = "spi5";
                                nvidia,pull = <TEGRA_PIN_PULL_NONE>;
                                nvidia,tristate = <TEGRA_PIN_DISABLE>;
 
                        /* Apalis UART1 */
                        ulpi_data0 {
-                               nvidia,pins =   "ulpi_data0_po1",
-                                               "ulpi_data1_po2",
-                                               "ulpi_data2_po3",
-                                               "ulpi_data3_po4",
-                                               "ulpi_data4_po5",
-                                               "ulpi_data5_po6",
-                                               "ulpi_data6_po7",
-                                               "ulpi_data7_po0";
+                               nvidia,pins = "ulpi_data0_po1",
+                                             "ulpi_data1_po2",
+                                             "ulpi_data2_po3",
+                                             "ulpi_data3_po4",
+                                             "ulpi_data4_po5",
+                                             "ulpi_data5_po6",
+                                             "ulpi_data6_po7",
+                                             "ulpi_data7_po0";
                                nvidia,function = "uarta";
                                nvidia,pull = <TEGRA_PIN_PULL_NONE>;
                                nvidia,tristate = <TEGRA_PIN_DISABLE>;
 
                        /* Apalis UART2 */
                        ulpi_clk_py0 {
-                               nvidia,pins =   "ulpi_clk_py0",
-                                               "ulpi_dir_py1",
-                                               "ulpi_nxt_py2",
-                                               "ulpi_stp_py3";
+                               nvidia,pins = "ulpi_clk_py0",
+                                             "ulpi_dir_py1",
+                                             "ulpi_nxt_py2",
+                                             "ulpi_stp_py3";
                                nvidia,function = "uartd";
                                nvidia,pull = <TEGRA_PIN_PULL_NONE>;
                                nvidia,tristate = <TEGRA_PIN_DISABLE>;
 
                        /* Apalis UART3 */
                        uart2_rxd_pc3 {
-                               nvidia,pins =   "uart2_rxd_pc3",
-                                               "uart2_txd_pc2";
+                               nvidia,pins = "uart2_rxd_pc3",
+                                             "uart2_txd_pc2";
                                nvidia,function = "uartb";
                                nvidia,pull = <TEGRA_PIN_PULL_NONE>;
                                nvidia,tristate = <TEGRA_PIN_DISABLE>;
 
                        /* Apalis UART4 */
                        uart3_rxd_pw7 {
-                               nvidia,pins =   "uart3_rxd_pw7",
-                                               "uart3_txd_pw6";
+                               nvidia,pins = "uart3_rxd_pw7",
+                                             "uart3_txd_pw6";
                                nvidia,function = "uartc";
                                nvidia,pull = <TEGRA_PIN_PULL_NONE>;
                                nvidia,tristate = <TEGRA_PIN_DISABLE>;
 
                        /* eMMC (On-module) */
                        sdmmc4_clk_pcc4 {
-                               nvidia,pins =   "sdmmc4_clk_pcc4",
-                                               "sdmmc4_rst_n_pcc3";
+                               nvidia,pins = "sdmmc4_clk_pcc4",
+                                             "sdmmc4_rst_n_pcc3";
                                nvidia,function = "sdmmc4";
                                nvidia,pull = <TEGRA_PIN_PULL_NONE>;
                                nvidia,tristate = <TEGRA_PIN_DISABLE>;
                        };
                        sdmmc4_dat0_paa0 {
-                               nvidia,pins =   "sdmmc4_dat0_paa0",
-                                               "sdmmc4_dat1_paa1",
-                                               "sdmmc4_dat2_paa2",
-                                               "sdmmc4_dat3_paa3",
-                                               "sdmmc4_dat4_paa4",
-                                               "sdmmc4_dat5_paa5",
-                                               "sdmmc4_dat6_paa6",
-                                               "sdmmc4_dat7_paa7";
+                               nvidia,pins = "sdmmc4_dat0_paa0",
+                                             "sdmmc4_dat1_paa1",
+                                             "sdmmc4_dat2_paa2",
+                                             "sdmmc4_dat3_paa3",
+                                             "sdmmc4_dat4_paa4",
+                                             "sdmmc4_dat5_paa5",
+                                             "sdmmc4_dat6_paa6",
+                                             "sdmmc4_dat7_paa7";
                                nvidia,function = "sdmmc4";
                                nvidia,pull = <TEGRA_PIN_PULL_UP>;
                                nvidia,tristate = <TEGRA_PIN_DISABLE>;
 
                        /* LVDS Transceiver Configuration */
                        pbb0 {
-                               nvidia,pins =   "pbb0",
-                                               "pbb7",
-                                               "pcc1",
-                                               "pcc2";
+                               nvidia,pins = "pbb0",
+                                             "pbb7",
+                                             "pcc1",
+                                             "pcc2";
                                nvidia,function = "rsvd2";
                                nvidia,pull = <TEGRA_PIN_PULL_NONE>;
                                nvidia,tristate = <TEGRA_PIN_DISABLE>;
                                nvidia,lock = <TEGRA_PIN_DISABLE>;
                        };
                        pbb3 {
-                               nvidia,pins =   "pbb3",
-                                               "pbb4",
-                                               "pbb5",
-                                               "pbb6";
+                               nvidia,pins = "pbb3",
+                                             "pbb4",
+                                             "pbb5",
+                                             "pbb6";
                                nvidia,function = "displayb";
                                nvidia,pull = <TEGRA_PIN_PULL_NONE>;
                                nvidia,tristate = <TEGRA_PIN_DISABLE>;
                nvidia,sys-clock-req-active-high;
        };
 
+       /* eMMC */
        sdhci@78000600 {
                status = "okay";
                bus-width = <8>;
                #address-cells = <1>;
                #size-cells = <0>;
 
-               sys_3v3_reg: regulator@100 {
+               avdd_hdmi_pll_1v8_reg: regulator@100 {
                        compatible = "regulator-fixed";
                        reg = <100>;
+                       regulator-name = "+V1.8_AVDD_HDMI_PLL";
+                       regulator-min-microvolt = <1800000>;
+                       regulator-max-microvolt = <1800000>;
+                       enable-active-high;
+                       gpio = <&pmic 6 GPIO_ACTIVE_HIGH>;
+                       vin-supply = <&vio_reg>;
+               };
+
+               sys_3v3_reg: regulator@101 {
+                       compatible = "regulator-fixed";
+                       reg = <101>;
                        regulator-name = "3v3";
                        regulator-min-microvolt = <3300000>;
                        regulator-max-microvolt = <3300000>;
                        regulator-always-on;
                };
 
-               charge_pump_5v0_reg: regulator@101 {
+               avdd_hdmi_3v3_reg: regulator@102 {
                        compatible = "regulator-fixed";
-                       reg = <101>;
+                       reg = <102>;
+                       regulator-name = "+V3.3_AVDD_HDMI";
+                       regulator-min-microvolt = <3300000>;
+                       regulator-max-microvolt = <3300000>;
+                       enable-active-high;
+                       gpio = <&pmic 6 GPIO_ACTIVE_HIGH>;
+                       vin-supply = <&sys_3v3_reg>;
+               };
+
+               charge_pump_5v0_reg: regulator@103 {
+                       compatible = "regulator-fixed";
+                       reg = <103>;
                        regulator-name = "5v0";
                        regulator-min-microvolt = <5000000>;
                        regulator-max-microvolt = <5000000>;
index 4d3ddc58564126433410c17b5c3ef569532a9aa1..3ff019f47d008c6ff60564e3e025b8986d2129e7 100644 (file)
@@ -55,7 +55,7 @@
 
                /* M41T0M6 real time clock on carrier board */
                rtc@68 {
-                       compatible = "stm,m41t00";
+                       compatible = "st,m41t00";
                        reg = <0x68>;
                };
        };
@@ -84,6 +84,7 @@
                };
        };
 
+       /* SD/MMC */
        sdhci@78000200 {
                status = "okay";
                bus-width = <4>;
        gpio-keys {
                compatible = "gpio-keys";
 
-               power {
-                       label = "Power";
+               wakeup {
+                       label = "SODIMM pin 45 wakeup";
                        gpios = <&gpio TEGRA_GPIO(V, 1) GPIO_ACTIVE_HIGH>;
-                       linux,code = <KEY_POWER>;
+                       linux,code = <KEY_WAKEUP>;
                        debounce-interval = <10>;
                        gpio-key,wakeup;
                };
index c4ed1bec4d92afad7ae50eb5f16be4748aa77fc3..2d8c58fd9357996422b449c9effb9192433df25c 100644 (file)
@@ -2,8 +2,8 @@
 #include "tegra30.dtsi"
 
 /*
- * Toradex Colibri T30 Device Tree
- * Compatible for Revisions 1.1B/1.1C/1.1D
+ * Toradex Colibri T30 Module Device Tree
+ * Compatible for Revisions V1.1B, V1.1C, V1.1D, V1.1E; IT: V1.1A
  */
 / {
        model = "Toradex Colibri T30";
@@ -15,8 +15,8 @@
 
        host1x@50000000 {
                hdmi@54280000 {
-                       vdd-supply = <&sys_3v3_reg>;
-                       pll-supply = <&vio_reg>;
+                       vdd-supply = <&avdd_hdmi_3v3_reg>;
+                       pll-supply = <&avdd_hdmi_pll_1v8_reg>;
 
                        nvidia,hpd-gpio =
                                <&gpio TEGRA_GPIO(N, 7) GPIO_ACTIVE_HIGH>;
@@ -39,7 +39,7 @@
 
                        /* Colibri Backlight PWM<A> */
                        sdmmc3_dat3_pb4 {
-                               nvidia,pins =   "sdmmc3_dat3_pb4";
+                               nvidia,pins = "sdmmc3_dat3_pb4";
                                nvidia,function = "pwm0";
                                nvidia,pull = <TEGRA_PIN_PULL_NONE>;
                                nvidia,tristate = <TEGRA_PIN_DISABLE>;
                                nvidia,enable-input = <TEGRA_PIN_ENABLE>;
                        };
 
-                       /* Thermal alert, need to be disabled */
-                       lcd_dc1_pd2 {
-                               nvidia,pins = "lcd_dc1_pd2";
-                               nvidia,function = "rsvd3";
-                               nvidia,pull = <TEGRA_PIN_PULL_NONE>;
-                               nvidia,tristate = <TEGRA_PIN_DISABLE>;
-                               nvidia,enable-input = <TEGRA_PIN_ENABLE>;
-                       };
-
                        /* Colibri MMC */
                        kb_row10_ps2 {
                                nvidia,pins = "kb_row10_ps2";
                                nvidia,tristate = <TEGRA_PIN_DISABLE>;
                        };
                        kb_row11_ps3 {
-                               nvidia,pins =   "kb_row11_ps3",
-                                               "kb_row12_ps4",
-                                               "kb_row13_ps5",
-                                               "kb_row14_ps6",
-                                               "kb_row15_ps7";
+                               nvidia,pins = "kb_row11_ps3",
+                                             "kb_row12_ps4",
+                                             "kb_row13_ps5",
+                                             "kb_row14_ps6",
+                                             "kb_row15_ps7";
                                nvidia,function = "sdmmc2";
                                nvidia,pull = <TEGRA_PIN_PULL_UP>;
                                nvidia,tristate = <TEGRA_PIN_DISABLE>;
 
                        /* Colibri SSP */
                        ulpi_clk_py0 {
-                               nvidia,pins =   "ulpi_clk_py0",
-                                               "ulpi_dir_py1",
-                                               "ulpi_nxt_py2",
-                                               "ulpi_stp_py3";
+                               nvidia,pins = "ulpi_clk_py0",
+                                             "ulpi_dir_py1",
+                                             "ulpi_nxt_py2",
+                                             "ulpi_stp_py3";
                                nvidia,function = "spi1";
                                nvidia,pull = <TEGRA_PIN_PULL_NONE>;
                                nvidia,tristate = <TEGRA_PIN_DISABLE>;
                        };
                        sdmmc3_dat6_pd3 {
-                               nvidia,pins =   "sdmmc3_dat6_pd3",
-                                               "sdmmc3_dat7_pd4";
+                               nvidia,pins = "sdmmc3_dat6_pd3",
+                                             "sdmmc3_dat7_pd4";
                                nvidia,function = "spdif";
                                nvidia,pull = <TEGRA_PIN_PULL_NONE>;
                                nvidia,tristate = <TEGRA_PIN_ENABLE>;
 
                        /* Colibri UART_A */
                        ulpi_data0 {
-                               nvidia,pins =   "ulpi_data0_po1",
-                                               "ulpi_data1_po2",
-                                               "ulpi_data2_po3",
-                                               "ulpi_data3_po4",
-                                               "ulpi_data4_po5",
-                                               "ulpi_data5_po6",
-                                               "ulpi_data6_po7",
-                                               "ulpi_data7_po0";
+                               nvidia,pins = "ulpi_data0_po1",
+                                             "ulpi_data1_po2",
+                                             "ulpi_data2_po3",
+                                             "ulpi_data3_po4",
+                                             "ulpi_data4_po5",
+                                             "ulpi_data5_po6",
+                                             "ulpi_data6_po7",
+                                             "ulpi_data7_po0";
                                nvidia,function = "uarta";
                                nvidia,pull = <TEGRA_PIN_PULL_NONE>;
                                nvidia,tristate = <TEGRA_PIN_DISABLE>;
 
                        /* Colibri UART_B */
                        gmi_a16_pj7 {
-                               nvidia,pins =   "gmi_a16_pj7",
-                                               "gmi_a17_pb0",
-                                               "gmi_a18_pb1",
-                                               "gmi_a19_pk7";
+                               nvidia,pins = "gmi_a16_pj7",
+                                             "gmi_a17_pb0",
+                                             "gmi_a18_pb1",
+                                             "gmi_a19_pk7";
                                nvidia,function = "uartd";
                                nvidia,pull = <TEGRA_PIN_PULL_NONE>;
                                nvidia,tristate = <TEGRA_PIN_DISABLE>;
 
                        /* Colibri UART_C */
                        uart2_rxd {
-                               nvidia,pins =   "uart2_rxd_pc3",
-                                               "uart2_txd_pc2";
+                               nvidia,pins = "uart2_rxd_pc3",
+                                             "uart2_txd_pc2";
                                nvidia,function = "uartb";
                                nvidia,pull = <TEGRA_PIN_PULL_NONE>;
                                nvidia,tristate = <TEGRA_PIN_DISABLE>;
 
                        /* eMMC */
                        sdmmc4_clk_pcc4 {
-                               nvidia,pins =   "sdmmc4_clk_pcc4",
-                                               "sdmmc4_rst_n_pcc3";
+                               nvidia,pins = "sdmmc4_clk_pcc4",
+                                             "sdmmc4_rst_n_pcc3";
                                nvidia,function = "sdmmc4";
                                nvidia,pull = <TEGRA_PIN_PULL_NONE>;
                                nvidia,tristate = <TEGRA_PIN_DISABLE>;
                        };
                        sdmmc4_dat0_paa0 {
-                               nvidia,pins =   "sdmmc4_dat0_paa0",
-                                               "sdmmc4_dat1_paa1",
-                                               "sdmmc4_dat2_paa2",
-                                               "sdmmc4_dat3_paa3",
-                                               "sdmmc4_dat4_paa4",
-                                               "sdmmc4_dat5_paa5",
-                                               "sdmmc4_dat6_paa6",
-                                               "sdmmc4_dat7_paa7";
+                               nvidia,pins = "sdmmc4_dat0_paa0",
+                                             "sdmmc4_dat1_paa1",
+                                             "sdmmc4_dat2_paa2",
+                                             "sdmmc4_dat3_paa3",
+                                             "sdmmc4_dat4_paa4",
+                                             "sdmmc4_dat5_paa5",
+                                             "sdmmc4_dat6_paa6",
+                                             "sdmmc4_dat7_paa7";
                                nvidia,function = "sdmmc4";
                                nvidia,pull = <TEGRA_PIN_PULL_UP>;
                                nvidia,tristate = <TEGRA_PIN_DISABLE>;
                        };
+
+                       /* Power I2C (On-module) */
+                       pwr_i2c_scl_pz6 {
+                               nvidia,pins = "pwr_i2c_scl_pz6",
+                                             "pwr_i2c_sda_pz7";
+                               nvidia,function = "i2cpwr";
+                               nvidia,pull = <TEGRA_PIN_PULL_NONE>;
+                               nvidia,tristate = <TEGRA_PIN_DISABLE>;
+                               nvidia,enable-input = <TEGRA_PIN_ENABLE>;
+                               nvidia,lock = <TEGRA_PIN_DISABLE>;
+                               nvidia,open-drain = <TEGRA_PIN_ENABLE>;
+                       };
+
+                       /*
+                        * THERMD_ALERT#, unlatched I2C address pin of LM95245
+                        * temperature sensor therefore requires disabling for
+                        * now
+                        */
+                       lcd_dc1_pd2 {
+                               nvidia,pins = "lcd_dc1_pd2";
+                               nvidia,function = "rsvd3";
+                               nvidia,pull = <TEGRA_PIN_PULL_NONE>;
+                               nvidia,tristate = <TEGRA_PIN_DISABLE>;
+                               nvidia,enable-input = <TEGRA_PIN_ENABLE>;
+                       };
+
+                       /* TOUCH_PEN_INT# */
+                       pv0 {
+                               nvidia,pins = "pv0";
+                               nvidia,function = "rsvd1";
+                               nvidia,pull = <TEGRA_PIN_PULL_NONE>;
+                               nvidia,tristate = <TEGRA_PIN_DISABLE>;
+                               nvidia,enable-input = <TEGRA_PIN_ENABLE>;
+                       };
                };
        };
 
                                /*
                                 * EN_+V3.3 switching via FET:
                                 * +V3.3_AUDIO_AVDD_S, +V3.3 and +V1.8_VDD_LAN
-                                * see also v3_3 fixed supply
+                                * see also 3v3 fixed supply
                                 */
                                ldo2_reg: ldo2 {
                                        regulator-name = "en_3v3";
                        };
                };
 
+               /* STMPE811 touch screen controller */
+               stmpe811@41 {
+                       compatible = "st,stmpe811";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <0x41>;
+                       interrupts = <TEGRA_GPIO(V, 0) IRQ_TYPE_LEVEL_LOW>;
+                       interrupt-parent = <&gpio>;
+                       interrupt-controller;
+                       id = <0>;
+                       blocks = <0x5>;
+                       irq-trigger = <0x1>;
+
+                       stmpe_touchscreen {
+                               compatible = "st,stmpe-ts";
+                               reg = <0>;
+                               /* 3.25 MHz ADC clock speed */
+                               st,adc-freq = <1>;
+                               /* 8 sample average control */
+                               st,ave-ctrl = <3>;
+                               /* 7 length fractional part in z */
+                               st,fraction-z = <7>;
+                               /*
+                                * 50 mA typical 80 mA max touchscreen drivers
+                                * current limit value
+                                */
+                               st,i-drive = <1>;
+                               /* 12-bit ADC */
+                               st,mod-12b = <1>;
+                               /* internal ADC reference */
+                               st,ref-sel = <0>;
+                               /* ADC converstion time: 80 clocks */
+                               st,sample-time = <4>;
+                               /* 1 ms panel driver settling time */
+                               st,settling = <3>;
+                               /* 5 ms touch detect interrupt delay */
+                               st,touch-det-delay = <5>;
+                       };
+               };
+
                /*
                 * LM95245 temperature sensor
                 * Note: OVERT_N directly connected to PMIC PWRDN
                nvidia,sys-clock-req-active-high;
        };
 
-       emmc: sdhci@78000600 {
+       /* eMMC */
+       sdhci@78000600 {
                status = "okay";
                bus-width = <8>;
                non-removable;
                #address-cells = <1>;
                #size-cells = <0>;
 
-               sys_3v3_reg: regulator@100 {
+               avdd_hdmi_pll_1v8_reg: regulator@100 {
                        compatible = "regulator-fixed";
                        reg = <100>;
+                       regulator-name = "+V1.8_AVDD_HDMI_PLL";
+                       regulator-min-microvolt = <1800000>;
+                       regulator-max-microvolt = <1800000>;
+                       enable-active-high;
+                       gpio = <&pmic 6 GPIO_ACTIVE_HIGH>;
+                       vin-supply = <&vio_reg>;
+               };
+
+               sys_3v3_reg: regulator@101 {
+                       compatible = "regulator-fixed";
+                       reg = <101>;
                        regulator-name = "3v3";
                        regulator-min-microvolt = <3300000>;
                        regulator-max-microvolt = <3300000>;
                        regulator-always-on;
                };
 
-               charge_pump_5v0_reg: regulator@101 {
+               avdd_hdmi_3v3_reg: regulator@102 {
                        compatible = "regulator-fixed";
-                       reg = <101>;
+                       reg = <102>;
+                       regulator-name = "+V3.3_AVDD_HDMI";
+                       regulator-min-microvolt = <3300000>;
+                       regulator-max-microvolt = <3300000>;
+                       enable-active-high;
+                       gpio = <&pmic 6 GPIO_ACTIVE_HIGH>;
+                       vin-supply = <&sys_3v3_reg>;
+               };
+
+               charge_pump_5v0_reg: regulator@103 {
+                       compatible = "regulator-fixed";
+                       reg = <103>;
                        regulator-name = "5v0";
                        regulator-min-microvolt = <5000000>;
                        regulator-max-microvolt = <5000000>;
index c6938ad1b543fb93cf22d297dda5b2d18795afe8..313e260529a31283a4e0c01e0b4ac92b8f102112 100644 (file)
@@ -42,8 +42,8 @@
                         <&tegra_car TEGRA30_CLK_CML0>;
                clock-names = "pex", "afi", "pll_e", "cml";
                resets = <&tegra_car 70>,
-                        <&tegra_car 72>,
-                        <&tegra_car 74>;
+                        <&tegra_car 72>,
+                        <&tegra_car 74>;
                reset-names = "pex", "afi", "pcie_x";
                status = "disabled";
 
                                  &tegra_car TEGRA30_CLK_GR3D2>;
                        clock-names = "3d", "3d2";
                        resets = <&tegra_car 24>,
-                                <&tegra_car 98>;
+                                <&tegra_car 98>;
                        reset-names = "3d", "3d2";
                };
 
        };
 
        i2c@7000c000 {
-               compatible =  "nvidia,tegra30-i2c", "nvidia,tegra20-i2c";
+               compatible = "nvidia,tegra30-i2c", "nvidia,tegra20-i2c";
                reg = <0x7000c000 0x100>;
                interrupts = <GIC_SPI 38 IRQ_TYPE_LEVEL_HIGH>;
                #address-cells = <1>;
                reg = <0x70030000 0x10000>;
                interrupts = <GIC_SPI 81 IRQ_TYPE_LEVEL_HIGH>;
                clocks = <&tegra_car TEGRA30_CLK_HDA>,
-                        <&tegra_car TEGRA30_CLK_HDA2HDMI>,
+                        <&tegra_car TEGRA30_CLK_HDA2HDMI>,
                         <&tegra_car TEGRA30_CLK_HDA2CODEC_2X>;
                clock-names = "hda", "hda2hdmi", "hda2codec_2x";
                resets = <&tegra_car 125>, /* hda */
index bfd3bb8c82857c7d00738ff4c81b57a5176cef4b..f1e9d40149ab89026e9e1035248add10b03a1e2a 100644 (file)
@@ -57,8 +57,7 @@
        };
 
        chosen {
-               bootargs = "console=ttyS0,115200";
-               stdout-path = &serial0;
+               stdout-path = "serial0:115200n8";
        };
 
        aliases {
 };
 
 &extbus {
-       ranges = <0 0x00000000 0x0f000000 0x01000000
-                 1 0x00000000 0x00000000 0x08000000>;
+       ranges = <1 0x00000000 0x42000000 0x02000000>;
 };
 
 &support_card {
-       ranges = <0x00000000 1 0x03f00000 0x00100000>;
+       ranges = <0x00000000 1 0x01f00000 0x00100000>;
 };
 
 &ethsc {
index a6a185fae8f1dcb0d39ffa61027c1bbcb5756aed..af493819548dca9f5fed87d104a403aa5d713a46 100644 (file)
@@ -55,6 +55,7 @@
                        device_type = "cpu";
                        compatible = "arm,cortex-a9";
                        reg = <0>;
+                       next-level-cache = <&l2>;
                };
        };
 
                        #size-cells = <1>;
                };
 
+               l2: l2-cache@500c0000 {
+                       compatible = "socionext,uniphier-system-cache";
+                       reg = <0x500c0000 0x2000>, <0x503c0100 0x4>,
+                             <0x506c0000 0x400>;
+                       interrupts = <0 174 4>, <0 175 4>;
+                       cache-unified;
+                       cache-size = <(512 * 1024)>;
+                       cache-sets = <256>;
+                       cache-line-size = <128>;
+                       cache-level = <2>;
+               };
+
                serial0: serial@54006800 {
                        compatible = "socionext,uniphier-uart";
                        status = "disabled";
                        clock-frequency = <100000>;
                };
 
-               system-bus-controller-misc@59800000 {
-                       compatible = "socionext,uniphier-system-bus-controller-misc",
-                                    "syscon";
-                       reg = <0x59800000 0x2000>;
+               system-bus-controller@58c00000 {
+                       compatible = "socionext,uniphier-system-bus-controller";
+                       reg = <0x58c00000 0x400>, <0x59800000 0x2000>;
                };
 
                usb0: usb@5a800100 {
index f80f772d99fb5750ca4cb484a49bbea18b8ba61a..5baa9fc9c8886492b70a63e7b32e0e05b9dd4611 100644 (file)
@@ -57,8 +57,7 @@
        };
 
        chosen {
-               bootargs = "console=ttyS0,115200";
-               stdout-path = &serial0;
+               stdout-path = "serial0:115200n8";
        };
 
        aliases {
 };
 
 &extbus {
-       ranges = <0 0x00000000 0x0f000000 0x01000000
-                 1 0x00000000 0x00000000 0x08000000>;
+       ranges = <1 0x00000000 0x42000000 0x02000000>;
 };
 
 &support_card {
-       ranges = <0x00000000 1 0x03f00000 0x00100000>;
+       ranges = <0x00000000 1 0x01f00000 0x00100000>;
 };
 
 &ethsc {
index 69a5b7d396293e28f4f0728300c7ae3333ec1714..24626687d4df5bce1b93ba18fcef2668ec520f14 100644 (file)
@@ -57,8 +57,7 @@
        };
 
        chosen {
-               bootargs = "console=ttyS0,115200";
-               stdout-path = &serial0;
+               stdout-path = "serial0:115200n8";
        };
 
        aliases {
 };
 
 &extbus {
-       ranges = <0 0x00000000 0x0f000000 0x01000000
-                 1 0x00000000 0x00000000 0x08000000>;
+       ranges = <1 0x00000000 0x42000000 0x02000000>;
 };
 
 &support_card {
-       ranges = <0x00000000 1 0x03f00000 0x00100000>;
+       ranges = <0x00000000 1 0x01f00000 0x00100000>;
 };
 
 &ethsc {
index e8bbc454d7887d9f8887065cc4a378fc7bc89a94..254642fe0e71300f112a6b57eb379f7f1ff42722 100644 (file)
                        device_type = "cpu";
                        compatible = "arm,cortex-a9";
                        reg = <0>;
+                       next-level-cache = <&l2>;
                };
 
                cpu@1 {
                        device_type = "cpu";
                        compatible = "arm,cortex-a9";
                        reg = <1>;
+                       next-level-cache = <&l2>;
                };
        };
 
                        #size-cells = <1>;
                };
 
+               l2: l2-cache@500c0000 {
+                       compatible = "socionext,uniphier-system-cache";
+                       reg = <0x500c0000 0x2000>, <0x503c0100 0x4>,
+                             <0x506c0000 0x400>;
+                       interrupts = <0 174 4>, <0 175 4>;
+                       cache-unified;
+                       cache-size = <(768 * 1024)>;
+                       cache-sets = <256>;
+                       cache-line-size = <128>;
+                       cache-level = <2>;
+               };
+
                serial0: serial@54006800 {
                        compatible = "socionext,uniphier-uart";
                        status = "disabled";
                        clock-frequency = <400000>;
                };
 
-               system-bus-controller-misc@59800000 {
-                       compatible = "socionext,uniphier-system-bus-controller-misc",
-                                    "syscon";
-                       reg = <0x59800000 0x2000>;
+               system-bus-controller@58c00000 {
+                       compatible = "socionext,uniphier-system-bus-controller";
+                       reg = <0x58c00000 0x400>, <0x59800000 0x2000>;
                };
 
                usb2: usb@5a800100 {
index 59c2b127cffabfc87e17e5161ac7473f1d9a4c3c..11eb76239feb7b549931e3940107a23d3d0d10e3 100644 (file)
                        device_type = "cpu";
                        compatible = "arm,cortex-a9";
                        reg = <0>;
+                       next-level-cache = <&l2>;
                };
 
                cpu@1 {
                        device_type = "cpu";
                        compatible = "arm,cortex-a9";
                        reg = <1>;
+                       next-level-cache = <&l2>;
                };
        };
 
                        #size-cells = <1>;
                };
 
+               l2: l2-cache@500c0000 {
+                       compatible = "socionext,uniphier-system-cache";
+                       reg = <0x500c0000 0x2000>, <0x503c0100 0x8>,
+                             <0x506c0000 0x400>;
+                       interrupts = <0 190 4>, <0 191 4>;
+                       cache-unified;
+                       cache-size = <(2 * 1024 * 1024)>;
+                       cache-sets = <512>;
+                       cache-line-size = <128>;
+                       cache-level = <2>;
+                       next-level-cache = <&l3>;
+               };
+
+               l3: l3-cache@500c8000 {
+                       compatible = "socionext,uniphier-system-cache";
+                       reg = <0x500c8000 0x2000>, <0x503c8100 0x8>,
+                             <0x506c8000 0x400>;
+                       interrupts = <0 174 4>, <0 175 4>;
+                       cache-unified;
+                       cache-size = <(2 * 1024 * 1024)>;
+                       cache-sets = <512>;
+                       cache-line-size = <256>;
+                       cache-level = <3>;
+               };
+
                serial0: serial@54006800 {
                        compatible = "socionext,uniphier-uart";
                        status = "disabled";
                        clock-frequency = <400000>;
                };
 
-               system-bus-controller-misc@59800000 {
-                       compatible = "socionext,uniphier-system-bus-controller-misc",
-                                    "syscon";
-                       reg = <0x59800000 0x2000>;
+               system-bus-controller@58c00000 {
+                       compatible = "socionext,uniphier-system-bus-controller";
+                       reg = <0x58c00000 0x400>, <0x59800000 0x2000>;
                };
 
                pinctrl: pinctrl@5f801000 {
index 1a440f87fa920bcdc9b25c256d4e36167a10946e..b7a032156789f1d9b4b28a3d28931906a1c7c361 100644 (file)
@@ -58,8 +58,7 @@
        };
 
        chosen {
-               bootargs = "console=ttyS0,115200";
-               stdout-path = &serial0;
+               stdout-path = "serial0:115200n8";
        };
 
        aliases {
 };
 
 &extbus {
-       ranges = <0 0x00000000 0x0f000000 0x01000000
-                 1 0x00000000 0x00000000 0x08000000>;
+       ranges = <1 0x00000000 0x42000000 0x02000000>;
 };
 
 &support_card {
-       ranges = <0x00000000 1 0x03f00000 0x00100000>;
+       ranges = <0x00000000 1 0x01f00000 0x00100000>;
 };
 
 &ethsc {
index 3cc90cd37a263b334635963153c3f9a4c21d1c9b..691a17d765c2591a7f34edcf479373daeaa6224c 100644 (file)
                        device_type = "cpu";
                        compatible = "arm,cortex-a9";
                        reg = <0>;
+                       next-level-cache = <&l2>;
                };
 
                cpu@1 {
                        device_type = "cpu";
                        compatible = "arm,cortex-a9";
                        reg = <1>;
+                       next-level-cache = <&l2>;
                };
        };
 
                              <0x20000100 0x100>;
                };
 
+               l2: l2-cache@500c0000 {
+                       compatible = "socionext,uniphier-system-cache";
+                       reg = <0x500c0000 0x2000>, <0x503c0100 0x4>,
+                             <0x506c0000 0x400>;
+                       interrupts = <0 174 4>, <0 175 4>;
+                       cache-unified;
+                       cache-size = <(512 * 1024)>;
+                       cache-sets = <256>;
+                       cache-line-size = <128>;
+                       cache-level = <2>;
+               };
+
                serial0: serial@54006800 {
                        compatible = "socionext,uniphier-uart";
                        status = "disabled";
                        clock-frequency = <400000>;
                };
 
-               system-bus-controller-misc@59800000 {
-                       compatible = "socionext,uniphier-system-bus-controller-misc",
-                                    "syscon";
-                       reg = <0x59800000 0x2000>;
+               system-bus-controller@58c00000 {
+                       compatible = "socionext,uniphier-system-bus-controller";
+                       reg = <0x58c00000 0x400>, <0x59800000 0x2000>;
                };
 
                usb0: usb@5a800100 {
index 955d417a5c42427bff6395d3c3af83731fe16660..fc7250c61674f0e0b8a4ab0b393801790dc8c00a 100644 (file)
@@ -57,8 +57,7 @@
        };
 
        chosen {
-               bootargs = "console=ttyS0,115200";
-               stdout-path = &serial0;
+               stdout-path = "serial0:115200n8";
        };
 
        aliases {
 };
 
 &extbus {
-       ranges = <0 0x00000000 0x0f000000 0x01000000
-                 1 0x00000000 0x00000000 0x08000000>;
+       ranges = <1 0x00000000 0x42000000 0x02000000>;
 };
 
 &support_card {
-       ranges = <0x00000000 1 0x03f00000 0x00100000>;
+       ranges = <0x00000000 1 0x01f00000 0x00100000>;
 };
 
 &ethsc {
index 58067dfc16e592843ddfeb3a98ccb6b75abfd9ea..e88559b66be75399634ec1f855813cd0a06ea78d 100644 (file)
@@ -55,6 +55,7 @@
                        device_type = "cpu";
                        compatible = "arm,cortex-a9";
                        reg = <0>;
+                       next-level-cache = <&l2>;
                };
        };
 
                        #size-cells = <1>;
                };
 
+               l2: l2-cache@500c0000 {
+                       compatible = "socionext,uniphier-system-cache";
+                       reg = <0x500c0000 0x2000>, <0x503c0100 0x4>,
+                             <0x506c0000 0x400>;
+                       interrupts = <0 174 4>, <0 175 4>;
+                       cache-unified;
+                       cache-size = <(256 * 1024)>;
+                       cache-sets = <256>;
+                       cache-line-size = <128>;
+                       cache-level = <2>;
+               };
+
                serial0: serial@54006800 {
                        compatible = "socionext,uniphier-uart";
                        status = "disabled";
                        clock-frequency = <100000>;
                };
 
-               system-bus-controller-misc@59800000 {
-                       compatible = "socionext,uniphier-system-bus-controller-misc",
-                                    "syscon";
-                       reg = <0x59800000 0x2000>;
+               system-bus-controller@58c00000 {
+                       compatible = "socionext,uniphier-system-bus-controller";
+                       reg = <0x58c00000 0x400>, <0x59800000 0x2000>;
                };
 
                usb0: usb@5a800100 {
diff --git a/arch/arm/boot/dts/uniphier-proxstream2-gentil.dts b/arch/arm/boot/dts/uniphier-proxstream2-gentil.dts
new file mode 100644 (file)
index 0000000..9d7ec5c
--- /dev/null
@@ -0,0 +1,78 @@
+/*
+ * Device Tree Source for UniPhier ProXstream2 Gentil Board
+ *
+ * Copyright (C) 2015 Masahiro Yamada <yamada.masahiro@socionext.com>
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This file 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; either version 2 of the
+ *     License, or (at your option) any later version.
+ *
+ *     This file is distributed in the hope that it will be useful,
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ * Or, alternatively,
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use,
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/dts-v1/;
+/include/ "uniphier-proxstream2.dtsi"
+
+/ {
+       model = "UniPhier ProXstream2 Gentil Board";
+       compatible = "socionext,proxstream2-gentil", "socionext,proxstream2";
+
+       memory {
+               device_type = "memory";
+               reg = <0x80000000 0x80000000>;
+       };
+
+       chosen {
+               stdout-path = "serial2:115200n8";
+       };
+
+       aliases {
+               serial0 = &serial0;
+               serial1 = &serial1;
+               serial2 = &serial2;
+               i2c0 = &i2c0;
+               i2c4 = &i2c4;
+               i2c5 = &i2c5;
+               i2c6 = &i2c6;
+       };
+};
+
+&serial2 {
+       status = "okay";
+};
+
+&i2c0 {
+       status = "okay";
+};
diff --git a/arch/arm/boot/dts/uniphier-proxstream2-vodka.dts b/arch/arm/boot/dts/uniphier-proxstream2-vodka.dts
new file mode 100644 (file)
index 0000000..498acac
--- /dev/null
@@ -0,0 +1,78 @@
+/*
+ * Device Tree Source for UniPhier ProXstream2 Vodka Board
+ *
+ * Copyright (C) 2015 Masahiro Yamada <yamada.masahiro@socionext.com>
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This file 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; either version 2 of the
+ *     License, or (at your option) any later version.
+ *
+ *     This file is distributed in the hope that it will be useful,
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ * Or, alternatively,
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use,
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/dts-v1/;
+/include/ "uniphier-proxstream2.dtsi"
+
+/ {
+       model = "UniPhier ProXstream2 Vodka Board";
+       compatible = "socionext,proxstream2-vodka", "socionext,proxstream2";
+
+       memory {
+               device_type = "memory";
+               reg = <0x80000000 0x80000000>;
+       };
+
+       chosen {
+               stdout-path = "serial2:115200n8";
+       };
+
+       aliases {
+               serial0 = &serial0;
+               serial1 = &serial1;
+               serial2 = &serial2;
+               i2c0 = &i2c0;
+               i2c4 = &i2c4;
+               i2c5 = &i2c5;
+               i2c6 = &i2c6;
+       };
+};
+
+&serial2 {
+       status = "okay";
+};
+
+&i2c0 {
+       status = "okay";
+};
index 4c7b2461101215dc8075dc2f291450aee268fe8e..259f1a909e2401db2bd09e86476781e54583ec92 100644 (file)
                        device_type = "cpu";
                        compatible = "arm,cortex-a9";
                        reg = <0>;
+                       next-level-cache = <&l2>;
                };
 
                cpu@1 {
                        device_type = "cpu";
                        compatible = "arm,cortex-a9";
                        reg = <1>;
+                       next-level-cache = <&l2>;
                };
 
                cpu@2 {
                        device_type = "cpu";
                        compatible = "arm,cortex-a9";
                        reg = <2>;
+                       next-level-cache = <&l2>;
                };
 
                cpu@3 {
                        device_type = "cpu";
                        compatible = "arm,cortex-a9";
                        reg = <3>;
+                       next-level-cache = <&l2>;
                };
        };
 
                        #size-cells = <1>;
                };
 
+               l2: l2-cache@500c0000 {
+                       compatible = "socionext,uniphier-system-cache";
+                       reg = <0x500c0000 0x2000>, <0x503c0100 0x4>,
+                             <0x506c0000 0x400>;
+                       interrupts = <0 174 4>, <0 175 4>, <0 190 4>, <0 191 4>;
+                       cache-unified;
+                       cache-size = <(1280 * 1024)>;
+                       cache-sets = <512>;
+                       cache-line-size = <128>;
+                       cache-level = <2>;
+               };
+
                serial0: serial@54006800 {
                        compatible = "socionext,uniphier-uart";
                        status = "disabled";
                        clock-frequency = <400000>;
                };
 
-               system-bus-controller-misc@59800000 {
-                       compatible = "socionext,uniphier-system-bus-controller-misc",
-                                    "syscon";
-                       reg = <0x59800000 0x2000>;
+               system-bus-controller@58c00000 {
+                       compatible = "socionext,uniphier-system-bus-controller";
+                       reg = <0x58c00000 0x400>, <0x59800000 0x2000>;
                };
 
                pinctrl: pinctrl@5f801000 {
index 68ca125b56ea2f9db1642e05ef75f1e6534625f2..e5949b9349453394688ba62bd4073c817049ac58 100644 (file)
        pinctrl-0 = <&pinctrl_i2c0>;
 };
 
+&nfc {
+       assigned-clocks = <&clks VF610_CLK_NFC>;
+       assigned-clock-rates = <33000000>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_nfc>;
+       status = "okay";
+
+       nand@0 {
+               compatible = "fsl,vf610-nfc-nandcs";
+               reg = <0>;
+               #address-cells = <1>;
+               #size-cells = <1>;
+               nand-bus-width = <8>;
+               nand-ecc-mode = "hw";
+               nand-ecc-strength = <32>;
+               nand-ecc-step-size = <2048>;
+               nand-on-flash-bbt;
+       };
+};
+
 &pwm0 {
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_pwm0>;
                        >;
                };
 
+               pinctrl_nfc: nfcgrp {
+                       fsl,pins = <
+                               VF610_PAD_PTD23__NF_IO7         0x28df
+                               VF610_PAD_PTD22__NF_IO6         0x28df
+                               VF610_PAD_PTD21__NF_IO5         0x28df
+                               VF610_PAD_PTD20__NF_IO4         0x28df
+                               VF610_PAD_PTD19__NF_IO3         0x28df
+                               VF610_PAD_PTD18__NF_IO2         0x28df
+                               VF610_PAD_PTD17__NF_IO1         0x28df
+                               VF610_PAD_PTD16__NF_IO0         0x28df
+                               VF610_PAD_PTB24__NF_WE_B        0x28c2
+                               VF610_PAD_PTB25__NF_CE0_B       0x28c2
+                               VF610_PAD_PTB27__NF_RE_B        0x28c2
+                               VF610_PAD_PTC26__NF_RB_B        0x283d
+                               VF610_PAD_PTC27__NF_ALE         0x28c2
+                               VF610_PAD_PTC28__NF_CLE         0x28c2
+                       >;
+               };
+
                pinctrl_pwm0: pwm0grp {
                        fsl,pins = <
                                VF610_PAD_PTB0__FTM0_CH0                0x1182
index 7fc782c4fc52894d68b555c914e4a1d013b83f59..c3173fc9e8336d97af3d60570b2d5eab7c6cad7f 100644 (file)
@@ -15,3 +15,8 @@
        model = "Toradex Colibri VF50 on Colibri Evaluation Board";
        compatible = "toradex,vf500-colibri_vf50-on-eval", "toradex,vf500-colibri_vf50", "fsl,vf500";
 };
+
+&touchscreen {
+       vf50-ts-min-pressure = <200>;
+       status = "okay";
+};
index cee34a32f25be2cf8bd6219e0a35871d5d7bf34e..84f091d1fcf29bb3c24ce7c8f9e8c9163f1169c1 100644 (file)
        memory {
                reg = <0x80000000 0x8000000>;
        };
+
+       touchscreen: vf50-touchscreen {
+               compatible = "toradex,vf50-touchscreen";
+               io-channels = <&adc1 0>,<&adc0 0>,
+                               <&adc0 1>,<&adc1 2>;
+               xp-gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
+               xm-gpios = <&gpio2 29 GPIO_ACTIVE_HIGH>;
+               yp-gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;
+               ym-gpios = <&gpio0 4 GPIO_ACTIVE_HIGH>;
+               interrupt-parent = <&gpio0>;
+               interrupts = <8 IRQ_TYPE_LEVEL_LOW>;
+               pinctrl-names = "idle","default","gpios";
+               pinctrl-0 = <&pinctrl_touchctrl_idle>;
+               pinctrl-1 = <&pinctrl_touchctrl_default>;
+               pinctrl-2 = <&pinctrl_touchctrl_gpios>;
+               vf50-ts-min-pressure = <200>;
+               status = "disabled";
+       };
+};
+
+&iomuxc {
+       vf610-colibri {
+               pinctrl_touchctrl_idle: touchctrl_idle {
+                       fsl,pins = <
+                               VF610_PAD_PTA18__GPIO_8         0x006d
+                               VF610_PAD_PTA19__GPIO_9         0x006c
+                               >;
+               };
+
+               pinctrl_touchctrl_default: touchctrl_default {
+                       fsl,pins = <
+                               VF610_PAD_PTA18__ADC0_SE0       0x0040
+                               VF610_PAD_PTA19__ADC0_SE1       0x0040
+                               VF610_PAD_PTA16__ADC1_SE0       0x0040
+                               VF610_PAD_PTB2__ADC1_SE2        0x0040
+                               >;
+               };
+
+               pinctrl_touchctrl_gpios: touchctrl_gpios {
+                       fsl,pins = <
+                               VF610_PAD_PTA23__GPIO_13        0x22e9
+                               VF610_PAD_PTB23__GPIO_93        0x22e9
+                               VF610_PAD_PTA22__GPIO_12        0x22e9
+                               VF610_PAD_PTA11__GPIO_4         0x22e9
+                               >;
+               };
+       };
 };
index 375ab23ca7438049bac8c46022dceed27a17e25f..5438ee4be2ecf6278ac35cbf097a225b38a8a3ec 100644 (file)
                        >;
                };
 
+               pinctrl_nfc: nfcgrp {
+                       fsl,pins = <
+                               VF610_PAD_PTD31__NF_IO15        0x28df
+                               VF610_PAD_PTD30__NF_IO14        0x28df
+                               VF610_PAD_PTD29__NF_IO13        0x28df
+                               VF610_PAD_PTD28__NF_IO12        0x28df
+                               VF610_PAD_PTD27__NF_IO11        0x28df
+                               VF610_PAD_PTD26__NF_IO10        0x28df
+                               VF610_PAD_PTD25__NF_IO9         0x28df
+                               VF610_PAD_PTD24__NF_IO8         0x28df
+                               VF610_PAD_PTD23__NF_IO7         0x28df
+                               VF610_PAD_PTD22__NF_IO6         0x28df
+                               VF610_PAD_PTD21__NF_IO5         0x28df
+                               VF610_PAD_PTD20__NF_IO4         0x28df
+                               VF610_PAD_PTD19__NF_IO3         0x28df
+                               VF610_PAD_PTD18__NF_IO2         0x28df
+                               VF610_PAD_PTD17__NF_IO1         0x28df
+                               VF610_PAD_PTD16__NF_IO0         0x28df
+                               VF610_PAD_PTB24__NF_WE_B        0x28c2
+                               VF610_PAD_PTB25__NF_CE0_B       0x28c2
+                               VF610_PAD_PTB27__NF_RE_B        0x28c2
+                               VF610_PAD_PTC26__NF_RB_B        0x283d
+                               VF610_PAD_PTC27__NF_ALE         0x28c2
+                               VF610_PAD_PTC28__NF_CLE         0x28c2
+                       >;
+               };
+
                pinctrl_pwm0: pwm0grp {
                        fsl,pins = <
                                VF610_PAD_PTB0__FTM0_CH0                0x1582
        };
 };
 
+&nfc {
+       assigned-clocks = <&clks VF610_CLK_NFC>;
+       assigned-clock-rates = <33000000>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_nfc>;
+       status = "okay";
+
+       nand@0 {
+               compatible = "fsl,vf610-nfc-nandcs";
+               reg = <0>;
+               #address-cells = <1>;
+               #size-cells = <1>;
+               nand-bus-width = <16>;
+               nand-ecc-mode = "hw";
+               nand-ecc-strength = <24>;
+               nand-ecc-step-size = <2048>;
+               nand-on-flash-bbt;
+       };
+};
+
 &pwm0 {
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_pwm0>;
index 6865137fd114c7364c88f104a7413bf3d89c3218..6736bae43a5b09280ec824146e6caee85f787cdd 100644 (file)
                                status = "disabled";
                        };
 
+                       nfc: nand@400e0000 {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               compatible = "fsl,vf610-nfc";
+                               reg = <0x400e0000 0x4000>;
+                               interrupts = <83 IRQ_TYPE_LEVEL_HIGH>;
+                               clocks = <&clks VF610_CLK_NFC>;
+                               clock-names = "nfc";
+                               status = "disabled";
+                       };
+
                        i2c2: i2c@400e6000 {
                                #address-cells = <1>;
                                #size-cells = <0>;
index 557a9c2ace49faadac1f0698b4f32d8361a1f1eb..46d076d7302b24e5234de911f66ff950205f67d5 100644 (file)
@@ -17,7 +17,7 @@
 
                cpu {
                        device_type = "cpu";
-                       compatible = "arm,arm1176ej-s";
+                       compatible = "arm,arm1176jzf";
                };
        };
 
index 090c5b25dbed59d2800a2121675f26f80f9dbf40..1b1e5acd76e2ebd8545f5da91397366b264a989f 100644 (file)
@@ -17,7 +17,6 @@ CONFIG_ARCH_MULTI_V4T=y
 CONFIG_ARCH_MULTI_V5=y
 # CONFIG_ARCH_MULTI_V7 is not set
 CONFIG_ARCH_AT91=y
-CONFIG_SOC_SAM_V4_V5=y
 CONFIG_SOC_AT91RM9200=y
 CONFIG_SOC_AT91SAM9=y
 CONFIG_AEABI=y
@@ -28,7 +27,6 @@ CONFIG_ARM_APPENDED_DTB=y
 CONFIG_ARM_ATAG_DTB_COMPAT=y
 CONFIG_CMDLINE="console=ttyS0,115200 initrd=0x21100000,25165824 root=/dev/ram0 rw"
 CONFIG_KEXEC=y
-CONFIG_AUTO_ZRELADDR=y
 # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
 CONFIG_NET=y
 CONFIG_PACKET=y
@@ -43,7 +41,6 @@ CONFIG_IP_PNP_RARP=y
 # CONFIG_INET_XFRM_MODE_TUNNEL is not set
 # CONFIG_INET_XFRM_MODE_BEET is not set
 # CONFIG_INET_DIAG is not set
-CONFIG_IPV6=y
 # CONFIG_INET6_XFRM_MODE_TRANSPORT is not set
 # CONFIG_INET6_XFRM_MODE_TUNNEL is not set
 # CONFIG_INET6_XFRM_MODE_BEET is not set
@@ -119,7 +116,6 @@ CONFIG_LEGACY_PTY_COUNT=4
 CONFIG_SERIAL_ATMEL=y
 CONFIG_SERIAL_ATMEL_CONSOLE=y
 CONFIG_HW_RANDOM=y
-CONFIG_I2C=y
 CONFIG_I2C_AT91=y
 CONFIG_I2C_GPIO=y
 CONFIG_SPI=y
@@ -142,16 +138,12 @@ CONFIG_SOC_CAMERA_OV2640=m
 CONFIG_DRM=y
 CONFIG_DRM_ATMEL_HLCDC=y
 CONFIG_DRM_PANEL_SIMPLE=y
-CONFIG_FB=y
 CONFIG_FB_ATMEL=y
-CONFIG_BACKLIGHT_LCD_SUPPORT=y
 # CONFIG_LCD_CLASS_DEVICE is not set
-CONFIG_BACKLIGHT_CLASS_DEVICE=y
 CONFIG_BACKLIGHT_ATMEL_LCDC=y
 # CONFIG_BACKLIGHT_GENERIC is not set
 CONFIG_BACKLIGHT_PWM=y
 CONFIG_FRAMEBUFFER_CONSOLE=y
-CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
 CONFIG_LOGO=y
 CONFIG_SOUND=y
 CONFIG_SND=y
@@ -216,18 +208,11 @@ CONFIG_DEBUG_FS=y
 # CONFIG_DEBUG_BUGVERBOSE is not set
 # CONFIG_FTRACE is not set
 CONFIG_DEBUG_USER=y
-CONFIG_CRYPTO=y
 CONFIG_CRYPTO_ECB=y
-CONFIG_CRYPTO_AES=y
-CONFIG_CRYPTO_ARC4=y
-# CONFIG_CRYPTO_ANSI_CPRNG is not set
 CONFIG_CRYPTO_USER_API_HASH=m
 CONFIG_CRYPTO_USER_API_SKCIPHER=m
 # CONFIG_CRYPTO_HW is not set
 CONFIG_CRC_CCITT=y
-CONFIG_CRC_ITU_T=y
-CONFIG_CRC7=m
-CONFIG_AVERAGE=y
 CONFIG_FONTS=y
 CONFIG_FONT_8x8=y
 CONFIG_FONT_ACORN_8x8=y
diff --git a/arch/arm/configs/bockw_defconfig b/arch/arm/configs/bockw_defconfig
deleted file mode 100644 (file)
index 3125e00..0000000
+++ /dev/null
@@ -1,133 +0,0 @@
-# CONFIG_ARM_PATCH_PHYS_VIRT is not set
-CONFIG_KERNEL_LZMA=y
-CONFIG_NO_HZ=y
-CONFIG_IKCONFIG=y
-CONFIG_IKCONFIG_PROC=y
-CONFIG_LOG_BUF_SHIFT=16
-CONFIG_SYSCTL_SYSCALL=y
-CONFIG_EMBEDDED=y
-CONFIG_SLAB=y
-# CONFIG_IOSCHED_CFQ is not set
-CONFIG_ARCH_SHMOBILE_LEGACY=y
-CONFIG_ARCH_R8A7778=y
-CONFIG_MACH_BOCKW=y
-CONFIG_MEMORY_START=0x60000000
-CONFIG_MEMORY_SIZE=0x10000000
-CONFIG_SHMOBILE_TIMER_HZ=1024
-# CONFIG_SH_TIMER_CMT is not set
-# CONFIG_EM_TIMER_STI is not set
-CONFIG_ARM_ERRATA_430973=y
-CONFIG_ARM_ERRATA_458693=y
-CONFIG_ARM_ERRATA_460075=y
-CONFIG_ARM_ERRATA_743622=y
-CONFIG_ARM_ERRATA_754322=y
-CONFIG_AEABI=y
-# CONFIG_OABI_COMPAT is not set
-CONFIG_HIGHMEM=y
-CONFIG_ZBOOT_ROM_TEXT=0x0
-CONFIG_ZBOOT_ROM_BSS=0x0
-CONFIG_ARM_APPENDED_DTB=y
-CONFIG_VFP=y
-# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
-CONFIG_PM=y
-CONFIG_NET=y
-CONFIG_PACKET=y
-CONFIG_UNIX=y
-CONFIG_INET=y
-CONFIG_IP_PNP=y
-CONFIG_IP_PNP_DHCP=y
-# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
-# CONFIG_INET_XFRM_MODE_TUNNEL is not set
-# CONFIG_INET_XFRM_MODE_BEET is not set
-# CONFIG_INET_LRO is not set
-# CONFIG_INET_DIAG is not set
-# CONFIG_IPV6 is not set
-CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
-CONFIG_DEVTMPFS=y
-CONFIG_DEVTMPFS_MOUNT=y
-# CONFIG_STANDALONE is not set
-# CONFIG_PREVENT_FIRMWARE_BUILD is not set
-# CONFIG_FW_LOADER is not set
-CONFIG_MTD=y
-CONFIG_MTD_CHAR=y
-CONFIG_MTD_BLOCK=y
-CONFIG_MTD_CFI=y
-CONFIG_MTD_CFI_AMDSTD=y
-CONFIG_MTD_M25P80=y
-CONFIG_MTD_SPI_NOR=y
-CONFIG_SCSI=y
-CONFIG_BLK_DEV_SD=y
-CONFIG_NETDEVICES=y
-# CONFIG_NET_CADENCE is not set
-# CONFIG_NET_VENDOR_BROADCOM is not set
-# CONFIG_NET_VENDOR_CIRRUS is not set
-# CONFIG_NET_VENDOR_FARADAY is not set
-# CONFIG_NET_VENDOR_INTEL is not set
-# CONFIG_NET_VENDOR_MARVELL is not set
-# CONFIG_NET_VENDOR_MICREL is not set
-# CONFIG_NET_VENDOR_NATSEMI is not set
-# CONFIG_NET_VENDOR_SEEQ is not set
-CONFIG_SMSC911X=y
-# CONFIG_NET_VENDOR_STMICRO is not set
-# CONFIG_NET_VENDOR_WIZNET is not set
-# CONFIG_INPUT is not set
-# CONFIG_SERIO is not set
-# CONFIG_VT is not set
-# CONFIG_LEGACY_PTYS is not set
-# CONFIG_DEVKMEM is not set
-CONFIG_SERIAL_SH_SCI=y
-CONFIG_SERIAL_SH_SCI_NR_UARTS=6
-CONFIG_SERIAL_SH_SCI_CONSOLE=y
-# CONFIG_HW_RANDOM is not set
-# CONFIG_HWMON is not set
-CONFIG_I2C=y
-CONFIG_I2C_RCAR=y
-CONFIG_GPIO_RCAR=y
-CONFIG_REGULATOR=y
-CONFIG_MEDIA_SUPPORT=y
-CONFIG_MEDIA_CAMERA_SUPPORT=y
-CONFIG_V4L_PLATFORM_DRIVERS=y
-CONFIG_SOC_CAMERA=y
-CONFIG_VIDEO_RCAR_VIN=y
-# CONFIG_MEDIA_SUBDRV_AUTOSELECT is not set
-CONFIG_VIDEO_ML86V7667=y
-CONFIG_SPI=y
-CONFIG_SPI_SH_HSPI=y
-CONFIG_SOUND=y
-CONFIG_SND=y
-CONFIG_SND_SOC=y
-CONFIG_SND_SOC_RCAR=y
-CONFIG_USB=y
-CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
-CONFIG_USB_EHCI_HCD=y
-CONFIG_USB_OHCI_HCD=y
-CONFIG_USB_OHCI_HCD_PLATFORM=y
-CONFIG_USB_EHCI_HCD_PLATFORM=y
-CONFIG_USB_STORAGE=y
-CONFIG_USB_RCAR_PHY=y
-CONFIG_MMC=y
-CONFIG_MMC_SDHI=y
-CONFIG_MMC_SH_MMCIF=y
-CONFIG_RTC_CLASS=y
-CONFIG_RTC_DRV_RX8581=y
-CONFIG_DMADEVICES=y
-CONFIG_RCAR_HPB_DMAE=y
-CONFIG_UIO=y
-CONFIG_UIO_PDRV_GENIRQ=y
-# CONFIG_IOMMU_SUPPORT is not set
-# CONFIG_DNOTIFY is not set
-CONFIG_TMPFS=y
-# CONFIG_MISC_FILESYSTEMS is not set
-CONFIG_NFS_FS=y
-CONFIG_NFS_V3_ACL=y
-CONFIG_NFS_V4=y
-CONFIG_NFS_SWAP=y
-CONFIG_NFS_V4_1=y
-CONFIG_ROOT_NFS=y
-# CONFIG_ENABLE_WARN_DEPRECATED is not set
-# CONFIG_ENABLE_MUST_CHECK is not set
-# CONFIG_SCHED_DEBUG is not set
-# CONFIG_DEBUG_BUGVERBOSE is not set
-# CONFIG_FTRACE is not set
-# CONFIG_ARM_UNWIND is not set
-CONFIG_AVERAGE=y
index 0ff608fd7f0fadebad79209f88aac97a91069279..e0841a58ff9d9e9fc399824ea85e5850daac60a3 100644 (file)
@@ -61,11 +61,12 @@ CONFIG_BLK_DEV_DM=y
 CONFIG_DM_CRYPT=m
 CONFIG_NETDEVICES=y
 CONFIG_SMSC911X=y
+CONFIG_USB_RTL8152=y
 CONFIG_USB_USBNET=y
 CONFIG_USB_NET_SMSC75XX=y
 CONFIG_USB_NET_SMSC95XX=y
-CONFIG_MWIFIEX=y
-CONFIG_MWIFIEX_SDIO=y
+CONFIG_MWIFIEX=m
+CONFIG_MWIFIEX_SDIO=m
 CONFIG_INPUT_EVDEV=y
 CONFIG_KEYBOARD_GPIO=y
 CONFIG_KEYBOARD_CROS_EC=y
@@ -126,6 +127,10 @@ CONFIG_REGULATOR_S2MPA01=y
 CONFIG_REGULATOR_S2MPS11=y
 CONFIG_REGULATOR_S5M8767=y
 CONFIG_REGULATOR_TPS65090=y
+CONFIG_MEDIA_SUPPORT=m
+CONFIG_MEDIA_CAMERA_SUPPORT=y
+CONFIG_MEDIA_USB_SUPPORT=y
+CONFIG_USB_VIDEO_CLASS=m
 CONFIG_DRM=y
 CONFIG_DRM_NXP_PTN3460=y
 CONFIG_DRM_PARADE_PS8622=y
@@ -136,7 +141,6 @@ CONFIG_DRM_EXYNOS_MIXER=y
 CONFIG_DRM_EXYNOS_HDMI=y
 CONFIG_DRM_PANEL_SIMPLE=y
 CONFIG_DRM_PANEL_SAMSUNG_S6E8AA0=y
-CONFIG_FB_SIMPLE=y
 CONFIG_EXYNOS_VIDEO=y
 CONFIG_EXYNOS_MIPI_DSI=y
 CONFIG_LCD_CLASS_DEVICE=y
@@ -159,8 +163,10 @@ CONFIG_USB_OHCI_HCD=y
 CONFIG_USB_OHCI_EXYNOS=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_DWC3=y
+CONFIG_USB_DWC2=y
 CONFIG_USB_HSIC_USB3503=y
 CONFIG_USB_GADGET=y
+CONFIG_USB_ETH=y
 CONFIG_MMC=y
 CONFIG_MMC_BLOCK_MINORS=16
 CONFIG_MMC_SDHCI=y
@@ -168,6 +174,12 @@ CONFIG_MMC_SDHCI_S3C=y
 CONFIG_MMC_SDHCI_S3C_DMA=y
 CONFIG_MMC_DW=y
 CONFIG_MMC_DW_EXYNOS=y
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
+CONFIG_LEDS_GPIO=y
+CONFIG_LEDS_PWM=y
+CONFIG_LEDS_TRIGGERS=y
+CONFIG_LEDS_TRIGGER_HEARTBEAT=y
 CONFIG_RTC_CLASS=y
 CONFIG_RTC_DRV_MAX77686=y
 CONFIG_RTC_DRV_MAX77802=y
index 79194c60c78c368949a21487b2191f37458d4f10..4187f69f663049ddd2ebbb0f7fdf4b6f95c9172b 100644 (file)
@@ -47,7 +47,6 @@ CONFIG_SOC_VF610=y
 CONFIG_PCI=y
 CONFIG_PCI_IMX6=y
 CONFIG_SMP=y
-CONFIG_VMSPLIT_2G=y
 CONFIG_PREEMPT_VOLUNTARY=y
 CONFIG_AEABI=y
 CONFIG_HIGHMEM=y
@@ -159,6 +158,7 @@ CONFIG_MOUSE_PS2=m
 CONFIG_MOUSE_PS2_ELANTECH=y
 CONFIG_INPUT_TOUCHSCREEN=y
 CONFIG_TOUCHSCREEN_EGALAX=y
+CONFIG_TOUCHSCREEN_IMX6UL_TSC=y
 CONFIG_TOUCHSCREEN_MC13783=y
 CONFIG_TOUCHSCREEN_TSC2007=y
 CONFIG_TOUCHSCREEN_STMPE=y
index 95ce1284bd42d329205f61a5894fd731aabc678f..5bcc9cf9d8f190cead1e74e7ab8829f5778e2930 100644 (file)
@@ -4,6 +4,12 @@ CONFIG_HIGH_RES_TIMERS=y
 CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
+CONFIG_CGROUPS=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_SYSCTL_SYSCALL=y
 CONFIG_KALLSYMS_ALL=y
@@ -27,6 +33,7 @@ CONFIG_SMP=y
 CONFIG_PREEMPT=y
 CONFIG_AEABI=y
 CONFIG_HIGHMEM=y
+CONFIG_CMA=y
 CONFIG_VFP=y
 CONFIG_NEON=y
 # CONFIG_SUSPEND is not set
@@ -57,7 +64,6 @@ CONFIG_IP_MROUTE_MULTIPLE_TABLES=y
 CONFIG_IP_PIMSM_V2=y
 CONFIG_INET_AH=y
 CONFIG_INET_IPCOMP=y
-CONFIG_IPV6=y
 CONFIG_INET6_XFRM_MODE_TRANSPORT=m
 CONFIG_INET6_XFRM_MODE_TUNNEL=m
 CONFIG_INET6_XFRM_MODE_BEET=m
@@ -93,7 +99,6 @@ CONFIG_IP_NF_MATCH_ECN=y
 CONFIG_IP_NF_MATCH_TTL=y
 CONFIG_IP_NF_FILTER=y
 CONFIG_IP_NF_TARGET_REJECT=y
-CONFIG_IP_NF_TARGET_ULOG=y
 CONFIG_IP_NF_MANGLE=y
 CONFIG_IP_NF_TARGET_CLUSTERIP=y
 CONFIG_IP_NF_TARGET_ECN=y
@@ -106,7 +111,8 @@ CONFIG_IP6_NF_IPTABLES=m
 CONFIG_IP_SCTP=y
 CONFIG_VLAN_8021Q=y
 CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
-CONFIG_CMA=y
+CONFIG_DEVTMPFS=y
+CONFIG_DEVTMPFS_MOUNT=y
 CONFIG_DMA_CMA=y
 CONFIG_MTD=y
 CONFIG_MTD_CMDLINE_PARTS=y
@@ -117,7 +123,6 @@ CONFIG_MTD_NAND=y
 CONFIG_MTD_NAND_DAVINCI=y
 CONFIG_MTD_SPI_NOR=y
 CONFIG_MTD_UBI=y
-CONFIG_PROC_DEVICETREE=y
 CONFIG_BLK_DEV_LOOP=y
 CONFIG_EEPROM_AT24=y
 CONFIG_SCSI=y
@@ -125,7 +130,7 @@ CONFIG_BLK_DEV_SD=y
 CONFIG_NETDEVICES=y
 CONFIG_TI_KEYSTONE_NETCP=y
 CONFIG_TI_KEYSTONE_NETCP_ETHSS=y
-CONFIG_PHYLIB=y
+CONFIG_MARVELL_PHY=y
 CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250_CONSOLE=y
 CONFIG_SERIAL_OF_PLATFORM=y
@@ -137,12 +142,15 @@ CONFIG_I2C_DAVINCI=y
 CONFIG_SPI=y
 CONFIG_SPI_DAVINCI=y
 CONFIG_SPI_SPIDEV=y
-# CONFIG_HWMON is not set
+CONFIG_GPIOLIB=y
+CONFIG_GPIO_SYSFS=y
+CONFIG_GPIO_DAVINCI=y
+CONFIG_GPIO_SYSCON=y
 CONFIG_POWER_SUPPLY=y
 CONFIG_POWER_RESET=y
 CONFIG_POWER_RESET_KEYSTONE=y
+# CONFIG_HWMON is not set
 CONFIG_WATCHDOG=y
-CONFIG_WATCHDOG_CORE=y
 CONFIG_DAVINCI_WATCHDOG=y
 CONFIG_USB=y
 CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
@@ -150,9 +158,15 @@ CONFIG_USB_MON=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_DWC3=y
-CONFIG_USB_DWC3_DEBUG=y
-CONFIG_USB_DWC3_VERBOSE=y
 CONFIG_KEYSTONE_USB_PHY=y
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
+CONFIG_LEDS_GPIO=y
+CONFIG_LEDS_TRIGGERS=y
+CONFIG_LEDS_TRIGGER_ONESHOT=y
+CONFIG_LEDS_TRIGGER_HEARTBEAT=y
+CONFIG_LEDS_TRIGGER_BACKLIGHT=y
+CONFIG_LEDS_TRIGGER_GPIO=y
 CONFIG_DMADEVICES=y
 CONFIG_TI_EDMA=y
 CONFIG_SOC_TI=y
@@ -160,8 +174,11 @@ CONFIG_KEYSTONE_NAVIGATOR_QMSS=y
 CONFIG_KEYSTONE_NAVIGATOR_DMA=y
 CONFIG_MEMORY=y
 CONFIG_TI_AEMIF=y
+CONFIG_KEYSTONE_IRQ=y
 CONFIG_EXT4_FS=y
 CONFIG_EXT4_FS_POSIX_ACL=y
+CONFIG_FANOTIFY=y
+CONFIG_AUTOFS4_FS=y
 CONFIG_MSDOS_FS=y
 CONFIG_VFAT_FS=y
 CONFIG_NTFS_FS=y
@@ -179,11 +196,10 @@ CONFIG_NFSD_V3_ACL=y
 CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_ISO8859_1=y
 CONFIG_PRINTK_TIME=y
-CONFIG_DEBUG_SHIRQ=y
 CONFIG_DEBUG_INFO=y
+CONFIG_DEBUG_SHIRQ=y
 CONFIG_DEBUG_USER=y
 CONFIG_CRYPTO_USER=y
-CONFIG_CRYPTO_NULL=y
 CONFIG_CRYPTO_AUTHENC=y
 CONFIG_CRYPTO_CBC=y
 CONFIG_CRYPTO_CTR=y
@@ -192,19 +208,3 @@ CONFIG_CRYPTO_DES=y
 CONFIG_CRYPTO_ANSI_CPRNG=y
 CONFIG_CRYPTO_USER_API_HASH=y
 CONFIG_CRYPTO_USER_API_SKCIPHER=y
-CONFIG_GPIOLIB=y
-CONFIG_GPIO_SYSFS=y
-CONFIG_GPIO_DAVINCI=y
-CONFIG_LEDS_CLASS=y
-CONFIG_NEW_LEDS=y
-CONFIG_LEDS_GPIO=y
-CONFIG_LEDS_TRIGGERS=y
-CONFIG_LEDS_TRIGGER_ONESHOT=y
-CONFIG_LEDS_TRIGGER_HEARTBEAT=y
-CONFIG_LEDS_TRIGGER_BACKLIGHT=y
-CONFIG_LEDS_TRIGGER_GPIO=y
-CONFIG_KEYSTONE_IRQ=y
-CONFIG_GPIO_SYSCON=y
-CONFIG_TI_DAVINCI_MDIO=y
-CONFIG_MARVELL_PHY=y
-CONFIG_DEVTMPFS=y
index b7e8cdab51f97ab4689a46fee6f8ad82a827bf7d..03c155f5b811529abc46c71bc2989ddf00f10f6a 100644 (file)
@@ -52,15 +52,22 @@ CONFIG_DEVTMPFS=y
 CONFIG_DEVTMPFS_MOUNT=y
 # CONFIG_FW_LOADER is not set
 CONFIG_MTD=y
+CONFIG_MTD_BLOCK=y
 CONFIG_MTD_CFI=y
 CONFIG_MTD_CFI_INTELEXT=y
 CONFIG_MTD_CFI_AMDSTD=y
 CONFIG_MTD_CFI_STAA=y
 CONFIG_MTD_PHYSMAP=y
 CONFIG_MTD_PHYSMAP_OF=y
+CONFIG_MTD_SPI_NOR=y
+# CONFIG_MTD_SPI_NOR_USE_4K_SECTORS is not set
+CONFIG_SPI_NXP_SPIFI=y
 CONFIG_BLK_DEV_RAM=y
 CONFIG_SRAM=y
 CONFIG_EEPROM_AT24=y
+CONFIG_SCSI=y
+CONFIG_BLK_DEV_SD=y
+# CONFIG_SCSI_LOWLEVEL is not set
 CONFIG_NETDEVICES=y
 # CONFIG_NET_VENDOR_ARC is not set
 # CONFIG_NET_CADENCE is not set
@@ -102,14 +109,17 @@ CONFIG_SERIAL_8250_CONSOLE=y
 CONFIG_SERIAL_OF_PLATFORM=y
 # CONFIG_HW_RANDOM is not set
 CONFIG_I2C=y
+CONFIG_I2C_LPC2K=y
 CONFIG_SPI=y
 CONFIG_SPI_PL022=y
+CONFIG_GPIOLIB=y
 CONFIG_GPIO_SYSFS=y
 CONFIG_GPIO_74XX_MMIO=y
+CONFIG_GPIO_PCF857X=y
+CONFIG_SENSORS_JC42=y
 CONFIG_SENSORS_LM75=y
 CONFIG_WATCHDOG=y
-CONFIG_WATCHDOG_CORE=y
-CONFIG_MFD_SYSCON=y
+CONFIG_LPC18XX_WATCHDOG=y
 CONFIG_REGULATOR=y
 CONFIG_REGULATOR_FIXED_VOLTAGE=y
 CONFIG_FB=y
@@ -117,6 +127,8 @@ CONFIG_FB_ARMCLCD=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_EHCI_ROOT_HUB_TT=y
+CONFIG_USB_EHCI_HCD_PLATFORM=y
+CONFIG_USB_STORAGE=y
 CONFIG_MMC=y
 CONFIG_MMC_DW=y
 CONFIG_NEW_LEDS=y
@@ -127,12 +139,20 @@ CONFIG_LEDS_GPIO=y
 CONFIG_LEDS_TRIGGERS=y
 CONFIG_LEDS_TRIGGER_HEARTBEAT=y
 CONFIG_RTC_CLASS=y
+CONFIG_RTC_DRV_LPC24XX=y
 CONFIG_DMADEVICES=y
 CONFIG_AMBA_PL08X=y
+CONFIG_LPC18XX_DMAMUX=y
+CONFIG_MEMORY=y
+CONFIG_ARM_PL172_MPMC=y
+CONFIG_PWM=y
+CONFIG_PWM_LPC18XX_SCT=y
+CONFIG_PHY_LPC18XX_USB_OTG=y
 CONFIG_EXT2_FS=y
 # CONFIG_FILE_LOCKING is not set
 # CONFIG_DNOTIFY is not set
 # CONFIG_INOTIFY_USER is not set
+CONFIG_JFFS2_FS=y
 # CONFIG_NETWORK_FILESYSTEMS is not set
 CONFIG_PRINTK_TIME=y
 CONFIG_DEBUG_INFO=y
@@ -142,8 +162,6 @@ CONFIG_DEBUG_FS=y
 CONFIG_MAGIC_SYSRQ=y
 # CONFIG_SCHED_DEBUG is not set
 # CONFIG_DEBUG_BUGVERBOSE is not set
-# CONFIG_RCU_CPU_STALL_INFO is not set
-# CONFIG_FTRACE is not set
 CONFIG_DEBUG_LL=y
 CONFIG_EARLY_PRINTK=y
 CONFIG_CRC_ITU_T=y
index 03deb7fb35e8999522baceb89fbae066d978f7e3..69a22fdb52a5a49ecb26760ed4163989e2f735e4 100644 (file)
@@ -21,10 +21,12 @@ CONFIG_MACH_ARMADA_39X=y
 CONFIG_MACH_ARMADA_XP=y
 CONFIG_MACH_DOVE=y
 CONFIG_ARCH_AT91=y
+CONFIG_SOC_SAMA5D2=y
 CONFIG_SOC_SAMA5D3=y
 CONFIG_SOC_SAMA5D4=y
 CONFIG_ARCH_BCM=y
 CONFIG_ARCH_BCM_CYGNUS=y
+CONFIG_ARCH_BCM_NSP=y
 CONFIG_ARCH_BCM_21664=y
 CONFIG_ARCH_BCM_281XX=y
 CONFIG_ARCH_BCM_5301X=y
@@ -85,7 +87,6 @@ CONFIG_ARCH_R8A7791=y
 CONFIG_ARCH_R8A7793=y
 CONFIG_ARCH_R8A7794=y
 CONFIG_ARCH_SH73A0=y
-CONFIG_MACH_MARZEN=y
 CONFIG_ARCH_SUNXI=y
 CONFIG_ARCH_SIRF=y
 CONFIG_ARCH_TEGRA=y
@@ -153,6 +154,7 @@ CONFIG_CAN_DEV=y
 CONFIG_CAN_AT91=m
 CONFIG_CAN_XILINXCAN=y
 CONFIG_CAN_MCP251X=y
+CONFIG_CAN_SUN4I=y
 CONFIG_BT=m
 CONFIG_BT_MRVL=m
 CONFIG_BT_MRVL_SDIO=m
@@ -207,6 +209,7 @@ CONFIG_NET_CALXEDA_XGMAC=y
 CONFIG_IGB=y
 CONFIG_MV643XX_ETH=y
 CONFIG_MVNETA=y
+CONFIG_PXA168_ETH=m
 CONFIG_KS8851=y
 CONFIG_R8169=y
 CONFIG_SH_ETH=y
@@ -220,7 +223,9 @@ CONFIG_SMSC_PHY=y
 CONFIG_BROADCOM_PHY=y
 CONFIG_ICPLUS_PHY=y
 CONFIG_MICREL_PHY=y
+CONFIG_FIXED_PHY=y
 CONFIG_USB_PEGASUS=y
+CONFIG_USB_RTL8152=m
 CONFIG_USB_USBNET=y
 CONFIG_USB_NET_SMSC75XX=y
 CONFIG_USB_NET_SMSC95XX=y
@@ -245,6 +250,7 @@ CONFIG_TOUCHSCREEN_ATMEL_MXT=y
 CONFIG_TOUCHSCREEN_ST1232=m
 CONFIG_TOUCHSCREEN_STMPE=y
 CONFIG_TOUCHSCREEN_SUN4I=y
+CONFIG_TOUCHSCREEN_WM97XX=m
 CONFIG_INPUT_MISC=y
 CONFIG_INPUT_MPU3050=y
 CONFIG_INPUT_AXP20X_PEK=y
@@ -302,12 +308,15 @@ CONFIG_I2C_GPIO=m
 CONFIG_I2C_EXYNOS5=y
 CONFIG_I2C_MV64XXX=y
 CONFIG_I2C_RIIC=y
+CONFIG_I2C_RK3X=y
 CONFIG_I2C_S3C2410=y
 CONFIG_I2C_SH_MOBILE=y
 CONFIG_I2C_SIRF=y
 CONFIG_I2C_ST=y
 CONFIG_I2C_SUN6I_P2WI=y
 CONFIG_I2C_TEGRA=y
+CONFIG_I2C_UNIPHIER=y
+CONFIG_I2C_UNIPHIER_F=y
 CONFIG_I2C_XILINX=y
 CONFIG_I2C_RCAR=y
 CONFIG_I2C_CROS_EC_TUNNEL=m
@@ -318,6 +327,7 @@ CONFIG_SPI_DAVINCI=y
 CONFIG_SPI_OMAP24XX=y
 CONFIG_SPI_ORION=y
 CONFIG_SPI_PL022=y
+CONFIG_SPI_ROCKCHIP=m
 CONFIG_SPI_RSPI=y
 CONFIG_SPI_S3C64XX=m
 CONFIG_SPI_SH_MSIOF=m
@@ -332,6 +342,7 @@ CONFIG_SPI_XILINX=y
 CONFIG_SPI_SPIDEV=y
 CONFIG_PINCTRL_AS3722=y
 CONFIG_PINCTRL_PALMAS=y
+CONFIG_PINCTRL_APQ8064=y
 CONFIG_PINCTRL_APQ8084=y
 CONFIG_GPIO_SYSFS=y
 CONFIG_GPIO_GENERIC_PLATFORM=y
@@ -365,6 +376,7 @@ CONFIG_SENSORS_LM95245=y
 CONFIG_SENSORS_NTC_THERMISTOR=m
 CONFIG_THERMAL=y
 CONFIG_CPU_THERMAL=y
+CONFIG_ROCKCHIP_THERMAL=y
 CONFIG_RCAR_THERMAL=y
 CONFIG_ARMADA_THERMAL=y
 CONFIG_DAVINCI_WATCHDOG=m
@@ -382,6 +394,7 @@ CONFIG_MESON_WATCHDOG=y
 CONFIG_DIGICOLOR_WATCHDOG=y
 CONFIG_MFD_AS3711=y
 CONFIG_MFD_AS3722=y
+CONFIG_MFD_ATMEL_FLEXCOM=y
 CONFIG_MFD_BCM590XX=y
 CONFIG_MFD_AXP20X=y
 CONFIG_MFD_CROS_EC=y
@@ -391,6 +404,9 @@ CONFIG_MFD_MAX14577=y
 CONFIG_MFD_MAX77686=y
 CONFIG_MFD_MAX77693=y
 CONFIG_MFD_MAX8907=y
+CONFIG_MFD_RK808=y
+CONFIG_MFD_PM8921_CORE=y
+CONFIG_MFD_QCOM_RPM=y
 CONFIG_MFD_SEC_CORE=y
 CONFIG_MFD_STMPE=y
 CONFIG_MFD_PALMAS=y
@@ -398,11 +414,14 @@ CONFIG_MFD_TPS65090=y
 CONFIG_MFD_TPS6586X=y
 CONFIG_MFD_TPS65910=y
 CONFIG_REGULATOR_AB8500=y
+CONFIG_REGULATOR_ACT8865=y
 CONFIG_REGULATOR_AS3711=y
 CONFIG_REGULATOR_AS3722=y
 CONFIG_REGULATOR_AXP20X=y
 CONFIG_REGULATOR_BCM590XX=y
 CONFIG_REGULATOR_DA9210=y
+CONFIG_REGULATOR_FAN53555=y
+CONFIG_REGULATOR_RK808=y
 CONFIG_REGULATOR_GPIO=y
 CONFIG_MFD_SYSCON=y
 CONFIG_POWER_RESET_SYSCON=y
@@ -415,6 +434,8 @@ CONFIG_REGULATOR_MAX77802=m
 CONFIG_REGULATOR_PALMAS=y
 CONFIG_REGULATOR_PBIAS=y
 CONFIG_REGULATOR_PWM=m
+CONFIG_REGULATOR_QCOM_RPM=y
+CONFIG_REGULATOR_QCOM_SMD_RPM=y
 CONFIG_REGULATOR_S2MPS11=y
 CONFIG_REGULATOR_S5M8767=y
 CONFIG_REGULATOR_TPS51632=y
@@ -441,6 +462,7 @@ CONFIG_VIDEO_RENESAS_VSP1=m
 CONFIG_VIDEO_ADV7180=m
 CONFIG_VIDEO_ML86V7667=m
 CONFIG_DRM=y
+CONFIG_DRM_I2C_ADV7511=m
 # CONFIG_DRM_I2C_CH7006 is not set
 # CONFIG_DRM_I2C_SIL164 is not set
 CONFIG_DRM_NXP_PTN3460=m
@@ -450,7 +472,11 @@ CONFIG_DRM_EXYNOS=m
 CONFIG_DRM_EXYNOS_DSI=y
 CONFIG_DRM_EXYNOS_FIMD=y
 CONFIG_DRM_EXYNOS_HDMI=y
+CONFIG_DRM_ROCKCHIP=m
+CONFIG_ROCKCHIP_DW_HDMI=m
 CONFIG_DRM_RCAR_DU=m
+CONFIG_DRM_RCAR_HDMI=y
+CONFIG_DRM_RCAR_LVDS=y
 CONFIG_DRM_TEGRA=y
 CONFIG_DRM_PANEL_SAMSUNG_S6E8AA0=m
 CONFIG_DRM_PANEL_SIMPLE=y
@@ -485,6 +511,7 @@ CONFIG_SND_SOC_TEGRA=m
 CONFIG_SND_SOC_TEGRA_RT5640=m
 CONFIG_SND_SOC_TEGRA_WM8753=m
 CONFIG_SND_SOC_TEGRA_WM8903=m
+CONFIG_SND_SOC_TEGRA_WM9712=m
 CONFIG_SND_SOC_TEGRA_TRIMSLICE=m
 CONFIG_SND_SOC_TEGRA_ALC5632=m
 CONFIG_SND_SOC_TEGRA_MAX98090=m
@@ -494,6 +521,7 @@ CONFIG_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_MVEBU=y
 CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_EHCI_MSM=m
 CONFIG_USB_EHCI_EXYNOS=y
 CONFIG_USB_EHCI_TEGRA=y
 CONFIG_USB_EHCI_HCD_STI=y
@@ -507,6 +535,7 @@ CONFIG_USB_R8A66597_HCD=m
 CONFIG_USB_RENESAS_USBHS=m
 CONFIG_USB_STORAGE=y
 CONFIG_USB_DWC3=y
+CONFIG_USB_DWC2=m
 CONFIG_USB_CHIPIDEA=y
 CONFIG_USB_CHIPIDEA_HOST=y
 CONFIG_AB8500_USB=y
@@ -514,16 +543,19 @@ CONFIG_KEYSTONE_USB_PHY=y
 CONFIG_OMAP_USB3=y
 CONFIG_USB_GPIO_VBUS=y
 CONFIG_USB_ISP1301=y
+CONFIG_USB_MSM_OTG=m
 CONFIG_USB_MXS_PHY=y
 CONFIG_USB_RCAR_PHY=m
 CONFIG_USB_GADGET=y
 CONFIG_USB_RENESAS_USBHS_UDC=m
+CONFIG_USB_ETH=m
 CONFIG_MMC=y
 CONFIG_MMC_BLOCK_MINORS=16
 CONFIG_MMC_ARMMMCI=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_PLTFM=y
 CONFIG_MMC_SDHCI_OF_ARASAN=y
+CONFIG_MMC_SDHCI_OF_AT91=y
 CONFIG_MMC_SDHCI_ESDHC_IMX=y
 CONFIG_MMC_SDHCI_DOVE=y
 CONFIG_MMC_SDHCI_TEGRA=y
@@ -566,8 +598,10 @@ CONFIG_EDAC_HIGHBANK_L2=y
 CONFIG_RTC_CLASS=y
 CONFIG_RTC_DRV_AS3722=y
 CONFIG_RTC_DRV_DS1307=y
+CONFIG_RTC_DRV_HYM8563=m
 CONFIG_RTC_DRV_MAX8907=y
 CONFIG_RTC_DRV_MAX77686=y
+CONFIG_RTC_DRV_RK808=m
 CONFIG_RTC_DRV_MAX77802=m
 CONFIG_RTC_DRV_RS5C372=m
 CONFIG_RTC_DRV_PALMAS=y
@@ -605,6 +639,7 @@ CONFIG_IMX_SDMA=y
 CONFIG_IMX_DMA=y
 CONFIG_MXS_DMA=y
 CONFIG_DMA_OMAP=y
+CONFIG_QCOM_BAM_DMA=y
 CONFIG_XILINX_VDMA=y
 CONFIG_DMA_SUN6I=y
 CONFIG_STAGING=y
@@ -617,6 +652,9 @@ CONFIG_NVEC_POWER=y
 CONFIG_NVEC_PAZ00=y
 CONFIG_QCOM_GSBI=y
 CONFIG_QCOM_PM=y
+CONFIG_QCOM_SMD=y
+CONFIG_QCOM_SMD_RPM=y
+CONFIG_QCOM_SMEM=y
 CONFIG_COMMON_CLK_QCOM=y
 CONFIG_CHROME_PLATFORMS=y
 CONFIG_CROS_EC_CHARDEV=m
@@ -627,6 +665,8 @@ CONFIG_APQ_MMCC_8084=y
 CONFIG_MSM_GCC_8660=y
 CONFIG_MSM_MMCC_8960=y
 CONFIG_MSM_MMCC_8974=y
+CONFIG_HWSPINLOCK_QCOM=y
+CONFIG_ROCKCHIP_IOMMU=y
 CONFIG_TEGRA_IOMMU_GART=y
 CONFIG_TEGRA_IOMMU_SMMU=y
 CONFIG_PM_DEVFREQ=y
@@ -636,6 +676,7 @@ CONFIG_EXTCON=y
 CONFIG_TI_AEMIF=y
 CONFIG_IIO=y
 CONFIG_AT91_ADC=m
+CONFIG_BERLIN2_ADC=m
 CONFIG_EXYNOS_ADC=m
 CONFIG_XILINX_XADC=y
 CONFIG_AK8975=y
@@ -643,6 +684,7 @@ CONFIG_PWM=y
 CONFIG_PWM_ATMEL=m
 CONFIG_PWM_ATMEL_TCB=m
 CONFIG_PWM_RENESAS_TPU=y
+CONFIG_PWM_ROCKCHIP=m
 CONFIG_PWM_SAMSUNG=m
 CONFIG_PWM_SUN4I=y
 CONFIG_PWM_TEGRA=y
@@ -651,6 +693,10 @@ CONFIG_PHY_HIX5HD2_SATA=y
 CONFIG_PWM_STI=m
 CONFIG_OMAP_USB2=y
 CONFIG_TI_PIPE3=y
+CONFIG_PHY_BERLIN_USB=y
+CONFIG_PHY_BERLIN_SATA=y
+CONFIG_PHY_ROCKCHIP_USB=m
+CONFIG_PHY_QCOM_APQ8064_SATA=m
 CONFIG_PHY_MIPHY28LP=y
 CONFIG_PHY_MIPHY365X=y
 CONFIG_PHY_RCAR_GEN2=m
index 13fcd020e37516cef27c74099c527818c464c4db..c6729bf0a8ddb5e272ee97690cd58c68b013b5fa 100644 (file)
@@ -61,6 +61,7 @@ CONFIG_MTD_SPI_NOR=y
 CONFIG_EEPROM_AT24=y
 CONFIG_BLK_DEV_SD=y
 CONFIG_ATA=y
+CONFIG_SATA_AHCI=y
 CONFIG_AHCI_MVEBU=y
 CONFIG_SATA_MV=y
 CONFIG_NETDEVICES=y
@@ -85,6 +86,9 @@ CONFIG_SPI=y
 CONFIG_SPI_ORION=y
 CONFIG_GPIO_SYSFS=y
 CONFIG_GPIO_PCA953X=y
+CONFIG_POWER_SUPPLY=y
+CONFIG_POWER_RESET=y
+CONFIG_POWER_RESET_GPIO=y
 CONFIG_SENSORS_GPIO_FAN=y
 CONFIG_THERMAL=y
 CONFIG_ARMADA_THERMAL=y
@@ -111,12 +115,15 @@ CONFIG_MMC_SDHCI_PLTFM=y
 CONFIG_MMC_SDHCI_DOVE=y
 CONFIG_MMC_SDHCI_PXAV3=y
 CONFIG_MMC_MVSDIO=y
-CONFIG_LEDS_GPIO=y
+CONFIG_NEW_LEDS=y
 CONFIG_LEDS_CLASS=y
+CONFIG_LEDS_GPIO=y
 CONFIG_LEDS_TRIGGERS=y
 CONFIG_LEDS_TRIGGER_TIMER=y
 CONFIG_LEDS_TRIGGER_HEARTBEAT=y
 CONFIG_RTC_CLASS=y
+CONFIG_RTC_DRV_DS1307=y
+CONFIG_RTC_DRV_PCF8563=y
 CONFIG_RTC_DRV_S35390A=y
 CONFIG_RTC_DRV_MV=y
 CONFIG_RTC_DRV_ARMADA38X=y
index ff7985ba226ee1dfc3f6cdf6e11e3f570ebcac1d..ee54a706e8a356ba78829b2d8c0fd89d99209d93 100644 (file)
@@ -109,6 +109,7 @@ CONFIG_MFD_QCOM_RPM=y
 CONFIG_REGULATOR=y
 CONFIG_REGULATOR_FIXED_VOLTAGE=y
 CONFIG_REGULATOR_QCOM_RPM=y
+CONFIG_REGULATOR_QCOM_SMD_RPM=y
 CONFIG_MEDIA_SUPPORT=y
 CONFIG_FB=y
 CONFIG_SOUND=y
@@ -145,16 +146,17 @@ CONFIG_MSM_GCC_8660=y
 CONFIG_MSM_LCC_8960=y
 CONFIG_MSM_MMCC_8960=y
 CONFIG_MSM_MMCC_8974=y
-CONFIG_MSM_IOMMU=y
+CONFIG_HWSPINLOCK_QCOM=y
 CONFIG_QCOM_GSBI=y
 CONFIG_QCOM_PM=y
+CONFIG_QCOM_SMD=y
+CONFIG_QCOM_SMD_RPM=y
+CONFIG_QCOM_SMEM=y
 CONFIG_PHY_QCOM_APQ8064_SATA=y
 CONFIG_PHY_QCOM_IPQ806X_SATA=y
 CONFIG_EXT2_FS=y
 CONFIG_EXT2_FS_XATTR=y
 CONFIG_EXT3_FS=y
-# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
-CONFIG_EXT4_FS=y
 CONFIG_FUSE_FS=y
 CONFIG_VFAT_FS=y
 CONFIG_TMPFS=y
index 31eb951880aee1f6d1fd879071134b2bd83490a0..a0c57ac88b2756c0a4cdf0b9758e4df65d975833 100644 (file)
@@ -10,12 +10,11 @@ CONFIG_MODULES=y
 CONFIG_MODULE_FORCE_LOAD=y
 CONFIG_MODULE_UNLOAD=y
 CONFIG_MODULE_FORCE_UNLOAD=y
-CONFIG_LBDAF=y
 # CONFIG_BLK_DEV_BSG is not set
 # CONFIG_IOSCHED_DEADLINE is not set
 # CONFIG_IOSCHED_CFQ is not set
 CONFIG_ARCH_AT91=y
-CONFIG_SOC_SAM_V7=y
+CONFIG_SOC_SAMA5D2=y
 CONFIG_SOC_SAMA5D3=y
 CONFIG_SOC_SAMA5D4=y
 CONFIG_AEABI=y
@@ -25,12 +24,10 @@ CONFIG_ZBOOT_ROM_BSS=0x0
 CONFIG_ARM_APPENDED_DTB=y
 CONFIG_CMDLINE="console=ttyS0,115200 initrd=0x21100000,25165824 root=/dev/ram0 rw"
 CONFIG_KEXEC=y
-CONFIG_AUTO_ZRELADDR=y
 CONFIG_VFP=y
 CONFIG_NEON=y
 CONFIG_KERNEL_MODE_NEON=y
 # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
-CONFIG_PM=y
 CONFIG_PM_DEBUG=y
 CONFIG_PM_ADVANCED_DEBUG=y
 CONFIG_NET=y
@@ -47,7 +44,6 @@ CONFIG_IP_PNP_RARP=y
 # CONFIG_INET_XFRM_MODE_BEET is not set
 # CONFIG_INET_LRO is not set
 # CONFIG_INET_DIAG is not set
-CONFIG_IPV6=y
 # CONFIG_INET6_XFRM_MODE_TRANSPORT is not set
 # CONFIG_INET6_XFRM_MODE_TUNNEL is not set
 # CONFIG_INET6_XFRM_MODE_BEET is not set
@@ -123,7 +119,6 @@ CONFIG_LEGACY_PTY_COUNT=4
 CONFIG_SERIAL_ATMEL=y
 CONFIG_SERIAL_ATMEL_CONSOLE=y
 CONFIG_HW_RANDOM=y
-CONFIG_I2C=y
 CONFIG_I2C_CHARDEV=y
 CONFIG_I2C_AT91=y
 CONFIG_I2C_GPIO=y
@@ -135,6 +130,7 @@ CONFIG_POWER_SUPPLY=y
 CONFIG_POWER_RESET=y
 # CONFIG_HWMON is not set
 CONFIG_SSB=m
+CONFIG_MFD_ATMEL_FLEXCOM=y
 CONFIG_REGULATOR=y
 CONFIG_REGULATOR_FIXED_VOLTAGE=y
 CONFIG_REGULATOR_ACT8865=y
@@ -142,8 +138,8 @@ CONFIG_MEDIA_SUPPORT=y
 CONFIG_MEDIA_CAMERA_SUPPORT=y
 CONFIG_V4L_PLATFORM_DRIVERS=y
 CONFIG_SOC_CAMERA=y
-CONFIG_SOC_CAMERA_OV2640=y
 CONFIG_VIDEO_ATMEL_ISI=y
+CONFIG_SOC_CAMERA_OV2640=y
 CONFIG_FB=y
 CONFIG_BACKLIGHT_LCD_SUPPORT=y
 # CONFIG_LCD_CLASS_DEVICE is not set
@@ -171,6 +167,9 @@ CONFIG_USB_ATMEL_USBA=y
 CONFIG_USB_G_SERIAL=y
 CONFIG_MMC=y
 # CONFIG_MMC_BLOCK_BOUNCE is not set
+CONFIG_MMC_SDHCI=y
+CONFIG_MMC_SDHCI_PLTFM=y
+CONFIG_MMC_SDHCI_OF_AT91=y
 CONFIG_MMC_ATMELMCI=y
 CONFIG_NEW_LEDS=y
 CONFIG_LEDS_CLASS=y
@@ -207,11 +206,8 @@ CONFIG_DEBUG_MEMORY_INIT=y
 # CONFIG_SCHED_DEBUG is not set
 # CONFIG_FTRACE is not set
 CONFIG_DEBUG_USER=y
-# CONFIG_CRYPTO_ANSI_CPRNG is not set
 CONFIG_CRYPTO_USER_API_HASH=m
 CONFIG_CRYPTO_USER_API_SKCIPHER=m
 CONFIG_CRYPTO_DEV_ATMEL_AES=y
 CONFIG_CRYPTO_DEV_ATMEL_TDES=y
 CONFIG_CRYPTO_DEV_ATMEL_SHA=y
-CONFIG_CRC_CCITT=m
-CONFIG_CRC_ITU_T=m
index 89bf31ccfbfa1b269ce4b3e9c66c7053b7edcfb0..3aef019c0de7897de8c83d6a062218eaeb69deb0 100644 (file)
@@ -21,7 +21,6 @@ CONFIG_ARCH_R8A7791=y
 CONFIG_ARCH_R8A7793=y
 CONFIG_ARCH_R8A7794=y
 CONFIG_ARCH_SH73A0=y
-CONFIG_MACH_MARZEN=y
 CONFIG_CPU_BPREDICT_DISABLE=y
 CONFIG_PL310_ERRATA_588369=y
 CONFIG_ARM_ERRATA_754322=y
@@ -141,7 +140,10 @@ CONFIG_VIDEO_RENESAS_VSP1=y
 CONFIG_VIDEO_ADV7180=y
 CONFIG_VIDEO_ML86V7667=y
 CONFIG_DRM=y
+CONFIG_DRM_I2C_ADV7511=y
 CONFIG_DRM_RCAR_DU=y
+CONFIG_DRM_RCAR_HDMI=y
+CONFIG_DRM_RCAR_LVDS=y
 CONFIG_FB_SH_MOBILE_LCDC=y
 CONFIG_FB_SH_MOBILE_MERAM=y
 # CONFIG_LCD_CLASS_DEVICE is not set
index a2956c3112f14abd66c5ed586d621d8e7dd548b8..8128b93ed72cf8cc11c765a74c4615e9944f1b28 100644 (file)
@@ -86,6 +86,8 @@ CONFIG_USB_DWC2=y
 CONFIG_USB_DWC2_HOST=y
 CONFIG_MMC=y
 CONFIG_MMC_DW=y
+CONFIG_FPGA=y
+CONFIG_FPGA_MGR_SOCFPGA=y
 CONFIG_EXT2_FS=y
 CONFIG_EXT2_FS_XATTR=y
 CONFIG_EXT2_FS_POSIX_ACL=y
index 51eea220baae4be2d68ae036f8d39739ec6a9c5a..3c36e16fcacf7d44f7e8ce76f32a2cbc20f2b1d4 100644 (file)
@@ -5,6 +5,7 @@ CONFIG_CGROUPS=y
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_PERF_EVENTS=y
 CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
 CONFIG_ARCH_SUNXI=y
 CONFIG_SMP=y
 CONFIG_NR_CPUS=8
@@ -31,6 +32,8 @@ CONFIG_IP_PNP_BOOTP=y
 # CONFIG_INET_LRO is not set
 # CONFIG_INET_DIAG is not set
 # CONFIG_IPV6 is not set
+CONFIG_CAN=y
+CONFIG_CAN_SUN4I=y
 # CONFIG_WIRELESS is not set
 CONFIG_DEVTMPFS=y
 CONFIG_DEVTMPFS_MOUNT=y
@@ -63,6 +66,7 @@ CONFIG_STMMAC_ETH=y
 CONFIG_INPUT_MISC=y
 CONFIG_INPUT_AXP20X_PEK=y
 CONFIG_INPUT_TOUCHSCREEN=y
+CONFIG_KEYBOARD_SUN4I_LRADC=y
 CONFIG_TOUCHSCREEN_SUN4I=y
 CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250_CONSOLE=y
index 9808581176cc81790913c024e625b648a3650c68..3a36244e3cf68c2fb238f41f35130799b78211c4 100644 (file)
@@ -1,5 +1,6 @@
 CONFIG_SYSVIPC=y
 CONFIG_FHANDLE=y
+CONFIG_IRQ_DOMAIN_DEBUG=y
 CONFIG_NO_HZ=y
 CONFIG_HIGH_RES_TIMERS=y
 CONFIG_IKCONFIG=y
@@ -60,7 +61,6 @@ CONFIG_INET_ESP=y
 # CONFIG_INET_XFRM_MODE_BEET is not set
 # CONFIG_INET_LRO is not set
 # CONFIG_INET_DIAG is not set
-CONFIG_IPV6=y
 CONFIG_IPV6_ROUTER_PREF=y
 CONFIG_IPV6_OPTIMISTIC_DAD=y
 CONFIG_INET6_AH=y
@@ -121,6 +121,9 @@ CONFIG_KEYBOARD_CROS_EC=y
 CONFIG_MOUSE_PS2_ELANTECH=y
 CONFIG_INPUT_TOUCHSCREEN=y
 CONFIG_TOUCHSCREEN_ATMEL_MXT=y
+CONFIG_TOUCHSCREEN_WM97XX=y
+# CONFIG_TOUCHSCREEN_WM9705 is not set
+# CONFIG_TOUCHSCREEN_WM9713 is not set
 CONFIG_TOUCHSCREEN_STMPE=y
 CONFIG_INPUT_MISC=y
 CONFIG_INPUT_MPU3050=y
@@ -142,6 +145,7 @@ CONFIG_SPI_TEGRA20_SFLASH=y
 CONFIG_SPI_TEGRA20_SLINK=y
 CONFIG_PINCTRL_AS3722=y
 CONFIG_PINCTRL_PALMAS=y
+CONFIG_GPIO_SYSFS=y
 CONFIG_GPIO_PCA953X=y
 CONFIG_GPIO_PCA953X_IRQ=y
 CONFIG_GPIO_PALMAS=y
@@ -208,6 +212,7 @@ CONFIG_SND_SOC_TEGRA=y
 CONFIG_SND_SOC_TEGRA_RT5640=y
 CONFIG_SND_SOC_TEGRA_WM8753=y
 CONFIG_SND_SOC_TEGRA_WM8903=y
+CONFIG_SND_SOC_TEGRA_WM9712=y
 CONFIG_SND_SOC_TEGRA_TRIMSLICE=y
 CONFIG_SND_SOC_TEGRA_ALC5632=y
 CONFIG_SND_SOC_TEGRA_MAX98090=y
@@ -266,10 +271,8 @@ CONFIG_EXT2_FS_XATTR=y
 CONFIG_EXT2_FS_POSIX_ACL=y
 CONFIG_EXT2_FS_SECURITY=y
 CONFIG_EXT3_FS=y
-# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
 CONFIG_EXT3_FS_POSIX_ACL=y
 CONFIG_EXT3_FS_SECURITY=y
-CONFIG_EXT4_FS=y
 # CONFIG_DNOTIFY is not set
 CONFIG_VFAT_FS=y
 CONFIG_TMPFS=y
@@ -278,6 +281,7 @@ CONFIG_SQUASHFS=y
 CONFIG_SQUASHFS_LZO=y
 CONFIG_SQUASHFS_XZ=y
 CONFIG_NFS_FS=y
+CONFIG_NFS_V4=y
 CONFIG_ROOT_NFS=y
 CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_ISO8859_1=y
diff --git a/arch/arm/include/asm/hardware/cache-uniphier.h b/arch/arm/include/asm/hardware/cache-uniphier.h
new file mode 100644 (file)
index 0000000..102e3fb
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2015 Masahiro Yamada <yamada.masahiro@socionext.com>
+ *
+ * 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; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef __CACHE_UNIPHIER_H
+#define __CACHE_UNIPHIER_H
+
+#include <linux/types.h>
+
+#ifdef CONFIG_CACHE_UNIPHIER
+int uniphier_cache_init(void);
+int uniphier_cache_l2_is_enabled(void);
+void uniphier_cache_l2_touch_range(unsigned long start, unsigned long end);
+void uniphier_cache_l2_set_locked_ways(u32 way_mask);
+#else
+static inline int uniphier_cache_init(void)
+{
+       return -ENODEV;
+}
+
+static inline int uniphier_cache_l2_is_enabled(void)
+{
+       return 0;
+}
+
+static inline void uniphier_cache_l2_touch_range(unsigned long start,
+                                                unsigned long end)
+{
+}
+
+static inline void uniphier_cache_l2_set_locked_ways(u32 way_mask)
+{
+}
+#endif
+
+#endif /* __CACHE_UNIPHIER_H */
index 2556a8801c8cb973750391715878c79519197376..43243be94cfcb556d1a3a0e85f6a63089d8c89c2 100644 (file)
@@ -9,32 +9,22 @@
  *
 */
 
-#if defined(CONFIG_AT91_DEBUG_LL_DBGU0)
-#define AT91_DBGU 0xfffff200 /* AT91_BASE_DBGU0 */
-#elif defined(CONFIG_AT91_DEBUG_LL_DBGU1)
-#define AT91_DBGU 0xffffee00 /* AT91_BASE_DBGU1 */
-#elif defined(CONFIG_AT91_DEBUG_LL_DBGU2)
-/* On sama5d4, use USART3 as low level serial console */
-#define AT91_DBGU 0xfc00c000 /* SAMA5D4_BASE_USART3 */
-#else
-/* On sama5d2, use UART1 as low level serial console */
-#define AT91_DBGU 0xf8020000
-#endif
-
 #ifdef CONFIG_MMU
 #define AT91_IO_P2V(x) ((x) - 0x01000000)
 #else
 #define AT91_IO_P2V(x) (x)
 #endif
 
+#define CONFIG_DEBUG_UART_VIRT AT91_IO_P2V(CONFIG_DEBUG_UART_PHYS)
+
 #define AT91_DBGU_SR           (0x14)  /* Status Register */
 #define AT91_DBGU_THR          (0x1c)  /* Transmitter Holding Register */
 #define AT91_DBGU_TXRDY                (1 << 1)        /* Transmitter Ready */
 #define AT91_DBGU_TXEMPTY      (1 << 9)        /* Transmitter Empty */
 
        .macro  addruart, rp, rv, tmp
-       ldr     \rp, =AT91_DBGU                         @ System peripherals (phys address)
-       ldr     \rv, =AT91_IO_P2V(AT91_DBGU)            @ System peripherals (virt address)
+       ldr     \rp, =CONFIG_DEBUG_UART_PHYS            @ System peripherals (phys address)
+       ldr     \rv, =CONFIG_DEBUG_UART_VIRT            @ System peripherals (virt address)
        .endm
 
        .macro  senduart,rd,rx
index 2766183e69df255371f0586ff96b7112ec3dc643..1d45320ee125d572b108d8e40bb6e0150fea8b9a 100644 (file)
@@ -39,6 +39,7 @@
 #include <linux/export.h>
 
 #include <asm/hardware/cache-l2x0.h>
+#include <asm/hardware/cache-uniphier.h>
 #include <asm/outercache.h>
 #include <asm/exception.h>
 #include <asm/mach/arch.h>
@@ -97,6 +98,8 @@ void __init init_IRQ(void)
                if (ret)
                        pr_err("L2C: failed to init: %d\n", ret);
        }
+
+       uniphier_cache_init();
 }
 
 #ifdef CONFIG_MULTI_IRQ_HANDLER
index 61c04b02faebb009bf2d481cd5b651b79242f79c..9d479b2ea40dc016bda2a0d74e194d36859ceb37 100644 (file)
@@ -71,7 +71,7 @@ int psci_cpu_disable(unsigned int cpu)
        return 0;
 }
 
-void __ref psci_cpu_die(unsigned int cpu)
+void psci_cpu_die(unsigned int cpu)
 {
        u32 state = PSCI_POWER_STATE_TYPE_POWER_DOWN <<
                    PSCI_0_2_POWER_STATE_TYPE_SHIFT;
@@ -83,7 +83,7 @@ void __ref psci_cpu_die(unsigned int cpu)
        panic("psci: cpu %d failed to shutdown\n", cpu);
 }
 
-int __ref psci_cpu_kill(unsigned int cpu)
+int psci_cpu_kill(unsigned int cpu)
 {
        int err, i;
 
index 0d95f488b47a7fa40f7f837083e5b594c329dd65..a25defda3d226c98469c6150a001266aeec4c2fa 100644 (file)
@@ -80,6 +80,8 @@ tmp2  .req    r5
  *     @r2: base address of second SDRAM Controller or 0 if not present
  *     @r3: pm information
  */
+/* at91_pm_suspend_in_sram must be 8-byte aligned per the requirements of fncpy() */
+       .align 3
 ENTRY(at91_pm_suspend_in_sram)
        /* Save registers on stack */
        stmfd   sp!, {r4 - r12, lr}
index 84bd26535ae9d247a5f4c89eb6c95cfbaa643f6b..8c53c55be1feb318e84e2c2aba475b42646527c2 100644 (file)
@@ -35,6 +35,20 @@ config ARCH_BCM_CYGNUS
          BCM11300, BCM11320, BCM11350, BCM11360,
          BCM58300, BCM58302, BCM58303, BCM58305.
 
+config ARCH_BCM_NSP
+       bool "Broadcom Northstar Plus SoC Support" if ARCH_MULTI_V7
+       select ARCH_BCM_IPROC
+       select ARM_ERRATA_754322
+       select ARM_ERRATA_775420
+       help
+         Support for Broadcom Northstar Plus SoC.
+         Broadcom Northstar Plus family of SoCs are used for switching control
+         and management applications as well as residential router/gateway
+         applications. The SoC features dual core Cortex A9 ARM CPUs,
+         integrating several peripheral interfaces including multiple Gigabit
+         Ethernet PHYs, DDR3 memory, PCIE Gen-2, USB 2.0 and USB 3.0, serial and
+         NAND flash, SATA and several other IO controllers.
+
 config ARCH_BCM_5301X
        bool "Broadcom BCM470X / BCM5301X ARM SoC" if ARCH_MULTI_V7
        select ARCH_BCM_IPROC
@@ -147,6 +161,7 @@ config ARCH_BRCMSTB
        select BCM7120_L2_IRQ
        select ARCH_DMA_ADDR_T_64BIT if ARM_LPAE
        select ARCH_WANT_OPTIONAL_GPIOLIB
+       select SOC_BRCMSTB
        help
          Say Y if you intend to run the kernel on a Broadcom ARM-based STB
          chipset.
index 1780a3ff42f938f3998e2ad0803ab161c32367a0..892261fec0ae7febff91c35a3b8c1aab12b3196a 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2012-2014 Broadcom Corporation
+# Copyright (C) 2012-2015 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
@@ -13,6 +13,9 @@
 # Cygnus
 obj-$(CONFIG_ARCH_BCM_CYGNUS) +=  bcm_cygnus.o
 
+# Northstar Plus
+obj-$(CONFIG_ARCH_BCM_NSP) += bcm_nsp.o
+
 # BCM281XX
 obj-$(CONFIG_ARCH_BCM_281XX)   += board_bcm281xx.o
 
diff --git a/arch/arm/mach-bcm/bcm_nsp.c b/arch/arm/mach-bcm/bcm_nsp.c
new file mode 100644 (file)
index 0000000..a1101a3
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+ * Copyright (C) 2015 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 <asm/mach/arch.h>
+
+static const char *const bcm_nsp_dt_compat[] __initconst = {
+       "brcm,nsp",
+       NULL,
+};
+
+DT_MACHINE_START(NSP_DT, "Broadcom Northstar Plus SoC")
+       .l2c_aux_val    = 0,
+       .l2c_aux_mask   = ~0,
+       .dt_compat = bcm_nsp_dt_compat,
+MACHINE_END
index 3a60f7ee3f0cc1583788f9cd3da81a5723354647..99a67cfb7c0d5c129dfad0ec721ba24e402171fd 100644 (file)
  */
 
 #include <linux/init.h>
+#include <linux/irqchip.h>
 #include <linux/of_platform.h>
+#include <linux/soc/brcmstb/brcmstb.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 
+static void __init brcmstb_init_irq(void)
+{
+       irqchip_init();
+       brcmstb_biuctrl_init();
+}
+
 static const char *const brcmstb_match[] __initconst = {
        "brcm,bcm7445",
        "brcm,brcmstb",
@@ -25,4 +33,5 @@ static const char *const brcmstb_match[] __initconst = {
 
 DT_MACHINE_START(BRCMSTB, "Broadcom STB (Flattened Device Tree)")
        .dt_compat      = brcmstb_match,
+       .init_irq       = brcmstb_init_irq,
 MACHINE_END
index ac181c6797ee5784c2f64d80ea1b1f4b2d0fc3b1..25d73870cccad498e98eab1c4a43666a36fbaa9c 100644 (file)
 #include <asm/hardware/cache-l2x0.h>
 #include <asm/mach/arch.h>
 
+static void __init berlin_init_late(void)
+{
+       platform_device_register_simple("cpufreq-dt", -1, NULL, 0);
+}
+
 static const char * const berlin_dt_compat[] = {
        "marvell,berlin",
        NULL,
@@ -25,6 +30,7 @@ static const char * const berlin_dt_compat[] = {
 
 DT_MACHINE_START(BERLIN_DT, "Marvell Berlin")
        .dt_compat      = berlin_dt_compat,
+       .init_late      = berlin_init_late,
        /*
         * with DT probing for L2CCs, berlin_init_machine can be removed.
         * Note: 88DE3005 (Armada 1500-mini) uses pl310 l2cc
index 34a3753e73564ed99cf92bbaee7c94ed5a869acb..405cd37e4fba59d1010b14e1e1e11db069ef75b8 100644 (file)
 #include <linux/of_address.h>
 
 #include <asm/cacheflush.h>
+#include <asm/cp15.h>
 #include <asm/smp_plat.h>
 #include <asm/smp_scu.h>
 
-#define CPU_RESET              0x00
+/*
+ * There are two reset registers, one with self-clearing (SC)
+ * reset and one with non-self-clearing reset (NON_SC).
+ */
+#define CPU_RESET_SC           0x00
+#define CPU_RESET_NON_SC       0x20
 
 #define RESET_VECT             0x00
 #define SW_RESET_ADDR          0x94
@@ -30,9 +36,11 @@ static inline void berlin_perform_reset_cpu(unsigned int cpu)
 {
        u32 val;
 
-       val = readl(cpu_ctrl + CPU_RESET);
+       val = readl(cpu_ctrl + CPU_RESET_NON_SC);
+       val &= ~BIT(cpu_logical_map(cpu));
+       writel(val, cpu_ctrl + CPU_RESET_NON_SC);
        val |= BIT(cpu_logical_map(cpu));
-       writel(val, cpu_ctrl + CPU_RESET);
+       writel(val, cpu_ctrl + CPU_RESET_NON_SC);
 }
 
 static int berlin_boot_secondary(unsigned int cpu, struct task_struct *idle)
@@ -91,8 +99,32 @@ unmap_scu:
        iounmap(scu_base);
 }
 
+#ifdef CONFIG_HOTPLUG_CPU
+static void berlin_cpu_die(unsigned int cpu)
+{
+       v7_exit_coherency_flush(louis);
+       while (1)
+               cpu_do_idle();
+}
+
+static int berlin_cpu_kill(unsigned int cpu)
+{
+       u32 val;
+
+       val = readl(cpu_ctrl + CPU_RESET_NON_SC);
+       val &= ~BIT(cpu_logical_map(cpu));
+       writel(val, cpu_ctrl + CPU_RESET_NON_SC);
+
+       return 1;
+}
+#endif
+
 static struct smp_operations berlin_smp_ops __initdata = {
        .smp_prepare_cpus       = berlin_smp_prepare_cpus,
        .smp_boot_secondary     = berlin_boot_secondary,
+#ifdef CONFIG_HOTPLUG_CPU
+       .cpu_die                = berlin_cpu_die,
+       .cpu_kill               = berlin_cpu_kill,
+#endif
 };
 CPU_METHOD_OF_DECLARE(berlin_smp, "marvell,berlin-smp", &berlin_smp_ops);
index c622c306c390719f95cfac1eb8b3eff46f38c340..47905a50e0757e94c1300ec98a3924d9a51b7a5b 100644 (file)
@@ -65,8 +65,9 @@ static void __iomem *cns3xxx_pci_map_bus(struct pci_bus *bus,
 
        /*
         * The CNS PCI bridge doesn't fit into the PCI hierarchy, though
-        * we still want to access it. For this to work, we must place
-        * the first device on the same bus as the CNS PCI bridge.
+        * we still want to access it.
+        * We place the host bridge on bus 0, and the directly connected
+        * device on bus 1, slot 0.
         */
        if (busno == 0) { /* internal PCIe bus, host bridge device */
                if (devfn == 0) /* device# and function# are ignored by hw */
@@ -211,58 +212,46 @@ static void __init cns3xxx_pcie_check_link(struct cns3xxx_pcie *cnspci)
        }
 }
 
+static void cns3xxx_write_config(struct cns3xxx_pcie *cnspci,
+                                        int where, int size, u32 val)
+{
+       void __iomem *base = cnspci->host_regs + (where & 0xffc);
+       u32 v;
+       u32 mask = (0x1ull << (size * 8)) - 1;
+       int shift = (where % 4) * 8;
+
+       v = readl_relaxed(base + (where & 0xffc));
+
+       v &= ~(mask << shift);
+       v |= (val & mask) << shift;
+
+       writel_relaxed(v, base + (where & 0xffc));
+       readl_relaxed(base + (where & 0xffc));
+}
+
 static void __init cns3xxx_pcie_hw_init(struct cns3xxx_pcie *cnspci)
 {
-       int port = cnspci->port;
-       struct pci_sys_data sd = {
-               .private_data = cnspci,
-       };
-       struct pci_bus bus = {
-               .number = 0,
-               .ops = &cns3xxx_pcie_ops,
-               .sysdata = &sd,
-       };
        u16 mem_base  = cnspci->res_mem.start >> 16;
        u16 mem_limit = cnspci->res_mem.end   >> 16;
        u16 io_base   = cnspci->res_io.start  >> 16;
        u16 io_limit  = cnspci->res_io.end    >> 16;
-       u32 devfn = 0;
-       u8 tmp8;
-       u16 pos;
-       u16 dc;
-
-       pci_bus_write_config_byte(&bus, devfn, PCI_PRIMARY_BUS, 0);
-       pci_bus_write_config_byte(&bus, devfn, PCI_SECONDARY_BUS, 1);
-       pci_bus_write_config_byte(&bus, devfn, PCI_SUBORDINATE_BUS, 1);
 
-       pci_bus_read_config_byte(&bus, devfn, PCI_PRIMARY_BUS, &tmp8);
-       pci_bus_read_config_byte(&bus, devfn, PCI_SECONDARY_BUS, &tmp8);
-       pci_bus_read_config_byte(&bus, devfn, PCI_SUBORDINATE_BUS, &tmp8);
-
-       pci_bus_write_config_word(&bus, devfn, PCI_MEMORY_BASE, mem_base);
-       pci_bus_write_config_word(&bus, devfn, PCI_MEMORY_LIMIT, mem_limit);
-       pci_bus_write_config_word(&bus, devfn, PCI_IO_BASE_UPPER16, io_base);
-       pci_bus_write_config_word(&bus, devfn, PCI_IO_LIMIT_UPPER16, io_limit);
+       cns3xxx_write_config(cnspci, PCI_PRIMARY_BUS, 1, 0);
+       cns3xxx_write_config(cnspci, PCI_SECONDARY_BUS, 1, 1);
+       cns3xxx_write_config(cnspci, PCI_SUBORDINATE_BUS, 1, 1);
+       cns3xxx_write_config(cnspci, PCI_MEMORY_BASE, 2, mem_base);
+       cns3xxx_write_config(cnspci, PCI_MEMORY_LIMIT, 2, mem_limit);
+       cns3xxx_write_config(cnspci, PCI_IO_BASE_UPPER16, 2, io_base);
+       cns3xxx_write_config(cnspci, PCI_IO_LIMIT_UPPER16, 2, io_limit);
 
        if (!cnspci->linked)
                return;
 
        /* Set Device Max_Read_Request_Size to 128 byte */
-       bus.number = 1; /* directly connected PCIe device */
-       devfn = PCI_DEVFN(0, 0);
-       pos = pci_bus_find_capability(&bus, devfn, PCI_CAP_ID_EXP);
-       pci_bus_read_config_word(&bus, devfn, pos + PCI_EXP_DEVCTL, &dc);
-       if (dc & PCI_EXP_DEVCTL_READRQ) {
-               dc &= ~PCI_EXP_DEVCTL_READRQ;
-               pci_bus_write_config_word(&bus, devfn, pos + PCI_EXP_DEVCTL, dc);
-               pci_bus_read_config_word(&bus, devfn, pos + PCI_EXP_DEVCTL, &dc);
-               if (dc & PCI_EXP_DEVCTL_READRQ)
-                       pr_warn("PCIe: Unable to set device Max_Read_Request_Size\n");
-               else
-                       pr_info("PCIe: Max_Read_Request_Size set to 128 bytes\n");
-       }
+       pcie_bus_config = PCIE_BUS_PEER2PEER;
+
        /* Disable PCIe0 Interrupt Mask INTA to INTD */
-       __raw_writel(~0x3FFF, MISC_PCIE_INT_MASK(port));
+       __raw_writel(~0x3FFF, MISC_PCIE_INT_MASK(cnspci->port));
 }
 
 static int cns3xxx_pcie_abort_handler(unsigned long addr, unsigned int fsr,
index 1a0898c1c17ec40f4c66f2d3fa0f4c7d9da9f357..bbdd2d614b4978022f0b9f51a7abc898dc0b5e0f 100644 (file)
@@ -546,9 +546,7 @@ static int dm6444evm_msp430_get_pins(void)
        if (status < 0)
                return status;
 
-       dev_dbg(&dm6446evm_msp->dev,
-               "PINS: %02x %02x %02x %02x\n",
-               buf[0], buf[1], buf[2], buf[3]);
+       dev_dbg(&dm6446evm_msp->dev, "PINS: %4ph\n", buf);
 
        return (buf[3] << 8) | buf[2];
 }
index c70bb0a4dfb44cb288e671f727199c07a1d0af5f..3caff9637a82e759db99ee78c7677340f1f3e560 100644 (file)
@@ -97,7 +97,9 @@ int clk_enable(struct clk *clk)
 {
        unsigned long flags;
 
-       if (clk == NULL || IS_ERR(clk))
+       if (!clk)
+               return 0;
+       else if (IS_ERR(clk))
                return -EINVAL;
 
        spin_lock_irqsave(&clockfw_lock, flags);
@@ -124,7 +126,7 @@ EXPORT_SYMBOL(clk_disable);
 unsigned long clk_get_rate(struct clk *clk)
 {
        if (clk == NULL || IS_ERR(clk))
-               return -EINVAL;
+               return 0;
 
        return clk->rate;
 }
@@ -159,8 +161,10 @@ int clk_set_rate(struct clk *clk, unsigned long rate)
        unsigned long flags;
        int ret = -EINVAL;
 
-       if (clk == NULL || IS_ERR(clk))
-               return ret;
+       if (!clk)
+               return 0;
+       else if (IS_ERR(clk))
+               return -EINVAL;
 
        if (clk->set_rate)
                ret = clk->set_rate(clk, rate);
@@ -181,7 +185,9 @@ int clk_set_parent(struct clk *clk, struct clk *parent)
 {
        unsigned long flags;
 
-       if (clk == NULL || IS_ERR(clk))
+       if (!clk)
+               return 0;
+       else if (IS_ERR(clk))
                return -EINVAL;
 
        /* Cannot change parent on enabled clock */
index 4f36d8d2bc57bd59a76d5efb1ed0a6f132141310..fc65b0f1db482c9d9993be16ada142f63e95a8c9 100644 (file)
@@ -1,7 +1,10 @@
 config ARCH_DIGICOLOR
        bool "Conexant Digicolor SoC Support"
        depends on ARCH_MULTI_V7
+       select ARCH_REQUIRE_GPIOLIB
        select CLKSRC_MMIO
        select DIGICOLOR_TIMER
        select GENERIC_IRQ_CHIP
        select MFD_SYSCON
+       select PINCTRL
+       select PINCTRL_DIGICOLOR
index 5a7e47ceec91f7a6486821cc0a4b93e7d51257a9..c169cc3049aa3bbe270905eea1840d1b603b125c 100644 (file)
@@ -19,6 +19,7 @@
 #include <linux/cpu_pm.h>
 #include <linux/io.h>
 #include <linux/irq.h>
+#include <linux/irqchip.h>
 #include <linux/irqdomain.h>
 #include <linux/of_address.h>
 #include <linux/err.h>
@@ -265,7 +266,7 @@ static int __init exynos_pmu_irq_init(struct device_node *node,
        return 0;
 }
 
-#define EXYNOS_PMU_IRQ(symbol, name)   OF_DECLARE_2(irqchip, symbol, name, exynos_pmu_irq_init)
+#define EXYNOS_PMU_IRQ(symbol, name)   IRQCHIP_DECLARE(symbol, name, exynos_pmu_irq_init)
 
 EXYNOS_PMU_IRQ(exynos3250_pmu_irq, "samsung,exynos3250-pmu");
 EXYNOS_PMU_IRQ(exynos4210_pmu_irq, "samsung,exynos4210-pmu");
index 21e4e8697a58f7d020d155277caabf85c5a0934e..e2d53839fceb632214a9dbe8deade9a9ed618e08 100644 (file)
@@ -131,6 +131,7 @@ void imx6q_pm_init(void);
 void imx6dl_pm_init(void);
 void imx6sl_pm_init(void);
 void imx6sx_pm_init(void);
+void imx6ul_pm_init(void);
 
 #ifdef CONFIG_PM
 void imx51_pm_init(void);
index 10bf7159b27def3adf90403541fed2214b6bac4e..8e7976a4c3e723e1b27a08928700bac2b6cb9a09 100644 (file)
@@ -14,6 +14,7 @@
 #include <linux/delay.h>
 #include <linux/io.h>
 #include <linux/irq.h>
+#include <linux/irqchip.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
 #include <linux/of_irq.h>
@@ -271,12 +272,7 @@ static int __init imx_gpc_init(struct device_node *node,
 
        return 0;
 }
-
-/*
- * We cannot use the IRQCHIP_DECLARE macro that lives in
- * drivers/irqchip, so we're forced to roll our own. Not very nice.
- */
-OF_DECLARE_2(irqchip, imx_gpc, "fsl,imx6q-gpc", imx_gpc_init);
+IRQCHIP_DECLARE(imx_gpc, "fsl,imx6q-gpc", imx_gpc_init);
 
 void __init imx_gpc_check_dt(void)
 {
index 1b97fe133cef0aa47a50946e3d163c4483451212..acaf7056efa57be734cd5e447b5bae6d744b5b68 100644 (file)
@@ -67,6 +67,7 @@ static void __init imx6ul_init_machine(void)
        of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
        imx6ul_enet_init();
        imx_anatop_init();
+       imx6ul_pm_init();
 }
 
 static void __init imx6ul_init_irq(void)
@@ -74,6 +75,13 @@ static void __init imx6ul_init_irq(void)
        imx_init_revision_from_anatop();
        imx_src_init();
        irqchip_init();
+       imx6_pm_ccm_init("fsl,imx6ul-ccm");
+}
+
+static void __init imx6ul_init_late(void)
+{
+       if (IS_ENABLED(CONFIG_ARM_IMX6Q_CPUFREQ))
+               platform_device_register_simple("imx6q-cpufreq", -1, NULL, 0);
 }
 
 static const char *imx6ul_dt_compat[] __initconst = {
@@ -84,5 +92,6 @@ static const char *imx6ul_dt_compat[] __initconst = {
 DT_MACHINE_START(IMX6UL, "Freescale i.MX6 Ultralite (Device Tree)")
        .init_irq       = imx6ul_init_irq,
        .init_machine   = imx6ul_init_machine,
+       .init_late      = imx6ul_init_late,
        .dt_compat      = imx6ul_dt_compat,
 MACHINE_END
index 62f3437257f1f55b8c08c0f57b062ff23c678ff5..b450f525a670961b79cd0b3d28271a238dba70a1 100644 (file)
@@ -6,12 +6,85 @@
  * published by the Free Software Foundation.
  */
 #include <linux/irqchip.h>
+#include <linux/mfd/syscon.h>
+#include <linux/mfd/syscon/imx7-iomuxc-gpr.h>
 #include <linux/of_platform.h>
+#include <linux/phy.h>
+#include <linux/regmap.h>
+
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 
 #include "common.h"
 
+static int ar8031_phy_fixup(struct phy_device *dev)
+{
+       u16 val;
+
+       /* Set RGMII IO voltage to 1.8V */
+       phy_write(dev, 0x1d, 0x1f);
+       phy_write(dev, 0x1e, 0x8);
+
+       /* disable phy AR8031 SmartEEE function. */
+       phy_write(dev, 0xd, 0x3);
+       phy_write(dev, 0xe, 0x805d);
+       phy_write(dev, 0xd, 0x4003);
+       val = phy_read(dev, 0xe);
+       val &= ~(0x1 << 8);
+       phy_write(dev, 0xe, val);
+
+       /* introduce tx clock delay */
+       phy_write(dev, 0x1d, 0x5);
+       val = phy_read(dev, 0x1e);
+       val |= 0x0100;
+       phy_write(dev, 0x1e, val);
+
+       return 0;
+}
+
+static int bcm54220_phy_fixup(struct phy_device *dev)
+{
+       /* enable RXC skew select RGMII copper mode */
+       phy_write(dev, 0x1e, 0x21);
+       phy_write(dev, 0x1f, 0x7ea8);
+       phy_write(dev, 0x1e, 0x2f);
+       phy_write(dev, 0x1f, 0x71b7);
+
+       return 0;
+}
+
+#define PHY_ID_AR8031  0x004dd074
+#define PHY_ID_BCM54220        0x600d8589
+
+static void __init imx7d_enet_phy_init(void)
+{
+       if (IS_BUILTIN(CONFIG_PHYLIB)) {
+               phy_register_fixup_for_uid(PHY_ID_AR8031, 0xffffffff,
+                                          ar8031_phy_fixup);
+               phy_register_fixup_for_uid(PHY_ID_BCM54220, 0xffffffff,
+                                          bcm54220_phy_fixup);
+       }
+}
+
+static void __init imx7d_enet_clk_sel(void)
+{
+       struct regmap *gpr;
+
+       gpr = syscon_regmap_lookup_by_compatible("fsl,imx7d-iomuxc-gpr");
+       if (!IS_ERR(gpr)) {
+               regmap_update_bits(gpr, IOMUXC_GPR1, IMX7D_GPR1_ENET_TX_CLK_SEL_MASK, 0);
+               regmap_update_bits(gpr, IOMUXC_GPR1, IMX7D_GPR1_ENET_CLK_DIR_MASK, 0);
+       } else {
+               pr_err("failed to find fsl,imx7d-iomux-gpr regmap\n");
+       }
+}
+
+static inline void imx7d_enet_init(void)
+{
+       imx7d_enet_phy_init();
+       imx7d_enet_clk_sel();
+}
+
 static void __init imx7d_init_machine(void)
 {
        struct device *parent;
@@ -22,6 +95,7 @@ static void __init imx7d_init_machine(void)
 
        of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
        imx_anatop_init();
+       imx7d_enet_init();
 }
 
 static void __init imx7d_init_irq(void)
index 8ff8fc0b261ccd7a6d6912b4478e60b15606c097..4470376af5f815fd5f8f2d12c5e7d18306675bb4 100644 (file)
@@ -93,6 +93,7 @@ struct imx6_pm_socdata {
        const char *src_compat;
        const char *iomuxc_compat;
        const char *gpc_compat;
+       const char *pl310_compat;
        const u32 mmdc_io_num;
        const u32 *mmdc_io_offset;
 };
@@ -137,11 +138,19 @@ static const u32 imx6sx_mmdc_io_offset[] __initconst = {
        0x330, 0x334, 0x338, 0x33c, /* SDQS0 ~ SDQS3 */
 };
 
+static const u32 imx6ul_mmdc_io_offset[] __initconst = {
+       0x244, 0x248, 0x24c, 0x250, /* DQM0, DQM1, RAS, CAS */
+       0x27c, 0x498, 0x4a4, 0x490, /* SDCLK0, GPR_B0DS-B1DS, GPR_ADDS */
+       0x280, 0x284, 0x260, 0x264, /* SDQS0~1, SODT0, SODT1 */
+       0x494, 0x4b0,               /* MODE_CTL, MODE, */
+};
+
 static const struct imx6_pm_socdata imx6q_pm_data __initconst = {
        .mmdc_compat = "fsl,imx6q-mmdc",
        .src_compat = "fsl,imx6q-src",
        .iomuxc_compat = "fsl,imx6q-iomuxc",
        .gpc_compat = "fsl,imx6q-gpc",
+       .pl310_compat = "arm,pl310-cache",
        .mmdc_io_num = ARRAY_SIZE(imx6q_mmdc_io_offset),
        .mmdc_io_offset = imx6q_mmdc_io_offset,
 };
@@ -151,6 +160,7 @@ static const struct imx6_pm_socdata imx6dl_pm_data __initconst = {
        .src_compat = "fsl,imx6q-src",
        .iomuxc_compat = "fsl,imx6dl-iomuxc",
        .gpc_compat = "fsl,imx6q-gpc",
+       .pl310_compat = "arm,pl310-cache",
        .mmdc_io_num = ARRAY_SIZE(imx6dl_mmdc_io_offset),
        .mmdc_io_offset = imx6dl_mmdc_io_offset,
 };
@@ -160,6 +170,7 @@ static const struct imx6_pm_socdata imx6sl_pm_data __initconst = {
        .src_compat = "fsl,imx6sl-src",
        .iomuxc_compat = "fsl,imx6sl-iomuxc",
        .gpc_compat = "fsl,imx6sl-gpc",
+       .pl310_compat = "arm,pl310-cache",
        .mmdc_io_num = ARRAY_SIZE(imx6sl_mmdc_io_offset),
        .mmdc_io_offset = imx6sl_mmdc_io_offset,
 };
@@ -169,10 +180,21 @@ static const struct imx6_pm_socdata imx6sx_pm_data __initconst = {
        .src_compat = "fsl,imx6sx-src",
        .iomuxc_compat = "fsl,imx6sx-iomuxc",
        .gpc_compat = "fsl,imx6sx-gpc",
+       .pl310_compat = "arm,pl310-cache",
        .mmdc_io_num = ARRAY_SIZE(imx6sx_mmdc_io_offset),
        .mmdc_io_offset = imx6sx_mmdc_io_offset,
 };
 
+static const struct imx6_pm_socdata imx6ul_pm_data __initconst = {
+       .mmdc_compat = "fsl,imx6ul-mmdc",
+       .src_compat = "fsl,imx6ul-src",
+       .iomuxc_compat = "fsl,imx6ul-iomuxc",
+       .gpc_compat = "fsl,imx6ul-gpc",
+       .pl310_compat = NULL,
+       .mmdc_io_num = ARRAY_SIZE(imx6ul_mmdc_io_offset),
+       .mmdc_io_offset = imx6ul_mmdc_io_offset,
+};
+
 /*
  * This structure is for passing necessary data for low level ocram
  * suspend code(arch/arm/mach-imx/suspend-imx6.S), if this struct
@@ -290,7 +312,7 @@ int imx6_set_lpm(enum mxc_cpu_pwr_mode mode)
                val |= BM_CLPCR_SBYOS;
                if (cpu_is_imx6sl())
                        val |= BM_CLPCR_BYPASS_PMIC_READY;
-               if (cpu_is_imx6sl() || cpu_is_imx6sx())
+               if (cpu_is_imx6sl() || cpu_is_imx6sx() || cpu_is_imx6ul())
                        val |= BM_CLPCR_BYP_MMDC_CH0_LPM_HS;
                else
                        val |= BM_CLPCR_BYP_MMDC_CH1_LPM_HS;
@@ -330,6 +352,10 @@ static int imx6q_suspend_finish(unsigned long val)
                 * as we need to float DDR IO.
                 */
                local_flush_tlb_all();
+               /* check if need to flush internal L2 cache */
+               if (!((struct imx6_cpu_pm_info *)
+                       suspend_ocram_base)->l2_base.vbase)
+                       flush_cache_all();
                imx6_suspend_in_ocram_fn(suspend_ocram_base);
        }
 
@@ -470,6 +496,7 @@ static int __init imx6q_suspend_init(const struct imx6_pm_socdata *socdata)
        suspend_ocram_base = __arm_ioremap_exec(ocram_pbase,
                MX6Q_SUSPEND_OCRAM_SIZE, false);
 
+       memset(suspend_ocram_base, 0, sizeof(*pm_info));
        pm_info = suspend_ocram_base;
        pm_info->pbase = ocram_pbase;
        pm_info->resume_addr = virt_to_phys(v7_cpu_resume);
@@ -505,11 +532,13 @@ static int __init imx6q_suspend_init(const struct imx6_pm_socdata *socdata)
                goto gpc_map_failed;
        }
 
-       ret = imx6_pm_get_base(&pm_info->l2_base, "arm,pl310-cache");
-       if (ret) {
-               pr_warn("%s: failed to get pl310-cache base %d!\n",
-                       __func__, ret);
-               goto pl310_cache_map_failed;
+       if (socdata->pl310_compat) {
+               ret = imx6_pm_get_base(&pm_info->l2_base, socdata->pl310_compat);
+               if (ret) {
+                       pr_warn("%s: failed to get pl310-cache base %d!\n",
+                               __func__, ret);
+                       goto pl310_cache_map_failed;
+               }
        }
 
        pm_info->ddr_type = imx_mmdc_get_ddr_type();
@@ -610,3 +639,8 @@ void __init imx6sx_pm_init(void)
 {
        imx6_pm_common_init(&imx6sx_pm_data);
 }
+
+void __init imx6ul_pm_init(void)
+{
+       imx6_pm_common_init(&imx6ul_pm_data);
+}
index b99987b023fa426bc8a225aaa3e2bb362d940c3a..76ee2ceec8d546d0ca3f51aebcb8f40509213ba6 100644 (file)
        /* sync L2 cache to drain L2's buffers to DRAM. */
 #ifdef CONFIG_CACHE_L2X0
        ldr     r11, [r0, #PM_INFO_MX6Q_L2_V_OFFSET]
+       teq     r11, #0
+       beq     6f
        mov     r6, #0x0
        str     r6, [r11, #L2X0_CACHE_SYNC]
 1:
        ldr     r6, [r11, #L2X0_CACHE_SYNC]
        ands    r6, r6, #0x1
        bne     1b
+6:
 #endif
 
        .endm
index e288010522f9a6972ecebcd2b256746c9be98738..c279293f084cb87c2e0cc4cbf4ada1e2984e83f2 100644 (file)
@@ -97,6 +97,9 @@ static long long __init keystone_pv_fixup(void)
 }
 
 static const char *const keystone_match[] __initconst = {
+       "ti,k2hk",
+       "ti,k2e",
+       "ti,k2l",
        "ti,keystone",
        NULL,
 };
index 43e619f56172feed1cb4ebbcec544c1b73f2e121..21164605b83fcd8e923798b679b29ac75781c4cc 100644 (file)
@@ -1 +1,4 @@
+ifeq ($(CONFIG_SMP),y)
+obj-$(CONFIG_ARCH_MEDIATEK) += platsmp.o
+endif
 obj-$(CONFIG_ARCH_MEDIATEK) += mediatek.o
index a9549005097e035271ca34fae7a6a71caffdf956..d019a080a559a467acd503c94c0f70ec7c0050af 100644 (file)
  */
 #include <linux/init.h>
 #include <asm/mach/arch.h>
+#include <linux/of.h>
+#include <linux/clk-provider.h>
+#include <linux/clocksource.h>
+
+
+#define GPT6_CON_MT65xx 0x10008060
+#define GPT_ENABLE      0x31
+
+static void __init mediatek_timer_init(void)
+{
+       void __iomem *gpt_base;
+
+       if (of_machine_is_compatible("mediatek,mt6589") ||
+           of_machine_is_compatible("mediatek,mt8135") ||
+           of_machine_is_compatible("mediatek,mt8127")) {
+               /* turn on GPT6 which ungates arch timer clocks */
+               gpt_base = ioremap(GPT6_CON_MT65xx, 0x04);
+
+               /* enable clock and set to free-run */
+               writel(GPT_ENABLE, gpt_base);
+               iounmap(gpt_base);
+       }
+
+       of_clk_init(NULL);
+       clocksource_probe();
+};
 
 static const char * const mediatek_board_dt_compat[] = {
        "mediatek,mt6589",
@@ -27,4 +53,5 @@ static const char * const mediatek_board_dt_compat[] = {
 
 DT_MACHINE_START(MEDIATEK_DT, "Mediatek Cortex-A7 (Device Tree)")
        .dt_compat      = mediatek_board_dt_compat,
+       .init_time      = mediatek_timer_init,
 MACHINE_END
diff --git a/arch/arm/mach-mediatek/platsmp.c b/arch/arm/mach-mediatek/platsmp.c
new file mode 100644 (file)
index 0000000..8141f3f
--- /dev/null
@@ -0,0 +1,141 @@
+/*
+ * arch/arm/mach-mediatek/platsmp.c
+ *
+ * Copyright (c) 2014 Mediatek Inc.
+ * Author: Shunli Wang <shunli.wang@mediatek.com>
+ *         Yingjoe Chen <yingjoe.chen@mediatek.com>
+ *
+ * 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.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ */
+#include <linux/io.h>
+#include <linux/memblock.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/string.h>
+#include <linux/threads.h>
+
+#define MTK_MAX_CPU            8
+#define MTK_SMP_REG_SIZE       0x1000
+
+struct mtk_smp_boot_info {
+       unsigned long smp_base;
+       unsigned int jump_reg;
+       unsigned int core_keys[MTK_MAX_CPU - 1];
+       unsigned int core_regs[MTK_MAX_CPU - 1];
+};
+
+static const struct mtk_smp_boot_info mtk_mt8135_tz_boot = {
+       0x80002000, 0x3fc,
+       { 0x534c4131, 0x4c415332, 0x41534c33 },
+       { 0x3f8, 0x3f8, 0x3f8 },
+};
+
+static const struct mtk_smp_boot_info mtk_mt6589_boot = {
+       0x10002000, 0x34,
+       { 0x534c4131, 0x4c415332, 0x41534c33 },
+       { 0x38, 0x3c, 0x40 },
+};
+
+static const struct of_device_id mtk_tz_smp_boot_infos[] __initconst = {
+       { .compatible   = "mediatek,mt8135", .data = &mtk_mt8135_tz_boot },
+       { .compatible   = "mediatek,mt8127", .data = &mtk_mt8135_tz_boot },
+};
+
+static const struct of_device_id mtk_smp_boot_infos[] __initconst = {
+       { .compatible   = "mediatek,mt6589", .data = &mtk_mt6589_boot },
+};
+
+static void __iomem *mtk_smp_base;
+static const struct mtk_smp_boot_info *mtk_smp_info;
+
+static int mtk_boot_secondary(unsigned int cpu, struct task_struct *idle)
+{
+       if (!mtk_smp_base)
+               return -EINVAL;
+
+       if (!mtk_smp_info->core_keys[cpu-1])
+               return -EINVAL;
+
+       writel_relaxed(mtk_smp_info->core_keys[cpu-1],
+               mtk_smp_base + mtk_smp_info->core_regs[cpu-1]);
+
+       arch_send_wakeup_ipi_mask(cpumask_of(cpu));
+
+       return 0;
+}
+
+static void __init __mtk_smp_prepare_cpus(unsigned int max_cpus, int trustzone)
+{
+       int i, num;
+       const struct of_device_id *infos;
+
+       if (trustzone) {
+               num = ARRAY_SIZE(mtk_tz_smp_boot_infos);
+               infos = mtk_tz_smp_boot_infos;
+       } else {
+               num = ARRAY_SIZE(mtk_smp_boot_infos);
+               infos = mtk_smp_boot_infos;
+       }
+
+       /* Find smp boot info for this SoC */
+       for (i = 0; i < num; i++) {
+               if (of_machine_is_compatible(infos[i].compatible)) {
+                       mtk_smp_info = infos[i].data;
+                       break;
+               }
+       }
+
+       if (!mtk_smp_info) {
+               pr_err("%s: Device is not supported\n", __func__);
+               return;
+       }
+
+       if (trustzone) {
+               /* smp_base(trustzone-bootinfo) is reserved by device tree */
+               mtk_smp_base = phys_to_virt(mtk_smp_info->smp_base);
+       } else {
+               mtk_smp_base = ioremap(mtk_smp_info->smp_base, MTK_SMP_REG_SIZE);
+               if (!mtk_smp_base) {
+                       pr_err("%s: Can't remap %lx\n", __func__,
+                               mtk_smp_info->smp_base);
+                       return;
+               }
+       }
+
+       /*
+        * write the address of slave startup address into the system-wide
+        * jump register
+        */
+       writel_relaxed(virt_to_phys(secondary_startup_arm),
+                       mtk_smp_base + mtk_smp_info->jump_reg);
+}
+
+static void __init mtk_tz_smp_prepare_cpus(unsigned int max_cpus)
+{
+       __mtk_smp_prepare_cpus(max_cpus, 1);
+}
+
+static void __init mtk_smp_prepare_cpus(unsigned int max_cpus)
+{
+       __mtk_smp_prepare_cpus(max_cpus, 0);
+}
+
+static struct smp_operations mt81xx_tz_smp_ops __initdata = {
+       .smp_prepare_cpus = mtk_tz_smp_prepare_cpus,
+       .smp_boot_secondary = mtk_boot_secondary,
+};
+CPU_METHOD_OF_DECLARE(mt81xx_tz_smp, "mediatek,mt81xx-tz-smp", &mt81xx_tz_smp_ops);
+
+static struct smp_operations mt6589_smp_ops __initdata = {
+       .smp_prepare_cpus = mtk_smp_prepare_cpus,
+       .smp_boot_secondary = mtk_boot_secondary,
+};
+CPU_METHOD_OF_DECLARE(mt6589_smp, "mediatek,mt6589-smp", &mt6589_smp_ops);
index 0743e2059645d876af692026d9dfd74713ba2608..5d56f86ae1a4b1c96871e05c69eafd5bac5f7b26 100644 (file)
@@ -19,4 +19,9 @@ config MACH_MESON8
        default ARCH_MESON
        select MESON6_TIMER
 
+config MACH_MESON8B
+       bool "Amlogic Meson8b SoCs support"
+       default ARCH_MESON
+       select MESON6_TIMER
+
 endif
index 5d6affe6a694d38a37a34fe4d57e60f3c5ab7b7c..4e235717862599a211857c7c62cf5387fe85ebc8 100644 (file)
@@ -19,6 +19,7 @@
 static const char * const meson_common_board_compat[] = {
        "amlogic,meson6",
        "amlogic,meson8",
+       "amlogic,meson8b",
        NULL,
 };
 
index 9f739f3cad4c7e584391c0e8f79ec27376d5fa4c..1648edd515a2c2c5f313b0c9d3d68d6bebad545c 100644 (file)
@@ -22,7 +22,6 @@
 #include <linux/dma-mapping.h>
 #include <linux/memblock.h>
 #include <linux/mbus.h>
-#include <linux/signal.h>
 #include <linux/slab.h>
 #include <linux/irqchip.h>
 #include <asm/hardware/cache-l2x0.h>
@@ -105,27 +104,6 @@ static void __init mvebu_memblock_reserve(void)
 static void __init mvebu_memblock_reserve(void) {}
 #endif
 
-/*
- * Early versions of Armada 375 SoC have a bug where the BootROM
- * leaves an external data abort pending. The kernel is hit by this
- * data abort as soon as it enters userspace, because it unmasks the
- * data aborts at this moment. We register a custom abort handler
- * below to ignore the first data abort to work around this
- * problem.
- */
-static int armada_375_external_abort_wa(unsigned long addr, unsigned int fsr,
-                                       struct pt_regs *regs)
-{
-       static int ignore_first;
-
-       if (!ignore_first && fsr == 0x1406) {
-               ignore_first = 1;
-               return 0;
-       }
-
-       return 1;
-}
-
 static void __init mvebu_init_irq(void)
 {
        irqchip_init();
@@ -134,17 +112,6 @@ static void __init mvebu_init_irq(void)
        BUG_ON(mvebu_mbus_dt_init(coherency_available()));
 }
 
-static void __init external_abort_quirk(void)
-{
-       u32 dev, rev;
-
-       if (mvebu_get_soc_id(&dev, &rev) == 0 && rev > ARMADA_375_Z1_REV)
-               return;
-
-       hook_fault_code(16 + 6, armada_375_external_abort_wa, SIGBUS, 0,
-                       "imprecise external abort");
-}
-
 static void __init i2c_quirk(void)
 {
        struct device_node *np;
@@ -177,8 +144,6 @@ static void __init mvebu_dt_init(void)
 {
        if (of_machine_is_compatible("marvell,armadaxp"))
                i2c_quirk();
-       if (of_machine_is_compatible("marvell,a375-db"))
-               external_abort_quirk();
 
        of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 }
index 44eedf331ae7df40bb76fcfec0358e89ce128d76..55348ee5a35228cf5e8cbb8f55b0b16b4d56c805 100644 (file)
@@ -40,6 +40,7 @@
 unsigned long coherency_phys_base;
 void __iomem *coherency_base;
 static void __iomem *coherency_cpu_base;
+static void __iomem *cpu_config_base;
 
 /* Coherency fabric registers */
 #define IO_SYNC_BARRIER_CTL_OFFSET                0x0
@@ -65,6 +66,31 @@ static const struct of_device_id of_coherency_table[] = {
 int ll_enable_coherency(void);
 void ll_add_cpu_to_smp_group(void);
 
+#define CPU_CONFIG_SHARED_L2 BIT(16)
+
+/*
+ * Disable the "Shared L2 Present" bit in CPU Configuration register
+ * on Armada XP.
+ *
+ * The "Shared L2 Present" bit affects the "level of coherence" value
+ * in the clidr CP15 register.  Cache operation functions such as
+ * "flush all" and "invalidate all" operate on all the cache levels
+ * that included in the defined level of coherence. When HW I/O
+ * coherency is used, this bit causes unnecessary flushes of the L2
+ * cache.
+ */
+static void armada_xp_clear_shared_l2(void)
+{
+       u32 reg;
+
+       if (!cpu_config_base)
+               return;
+
+       reg = readl(cpu_config_base);
+       reg &= ~CPU_CONFIG_SHARED_L2;
+       writel(reg, cpu_config_base);
+}
+
 static int mvebu_hwcc_notifier(struct notifier_block *nb,
                               unsigned long event, void *__dev)
 {
@@ -85,9 +111,24 @@ static struct notifier_block mvebu_hwcc_pci_nb = {
        .notifier_call = mvebu_hwcc_notifier,
 };
 
+static int armada_xp_clear_shared_l2_notifier_func(struct notifier_block *nfb,
+                                       unsigned long action, void *hcpu)
+{
+       if (action == CPU_STARTING || action == CPU_STARTING_FROZEN)
+               armada_xp_clear_shared_l2();
+
+       return NOTIFY_OK;
+}
+
+static struct notifier_block armada_xp_clear_shared_l2_notifier = {
+       .notifier_call = armada_xp_clear_shared_l2_notifier_func,
+       .priority = 100,
+};
+
 static void __init armada_370_coherency_init(struct device_node *np)
 {
        struct resource res;
+       struct device_node *cpu_config_np;
 
        of_address_to_resource(np, 0, &res);
        coherency_phys_base = res.start;
@@ -100,6 +141,23 @@ static void __init armada_370_coherency_init(struct device_node *np)
        sync_cache_w(&coherency_phys_base);
        coherency_base = of_iomap(np, 0);
        coherency_cpu_base = of_iomap(np, 1);
+
+       cpu_config_np = of_find_compatible_node(NULL, NULL,
+                                               "marvell,armada-xp-cpu-config");
+       if (!cpu_config_np)
+               goto exit;
+
+       cpu_config_base = of_iomap(cpu_config_np, 0);
+       if (!cpu_config_base) {
+               of_node_put(cpu_config_np);
+               goto exit;
+       }
+
+       of_node_put(cpu_config_np);
+
+       register_cpu_notifier(&armada_xp_clear_shared_l2_notifier);
+
+exit:
        set_cpu_coherent();
 }
 
@@ -204,6 +262,8 @@ int set_cpu_coherent(void)
                        pr_warn("Coherency fabric is not initialized\n");
                        return 1;
                }
+
+               armada_xp_clear_shared_l2();
                ll_add_cpu_to_smp_group();
                return ll_enable_coherency();
        }
index e8fdb9ceedf0c7c9402bff4123ea9c375a1ccbfe..ed8fda4cd055848e871bb0f592b23735d4c843aa 100644 (file)
@@ -296,11 +296,11 @@ int armada_370_xp_pmsu_idle_enter(unsigned long deepidle)
        /* Test the CR_C bit and set it if it was cleared */
        asm volatile(
        "mrc    p15, 0, r0, c1, c0, 0 \n\t"
-       "tst    r0, #(1 << 2) \n\t"
+       "tst    r0, %0 \n\t"
        "orreq  r0, r0, #(1 << 2) \n\t"
        "mcreq  p15, 0, r0, c1, c0, 0 \n\t"
        "isb    "
-       : : : "r0");
+       : : "Ir" (CR_C) : "r0");
 
        pr_debug("Failed to suspend the system\n");
 
@@ -379,6 +379,16 @@ static struct notifier_block mvebu_v7_cpu_pm_notifier = {
 
 static struct platform_device mvebu_v7_cpuidle_device;
 
+static int broken_idle(struct device_node *np)
+{
+       if (of_property_read_bool(np, "broken-idle")) {
+               pr_warn("CPU idle is currently broken: disabling\n");
+               return 1;
+       }
+
+       return 0;
+}
+
 static __init int armada_370_cpuidle_init(void)
 {
        struct device_node *np;
@@ -387,7 +397,9 @@ static __init int armada_370_cpuidle_init(void)
        np = of_find_compatible_node(NULL, NULL, "marvell,coherency-fabric");
        if (!np)
                return -ENODEV;
-       of_node_put(np);
+
+       if (broken_idle(np))
+               goto end;
 
        /*
         * On Armada 370, there is "a slow exit process from the deep
@@ -406,6 +418,8 @@ static __init int armada_370_cpuidle_init(void)
        mvebu_v7_cpuidle_device.dev.platform_data = armada_370_xp_cpu_suspend;
        mvebu_v7_cpuidle_device.name = "cpuidle-armada-370";
 
+end:
+       of_node_put(np);
        return 0;
 }
 
@@ -422,6 +436,10 @@ static __init int armada_38x_cpuidle_init(void)
                                     "marvell,armada-380-coherency-fabric");
        if (!np)
                return -ENODEV;
+
+       if (broken_idle(np))
+               goto end;
+
        of_node_put(np);
 
        np = of_find_compatible_node(NULL, NULL,
@@ -430,7 +448,6 @@ static __init int armada_38x_cpuidle_init(void)
                return -ENODEV;
        mpsoc_base = of_iomap(np, 0);
        BUG_ON(!mpsoc_base);
-       of_node_put(np);
 
        /* Set up reset mask when powering down the cpus */
        reg = readl(mpsoc_base + MPCORE_RESET_CTL);
@@ -450,6 +467,8 @@ static __init int armada_38x_cpuidle_init(void)
        mvebu_v7_cpuidle_device.dev.platform_data = armada_38x_cpu_suspend;
        mvebu_v7_cpuidle_device.name = "cpuidle-armada-38x";
 
+end:
+       of_node_put(np);
        return 0;
 }
 
@@ -460,12 +479,16 @@ static __init int armada_xp_cpuidle_init(void)
        np = of_find_compatible_node(NULL, NULL, "marvell,coherency-fabric");
        if (!np)
                return -ENODEV;
-       of_node_put(np);
+
+       if (broken_idle(np))
+               goto end;
 
        mvebu_cpu_resume = armada_370_xp_cpu_resume;
        mvebu_v7_cpuidle_device.dev.platform_data = armada_370_xp_cpu_suspend;
        mvebu_v7_cpuidle_device.name = "cpuidle-armada-xp";
 
+end:
+       of_node_put(np);
        return 0;
 }
 
index cdd05f2e67ee87148a023bd2af8025fbfb5b5bff..afb8095091402eec1a6dd404f14b8a2b2637cd31 100644 (file)
@@ -90,13 +90,6 @@ config MACH_OMAP_FSAMPLE
          Support for TI OMAP 850 F-Sample board. Say Y here if you have such
          a board.
 
-config MACH_VOICEBLUE
-       bool "Voiceblue"
-       depends on ARCH_OMAP1 && ARCH_OMAP15XX
-       help
-         Support for Voiceblue GSM/VoIP gateway. Say Y here if you have
-         such a board.
-
 config MACH_OMAP_PALMTE
        bool "Palm Tungsten E"
        depends on ARCH_OMAP1 && ARCH_OMAP15XX
index 3889b6cd211e704b325573468246b28a45cf299d..0e8ea95ea82268958b1dcfd5edf75b55b2d8f6b4 100644 (file)
@@ -37,7 +37,6 @@ obj-$(CONFIG_MACH_OMAP_FSAMPLE)               += board-fsample.o board-nand.o
 obj-$(CONFIG_MACH_OMAP_OSK)            += board-osk.o
 obj-$(CONFIG_MACH_OMAP_H3)             += board-h3.o board-h3-mmc.o \
                                           board-nand.o
-obj-$(CONFIG_MACH_VOICEBLUE)           += board-voiceblue.o
 obj-$(CONFIG_MACH_OMAP_PALMTE)         += board-palmte.o
 obj-$(CONFIG_MACH_OMAP_PALMZ71)                += board-palmz71.o
 obj-$(CONFIG_MACH_OMAP_PALMTT)         += board-palmtt.o
diff --git a/arch/arm/mach-omap1/board-voiceblue.c b/arch/arm/mach-omap1/board-voiceblue.c
deleted file mode 100644 (file)
index e960687..0000000
+++ /dev/null
@@ -1,296 +0,0 @@
-/*
- * linux/arch/arm/mach-omap1/board-voiceblue.c
- *
- * Modified from board-generic.c
- *
- * Copyright (C) 2004 2N Telekomunikace, Ladislav Michl <michl@2n.cz>
- *
- * Code for OMAP5910 based VoiceBlue board (VoIP to GSM gateway).
- *
- * 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.
- */
-
-#include <linux/delay.h>
-#include <linux/gpio.h>
-#include <linux/platform_device.h>
-#include <linux/interrupt.h>
-#include <linux/irq.h>
-#include <linux/init.h>
-#include <linux/kernel.h>
-#include <linux/mtd/physmap.h>
-#include <linux/notifier.h>
-#include <linux/reboot.h>
-#include <linux/serial_8250.h>
-#include <linux/serial_reg.h>
-#include <linux/smc91x.h>
-#include <linux/export.h>
-#include <linux/reboot.h>
-
-#include <asm/mach-types.h>
-#include <asm/mach/arch.h>
-#include <asm/mach/map.h>
-
-#include <mach/board-voiceblue.h>
-#include <mach/flash.h>
-#include <mach/mux.h>
-#include <mach/tc.h>
-
-#include <mach/hardware.h>
-#include <mach/usb.h>
-
-#include "common.h"
-
-static struct plat_serial8250_port voiceblue_ports[] = {
-       {
-               .mapbase        = (unsigned long)(OMAP_CS1_PHYS + 0x40000),
-               .flags          = UPF_BOOT_AUTOCONF | UPF_IOREMAP,
-               .iotype         = UPIO_MEM,
-               .regshift       = 1,
-               .uartclk        = 3686400,
-       },
-       {
-               .mapbase        = (unsigned long)(OMAP_CS1_PHYS + 0x50000),
-               .flags          = UPF_BOOT_AUTOCONF | UPF_IOREMAP,
-               .iotype         = UPIO_MEM,
-               .regshift       = 1,
-               .uartclk        = 3686400,
-       },
-       {
-               .mapbase        = (unsigned long)(OMAP_CS1_PHYS + 0x60000),
-               .flags          = UPF_BOOT_AUTOCONF | UPF_IOREMAP,
-               .iotype         = UPIO_MEM,
-               .regshift       = 1,
-               .uartclk        = 3686400,
-       },
-       {
-               .mapbase        = (unsigned long)(OMAP_CS1_PHYS + 0x70000),
-               .flags          = UPF_BOOT_AUTOCONF | UPF_IOREMAP,
-               .iotype         = UPIO_MEM,
-               .regshift       = 1,
-               .uartclk        = 3686400,
-       },
-       { },
-};
-
-static struct platform_device serial_device = {
-       .name                   = "serial8250",
-       .id                     = PLAT8250_DEV_PLATFORM1,
-};
-
-static int __init ext_uart_init(void)
-{
-       if (!machine_is_voiceblue())
-               return -ENODEV;
-
-       voiceblue_ports[0].irq = gpio_to_irq(12);
-       voiceblue_ports[1].irq = gpio_to_irq(13);
-       voiceblue_ports[2].irq = gpio_to_irq(14);
-       voiceblue_ports[3].irq = gpio_to_irq(15);
-       serial_device.dev.platform_data = voiceblue_ports;
-       return platform_device_register(&serial_device);
-}
-arch_initcall(ext_uart_init);
-
-static struct physmap_flash_data voiceblue_flash_data = {
-       .width          = 2,
-       .set_vpp        = omap1_set_vpp,
-};
-
-static struct resource voiceblue_flash_resource = {
-       .start  = OMAP_CS0_PHYS,
-       .end    = OMAP_CS0_PHYS + SZ_32M - 1,
-       .flags  = IORESOURCE_MEM,
-};
-
-static struct platform_device voiceblue_flash_device = {
-       .name           = "physmap-flash",
-       .id             = 0,
-       .dev            = {
-               .platform_data  = &voiceblue_flash_data,
-       },
-       .num_resources  = 1,
-       .resource       = &voiceblue_flash_resource,
-};
-
-static struct smc91x_platdata voiceblue_smc91x_info = {
-       .flags  = SMC91X_USE_16BIT | SMC91X_NOWAIT,
-       .leda   = RPC_LED_100_10,
-       .ledb   = RPC_LED_TX_RX,
-};
-
-static struct resource voiceblue_smc91x_resources[] = {
-       [0] = {
-               .start  = OMAP_CS2_PHYS + 0x300,
-               .end    = OMAP_CS2_PHYS + 0x300 + 16,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .flags  = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
-       },
-};
-
-static struct platform_device voiceblue_smc91x_device = {
-       .name           = "smc91x",
-       .id             = 0,
-       .dev    = {
-               .platform_data  = &voiceblue_smc91x_info,
-       },
-       .num_resources  = ARRAY_SIZE(voiceblue_smc91x_resources),
-       .resource       = voiceblue_smc91x_resources,
-};
-
-static struct platform_device *voiceblue_devices[] __initdata = {
-       &voiceblue_flash_device,
-       &voiceblue_smc91x_device,
-};
-
-static struct omap_usb_config voiceblue_usb_config __initdata = {
-       .hmc_mode       = 3,
-       .register_host  = 1,
-       .register_dev   = 1,
-       .pins[0]        = 2,
-       .pins[1]        = 6,
-       .pins[2]        = 6,
-};
-
-#define MACHINE_PANICED                1
-#define MACHINE_REBOOTING      2
-#define MACHINE_REBOOT         4
-static unsigned long machine_state;
-
-static int panic_event(struct notifier_block *this, unsigned long event,
-        void *ptr)
-{
-       if (test_and_set_bit(MACHINE_PANICED, &machine_state))
-               return NOTIFY_DONE;
-
-       /* Flash power LED */
-       omap_writeb(0x78, OMAP_LPG1_LCR);
-       omap_writeb(0x01, OMAP_LPG1_PMR);       /* Enable clock */
-
-       return NOTIFY_DONE;
-}
-
-static struct notifier_block panic_block = {
-       .notifier_call  = panic_event,
-};
-
-static int __init voiceblue_setup(void)
-{
-       if (!machine_is_voiceblue())
-               return -ENODEV;
-
-       /* Setup panic notifier */
-       atomic_notifier_chain_register(&panic_notifier_list, &panic_block);
-
-       return 0;
-}
-postcore_initcall(voiceblue_setup);
-
-static int wdt_gpio_state;
-
-void voiceblue_wdt_enable(void)
-{
-       gpio_direction_output(0, 0);
-       gpio_set_value(0, 1);
-       gpio_set_value(0, 0);
-       wdt_gpio_state = 0;
-}
-
-void voiceblue_wdt_disable(void)
-{
-       gpio_set_value(0, 0);
-       gpio_set_value(0, 1);
-       gpio_set_value(0, 0);
-       gpio_direction_input(0);
-}
-
-void voiceblue_wdt_ping(void)
-{
-       if (test_bit(MACHINE_REBOOT, &machine_state))
-               return;
-
-       wdt_gpio_state = !wdt_gpio_state;
-       gpio_set_value(0, wdt_gpio_state);
-}
-
-static void voiceblue_restart(enum reboot_mode mode, const char *cmd)
-{
-       /*
-        * Workaround for 5912/1611b bug mentioned in sprz209d.pdf p. 28
-        * "Global Software Reset Affects Traffic Controller Frequency".
-        */
-       if (cpu_is_omap5912()) {
-               omap_writew(omap_readw(DPLL_CTL) & ~(1 << 4), DPLL_CTL);
-               omap_writew(0x8, ARM_RSTCT1);
-       }
-
-       set_bit(MACHINE_REBOOT, &machine_state);
-       voiceblue_wdt_enable();
-       while (1) ;
-}
-
-EXPORT_SYMBOL(voiceblue_wdt_enable);
-EXPORT_SYMBOL(voiceblue_wdt_disable);
-EXPORT_SYMBOL(voiceblue_wdt_ping);
-
-static void __init voiceblue_init(void)
-{
-       /* mux pins for uarts */
-       omap_cfg_reg(UART1_TX);
-       omap_cfg_reg(UART1_RTS);
-       omap_cfg_reg(UART2_TX);
-       omap_cfg_reg(UART2_RTS);
-       omap_cfg_reg(UART3_TX);
-       omap_cfg_reg(UART3_RX);
-
-       /* Watchdog */
-       gpio_request(0, "Watchdog");
-       /* smc91x reset */
-       gpio_request(7, "SMC91x reset");
-       gpio_direction_output(7, 1);
-       udelay(2);      /* wait at least 100ns */
-       gpio_set_value(7, 0);
-       mdelay(50);     /* 50ms until PHY ready */
-       /* smc91x interrupt pin */
-       gpio_request(8, "SMC91x irq");
-       /* 16C554 reset*/
-       gpio_request(6, "16C554 reset");
-       gpio_direction_output(6, 0);
-       /* 16C554 interrupt pins */
-       gpio_request(12, "16C554 irq");
-       gpio_request(13, "16C554 irq");
-       gpio_request(14, "16C554 irq");
-       gpio_request(15, "16C554 irq");
-       irq_set_irq_type(gpio_to_irq(12), IRQ_TYPE_EDGE_RISING);
-       irq_set_irq_type(gpio_to_irq(13), IRQ_TYPE_EDGE_RISING);
-       irq_set_irq_type(gpio_to_irq(14), IRQ_TYPE_EDGE_RISING);
-       irq_set_irq_type(gpio_to_irq(15), IRQ_TYPE_EDGE_RISING);
-
-       voiceblue_smc91x_resources[1].start = gpio_to_irq(8);
-       voiceblue_smc91x_resources[1].end = gpio_to_irq(8);
-       platform_add_devices(voiceblue_devices, ARRAY_SIZE(voiceblue_devices));
-       omap_serial_init();
-       omap1_usb_init(&voiceblue_usb_config);
-       omap_register_i2c_bus(1, 100, NULL, 0);
-
-       /* There is a good chance board is going up, so enable power LED
-        * (it is connected through invertor) */
-       omap_writeb(0x00, OMAP_LPG1_LCR);
-       omap_writeb(0x00, OMAP_LPG1_PMR);       /* Disable clock */
-}
-
-MACHINE_START(VOICEBLUE, "VoiceBlue OMAP5910")
-       /* Maintainer: Ladislav Michl <michl@2n.cz> */
-       .atag_offset    = 0x100,
-       .map_io         = omap15xx_map_io,
-       .init_early     = omap1_init_early,
-       .init_irq       = omap1_init_irq,
-       .handle_irq     = omap1_handle_irq,
-       .init_machine   = voiceblue_init,
-       .init_late      = omap1_init_late,
-       .init_time      = omap1_timer_init,
-       .restart        = voiceblue_restart,
-MACHINE_END
diff --git a/arch/arm/mach-omap1/include/mach/board-voiceblue.h b/arch/arm/mach-omap1/include/mach/board-voiceblue.h
deleted file mode 100644 (file)
index 27916b2..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Copyright (C) 2004 2N Telekomunikace, Ladislav Michl <michl@2n.cz>
- *
- * Hardware definitions for OMAP5910 based VoiceBlue board.
- *
- * 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.
- */
-
-#ifndef __ASM_ARCH_VOICEBLUE_H
-#define __ASM_ARCH_VOICEBLUE_H
-
-extern void voiceblue_wdt_enable(void);
-extern void voiceblue_wdt_disable(void);
-extern void voiceblue_wdt_ping(void);
-
-#endif /*  __ASM_ARCH_VOICEBLUE_H */
-
index ddf912406ce8f271f1d77dee457a878c28eafee4..5076d3f334d28753e697b9e801b050c5807cadad 100644 (file)
@@ -97,6 +97,7 @@ config ARCH_OMAP2PLUS
        select PINCTRL
        select SOC_BUS
        select OMAP_IRQCHIP
+       select CLKSRC_TI_32K
        help
          Systems based on OMAP2, OMAP3, OMAP4 or OMAP5
 
index 935869698cbc45ca0b59d5d75ad326a175549c1d..ceefcee6bb85a7042ac0a3e4c077347ce93543a5 100644 (file)
@@ -48,11 +48,9 @@ AFLAGS_sleep44xx.o                   :=-Wa,-march=armv7-a$(plus_sec)
 # Functions loaded to SRAM
 obj-$(CONFIG_SOC_OMAP2420)             += sram242x.o
 obj-$(CONFIG_SOC_OMAP2430)             += sram243x.o
-obj-$(CONFIG_ARCH_OMAP3)               += sram34xx.o
 
 AFLAGS_sram242x.o                      :=-Wa,-march=armv6
 AFLAGS_sram243x.o                      :=-Wa,-march=armv6
-AFLAGS_sram34xx.o                      :=-Wa,-march=armv7-a
 
 # Restart code (OMAP4/5 currently in omap4-common.c)
 obj-$(CONFIG_SOC_OMAP2420)             += omap2-restart.o
@@ -186,7 +184,6 @@ obj-$(CONFIG_ARCH_OMAP2)            += clkt2xxx_dpllcore.o
 obj-$(CONFIG_ARCH_OMAP2)               += clkt2xxx_virt_prcm_set.o
 obj-$(CONFIG_ARCH_OMAP2)               += clkt2xxx_dpll.o
 obj-$(CONFIG_ARCH_OMAP3)               += $(clock-common)
-obj-$(CONFIG_ARCH_OMAP3)               += clkt34xx_dpll3m2.o
 obj-$(CONFIG_ARCH_OMAP4)               += $(clock-common)
 obj-$(CONFIG_SOC_AM33XX)               += $(clock-common)
 obj-$(CONFIG_SOC_OMAP5)                        += $(clock-common)
index fb219a30c10c60ff56f8b6c0ae754a861f886dc0..04a56cc04dfa48cfc8c9752033cff152e5f15dba 100644 (file)
@@ -46,7 +46,7 @@ DT_MACHINE_START(OMAP242X_DT, "Generic OMAP2420 (Flattened Device Tree)")
        .map_io         = omap242x_map_io,
        .init_early     = omap2420_init_early,
        .init_machine   = omap_generic_init,
-       .init_time      = omap2_sync32k_timer_init,
+       .init_time      = omap_init_time,
        .dt_compat      = omap242x_boards_compat,
        .restart        = omap2xxx_restart,
 MACHINE_END
@@ -63,7 +63,7 @@ DT_MACHINE_START(OMAP243X_DT, "Generic OMAP2430 (Flattened Device Tree)")
        .map_io         = omap243x_map_io,
        .init_early     = omap2430_init_early,
        .init_machine   = omap_generic_init,
-       .init_time      = omap2_sync32k_timer_init,
+       .init_time      = omap_init_time,
        .dt_compat      = omap243x_boards_compat,
        .restart        = omap2xxx_restart,
 MACHINE_END
@@ -82,7 +82,7 @@ DT_MACHINE_START(OMAP3_N900_DT, "Nokia RX-51 board")
        .init_early     = omap3430_init_early,
        .init_machine   = omap_generic_init,
        .init_late      = omap3_init_late,
-       .init_time      = omap3_sync32k_timer_init,
+       .init_time      = omap_init_time,
        .dt_compat      = n900_boards_compat,
        .restart        = omap3xxx_restart,
 MACHINE_END
@@ -100,7 +100,7 @@ DT_MACHINE_START(OMAP3_DT, "Generic OMAP3 (Flattened Device Tree)")
        .init_early     = omap3430_init_early,
        .init_machine   = omap_generic_init,
        .init_late      = omap3_init_late,
-       .init_time      = omap3_sync32k_timer_init,
+       .init_time      = omap_init_time,
        .dt_compat      = omap3_boards_compat,
        .restart        = omap3xxx_restart,
 MACHINE_END
@@ -117,7 +117,7 @@ DT_MACHINE_START(OMAP36XX_DT, "Generic OMAP36xx (Flattened Device Tree)")
        .init_early     = omap3630_init_early,
        .init_machine   = omap_generic_init,
        .init_late      = omap3_init_late,
-       .init_time      = omap3_sync32k_timer_init,
+       .init_time      = omap_init_time,
        .dt_compat      = omap36xx_boards_compat,
        .restart        = omap3xxx_restart,
 MACHINE_END
@@ -276,7 +276,7 @@ DT_MACHINE_START(AM43_DT, "Generic AM43 (Flattened Device Tree)")
        .init_late      = am43xx_init_late,
        .init_irq       = omap_gic_of_init,
        .init_machine   = omap_generic_init,
-       .init_time      = omap3_gptimer_timer_init,
+       .init_time      = omap4_local_timer_init,
        .dt_compat      = am43_boards_compat,
        .restart        = omap44xx_restart,
 MACHINE_END
index c2975af4cd5dee360e37fa886d3188314e347af3..d9c3ffc393291ea6da82dc4886e5ca5e2efb4db8 100644 (file)
@@ -424,6 +424,6 @@ MACHINE_START(OMAP_LDP, "OMAP LDP board")
        .init_irq       = omap3_init_irq,
        .init_machine   = omap_ldp_init,
        .init_late      = omap3430_init_late,
-       .init_time      = omap3_sync32k_timer_init,
+       .init_time      = omap_init_time,
        .restart        = omap3xxx_restart,
 MACHINE_END
index 2d1e5a6beb855d47e4366df52876c667497c6c0b..41161ca97d74b23f1cf6b68466dabde6a8c90569 100644 (file)
@@ -136,6 +136,6 @@ MACHINE_START(NOKIA_RX51, "Nokia RX-51 board")
        .init_irq       = omap3_init_irq,
        .init_machine   = rx51_init,
        .init_late      = omap3430_init_late,
-       .init_time      = omap3_sync32k_timer_init,
+       .init_time      = omap_init_time,
        .restart        = omap3xxx_restart,
 MACHINE_END
diff --git a/arch/arm/mach-omap2/clkt34xx_dpll3m2.c b/arch/arm/mach-omap2/clkt34xx_dpll3m2.c
deleted file mode 100644 (file)
index 3f65213..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * OMAP34xx M2 divider clock code
- *
- * Copyright (C) 2007-2008 Texas Instruments, Inc.
- * Copyright (C) 2007-2010 Nokia Corporation
- *
- * Paul Walmsley
- * Jouni Högander
- *
- * Parts of this code are based on code written by
- * Richard Woodruff, Tony Lindgren, Tuukka Tikkanen, Karthik Dasu
- *
- * 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.
- */
-#undef DEBUG
-
-#include <linux/kernel.h>
-#include <linux/errno.h>
-#include <linux/clk.h>
-#include <linux/io.h>
-
-#include "clock.h"
-#include "clock3xxx.h"
-#include "sdrc.h"
-#include "sram.h"
-
-#define CYCLES_PER_MHZ                 1000000
-
-struct clk *sdrc_ick_p, *arm_fck_p;
-
-/*
- * CORE DPLL (DPLL3) M2 divider rate programming functions
- *
- * These call into SRAM code to do the actual CM writes, since the SDRAM
- * is clocked from DPLL3.
- */
-
-/**
- * omap3_core_dpll_m2_set_rate - set CORE DPLL M2 divider
- * @clk: struct clk * of DPLL to set
- * @rate: rounded target rate
- *
- * Program the DPLL M2 divider with the rounded target rate.  Returns
- * -EINVAL upon error, or 0 upon success.
- */
-int omap3_core_dpll_m2_set_rate(struct clk_hw *hw, unsigned long rate,
-                                       unsigned long parent_rate)
-{
-       struct clk_hw_omap *clk = to_clk_hw_omap(hw);
-       u32 new_div = 0;
-       u32 unlock_dll = 0;
-       u32 c;
-       unsigned long validrate, sdrcrate, _mpurate;
-       struct omap_sdrc_params *sdrc_cs0;
-       struct omap_sdrc_params *sdrc_cs1;
-       int ret;
-       unsigned long clkrate;
-
-       if (!clk || !rate)
-               return -EINVAL;
-
-       new_div = DIV_ROUND_UP(parent_rate, rate);
-       validrate = parent_rate / new_div;
-
-       if (validrate != rate)
-               return -EINVAL;
-
-       sdrcrate = clk_get_rate(sdrc_ick_p);
-       clkrate = clk_hw_get_rate(hw);
-       if (rate > clkrate)
-               sdrcrate <<= ((rate / clkrate) >> 1);
-       else
-               sdrcrate >>= ((clkrate / rate) >> 1);
-
-       ret = omap2_sdrc_get_params(sdrcrate, &sdrc_cs0, &sdrc_cs1);
-       if (ret)
-               return -EINVAL;
-
-       if (sdrcrate < MIN_SDRC_DLL_LOCK_FREQ) {
-               pr_debug("clock: will unlock SDRC DLL\n");
-               unlock_dll = 1;
-       }
-
-       /*
-        * XXX This only needs to be done when the CPU frequency changes
-        */
-       _mpurate = clk_get_rate(arm_fck_p) / CYCLES_PER_MHZ;
-       c = (_mpurate << SDRC_MPURATE_SCALE) >> SDRC_MPURATE_BASE_SHIFT;
-       c += 1;  /* for safety */
-       c *= SDRC_MPURATE_LOOPS;
-       c >>= SDRC_MPURATE_SCALE;
-       if (c == 0)
-               c = 1;
-
-       pr_debug("clock: changing CORE DPLL rate from %lu to %lu\n",
-                clkrate, validrate);
-       pr_debug("clock: SDRC CS0 timing params used: RFR %08x CTRLA %08x CTRLB %08x MR %08x\n",
-                sdrc_cs0->rfr_ctrl, sdrc_cs0->actim_ctrla,
-                sdrc_cs0->actim_ctrlb, sdrc_cs0->mr);
-       if (sdrc_cs1)
-               pr_debug("clock: SDRC CS1 timing params used: RFR %08x CTRLA %08x CTRLB %08x MR %08x\n",
-                        sdrc_cs1->rfr_ctrl, sdrc_cs1->actim_ctrla,
-                        sdrc_cs1->actim_ctrlb, sdrc_cs1->mr);
-
-       if (sdrc_cs1)
-               omap3_configure_core_dpll(
-                                 new_div, unlock_dll, c, rate > clkrate,
-                                 sdrc_cs0->rfr_ctrl, sdrc_cs0->actim_ctrla,
-                                 sdrc_cs0->actim_ctrlb, sdrc_cs0->mr,
-                                 sdrc_cs1->rfr_ctrl, sdrc_cs1->actim_ctrla,
-                                 sdrc_cs1->actim_ctrlb, sdrc_cs1->mr);
-       else
-               omap3_configure_core_dpll(
-                                 new_div, unlock_dll, c, rate > clkrate,
-                                 sdrc_cs0->rfr_ctrl, sdrc_cs0->actim_ctrla,
-                                 sdrc_cs0->actim_ctrlb, sdrc_cs0->mr,
-                                 0, 0, 0, 0);
-       return 0;
-}
-
index 92e92cfc2775f4840bb793edeb60267c1f2e793f..0cba9575d2cac3c0a658d0b6fc40edbd4ea50dcd 100644 (file)
@@ -88,8 +88,7 @@ static inline int omap_mux_late_init(void)
 
 extern void omap2_init_common_infrastructure(void);
 
-extern void omap2_sync32k_timer_init(void);
-extern void omap3_sync32k_timer_init(void);
+extern void omap_init_time(void);
 extern void omap3_secure_sync32k_timer_init(void);
 extern void omap3_gptimer_timer_init(void);
 extern void omap4_local_timer_init(void);
index a69bd67e9028030372309ee6c80d2265493c4967..9374da313e8e3ddd86b8b3dcc10ce7d368795fa5 100644 (file)
@@ -33,7 +33,6 @@
 #include "common.h"
 #include "mux.h"
 #include "control.h"
-#include "devices.h"
 #include "display.h"
 
 #define L3_MODULES_MAX_LEN 12
@@ -67,58 +66,6 @@ static int __init omap3_l3_init(void)
 }
 omap_postcore_initcall(omap3_l3_init);
 
-#if defined(CONFIG_IOMMU_API)
-
-#include <linux/platform_data/iommu-omap.h>
-
-static struct resource omap3isp_resources[] = {
-       {
-               .start          = OMAP3430_ISP_BASE,
-               .end            = OMAP3430_ISP_BASE + 0x12fc,
-               .flags          = IORESOURCE_MEM,
-       },
-       {
-               .start          = OMAP3430_ISP_BASE2,
-               .end            = OMAP3430_ISP_BASE2 + 0x0600,
-               .flags          = IORESOURCE_MEM,
-       },
-       {
-               .start          = 24 + OMAP_INTC_START,
-               .flags          = IORESOURCE_IRQ,
-       }
-};
-
-static struct platform_device omap3isp_device = {
-       .name           = "omap3isp",
-       .id             = -1,
-       .num_resources  = ARRAY_SIZE(omap3isp_resources),
-       .resource       = omap3isp_resources,
-};
-
-static struct omap_iommu_arch_data omap3_isp_iommu = {
-       .name = "mmu_isp",
-};
-
-int omap3_init_camera(struct isp_platform_data *pdata)
-{
-       if (of_have_populated_dt())
-               omap3_isp_iommu.name = "480bd400.mmu";
-
-       omap3isp_device.dev.platform_data = pdata;
-       omap3isp_device.dev.archdata.iommu = &omap3_isp_iommu;
-
-       return platform_device_register(&omap3isp_device);
-}
-
-#else /* !CONFIG_IOMMU_API */
-
-int omap3_init_camera(struct isp_platform_data *pdata)
-{
-       return 0;
-}
-
-#endif
-
 #if defined(CONFIG_OMAP2PLUS_MBOX) || defined(CONFIG_OMAP2PLUS_MBOX_MODULE)
 static inline void __init omap_init_mbox(void)
 {
diff --git a/arch/arm/mach-omap2/devices.h b/arch/arm/mach-omap2/devices.h
deleted file mode 100644 (file)
index f61eb6e..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * arch/arm/mach-omap2/devices.h
- *
- * OMAP2 platform device setup/initialization
- *
- * 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; either version 2 of the License, or
- * (at your option) any later version.
- */
-
-#ifndef __ARCH_ARM_MACH_OMAP_DEVICES_H
-#define __ARCH_ARM_MACH_OMAP_DEVICES_H
-
-struct isp_platform_data;
-
-int omap3_init_camera(struct isp_platform_data *pdata);
-
-#endif
index 54a5ba54d2ffaea58cef114db9950d643ae17d77..8a2ae82cb2271c3d99fe08ef2da917c3e7967f66 100644 (file)
@@ -57,15 +57,15 @@ int omap_type(void)
        if (val < OMAP2_DEVICETYPE_MASK)
                return val;
 
-       if (cpu_is_omap24xx()) {
+       if (soc_is_omap24xx()) {
                val = omap_ctrl_readl(OMAP24XX_CONTROL_STATUS);
-       } else if (cpu_is_ti81xx()) {
+       } else if (soc_is_ti81xx()) {
                val = omap_ctrl_readl(TI81XX_CONTROL_STATUS);
        } else if (soc_is_am33xx() || soc_is_am43xx()) {
                val = omap_ctrl_readl(AM33XX_CONTROL_STATUS);
-       } else if (cpu_is_omap34xx()) {
+       } else if (soc_is_omap34xx()) {
                val = omap_ctrl_readl(OMAP343X_CONTROL_STATUS);
-       } else if (cpu_is_omap44xx()) {
+       } else if (soc_is_omap44xx()) {
                val = omap_ctrl_readl(OMAP4_CTRL_MODULE_CORE_STATUS);
        } else if (soc_is_omap54xx() || soc_is_dra7xx()) {
                val = omap_ctrl_readl(OMAP5XXX_CONTROL_STATUS);
@@ -122,7 +122,7 @@ static u16 tap_prod_id;
 
 void omap_get_die_id(struct omap_die_id *odi)
 {
-       if (cpu_is_omap44xx() || soc_is_omap54xx() || soc_is_dra7xx()) {
+       if (soc_is_omap44xx() || soc_is_omap54xx() || soc_is_dra7xx()) {
                odi->id_0 = read_tap_reg(OMAP_TAP_DIE_ID_44XX_0);
                odi->id_1 = read_tap_reg(OMAP_TAP_DIE_ID_44XX_1);
                odi->id_2 = read_tap_reg(OMAP_TAP_DIE_ID_44XX_2);
@@ -218,17 +218,17 @@ static void __init omap3_cpuinfo(void)
         * on available features. Upon detection, update the CPU id
         * and CPU class bits.
         */
-       if (cpu_is_omap3630()) {
+       if (soc_is_omap3630()) {
                cpu_name = "OMAP3630";
        } else if (soc_is_am35xx()) {
                cpu_name = (omap3_has_sgx()) ? "AM3517" : "AM3505";
-       } else if (cpu_is_ti816x()) {
+       } else if (soc_is_ti816x()) {
                cpu_name = "TI816X";
        } else if (soc_is_am335x()) {
                cpu_name =  "AM335X";
        } else if (soc_is_am437x()) {
                cpu_name =  "AM437x";
-       } else if (cpu_is_ti814x()) {
+       } else if (soc_is_ti814x()) {
                cpu_name = "TI814X";
        } else if (omap3_has_iva() && omap3_has_sgx()) {
                /* OMAP3430, OMAP3525, OMAP3515, OMAP3503 devices */
@@ -275,11 +275,11 @@ void __init omap3xxx_check_features(void)
        OMAP3_CHECK_FEATURE(status, SGX);
        OMAP3_CHECK_FEATURE(status, NEON);
        OMAP3_CHECK_FEATURE(status, ISP);
-       if (cpu_is_omap3630())
+       if (soc_is_omap3630())
                omap_features |= OMAP3_HAS_192MHZ_CLK;
-       if (cpu_is_omap3430() || cpu_is_omap3630())
+       if (soc_is_omap3430() || soc_is_omap3630())
                omap_features |= OMAP3_HAS_IO_WAKEUP;
-       if (cpu_is_omap3630() || omap_rev() == OMAP3430_REV_ES3_1 ||
+       if (soc_is_omap3630() || omap_rev() == OMAP3430_REV_ES3_1 ||
            omap_rev() == OMAP3430_REV_ES3_1_2)
                omap_features |= OMAP3_HAS_IO_CHAIN_CTRL;
 
@@ -701,7 +701,7 @@ void __init omap2_set_globals_tap(u32 class, void __iomem *tap)
        tap_base = tap;
 
        /* XXX What is this intended to do? */
-       if (cpu_is_omap34xx())
+       if (soc_is_omap34xx())
                tap_prod_id = 0x0210;
        else
                tap_prod_id = 0x0208;
@@ -719,11 +719,11 @@ static const char * const omap_types[] = {
 
 static const char * __init omap_get_family(void)
 {
-       if (cpu_is_omap24xx())
+       if (soc_is_omap24xx())
                return kasprintf(GFP_KERNEL, "OMAP2");
-       else if (cpu_is_omap34xx())
+       else if (soc_is_omap34xx())
                return kasprintf(GFP_KERNEL, "OMAP3");
-       else if (cpu_is_omap44xx())
+       else if (soc_is_omap44xx())
                return kasprintf(GFP_KERNEL, "OMAP4");
        else if (soc_is_omap54xx())
                return kasprintf(GFP_KERNEL, "OMAP5");
index 971791fe9a3f2f684c81ca4ccdecde5e6eec93ed..593fec753b282a40b54bedb6d26c53131b78a83c 100644 (file)
@@ -27,7 +27,7 @@
  * platform-specific code to shutdown a CPU
  * Called with IRQs disabled
  */
-void __ref omap4_cpu_die(unsigned int cpu)
+void omap4_cpu_die(unsigned int cpu)
 {
        unsigned int boot_cpu = 0;
        void __iomem *base = omap_get_wakeupgen_base();
index db7e0bab3587cb975ea1ecb5c89e10956fcc7214..f397bd6bd6e30149c525e270853701a916500e96 100644 (file)
@@ -20,6 +20,7 @@
 #include <linux/init.h>
 #include <linux/io.h>
 #include <linux/irq.h>
+#include <linux/irqchip.h>
 #include <linux/irqdomain.h>
 #include <linux/of_address.h>
 #include <linux/platform_device.h>
@@ -330,7 +331,7 @@ static int irq_cpu_hotplug_notify(struct notifier_block *self,
        return NOTIFY_OK;
 }
 
-static struct notifier_block __refdata irq_hotplug_notifier = {
+static struct notifier_block irq_hotplug_notifier = {
        .notifier_call = irq_cpu_hotplug_notify,
 };
 
@@ -540,9 +541,4 @@ static int __init wakeupgen_init(struct device_node *node,
 
        return 0;
 }
-
-/*
- * We cannot use the IRQCHIP_DECLARE macro that lives in
- * drivers/irqchip, so we're forced to roll our own. Not very nice.
- */
-OF_DECLARE_2(irqchip, ti_wakeupgen, "ti,omap4-wugen-mpu", wakeupgen_init);
+IRQCHIP_DECLARE(ti_wakeupgen, "ti,omap4-wugen-mpu", wakeupgen_init);
index 8f5989d48a801306224f94ad73dcf21345e4b84b..1c210cb2b8c1ec1ce956b0946027fe9b6dc6607c 100644 (file)
@@ -152,20 +152,10 @@ struct omap_hwmod_ocp_if am33xx_cpgmac0__mdio = {
        .user           = OCP_USER_MPU,
 };
 
-static struct omap_hwmod_addr_space am33xx_elm_addr_space[] = {
-       {
-               .pa_start       = 0x48080000,
-               .pa_end         = 0x48080000 + SZ_8K - 1,
-               .flags          = ADDR_TYPE_RT
-       },
-       { }
-};
-
 struct omap_hwmod_ocp_if am33xx_l4_ls__elm = {
        .master         = &am33xx_l4_ls_hwmod,
        .slave          = &am33xx_elm_hwmod,
        .clk            = "l4ls_gclk",
-       .addr           = am33xx_elm_addr_space,
        .user           = OCP_USER_MPU,
 };
 
@@ -285,20 +275,10 @@ struct omap_hwmod_ocp_if am33xx_epwmss2__ehrpwm2 = {
 };
 
 /* l3s cfg -> gpmc */
-static struct omap_hwmod_addr_space am33xx_gpmc_addr_space[] = {
-       {
-               .pa_start       = 0x50000000,
-               .pa_end         = 0x50000000 + SZ_8K - 1,
-               .flags          = ADDR_TYPE_RT,
-       },
-       { }
-};
-
 struct omap_hwmod_ocp_if am33xx_l3_s__gpmc = {
        .master         = &am33xx_l3_s_hwmod,
        .slave          = &am33xx_gpmc_hwmod,
        .clk            = "l3s_gclk",
-       .addr           = am33xx_gpmc_addr_space,
        .user           = OCP_USER_MPU,
 };
 
index dc55f8dedf2c6bb597bddd858d9acd960398fceb..aff78d5198d21cad56f0986814ea161485374de3 100644 (file)
@@ -26,7 +26,6 @@
 #include <linux/platform_data/asoc-ti-mcbsp.h>
 #include <linux/platform_data/spi-omap2-mcspi.h>
 #include <linux/platform_data/iommu-omap.h>
-#include <linux/platform_data/mailbox-omap.h>
 #include <plat/dmtimer.h>
 
 #include "soc.h"
@@ -1506,26 +1505,9 @@ static struct omap_hwmod_class omap3xxx_mailbox_hwmod_class = {
        .sysc = &omap3xxx_mailbox_sysc,
 };
 
-static struct omap_mbox_dev_info omap3xxx_mailbox_info[] = {
-       { .name = "dsp", .tx_id = 0, .rx_id = 1 },
-};
-
-static struct omap_mbox_pdata omap3xxx_mailbox_attrs = {
-       .num_users      = 2,
-       .num_fifos      = 2,
-       .info_cnt       = ARRAY_SIZE(omap3xxx_mailbox_info),
-       .info           = omap3xxx_mailbox_info,
-};
-
-static struct omap_hwmod_irq_info omap3xxx_mailbox_irqs[] = {
-       { .irq = 26 + OMAP_INTC_START, },
-       { .irq = -1 },
-};
-
 static struct omap_hwmod omap3xxx_mailbox_hwmod = {
        .name           = "mailbox",
        .class          = &omap3xxx_mailbox_hwmod_class,
-       .mpu_irqs       = omap3xxx_mailbox_irqs,
        .main_clk       = "mailboxes_ick",
        .prcm           = {
                .omap2 = {
@@ -1536,7 +1518,6 @@ static struct omap_hwmod omap3xxx_mailbox_hwmod = {
                        .idlest_idle_bit = OMAP3430_ST_MAILBOXES_SHIFT,
                },
        },
-       .dev_attr       = &omap3xxx_mailbox_attrs,
 };
 
 /*
@@ -3276,20 +3257,10 @@ static struct omap_hwmod_ocp_if omap3xxx_l4_per__mcbsp3_sidetone = {
        .user           = OCP_USER_MPU,
 };
 
-static struct omap_hwmod_addr_space omap3xxx_mailbox_addrs[] = {
-       {
-               .pa_start       = 0x48094000,
-               .pa_end         = 0x480941ff,
-               .flags          = ADDR_TYPE_RT,
-       },
-       { }
-};
-
 /* l4_core -> mailbox */
 static struct omap_hwmod_ocp_if omap3xxx_l4_core__mailbox = {
        .master         = &omap3xxx_l4_core_hwmod,
        .slave          = &omap3xxx_mailbox_hwmod,
-       .addr           = omap3xxx_mailbox_addrs,
        .user           = OCP_USER_MPU | OCP_USER_SDMA,
 };
 
index 43eebf2c59e2f71a375cdbc5d3dbf227f7b99378..a5e444b1e57a250ce14ce31ff96ed6d7c2bbd0ae 100644 (file)
@@ -4471,21 +4471,11 @@ static struct omap_hwmod_ocp_if omap44xx_l4_cfg__smartreflex_mpu = {
        .user           = OCP_USER_MPU | OCP_USER_SDMA,
 };
 
-static struct omap_hwmod_addr_space omap44xx_spinlock_addrs[] = {
-       {
-               .pa_start       = 0x4a0f6000,
-               .pa_end         = 0x4a0f6fff,
-               .flags          = ADDR_TYPE_RT
-       },
-       { }
-};
-
 /* l4_cfg -> spinlock */
 static struct omap_hwmod_ocp_if omap44xx_l4_cfg__spinlock = {
        .master         = &omap44xx_l4_cfg_hwmod,
        .slave          = &omap44xx_spinlock_hwmod,
        .clk            = "l4_div_ck",
-       .addr           = omap44xx_spinlock_addrs,
        .user           = OCP_USER_MPU | OCP_USER_SDMA,
 };
 
index 7c3fac035e936884febd606bcb9d0218428fd91c..8cdfd9b7ab4f9ac33a9759ff5c491b19418c95a9 100644 (file)
@@ -1844,8 +1844,7 @@ static struct omap_hwmod_class_sysconfig omap54xx_usb_host_hs_sysc = {
        .rev_offs       = 0x0000,
        .sysc_offs      = 0x0010,
        .sysc_flags     = (SYSC_HAS_MIDLEMODE | SYSC_HAS_RESET_STATUS |
-                          SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET |
-                          SYSC_HAS_RESET_STATUS),
+                          SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET),
        .idlemodes      = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
                           SIDLE_SMART_WKUP | MSTANDBY_FORCE | MSTANDBY_NO |
                           MSTANDBY_SMART | MSTANDBY_SMART_WKUP),
index 562247bced496bc085f75cb65f5061f8ec2be6c1..51d1ecb384bdddb95c1996258de93ee9ba9b85ec 100644 (file)
@@ -2566,21 +2566,11 @@ static struct omap_hwmod_ocp_if dra7xx_l3_main_1__hdmi = {
        .user           = OCP_USER_MPU | OCP_USER_SDMA,
 };
 
-static struct omap_hwmod_addr_space dra7xx_elm_addrs[] = {
-       {
-               .pa_start       = 0x48078000,
-               .pa_end         = 0x48078fff,
-               .flags          = ADDR_TYPE_RT
-       },
-       { }
-};
-
 /* l4_per1 -> elm */
 static struct omap_hwmod_ocp_if dra7xx_l4_per1__elm = {
        .master         = &dra7xx_l4_per1_hwmod,
        .slave          = &dra7xx_elm_hwmod,
        .clk            = "l3_iclk_div",
-       .addr           = dra7xx_elm_addrs,
        .user           = OCP_USER_MPU | OCP_USER_SDMA,
 };
 
@@ -2648,21 +2638,11 @@ static struct omap_hwmod_ocp_if dra7xx_l4_per1__gpio8 = {
        .user           = OCP_USER_MPU | OCP_USER_SDMA,
 };
 
-static struct omap_hwmod_addr_space dra7xx_gpmc_addrs[] = {
-       {
-               .pa_start       = 0x50000000,
-               .pa_end         = 0x500003ff,
-               .flags          = ADDR_TYPE_RT
-       },
-       { }
-};
-
 /* l3_main_1 -> gpmc */
 static struct omap_hwmod_ocp_if dra7xx_l3_main_1__gpmc = {
        .master         = &dra7xx_l3_main_1_hwmod,
        .slave          = &dra7xx_gpmc_hwmod,
        .clk            = "l3_iclk_div",
-       .addr           = dra7xx_gpmc_addrs,
        .user           = OCP_USER_MPU | OCP_USER_SDMA,
 };
 
@@ -3029,21 +3009,11 @@ static struct omap_hwmod_ocp_if dra7xx_l4_cfg__smartreflex_mpu = {
        .user           = OCP_USER_MPU | OCP_USER_SDMA,
 };
 
-static struct omap_hwmod_addr_space dra7xx_spinlock_addrs[] = {
-       {
-               .pa_start       = 0x4a0f6000,
-               .pa_end         = 0x4a0f6fff,
-               .flags          = ADDR_TYPE_RT
-       },
-       { }
-};
-
 /* l4_cfg -> spinlock */
 static struct omap_hwmod_ocp_if dra7xx_l4_cfg__spinlock = {
        .master         = &dra7xx_l4_cfg_hwmod,
        .slave          = &dra7xx_spinlock_hwmod,
        .clk            = "l3_iclk_div",
-       .addr           = dra7xx_spinlock_addrs,
        .user           = OCP_USER_MPU | OCP_USER_SDMA,
 };
 
index d697cecf762b4501b8c3849d2bece4b25ab86967..178e22c146b7acc786ef9c32cae01ca6cdd480b9 100644 (file)
@@ -210,7 +210,7 @@ static inline int omap4plus_init_static_deps(const struct static_dep_map *map)
                }
 
                map++;
-       };
+       }
 
        return 0;
 }
index d31c495175c1aa3daaff7da2f65b8ac3075b6232..2e00c7f1f4714a822329e6e4a7e8335223c83970 100644 (file)
@@ -582,7 +582,7 @@ void __init omap3xxx_powerdomains_init(void)
 
        /* Only 81xx needs custom pwrdm_operations */
        if (!cpu_is_ti81xx())
-               pwrdm_register_platform_funcs(&omap3_pwrdm_operations);;
+               pwrdm_register_platform_funcs(&omap3_pwrdm_operations);
 
        rev = omap_rev();
 
index 2d1d3845253c33493f2a3f66edf05db136c03a65..79ca3c3eb2afe86c6250f5a7be74b6aef694d3cf 100644 (file)
@@ -129,9 +129,9 @@ int omap_type(void);
 
 /*
  * omap_rev bits:
- * CPU id bits (0730, 1510, 1710, 2422...)     [31:16]
- * CPU revision        (See _REV_ defined in cpu.h)    [15:08]
- * CPU class bits (15xx, 16xx, 24xx, 34xx...)  [07:00]
+ * SoC id bits (0730, 1510, 1710, 2422...)     [31:16]
+ * SoC revision        (See _REV_ defined in cpu.h)    [15:08]
+ * SoC class bits (15xx, 16xx, 24xx, 34xx...)  [07:00]
  */
 unsigned int omap_rev(void);
 
@@ -141,20 +141,20 @@ static inline int soc_is_omap(void)
 }
 
 /*
- * Get the CPU revision for OMAP devices
+ * Get the SoC revision for OMAP devices
  */
 #define GET_OMAP_REVISION()    ((omap_rev() >> 8) & 0xff)
 
 /*
  * Macros to group OMAP into cpu classes.
  * These can be used in most places.
- * cpu_is_omap24xx():  True for OMAP2420, OMAP2422, OMAP2423, OMAP2430
- * cpu_is_omap242x():  True for OMAP2420, OMAP2422, OMAP2423
- * cpu_is_omap243x():  True for OMAP2430
- * cpu_is_omap343x():  True for OMAP3430
- * cpu_is_omap443x():  True for OMAP4430
- * cpu_is_omap446x():  True for OMAP4460
- * cpu_is_omap447x():  True for OMAP4470
+ * soc_is_omap24xx():  True for OMAP2420, OMAP2422, OMAP2423, OMAP2430
+ * soc_is_omap242x():  True for OMAP2420, OMAP2422, OMAP2423
+ * soc_is_omap243x():  True for OMAP2430
+ * soc_is_omap343x():  True for OMAP3430
+ * soc_is_omap443x():  True for OMAP4430
+ * soc_is_omap446x():  True for OMAP4460
+ * soc_is_omap447x():  True for OMAP4470
  * soc_is_omap543x():  True for OMAP5430, OMAP5432
  */
 #define GET_OMAP_CLASS (omap_rev() & 0xff)
@@ -225,23 +225,23 @@ IS_TI_SUBCLASS(814x, 0x814)
 IS_AM_SUBCLASS(335x, 0x335)
 IS_AM_SUBCLASS(437x, 0x437)
 
-#define cpu_is_omap24xx()              0
-#define cpu_is_omap242x()              0
-#define cpu_is_omap243x()              0
-#define cpu_is_omap34xx()              0
-#define cpu_is_omap343x()              0
-#define cpu_is_ti81xx()                        0
-#define cpu_is_ti816x()                        0
-#define cpu_is_ti814x()                        0
+#define soc_is_omap24xx()              0
+#define soc_is_omap242x()              0
+#define soc_is_omap243x()              0
+#define soc_is_omap34xx()              0
+#define soc_is_omap343x()              0
+#define soc_is_ti81xx()                        0
+#define soc_is_ti816x()                        0
+#define soc_is_ti814x()                        0
 #define soc_is_am35xx()                        0
 #define soc_is_am33xx()                        0
 #define soc_is_am335x()                        0
 #define soc_is_am43xx()                        0
 #define soc_is_am437x()                        0
-#define cpu_is_omap44xx()              0
-#define cpu_is_omap443x()              0
-#define cpu_is_omap446x()              0
-#define cpu_is_omap447x()              0
+#define soc_is_omap44xx()              0
+#define soc_is_omap443x()              0
+#define soc_is_omap446x()              0
+#define soc_is_omap447x()              0
 #define soc_is_omap54xx()              0
 #define soc_is_omap543x()              0
 #define soc_is_dra7xx()                        0
@@ -250,54 +250,54 @@ IS_AM_SUBCLASS(437x, 0x437)
 
 #if defined(MULTI_OMAP2)
 # if defined(CONFIG_ARCH_OMAP2)
-#  undef  cpu_is_omap24xx
-#  define cpu_is_omap24xx()            is_omap24xx()
+#  undef  soc_is_omap24xx
+#  define soc_is_omap24xx()            is_omap24xx()
 # endif
 # if defined (CONFIG_SOC_OMAP2420)
-#  undef  cpu_is_omap242x
-#  define cpu_is_omap242x()            is_omap242x()
+#  undef  soc_is_omap242x
+#  define soc_is_omap242x()            is_omap242x()
 # endif
 # if defined (CONFIG_SOC_OMAP2430)
-#  undef  cpu_is_omap243x
-#  define cpu_is_omap243x()            is_omap243x()
+#  undef  soc_is_omap243x
+#  define soc_is_omap243x()            is_omap243x()
 # endif
 # if defined(CONFIG_ARCH_OMAP3)
-#  undef  cpu_is_omap34xx
-#  undef  cpu_is_omap343x
-#  define cpu_is_omap34xx()            is_omap34xx()
-#  define cpu_is_omap343x()            is_omap343x()
+#  undef  soc_is_omap34xx
+#  undef  soc_is_omap343x
+#  define soc_is_omap34xx()            is_omap34xx()
+#  define soc_is_omap343x()            is_omap343x()
 # endif
 #else
 # if defined(CONFIG_ARCH_OMAP2)
-#  undef  cpu_is_omap24xx
-#  define cpu_is_omap24xx()            1
+#  undef  soc_is_omap24xx
+#  define soc_is_omap24xx()            1
 # endif
 # if defined(CONFIG_SOC_OMAP2420)
-#  undef  cpu_is_omap242x
-#  define cpu_is_omap242x()            1
+#  undef  soc_is_omap242x
+#  define soc_is_omap242x()            1
 # endif
 # if defined(CONFIG_SOC_OMAP2430)
-#  undef  cpu_is_omap243x
-#  define cpu_is_omap243x()            1
+#  undef  soc_is_omap243x
+#  define soc_is_omap243x()            1
 # endif
 # if defined(CONFIG_ARCH_OMAP3)
-#  undef  cpu_is_omap34xx
-#  define cpu_is_omap34xx()            1
+#  undef  soc_is_omap34xx
+#  define soc_is_omap34xx()            1
 # endif
 # if defined(CONFIG_SOC_OMAP3430)
-#  undef  cpu_is_omap343x
-#  define cpu_is_omap343x()            1
+#  undef  soc_is_omap343x
+#  define soc_is_omap343x()            1
 # endif
 #endif
 
 /*
  * Macros to detect individual cpu types.
  * These are only rarely needed.
- * cpu_is_omap2420():  True for OMAP2420
- * cpu_is_omap2422():  True for OMAP2422
- * cpu_is_omap2423():  True for OMAP2423
- * cpu_is_omap2430():  True for OMAP2430
- * cpu_is_omap3430():  True for OMAP3430
+ * soc_is_omap2420():  True for OMAP2420
+ * soc_is_omap2422():  True for OMAP2422
+ * soc_is_omap2423():  True for OMAP2423
+ * soc_is_omap2430():  True for OMAP2430
+ * soc_is_omap3430():  True for OMAP3430
  */
 #define GET_OMAP_TYPE  ((omap_rev() >> 16) & 0xffff)
 
@@ -313,51 +313,51 @@ IS_OMAP_TYPE(2423, 0x2423)
 IS_OMAP_TYPE(2430, 0x2430)
 IS_OMAP_TYPE(3430, 0x3430)
 
-#define cpu_is_omap2420()              0
-#define cpu_is_omap2422()              0
-#define cpu_is_omap2423()              0
-#define cpu_is_omap2430()              0
-#define cpu_is_omap3430()              0
-#define cpu_is_omap3630()              0
+#define soc_is_omap2420()              0
+#define soc_is_omap2422()              0
+#define soc_is_omap2423()              0
+#define soc_is_omap2430()              0
+#define soc_is_omap3430()              0
+#define soc_is_omap3630()              0
 #define soc_is_omap5430()              0
 
 /* These are needed for the common code */
 #ifdef CONFIG_ARCH_OMAP2PLUS
-#define cpu_is_omap7xx()               0
-#define cpu_is_omap15xx()              0
-#define cpu_is_omap16xx()              0
-#define cpu_is_omap1510()              0
-#define cpu_is_omap1610()              0
-#define cpu_is_omap1611()              0
-#define cpu_is_omap1621()              0
-#define cpu_is_omap1710()              0
+#define soc_is_omap7xx()               0
+#define soc_is_omap15xx()              0
+#define soc_is_omap16xx()              0
+#define soc_is_omap1510()              0
+#define soc_is_omap1610()              0
+#define soc_is_omap1611()              0
+#define soc_is_omap1621()              0
+#define soc_is_omap1710()              0
 #define cpu_class_is_omap1()           0
 #define cpu_class_is_omap2()           1
 #endif
 
 #if defined(CONFIG_ARCH_OMAP2)
-# undef  cpu_is_omap2420
-# undef  cpu_is_omap2422
-# undef  cpu_is_omap2423
-# undef  cpu_is_omap2430
-# define cpu_is_omap2420()             is_omap2420()
-# define cpu_is_omap2422()             is_omap2422()
-# define cpu_is_omap2423()             is_omap2423()
-# define cpu_is_omap2430()             is_omap2430()
+# undef  soc_is_omap2420
+# undef  soc_is_omap2422
+# undef  soc_is_omap2423
+# undef  soc_is_omap2430
+# define soc_is_omap2420()             is_omap2420()
+# define soc_is_omap2422()             is_omap2422()
+# define soc_is_omap2423()             is_omap2423()
+# define soc_is_omap2430()             is_omap2430()
 #endif
 
 #if defined(CONFIG_ARCH_OMAP3)
-# undef cpu_is_omap3430
-# undef cpu_is_ti81xx
-# undef cpu_is_ti816x
-# undef cpu_is_ti814x
+# undef soc_is_omap3430
+# undef soc_is_ti81xx
+# undef soc_is_ti816x
+# undef soc_is_ti814x
 # undef soc_is_am35xx
-# define cpu_is_omap3430()             is_omap3430()
-# undef cpu_is_omap3630
-# define cpu_is_omap3630()             is_omap363x()
-# define cpu_is_ti81xx()               is_ti81xx()
-# define cpu_is_ti816x()               is_ti816x()
-# define cpu_is_ti814x()               is_ti814x()
+# define soc_is_omap3430()             is_omap3430()
+# undef soc_is_omap3630
+# define soc_is_omap3630()             is_omap363x()
+# define soc_is_ti81xx()               is_ti81xx()
+# define soc_is_ti816x()               is_ti816x()
+# define soc_is_ti814x()               is_ti814x()
 # define soc_is_am35xx()               is_am35xx()
 #endif
 
@@ -376,14 +376,14 @@ IS_OMAP_TYPE(3430, 0x3430)
 #endif
 
 # if defined(CONFIG_ARCH_OMAP4)
-# undef cpu_is_omap44xx
-# undef cpu_is_omap443x
-# undef cpu_is_omap446x
-# undef cpu_is_omap447x
-# define cpu_is_omap44xx()             is_omap44xx()
-# define cpu_is_omap443x()             is_omap443x()
-# define cpu_is_omap446x()             is_omap446x()
-# define cpu_is_omap447x()             is_omap447x()
+# undef soc_is_omap44xx
+# undef soc_is_omap443x
+# undef soc_is_omap446x
+# undef soc_is_omap447x
+# define soc_is_omap44xx()             is_omap44xx()
+# define soc_is_omap443x()             is_omap443x()
+# define soc_is_omap446x()             is_omap446x()
+# define soc_is_omap447x()             is_omap447x()
 # endif
 
 # if defined(CONFIG_SOC_OMAP5)
@@ -556,5 +556,22 @@ level(__##fn);
 #define omap_late_initcall(fn)         omap_initcall(late_initcall, fn)
 #define omap_late_initcall_sync(fn)    omap_initcall(late_initcall_sync, fn)
 
-#endif /* __ASSEMBLY__ */
+/* Legacy defines, these can be removed when users are removed */
+#define cpu_is_omap2420()      soc_is_omap2420()
+#define cpu_is_omap2422()      soc_is_omap2422()
+#define cpu_is_omap242x()      soc_is_omap242x()
+#define cpu_is_omap2430()      soc_is_omap2430()
+#define cpu_is_omap243x()      soc_is_omap243x()
+#define cpu_is_omap24xx()      soc_is_omap24xx()
+#define cpu_is_omap3430()      soc_is_omap3430()
+#define cpu_is_omap343x()      soc_is_omap343x()
+#define cpu_is_omap34xx()      soc_is_omap34xx()
+#define cpu_is_omap3630()      soc_is_omap3630()
+#define cpu_is_omap443x()      soc_is_omap443x()
+#define cpu_is_omap446x()      soc_is_omap446x()
+#define cpu_is_omap44xx()      soc_is_omap44xx()
+#define cpu_is_ti814x()                soc_is_ti814x()
+#define cpu_is_ti816x()                soc_is_ti816x()
+#define cpu_is_ti81xx()                soc_is_ti81xx()
 
+#endif /* __ASSEMBLY__ */
index cd488b80ba36ed621e69828ab4d847e26259498c..83d0e61f49e64cded35f31761219ebc3a4ad82ac 100644 (file)
@@ -211,35 +211,10 @@ static inline int omap243x_sram_init(void)
 
 #ifdef CONFIG_ARCH_OMAP3
 
-static u32 (*_omap3_sram_configure_core_dpll)(
-                       u32 m2, u32 unlock_dll, u32 f, u32 inc,
-                       u32 sdrc_rfr_ctrl_0, u32 sdrc_actim_ctrl_a_0,
-                       u32 sdrc_actim_ctrl_b_0, u32 sdrc_mr_0,
-                       u32 sdrc_rfr_ctrl_1, u32 sdrc_actim_ctrl_a_1,
-                       u32 sdrc_actim_ctrl_b_1, u32 sdrc_mr_1);
-
-u32 omap3_configure_core_dpll(u32 m2, u32 unlock_dll, u32 f, u32 inc,
-                       u32 sdrc_rfr_ctrl_0, u32 sdrc_actim_ctrl_a_0,
-                       u32 sdrc_actim_ctrl_b_0, u32 sdrc_mr_0,
-                       u32 sdrc_rfr_ctrl_1, u32 sdrc_actim_ctrl_a_1,
-                       u32 sdrc_actim_ctrl_b_1, u32 sdrc_mr_1)
-{
-       BUG_ON(!_omap3_sram_configure_core_dpll);
-       return _omap3_sram_configure_core_dpll(
-                       m2, unlock_dll, f, inc,
-                       sdrc_rfr_ctrl_0, sdrc_actim_ctrl_a_0,
-                       sdrc_actim_ctrl_b_0, sdrc_mr_0,
-                       sdrc_rfr_ctrl_1, sdrc_actim_ctrl_a_1,
-                       sdrc_actim_ctrl_b_1, sdrc_mr_1);
-}
-
 void omap3_sram_restore_context(void)
 {
        omap_sram_reset();
 
-       _omap3_sram_configure_core_dpll =
-               omap_sram_push(omap3_sram_configure_core_dpll,
-                              omap3_sram_configure_core_dpll_sz);
        omap_push_sram_idle();
 }
 
index 948d3edefc3865504bd87ea328b55b9b3713ef6f..18dc884267fa6b6efa37a18596843e4e595773e3 100644 (file)
@@ -15,12 +15,6 @@ extern void omap2_sram_reprogram_sdrc(u32 perf_level, u32 dll_val,
                                      u32 mem_type);
 extern u32 omap2_set_prcm(u32 dpll_ctrl_val, u32 sdrc_rfr_val, int bypass);
 
-extern u32 omap3_configure_core_dpll(
-                       u32 m2, u32 unlock_dll, u32 f, u32 inc,
-                       u32 sdrc_rfr_ctrl_0, u32 sdrc_actim_ctrl_a_0,
-                       u32 sdrc_actim_ctrl_b_0, u32 sdrc_mr_0,
-                       u32 sdrc_rfr_ctrl_1, u32 sdrc_actim_ctrl_a_1,
-                       u32 sdrc_actim_ctrl_b_1, u32 sdrc_mr_1);
 extern void omap3_sram_restore_context(void);
 
 /* Do not use these */
@@ -52,14 +46,6 @@ extern void omap243x_sram_reprogram_sdrc(u32 perf_level, u32 dll_val,
                                                u32 mem_type);
 extern unsigned long omap243x_sram_reprogram_sdrc_sz;
 
-extern u32 omap3_sram_configure_core_dpll(
-                       u32 m2, u32 unlock_dll, u32 f, u32 inc,
-                       u32 sdrc_rfr_ctrl_0, u32 sdrc_actim_ctrl_a_0,
-                       u32 sdrc_actim_ctrl_b_0, u32 sdrc_mr_0,
-                       u32 sdrc_rfr_ctrl_1, u32 sdrc_actim_ctrl_a_1,
-                       u32 sdrc_actim_ctrl_b_1, u32 sdrc_mr_1);
-extern unsigned long omap3_sram_configure_core_dpll_sz;
-
 #ifdef CONFIG_PM
 extern void omap_push_sram_idle(void);
 #else
diff --git a/arch/arm/mach-omap2/sram34xx.S b/arch/arm/mach-omap2/sram34xx.S
deleted file mode 100644 (file)
index 1446331..0000000
+++ /dev/null
@@ -1,346 +0,0 @@
-/*
- * linux/arch/arm/mach-omap3/sram.S
- *
- * Omap3 specific functions that need to be run in internal SRAM
- *
- * Copyright (C) 2004, 2007, 2008 Texas Instruments, Inc.
- * Copyright (C) 2008 Nokia Corporation
- *
- * Rajendra Nayak <rnayak@ti.com>
- * Richard Woodruff <r-woodruff2@ti.com>
- * Paul Walmsley
- *
- * 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; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR /PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-#include <linux/linkage.h>
-
-#include <asm/assembler.h>
-
-#include "soc.h"
-#include "iomap.h"
-#include "sdrc.h"
-#include "cm3xxx.h"
-
-/*
- * This file needs be built unconditionally as ARM to interoperate correctly
- * with non-Thumb-2-capable firmware.
- */
-       .arm
-
-       .text
-
-/* r1 parameters */
-#define SDRC_NO_UNLOCK_DLL             0x0
-#define SDRC_UNLOCK_DLL                        0x1
-
-/* SDRC_DLLA_CTRL bit settings */
-#define FIXEDDELAY_SHIFT               24
-#define FIXEDDELAY_MASK                        (0xff << FIXEDDELAY_SHIFT)
-#define DLLIDLE_MASK                   0x4
-
-/*
- * SDRC_DLLA_CTRL default values: TI hardware team indicates that
- * FIXEDDELAY should be initialized to 0xf.  This apparently was
- * empirically determined during process testing, so no derivation
- * was provided.
- */
-#define FIXEDDELAY_DEFAULT             (0x0f << FIXEDDELAY_SHIFT)
-
-/* SDRC_DLLA_STATUS bit settings */
-#define LOCKSTATUS_MASK                        0x4
-
-/* SDRC_POWER bit settings */
-#define SRFRONIDLEREQ_MASK             0x40
-
-/* CM_IDLEST1_CORE bit settings */
-#define ST_SDRC_MASK                   0x2
-
-/* CM_ICLKEN1_CORE bit settings */
-#define EN_SDRC_MASK                   0x2
-
-/* CM_CLKSEL1_PLL bit settings */
-#define CORE_DPLL_CLKOUT_DIV_SHIFT     0x1b
-
-/*
- * omap3_sram_configure_core_dpll - change DPLL3 M2 divider
- *
- * Params passed in registers:
- *  r0 = new M2 divider setting (only 1 and 2 supported right now)
- *  r1 = unlock SDRC DLL? (1 = yes, 0 = no).  Only unlock DLL for
- *      SDRC rates < 83MHz
- *  r2 = number of MPU cycles to wait for SDRC to stabilize after
- *      reprogramming the SDRC when switching to a slower MPU speed
- *  r3 = increasing SDRC rate? (1 = yes, 0 = no)
- *
- * Params passed via the stack. The needed params will be copied in SRAM
- *  before use by the code in SRAM (SDRAM is not accessible during SDRC
- *  reconfiguration):
- *  new SDRC_RFR_CTRL_0 register contents
- *  new SDRC_ACTIM_CTRL_A_0 register contents
- *  new SDRC_ACTIM_CTRL_B_0 register contents
- *  new SDRC_MR_0 register value
- *  new SDRC_RFR_CTRL_1 register contents
- *  new SDRC_ACTIM_CTRL_A_1 register contents
- *  new SDRC_ACTIM_CTRL_B_1 register contents
- *  new SDRC_MR_1 register value
- *
- * If the param SDRC_RFR_CTRL_1 is 0, the parameters are not programmed into
- * the SDRC CS1 registers
- *
- * NOTE: This code no longer attempts to program the SDRC AC timing and MR
- * registers.  This is because the code currently cannot ensure that all
- * L3 initiators (e.g., sDMA, IVA, DSS DISPC, etc.) are not accessing the
- * SDRAM when the registers are written.  If the registers are changed while
- * an initiator is accessing SDRAM, memory can be corrupted and/or the SDRC
- * may enter an unpredictable state.  In the future, the intent is to
- * re-enable this code in cases where we can ensure that no initiators are
- * touching the SDRAM.  Until that time, users who know that their use case
- * can satisfy the above requirement can enable the CONFIG_OMAP3_SDRC_AC_TIMING
- * option.
- *
- * Richard Woodruff notes that any changes to this code must be carefully
- * audited and tested to ensure that they don't cause a TLB miss while
- * the SDRAM is inaccessible.  Such a situation will crash the system
- * since it will cause the ARM MMU to attempt to walk the page tables.
- * These crashes may be intermittent.
- */
-       .align  3
-ENTRY(omap3_sram_configure_core_dpll)
-       stmfd   sp!, {r1-r12, lr}       @ store regs to stack
-
-                                       @ pull the extra args off the stack
-                                       @  and store them in SRAM
-
-/*
- * PC-relative stores are deprecated in ARMv7 and lead to undefined behaviour
- * in Thumb-2: use a r7 as a base instead.
- * Be careful not to clobber r7 when maintaing this file.
- */
- THUMB(        adr     r7, omap3_sram_configure_core_dpll                      )
-       .macro strtext Rt:req, label:req
- ARM(  str     \Rt, \label                                             )
- THUMB(        str     \Rt, [r7, \label - omap3_sram_configure_core_dpll]      )
-       .endm
-
-       ldr     r4, [sp, #52]
-       strtext r4, omap_sdrc_rfr_ctrl_0_val
-       ldr     r4, [sp, #56]
-       strtext r4, omap_sdrc_actim_ctrl_a_0_val
-       ldr     r4, [sp, #60]
-       strtext r4, omap_sdrc_actim_ctrl_b_0_val
-       ldr     r4, [sp, #64]
-       strtext r4, omap_sdrc_mr_0_val
-       ldr     r4, [sp, #68]
-       strtext r4, omap_sdrc_rfr_ctrl_1_val
-       cmp     r4, #0                  @ if SDRC_RFR_CTRL_1 is 0,
-       beq     skip_cs1_params         @  do not use cs1 params
-       ldr     r4, [sp, #72]
-       strtext r4, omap_sdrc_actim_ctrl_a_1_val
-       ldr     r4, [sp, #76]
-       strtext r4, omap_sdrc_actim_ctrl_b_1_val
-       ldr     r4, [sp, #80]
-       strtext r4, omap_sdrc_mr_1_val
-skip_cs1_params:
-       mrc     p15, 0, r8, c1, c0, 0   @ read ctrl register
-       bic     r10, r8, #0x800         @ clear Z-bit, disable branch prediction
-       mcr     p15, 0, r10, c1, c0, 0  @ write ctrl register
-       dsb                             @ flush buffered writes to interconnect
-       isb                             @ prevent speculative exec past here
-       cmp     r3, #1                  @ if increasing SDRC clk rate,
-       bleq    configure_sdrc          @ program the SDRC regs early (for RFR)
-       cmp     r1, #SDRC_UNLOCK_DLL    @ set the intended DLL state
-       bleq    unlock_dll
-       blne    lock_dll
-       bl      sdram_in_selfrefresh    @ put SDRAM in self refresh, idle SDRC
-       bl      configure_core_dpll     @ change the DPLL3 M2 divider
-       mov     r12, r2
-       bl      wait_clk_stable         @ wait for SDRC to stabilize
-       bl      enable_sdrc             @ take SDRC out of idle
-       cmp     r1, #SDRC_UNLOCK_DLL    @ wait for DLL status to change
-       bleq    wait_dll_unlock
-       blne    wait_dll_lock
-       cmp     r3, #1                  @ if increasing SDRC clk rate,
-       beq     return_to_sdram         @ return to SDRAM code, otherwise,
-       bl      configure_sdrc          @ reprogram SDRC regs now
-return_to_sdram:
-       mcr     p15, 0, r8, c1, c0, 0   @ restore ctrl register
-       isb                             @ prevent speculative exec past here
-       mov     r0, #0                  @ return value
-       ldmfd   sp!, {r1-r12, pc}       @ restore regs and return
-unlock_dll:
-       ldr     r11, omap3_sdrc_dlla_ctrl
-       ldr     r12, [r11]
-       bic     r12, r12, #FIXEDDELAY_MASK
-       orr     r12, r12, #FIXEDDELAY_DEFAULT
-       orr     r12, r12, #DLLIDLE_MASK
-       str     r12, [r11]              @ (no OCP barrier needed)
-       bx      lr
-lock_dll:
-       ldr     r11, omap3_sdrc_dlla_ctrl
-       ldr     r12, [r11]
-       bic     r12, r12, #DLLIDLE_MASK
-       str     r12, [r11]              @ (no OCP barrier needed)
-       bx      lr
-sdram_in_selfrefresh:
-       ldr     r11, omap3_sdrc_power   @ read the SDRC_POWER register
-       ldr     r12, [r11]              @ read the contents of SDRC_POWER
-       mov     r9, r12                 @ keep a copy of SDRC_POWER bits
-       orr     r12, r12, #SRFRONIDLEREQ_MASK   @ enable self refresh on idle
-       str     r12, [r11]              @ write back to SDRC_POWER register
-       ldr     r12, [r11]              @ posted-write barrier for SDRC
-idle_sdrc:
-       ldr     r11, omap3_cm_iclken1_core      @ read the CM_ICLKEN1_CORE reg
-       ldr     r12, [r11]
-       bic     r12, r12, #EN_SDRC_MASK         @ disable iclk bit for SDRC
-       str     r12, [r11]
-wait_sdrc_idle:
-       ldr     r11, omap3_cm_idlest1_core
-       ldr     r12, [r11]
-       and     r12, r12, #ST_SDRC_MASK         @ check for SDRC idle
-       cmp     r12, #ST_SDRC_MASK
-       bne     wait_sdrc_idle
-       bx      lr
-configure_core_dpll:
-       ldr     r11, omap3_cm_clksel1_pll
-       ldr     r12, [r11]
-       ldr     r10, core_m2_mask_val   @ modify m2 for core dpll
-       and     r12, r12, r10
-       orr     r12, r12, r0, lsl #CORE_DPLL_CLKOUT_DIV_SHIFT
-       str     r12, [r11]
-       ldr     r12, [r11]              @ posted-write barrier for CM
-       bx      lr
-wait_clk_stable:
-       subs    r12, r12, #1
-       bne     wait_clk_stable
-       bx      lr
-enable_sdrc:
-       ldr     r11, omap3_cm_iclken1_core
-       ldr     r12, [r11]
-       orr     r12, r12, #EN_SDRC_MASK         @ enable iclk bit for SDRC
-       str     r12, [r11]
-wait_sdrc_idle1:
-       ldr     r11, omap3_cm_idlest1_core
-       ldr     r12, [r11]
-       and     r12, r12, #ST_SDRC_MASK
-       cmp     r12, #0
-       bne     wait_sdrc_idle1
-restore_sdrc_power_val:
-       ldr     r11, omap3_sdrc_power
-       str     r9, [r11]               @ restore SDRC_POWER, no barrier needed
-       bx      lr
-wait_dll_lock:
-       ldr     r11, omap3_sdrc_dlla_status
-       ldr     r12, [r11]
-       and     r12, r12, #LOCKSTATUS_MASK
-       cmp     r12, #LOCKSTATUS_MASK
-       bne     wait_dll_lock
-       bx      lr
-wait_dll_unlock:
-       ldr     r11, omap3_sdrc_dlla_status
-       ldr     r12, [r11]
-       and     r12, r12, #LOCKSTATUS_MASK
-       cmp     r12, #0x0
-       bne     wait_dll_unlock
-       bx      lr
-configure_sdrc:
-       ldr     r12, omap_sdrc_rfr_ctrl_0_val   @ fetch value from SRAM
-       ldr     r11, omap3_sdrc_rfr_ctrl_0      @ fetch addr from SRAM
-       str     r12, [r11]                      @ store
-#ifdef CONFIG_OMAP3_SDRC_AC_TIMING
-       ldr     r12, omap_sdrc_actim_ctrl_a_0_val
-       ldr     r11, omap3_sdrc_actim_ctrl_a_0
-       str     r12, [r11]
-       ldr     r12, omap_sdrc_actim_ctrl_b_0_val
-       ldr     r11, omap3_sdrc_actim_ctrl_b_0
-       str     r12, [r11]
-       ldr     r12, omap_sdrc_mr_0_val
-       ldr     r11, omap3_sdrc_mr_0
-       str     r12, [r11]
-#endif
-       ldr     r12, omap_sdrc_rfr_ctrl_1_val
-       cmp     r12, #0                 @ if SDRC_RFR_CTRL_1 is 0,
-       beq     skip_cs1_prog           @  do not program cs1 params
-       ldr     r11, omap3_sdrc_rfr_ctrl_1
-       str     r12, [r11]
-#ifdef CONFIG_OMAP3_SDRC_AC_TIMING
-       ldr     r12, omap_sdrc_actim_ctrl_a_1_val
-       ldr     r11, omap3_sdrc_actim_ctrl_a_1
-       str     r12, [r11]
-       ldr     r12, omap_sdrc_actim_ctrl_b_1_val
-       ldr     r11, omap3_sdrc_actim_ctrl_b_1
-       str     r12, [r11]
-       ldr     r12, omap_sdrc_mr_1_val
-       ldr     r11, omap3_sdrc_mr_1
-       str     r12, [r11]
-#endif
-skip_cs1_prog:
-       ldr     r12, [r11]              @ posted-write barrier for SDRC
-       bx      lr
-
-       .align
-omap3_sdrc_power:
-       .word OMAP34XX_SDRC_REGADDR(SDRC_POWER)
-omap3_cm_clksel1_pll:
-       .word OMAP34XX_CM_REGADDR(PLL_MOD, CM_CLKSEL1)
-omap3_cm_idlest1_core:
-       .word OMAP34XX_CM_REGADDR(CORE_MOD, CM_IDLEST)
-omap3_cm_iclken1_core:
-       .word OMAP34XX_CM_REGADDR(CORE_MOD, CM_ICLKEN1)
-
-omap3_sdrc_rfr_ctrl_0:
-       .word OMAP34XX_SDRC_REGADDR(SDRC_RFR_CTRL_0)
-omap3_sdrc_rfr_ctrl_1:
-       .word OMAP34XX_SDRC_REGADDR(SDRC_RFR_CTRL_1)
-omap3_sdrc_actim_ctrl_a_0:
-       .word OMAP34XX_SDRC_REGADDR(SDRC_ACTIM_CTRL_A_0)
-omap3_sdrc_actim_ctrl_a_1:
-       .word OMAP34XX_SDRC_REGADDR(SDRC_ACTIM_CTRL_A_1)
-omap3_sdrc_actim_ctrl_b_0:
-       .word OMAP34XX_SDRC_REGADDR(SDRC_ACTIM_CTRL_B_0)
-omap3_sdrc_actim_ctrl_b_1:
-       .word OMAP34XX_SDRC_REGADDR(SDRC_ACTIM_CTRL_B_1)
-omap3_sdrc_mr_0:
-       .word OMAP34XX_SDRC_REGADDR(SDRC_MR_0)
-omap3_sdrc_mr_1:
-       .word OMAP34XX_SDRC_REGADDR(SDRC_MR_1)
-omap_sdrc_rfr_ctrl_0_val:
-       .word 0xDEADBEEF
-omap_sdrc_rfr_ctrl_1_val:
-       .word 0xDEADBEEF
-omap_sdrc_actim_ctrl_a_0_val:
-       .word 0xDEADBEEF
-omap_sdrc_actim_ctrl_a_1_val:
-       .word 0xDEADBEEF
-omap_sdrc_actim_ctrl_b_0_val:
-       .word 0xDEADBEEF
-omap_sdrc_actim_ctrl_b_1_val:
-       .word 0xDEADBEEF
-omap_sdrc_mr_0_val:
-       .word 0xDEADBEEF
-omap_sdrc_mr_1_val:
-       .word 0xDEADBEEF
-
-omap3_sdrc_dlla_status:
-       .word OMAP34XX_SDRC_REGADDR(SDRC_DLLA_STATUS)
-omap3_sdrc_dlla_ctrl:
-       .word OMAP34XX_SDRC_REGADDR(SDRC_DLLA_CTRL)
-core_m2_mask_val:
-       .word 0x07FFFFFF
-ENDPROC(omap3_sram_configure_core_dpll)
-
-ENTRY(omap3_sram_configure_core_dpll_sz)
-       .word   . - omap3_sram_configure_core_dpll
-
index bef41837bf7fd7090eccf768c2881662ac42025a..b18ebbefae09577e20b19e53167aca5ef11b8d86 100644 (file)
@@ -183,7 +183,8 @@ static struct device_node * __init omap_get_timer_dt(const struct of_device_id *
                                  of_get_property(np, "ti,timer-secure", NULL)))
                        continue;
 
-               of_add_property(np, &device_disabled);
+               if (!of_device_is_compatible(np, "ti,omap-counter32k"))
+                       of_add_property(np, &device_disabled);
                return np;
        }
 
@@ -394,7 +395,6 @@ static int __init __maybe_unused omap2_sync32k_clocksource_init(void)
        int ret;
        struct device_node *np = NULL;
        struct omap_hwmod *oh;
-       void __iomem *vbase;
        const char *oh_name = "counter_32k";
 
        /*
@@ -420,18 +420,6 @@ static int __init __maybe_unused omap2_sync32k_clocksource_init(void)
 
        omap_hwmod_setup_one(oh_name);
 
-       if (np) {
-               vbase = of_iomap(np, 0);
-               of_node_put(np);
-       } else {
-               vbase = omap_hwmod_get_mpu_rt_va(oh);
-       }
-
-       if (!vbase) {
-               pr_warn("%s: failed to get counter_32k resource\n", __func__);
-               return -ENXIO;
-       }
-
        ret = omap_hwmod_enable(oh);
        if (ret) {
                pr_warn("%s: failed to enable counter_32k module (%d)\n",
@@ -439,13 +427,18 @@ static int __init __maybe_unused omap2_sync32k_clocksource_init(void)
                return ret;
        }
 
-       ret = omap_init_clocksource_32k(vbase);
-       if (ret) {
-               pr_warn("%s: failed to initialize counter_32k as a clocksource (%d)\n",
-                                                       __func__, ret);
-               omap_hwmod_idle(oh);
-       }
+       if (!of_have_populated_dt()) {
+               void __iomem *vbase;
+
+               vbase = omap_hwmod_get_mpu_rt_va(oh);
 
+               ret = omap_init_clocksource_32k(vbase);
+               if (ret) {
+                       pr_warn("%s: failed to initialize counter_32k as a clocksource (%d)\n",
+                                       __func__, ret);
+                       omap_hwmod_idle(oh);
+               }
+       }
        return ret;
 }
 
@@ -476,7 +469,64 @@ static void __init omap2_gptimer_clocksource_init(int gptimer_id,
                        clocksource_gpt.name, clksrc.rate);
 }
 
-#ifdef CONFIG_SOC_HAS_REALTIME_COUNTER
+static void __init __omap_sync32k_timer_init(int clkev_nr, const char *clkev_src,
+               const char *clkev_prop, int clksrc_nr, const char *clksrc_src,
+               const char *clksrc_prop, bool gptimer)
+{
+       omap_clk_init();
+       omap_dmtimer_init();
+       omap2_gp_clockevent_init(clkev_nr, clkev_src, clkev_prop);
+
+       /* Enable the use of clocksource="gp_timer" kernel parameter */
+       if (use_gptimer_clksrc || gptimer)
+               omap2_gptimer_clocksource_init(clksrc_nr, clksrc_src,
+                                               clksrc_prop);
+       else
+               omap2_sync32k_clocksource_init();
+}
+
+void __init omap_init_time(void)
+{
+       __omap_sync32k_timer_init(1, "timer_32k_ck", "ti,timer-alwon",
+                       2, "timer_sys_ck", NULL, false);
+
+       if (of_have_populated_dt())
+               clocksource_probe();
+}
+
+#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_SOC_AM43XX)
+void __init omap3_secure_sync32k_timer_init(void)
+{
+       __omap_sync32k_timer_init(12, "secure_32k_fck", "ti,timer-secure",
+                       2, "timer_sys_ck", NULL, false);
+}
+#endif /* CONFIG_ARCH_OMAP3 */
+
+#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_SOC_AM33XX)
+void __init omap3_gptimer_timer_init(void)
+{
+       __omap_sync32k_timer_init(2, "timer_sys_ck", NULL,
+                       1, "timer_sys_ck", "ti,timer-alwon", true);
+}
+#endif
+
+#if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5) ||         \
+       defined(CONFIG_SOC_DRA7XX) || defined(CONFIG_SOC_AM43XX)
+static void __init omap4_sync32k_timer_init(void)
+{
+       __omap_sync32k_timer_init(1, "timer_32k_ck", "ti,timer-alwon",
+                       2, "sys_clkin_ck", NULL, false);
+}
+
+void __init omap4_local_timer_init(void)
+{
+       omap4_sync32k_timer_init();
+       clocksource_probe();
+}
+#endif
+
+#if defined(CONFIG_SOC_OMAP5) || defined(CONFIG_SOC_DRA7XX)
+
 /*
  * The realtime counter also called master counter, is a free-running
  * counter, which is related to real time. It produces the count used
@@ -488,6 +538,7 @@ static void __init omap2_gptimer_clocksource_init(int gptimer_id,
  */
 static void __init realtime_counter_init(void)
 {
+#ifdef CONFIG_SOC_HAS_REALTIME_COUNTER
        void __iomem *base;
        static struct clk *sys_clk;
        unsigned long rate;
@@ -586,78 +637,9 @@ sysclk1_based:
        set_cntfreq();
 
        iounmap(base);
-}
-#else
-static inline void __init realtime_counter_init(void)
-{}
 #endif
-
-#define OMAP_SYS_GP_TIMER_INIT(name, clkev_nr, clkev_src, clkev_prop,  \
-                              clksrc_nr, clksrc_src, clksrc_prop)      \
-void __init omap##name##_gptimer_timer_init(void)                      \
-{                                                                      \
-       omap_clk_init();                                        \
-       omap_dmtimer_init();                                            \
-       omap2_gp_clockevent_init((clkev_nr), clkev_src, clkev_prop);    \
-       omap2_gptimer_clocksource_init((clksrc_nr), clksrc_src,         \
-                                       clksrc_prop);                   \
 }
 
-#define OMAP_SYS_32K_TIMER_INIT(name, clkev_nr, clkev_src, clkev_prop, \
-                               clksrc_nr, clksrc_src, clksrc_prop)     \
-void __init omap##name##_sync32k_timer_init(void)              \
-{                                                                      \
-       omap_clk_init();                                        \
-       omap_dmtimer_init();                                            \
-       omap2_gp_clockevent_init((clkev_nr), clkev_src, clkev_prop);    \
-       /* Enable the use of clocksource="gp_timer" kernel parameter */ \
-       if (use_gptimer_clksrc)                                         \
-               omap2_gptimer_clocksource_init((clksrc_nr), clksrc_src, \
-                                               clksrc_prop);           \
-       else                                                            \
-               omap2_sync32k_clocksource_init();                       \
-}
-
-#ifdef CONFIG_ARCH_OMAP2
-OMAP_SYS_32K_TIMER_INIT(2, 1, "timer_32k_ck", "ti,timer-alwon",
-                       2, "timer_sys_ck", NULL);
-#endif /* CONFIG_ARCH_OMAP2 */
-
-#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_SOC_AM43XX)
-OMAP_SYS_32K_TIMER_INIT(3, 1, "timer_32k_ck", "ti,timer-alwon",
-                       2, "timer_sys_ck", NULL);
-OMAP_SYS_32K_TIMER_INIT(3_secure, 12, "secure_32k_fck", "ti,timer-secure",
-                       2, "timer_sys_ck", NULL);
-#endif /* CONFIG_ARCH_OMAP3 */
-
-#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_SOC_AM33XX) || \
-       defined(CONFIG_SOC_AM43XX)
-OMAP_SYS_GP_TIMER_INIT(3, 2, "timer_sys_ck", NULL,
-                      1, "timer_sys_ck", "ti,timer-alwon");
-#endif
-
-#if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5) || \
-       defined(CONFIG_SOC_DRA7XX)
-static OMAP_SYS_32K_TIMER_INIT(4, 1, "timer_32k_ck", "ti,timer-alwon",
-                              2, "sys_clkin_ck", NULL);
-#endif
-
-#ifdef CONFIG_ARCH_OMAP4
-#ifdef CONFIG_HAVE_ARM_TWD
-void __init omap4_local_timer_init(void)
-{
-       omap4_sync32k_timer_init();
-       clocksource_probe();
-}
-#else
-void __init omap4_local_timer_init(void)
-{
-       omap4_sync32k_timer_init();
-}
-#endif /* CONFIG_HAVE_ARM_TWD */
-#endif /* CONFIG_ARCH_OMAP4 */
-
-#if defined(CONFIG_SOC_OMAP5) || defined(CONFIG_SOC_DRA7XX)
 void __init omap5_realtime_timer_init(void)
 {
        omap4_sync32k_timer_init();
index d44d311704ba97e72a8736d79cfb024ebc78a214..2028167fff310041cf54037798f81cc8efa9efc2 100644 (file)
@@ -280,10 +280,6 @@ void omap3_vc_set_pmic_signaling(int core_next_state)
        }
 }
 
-#define PRM_POLCTRL_TWL_MASK   (OMAP3430_PRM_POLCTRL_CLKREQ_POL | \
-                                       OMAP3430_PRM_POLCTRL_CLKREQ_POL)
-#define PRM_POLCTRL_TWL_VAL    OMAP3430_PRM_POLCTRL_CLKREQ_POL
-
 /*
  * Configure signal polarity for sys_clkreq and sys_off_mode pins
  * as the default values are wrong and can cause the system to hang
index 08d2be2ea41f43c8273de58924741da7c72f6e43..66f1c952c0483d4dc5830fe66fd66bcf4f058f40 100644 (file)
@@ -45,6 +45,7 @@ config MACH_KUROBOX_PRO
 
 config MACH_DNS323
        bool "D-Link DNS-323"
+       select GENERIC_NET_UTILS
        select I2C_BOARDINFO
        help
          Say 'Y' here if you want your kernel to support the
@@ -52,6 +53,7 @@ config MACH_DNS323
 
 config MACH_TS209
        bool "QNAP TS-109/TS-209"
+       select GENERIC_NET_UTILS
        help
          Say 'Y' here if you want your kernel to support the
          QNAP TS-109/TS-209 platform.
@@ -93,6 +95,7 @@ config MACH_LINKSTATION_LS_HGL
 
 config MACH_TS409
        bool "QNAP TS-409"
+       select GENERIC_NET_UTILS
        help
          Say 'Y' here if you want your kernel to support the
          QNAP TS-409 platform.
index f267e58a82833b45647608aea78990bc5e673a0a..bc279a8530753ea6531dbb0b5098498d86fa78de 100644 (file)
@@ -173,42 +173,10 @@ static struct mv643xx_eth_platform_data dns323_eth_data = {
        .phy_addr = MV643XX_ETH_PHY_ADDR(8),
 };
 
-/* dns323_parse_hex_*() taken from tsx09-common.c; should a common copy of these
- * functions be kept somewhere?
- */
-static int __init dns323_parse_hex_nibble(char n)
-{
-       if (n >= '0' && n <= '9')
-               return n - '0';
-
-       if (n >= 'A' && n <= 'F')
-               return n - 'A' + 10;
-
-       if (n >= 'a' && n <= 'f')
-               return n - 'a' + 10;
-
-       return -1;
-}
-
-static int __init dns323_parse_hex_byte(const char *b)
-{
-       int hi;
-       int lo;
-
-       hi = dns323_parse_hex_nibble(b[0]);
-       lo = dns323_parse_hex_nibble(b[1]);
-
-       if (hi < 0 || lo < 0)
-               return -1;
-
-       return (hi << 4) | lo;
-}
-
 static int __init dns323_read_mac_addr(void)
 {
        u_int8_t addr[6];
-       int i;
-       char *mac_page;
+       void __iomem *mac_page;
 
        /* MAC address is stored as a regular ol' string in /dev/mtdblock4
         * (0x007d0000-0x00800000) starting at offset 196480 (0x2ff80).
@@ -217,23 +185,8 @@ static int __init dns323_read_mac_addr(void)
        if (!mac_page)
                return -ENOMEM;
 
-       /* Sanity check the string we're looking at */
-       for (i = 0; i < 5; i++) {
-               if (*(mac_page + (i * 3) + 2) != ':') {
-                       goto error_fail;
-               }
-       }
-
-       for (i = 0; i < 6; i++) {
-               int byte;
-
-               byte = dns323_parse_hex_byte(mac_page + (i * 3));
-               if (byte < 0) {
-                       goto error_fail;
-               }
-
-               addr[i] = byte;
-       }
+       if (!mac_pton((__force const char *) mac_page, addr))
+               goto error_fail;
 
        iounmap(mac_page);
        printk("DNS-323: Found ethernet MAC address: %pM\n", addr);
index 24b2959719faf1d93e240436cc486463cf52a6f7..d42e006597c7b1e1cf4078972669b0cec3bfd6d0 100644 (file)
@@ -53,53 +53,12 @@ struct mv643xx_eth_platform_data qnap_tsx09_eth_data = {
        .phy_addr       = MV643XX_ETH_PHY_ADDR(8),
 };
 
-static int __init qnap_tsx09_parse_hex_nibble(char n)
-{
-       if (n >= '0' && n <= '9')
-               return n - '0';
-
-       if (n >= 'A' && n <= 'F')
-               return n - 'A' + 10;
-
-       if (n >= 'a' && n <= 'f')
-               return n - 'a' + 10;
-
-       return -1;
-}
-
-static int __init qnap_tsx09_parse_hex_byte(const char *b)
-{
-       int hi;
-       int lo;
-
-       hi = qnap_tsx09_parse_hex_nibble(b[0]);
-       lo = qnap_tsx09_parse_hex_nibble(b[1]);
-
-       if (hi < 0 || lo < 0)
-               return -1;
-
-       return (hi << 4) | lo;
-}
-
 static int __init qnap_tsx09_check_mac_addr(const char *addr_str)
 {
        u_int8_t addr[6];
-       int i;
 
-       for (i = 0; i < 6; i++) {
-               int byte;
-
-               /*
-                * Enforce "xx:xx:xx:xx:xx:xx\n" format.
-                */
-               if (addr_str[(i * 3) + 2] != ((i < 5) ? ':' : '\n'))
-                       return -1;
-
-               byte = qnap_tsx09_parse_hex_byte(addr_str + (i * 3));
-               if (byte < 0)
-                       return -1;
-               addr[i] = byte;
-       }
+       if (!mac_pton(addr_str, addr))
+               return -1;
 
        printk(KERN_INFO "tsx09: found ethernet mac address %pM\n", addr);
 
@@ -118,12 +77,12 @@ void __init qnap_tsx09_find_mac_addr(u32 mem_base, u32 size)
        unsigned long addr;
 
        for (addr = mem_base; addr < (mem_base + size); addr += 1024) {
-               char *nor_page;
+               void __iomem *nor_page;
                int ret = 0;
 
                nor_page = ioremap(addr, 1024);
                if (nor_page != NULL) {
-                       ret = qnap_tsx09_check_mac_addr(nor_page);
+                       ret = qnap_tsx09_check_mac_addr((__force const char *)nor_page);
                        iounmap(nor_page);
                }
 
index 0ab2f8bae28e2aa9fce403175fdc87e278bc766a..a728c78b996f7fa0e1050f9e79c775cfa14b42da 100644 (file)
@@ -32,7 +32,7 @@ static inline void platform_do_lowpower(unsigned int cpu)
  *
  * Called with IRQs disabled
  */
-void __ref sirfsoc_cpu_die(unsigned int cpu)
+void sirfsoc_cpu_die(unsigned int cpu)
 {
        platform_do_lowpower(cpu);
 }
index 5851f4c254c1618cc4a8e433491b3e08e8e5448b..a7dae60810e8717c09eda1058e934d546dd66ddc 100644 (file)
@@ -26,6 +26,7 @@
 #include <linux/dm9000.h>
 #include <linux/leds.h>
 #include <linux/rtc-v3020.h>
+#include <linux/pwm.h>
 #include <linux/pwm_backlight.h>
 
 #include <linux/i2c.h>
@@ -305,11 +306,14 @@ static inline void cm_x300_init_lcd(void) {}
 #endif
 
 #if defined(CONFIG_BACKLIGHT_PWM) || defined(CONFIG_BACKLIGHT_PWM_MODULE)
+static struct pwm_lookup cm_x300_pwm_lookup[] = {
+       PWM_LOOKUP("pxa27x-pwm.0", 1, "pwm-backlight.0", NULL, 10000,
+                  PWM_POLARITY_NORMAL),
+};
+
 static struct platform_pwm_backlight_data cm_x300_backlight_data = {
-       .pwm_id         = 2,
        .max_brightness = 100,
        .dft_brightness = 100,
-       .pwm_period_ns  = 10000,
        .enable_gpio    = -1,
 };
 
@@ -323,6 +327,7 @@ static struct platform_device cm_x300_backlight_device = {
 
 static void cm_x300_init_bl(void)
 {
+       pwm_add_table(cm_x300_pwm_lookup, ARRAY_SIZE(cm_x300_pwm_lookup));
        platform_device_register(&cm_x300_backlight_device);
 }
 #else
index 3aa264640c9dd5a0457b99e5a34897bd684ad3ba..db20d25daaabbfb0f35e09a1dd3d79feaa924e88 100644 (file)
@@ -20,6 +20,7 @@
 #include <linux/ioport.h>
 #include <linux/kernel.h>
 #include <linux/platform_device.h>
+#include <linux/pwm.h>
 #include <linux/pwm_backlight.h>
 #include <linux/i2c/pxa-i2c.h>
 
@@ -184,11 +185,14 @@ static inline void income_lcd_init(void) {}
  * Backlight
  ******************************************************************************/
 #if defined(CONFIG_BACKLIGHT_PWM) || defined(CONFIG_BACKLIGHT_PWM_MODULE)
+static struct pwm_lookup income_pwm_lookup[] = {
+       PWM_LOOKUP("pxa27x-pwm.0", 0, "pwm-backlight.0", NULL, 1000000,
+                  PWM_POLARITY_NORMAL),
+};
+
 static struct platform_pwm_backlight_data income_backlight_data = {
-       .pwm_id         = 0,
        .max_brightness = 0x3ff,
        .dft_brightness = 0x1ff,
-       .pwm_period_ns  = 1000000,
        .enable_gpio    = -1,
 };
 
@@ -202,6 +206,7 @@ static struct platform_device income_backlight = {
 
 static void __init income_pwm_init(void)
 {
+       pwm_add_table(income_pwm_lookup, ARRAY_SIZE(income_pwm_lookup));
        platform_device_register(&income_backlight);
 }
 #else
index c62473235a1332b3c7211a408b9a4501b116c211..2a6e0ae2b92050bb35547a54ef345e1b93a6f8a4 100644 (file)
@@ -395,6 +395,26 @@ static struct resource pxa_ir_resources[] = {
                .end    = IRQ_ICP,
                .flags  = IORESOURCE_IRQ,
        },
+       [3] = {
+               .start  = 0x40800000,
+               .end    = 0x4080001b,
+               .flags  = IORESOURCE_MEM,
+       },
+       [4] = {
+               .start  = 0x40700000,
+               .end    = 0x40700023,
+               .flags  = IORESOURCE_MEM,
+       },
+       [5] = {
+               .start  = 17,
+               .end    = 17,
+               .flags  = IORESOURCE_DMA,
+       },
+       [6] = {
+               .start  = 18,
+               .end    = 18,
+               .flags  = IORESOURCE_DMA,
+       },
 };
 
 struct platform_device pxa_device_ficp = {
index ab93441e596ed7eb6d3e0f4552d029626e81e42c..9a9c15bfcd3451f02c115238813b2193db266844 100644 (file)
@@ -15,6 +15,7 @@
 #include <linux/init.h>
 #include <linux/platform_device.h>
 #include <linux/delay.h>
+#include <linux/pwm.h>
 #include <linux/pwm_backlight.h>
 #include <linux/input.h>
 #include <linux/gpio.h>
 #define GPIO19_GEN1_CAM_RST            19
 #define GPIO28_GEN2_CAM_RST            28
 
+static struct pwm_lookup ezx_pwm_lookup[] = {
+       PWM_LOOKUP("pxa27x-pwm.0", 0, "pwm-backlight.0", NULL, 78700,
+                  PWM_POLARITY_NORMAL),
+};
+
 static struct platform_pwm_backlight_data ezx_backlight_data = {
-       .pwm_id         = 0,
        .max_brightness = 1023,
        .dft_brightness = 1023,
-       .pwm_period_ns  = 78770,
        .enable_gpio    = -1,
 };
 
@@ -817,6 +821,7 @@ static void __init a780_init(void)
                platform_device_register(&a780_camera);
        }
 
+       pwm_add_table(ezx_pwm_lookup, ARRAY_SIZE(ezx_pwm_lookup));
        platform_add_devices(ARRAY_AND_SIZE(ezx_devices));
        platform_add_devices(ARRAY_AND_SIZE(a780_devices));
 }
index 5fb41ad6e3bcdcdc3b07fb20382c980b7e7dfa9e..b076a835eb21b30aef39e0d46968231d23af1500 100644 (file)
@@ -557,10 +557,8 @@ static struct platform_device hx4700_lcd = {
  */
 
 static struct platform_pwm_backlight_data backlight_data = {
-       .pwm_id         = -1,   /* Superseded by pwm_lookup */
        .max_brightness = 200,
        .dft_brightness = 100,
-       .pwm_period_ns  = 30923,
        .enable_gpio    = -1,
 };
 
@@ -630,7 +628,6 @@ static struct spi_board_info tsc2046_board_info[] __initdata = {
 
 static struct pxa2xx_spi_master pxa_ssp2_master_info = {
        .num_chipselect = 1,
-       .clock_enable   = CKEN_SSP2,
        .enable_dma     = 1,
 };
 
index 9b0eb0252af6facf54158a70d97712a92373c1af..a1869f9b6219b8701ec56e6cf249a5015b6b68b5 100644 (file)
@@ -116,13 +116,11 @@ static struct spi_board_info mcp251x_board_info[] = {
 };
 
 static struct pxa2xx_spi_master pxa_ssp3_spi_master_info = {
-       .clock_enable   = CKEN_SSP3,
        .num_chipselect = 2,
        .enable_dma     = 1
 };
 
 static struct pxa2xx_spi_master pxa_ssp4_spi_master_info = {
-       .clock_enable   = CKEN_SSP4,
        .num_chipselect = 2,
        .enable_dma     = 1
 };
index ba6a6e1d29e9611c11b95363d55010e36c3a5981..5f6b850ebe33b7c8e2fee8548f6273bab14023e0 100644 (file)
@@ -52,9 +52,9 @@
 #define GPIO101_MAGICIAN_KEY_VOL_DOWN          101
 #define GPIO102_MAGICIAN_KEY_PHONE             102
 #define GPIO103_MAGICIAN_LED_KP                        103
-#define GPIO104_MAGICIAN_LCD_POWER_1           104
-#define GPIO105_MAGICIAN_LCD_POWER_2           105
-#define GPIO106_MAGICIAN_LCD_POWER_3           106
+#define GPIO104_MAGICIAN_LCD_VOFF_EN           104
+#define GPIO105_MAGICIAN_LCD_VON_EN            105
+#define GPIO106_MAGICIAN_LCD_DCDC_NRESET       106
 #define GPIO107_MAGICIAN_DS1WM_IRQ             107
 #define GPIO108_MAGICIAN_GSM_READY             108
 #define GPIO114_MAGICIAN_UNKNOWN               114
  * CPLD EGPIOs
  */
 
-#define MAGICIAN_EGPIO_BASE                    PXA_NR_BUILTIN_GPIO
+#define MAGICIAN_EGPIO_BASE            PXA_NR_BUILTIN_GPIO
 #define MAGICIAN_EGPIO(reg,bit) \
        (MAGICIAN_EGPIO_BASE + 8*reg + bit)
 
 /* output */
 
-#define EGPIO_MAGICIAN_TOPPOLY_POWER           MAGICIAN_EGPIO(0, 2)
-#define EGPIO_MAGICIAN_LED_POWER               MAGICIAN_EGPIO(0, 5)
-#define EGPIO_MAGICIAN_GSM_RESET               MAGICIAN_EGPIO(0, 6)
-#define EGPIO_MAGICIAN_LCD_POWER               MAGICIAN_EGPIO(0, 7)
-#define EGPIO_MAGICIAN_SPK_POWER               MAGICIAN_EGPIO(1, 0)
-#define EGPIO_MAGICIAN_EP_POWER                        MAGICIAN_EGPIO(1, 1)
-#define EGPIO_MAGICIAN_IN_SEL0                 MAGICIAN_EGPIO(1, 2)
-#define EGPIO_MAGICIAN_IN_SEL1                 MAGICIAN_EGPIO(1, 3)
-#define EGPIO_MAGICIAN_MIC_POWER               MAGICIAN_EGPIO(1, 4)
-#define EGPIO_MAGICIAN_CODEC_RESET             MAGICIAN_EGPIO(1, 5)
-#define EGPIO_MAGICIAN_CODEC_POWER             MAGICIAN_EGPIO(1, 6)
-#define EGPIO_MAGICIAN_BL_POWER                        MAGICIAN_EGPIO(1, 7)
-#define EGPIO_MAGICIAN_SD_POWER                        MAGICIAN_EGPIO(2, 0)
-#define EGPIO_MAGICIAN_CARKIT_MIC              MAGICIAN_EGPIO(2, 1)
-#define EGPIO_MAGICIAN_UNKNOWN_WAVEDEV_DLL     MAGICIAN_EGPIO(2, 2)
-#define EGPIO_MAGICIAN_FLASH_VPP               MAGICIAN_EGPIO(2, 3)
-#define EGPIO_MAGICIAN_BL_POWER2               MAGICIAN_EGPIO(2, 4)
-#define EGPIO_MAGICIAN_BQ24022_ISET2           MAGICIAN_EGPIO(2, 5)
-#define EGPIO_MAGICIAN_GSM_POWER               MAGICIAN_EGPIO(2, 7)
+#define EGPIO_MAGICIAN_TOPPOLY_POWER   MAGICIAN_EGPIO(0, 2)
+#define EGPIO_MAGICIAN_LED_POWER       MAGICIAN_EGPIO(0, 5)
+#define EGPIO_MAGICIAN_GSM_RESET       MAGICIAN_EGPIO(0, 6)
+#define EGPIO_MAGICIAN_LCD_POWER       MAGICIAN_EGPIO(0, 7)
+#define EGPIO_MAGICIAN_SPK_POWER       MAGICIAN_EGPIO(1, 0)
+#define EGPIO_MAGICIAN_EP_POWER                MAGICIAN_EGPIO(1, 1)
+#define EGPIO_MAGICIAN_IN_SEL0         MAGICIAN_EGPIO(1, 2)
+#define EGPIO_MAGICIAN_IN_SEL1         MAGICIAN_EGPIO(1, 3)
+#define EGPIO_MAGICIAN_MIC_POWER       MAGICIAN_EGPIO(1, 4)
+#define EGPIO_MAGICIAN_CODEC_RESET     MAGICIAN_EGPIO(1, 5)
+#define EGPIO_MAGICIAN_CODEC_POWER     MAGICIAN_EGPIO(1, 6)
+#define EGPIO_MAGICIAN_BL_POWER                MAGICIAN_EGPIO(1, 7)
+#define EGPIO_MAGICIAN_SD_POWER                MAGICIAN_EGPIO(2, 0)
+#define EGPIO_MAGICIAN_CARKIT_MIC      MAGICIAN_EGPIO(2, 1)
+#define EGPIO_MAGICIAN_IR_RX_SHUTDOWN  MAGICIAN_EGPIO(2, 2)
+#define EGPIO_MAGICIAN_FLASH_VPP       MAGICIAN_EGPIO(2, 3)
+#define EGPIO_MAGICIAN_BL_POWER2       MAGICIAN_EGPIO(2, 4)
+#define EGPIO_MAGICIAN_BQ24022_ISET2   MAGICIAN_EGPIO(2, 5)
+#define EGPIO_MAGICIAN_NICD_CHARGE     MAGICIAN_EGPIO(2, 6)
+#define EGPIO_MAGICIAN_GSM_POWER       MAGICIAN_EGPIO(2, 7)
 
 /* input */
 
-#define EGPIO_MAGICIAN_CABLE_STATE_AC          MAGICIAN_EGPIO(4, 0)
-#define EGPIO_MAGICIAN_CABLE_STATE_USB         MAGICIAN_EGPIO(4, 1)
+/* USB or AC charger type */
+#define EGPIO_MAGICIAN_CABLE_TYPE      MAGICIAN_EGPIO(4, 0)
+/*
+ * Vbus is detected
+ * FIXME behaves like (6,3), may differ for host/device
+ */
+#define EGPIO_MAGICIAN_CABLE_VBUS      MAGICIAN_EGPIO(4, 1)
 
-#define EGPIO_MAGICIAN_BOARD_ID0               MAGICIAN_EGPIO(5, 0)
-#define EGPIO_MAGICIAN_BOARD_ID1               MAGICIAN_EGPIO(5, 1)
-#define EGPIO_MAGICIAN_BOARD_ID2               MAGICIAN_EGPIO(5, 2)
-#define EGPIO_MAGICIAN_LCD_SELECT              MAGICIAN_EGPIO(5, 3)
-#define EGPIO_MAGICIAN_nSD_READONLY            MAGICIAN_EGPIO(5, 4)
+#define EGPIO_MAGICIAN_BOARD_ID0       MAGICIAN_EGPIO(5, 0)
+#define EGPIO_MAGICIAN_BOARD_ID1       MAGICIAN_EGPIO(5, 1)
+#define EGPIO_MAGICIAN_BOARD_ID2       MAGICIAN_EGPIO(5, 2)
+#define EGPIO_MAGICIAN_LCD_SELECT      MAGICIAN_EGPIO(5, 3)
+#define EGPIO_MAGICIAN_nSD_READONLY    MAGICIAN_EGPIO(5, 4)
 
-#define EGPIO_MAGICIAN_EP_INSERT               MAGICIAN_EGPIO(6, 1)
+#define EGPIO_MAGICIAN_EP_INSERT       MAGICIAN_EGPIO(6, 1)
+/* FIXME behaves like (4,1), may differ for host/device */
+#define EGPIO_MAGICIAN_CABLE_INSERTED  MAGICIAN_EGPIO(6, 3)
 
 #endif /* _MAGICIAN_H_ */
index 599b925a657c46c5679524006757350b910436a7..1a4291936c582baaef76cb9af46c94333a6467d2 100644 (file)
@@ -19,7 +19,7 @@
 #define ARB_CORE_PARK          (1<<24)    /* Be parked with core when idle */
 #define ARB_LOCK_FLAG          (1<<23)    /* Only Locking masters gain access to the bus */
 
-extern int __init pxa27x_set_pwrmode(unsigned int mode);
+extern int pxa27x_set_pwrmode(unsigned int mode);
 extern void pxa27x_cpu_pm_enter(suspend_state_t state);
 
 #endif /* __MACH_PXA27x_H */
index 4823d972e64745dd4ae10dbfed0138eb46d10311..5fcd4f094900b810b6fd902903c53fe27fb672ec 100644 (file)
@@ -23,6 +23,7 @@
 #include <linux/ioport.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/partitions.h>
+#include <linux/pwm.h>
 #include <linux/pwm_backlight.h>
 #include <linux/smc91x.h>
 
@@ -271,11 +272,14 @@ static struct platform_device lpd270_flash_device[2] = {
        },
 };
 
+static struct pwm_lookup lpd270_pwm_lookup[] = {
+       PWM_LOOKUP("pxa27x-pwm.0", 0, "pwm-backlight.0", NULL, 78770,
+                  PWM_POLARITY_NORMAL),
+};
+
 static struct platform_pwm_backlight_data lpd270_backlight_data = {
-       .pwm_id         = 0,
        .max_brightness = 1,
        .dft_brightness = 1,
-       .pwm_period_ns  = 78770,
        .enable_gpio    = -1,
 };
 
@@ -474,6 +478,7 @@ static void __init lpd270_init(void)
         */
        ARB_CNTRL = ARB_CORE_PARK | 0x234;
 
+       pwm_add_table(lpd270_pwm_lookup, ARRAY_SIZE(lpd270_pwm_lookup));
        platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
 
        pxa_set_ac97_info(NULL);
index a9761c293028cebd348fbf7e43facdf34b166376..896b268c3ab76a70e13c5702fd92df5f9134e0ac 100644 (file)
 #include <linux/mfd/htc-pasic3.h>
 #include <linux/mtd/physmap.h>
 #include <linux/pda_power.h>
+#include <linux/pwm.h>
 #include <linux/pwm_backlight.h>
 #include <linux/regulator/driver.h>
+#include <linux/regulator/fixed.h>
 #include <linux/regulator/gpio-regulator.h>
 #include <linux/regulator/machine.h>
 #include <linux/usb/gpio_vbus.h>
 #include <linux/platform_data/irda-pxaficp.h>
 #include <linux/platform_data/usb-ohci-pxa27x.h>
 
+#include <linux/regulator/max1586.h>
+
+#include <linux/platform_data/pxa2xx_udc.h>
+#include <mach/udc.h>
+#include <mach/pxa27x-udc.h>
+
 #include "devices.h"
 #include "generic.h"
 
@@ -52,36 +60,36 @@ static unsigned long magician_pin_config[] __initdata = {
        GPIO20_nSDCS_2,
        GPIO21_nSDCS_3,
        GPIO15_nCS_1,
-       GPIO78_nCS_2,   /* PASIC3 */
-       GPIO79_nCS_3,   /* EGPIO CPLD */
+       GPIO78_nCS_2,   /* PASIC3 */
+       GPIO79_nCS_3,   /* EGPIO CPLD */
        GPIO80_nCS_4,
        GPIO33_nCS_5,
 
-       /* I2C */
+       /* I2C UDA1380 + OV9640 */
        GPIO117_I2C_SCL,
        GPIO118_I2C_SDA,
 
-       /* PWM 0 */
+       /* PWM 0 - LCD backlight */
        GPIO16_PWM0_OUT,
 
-       /* I2S */
+       /* I2S UDA1380 capture */
        GPIO28_I2S_BITCLK_OUT,
        GPIO29_I2S_SDATA_IN,
        GPIO31_I2S_SYNC,
        GPIO113_I2S_SYSCLK,
 
-       /* SSP 1 */
+       /* SSP 1 UDA1380 playback */
        GPIO23_SSP1_SCLK,
        GPIO24_SSP1_SFRM,
        GPIO25_SSP1_TXD,
 
-       /* SSP 2 */
+       /* SSP 2 TSC2046 touchscreen */
        GPIO19_SSP2_SCLK,
        GPIO14_SSP2_SFRM,
        GPIO89_SSP2_TXD,
        GPIO88_SSP2_RXD,
 
-       /* MMC */
+       /* MMC/SD/SDHC slot */
        GPIO32_MMC_CLK,
        GPIO92_MMC_DAT_0,
        GPIO109_MMC_DAT_1,
@@ -92,7 +100,7 @@ static unsigned long magician_pin_config[] __initdata = {
        /* LCD */
        GPIOxx_LCD_TFT_16BPP,
 
-       /* QCI */
+       /* QCI camera interface */
        GPIO12_CIF_DD_7,
        GPIO17_CIF_DD_6,
        GPIO50_CIF_DD_3,
@@ -120,12 +128,13 @@ static unsigned long magician_pin_config[] __initdata = {
 };
 
 /*
- * IRDA
+ * IrDA
  */
 
 static struct pxaficp_platform_data magician_ficp_info = {
        .gpio_pwdown            = GPIO83_MAGICIAN_nIR_EN,
        .transceiver_cap        = IR_SIRMODE | IR_OFF,
+       .gpio_pwdown_inverted   = 0,
 };
 
 /*
@@ -134,11 +143,11 @@ static struct pxaficp_platform_data magician_ficp_info = {
 
 #define INIT_KEY(_code, _gpio, _desc)  \
        {                               \
-               .code   = KEY_##_code,  \
-               .gpio   = _gpio,        \
-               .desc   = _desc,        \
-               .type   = EV_KEY,       \
-               .wakeup = 1,            \
+               .code   = KEY_##_code,  \
+               .gpio   = _gpio,        \
+               .desc   = _desc,        \
+               .type   = EV_KEY,       \
+               .wakeup = 1,            \
        }
 
 static struct gpio_keys_button magician_button_table[] = {
@@ -160,164 +169,162 @@ static struct gpio_keys_button magician_button_table[] = {
 };
 
 static struct gpio_keys_platform_data gpio_keys_data = {
-       .buttons  = magician_button_table,
-       .nbuttons = ARRAY_SIZE(magician_button_table),
+       .buttons        = magician_button_table,
+       .nbuttons       = ARRAY_SIZE(magician_button_table),
 };
 
 static struct platform_device gpio_keys = {
-       .name = "gpio-keys",
-       .dev  = {
+       .name   = "gpio-keys",
+       .dev    = {
                .platform_data = &gpio_keys_data,
        },
-       .id   = -1,
+       .id     = -1,
 };
 
-
 /*
  * EGPIO (Xilinx CPLD)
  *
- * 7 32-bit aligned 8-bit registers: 3x output, 1x irq, 3x input
+ * 32-bit aligned 8-bit registers
+ * 16 possible registers (reg windows size), only 7 used:
+ * 3x output, 1x irq, 3x input
  */
 
 static struct resource egpio_resources[] = {
        [0] = {
-               .start = PXA_CS3_PHYS,
-               .end   = PXA_CS3_PHYS + 0x20 - 1,
-               .flags = IORESOURCE_MEM,
+               .start  = PXA_CS3_PHYS,
+               .end    = PXA_CS3_PHYS + 0x20 - 1,
+               .flags  = IORESOURCE_MEM,
        },
        [1] = {
-               .start = PXA_GPIO_TO_IRQ(GPIO13_MAGICIAN_CPLD_IRQ),
-               .end   = PXA_GPIO_TO_IRQ(GPIO13_MAGICIAN_CPLD_IRQ),
-               .flags = IORESOURCE_IRQ,
+               .start  = PXA_GPIO_TO_IRQ(GPIO13_MAGICIAN_CPLD_IRQ),
+               .end    = PXA_GPIO_TO_IRQ(GPIO13_MAGICIAN_CPLD_IRQ),
+               .flags  = IORESOURCE_IRQ,
        },
 };
 
 static struct htc_egpio_chip egpio_chips[] = {
        [0] = {
-               .reg_start = 0,
-               .gpio_base = MAGICIAN_EGPIO(0, 0),
-               .num_gpios = 24,
-               .direction = HTC_EGPIO_OUTPUT,
-               .initial_values = 0x40, /* EGPIO_MAGICIAN_GSM_RESET */
+               .reg_start      = 0,
+               .gpio_base      = MAGICIAN_EGPIO(0, 0),
+               .num_gpios      = 24,
+               .direction      = HTC_EGPIO_OUTPUT,
+               /*
+                * Depends on modules configuration
+                */
+               .initial_values = 0x40, /* EGPIO_MAGICIAN_GSM_RESET */
        },
        [1] = {
-               .reg_start = 4,
-               .gpio_base = MAGICIAN_EGPIO(4, 0),
-               .num_gpios = 24,
-               .direction = HTC_EGPIO_INPUT,
+               .reg_start      = 4,
+               .gpio_base      = MAGICIAN_EGPIO(4, 0),
+               .num_gpios      = 24,
+               .direction      = HTC_EGPIO_INPUT,
        },
 };
 
 static struct htc_egpio_platform_data egpio_info = {
-       .reg_width    = 8,
-       .bus_width    = 32,
-       .irq_base     = IRQ_BOARD_START,
-       .num_irqs     = 4,
-       .ack_register = 3,
-       .chip         = egpio_chips,
-       .num_chips    = ARRAY_SIZE(egpio_chips),
+       .reg_width      = 8,
+       .bus_width      = 32,
+       .irq_base       = IRQ_BOARD_START,
+       .num_irqs       = 4,
+       .ack_register   = 3,
+       .chip           = egpio_chips,
+       .num_chips      = ARRAY_SIZE(egpio_chips),
 };
 
 static struct platform_device egpio = {
-       .name          = "htc-egpio",
-       .id            = -1,
-       .resource      = egpio_resources,
-       .num_resources = ARRAY_SIZE(egpio_resources),
+       .name           = "htc-egpio",
+       .id             = -1,
+       .resource       = egpio_resources,
+       .num_resources  = ARRAY_SIZE(egpio_resources),
        .dev = {
                .platform_data = &egpio_info,
        },
 };
 
 /*
- * LCD - Toppoly TD028STEB1 or Samsung LTP280QV
+ * PXAFB LCD - Toppoly TD028STEB1 or Samsung LTP280QV
  */
 
 static struct pxafb_mode_info toppoly_modes[] = {
        {
-               .pixclock     = 96153,
-               .bpp          = 16,
-               .xres         = 240,
-               .yres         = 320,
-               .hsync_len    = 11,
-               .vsync_len    = 3,
-               .left_margin  = 19,
-               .upper_margin = 2,
-               .right_margin = 10,
-               .lower_margin = 2,
-               .sync         = 0,
+               .pixclock       = 96153,
+               .bpp            = 16,
+               .xres           = 240,
+               .yres           = 320,
+               .hsync_len      = 11,
+               .vsync_len      = 3,
+               .left_margin    = 19,
+               .upper_margin   = 2,
+               .right_margin   = 10,
+               .lower_margin   = 2,
+               .sync           = 0,
        },
 };
 
 static struct pxafb_mode_info samsung_modes[] = {
        {
-               .pixclock     = 96153,
-               .bpp          = 16,
-               .xres         = 240,
-               .yres         = 320,
-               .hsync_len    = 8,
-               .vsync_len    = 4,
-               .left_margin  = 9,
-               .upper_margin = 4,
-               .right_margin = 9,
-               .lower_margin = 4,
-               .sync         = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
+               .pixclock       = 226469,
+               .bpp            = 16,
+               .xres           = 240,
+               .yres           = 320,
+               .hsync_len      = 8,
+               .vsync_len      = 4,
+               .left_margin    = 9,
+               .upper_margin   = 4,
+               .right_margin   = 9,
+               .lower_margin   = 4,
+               .sync   = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
        },
 };
 
 static void toppoly_lcd_power(int on, struct fb_var_screeninfo *si)
 {
-       pr_debug("Toppoly LCD power\n");
+       pr_debug("Toppoly LCD power: %s\n", on ? "on" : "off");
 
        if (on) {
-               pr_debug("on\n");
                gpio_set_value(EGPIO_MAGICIAN_TOPPOLY_POWER, 1);
-               gpio_set_value(GPIO106_MAGICIAN_LCD_POWER_3, 1);
+               gpio_set_value(GPIO106_MAGICIAN_LCD_DCDC_NRESET, 1);
                udelay(2000);
                gpio_set_value(EGPIO_MAGICIAN_LCD_POWER, 1);
                udelay(2000);
                /* FIXME: enable LCDC here */
                udelay(2000);
-               gpio_set_value(GPIO104_MAGICIAN_LCD_POWER_1, 1);
+               gpio_set_value(GPIO104_MAGICIAN_LCD_VOFF_EN, 1);
                udelay(2000);
-               gpio_set_value(GPIO105_MAGICIAN_LCD_POWER_2, 1);
+               gpio_set_value(GPIO105_MAGICIAN_LCD_VON_EN, 1);
        } else {
-               pr_debug("off\n");
                msleep(15);
-               gpio_set_value(GPIO105_MAGICIAN_LCD_POWER_2, 0);
+               gpio_set_value(GPIO105_MAGICIAN_LCD_VON_EN, 0);
                udelay(500);
-               gpio_set_value(GPIO104_MAGICIAN_LCD_POWER_1, 0);
+               gpio_set_value(GPIO104_MAGICIAN_LCD_VOFF_EN, 0);
                udelay(1000);
-               gpio_set_value(GPIO106_MAGICIAN_LCD_POWER_3, 0);
+               gpio_set_value(GPIO106_MAGICIAN_LCD_DCDC_NRESET, 0);
                gpio_set_value(EGPIO_MAGICIAN_LCD_POWER, 0);
        }
 }
 
 static void samsung_lcd_power(int on, struct fb_var_screeninfo *si)
 {
-       pr_debug("Samsung LCD power\n");
+       pr_debug("Samsung LCD power: %s\n", on ? "on" : "off");
 
        if (on) {
-               pr_debug("on\n");
                if (system_rev < 3)
                        gpio_set_value(GPIO75_MAGICIAN_SAMSUNG_POWER, 1);
                else
                        gpio_set_value(EGPIO_MAGICIAN_LCD_POWER, 1);
-               mdelay(10);
-               gpio_set_value(GPIO106_MAGICIAN_LCD_POWER_3, 1);
-               mdelay(10);
-               gpio_set_value(GPIO104_MAGICIAN_LCD_POWER_1, 1);
-               mdelay(30);
-               gpio_set_value(GPIO105_MAGICIAN_LCD_POWER_2, 1);
-               mdelay(10);
+               mdelay(6);
+               gpio_set_value(GPIO106_MAGICIAN_LCD_DCDC_NRESET, 1);
+               mdelay(6);      /* Avdd -> Voff >5ms */
+               gpio_set_value(GPIO104_MAGICIAN_LCD_VOFF_EN, 1);
+               mdelay(16);     /* Voff -> Von >(5+10)ms */
+               gpio_set_value(GPIO105_MAGICIAN_LCD_VON_EN, 1);
        } else {
-               pr_debug("off\n");
-               mdelay(10);
-               gpio_set_value(GPIO105_MAGICIAN_LCD_POWER_2, 0);
-               mdelay(30);
-               gpio_set_value(GPIO104_MAGICIAN_LCD_POWER_1, 0);
-               mdelay(10);
-               gpio_set_value(GPIO106_MAGICIAN_LCD_POWER_3, 0);
-               mdelay(10);
+               gpio_set_value(GPIO105_MAGICIAN_LCD_VON_EN, 0);
+               mdelay(16);
+               gpio_set_value(GPIO104_MAGICIAN_LCD_VOFF_EN, 0);
+               mdelay(6);
+               gpio_set_value(GPIO106_MAGICIAN_LCD_DCDC_NRESET, 0);
+               mdelay(6);
                if (system_rev < 3)
                        gpio_set_value(GPIO75_MAGICIAN_SAMSUNG_POWER, 0);
                else
@@ -326,29 +333,43 @@ static void samsung_lcd_power(int on, struct fb_var_screeninfo *si)
 }
 
 static struct pxafb_mach_info toppoly_info = {
-       .modes           = toppoly_modes,
-       .num_modes       = 1,
-       .fixed_modes     = 1,
-       .lcd_conn       = LCD_COLOR_TFT_16BPP,
-       .pxafb_lcd_power = toppoly_lcd_power,
+       .modes                  = toppoly_modes,
+       .num_modes              = 1,
+       .fixed_modes            = 1,
+       .lcd_conn               = LCD_COLOR_TFT_16BPP,
+       .pxafb_lcd_power        = toppoly_lcd_power,
 };
 
 static struct pxafb_mach_info samsung_info = {
-       .modes           = samsung_modes,
-       .num_modes       = 1,
-       .fixed_modes     = 1,
-       .lcd_conn        = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL |\
-                          LCD_ALTERNATE_MAPPING,
-       .pxafb_lcd_power = samsung_lcd_power,
+       .modes                  = samsung_modes,
+       .num_modes              = 1,
+       .fixed_modes            = 1,
+       .lcd_conn               = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL |
+               LCD_ALTERNATE_MAPPING,
+       .pxafb_lcd_power        = samsung_lcd_power,
 };
 
 /*
  * Backlight
  */
 
+static struct pwm_lookup magician_pwm_lookup[] = {
+       PWM_LOOKUP("pxa27x-pwm.0", 0, "pwm-backlight", NULL, 30923,
+                  PWM_POLARITY_NORMAL),
+};
+
+ /*
+ * fixed regulator for pwm_backlight
+ */
+
+static struct regulator_consumer_supply pwm_backlight_supply[] = {
+       REGULATOR_SUPPLY("power", "pwm_backlight"),
+};
+
+
 static struct gpio magician_bl_gpios[] = {
-       { EGPIO_MAGICIAN_BL_POWER,  GPIOF_DIR_OUT, "Backlight power" },
-       { EGPIO_MAGICIAN_BL_POWER2, GPIOF_DIR_OUT, "Backlight power 2" },
+       { EGPIO_MAGICIAN_BL_POWER,      GPIOF_DIR_OUT, "Backlight power" },
+       { EGPIO_MAGICIAN_BL_POWER2,     GPIOF_DIR_OUT, "Backlight power 2" },
 };
 
 static int magician_backlight_init(struct device *dev)
@@ -358,6 +379,7 @@ static int magician_backlight_init(struct device *dev)
 
 static int magician_backlight_notify(struct device *dev, int brightness)
 {
+       pr_debug("Brightness = %i\n", brightness);
        gpio_set_value(EGPIO_MAGICIAN_BL_POWER, brightness);
        if (brightness >= 200) {
                gpio_set_value(EGPIO_MAGICIAN_BL_POWER2, 1);
@@ -373,28 +395,33 @@ static void magician_backlight_exit(struct device *dev)
        gpio_free_array(ARRAY_AND_SIZE(magician_bl_gpios));
 }
 
+/*
+ * LCD PWM backlight (main)
+ *
+ * MP1521 frequency should be:
+ *     100-400 Hz = 2 .5*10^6 - 10 *10^6 ns
+ */
+
 static struct platform_pwm_backlight_data backlight_data = {
-       .pwm_id         = 0,
-       .max_brightness = 272,
-       .dft_brightness = 100,
-       .pwm_period_ns  = 30923,
-       .enable_gpio    = -1,
-       .init           = magician_backlight_init,
-       .notify         = magician_backlight_notify,
-       .exit           = magician_backlight_exit,
+       .max_brightness = 272,
+       .dft_brightness = 100,
+       .enable_gpio    = -1,
+       .init           = magician_backlight_init,
+       .notify         = magician_backlight_notify,
+       .exit           = magician_backlight_exit,
 };
 
 static struct platform_device backlight = {
-       .name = "pwm-backlight",
-       .id   = -1,
-       .dev  = {
-               .parent        = &pxa27x_device_pwm0.dev,
-               .platform_data = &backlight_data,
+       .name   = "pwm-backlight",
+       .id     = -1,
+       .dev    = {
+               .parent         = &pxa27x_device_pwm0.dev,
+               .platform_data  = &backlight_data,
        },
 };
 
 /*
- * LEDs
+ * GPIO LEDs, Phone keys backlight, vibra
  */
 
 static struct gpio_led gpio_leds[] = {
@@ -416,69 +443,32 @@ static struct gpio_led_platform_data gpio_led_info = {
 };
 
 static struct platform_device leds_gpio = {
-       .name = "leds-gpio",
-       .id   = -1,
-       .dev  = {
+       .name   = "leds-gpio",
+       .id     = -1,
+       .dev    = {
                .platform_data = &gpio_led_info,
        },
 };
 
-static struct pasic3_led pasic3_leds[] = {
-       {
-               .led = {
-                       .name            = "magician:red",
-                       .default_trigger = "ds2760-battery.0-charging",
-               },
-               .hw_num = 0,
-               .bit2   = PASIC3_BIT2_LED0,
-               .mask   = PASIC3_MASK_LED0,
-       },
-       {
-               .led = {
-                       .name            = "magician:green",
-                       .default_trigger = "ds2760-battery.0-charging-or-full",
-               },
-               .hw_num = 1,
-               .bit2   = PASIC3_BIT2_LED1,
-               .mask   = PASIC3_MASK_LED1,
-       },
-       {
-               .led = {
-                       .name            = "magician:blue",
-                       .default_trigger = "bluetooth",
-               },
-               .hw_num = 2,
-               .bit2   = PASIC3_BIT2_LED2,
-               .mask   = PASIC3_MASK_LED2,
-       },
-};
-
-static struct pasic3_leds_machinfo pasic3_leds_info = {
-       .num_leds   = ARRAY_SIZE(pasic3_leds),
-       .power_gpio = EGPIO_MAGICIAN_LED_POWER,
-       .leds       = pasic3_leds,
-};
-
 /*
  * PASIC3 with DS1WM
  */
 
 static struct resource pasic3_resources[] = {
        [0] = {
-               .start  = PXA_CS2_PHYS,
+               .start  = PXA_CS2_PHYS,
                .end    = PXA_CS2_PHYS + 0x1b,
-               .flags  = IORESOURCE_MEM,
+               .flags  = IORESOURCE_MEM,
        },
        /* No IRQ handler in the PASIC3, DS1WM needs an external IRQ */
        [1] = {
-               .start  = PXA_GPIO_TO_IRQ(GPIO107_MAGICIAN_DS1WM_IRQ),
-               .end    = PXA_GPIO_TO_IRQ(GPIO107_MAGICIAN_DS1WM_IRQ),
-               .flags  = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
+               .start  = PXA_GPIO_TO_IRQ(GPIO107_MAGICIAN_DS1WM_IRQ),
+               .end    = PXA_GPIO_TO_IRQ(GPIO107_MAGICIAN_DS1WM_IRQ),
+               .flags  = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
        }
 };
 
 static struct pasic3_platform_data pasic3_platform_data = {
-       .led_pdata  = &pasic3_leds_info,
        .clock_rate = 4000000,
 };
 
@@ -493,25 +483,42 @@ static struct platform_device pasic3 = {
 };
 
 /*
- * USB "Transceiver"
+ * PXA UDC
+ */
+
+static void magician_udc_command(int cmd)
+{
+       if (cmd == PXA2XX_UDC_CMD_CONNECT)
+               UP2OCR |= UP2OCR_DPPUE | UP2OCR_DPPUBE;
+       else if (cmd == PXA2XX_UDC_CMD_DISCONNECT)
+               UP2OCR &= ~(UP2OCR_DPPUE | UP2OCR_DPPUBE);
+}
+
+static struct pxa2xx_udc_mach_info magician_udc_info __initdata = {
+       .udc_command    = magician_udc_command,
+       .gpio_pullup    = GPIO27_MAGICIAN_USBC_PUEN,
+};
+
+/*
+ * USB device VBus detection
  */
 
 static struct resource gpio_vbus_resource = {
-       .flags = IORESOURCE_IRQ,
-       .start = IRQ_MAGICIAN_VBUS,
-       .end   = IRQ_MAGICIAN_VBUS,
+       .flags  = IORESOURCE_IRQ,
+       .start  = IRQ_MAGICIAN_VBUS,
+       .end    = IRQ_MAGICIAN_VBUS,
 };
 
 static struct gpio_vbus_mach_info gpio_vbus_info = {
-       .gpio_pullup = GPIO27_MAGICIAN_USBC_PUEN,
-       .gpio_vbus   = EGPIO_MAGICIAN_CABLE_STATE_USB,
+       .gpio_pullup    = GPIO27_MAGICIAN_USBC_PUEN,
+       .gpio_vbus      = EGPIO_MAGICIAN_CABLE_VBUS,
 };
 
 static struct platform_device gpio_vbus = {
-       .name          = "gpio-vbus",
-       .id            = -1,
-       .num_resources = 1,
-       .resource      = &gpio_vbus_resource,
+       .name           = "gpio-vbus",
+       .id             = -1,
+       .num_resources  = 1,
+       .resource       = &gpio_vbus_resource,
        .dev = {
                .platform_data = &gpio_vbus_info,
        },
@@ -521,19 +528,60 @@ static struct platform_device gpio_vbus = {
  * External power
  */
 
-static int power_supply_init(struct device *dev)
+static int magician_supply_init(struct device *dev)
+{
+       int ret = -1;
+
+       ret = gpio_request(EGPIO_MAGICIAN_CABLE_TYPE, "Cable is AC charger");
+       if (ret) {
+               pr_err("Cannot request AC/USB charger GPIO (%i)\n", ret);
+               goto err_ac;
+       }
+
+       ret = gpio_request(EGPIO_MAGICIAN_CABLE_INSERTED, "Cable inserted");
+       if (ret) {
+               pr_err("Cannot request cable detection GPIO (%i)\n", ret);
+               goto err_usb;
+       }
+
+       return 0;
+
+err_usb:
+       gpio_free(EGPIO_MAGICIAN_CABLE_TYPE);
+err_ac:
+       return ret;
+}
+
+static void magician_set_charge(int flags)
 {
-       return gpio_request(EGPIO_MAGICIAN_CABLE_STATE_AC, "CABLE_STATE_AC");
+       if (flags & PDA_POWER_CHARGE_AC) {
+               pr_debug("Charging from AC\n");
+               gpio_set_value(EGPIO_MAGICIAN_NICD_CHARGE, 1);
+       } else if (flags & PDA_POWER_CHARGE_USB) {
+               pr_debug("Charging from USB\n");
+               gpio_set_value(EGPIO_MAGICIAN_NICD_CHARGE, 1);
+       } else {
+               pr_debug("Charging disabled\n");
+               gpio_set_value(EGPIO_MAGICIAN_NICD_CHARGE, 0);
+       }
 }
 
 static int magician_is_ac_online(void)
 {
-       return gpio_get_value(EGPIO_MAGICIAN_CABLE_STATE_AC);
+       return gpio_get_value(EGPIO_MAGICIAN_CABLE_INSERTED) &&
+               gpio_get_value(EGPIO_MAGICIAN_CABLE_TYPE); /* AC=1 */
 }
 
-static void power_supply_exit(struct device *dev)
+static int magician_is_usb_online(void)
 {
-       gpio_free(EGPIO_MAGICIAN_CABLE_STATE_AC);
+       return gpio_get_value(EGPIO_MAGICIAN_CABLE_INSERTED) &&
+               (!gpio_get_value(EGPIO_MAGICIAN_CABLE_TYPE)); /* USB=0 */
+}
+
+static void magician_supply_exit(struct device *dev)
+{
+       gpio_free(EGPIO_MAGICIAN_CABLE_INSERTED);
+       gpio_free(EGPIO_MAGICIAN_CABLE_TYPE);
 }
 
 static char *magician_supplicants[] = {
@@ -541,38 +589,40 @@ static char *magician_supplicants[] = {
 };
 
 static struct pda_power_pdata power_supply_info = {
-       .init            = power_supply_init,
-       .is_ac_online    = magician_is_ac_online,
-       .exit            = power_supply_exit,
-       .supplied_to     = magician_supplicants,
-       .num_supplicants = ARRAY_SIZE(magician_supplicants),
+       .init                   = magician_supply_init,
+       .exit                   = magician_supply_exit,
+       .is_ac_online           = magician_is_ac_online,
+       .is_usb_online          = magician_is_usb_online,
+       .set_charge             = magician_set_charge,
+       .supplied_to            = magician_supplicants,
+       .num_supplicants        = ARRAY_SIZE(magician_supplicants),
 };
 
 static struct resource power_supply_resources[] = {
        [0] = {
-               .name  = "ac",
-               .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE |
-                        IORESOURCE_IRQ_LOWEDGE,
-               .start = IRQ_MAGICIAN_VBUS,
-               .end   = IRQ_MAGICIAN_VBUS,
+               .name   = "ac",
+               .flags  = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE |
+                       IORESOURCE_IRQ_LOWEDGE,
+               .start  = IRQ_MAGICIAN_VBUS,
+               .end    = IRQ_MAGICIAN_VBUS,
        },
        [1] = {
-               .name  = "usb",
-               .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE |
-                        IORESOURCE_IRQ_LOWEDGE,
-               .start = IRQ_MAGICIAN_VBUS,
-               .end   = IRQ_MAGICIAN_VBUS,
+               .name   = "usb",
+               .flags  = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE |
+                       IORESOURCE_IRQ_LOWEDGE,
+               .start  = IRQ_MAGICIAN_VBUS,
+               .end    = IRQ_MAGICIAN_VBUS,
        },
 };
 
 static struct platform_device power_supply = {
-       .name = "pda-power",
-       .id   = -1,
-       .dev  = {
+       .name   = "pda-power",
+       .id     = -1,
+       .dev = {
                .platform_data = &power_supply_info,
        },
-       .resource      = power_supply_resources,
-       .num_resources = ARRAY_SIZE(power_supply_resources),
+       .resource       = power_supply_resources,
+       .num_resources  = ARRAY_SIZE(power_supply_resources),
 };
 
 /*
@@ -586,11 +636,12 @@ static struct regulator_consumer_supply bq24022_consumers[] = {
 
 static struct regulator_init_data bq24022_init_data = {
        .constraints = {
-               .max_uA         = 500000,
-               .valid_ops_mask = REGULATOR_CHANGE_CURRENT | REGULATOR_CHANGE_STATUS,
+               .max_uA         = 500000,
+               .valid_ops_mask = REGULATOR_CHANGE_CURRENT |
+                       REGULATOR_CHANGE_STATUS,
        },
-       .num_consumer_supplies  = ARRAY_SIZE(bq24022_consumers),
-       .consumer_supplies      = bq24022_consumers,
+       .num_consumer_supplies  = ARRAY_SIZE(bq24022_consumers),
+       .consumer_supplies      = bq24022_consumers,
 };
 
 static struct gpio bq24022_gpios[] = {
@@ -603,39 +654,85 @@ static struct gpio_regulator_state bq24022_states[] = {
 };
 
 static struct gpio_regulator_config bq24022_info = {
-       .supply_name = "bq24022",
+       .supply_name            = "bq24022",
 
-       .enable_gpio = GPIO30_MAGICIAN_BQ24022_nCHARGE_EN,
-       .enable_high = 0,
-       .enabled_at_boot = 0,
+       .enable_gpio            = GPIO30_MAGICIAN_BQ24022_nCHARGE_EN,
+       .enable_high            = 0,
+       .enabled_at_boot        = 1,
 
-       .gpios = bq24022_gpios,
-       .nr_gpios = ARRAY_SIZE(bq24022_gpios),
+       .gpios                  = bq24022_gpios,
+       .nr_gpios               = ARRAY_SIZE(bq24022_gpios),
 
-       .states = bq24022_states,
-       .nr_states = ARRAY_SIZE(bq24022_states),
+       .states                 = bq24022_states,
+       .nr_states              = ARRAY_SIZE(bq24022_states),
 
-       .type = REGULATOR_CURRENT,
-       .init_data = &bq24022_init_data,
+       .type                   = REGULATOR_CURRENT,
+       .init_data              = &bq24022_init_data,
 };
 
 static struct platform_device bq24022 = {
-       .name = "gpio-regulator",
-       .id   = -1,
-       .dev  = {
+       .name   = "gpio-regulator",
+       .id     = -1,
+       .dev    = {
                .platform_data = &bq24022_info,
        },
 };
 
+/*
+ * Vcore regulator MAX1587A
+ */
+
+static struct regulator_consumer_supply magician_max1587a_consumers[] = {
+       REGULATOR_SUPPLY("vcc_core", NULL),
+};
+
+static struct regulator_init_data magician_max1587a_v3_info = {
+       .constraints = {
+               .name           = "vcc_core range",
+               .min_uV         = 700000,
+               .max_uV         = 1475000,
+               .always_on      = 1,
+               .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
+       },
+       .consumer_supplies      = magician_max1587a_consumers,
+       .num_consumer_supplies  = ARRAY_SIZE(magician_max1587a_consumers),
+};
+
+static struct max1586_subdev_data magician_max1587a_subdevs[] = {
+       {
+               .name           = "vcc_core",
+               .id             = MAX1586_V3,
+               .platform_data  = &magician_max1587a_v3_info,
+       }
+};
+
+static struct max1586_platform_data magician_max1587a_info = {
+       .subdevs     = magician_max1587a_subdevs,
+       .num_subdevs = ARRAY_SIZE(magician_max1587a_subdevs),
+       /*
+        * NOTICE measured directly on the PCB (board_id == 0x3a), but
+        * if R24 is present, it will boost the voltage
+        * (write 1.475V, get 1.645V and smoke)
+        */
+       .v3_gain     = MAX1586_GAIN_NO_R24,
+};
+
+static struct i2c_board_info magician_pwr_i2c_board_info[] __initdata = {
+       {
+               I2C_BOARD_INFO("max1586", 0x14),
+               .platform_data  = &magician_max1587a_info,
+       },
+};
+
 /*
  * MMC/SD
  */
 
 static int magician_mci_init(struct device *dev,
-                               irq_handler_t detect_irq, void *data)
+       irq_handler_t detect_irq, void *data)
 {
        return request_irq(IRQ_MAGICIAN_SD, detect_irq, 0,
-                          "mmc card detect", data);
+               "mmc card detect", data);
 }
 
 static void magician_mci_exit(struct device *dev, void *data)
@@ -644,9 +741,9 @@ static void magician_mci_exit(struct device *dev, void *data)
 }
 
 static struct pxamci_platform_data magician_mci_info = {
-       .ocr_mask               = MMC_VDD_32_33|MMC_VDD_33_34,
-       .init                   = magician_mci_init,
-       .exit                   = magician_mci_exit,
+       .ocr_mask               = MMC_VDD_32_33|MMC_VDD_33_34,
+       .init                   = magician_mci_init,
+       .exit                   = magician_mci_exit,
        .gpio_card_detect       = -1,
        .gpio_card_ro           = EGPIO_MAGICIAN_nSD_READONLY,
        .gpio_card_ro_invert    = 1,
@@ -660,47 +757,102 @@ static struct pxamci_platform_data magician_mci_info = {
 
 static struct pxaohci_platform_data magician_ohci_info = {
        .port_mode      = PMM_PERPORT_MODE,
-       .flags          = ENABLE_PORT1 | ENABLE_PORT3 | POWER_CONTROL_LOW,
+       /* port1: CSR Bluetooth, port2: OTG with UDC */
+       .flags          = ENABLE_PORT1 | ENABLE_PORT2 | POWER_CONTROL_LOW,
        .power_budget   = 0,
+       .power_on_delay = 100,
 };
 
-
 /*
  * StrataFlash
  */
 
+static int magician_flash_init(struct platform_device *pdev)
+{
+       int ret = gpio_request(EGPIO_MAGICIAN_FLASH_VPP, "flash Vpp enable");
+
+       if (ret) {
+               pr_err("Cannot request flash enable GPIO (%i)\n", ret);
+               return ret;
+       }
+
+       ret = gpio_direction_output(EGPIO_MAGICIAN_FLASH_VPP, 1);
+       if (ret) {
+               pr_err("Cannot set direction for flash enable (%i)\n", ret);
+               gpio_free(EGPIO_MAGICIAN_FLASH_VPP);
+       }
+
+       return ret;
+}
+
 static void magician_set_vpp(struct platform_device *pdev, int vpp)
 {
        gpio_set_value(EGPIO_MAGICIAN_FLASH_VPP, vpp);
 }
 
+static void magician_flash_exit(struct platform_device *pdev)
+{
+       gpio_free(EGPIO_MAGICIAN_FLASH_VPP);
+}
+
 static struct resource strataflash_resource = {
-       .start = PXA_CS0_PHYS,
-       .end   = PXA_CS0_PHYS + SZ_64M - 1,
-       .flags = IORESOURCE_MEM,
+       .start  = PXA_CS0_PHYS,
+       .end    = PXA_CS0_PHYS + SZ_64M - 1,
+       .flags  = IORESOURCE_MEM,
 };
 
+static struct mtd_partition magician_flash_parts[] = {
+       {
+               .name           = "Bootloader",
+               .offset         = 0x0,
+               .size           = 0x40000,
+               .mask_flags     = MTD_WRITEABLE, /* EXPERIMENTAL */
+       },
+       {
+               .name           = "Linux Kernel",
+               .offset         = 0x40000,
+               .size           = MTDPART_SIZ_FULL,
+       },
+};
+
+/*
+ * physmap-flash driver
+ */
+
 static struct physmap_flash_data strataflash_data = {
-       .width = 4,
-       .set_vpp = magician_set_vpp,
+       .width          = 4,
+       .init           = magician_flash_init,
+       .set_vpp        = magician_set_vpp,
+       .exit           = magician_flash_exit,
+       .parts          = magician_flash_parts,
+       .nr_parts       = ARRAY_SIZE(magician_flash_parts),
 };
 
 static struct platform_device strataflash = {
-       .name          = "physmap-flash",
-       .id            = -1,
-       .resource      = &strataflash_resource,
-       .num_resources = 1,
+       .name           = "physmap-flash",
+       .id             = -1,
+       .resource       = &strataflash_resource,
+       .num_resources  = 1,
        .dev = {
                .platform_data = &strataflash_data,
        },
 };
 
 /*
- * I2C
+ * PXA I2C main controller
  */
 
 static struct i2c_pxa_platform_data i2c_info = {
-       .fast_mode = 1,
+       /* OV9640 I2C device doesn't support fast mode */
+       .fast_mode      = 0,
+};
+
+/*
+ * PXA I2C power controller
+ */
+
+static struct i2c_pxa_platform_data magician_i2c_power_info = {
+       .fast_mode      = 1,
 };
 
 /*
@@ -720,12 +872,13 @@ static struct platform_device *devices[] __initdata = {
 };
 
 static struct gpio magician_global_gpios[] = {
-       { GPIO13_MAGICIAN_CPLD_IRQ,   GPIOF_IN, "CPLD_IRQ" },
+       { GPIO13_MAGICIAN_CPLD_IRQ, GPIOF_IN, "CPLD_IRQ" },
        { GPIO107_MAGICIAN_DS1WM_IRQ, GPIOF_IN, "DS1WM_IRQ" },
-       { GPIO104_MAGICIAN_LCD_POWER_1, GPIOF_OUT_INIT_LOW, "LCD power 1" },
-       { GPIO105_MAGICIAN_LCD_POWER_2, GPIOF_OUT_INIT_LOW, "LCD power 2" },
-       { GPIO106_MAGICIAN_LCD_POWER_3, GPIOF_OUT_INIT_LOW, "LCD power 3" },
-       { GPIO83_MAGICIAN_nIR_EN, GPIOF_OUT_INIT_HIGH, "nIR_EN" },
+
+       /* NOTICE valid LCD init sequence */
+       { GPIO106_MAGICIAN_LCD_DCDC_NRESET, GPIOF_OUT_INIT_LOW, "LCD DCDC nreset" },
+       { GPIO104_MAGICIAN_LCD_VOFF_EN, GPIOF_OUT_INIT_LOW, "LCD VOFF enable" },
+       { GPIO105_MAGICIAN_LCD_VON_EN, GPIOF_OUT_INIT_LOW, "LCD VON enable" },
 };
 
 static void __init magician_init(void)
@@ -737,44 +890,55 @@ static void __init magician_init(void)
        pxa2xx_mfp_config(ARRAY_AND_SIZE(magician_pin_config));
        err = gpio_request_array(ARRAY_AND_SIZE(magician_global_gpios));
        if (err)
-               pr_err("magician: Failed to request GPIOs: %d\n", err);
+               pr_err("magician: Failed to request global GPIOs: %d\n", err);
 
        pxa_set_ffuart_info(NULL);
        pxa_set_btuart_info(NULL);
-       pxa_set_stuart_info(NULL);
 
-       platform_add_devices(ARRAY_AND_SIZE(devices));
+       pwm_add_table(magician_pwm_lookup, ARRAY_SIZE(magician_pwm_lookup));
 
        pxa_set_ficp_info(&magician_ficp_info);
-       pxa27x_set_i2c_power_info(NULL);
+       pxa27x_set_i2c_power_info(&magician_i2c_power_info);
        pxa_set_i2c_info(&i2c_info);
+
+       i2c_register_board_info(1,
+               ARRAY_AND_SIZE(magician_pwr_i2c_board_info));
+
        pxa_set_mci_info(&magician_mci_info);
        pxa_set_ohci_info(&magician_ohci_info);
+       pxa_set_udc_info(&magician_udc_info);
 
        /* Check LCD type we have */
        cpld = ioremap_nocache(PXA_CS3_PHYS, 0x1000);
        if (cpld) {
-               u8 board_id = __raw_readb(cpld+0x14);
+               u8 board_id = __raw_readb(cpld + 0x14);
+
                iounmap(cpld);
                system_rev = board_id & 0x7;
                lcd_select = board_id & 0x8;
                pr_info("LCD type: %s\n", lcd_select ? "Samsung" : "Toppoly");
                if (lcd_select && (system_rev < 3))
+                       /* NOTICE valid LCD init sequence */
                        gpio_request_one(GPIO75_MAGICIAN_SAMSUNG_POWER,
-                                        GPIOF_OUT_INIT_LOW, "SAMSUNG_POWER");
-               pxa_set_fb_info(NULL, lcd_select ? &samsung_info : &toppoly_info);
+                               GPIOF_OUT_INIT_LOW, "Samsung LCD Power");
+               pxa_set_fb_info(NULL,
+                       lcd_select ? &samsung_info : &toppoly_info);
        } else
                pr_err("LCD detection: CPLD mapping failed\n");
-}
 
+       regulator_register_always_on(0, "power", pwm_backlight_supply,
+               ARRAY_SIZE(pwm_backlight_supply), 5000000);
+
+       platform_add_devices(ARRAY_AND_SIZE(devices));
+}
 
 MACHINE_START(MAGICIAN, "HTC Magician")
-       .atag_offset = 0x100,
-       .map_io = pxa27x_map_io,
-       .nr_irqs = MAGICIAN_NR_IRQS,
-       .init_irq = pxa27x_init_irq,
-       .handle_irq = pxa27x_handle_irq,
-       .init_machine = magician_init,
+       .atag_offset    = 0x100,
+       .map_io         = pxa27x_map_io,
+       .nr_irqs        = MAGICIAN_NR_IRQS,
+       .init_irq       = pxa27x_init_irq,
+       .handle_irq     = pxa27x_handle_irq,
+       .init_machine   = magician_init,
        .init_time      = pxa_timer_init,
        .restart        = pxa_restart,
 MACHINE_END
index 2c0658cf6be261f7a7a6ea89409b0d3f52e5f0eb..c3a87c176d7277383f32fb1129a0320c3de84e11 100644 (file)
@@ -26,6 +26,7 @@
 #include <linux/mtd/partitions.h>
 #include <linux/input.h>
 #include <linux/gpio_keys.h>
+#include <linux/pwm.h>
 #include <linux/pwm_backlight.h>
 #include <linux/smc91x.h>
 #include <linux/i2c/pxa-i2c.h>
@@ -248,11 +249,14 @@ static struct platform_device mst_flash_device[2] = {
 };
 
 #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE)
+static struct pwm_lookup mainstone_pwm_lookup[] = {
+       PWM_LOOKUP("pxa27x-pwm.0", 0, "pwm-backlight.0", NULL, 78770,
+                  PWM_POLARITY_NORMAL),
+};
+
 static struct platform_pwm_backlight_data mainstone_backlight_data = {
-       .pwm_id         = 0,
        .max_brightness = 1023,
        .dft_brightness = 1023,
-       .pwm_period_ns  = 78770,
        .enable_gpio    = -1,
 };
 
@@ -266,9 +270,16 @@ static struct platform_device mainstone_backlight_device = {
 
 static void __init mainstone_backlight_register(void)
 {
-       int ret = platform_device_register(&mainstone_backlight_device);
-       if (ret)
+       int ret;
+
+       pwm_add_table(mainstone_pwm_lookup, ARRAY_SIZE(mainstone_pwm_lookup));
+
+       ret = platform_device_register(&mainstone_backlight_device);
+       if (ret) {
                printk(KERN_ERR "mainstone: failed to register backlight device: %d\n", ret);
+               pwm_remove_table(mainstone_pwm_lookup,
+                                ARRAY_SIZE(mainstone_pwm_lookup));
+       }
 }
 #else
 #define mainstone_backlight_register() do { } while (0)
index 29997bde277d1be730aa85d98a2ae17bc0bc2da5..3b52b1aa06594a7a591045f1b9f195307b0583f4 100644 (file)
@@ -26,6 +26,7 @@
 #include <linux/input.h>
 #include <linux/delay.h>
 #include <linux/gpio_keys.h>
+#include <linux/pwm.h>
 #include <linux/pwm_backlight.h>
 #include <linux/rtc.h>
 #include <linux/leds.h>
@@ -181,12 +182,15 @@ static unsigned long mioa701_pin_config[] = {
        MFP_CFG_OUT(GPIO116, AF0, DRIVE_HIGH),
 };
 
+static struct pwm_lookup mioa701_pwm_lookup[] = {
+       PWM_LOOKUP("pxa27x-pwm.0", 0, "pwm-backlight", NULL, 4000 * 1024,
+                  PWM_POLARITY_NORMAL),
+};
+
 /* LCD Screen and Backlight */
 static struct platform_pwm_backlight_data mioa701_backlight_data = {
-       .pwm_id         = 0,
        .max_brightness = 100,
        .dft_brightness = 50,
-       .pwm_period_ns  = 4000 * 1024,  /* Fl = 250kHz */
        .enable_gpio    = -1,
 };
 
@@ -678,6 +682,7 @@ MIO_SIMPLE_DEV(mioa701_led,   "leds-gpio",      &gpio_led_info)
 MIO_SIMPLE_DEV(pxa2xx_pcm,       "pxa2xx-pcm",     NULL)
 MIO_SIMPLE_DEV(mioa701_sound,    "mioa701-wm9713", NULL)
 MIO_SIMPLE_DEV(mioa701_board,    "mioa701-board",  NULL)
+MIO_SIMPLE_DEV(wm9713_acodec,    "wm9713-codec",   NULL);
 MIO_SIMPLE_DEV(gpio_vbus,        "gpio-vbus",      &gpio_vbus_data);
 MIO_SIMPLE_DEV(mioa701_camera,   "soc-camera-pdrv",&iclink);
 
@@ -685,6 +690,7 @@ static struct platform_device *devices[] __initdata = {
        &mioa701_gpio_keys,
        &mioa701_backlight,
        &mioa701_led,
+       &wm9713_acodec,
        &pxa2xx_pcm,
        &mioa701_sound,
        &power_dev,
@@ -751,6 +757,7 @@ static void __init mioa701_machine_init(void)
        pxa_set_udc_info(&mioa701_udc_info);
        pxa_set_ac97_info(&mioa701_ac97_info);
        pm_power_off = mioa701_poweroff;
+       pwm_add_table(mioa701_pwm_lookup, ARRAY_SIZE(mioa701_pwm_lookup));
        platform_add_devices(devices, ARRAY_SIZE(devices));
        gsm_init();
 
index e54a296fb81f8b045f814860c0dc729edb71d2c4..13eba2b26e0aa478e7e26eb541855be091ac68e0 100644 (file)
@@ -15,6 +15,7 @@
 #include <linux/gpio_keys.h>
 #include <linux/input.h>
 #include <linux/pda_power.h>
+#include <linux/pwm.h>
 #include <linux/pwm_backlight.h>
 #include <linux/gpio.h>
 #include <linux/wm97xx.h>
@@ -270,6 +271,11 @@ void __init palm27x_ac97_init(int minv, int maxv, int jack, int reset)
  * Backlight
  ******************************************************************************/
 #if defined(CONFIG_BACKLIGHT_PWM) || defined(CONFIG_BACKLIGHT_PWM_MODULE)
+static struct pwm_lookup palm27x_pwm_lookup[] = {
+       PWM_LOOKUP("pxa27x-pwm.0", 0, "pwm-backlight.0", NULL, 3500 * 1024,
+                  PWM_POLARITY_NORMAL),
+};
+
 static int palm_bl_power;
 static int palm_lcd_power;
 
@@ -318,10 +324,8 @@ static void palm27x_backlight_exit(struct device *dev)
 }
 
 static struct platform_pwm_backlight_data palm27x_backlight_data = {
-       .pwm_id         = 0,
        .max_brightness = 0xfe,
        .dft_brightness = 0x7e,
-       .pwm_period_ns  = 3500 * 1024,
        .enable_gpio    = -1,
        .init           = palm27x_backlight_init,
        .notify         = palm27x_backlight_notify,
@@ -340,6 +344,7 @@ void __init palm27x_pwm_init(int bl, int lcd)
 {
        palm_bl_power   = bl;
        palm_lcd_power  = lcd;
+       pwm_add_lookup(palm27x_pwm_lookup, ARRAY_SIZE(palm27x_pwm_lookup));
        platform_device_register(&palm27x_backlight);
 }
 #endif
index 7691c974ca4bd0b6ade4c467e3ea6a26c611d9ce..aebf6de62468962b9398f6ee299c0539920cbba8 100644 (file)
@@ -18,6 +18,7 @@
 #include <linux/delay.h>
 #include <linux/irq.h>
 #include <linux/input.h>
+#include <linux/pwm.h>
 #include <linux/pwm_backlight.h>
 #include <linux/gpio.h>
 #include <linux/input/matrix_keypad.h>
@@ -166,11 +167,14 @@ static inline void palmtc_keys_init(void) {}
  * Backlight
  ******************************************************************************/
 #if defined(CONFIG_BACKLIGHT_PWM) || defined(CONFIG_BACKLIGHT_PWM_MODULE)
+static struct pwm_lookup palmtc_pwm_lookup[] = {
+       PWM_LOOKUP("pxa25x-pwm.1", 0, "pwm-backlight.0", NULL, PALMTC_PERIOD_NS,
+                  PWM_PERIOD_NORMAL),
+};
+
 static struct platform_pwm_backlight_data palmtc_backlight_data = {
-       .pwm_id         = 1,
        .max_brightness = PALMTC_MAX_INTENSITY,
        .dft_brightness = PALMTC_MAX_INTENSITY,
-       .pwm_period_ns  = PALMTC_PERIOD_NS,
        .enable_gpio    = GPIO_NR_PALMTC_BL_POWER,
 };
 
@@ -184,6 +188,7 @@ static struct platform_device palmtc_backlight = {
 
 static void __init palmtc_pwm_init(void)
 {
+       pwm_add_table(palmtc_pwm_lookup, ARRAY_SIZE(palmtc_pwm_lookup));
        platform_device_register(&palmtc_backlight);
 }
 #else
index 956fd24ee6fdca69b63bed29ebe4b9ebe567fd83..e64bb4326e6969e4543da8593f6a3392cd87a999 100644 (file)
@@ -21,6 +21,7 @@
 #include <linux/gpio_keys.h>
 #include <linux/input.h>
 #include <linux/pda_power.h>
+#include <linux/pwm.h>
 #include <linux/pwm_backlight.h>
 #include <linux/gpio.h>
 #include <linux/wm97xx.h>
@@ -138,6 +139,11 @@ static struct platform_device palmte2_pxa_keys = {
 /******************************************************************************
  * Backlight
  ******************************************************************************/
+static struct pwm_lookup palmte2_pwm_lookup[] = {
+       PWM_LOOKUP("pxa25x-pwm.0", 0, "pwm-backlight.0", NULL,
+                  PALMTE2_PERIOD_NS, PWM_POLARITY_NORMAL),
+};
+
 static struct gpio palmte_bl_gpios[] = {
        { GPIO_NR_PALMTE2_BL_POWER, GPIOF_INIT_LOW, "Backlight power" },
        { GPIO_NR_PALMTE2_LCD_POWER, GPIOF_INIT_LOW, "LCD power" },
@@ -161,10 +167,8 @@ static void palmte2_backlight_exit(struct device *dev)
 }
 
 static struct platform_pwm_backlight_data palmte2_backlight_data = {
-       .pwm_id         = 0,
        .max_brightness = PALMTE2_MAX_INTENSITY,
        .dft_brightness = PALMTE2_MAX_INTENSITY,
-       .pwm_period_ns  = PALMTE2_PERIOD_NS,
        .enable_gpio    = -1,
        .init           = palmte2_backlight_init,
        .notify         = palmte2_backlight_notify,
@@ -355,6 +359,7 @@ static void __init palmte2_init(void)
        pxa_set_ac97_info(&palmte2_ac97_pdata);
        pxa_set_ficp_info(&palmte2_ficp_platform_data);
 
+       pwm_add_table(palmte2_pwm_lookup, ARRAY_SIZE(palmte2_pwm_lookup));
        platform_add_devices(devices, ARRAY_SIZE(devices));
 }
 
index d8319b54299a571d223321a53cd7776aa71ccece..b71c96f614f935317bfeb5d5b74b39a616aa64bd 100644 (file)
@@ -24,6 +24,7 @@
 #include <linux/platform_device.h>
 #include <linux/i2c.h>
 #include <linux/i2c/pxa-i2c.h>
+#include <linux/pwm.h>
 #include <linux/pwm_backlight.h>
 
 #include <media/mt9v022.h>
@@ -148,11 +149,14 @@ static struct pxafb_mach_info pcm990_fbinfo __initdata = {
 };
 #endif
 
+static struct pwm_lookup pcm990_pwm_lookup[] = {
+       PWM_LOOKUP("pxa27x-pwm.0", 0, "pwm-backlight.0", NULL, 78770,
+                  PWM_POLARITY_NORMAL),
+};
+
 static struct platform_pwm_backlight_data pcm990_backlight_data = {
-       .pwm_id         = 0,
        .max_brightness = 1023,
        .dft_brightness = 1023,
-       .pwm_period_ns  = 78770,
        .enable_gpio    = -1,
 };
 
@@ -542,6 +546,7 @@ void __init pcm990_baseboard_init(void)
 #ifndef CONFIG_PCM990_DISPLAY_NONE
        pxa_set_fb_info(NULL, &pcm990_fbinfo);
 #endif
+       pwm_add_table(pcm990_pwm_lookup, ARRAY_SIZE(pcm990_pwm_lookup));
        platform_device_register(&pcm990_backlight_device);
 
        /* MMC */
index 221260d5d1092364792e3eb181eea74a67462bc7..ffc4240285577919598820db167ec57c202fa2dd 100644 (file)
@@ -84,7 +84,7 @@ EXPORT_SYMBOL_GPL(pxa27x_configure_ac97reset);
  */
 static unsigned int pwrmode = PWRMODE_SLEEP;
 
-int __init pxa27x_set_pwrmode(unsigned int mode)
+int pxa27x_set_pwrmode(unsigned int mode)
 {
        switch (mode) {
        case PWRMODE_SLEEP:
index 88f70c37ad0dddef1fa85e9dd804c3c2fda41459..36571a9a44fecb47c18401b03f3a8775b0410cc8 100644 (file)
@@ -29,6 +29,7 @@
 #include <linux/leds.h>
 #include <linux/w1-gpio.h>
 #include <linux/sched.h>
+#include <linux/pwm.h>
 #include <linux/pwm_backlight.h>
 #include <linux/i2c.h>
 #include <linux/i2c/pxa-i2c.h>
@@ -507,7 +508,7 @@ static struct w1_gpio_platform_data w1_gpio_platform_data = {
        .ext_pullup_enable_pin  = -EINVAL,
 };
 
-struct platform_device raumfeld_w1_gpio_device = {
+static struct platform_device raumfeld_w1_gpio_device = {
        .name   = "w1-gpio",
        .dev    = {
                .platform_data = &w1_gpio_platform_data
@@ -531,13 +532,15 @@ static void __init raumfeld_w1_init(void)
  * Framebuffer device
  */
 
+static struct pwm_lookup raumfeld_pwm_lookup[] = {
+       PWM_LOOKUP("pxa27x-pwm.0", 0, "pwm-backlight", NULL, 10000,
+                  PWM_POLARITY_NORMAL),
+};
+
 /* PWM controlled backlight */
 static struct platform_pwm_backlight_data raumfeld_pwm_backlight_data = {
-       .pwm_id         = 0,
        .max_brightness = 100,
        .dft_brightness = 100,
-       /* 10000 ns = 10 ms ^= 100 kHz */
-       .pwm_period_ns  = 10000,
        .enable_gpio    = -1,
 };
 
@@ -618,6 +621,8 @@ static void __init raumfeld_lcd_init(void)
        } else {
                mfp_cfg_t raumfeld_pwm_pin_config = GPIO17_PWM0_OUT;
                pxa3xx_mfp_config(&raumfeld_pwm_pin_config, 1);
+               pwm_add_table(raumfeld_pwm_lookup,
+                             ARRAY_SIZE(raumfeld_pwm_lookup));
                platform_device_register(&raumfeld_pwm_backlight_device);
        }
 
@@ -629,7 +634,7 @@ static void __init raumfeld_lcd_init(void)
  * SPI devices
  */
 
-struct spi_gpio_platform_data raumfeld_spi_platform_data = {
+static struct spi_gpio_platform_data raumfeld_spi_platform_data = {
        .sck            = GPIO_SPI_CLK,
        .mosi           = GPIO_SPI_MOSI,
        .miso           = GPIO_SPI_MISO,
@@ -848,7 +853,7 @@ static void __init raumfeld_power_init(void)
 static struct regulator_consumer_supply audio_va_consumer_supply =
        REGULATOR_SUPPLY("va", "0-0048");
 
-struct regulator_init_data audio_va_initdata = {
+static struct regulator_init_data audio_va_initdata = {
        .consumer_supplies = &audio_va_consumer_supply,
        .num_consumer_supplies = 1,
        .constraints = {
@@ -880,7 +885,7 @@ static struct regulator_consumer_supply audio_dummy_supplies[] = {
        REGULATOR_SUPPLY("vlc", "0-0048"),
 };
 
-struct regulator_init_data audio_dummy_initdata = {
+static struct regulator_init_data audio_dummy_initdata = {
        .consumer_supplies = audio_dummy_supplies,
        .num_consumer_supplies = ARRAY_SIZE(audio_dummy_supplies),
        .constraints = {
@@ -928,7 +933,7 @@ static struct regulator_init_data vcc_mmc_init_data = {
        .num_consumer_supplies = 1,
 };
 
-struct max8660_subdev_data max8660_v6_subdev_data = {
+static struct max8660_subdev_data max8660_v6_subdev_data = {
        .id             = MAX8660_V6,
        .name           = "vmmc",
        .platform_data  = &vcc_mmc_init_data,
index a71da84e784b75fcf9f740758ee0cb0604d3f741..349a13a7621585cf4dbebf55c971cec80959b825 100644 (file)
@@ -18,6 +18,7 @@
 #include <linux/clk.h>
 #include <linux/gpio.h>
 #include <linux/smc91x.h>
+#include <linux/pwm.h>
 #include <linux/pwm_backlight.h>
 
 #include <asm/mach-types.h>
@@ -168,21 +169,24 @@ static inline void tavorevb_init_keypad(void) {}
 #endif /* CONFIG_KEYBOARD_PXA27x || CONFIG_KEYBOARD_PXA27x_MODULE */
 
 #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE)
+static struct pwm_lookup tavorevb_pwm_lookup[] = {
+       PWM_LOOKUP("pxa27x-pwm.0", 1, "pwm-backlight.0", NULL, 100000,
+                  PWM_POLARITY_NORMAL),
+       PWM_LOOKUP("pxa27x-pwm.0", 0, "pwm-backlight.1", NULL, 100000,
+                  PWM_POLARITY_NORMAL),
+};
+
 static struct platform_pwm_backlight_data tavorevb_backlight_data[] = {
        [0] = {
                /* primary backlight */
-               .pwm_id         = 2,
                .max_brightness = 100,
                .dft_brightness = 100,
-               .pwm_period_ns  = 100000,
                .enable_gpio    = -1,
        },
        [1] = {
                /* secondary backlight */
-               .pwm_id         = 0,
                .max_brightness = 100,
                .dft_brightness = 100,
-               .pwm_period_ns  = 100000,
                .enable_gpio    = -1,
        },
 };
@@ -470,6 +474,7 @@ static struct pxafb_mach_info tavorevb_lcd_info = {
 
 static void __init tavorevb_init_lcd(void)
 {
+       pwm_add_table(tavorevb_pwm_lookup, ARRAY_SIZE(tavorevb_pwm_lookup));
        platform_device_register(&tavorevb_backlight_devices[0]);
        platform_device_register(&tavorevb_backlight_devices[1]);
        pxa_set_fb_info(NULL, &tavorevb_lcd_info);
index 8ab26370107ea5d0df2742b1ac0ab31aa18eb425..7ecc61ad2bed08bb976d1f6be31851e2bd75e5cf 100644 (file)
@@ -39,6 +39,7 @@
 #include <linux/i2c/pxa-i2c.h>
 #include <linux/serial_8250.h>
 #include <linux/smc91x.h>
+#include <linux/pwm.h>
 #include <linux/pwm_backlight.h>
 #include <linux/usb/isp116x.h>
 #include <linux/mtd/mtd.h>
@@ -350,6 +351,11 @@ static struct pxafb_mach_info fb_info = {
        .lcd_conn               = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL,
 };
 
+static struct pwm_lookup viper_pwm_lookup[] = {
+       PWM_LOOKUP("pxa25x-pwm.0", 0, "pwm-backlight.0", NULL, 1000000,
+                  PWM_POLARITY_NORMAL),
+};
+
 static int viper_backlight_init(struct device *dev)
 {
        int ret;
@@ -398,10 +404,8 @@ static void viper_backlight_exit(struct device *dev)
 }
 
 static struct platform_pwm_backlight_data viper_backlight_data = {
-       .pwm_id         = 0,
        .max_brightness = 100,
        .dft_brightness = 100,
-       .pwm_period_ns  = 1000000,
        .enable_gpio    = -1,
        .init           = viper_backlight_init,
        .notify         = viper_backlight_notify,
@@ -939,6 +943,7 @@ static void __init viper_init(void)
                smc91x_device.num_resources--;
 
        pxa_set_i2c_info(NULL);
+       pwm_add_table(viper_pwm_lookup, ARRAY_SIZE(viper_pwm_lookup));
        platform_add_devices(viper_devs, ARRAY_SIZE(viper_devs));
 
        viper_init_vcore_gpios();
index e1a121b36cfa6eef0e9dec7155da7f929e1075ed..d9899d73e46bf8c8c1c5c09ff9b45629ded7066b 100644 (file)
@@ -16,6 +16,7 @@
 #include <linux/platform_device.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/partitions.h>
+#include <linux/pwm.h>
 #include <linux/pwm_backlight.h>
 #include <linux/z2_battery.h>
 #include <linux/dma-mapping.h>
@@ -199,21 +200,24 @@ static inline void z2_nor_init(void) {}
  * Backlight
  ******************************************************************************/
 #if defined(CONFIG_BACKLIGHT_PWM) || defined(CONFIG_BACKLIGHT_PWM_MODULE)
+static struct pwm_lookup z2_pwm_lookup[] = {
+       PWM_LOOKUP("pxa27x-pwm.1", 0, "pwm-backlight.0", NULL, 1260320,
+                  PWM_POLARITY_NORMAL),
+       PWM_LOOKUP("pxa27x-pwm.0", 1, "pwm-backlight.1", NULL, 1260320,
+                  PWM_POLARITY_NORMAL),
+};
+
 static struct platform_pwm_backlight_data z2_backlight_data[] = {
        [0] = {
                /* Keypad Backlight */
-               .pwm_id         = 1,
                .max_brightness = 1023,
                .dft_brightness = 0,
-               .pwm_period_ns  = 1260320,
                .enable_gpio    = -1,
        },
        [1] = {
                /* LCD Backlight */
-               .pwm_id         = 2,
                .max_brightness = 1023,
                .dft_brightness = 512,
-               .pwm_period_ns  = 1260320,
                .enable_gpio    = -1,
        },
 };
@@ -236,6 +240,7 @@ static struct platform_device z2_backlight_devices[2] = {
 };
 static void __init z2_pwm_init(void)
 {
+       pwm_add_table(z2_pwm_lookup, ARRAY_SIZE(z2_pwm_lookup));
        platform_device_register(&z2_backlight_devices[0]);
        platform_device_register(&z2_backlight_devices[1]);
 }
@@ -595,13 +600,11 @@ static struct spi_board_info spi_board_info[] __initdata = {
 };
 
 static struct pxa2xx_spi_master pxa_ssp1_master_info = {
-       .clock_enable   = CKEN_SSP,
        .num_chipselect = 1,
        .enable_dma     = 1,
 };
 
 static struct pxa2xx_spi_master pxa_ssp2_master_info = {
-       .clock_enable   = CKEN_SSP2,
        .num_chipselect = 1,
 };
 
index 77daea478e88709aa20568d30073ae3c625efa73..e20359a7433cc8c0d4b12bd5b403e9cc7852f61b 100644 (file)
@@ -19,6 +19,7 @@
 #include <linux/init.h>
 #include <linux/platform_device.h>
 #include <linux/gpio.h>
+#include <linux/pwm.h>
 #include <linux/pwm_backlight.h>
 #include <linux/smc91x.h>
 
@@ -120,11 +121,14 @@ static inline void zylonite_init_leds(void) {}
 #endif
 
 #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE)
+static struct pwm_lookup zylonite_pwm_lookup[] = {
+       PWM_LOOKUP("pxa27x-pwm.1", 1, "pwm-backlight.0", NULL, 10000,
+                  PWM_POLARITY_NORMAL),
+};
+
 static struct platform_pwm_backlight_data zylonite_backlight_data = {
-       .pwm_id         = 3,
        .max_brightness = 100,
        .dft_brightness = 100,
-       .pwm_period_ns  = 10000,
        .enable_gpio    = -1,
 };
 
@@ -206,6 +210,7 @@ static struct pxafb_mach_info zylonite_sharp_lcd_info = {
 
 static void __init zylonite_init_lcd(void)
 {
+       pwm_add_table(zylonite_pwm_lookup, ARRAY_SIZE(zylonite_pwm_lookup));
        platform_device_register(&zylonite_backlight_device);
 
        if (lcd_id & 0x20) {
index 5cde63a64b34d9d5ff2b6c1821d4a4caa77586ae..9b00123a315d253daa5183058f919f7fff98e41c 100644 (file)
@@ -49,7 +49,7 @@ extern void secondary_startup_arm(void);
 static DEFINE_SPINLOCK(boot_lock);
 
 #ifdef CONFIG_HOTPLUG_CPU
-static void __ref qcom_cpu_die(unsigned int cpu)
+static void qcom_cpu_die(unsigned int cpu)
 {
        wfi();
 }
index ac22dd41b13509e3195a21bbbeef0a24bdeb498c..968e2d1964f672536264d7bb6029907a03631e28 100644 (file)
@@ -90,7 +90,7 @@ static inline void platform_do_lowpower(unsigned int cpu, int *spurious)
  *
  * Called with IRQs disabled
  */
-void __ref realview_cpu_die(unsigned int cpu)
+void realview_cpu_die(unsigned int cpu)
 {
        int spurious = 0;
 
index d40d4f5244c6835e4e73205b9e91a20d55613c03..9f54300df4b3c519b17070f65301abae9ba31768 100644 (file)
@@ -25,6 +25,7 @@
 #include <linux/gpio.h>
 #include <linux/input.h>
 #include <linux/gpio_keys.h>
+#include <linux/pwm.h>
 #include <linux/pwm_backlight.h>
 #include <linux/i2c.h>
 #include <linux/leds.h>
@@ -469,6 +470,11 @@ static struct s3c24xx_mci_pdata h1940_mmc_cfg __initdata = {
        .ocr_avail     = MMC_VDD_32_33,
 };
 
+static struct pwm_lookup h1940_pwm_lookup[] = {
+       PWM_LOOKUP("samsung-pwm", 0, "pwm-backlight", NULL, 36296,
+                  PWM_POLARITY_NORMAL),
+};
+
 static int h1940_backlight_init(struct device *dev)
 {
        gpio_request(S3C2410_GPB(0), "Backlight");
@@ -503,11 +509,8 @@ static void h1940_backlight_exit(struct device *dev)
 
 
 static struct platform_pwm_backlight_data backlight_data = {
-       .pwm_id         = 0,
        .max_brightness = 100,
        .dft_brightness = 50,
-       /* tcnt = 0x31 */
-       .pwm_period_ns  = 36296,
        .enable_gpio    = -1,
        .init           = h1940_backlight_init,
        .notify         = h1940_backlight_notify,
@@ -725,6 +728,7 @@ static void __init h1940_init(void)
        gpio_request(H1940_LATCH_SD_POWER, "SD power");
        gpio_direction_output(H1940_LATCH_SD_POWER, 0);
 
+       pwm_add_table(h1940_pwm_lookup, ARRAY_SIZE(h1940_pwm_lookup));
        platform_add_devices(h1940_devices, ARRAY_SIZE(h1940_devices));
 
        gpio_request(S3C2410_GPA(1), "Red LED blink");
index 1d35ff375a01297726825ffdefd3d5253a852561..774c982a7b7ed4260a49ca01d7d9714b188f65d4 100644 (file)
@@ -375,6 +375,11 @@ static struct s3c2410fb_mach_info rx1950_lcd_cfg = {
 
 };
 
+static struct pwm_lookup rx1950_pwm_lookup[] = {
+       PWM_LOOKUP("samsung-pwm", 0, "pwm-backlight.0", NULL, 48000,
+                  PWM_POLARITY_NORMAL),
+};
+
 static struct pwm_device *lcd_pwm;
 
 static void rx1950_lcd_power(int enable)
@@ -520,10 +525,8 @@ static int rx1950_backlight_notify(struct device *dev, int brightness)
 }
 
 static struct platform_pwm_backlight_data rx1950_backlight_data = {
-       .pwm_id = 0,
        .max_brightness = 24,
        .dft_brightness = 4,
-       .pwm_period_ns = 48000,
        .enable_gpio = -1,
        .init = rx1950_backlight_init,
        .notify = rx1950_backlight_notify,
@@ -792,6 +795,7 @@ static void __init rx1950_init_machine(void)
        gpio_direction_output(S3C2410_GPA(4), 0);
        gpio_direction_output(S3C2410_GPJ(6), 0);
 
+       pwm_add_table(rx1950_pwm_lookup, ARRAY_SIZE(rx1950_pwm_lookup));
        platform_add_devices(rx1950_devices, ARRAY_SIZE(rx1950_devices));
 
        i2c_register_board_info(0, rx1950_i2c_devices,
index 38c323e68e3f910ba8e9ecb413f603161a44253d..e62e789f9aeeecd279c93ce6b8c7775e283074e4 100644 (file)
@@ -69,7 +69,6 @@ static struct samsung_bl_drvdata samsung_dfl_bl_data __initdata = {
        .plat_data = {
                .max_brightness = 255,
                .dft_brightness = 255,
-               .pwm_period_ns  = 78770,
                .enable_gpio    = -1,
                .init           = samsung_bl_init,
                .exit           = samsung_bl_exit,
@@ -111,7 +110,6 @@ void __init samsung_bl_set(struct samsung_bl_gpio_info *gpio_info,
        samsung_bl_data = &samsung_bl_drvdata->plat_data;
 
        /* Copy board specific data provided by user */
-       samsung_bl_data->pwm_id = bl_data->pwm_id;
        samsung_bl_device->dev.parent = &samsung_device_pwm.dev;
 
        if (bl_data->max_brightness)
@@ -120,8 +118,6 @@ void __init samsung_bl_set(struct samsung_bl_gpio_info *gpio_info,
                samsung_bl_data->dft_brightness = bl_data->dft_brightness;
        if (bl_data->lth_brightness)
                samsung_bl_data->lth_brightness = bl_data->lth_brightness;
-       if (bl_data->pwm_period_ns)
-               samsung_bl_data->pwm_period_ns = bl_data->pwm_period_ns;
        if (bl_data->enable_gpio >= 0)
                samsung_bl_data->enable_gpio = bl_data->enable_gpio;
        if (bl_data->init)
index 14bd9ae3f476a2f8c9dd8672e5e21ed9125b9ad4..f776adcdaee8c3e354d73eb65c1ced6c9a752f30 100644 (file)
@@ -25,6 +25,7 @@
 #include <linux/mmc/host.h>
 #include <linux/regulator/machine.h>
 #include <linux/regulator/fixed.h>
+#include <linux/pwm.h>
 #include <linux/pwm_backlight.h>
 #include <linux/dm9000.h>
 #include <linux/gpio_keys.h>
@@ -108,11 +109,14 @@ static struct s3c2410_uartcfg crag6410_uartcfgs[] __initdata = {
        },
 };
 
+static struct pwm_lookup crag6410_pwm_lookup[] = {
+       PWM_LOOKUP("samsung-pwm", 0, "pwm-backlight", NULL, 100000,
+                  PWM_POLARITY_NORMAL),
+};
+
 static struct platform_pwm_backlight_data crag6410_backlight_data = {
-       .pwm_id         = 0,
        .max_brightness = 1000,
        .dft_brightness = 600,
-       .pwm_period_ns  = 100000,       /* about 1kHz */
        .enable_gpio    = -1,
 };
 
@@ -843,6 +847,7 @@ static void __init crag6410_machine_init(void)
        samsung_keypad_set_platdata(&crag6410_keypad_data);
        s3c64xx_spi0_set_platdata(NULL, 0, 2);
 
+       pwm_add_table(crag6410_pwm_lookup, ARRAY_SIZE(crag6410_pwm_lookup));
        platform_add_devices(crag6410_devices, ARRAY_SIZE(crag6410_devices));
 
        gpio_led_register_device(-1, &gpio_leds_pdata);
index e4b087c58ee61ae14fbe69f8204c85d806909666..816b39d1e6d1b13c5a074676431b16efb145631c 100644 (file)
@@ -19,6 +19,7 @@
 #include <linux/gpio.h>
 #include <linux/delay.h>
 #include <linux/leds.h>
+#include <linux/pwm.h>
 #include <linux/pwm_backlight.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/partitions.h>
@@ -73,6 +74,11 @@ static struct s3c2410_uartcfg hmt_uartcfgs[] __initdata = {
        },
 };
 
+static struct pwm_lookup hmt_pwm_lookup[] = {
+       PWM_LOOKUP("samsung-pwm", 1, "pwm-backlight.0", NULL,
+                  1000000000 / (100 * 256 * 20), PWM_POLARITY_NORMAL),
+};
+
 static int hmt_bl_init(struct device *dev)
 {
        int ret;
@@ -110,10 +116,8 @@ static void hmt_bl_exit(struct device *dev)
 }
 
 static struct platform_pwm_backlight_data hmt_backlight_data = {
-       .pwm_id         = 1,
        .max_brightness = 100 * 256,
        .dft_brightness = 40 * 256,
-       .pwm_period_ns  = 1000000000 / (100 * 256 * 20),
        .enable_gpio    = -1,
        .init           = hmt_bl_init,
        .notify         = hmt_bl_notify,
@@ -268,6 +272,7 @@ static void __init hmt_machine_init(void)
        gpio_request(S3C64XX_GPF(13), "usb power");
        gpio_direction_output(S3C64XX_GPF(13), 1);
 
+       pwm_add_table(hmt_pwm_lookup, ARRAY_SIZE(hmt_pwm_lookup));
        platform_add_devices(hmt_devices, ARRAY_SIZE(hmt_devices));
 }
 
index 719843dca510d5900a8560bacee9706650f5b2e6..acdfb5fac40f6f8124dd57b71a3b173ac2296c08 100644 (file)
@@ -14,6 +14,7 @@
 #include <linux/gpio.h>
 #include <linux/init.h>
 #include <linux/platform_device.h>
+#include <linux/pwm.h>
 #include <linux/pwm_backlight.h>
 #include <linux/serial_core.h>
 #include <linux/serial_s3c.h>
@@ -139,6 +140,11 @@ static struct platform_device smartq_usb_otg_vbus_dev = {
        .dev.platform_data      = &smartq_usb_otg_vbus_pdata,
 };
 
+static struct pwm_lookup smartq_pwm_lookup[] = {
+       PWM_LOOKUP("samsung-pwm", 1, "pwm-backlight.0", NULL,
+                  1000000000 / (1000 * 20), PWM_POLARITY_NORMAL),
+};
+
 static int smartq_bl_init(struct device *dev)
 {
     s3c_gpio_cfgpin(S3C64XX_GPF(15), S3C_GPIO_SFN(2));
@@ -147,10 +153,8 @@ static int smartq_bl_init(struct device *dev)
 }
 
 static struct platform_pwm_backlight_data smartq_backlight_data = {
-       .pwm_id         = 1,
        .max_brightness = 1000,
        .dft_brightness = 600,
-       .pwm_period_ns  = 1000000000 / (1000 * 20),
        .enable_gpio    = -1,
        .init           = smartq_bl_init,
 };
@@ -396,5 +400,6 @@ void __init smartq_machine_init(void)
        WARN_ON(smartq_usb_host_init());
        WARN_ON(smartq_wifi_init());
 
+       pwm_add_table(smartq_pwm_lookup, ARRAY_SIZE(smartq_pwm_lookup));
        platform_add_devices(smartq_devices, ARRAY_SIZE(smartq_devices));
 }
index 286c9bd676e1796154f65d08f85a899fb40f06c5..30fd27853072440a5a642d2cae86bcc2357d0247 100644 (file)
@@ -30,6 +30,7 @@
 #include <linux/smsc911x.h>
 #include <linux/regulator/fixed.h>
 #include <linux/regulator/machine.h>
+#include <linux/pwm.h>
 #include <linux/pwm_backlight.h>
 #include <linux/platform_data/s3c-hsotg.h>
 
@@ -623,8 +624,12 @@ static struct samsung_bl_gpio_info smdk6410_bl_gpio_info = {
        .func = S3C_GPIO_SFN(2),
 };
 
+static struct pwm_lookup smdk6410_pwm_lookup[] = {
+       PWM_LOOKUP("samsung-pwm", 1, "pwm-backlight.0", NULL, 78770,
+                  PWM_POLARITY_NORMAL),
+};
+
 static struct platform_pwm_backlight_data smdk6410_bl_data = {
-       .pwm_id = 1,
        .enable_gpio = -1,
 };
 
@@ -695,6 +700,7 @@ static void __init smdk6410_machine_init(void)
 
        platform_add_devices(smdk6410_devices, ARRAY_SIZE(smdk6410_devices));
 
+       pwm_add_table(smdk6410_pwm_lookup, ARRAY_SIZE(smdk6410_pwm_lookup));
        samsung_bl_set(&smdk6410_bl_gpio_info, &smdk6410_bl_data);
 }
 
index 926e336d6aeb7181756646a8bff25054e78070e9..88734a5e10ca518be58b4217e22adab218e05d62 100644 (file)
@@ -98,76 +98,3 @@ config ARCH_SH73A0
 
 comment "Renesas ARM SoCs System Configuration"
 endif
-
-if ARCH_SHMOBILE_LEGACY
-
-comment "Renesas ARM SoCs System Type"
-
-config ARCH_R8A7778
-       bool "R-Car M1A (R8A77781)"
-       select ARCH_RCAR_GEN1
-       select ARCH_WANT_OPTIONAL_GPIOLIB
-       select ARM_GIC
-
-config ARCH_R8A7779
-       bool "R-Car H1 (R8A77790)"
-       select ARCH_RCAR_GEN1
-       select ARCH_WANT_OPTIONAL_GPIOLIB
-       select ARM_GIC
-
-comment "Renesas ARM SoCs Board Type"
-
-config MACH_BOCKW
-       bool "BOCK-W platform"
-       depends on ARCH_R8A7778
-       select ARCH_REQUIRE_GPIOLIB
-       select REGULATOR_FIXED_VOLTAGE if REGULATOR
-       select SND_SOC_AK4554 if SND_SIMPLE_CARD
-       select SND_SOC_AK4642 if SND_SIMPLE_CARD && I2C
-       select USE_OF
-
-config MACH_BOCKW_REFERENCE
-       bool "BOCK-W  - Reference Device Tree Implementation"
-       depends on ARCH_R8A7778
-       select ARCH_REQUIRE_GPIOLIB
-       select REGULATOR_FIXED_VOLTAGE if REGULATOR
-       select USE_OF
-       ---help---
-          Use reference implementation of BockW board support
-          which makes use of device tree at the expense
-          of not supporting a number of devices.
-
-          This is intended to aid developers
-
-comment "Renesas ARM SoCs System Configuration"
-
-config CPU_HAS_INTEVT
-        bool
-       default y
-
-config SH_CLK_CPG
-       bool
-
-source "drivers/sh/Kconfig"
-
-endif
-
-if ARCH_SHMOBILE
-
-menu "Timer and clock configuration"
-
-config SHMOBILE_TIMER_HZ
-       int "Kernel HZ (jiffies per second)"
-       range 32 1024
-       default "128"
-       help
-         Allows the configuration of the timer frequency. It is customary
-         to have the timer interrupt run at 1000 Hz or 100 Hz, but in the
-         case of low timer frequencies other values may be more suitable.
-         Renesas ARM SoC systems using a 32768 Hz RCLK for clock events may
-         want to select a HZ value such as 128 that can evenly divide RCLK.
-         A HZ value that does not divide evenly may cause timer drift.
-
-endmenu
-
-endif
index 476de30798d7290b8920b95991816c09a646b080..a65c80ac9009d51f1e54fd0b07e58336d8241e02 100644 (file)
@@ -3,7 +3,7 @@
 #
 
 # Common objects
-obj-y                          := timer.o console.o
+obj-y                          := timer.o
 
 # CPU objects
 obj-$(CONFIG_ARCH_SH73A0)      += setup-sh73a0.o
@@ -18,12 +18,6 @@ obj-$(CONFIG_ARCH_R8A7794)   += setup-r8a7794.o
 obj-$(CONFIG_ARCH_EMEV2)       += setup-emev2.o
 obj-$(CONFIG_ARCH_R7S72100)    += setup-r7s72100.o
 
-# Clock objects
-ifndef CONFIG_COMMON_CLK
-obj-y                          += clock.o
-obj-$(CONFIG_ARCH_R8A7778)     += clock-r8a7778.o
-endif
-
 # CPU reset vector handling objects
 cpu-y                          := platsmp.o headsmp.o
 
@@ -49,11 +43,5 @@ obj-$(CONFIG_PM_RCAR)                += pm-rcar.o
 obj-$(CONFIG_PM_RMOBILE)       += pm-rmobile.o
 obj-$(CONFIG_ARCH_RCAR_GEN2)   += pm-rcar-gen2.o
 
-# Board objects
-ifndef CONFIG_ARCH_SHMOBILE_MULTI
-obj-$(CONFIG_MACH_BOCKW)       += board-bockw.o
-obj-$(CONFIG_MACH_BOCKW_REFERENCE)     += board-bockw-reference.o
-endif
-
 # Framework support
 obj-$(CONFIG_SMP)              += $(smp-y)
diff --git a/arch/arm/mach-shmobile/Makefile.boot b/arch/arm/mach-shmobile/Makefile.boot
deleted file mode 100644 (file)
index a489fe9..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-# per-board load address for uImage
-loadaddr-y     :=
-loadaddr-$(CONFIG_MACH_BOCKW) += 0x60008000
-loadaddr-$(CONFIG_MACH_BOCKW_REFERENCE) += 0x60008000
-
-__ZRELADDR     := $(sort $(loadaddr-y))
-   zreladdr-y   += $(__ZRELADDR)
-
-# Unsupported legacy stuff
-#
-#params_phys-y (Instead: Pass atags pointer in r2)
-#initrd_phys-y (Instead: Use compiled-in initramfs)
diff --git a/arch/arm/mach-shmobile/board-bockw-reference.c b/arch/arm/mach-shmobile/board-bockw-reference.c
deleted file mode 100644 (file)
index 4f78296..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Bock-W board support
- *
- * Copyright (C) 2013  Renesas Solutions Corp.
- * Copyright (C) 2013  Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
- *
- * 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 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- */
-
-#include <linux/of_platform.h>
-
-#include <asm/mach/arch.h>
-
-#include "common.h"
-#include "r8a7778.h"
-
-/*
- *     see board-bock.c for checking detail of dip-switch
- */
-
-#define FPGA   0x18200000
-#define IRQ0MR 0x30
-#define COMCTLR        0x101c
-
-#define PFC    0xfffc0000
-#define PUPR4  0x110
-static void __init bockw_init(void)
-{
-       void __iomem *fpga;
-       void __iomem *pfc;
-
-#ifndef CONFIG_COMMON_CLK
-       r8a7778_clock_init();
-#endif
-       r8a7778_init_irq_extpin_dt(1);
-       r8a7778_add_dt_devices();
-
-       fpga = ioremap_nocache(FPGA, SZ_1M);
-       if (fpga) {
-               /*
-                * CAUTION
-                *
-                * IRQ0/1 is cascaded interrupt from FPGA.
-                * it should be cared in the future
-                * Now, it is assuming IRQ0 was used only from SMSC.
-                */
-               u16 val = ioread16(fpga + IRQ0MR);
-               val &= ~(1 << 4); /* enable SMSC911x */
-               iowrite16(val, fpga + IRQ0MR);
-
-               iounmap(fpga);
-       }
-
-       pfc = ioremap_nocache(PFC, 0x200);
-       if (pfc) {
-               /*
-                * FIXME
-                *
-                * SDHI CD/WP pin needs pull-up
-                */
-               iowrite32(ioread32(pfc + PUPR4) | (3 << 26), pfc + PUPR4);
-               iounmap(pfc);
-       }
-
-       of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
-}
-
-static const char *const bockw_boards_compat_dt[] __initconst = {
-       "renesas,bockw-reference",
-       NULL,
-};
-
-DT_MACHINE_START(BOCKW_DT, "bockw")
-       .init_early     = shmobile_init_delay,
-       .init_irq       = r8a7778_init_irq_dt,
-       .init_machine   = bockw_init,
-       .init_late      = shmobile_init_late,
-       .dt_compat      = bockw_boards_compat_dt,
-MACHINE_END
diff --git a/arch/arm/mach-shmobile/board-bockw.c b/arch/arm/mach-shmobile/board-bockw.c
deleted file mode 100644 (file)
index 25a0e72..0000000
+++ /dev/null
@@ -1,737 +0,0 @@
-/*
- * Bock-W board support
- *
- * Copyright (C) 2013-2014  Renesas Solutions Corp.
- * Copyright (C) 2013  Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
- * Copyright (C) 2013-2014  Cogent Embedded, Inc.
- *
- * 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 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- */
-
-#include <linux/mfd/tmio.h>
-#include <linux/mmc/host.h>
-#include <linux/mmc/sh_mobile_sdhi.h>
-#include <linux/mmc/sh_mmcif.h>
-#include <linux/mtd/partitions.h>
-#include <linux/pinctrl/machine.h>
-#include <linux/platform_data/camera-rcar.h>
-#include <linux/platform_data/usb-rcar-phy.h>
-#include <linux/platform_device.h>
-#include <linux/regulator/fixed.h>
-#include <linux/regulator/machine.h>
-#include <linux/smsc911x.h>
-#include <linux/spi/spi.h>
-#include <linux/spi/flash.h>
-#include <linux/usb/renesas_usbhs.h>
-
-#include <media/soc_camera.h>
-#include <asm/mach/arch.h>
-#include <sound/rcar_snd.h>
-#include <sound/simple_card.h>
-
-#include "common.h"
-#include "irqs.h"
-#include "r8a7778.h"
-
-#define FPGA   0x18200000
-#define IRQ0MR 0x30
-#define COMCTLR        0x101c
-static void __iomem *fpga;
-
-/*
- *     CN9(Upper side) SCIF/RCAN selection
- *
- *             1,4     3,6
- * SW40                SCIF    RCAN
- * SW41                SCIF    RCAN
- */
-
-/*
- * MMC (CN26) pin
- *
- * SW6 (D2)    3 pin
- * SW7 (D5)    ON
- * SW8 (D3)    3 pin
- * SW10        (D4)    1 pin
- * SW12        (CLK)   1 pin
- * SW13        (D6)    3 pin
- * SW14        (CMD)   ON
- * SW15        (D6)    1 pin
- * SW16        (D0)    ON
- * SW17        (D1)    ON
- * SW18        (D7)    3 pin
- * SW19        (MMC)   1 pin
- */
-
-/*
- *     SSI settings
- *
- * SW45: 1-4 side      (SSI5 out, ROUT/LOUT CN19 Mid)
- * SW46: 1101          (SSI6 Recorde)
- * SW47: 1110          (SSI5 Playback)
- * SW48: 11            (Recorde power)
- * SW49: 1             (SSI slave mode)
- * SW50: 1111          (SSI7, SSI8)
- * SW51: 1111          (SSI3, SSI4)
- * SW54: 1pin          (ak4554 FPGA control)
- * SW55: 1             (CLKB is 24.5760MHz)
- * SW60: 1pin          (ak4554 FPGA control)
- * SW61: 3pin          (use X11 clock)
- * SW78: 3-6           (ak4642 connects I2C0)
- *
- * You can use sound as
- *
- * hw0: CN19: SSI56-AK4643
- * hw1: CN21: SSI3-AK4554(playback)
- * hw2: CN21: SSI4-AK4554(capture)
- * hw3: CN20: SSI7-AK4554(playback)
- * hw4: CN20: SSI8-AK4554(capture)
- *
- * this command is required when playback on hw0.
- *
- * # amixer set "LINEOUT Mixer DACL" on
- */
-
-/*
- * USB
- *
- * USB1 (CN29) can be Host/Function
- *
- *             Host    Func
- * SW98                1       2
- * SW99                1       3
- */
-
-/* Dummy supplies, where voltage doesn't matter */
-static struct regulator_consumer_supply dummy_supplies[] = {
-       REGULATOR_SUPPLY("vddvario", "smsc911x"),
-       REGULATOR_SUPPLY("vdd33a", "smsc911x"),
-};
-
-static struct regulator_consumer_supply fixed3v3_power_consumers[] = {
-       REGULATOR_SUPPLY("vmmc", "sh_mmcif"),
-       REGULATOR_SUPPLY("vqmmc", "sh_mmcif"),
-};
-
-static struct smsc911x_platform_config smsc911x_data __initdata = {
-       .irq_polarity   = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
-       .irq_type       = SMSC911X_IRQ_TYPE_PUSH_PULL,
-       .flags          = SMSC911X_USE_32BIT,
-       .phy_interface  = PHY_INTERFACE_MODE_MII,
-};
-
-static struct resource smsc911x_resources[] __initdata = {
-       DEFINE_RES_MEM(0x18300000, 0x1000),
-       DEFINE_RES_IRQ(irq_pin(0)), /* IRQ 0 */
-};
-
-#if IS_ENABLED(CONFIG_USB_RENESAS_USBHS_UDC)
-/*
- * When USB1 is Func
- */
-static int usbhsf_get_id(struct platform_device *pdev)
-{
-       return USBHS_GADGET;
-}
-
-#define SUSPMODE       0x102
-static int usbhsf_power_ctrl(struct platform_device *pdev,
-                            void __iomem *base, int enable)
-{
-       enable = !!enable;
-
-       r8a7778_usb_phy_power(enable);
-
-       iowrite16(enable << 14, base + SUSPMODE);
-
-       return 0;
-}
-
-static struct resource usbhsf_resources[] __initdata = {
-       DEFINE_RES_MEM(0xffe60000, 0x110),
-       DEFINE_RES_IRQ(gic_iid(0x4f)),
-};
-
-static struct renesas_usbhs_platform_info usbhs_info __initdata = {
-       .platform_callback = {
-               .get_id         = usbhsf_get_id,
-               .power_ctrl     = usbhsf_power_ctrl,
-       },
-       .driver_param = {
-               .buswait_bwait  = 4,
-               .d0_tx_id       = HPBDMA_SLAVE_USBFUNC_TX,
-               .d1_rx_id       = HPBDMA_SLAVE_USBFUNC_RX,
-       },
-};
-
-#define USB_PHY_SETTING {.port1_func = 1, .ovc_pin[1].active_high = 1,}
-#define USB1_DEVICE    "renesas_usbhs"
-#define ADD_USB_FUNC_DEVICE_IF_POSSIBLE()                      \
-       platform_device_register_resndata(                      \
-               NULL, "renesas_usbhs", -1,                      \
-               usbhsf_resources,                               \
-               ARRAY_SIZE(usbhsf_resources),                   \
-               &usbhs_info, sizeof(struct renesas_usbhs_platform_info))
-
-#else
-/*
- * When USB1 is Host
- */
-#define USB_PHY_SETTING { }
-#define USB1_DEVICE    "ehci-platform"
-#define ADD_USB_FUNC_DEVICE_IF_POSSIBLE()
-
-#endif
-
-/* USB */
-static struct resource usb_phy_resources[] __initdata = {
-       DEFINE_RES_MEM(0xffe70800, 0x100),
-       DEFINE_RES_MEM(0xffe76000, 0x100),
-};
-
-static struct rcar_phy_platform_data usb_phy_platform_data __initdata =
-       USB_PHY_SETTING;
-
-
-/* SDHI */
-static struct tmio_mmc_data sdhi0_info __initdata = {
-       .chan_priv_tx   = (void *)HPBDMA_SLAVE_SDHI0_TX,
-       .chan_priv_rx   = (void *)HPBDMA_SLAVE_SDHI0_RX,
-       .capabilities   = MMC_CAP_SD_HIGHSPEED,
-       .ocr_mask       = MMC_VDD_165_195 | MMC_VDD_32_33 | MMC_VDD_33_34,
-       .flags          = TMIO_MMC_HAS_IDLE_WAIT,
-};
-
-static struct resource sdhi0_resources[] __initdata = {
-       DEFINE_RES_MEM(0xFFE4C000, 0x100),
-       DEFINE_RES_IRQ(gic_iid(0x77)),
-};
-
-/* Ether */
-static struct resource ether_resources[] __initdata = {
-       DEFINE_RES_MEM(0xfde00000, 0x400),
-       DEFINE_RES_IRQ(gic_iid(0x89)),
-};
-
-static struct sh_eth_plat_data ether_platform_data __initdata = {
-       .phy            = 0x01,
-       .edmac_endian   = EDMAC_LITTLE_ENDIAN,
-       .phy_interface  = PHY_INTERFACE_MODE_RMII,
-       /*
-        * Although the LINK signal is available on the board, it's connected to
-        * the link/activity LED output of the PHY, thus the link disappears and
-        * reappears after each packet.  We'd be better off ignoring such signal
-        * and getting the link state from the PHY indirectly.
-        */
-       .no_ether_link  = 1,
-};
-
-static struct platform_device_info ether_info __initdata = {
-       .name           = "r8a777x-ether",
-       .id             = -1,
-       .res            = ether_resources,
-       .num_res        = ARRAY_SIZE(ether_resources),
-       .data           = &ether_platform_data,
-       .size_data      = sizeof(ether_platform_data),
-       .dma_mask       = DMA_BIT_MASK(32),
-};
-
-/* I2C */
-static struct i2c_board_info i2c0_devices[] = {
-       {
-               I2C_BOARD_INFO("rx8581", 0x51),
-       }, {
-               I2C_BOARD_INFO("ak4643", 0x12),
-       }
-};
-
-/* HSPI*/
-static struct mtd_partition m25p80_spi_flash_partitions[] = {
-       {
-               .name   = "data(spi)",
-               .size   = 0x0100000,
-               .offset = 0,
-       },
-};
-
-static struct flash_platform_data spi_flash_data = {
-       .name           = "m25p80",
-       .type           = "s25fl008k",
-       .parts          = m25p80_spi_flash_partitions,
-       .nr_parts       = ARRAY_SIZE(m25p80_spi_flash_partitions),
-};
-
-static struct spi_board_info spi_board_info[] __initdata = {
-       {
-               .modalias       = "m25p80",
-               .max_speed_hz   = 104000000,
-               .chip_select    = 0,
-               .bus_num        = 0,
-               .mode           = SPI_MODE_0,
-               .platform_data  = &spi_flash_data,
-       },
-};
-
-/* MMC */
-static struct resource mmc_resources[] __initdata = {
-       DEFINE_RES_MEM(0xffe4e000, 0x100),
-       DEFINE_RES_IRQ(gic_iid(0x5d)),
-};
-
-static struct sh_mmcif_plat_data sh_mmcif_plat __initdata = {
-       .sup_pclk       = 0,
-       .caps           = MMC_CAP_4_BIT_DATA |
-                         MMC_CAP_8_BIT_DATA |
-                         MMC_CAP_NEEDS_POLL,
-};
-
-/* In the default configuration both decoders reside on I2C bus 0 */
-#define BOCKW_CAMERA(idx)                                              \
-static struct i2c_board_info camera##idx##_info = {                    \
-       I2C_BOARD_INFO("ml86v7667", 0x41 + 2 * (idx)),                  \
-};                                                                     \
-                                                                       \
-static struct soc_camera_link iclink##idx##_ml86v7667 __initdata = {   \
-       .bus_id         = idx,                                          \
-       .i2c_adapter_id = 0,                                            \
-       .board_info     = &camera##idx##_info,                          \
-}
-
-BOCKW_CAMERA(0);
-BOCKW_CAMERA(1);
-
-/* VIN */
-static struct rcar_vin_platform_data vin_platform_data __initdata = {
-       .flags  = RCAR_VIN_BT656,
-};
-
-#define R8A7778_VIN(idx)                                               \
-static struct resource vin##idx##_resources[] __initdata = {           \
-       DEFINE_RES_MEM(0xffc50000 + 0x1000 * (idx), 0x1000),            \
-       DEFINE_RES_IRQ(gic_iid(0x5a)),                                  \
-};                                                                     \
-                                                                       \
-static struct platform_device_info vin##idx##_info __initdata = {      \
-       .name           = "r8a7778-vin",                                \
-       .id             = idx,                                          \
-       .res            = vin##idx##_resources,                         \
-       .num_res        = ARRAY_SIZE(vin##idx##_resources),             \
-       .dma_mask       = DMA_BIT_MASK(32),                             \
-       .data           = &vin_platform_data,                           \
-       .size_data      = sizeof(vin_platform_data),                    \
-}
-R8A7778_VIN(0);
-R8A7778_VIN(1);
-
-/* Sound */
-static struct resource rsnd_resources[] __initdata = {
-       [RSND_GEN1_SRU] = DEFINE_RES_MEM(0xffd90000, 0x1000),
-       [RSND_GEN1_SSI] = DEFINE_RES_MEM(0xffd91000, 0x1240),
-       [RSND_GEN1_ADG] = DEFINE_RES_MEM(0xfffe0000, 0x24),
-};
-
-static struct rsnd_ssi_platform_info rsnd_ssi[] = {
-       RSND_SSI_UNUSED, /* SSI 0 */
-       RSND_SSI_UNUSED, /* SSI 1 */
-       RSND_SSI_UNUSED, /* SSI 2 */
-       RSND_SSI(HPBDMA_SLAVE_HPBIF3_TX, gic_iid(0x85), 0),
-       RSND_SSI(HPBDMA_SLAVE_HPBIF4_RX, gic_iid(0x85), RSND_SSI_CLK_PIN_SHARE),
-       RSND_SSI(HPBDMA_SLAVE_HPBIF5_TX, gic_iid(0x86), 0),
-       RSND_SSI(HPBDMA_SLAVE_HPBIF6_RX, gic_iid(0x86), 0),
-       RSND_SSI(HPBDMA_SLAVE_HPBIF7_TX, gic_iid(0x86), 0),
-       RSND_SSI(HPBDMA_SLAVE_HPBIF8_RX, gic_iid(0x86), RSND_SSI_CLK_PIN_SHARE),
-};
-
-static struct rsnd_src_platform_info rsnd_src[9] = {
-       RSND_SRC_UNUSED, /* SRU 0 */
-       RSND_SRC_UNUSED, /* SRU 1 */
-       RSND_SRC_UNUSED, /* SRU 2 */
-       RSND_SRC(0, 0),
-       RSND_SRC(0, 0),
-       RSND_SRC(0, 0),
-       RSND_SRC(0, 0),
-       RSND_SRC(0, 0),
-       RSND_SRC(0, 0),
-};
-
-static struct rsnd_dai_platform_info rsnd_dai[] = {
-       {
-               .playback = { .ssi = &rsnd_ssi[5], .src = &rsnd_src[5] },
-               .capture  = { .ssi = &rsnd_ssi[6], .src = &rsnd_src[6] },
-       }, {
-               .playback = { .ssi = &rsnd_ssi[3], .src = &rsnd_src[3] },
-       }, {
-               .capture  = { .ssi = &rsnd_ssi[4], .src = &rsnd_src[4] },
-       }, {
-               .playback = { .ssi = &rsnd_ssi[7], .src = &rsnd_src[7] },
-       }, {
-               .capture  = { .ssi = &rsnd_ssi[8], .src = &rsnd_src[8] },
-       },
-};
-
-enum {
-       AK4554_34 = 0,
-       AK4643_56,
-       AK4554_78,
-       SOUND_MAX,
-};
-
-static int rsnd_codec_power(int id, int enable)
-{
-       static int sound_user[SOUND_MAX] = {0, 0, 0};
-       int *usr = NULL;
-       u32 bit;
-
-       switch (id) {
-       case 3:
-       case 4:
-               usr = sound_user + AK4554_34;
-               bit = (1 << 10);
-               break;
-       case 5:
-       case 6:
-               usr = sound_user + AK4643_56;
-               bit = (1 << 6);
-               break;
-       case 7:
-       case 8:
-               usr = sound_user + AK4554_78;
-               bit = (1 << 7);
-               break;
-       }
-
-       if (!usr)
-               return -EIO;
-
-       if (enable) {
-               if (*usr == 0) {
-                       u32 val = ioread16(fpga + COMCTLR);
-                       val &= ~bit;
-                       iowrite16(val, fpga + COMCTLR);
-               }
-
-               (*usr)++;
-       } else {
-               if (*usr == 0)
-                       return 0;
-
-               (*usr)--;
-
-               if (*usr == 0) {
-                       u32 val = ioread16(fpga + COMCTLR);
-                       val |= bit;
-                       iowrite16(val, fpga + COMCTLR);
-               }
-       }
-
-       return 0;
-}
-
-static int rsnd_start(int id)
-{
-       return rsnd_codec_power(id, 1);
-}
-
-static int rsnd_stop(int id)
-{
-       return rsnd_codec_power(id, 0);
-}
-
-static struct rcar_snd_info rsnd_info = {
-       .flags          = RSND_GEN1,
-       .ssi_info       = rsnd_ssi,
-       .ssi_info_nr    = ARRAY_SIZE(rsnd_ssi),
-       .src_info       = rsnd_src,
-       .src_info_nr    = ARRAY_SIZE(rsnd_src),
-       .dai_info       = rsnd_dai,
-       .dai_info_nr    = ARRAY_SIZE(rsnd_dai),
-       .start          = rsnd_start,
-       .stop           = rsnd_stop,
-};
-
-static struct asoc_simple_card_info rsnd_card_info[] = {
-       /* SSI5, SSI6 */
-       {
-               .name           = "AK4643",
-               .card           = "SSI56-AK4643",
-               .codec          = "ak4642-codec.0-0012",
-               .platform       = "rcar_sound",
-               .daifmt         = SND_SOC_DAIFMT_LEFT_J | SND_SOC_DAIFMT_CBM_CFM,
-               .cpu_dai = {
-                       .name   = "rsnd-dai.0",
-               },
-               .codec_dai = {
-                       .name   = "ak4642-hifi",
-                       .sysclk = 11289600,
-               },
-       },
-       /* SSI3 */
-       {
-               .name           = "AK4554",
-               .card           = "SSI3-AK4554(playback)",
-               .codec          = "ak4554-adc-dac.0",
-               .platform       = "rcar_sound",
-               .daifmt         = SND_SOC_DAIFMT_CBS_CFS | SND_SOC_DAIFMT_RIGHT_J,
-               .cpu_dai = {
-                       .name   = "rsnd-dai.1",
-               },
-               .codec_dai = {
-                       .name   = "ak4554-hifi",
-               },
-       },
-       /* SSI4 */
-       {
-               .name           = "AK4554",
-               .card           = "SSI4-AK4554(capture)",
-               .codec          = "ak4554-adc-dac.0",
-               .platform       = "rcar_sound",
-               .daifmt         = SND_SOC_DAIFMT_CBS_CFS | SND_SOC_DAIFMT_LEFT_J,
-               .cpu_dai = {
-                       .name   = "rsnd-dai.2",
-               },
-               .codec_dai = {
-                       .name   = "ak4554-hifi",
-               },
-       },
-       /* SSI7 */
-       {
-               .name           = "AK4554",
-               .card           = "SSI7-AK4554(playback)",
-               .codec          = "ak4554-adc-dac.1",
-               .platform       = "rcar_sound",
-               .daifmt         = SND_SOC_DAIFMT_CBS_CFS | SND_SOC_DAIFMT_RIGHT_J,
-               .cpu_dai = {
-                       .name   = "rsnd-dai.3",
-               },
-               .codec_dai = {
-                       .name   = "ak4554-hifi",
-               },
-       },
-       /* SSI8 */
-       {
-               .name           = "AK4554",
-               .card           = "SSI8-AK4554(capture)",
-               .codec          = "ak4554-adc-dac.1",
-               .platform       = "rcar_sound",
-               .daifmt         = SND_SOC_DAIFMT_CBS_CFS | SND_SOC_DAIFMT_LEFT_J,
-               .cpu_dai = {
-                       .name   = "rsnd-dai.4",
-               },
-               .codec_dai = {
-                       .name   = "ak4554-hifi",
-               },
-       }
-};
-
-static const struct pinctrl_map bockw_pinctrl_map[] = {
-       /* AUDIO */
-       PIN_MAP_MUX_GROUP_DEFAULT("rcar_sound", "pfc-r8a7778",
-                                 "audio_clk_a", "audio_clk"),
-       PIN_MAP_MUX_GROUP_DEFAULT("rcar_sound", "pfc-r8a7778",
-                                 "audio_clk_b", "audio_clk"),
-       PIN_MAP_MUX_GROUP_DEFAULT("rcar_sound", "pfc-r8a7778",
-                                 "ssi34_ctrl", "ssi"),
-       PIN_MAP_MUX_GROUP_DEFAULT("rcar_sound", "pfc-r8a7778",
-                                 "ssi3_data", "ssi"),
-       PIN_MAP_MUX_GROUP_DEFAULT("rcar_sound", "pfc-r8a7778",
-                                 "ssi4_data", "ssi"),
-       PIN_MAP_MUX_GROUP_DEFAULT("rcar_sound", "pfc-r8a7778",
-                                 "ssi5_ctrl", "ssi"),
-       PIN_MAP_MUX_GROUP_DEFAULT("rcar_sound", "pfc-r8a7778",
-                                 "ssi5_data", "ssi"),
-       PIN_MAP_MUX_GROUP_DEFAULT("rcar_sound", "pfc-r8a7778",
-                                 "ssi6_ctrl", "ssi"),
-       PIN_MAP_MUX_GROUP_DEFAULT("rcar_sound", "pfc-r8a7778",
-                                 "ssi6_data", "ssi"),
-       PIN_MAP_MUX_GROUP_DEFAULT("rcar_sound", "pfc-r8a7778",
-                                 "ssi78_ctrl", "ssi"),
-       PIN_MAP_MUX_GROUP_DEFAULT("rcar_sound", "pfc-r8a7778",
-                                 "ssi7_data", "ssi"),
-       PIN_MAP_MUX_GROUP_DEFAULT("rcar_sound", "pfc-r8a7778",
-                                 "ssi8_data", "ssi"),
-       /* Ether */
-       PIN_MAP_MUX_GROUP_DEFAULT("r8a777x-ether", "pfc-r8a7778",
-                                 "ether_rmii", "ether"),
-       /* HSPI0 */
-       PIN_MAP_MUX_GROUP_DEFAULT("sh-hspi.0", "pfc-r8a7778",
-                                 "hspi0_a", "hspi0"),
-       /* MMC */
-       PIN_MAP_MUX_GROUP_DEFAULT("sh_mmcif", "pfc-r8a7778",
-                                 "mmc_data8", "mmc"),
-       PIN_MAP_MUX_GROUP_DEFAULT("sh_mmcif", "pfc-r8a7778",
-                                 "mmc_ctrl", "mmc"),
-       /* SCIF0 */
-       PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.0", "pfc-r8a7778",
-                                 "scif0_data_a", "scif0"),
-       PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.0", "pfc-r8a7778",
-                                 "scif0_ctrl", "scif0"),
-       /* USB */
-       PIN_MAP_MUX_GROUP_DEFAULT("ehci-platform", "pfc-r8a7778",
-                                 "usb0", "usb0"),
-       PIN_MAP_MUX_GROUP_DEFAULT(USB1_DEVICE, "pfc-r8a7778",
-                                 "usb1", "usb1"),
-       /* SDHI0 */
-       PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a7778",
-                                 "sdhi0_data4", "sdhi0"),
-       PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a7778",
-                                 "sdhi0_ctrl", "sdhi0"),
-       PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a7778",
-                                 "sdhi0_cd", "sdhi0"),
-       PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a7778",
-                                 "sdhi0_wp", "sdhi0"),
-       /* VIN0 */
-       PIN_MAP_MUX_GROUP_DEFAULT("r8a7778-vin.0", "pfc-r8a7778",
-                                 "vin0_clk", "vin0"),
-       PIN_MAP_MUX_GROUP_DEFAULT("r8a7778-vin.0", "pfc-r8a7778",
-                                 "vin0_data8", "vin0"),
-       /* VIN1 */
-       PIN_MAP_MUX_GROUP_DEFAULT("r8a7778-vin.1", "pfc-r8a7778",
-                                 "vin1_clk", "vin1"),
-       PIN_MAP_MUX_GROUP_DEFAULT("r8a7778-vin.1", "pfc-r8a7778",
-                                 "vin1_data8", "vin1"),
-};
-
-#define PFC    0xfffc0000
-#define PUPR4  0x110
-static void __init bockw_init(void)
-{
-       void __iomem *base;
-       struct clk *clk;
-       struct platform_device *pdev;
-       int i;
-
-       r8a7778_clock_init();
-       r8a7778_init_irq_extpin(1);
-       r8a7778_add_standard_devices();
-
-       platform_device_register_full(&ether_info);
-
-       platform_device_register_full(&vin0_info);
-       /* VIN1 has a pin conflict with Ether */
-       if (!IS_ENABLED(CONFIG_SH_ETH))
-               platform_device_register_full(&vin1_info);
-       platform_device_register_data(NULL, "soc-camera-pdrv", 0,
-                                     &iclink0_ml86v7667,
-                                     sizeof(iclink0_ml86v7667));
-       platform_device_register_data(NULL, "soc-camera-pdrv", 1,
-                                     &iclink1_ml86v7667,
-                                     sizeof(iclink1_ml86v7667));
-
-       i2c_register_board_info(0, i2c0_devices,
-                               ARRAY_SIZE(i2c0_devices));
-       spi_register_board_info(spi_board_info,
-                               ARRAY_SIZE(spi_board_info));
-       pinctrl_register_mappings(bockw_pinctrl_map,
-                                 ARRAY_SIZE(bockw_pinctrl_map));
-       r8a7778_pinmux_init();
-
-       platform_device_register_resndata(
-               NULL, "sh_mmcif", -1,
-               mmc_resources, ARRAY_SIZE(mmc_resources),
-               &sh_mmcif_plat, sizeof(struct sh_mmcif_plat_data));
-
-       platform_device_register_resndata(
-               NULL, "rcar_usb_phy", -1,
-               usb_phy_resources,
-               ARRAY_SIZE(usb_phy_resources),
-               &usb_phy_platform_data,
-               sizeof(struct rcar_phy_platform_data));
-
-       regulator_register_fixed(0, dummy_supplies,
-                                ARRAY_SIZE(dummy_supplies));
-       regulator_register_always_on(1, "fixed-3.3V", fixed3v3_power_consumers,
-                                    ARRAY_SIZE(fixed3v3_power_consumers), 3300000);
-
-       /* for SMSC */
-       fpga = ioremap_nocache(FPGA, SZ_1M);
-       if (fpga) {
-               /*
-                * CAUTION
-                *
-                * IRQ0/1 is cascaded interrupt from FPGA.
-                * it should be cared in the future
-                * Now, it is assuming IRQ0 was used only from SMSC.
-                */
-               u16 val = ioread16(fpga + IRQ0MR);
-               val &= ~(1 << 4); /* enable SMSC911x */
-               iowrite16(val, fpga + IRQ0MR);
-
-               platform_device_register_resndata(
-                       NULL, "smsc911x", -1,
-                       smsc911x_resources, ARRAY_SIZE(smsc911x_resources),
-                       &smsc911x_data, sizeof(smsc911x_data));
-       }
-
-       /* for SDHI */
-       base = ioremap_nocache(PFC, 0x200);
-       if (base) {
-               /*
-                * FIXME
-                *
-                * SDHI CD/WP pin needs pull-up
-                */
-               iowrite32(ioread32(base + PUPR4) | (3 << 26), base + PUPR4);
-               iounmap(base);
-
-               platform_device_register_resndata(
-                       NULL, "sh_mobile_sdhi", 0,
-                       sdhi0_resources, ARRAY_SIZE(sdhi0_resources),
-                       &sdhi0_info, sizeof(struct tmio_mmc_data));
-       }
-
-       /* for Audio */
-       rsnd_codec_power(5, 1); /* enable ak4642 */
-
-       platform_device_register_simple(
-               "ak4554-adc-dac", 0, NULL, 0);
-
-       platform_device_register_simple(
-               "ak4554-adc-dac", 1, NULL, 0);
-
-       pdev = platform_device_register_resndata(
-               NULL, "rcar_sound", -1,
-               rsnd_resources, ARRAY_SIZE(rsnd_resources),
-               &rsnd_info, sizeof(rsnd_info));
-
-       clk = clk_get(&pdev->dev, "clk_b");
-       clk_set_rate(clk, 24576000);
-       clk_put(clk);
-
-       for (i = 0; i < ARRAY_SIZE(rsnd_card_info); i++) {
-               struct platform_device_info cardinfo = {
-                       .name           = "asoc-simple-card",
-                       .id             = i,
-                       .data           = &rsnd_card_info[i],
-                       .size_data      = sizeof(struct asoc_simple_card_info),
-                       .dma_mask       = DMA_BIT_MASK(32),
-               };
-
-               platform_device_register_full(&cardinfo);
-       }
-}
-
-static void __init bockw_init_late(void)
-{
-       r8a7778_init_late();
-       ADD_USB_FUNC_DEVICE_IF_POSSIBLE();
-}
-
-static const char *const bockw_boards_compat_dt[] __initconst = {
-       "renesas,bockw",
-       NULL,
-};
-
-DT_MACHINE_START(BOCKW_DT, "bockw")
-       .init_early     = shmobile_init_delay,
-       .init_irq       = r8a7778_init_irq_dt,
-       .init_machine   = bockw_init,
-       .dt_compat      = bockw_boards_compat_dt,
-       .init_late      = bockw_init_late,
-MACHINE_END
diff --git a/arch/arm/mach-shmobile/clock-r8a7778.c b/arch/arm/mach-shmobile/clock-r8a7778.c
deleted file mode 100644 (file)
index e8510c3..0000000
+++ /dev/null
@@ -1,342 +0,0 @@
-/*
- * r8a7778 clock framework support
- *
- * Copyright (C) 2013  Renesas Solutions Corp.
- * Copyright (C) 2013  Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
- *
- * based on r8a7779
- *
- * Copyright (C) 2011  Renesas Solutions Corp.
- * Copyright (C) 2011  Magnus Damm
- *
- * 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; either version 2 of the License
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- */
-
-/*
- *     MD      MD      MD      MD       PLLA   PLLB    EXTAL   clki    clkz
- *     19      18      12      11                      (HMz)   (MHz)   (MHz)
- *----------------------------------------------------------------------------
- *     1       0       0       0       x21     x21     38.00   800     800
- *     1       0       0       1       x24     x24     33.33   800     800
- *     1       0       1       0       x28     x28     28.50   800     800
- *     1       0       1       1       x32     x32     25.00   800     800
- *     1       1       0       1       x24     x21     33.33   800     700
- *     1       1       1       0       x28     x21     28.50   800     600
- *     1       1       1       1       x32     x24     25.00   800     600
- */
-
-#include <linux/io.h>
-#include <linux/sh_clk.h>
-#include <linux/clkdev.h>
-#include "clock.h"
-#include "common.h"
-
-#define MSTPCR0                IOMEM(0xffc80030)
-#define MSTPCR1                IOMEM(0xffc80034)
-#define MSTPCR3                IOMEM(0xffc8003c)
-#define MSTPSR1                IOMEM(0xffc80044)
-#define MSTPSR4                IOMEM(0xffc80048)
-#define MSTPSR6                IOMEM(0xffc8004c)
-#define MSTPCR4                IOMEM(0xffc80050)
-#define MSTPCR5                IOMEM(0xffc80054)
-#define MSTPCR6                IOMEM(0xffc80058)
-#define MODEMR         0xFFCC0020
-
-#define MD(nr) BIT(nr)
-
-/* ioremap() through clock mapping mandatory to avoid
- * collision with ARM coherent DMA virtual memory range.
- */
-
-static struct clk_mapping cpg_mapping = {
-       .phys   = 0xffc80000,
-       .len    = 0x80,
-};
-
-static struct clk extal_clk = {
-       /* .rate will be updated on r8a7778_clock_init() */
-       .mapping = &cpg_mapping,
-};
-
-static struct clk audio_clk_a = {
-};
-
-static struct clk audio_clk_b = {
-};
-
-static struct clk audio_clk_c = {
-};
-
-/*
- * clock ratio of these clock will be updated
- * on r8a7778_clock_init()
- */
-SH_FIXED_RATIO_CLK_SET(plla_clk,       extal_clk, 1, 1);
-SH_FIXED_RATIO_CLK_SET(pllb_clk,       extal_clk, 1, 1);
-SH_FIXED_RATIO_CLK_SET(i_clk,          plla_clk,  1, 1);
-SH_FIXED_RATIO_CLK_SET(s_clk,          plla_clk,  1, 1);
-SH_FIXED_RATIO_CLK_SET(s1_clk,         plla_clk,  1, 1);
-SH_FIXED_RATIO_CLK_SET(s3_clk,         plla_clk,  1, 1);
-SH_FIXED_RATIO_CLK_SET(s4_clk,         plla_clk,  1, 1);
-SH_FIXED_RATIO_CLK_SET(b_clk,          plla_clk,  1, 1);
-SH_FIXED_RATIO_CLK_SET(out_clk,                plla_clk,  1, 1);
-SH_FIXED_RATIO_CLK_SET(p_clk,          plla_clk,  1, 1);
-SH_FIXED_RATIO_CLK_SET(g_clk,          plla_clk,  1, 1);
-SH_FIXED_RATIO_CLK_SET(z_clk,          pllb_clk,  1, 1);
-
-static struct clk *main_clks[] = {
-       &extal_clk,
-       &plla_clk,
-       &pllb_clk,
-       &i_clk,
-       &s_clk,
-       &s1_clk,
-       &s3_clk,
-       &s4_clk,
-       &b_clk,
-       &out_clk,
-       &p_clk,
-       &g_clk,
-       &z_clk,
-       &audio_clk_a,
-       &audio_clk_b,
-       &audio_clk_c,
-};
-
-enum {
-       MSTP531, MSTP530,
-       MSTP529, MSTP528, MSTP527, MSTP526, MSTP525, MSTP524, MSTP523,
-       MSTP331,
-       MSTP323, MSTP322, MSTP321,
-       MSTP311, MSTP310,
-       MSTP309, MSTP308, MSTP307,
-       MSTP114,
-       MSTP110, MSTP109,
-       MSTP100,
-       MSTP030,
-       MSTP029, MSTP028, MSTP027, MSTP026, MSTP025, MSTP024, MSTP023, MSTP022, MSTP021,
-       MSTP016, MSTP015, MSTP012, MSTP011, MSTP010,
-       MSTP009, MSTP008, MSTP007,
-       MSTP_NR };
-
-static struct clk mstp_clks[MSTP_NR] = {
-       [MSTP531] = SH_CLK_MSTP32(&p_clk, MSTPCR5, 31, 0), /* SCU0 */
-       [MSTP530] = SH_CLK_MSTP32(&p_clk, MSTPCR5, 30, 0), /* SCU1 */
-       [MSTP529] = SH_CLK_MSTP32(&p_clk, MSTPCR5, 29, 0), /* SCU2 */
-       [MSTP528] = SH_CLK_MSTP32(&p_clk, MSTPCR5, 28, 0), /* SCU3 */
-       [MSTP527] = SH_CLK_MSTP32(&p_clk, MSTPCR5, 27, 0), /* SCU4 */
-       [MSTP526] = SH_CLK_MSTP32(&p_clk, MSTPCR5, 26, 0), /* SCU5 */
-       [MSTP525] = SH_CLK_MSTP32(&p_clk, MSTPCR5, 25, 0), /* SCU6 */
-       [MSTP524] = SH_CLK_MSTP32(&p_clk, MSTPCR5, 24, 0), /* SCU7 */
-       [MSTP523] = SH_CLK_MSTP32(&p_clk, MSTPCR5, 23, 0), /* SCU8 */
-       [MSTP331] = SH_CLK_MSTP32(&s4_clk, MSTPCR3, 31, 0), /* MMC */
-       [MSTP323] = SH_CLK_MSTP32(&p_clk, MSTPCR3, 23, 0), /* SDHI0 */
-       [MSTP322] = SH_CLK_MSTP32(&p_clk, MSTPCR3, 22, 0), /* SDHI1 */
-       [MSTP321] = SH_CLK_MSTP32(&p_clk, MSTPCR3, 21, 0), /* SDHI2 */
-       [MSTP311] = SH_CLK_MSTP32(&p_clk, MSTPCR3, 11, 0), /* SSI4 */
-       [MSTP310] = SH_CLK_MSTP32(&p_clk, MSTPCR3, 10, 0), /* SSI5 */
-       [MSTP309] = SH_CLK_MSTP32(&p_clk, MSTPCR3,  9, 0), /* SSI6 */
-       [MSTP308] = SH_CLK_MSTP32(&p_clk, MSTPCR3,  8, 0), /* SSI7 */
-       [MSTP307] = SH_CLK_MSTP32(&p_clk, MSTPCR3,  7, 0), /* SSI8 */
-       [MSTP114] = SH_CLK_MSTP32(&p_clk, MSTPCR1, 14, 0), /* Ether */
-       [MSTP110] = SH_CLK_MSTP32(&s_clk, MSTPCR1, 10, 0), /* VIN0 */
-       [MSTP109] = SH_CLK_MSTP32(&s_clk, MSTPCR1,  9, 0), /* VIN1 */
-       [MSTP100] = SH_CLK_MSTP32(&p_clk, MSTPCR1,  0, 0), /* USB0/1 */
-       [MSTP030] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 30, 0), /* I2C0 */
-       [MSTP029] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 29, 0), /* I2C1 */
-       [MSTP028] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 28, 0), /* I2C2 */
-       [MSTP027] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 27, 0), /* I2C3 */
-       [MSTP026] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 26, 0), /* SCIF0 */
-       [MSTP025] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 25, 0), /* SCIF1 */
-       [MSTP024] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 24, 0), /* SCIF2 */
-       [MSTP023] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 23, 0), /* SCIF3 */
-       [MSTP022] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 22, 0), /* SCIF4 */
-       [MSTP021] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 21, 0), /* SCIF5 */
-       [MSTP016] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 16, 0), /* TMU0 */
-       [MSTP015] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 15, 0), /* TMU1 */
-       [MSTP012] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 12, 0), /* SSI0 */
-       [MSTP011] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 11, 0), /* SSI1 */
-       [MSTP010] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 10, 0), /* SSI2 */
-       [MSTP009] = SH_CLK_MSTP32(&p_clk, MSTPCR0,  9, 0), /* SSI3 */
-       [MSTP008] = SH_CLK_MSTP32(&p_clk, MSTPCR0,  8, 0), /* SRU */
-       [MSTP007] = SH_CLK_MSTP32(&s_clk, MSTPCR0,  7, 0), /* HSPI */
-};
-
-static struct clk_lookup lookups[] = {
-       /* main */
-       CLKDEV_CON_ID("shyway_clk",     &s_clk),
-       CLKDEV_CON_ID("peripheral_clk", &p_clk),
-
-       /* MSTP32 clocks */
-       CLKDEV_DEV_ID("sh_mmcif", &mstp_clks[MSTP331]), /* MMC */
-       CLKDEV_DEV_ID("ffe4e000.mmc", &mstp_clks[MSTP331]), /* MMC */
-       CLKDEV_DEV_ID("sh_mobile_sdhi.0", &mstp_clks[MSTP323]), /* SDHI0 */
-       CLKDEV_DEV_ID("ffe4c000.sd", &mstp_clks[MSTP323]), /* SDHI0 */
-       CLKDEV_DEV_ID("sh_mobile_sdhi.1", &mstp_clks[MSTP322]), /* SDHI1 */
-       CLKDEV_DEV_ID("ffe4d000.sd", &mstp_clks[MSTP322]), /* SDHI1 */
-       CLKDEV_DEV_ID("sh_mobile_sdhi.2", &mstp_clks[MSTP321]), /* SDHI2 */
-       CLKDEV_DEV_ID("ffe4f000.sd", &mstp_clks[MSTP321]), /* SDHI2 */
-       CLKDEV_DEV_ID("r8a777x-ether", &mstp_clks[MSTP114]), /* Ether */
-       CLKDEV_DEV_ID("r8a7778-vin.0", &mstp_clks[MSTP110]), /* VIN0 */
-       CLKDEV_DEV_ID("r8a7778-vin.1", &mstp_clks[MSTP109]), /* VIN1 */
-       CLKDEV_DEV_ID("ehci-platform", &mstp_clks[MSTP100]), /* USB EHCI port0/1 */
-       CLKDEV_DEV_ID("ohci-platform", &mstp_clks[MSTP100]), /* USB OHCI port0/1 */
-       CLKDEV_DEV_ID("renesas_usbhs", &mstp_clks[MSTP100]), /* USB FUNC */
-       CLKDEV_DEV_ID("i2c-rcar.0", &mstp_clks[MSTP030]), /* I2C0 */
-       CLKDEV_DEV_ID("ffc70000.i2c", &mstp_clks[MSTP030]), /* I2C0 */
-       CLKDEV_DEV_ID("i2c-rcar.1", &mstp_clks[MSTP029]), /* I2C1 */
-       CLKDEV_DEV_ID("ffc71000.i2c", &mstp_clks[MSTP029]), /* I2C1 */
-       CLKDEV_DEV_ID("i2c-rcar.2", &mstp_clks[MSTP028]), /* I2C2 */
-       CLKDEV_DEV_ID("ffc72000.i2c", &mstp_clks[MSTP028]), /* I2C2 */
-       CLKDEV_DEV_ID("i2c-rcar.3", &mstp_clks[MSTP027]), /* I2C3 */
-       CLKDEV_DEV_ID("ffc73000.i2c", &mstp_clks[MSTP027]), /* I2C3 */
-       CLKDEV_DEV_ID("sh-sci.0", &mstp_clks[MSTP026]), /* SCIF0 */
-       CLKDEV_DEV_ID("ffe40000.serial", &mstp_clks[MSTP026]), /* SCIF0 */
-       CLKDEV_DEV_ID("sh-sci.1", &mstp_clks[MSTP025]), /* SCIF1 */
-       CLKDEV_DEV_ID("ffe41000.serial", &mstp_clks[MSTP025]), /* SCIF1 */
-       CLKDEV_DEV_ID("sh-sci.2", &mstp_clks[MSTP024]), /* SCIF2 */
-       CLKDEV_DEV_ID("ffe42000.serial", &mstp_clks[MSTP024]), /* SCIF2 */
-       CLKDEV_DEV_ID("sh-sci.3", &mstp_clks[MSTP023]), /* SCIF3 */
-       CLKDEV_DEV_ID("ffe43000.serial", &mstp_clks[MSTP023]), /* SCIF3 */
-       CLKDEV_DEV_ID("sh-sci.4", &mstp_clks[MSTP022]), /* SCIF4 */
-       CLKDEV_DEV_ID("ffe44000.serial", &mstp_clks[MSTP022]), /* SCIF4 */
-       CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP021]), /* SCIF6 */
-       CLKDEV_DEV_ID("ffe45000.serial", &mstp_clks[MSTP021]), /* SCIF5 */
-       CLKDEV_DEV_ID("sh-hspi.0", &mstp_clks[MSTP007]), /* HSPI0 */
-       CLKDEV_DEV_ID("fffc7000.spi", &mstp_clks[MSTP007]), /* HSPI0 */
-       CLKDEV_DEV_ID("sh-hspi.1", &mstp_clks[MSTP007]), /* HSPI1 */
-       CLKDEV_DEV_ID("fffc8000.spi", &mstp_clks[MSTP007]), /* HSPI1 */
-       CLKDEV_DEV_ID("sh-hspi.2", &mstp_clks[MSTP007]), /* HSPI2 */
-       CLKDEV_DEV_ID("fffc6000.spi", &mstp_clks[MSTP007]), /* HSPI2 */
-       CLKDEV_DEV_ID("rcar_sound", &mstp_clks[MSTP008]), /* SRU */
-
-       CLKDEV_ICK_ID("clk_a", "rcar_sound", &audio_clk_a),
-       CLKDEV_ICK_ID("clk_b", "rcar_sound", &audio_clk_b),
-       CLKDEV_ICK_ID("clk_c", "rcar_sound", &audio_clk_c),
-       CLKDEV_ICK_ID("clk_i", "rcar_sound", &s1_clk),
-       CLKDEV_ICK_ID("ssi.0", "rcar_sound", &mstp_clks[MSTP012]),
-       CLKDEV_ICK_ID("ssi.1", "rcar_sound", &mstp_clks[MSTP011]),
-       CLKDEV_ICK_ID("ssi.2", "rcar_sound", &mstp_clks[MSTP010]),
-       CLKDEV_ICK_ID("ssi.3", "rcar_sound", &mstp_clks[MSTP009]),
-       CLKDEV_ICK_ID("ssi.4", "rcar_sound", &mstp_clks[MSTP311]),
-       CLKDEV_ICK_ID("ssi.5", "rcar_sound", &mstp_clks[MSTP310]),
-       CLKDEV_ICK_ID("ssi.6", "rcar_sound", &mstp_clks[MSTP309]),
-       CLKDEV_ICK_ID("ssi.7", "rcar_sound", &mstp_clks[MSTP308]),
-       CLKDEV_ICK_ID("ssi.8", "rcar_sound", &mstp_clks[MSTP307]),
-       CLKDEV_ICK_ID("src.0", "rcar_sound", &mstp_clks[MSTP531]),
-       CLKDEV_ICK_ID("src.1", "rcar_sound", &mstp_clks[MSTP530]),
-       CLKDEV_ICK_ID("src.2", "rcar_sound", &mstp_clks[MSTP529]),
-       CLKDEV_ICK_ID("src.3", "rcar_sound", &mstp_clks[MSTP528]),
-       CLKDEV_ICK_ID("src.4", "rcar_sound", &mstp_clks[MSTP527]),
-       CLKDEV_ICK_ID("src.5", "rcar_sound", &mstp_clks[MSTP526]),
-       CLKDEV_ICK_ID("src.6", "rcar_sound", &mstp_clks[MSTP525]),
-       CLKDEV_ICK_ID("src.7", "rcar_sound", &mstp_clks[MSTP524]),
-       CLKDEV_ICK_ID("src.8", "rcar_sound", &mstp_clks[MSTP523]),
-       CLKDEV_ICK_ID("fck", "sh-tmu.0", &mstp_clks[MSTP016]),
-       CLKDEV_ICK_ID("fck", "ffd80000.timer", &mstp_clks[MSTP016]),
-       CLKDEV_ICK_ID("fck", "sh-tmu.1", &mstp_clks[MSTP015]),
-       CLKDEV_ICK_ID("fck", "ffd81000.timer", &mstp_clks[MSTP015]),
-};
-
-void __init r8a7778_clock_init(void)
-{
-       void __iomem *modemr = ioremap_nocache(MODEMR, PAGE_SIZE);
-       u32 mode;
-       int k, ret = 0;
-
-       BUG_ON(!modemr);
-       mode = ioread32(modemr);
-       iounmap(modemr);
-
-       switch (mode & (MD(19) | MD(18) | MD(12) | MD(11))) {
-       case MD(19):
-               extal_clk.rate = 38000000;
-               SH_CLK_SET_RATIO(&plla_clk_ratio,       21, 1);
-               SH_CLK_SET_RATIO(&pllb_clk_ratio,       21, 1);
-               break;
-       case MD(19) | MD(11):
-               extal_clk.rate = 33333333;
-               SH_CLK_SET_RATIO(&plla_clk_ratio,       24, 1);
-               SH_CLK_SET_RATIO(&pllb_clk_ratio,       24, 1);
-               break;
-       case MD(19) | MD(12):
-               extal_clk.rate = 28500000;
-               SH_CLK_SET_RATIO(&plla_clk_ratio,       28, 1);
-               SH_CLK_SET_RATIO(&pllb_clk_ratio,       28, 1);
-               break;
-       case MD(19) | MD(12) | MD(11):
-               extal_clk.rate = 25000000;
-               SH_CLK_SET_RATIO(&plla_clk_ratio,       32, 1);
-               SH_CLK_SET_RATIO(&pllb_clk_ratio,       32, 1);
-               break;
-       case MD(19) | MD(18) | MD(11):
-               extal_clk.rate = 33333333;
-               SH_CLK_SET_RATIO(&plla_clk_ratio,       24, 1);
-               SH_CLK_SET_RATIO(&pllb_clk_ratio,       21, 1);
-               break;
-       case MD(19) | MD(18) | MD(12):
-               extal_clk.rate = 28500000;
-               SH_CLK_SET_RATIO(&plla_clk_ratio,       28, 1);
-               SH_CLK_SET_RATIO(&pllb_clk_ratio,       21, 1);
-               break;
-       case MD(19) | MD(18) | MD(12) | MD(11):
-               extal_clk.rate = 25000000;
-               SH_CLK_SET_RATIO(&plla_clk_ratio,       32, 1);
-               SH_CLK_SET_RATIO(&pllb_clk_ratio,       24, 1);
-               break;
-       default:
-               BUG();
-       }
-
-       if (mode & MD(1)) {
-               SH_CLK_SET_RATIO(&i_clk_ratio,  1, 1);
-               SH_CLK_SET_RATIO(&s_clk_ratio,  1, 3);
-               SH_CLK_SET_RATIO(&s1_clk_ratio, 1, 6);
-               SH_CLK_SET_RATIO(&s3_clk_ratio, 1, 4);
-               SH_CLK_SET_RATIO(&s4_clk_ratio, 1, 8);
-               SH_CLK_SET_RATIO(&p_clk_ratio,  1, 12);
-               SH_CLK_SET_RATIO(&g_clk_ratio,  1, 12);
-               if (mode & MD(2)) {
-                       SH_CLK_SET_RATIO(&b_clk_ratio,          1, 18);
-                       SH_CLK_SET_RATIO(&out_clk_ratio,        1, 18);
-               } else {
-                       SH_CLK_SET_RATIO(&b_clk_ratio,          1, 12);
-                       SH_CLK_SET_RATIO(&out_clk_ratio,        1, 12);
-               }
-       } else {
-               SH_CLK_SET_RATIO(&i_clk_ratio,  1, 1);
-               SH_CLK_SET_RATIO(&s_clk_ratio,  1, 4);
-               SH_CLK_SET_RATIO(&s1_clk_ratio, 1, 8);
-               SH_CLK_SET_RATIO(&s3_clk_ratio, 1, 4);
-               SH_CLK_SET_RATIO(&s4_clk_ratio, 1, 8);
-               SH_CLK_SET_RATIO(&p_clk_ratio,  1, 16);
-               SH_CLK_SET_RATIO(&g_clk_ratio,  1, 12);
-               if (mode & MD(2)) {
-                       SH_CLK_SET_RATIO(&b_clk_ratio,          1, 16);
-                       SH_CLK_SET_RATIO(&out_clk_ratio,        1, 16);
-               } else {
-                       SH_CLK_SET_RATIO(&b_clk_ratio,          1, 12);
-                       SH_CLK_SET_RATIO(&out_clk_ratio,        1, 12);
-               }
-       }
-
-       for (k = 0; !ret && (k < ARRAY_SIZE(main_clks)); k++)
-               ret = clk_register(main_clks[k]);
-
-       if (!ret)
-               ret = sh_clk_mstp_register(mstp_clks, MSTP_NR);
-
-       clkdev_add_table(lookups, ARRAY_SIZE(lookups));
-
-       if (!ret)
-               shmobile_clk_init();
-       else
-               panic("failed to setup r8a7778 clocks\n");
-}
diff --git a/arch/arm/mach-shmobile/clock.c b/arch/arm/mach-shmobile/clock.c
deleted file mode 100644 (file)
index 68c2d06..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * SH-Mobile Clock Framework
- *
- * Copyright (C) 2010  Magnus Damm
- *
- * Used together with arch/arm/common/clkdev.c and drivers/sh/clk.c.
- *
- * 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 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- */
-
-#include <linux/export.h>
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/sh_clk.h>
-
-#include "clock.h"
-#include "common.h"
-
-unsigned long shmobile_fixed_ratio_clk_recalc(struct clk *clk)
-{
-       struct clk_ratio *p = clk->priv;
-
-       return clk->parent->rate / p->div * p->mul;
-};
-
-struct sh_clk_ops shmobile_fixed_ratio_clk_ops = {
-       .recalc = shmobile_fixed_ratio_clk_recalc,
-};
-
-int __init shmobile_clk_init(void)
-{
-       /* Kick the child clocks.. */
-       recalculate_root_clocks();
-
-       /* Enable the necessary init clocks */
-       clk_enable_init_clocks();
-
-       return 0;
-}
diff --git a/arch/arm/mach-shmobile/clock.h b/arch/arm/mach-shmobile/clock.h
deleted file mode 100644 (file)
index cf3552e..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-#ifndef CLOCK_H
-#define CLOCK_H
-
-/* legacy clock implementation */
-
-struct clk;
-unsigned long shmobile_fixed_ratio_clk_recalc(struct clk *clk);
-extern struct sh_clk_ops shmobile_fixed_ratio_clk_ops;
-
-/* clock ratio */
-struct clk_ratio {
-       int mul;
-       int div;
-};
-
-#define SH_CLK_RATIO(name, m, d)               \
-static struct clk_ratio name ##_ratio = {      \
-       .mul = m,                               \
-       .div = d,                               \
-}
-
-#define SH_FIXED_RATIO_CLKg(name, p, r)        \
-struct clk name = {                    \
-       .parent = &p,                           \
-       .ops    = &shmobile_fixed_ratio_clk_ops,\
-       .priv   = &r ## _ratio,                 \
-}
-
-#define SH_FIXED_RATIO_CLK(name, p, r)         \
-static SH_FIXED_RATIO_CLKg(name, p, r)
-
-#define SH_FIXED_RATIO_CLK_SET(name, p, m, d)  \
-       SH_CLK_RATIO(name, m, d);               \
-       SH_FIXED_RATIO_CLK(name, p, name)
-
-#define SH_CLK_SET_RATIO(p, m, d)      \
-do {                   \
-       (p)->mul = m;   \
-       (p)->div = d;   \
-} while (0)
-
-#endif
index 8d27ec546a35f4b9ee5771adc24a331006342bd1..9cb11215cebaeb2e4e0a8355589ce6d7e5270b78 100644 (file)
@@ -1,10 +1,7 @@
 #ifndef __ARCH_MACH_COMMON_H
 #define __ARCH_MACH_COMMON_H
 
-extern void shmobile_earlytimer_init(void);
 extern void shmobile_init_delay(void);
-struct twd_local_timer;
-extern void shmobile_setup_console(void);
 extern void shmobile_boot_vector(void);
 extern unsigned long shmobile_boot_fn;
 extern unsigned long shmobile_boot_arg;
@@ -18,8 +15,6 @@ extern void shmobile_boot_scu(void);
 extern void shmobile_smp_scu_prepare_cpus(unsigned int max_cpus);
 extern void shmobile_smp_scu_cpu_die(unsigned int cpu);
 extern int shmobile_smp_scu_cpu_kill(unsigned int cpu);
-struct clk;
-extern int shmobile_clk_init(void);
 extern struct platform_suspend_ops shmobile_suspend_ops;
 
 #ifdef CONFIG_SUSPEND
diff --git a/arch/arm/mach-shmobile/console.c b/arch/arm/mach-shmobile/console.c
deleted file mode 100644 (file)
index e329ccb..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * SH-Mobile Console
- *
- * Copyright (C) 2010  Magnus Damm
- *
- * 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 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- */
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <asm/mach/map.h>
-#include "common.h"
-
-void __init shmobile_setup_console(void)
-{
-       parse_early_param();
-
-       /* Let earlyprintk output early console messages */
-       early_platform_driver_probe("earlyprintk", 1, 1);
-}
diff --git a/arch/arm/mach-shmobile/intc.h b/arch/arm/mach-shmobile/intc.h
deleted file mode 100644 (file)
index 40b2ad4..0000000
+++ /dev/null
@@ -1,295 +0,0 @@
-#ifndef __ASM_MACH_INTC_H
-#define __ASM_MACH_INTC_H
-#include <linux/sh_intc.h>
-
-#define INTC_IRQ_PINS_ENUM_16L(p)                              \
-       p ## _IRQ0, p ## _IRQ1, p ## _IRQ2, p ## _IRQ3,         \
-       p ## _IRQ4, p ## _IRQ5, p ## _IRQ6, p ## _IRQ7,         \
-       p ## _IRQ8, p ## _IRQ9, p ## _IRQ10, p ## _IRQ11,       \
-       p ## _IRQ12, p ## _IRQ13, p ## _IRQ14, p ## _IRQ15
-
-#define INTC_IRQ_PINS_ENUM_16H(p)                              \
-       p ## _IRQ16, p ## _IRQ17, p ## _IRQ18, p ## _IRQ19,     \
-       p ## _IRQ20, p ## _IRQ21, p ## _IRQ22, p ## _IRQ23,     \
-       p ## _IRQ24, p ## _IRQ25, p ## _IRQ26, p ## _IRQ27,     \
-       p ## _IRQ28, p ## _IRQ29, p ## _IRQ30, p ## _IRQ31
-
-#define INTC_IRQ_PINS_VECT_16L(p, vect)                                \
-       vect(p ## _IRQ0, 0x0200), vect(p ## _IRQ1, 0x0220),     \
-       vect(p ## _IRQ2, 0x0240), vect(p ## _IRQ3, 0x0260),     \
-       vect(p ## _IRQ4, 0x0280), vect(p ## _IRQ5, 0x02a0),     \
-       vect(p ## _IRQ6, 0x02c0), vect(p ## _IRQ7, 0x02e0),     \
-       vect(p ## _IRQ8, 0x0300), vect(p ## _IRQ9, 0x0320),     \
-       vect(p ## _IRQ10, 0x0340), vect(p ## _IRQ11, 0x0360),   \
-       vect(p ## _IRQ12, 0x0380), vect(p ## _IRQ13, 0x03a0),   \
-       vect(p ## _IRQ14, 0x03c0), vect(p ## _IRQ15, 0x03e0)
-
-#define INTC_IRQ_PINS_VECT_16H(p, vect)                                \
-       vect(p ## _IRQ16, 0x3200), vect(p ## _IRQ17, 0x3220),   \
-       vect(p ## _IRQ18, 0x3240), vect(p ## _IRQ19, 0x3260),   \
-       vect(p ## _IRQ20, 0x3280), vect(p ## _IRQ21, 0x32a0),   \
-       vect(p ## _IRQ22, 0x32c0), vect(p ## _IRQ23, 0x32e0),   \
-       vect(p ## _IRQ24, 0x3300), vect(p ## _IRQ25, 0x3320),   \
-       vect(p ## _IRQ26, 0x3340), vect(p ## _IRQ27, 0x3360),   \
-       vect(p ## _IRQ28, 0x3380), vect(p ## _IRQ29, 0x33a0),   \
-       vect(p ## _IRQ30, 0x33c0), vect(p ## _IRQ31, 0x33e0)
-
-#define INTC_IRQ_PINS_MASK_16L(p, base)                                        \
-       { base + 0x40, base + 0x60, 8, /* INTMSK00A / INTMSKCLR00A */   \
-         { p ## _IRQ0, p ## _IRQ1, p ## _IRQ2, p ## _IRQ3,             \
-           p ## _IRQ4, p ## _IRQ5, p ## _IRQ6, p ## _IRQ7 } },         \
-       { base + 0x44, base + 0x64, 8, /* INTMSK10A / INTMSKCLR10A */   \
-         { p ## _IRQ8, p ## _IRQ9, p ## _IRQ10, p ## _IRQ11,           \
-           p ## _IRQ12, p ## _IRQ13, p ## _IRQ14, p ## _IRQ15 } }
-
-#define INTC_IRQ_PINS_MASK_16H(p, base)                                        \
-       { base + 0x48, base + 0x68, 8, /* INTMSK20A / INTMSKCLR20A */   \
-         { p ## _IRQ16, p ## _IRQ17, p ## _IRQ18, p ## _IRQ19,         \
-           p ## _IRQ20, p ## _IRQ21, p ## _IRQ22, p ## _IRQ23 } },     \
-       { base + 0x4c, base + 0x6c, 8, /* INTMSK30A / INTMSKCLR30A */   \
-         { p ## _IRQ24, p ## _IRQ25, p ## _IRQ26, p ## _IRQ27,         \
-           p ## _IRQ28, p ## _IRQ29, p ## _IRQ30, p ## _IRQ31 } }
-
-#define INTC_IRQ_PINS_PRIO_16L(p, base)                                        \
-       { base + 0x10, 0, 32, 4, /* INTPRI00A */                        \
-         { p ## _IRQ0, p ## _IRQ1, p ## _IRQ2, p ## _IRQ3,             \
-           p ## _IRQ4, p ## _IRQ5, p ## _IRQ6, p ## _IRQ7 } },         \
-       { base + 0x14, 0, 32, 4, /* INTPRI10A */                        \
-         { p ## _IRQ8, p ## _IRQ9, p ## _IRQ10, p ## _IRQ11,           \
-           p ## _IRQ12, p ## _IRQ13, p ## _IRQ14, p ## _IRQ15 } }
-
-#define INTC_IRQ_PINS_PRIO_16H(p, base)                                        \
-       { base + 0x18, 0, 32, 4, /* INTPRI20A */                        \
-         { p ## _IRQ16, p ## _IRQ17, p ## _IRQ18, p ## _IRQ19,         \
-           p ## _IRQ20, p ## _IRQ21, p ## _IRQ22, p ## _IRQ23 } },     \
-       { base + 0x1c, 0, 32, 4, /* INTPRI30A */                        \
-         { p ## _IRQ24, p ## _IRQ25, p ## _IRQ26, p ## _IRQ27,         \
-           p ## _IRQ28, p ## _IRQ29, p ## _IRQ30, p ## _IRQ31 } }
-
-#define INTC_IRQ_PINS_SENSE_16L(p, base)                               \
-       { base + 0x00, 32, 4, /* ICR1A */                               \
-         { p ## _IRQ0, p ## _IRQ1, p ## _IRQ2, p ## _IRQ3,             \
-           p ## _IRQ4, p ## _IRQ5, p ## _IRQ6, p ## _IRQ7 } },         \
-       { base + 0x04, 32, 4, /* ICR2A */                               \
-         { p ## _IRQ8, p ## _IRQ9, p ## _IRQ10, p ## _IRQ11,           \
-           p ## _IRQ12, p ## _IRQ13, p ## _IRQ14, p ## _IRQ15 } }
-
-#define INTC_IRQ_PINS_SENSE_16H(p, base)                               \
-       { base + 0x08, 32, 4, /* ICR3A */                               \
-         { p ## _IRQ16, p ## _IRQ17, p ## _IRQ18, p ## _IRQ19,         \
-           p ## _IRQ20, p ## _IRQ21, p ## _IRQ22, p ## _IRQ23 } },     \
-       { base + 0x0c, 32, 4, /* ICR4A */                               \
-         { p ## _IRQ24, p ## _IRQ25, p ## _IRQ26, p ## _IRQ27,         \
-           p ## _IRQ28, p ## _IRQ29, p ## _IRQ30, p ## _IRQ31 } }
-
-#define INTC_IRQ_PINS_ACK_16L(p, base)                                 \
-       { base + 0x20, 0, 8, /* INTREQ00A */                            \
-         { p ## _IRQ0, p ## _IRQ1, p ## _IRQ2, p ## _IRQ3,             \
-           p ## _IRQ4, p ## _IRQ5, p ## _IRQ6, p ## _IRQ7 } },         \
-       { base + 0x24, 0, 8, /* INTREQ10A */                            \
-         { p ## _IRQ8, p ## _IRQ9, p ## _IRQ10, p ## _IRQ11,           \
-           p ## _IRQ12, p ## _IRQ13, p ## _IRQ14, p ## _IRQ15 } }
-
-#define INTC_IRQ_PINS_ACK_16H(p, base)                                 \
-       { base + 0x28, 0, 8, /* INTREQ20A */                            \
-         { p ## _IRQ16, p ## _IRQ17, p ## _IRQ18, p ## _IRQ19,         \
-           p ## _IRQ20, p ## _IRQ21, p ## _IRQ22, p ## _IRQ23 } },     \
-       { base + 0x2c, 0, 8, /* INTREQ30A */                            \
-         { p ## _IRQ24, p ## _IRQ25, p ## _IRQ26, p ## _IRQ27,         \
-           p ## _IRQ28, p ## _IRQ29, p ## _IRQ30, p ## _IRQ31 } }
-
-#define INTC_IRQ_PINS_16(p, base, vect, str)                           \
-                                                                       \
-static struct resource p ## _resources[] __initdata = {                        \
-       [0] = {                                                         \
-               .start  = base,                                         \
-               .end    = base + 0x64,                                  \
-               .flags  = IORESOURCE_MEM,                               \
-       },                                                              \
-};                                                                     \
-                                                                       \
-enum {                                                                 \
-       p ## _UNUSED = 0,                                               \
-       INTC_IRQ_PINS_ENUM_16L(p),                                      \
-};                                                                     \
-                                                                       \
-static struct intc_vect p ## _vectors[] __initdata = {                 \
-       INTC_IRQ_PINS_VECT_16L(p, vect),                                \
-};                                                                     \
-                                                                       \
-static struct intc_mask_reg p ## _mask_registers[] __initdata = {      \
-       INTC_IRQ_PINS_MASK_16L(p, base),                                \
-};                                                                     \
-                                                                       \
-static struct intc_prio_reg p ## _prio_registers[] __initdata = {      \
-       INTC_IRQ_PINS_PRIO_16L(p, base),                                \
-};                                                                     \
-                                                                       \
-static struct intc_sense_reg p ## _sense_registers[] __initdata = {    \
-       INTC_IRQ_PINS_SENSE_16L(p, base),                               \
-};                                                                     \
-                                                                       \
-static struct intc_mask_reg p ## _ack_registers[] __initdata = {       \
-       INTC_IRQ_PINS_ACK_16L(p, base),                                 \
-};                                                                     \
-                                                                       \
-static struct intc_desc p ## _desc __initdata = {                      \
-       .name = str,                                                    \
-       .resource = p ## _resources,                                    \
-       .num_resources = ARRAY_SIZE(p ## _resources),                   \
-       .hw = INTC_HW_DESC(p ## _vectors, NULL,                         \
-                            p ## _mask_registers, p ## _prio_registers, \
-                            p ## _sense_registers, p ## _ack_registers) \
-}
-
-#define INTC_IRQ_PINS_16H(p, base, vect, str)                          \
-                                                                       \
-static struct resource p ## _resources[] __initdata = {                        \
-       [0] = {                                                         \
-               .start  = base,                                         \
-               .end    = base + 0x64,                                  \
-               .flags  = IORESOURCE_MEM,                               \
-       },                                                              \
-};                                                                     \
-                                                                       \
-enum {                                                                 \
-       p ## _UNUSED = 0,                                               \
-       INTC_IRQ_PINS_ENUM_16H(p),                                      \
-};                                                                     \
-                                                                       \
-static struct intc_vect p ## _vectors[] __initdata = {                 \
-       INTC_IRQ_PINS_VECT_16H(p, vect),                                \
-};                                                                     \
-                                                                       \
-static struct intc_mask_reg p ## _mask_registers[] __initdata = {      \
-       INTC_IRQ_PINS_MASK_16H(p, base),                                \
-};                                                                     \
-                                                                       \
-static struct intc_prio_reg p ## _prio_registers[] __initdata = {      \
-       INTC_IRQ_PINS_PRIO_16H(p, base),                                \
-};                                                                     \
-                                                                       \
-static struct intc_sense_reg p ## _sense_registers[] __initdata = {    \
-       INTC_IRQ_PINS_SENSE_16H(p, base),                               \
-};                                                                     \
-                                                                       \
-static struct intc_mask_reg p ## _ack_registers[] __initdata = {       \
-       INTC_IRQ_PINS_ACK_16H(p, base),                                 \
-};                                                                     \
-                                                                       \
-static struct intc_desc p ## _desc __initdata = {                      \
-       .name = str,                                                    \
-       .resource = p ## _resources,                                    \
-       .num_resources = ARRAY_SIZE(p ## _resources),                   \
-       .hw = INTC_HW_DESC(p ## _vectors, NULL,                         \
-                            p ## _mask_registers, p ## _prio_registers, \
-                            p ## _sense_registers, p ## _ack_registers) \
-}
-
-#define INTC_IRQ_PINS_32(p, base, vect, str)                           \
-                                                                       \
-static struct resource p ## _resources[] __initdata = {                        \
-       [0] = {                                                         \
-               .start  = base,                                         \
-               .end    = base + 0x6c,                                  \
-               .flags  = IORESOURCE_MEM,                               \
-       },                                                              \
-};                                                                     \
-                                                                       \
-enum {                                                                 \
-       p ## _UNUSED = 0,                                               \
-       INTC_IRQ_PINS_ENUM_16L(p),                                      \
-       INTC_IRQ_PINS_ENUM_16H(p),                                      \
-};                                                                     \
-                                                                       \
-static struct intc_vect p ## _vectors[] __initdata = {                 \
-       INTC_IRQ_PINS_VECT_16L(p, vect),                                \
-       INTC_IRQ_PINS_VECT_16H(p, vect),                                \
-};                                                                     \
-                                                                       \
-static struct intc_mask_reg p ## _mask_registers[] __initdata = {      \
-       INTC_IRQ_PINS_MASK_16L(p, base),                                \
-       INTC_IRQ_PINS_MASK_16H(p, base),                                \
-};                                                                     \
-                                                                       \
-static struct intc_prio_reg p ## _prio_registers[] __initdata = {      \
-       INTC_IRQ_PINS_PRIO_16L(p, base),                                \
-       INTC_IRQ_PINS_PRIO_16H(p, base),                                \
-};                                                                     \
-                                                                       \
-static struct intc_sense_reg p ## _sense_registers[] __initdata = {    \
-       INTC_IRQ_PINS_SENSE_16L(p, base),                               \
-       INTC_IRQ_PINS_SENSE_16H(p, base),                               \
-};                                                                     \
-                                                                       \
-static struct intc_mask_reg p ## _ack_registers[] __initdata = {       \
-       INTC_IRQ_PINS_ACK_16L(p, base),                                 \
-       INTC_IRQ_PINS_ACK_16H(p, base),                                 \
-};                                                                     \
-                                                                       \
-static struct intc_desc p ## _desc __initdata = {                      \
-       .name = str,                                                    \
-       .resource = p ## _resources,                                    \
-       .num_resources = ARRAY_SIZE(p ## _resources),                   \
-       .hw = INTC_HW_DESC(p ## _vectors, NULL,                         \
-                            p ## _mask_registers, p ## _prio_registers, \
-                            p ## _sense_registers, p ## _ack_registers) \
-}
-
-#define INTC_PINT_E_EMPTY
-#define INTC_PINT_E_NONE 0, 0, 0, 0, 0, 0, 0, 0,
-#define INTC_PINT_E(p)                                                 \
-       PINT ## p ## 0, PINT ## p ## 1, PINT ## p ## 2, PINT ## p ## 3, \
-       PINT ## p ## 4, PINT ## p ## 5, PINT ## p ## 6, PINT ## p ## 7,
-
-#define INTC_PINT_V_NONE
-#define INTC_PINT_V(p, vect)                                   \
-       vect(PINT ## p ## 0, 0), vect(PINT ## p ## 1, 1),       \
-       vect(PINT ## p ## 2, 2), vect(PINT ## p ## 3, 3),       \
-       vect(PINT ## p ## 4, 4), vect(PINT ## p ## 5, 5),       \
-       vect(PINT ## p ## 6, 6), vect(PINT ## p ## 7, 7),
-
-#define INTC_PINT(p, mask_reg, sense_base, str,                                \
-       enums_1, enums_2, enums_3, enums_4,                             \
-       vect_1, vect_2, vect_3, vect_4,                                 \
-       mask_a, mask_b, mask_c, mask_d,                                 \
-       sense_a, sense_b, sense_c, sense_d)                             \
-                                                                       \
-enum {                                                                 \
-       PINT ## p ## _UNUSED = 0,                                       \
-       enums_1 enums_2 enums_3 enums_4                                 \
-};                                                                     \
-                                                                       \
-static struct intc_vect p ## _vectors[] __initdata = {                 \
-       vect_1 vect_2 vect_3 vect_4                                     \
-};                                                                     \
-                                                                       \
-static struct intc_mask_reg p ## _mask_registers[] __initdata = {      \
-       { mask_reg, 0, 32, /* PINTER */                                 \
-         { mask_a mask_b mask_c mask_d } }                             \
-};                                                                     \
-                                                                       \
-static struct intc_sense_reg p ## _sense_registers[] __initdata = {    \
-       { sense_base + 0x00, 16, 2, /* PINTCR */                        \
-         { sense_a } },                                                \
-       { sense_base + 0x04, 16, 2, /* PINTCR */                        \
-         { sense_b } },                                                \
-       { sense_base + 0x08, 16, 2, /* PINTCR */                        \
-         { sense_c } },                                                \
-       { sense_base + 0x0c, 16, 2, /* PINTCR */                        \
-         { sense_d } },                                                \
-};                                                                     \
-                                                                       \
-static struct intc_desc p ## _desc __initdata = {                      \
-       .name = str,                                                    \
-       .hw = INTC_HW_DESC(p ## _vectors, NULL,                         \
-                            p ## _mask_registers, NULL,                \
-                            p ## _sense_registers, NULL),              \
-}
-
-/* INTCS */
-#define INTCS_VECT_BASE                0x3400
-#define INTCS_VECT(n, vect)    INTC_VECT((n), INTCS_VECT_BASE + (vect))
-#define intcs_evt2irq(evt)     evt2irq(INTCS_VECT_BASE + (evt))
-
-#endif  /* __ASM_MACH_INTC_H */
index 4e54512bee308312a7113751832e320490fbe5db..911884f7e28b174c271c6724c863520afe859868 100644 (file)
@@ -88,7 +88,7 @@ static void apmu_init_cpu(struct resource *res, int cpu, int bit)
 static void apmu_parse_cfg(void (*fn)(struct resource *res, int cpu, int bit),
                           struct rcar_apmu_config *apmu_config, int num)
 {
-       u32 id;
+       int id;
        int k;
        int bit, index;
        bool is_allowed;
@@ -170,7 +170,7 @@ static inline void cpu_enter_lowpower_a15(void)
        dsb();
 }
 
-void shmobile_smp_apmu_cpu_shutdown(unsigned int cpu)
+static void shmobile_smp_apmu_cpu_shutdown(unsigned int cpu)
 {
 
        /* Select next sleep mode using the APMU */
index 47a862e7f8bab242a180e3e72bba6c306ff15f03..14c42a1bdf1ef20d506f47d8fe013be7e71254b9 100644 (file)
@@ -9,20 +9,8 @@
  * for more details.
  */
 
-#include <linux/pm.h>
-#include <linux/suspend.h>
-#include <linux/err.h>
-#include <linux/pm_clock.h>
-#include <linux/pm_domain.h>
-#include <linux/platform_device.h>
-#include <linux/delay.h>
-#include <linux/irq.h>
-#include <linux/interrupt.h>
-#include <linux/console.h>
-
 #include <asm/io.h>
 
-#include "common.h"
 #include "pm-rcar.h"
 #include "r8a7779.h"
 
 #define SYSCIER 0x0c
 #define SYSCIMR 0x10
 
-struct r8a7779_pm_domain {
-       struct generic_pm_domain genpd;
-       struct rcar_sysc_ch ch;
-};
-
-static inline
-const struct rcar_sysc_ch *to_r8a7779_ch(struct generic_pm_domain *d)
-{
-       return &container_of(d, struct r8a7779_pm_domain, genpd)->ch;
-}
-
 #if defined(CONFIG_PM) || defined(CONFIG_SMP)
 
 static void __init r8a7779_sysc_init(void)
@@ -58,82 +35,6 @@ static inline void r8a7779_sysc_init(void) {}
 
 #endif /* CONFIG_PM || CONFIG_SMP */
 
-#ifdef CONFIG_PM
-
-static int pd_power_down(struct generic_pm_domain *genpd)
-{
-       return rcar_sysc_power_down(to_r8a7779_ch(genpd));
-}
-
-static int pd_power_up(struct generic_pm_domain *genpd)
-{
-       return rcar_sysc_power_up(to_r8a7779_ch(genpd));
-}
-
-static bool pd_is_off(struct generic_pm_domain *genpd)
-{
-       return rcar_sysc_power_is_off(to_r8a7779_ch(genpd));
-}
-
-static bool pd_active_wakeup(struct device *dev)
-{
-       return true;
-}
-
-static void r8a7779_init_pm_domain(struct r8a7779_pm_domain *r8a7779_pd)
-{
-       struct generic_pm_domain *genpd = &r8a7779_pd->genpd;
-
-       pm_genpd_init(genpd, NULL, false);
-       genpd->dev_ops.active_wakeup = pd_active_wakeup;
-       genpd->power_off = pd_power_down;
-       genpd->power_on = pd_power_up;
-
-       if (pd_is_off(&r8a7779_pd->genpd))
-               pd_power_up(&r8a7779_pd->genpd);
-}
-
-static struct r8a7779_pm_domain r8a7779_pm_domains[] = {
-       {
-               .genpd.name = "SH4A",
-               .ch = {
-                       .chan_offs = 0x80, /* PWRSR1 .. PWRER1 */
-                       .isr_bit = 16, /* SH4A */
-               },
-       },
-       {
-               .genpd.name = "SGX",
-               .ch = {
-                       .chan_offs = 0xc0, /* PWRSR2 .. PWRER2 */
-                       .isr_bit = 20, /* SGX */
-               },
-       },
-       {
-               .genpd.name = "VDP1",
-               .ch = {
-                       .chan_offs = 0x100, /* PWRSR3 .. PWRER3 */
-                       .isr_bit = 21, /* VDP */
-               },
-       },
-       {
-               .genpd.name = "IMPX3",
-               .ch = {
-                       .chan_offs = 0x140, /* PWRSR4 .. PWRER4 */
-                       .isr_bit = 24, /* IMP */
-               },
-       },
-};
-
-void __init r8a7779_init_pm_domains(void)
-{
-       int j;
-
-       for (j = 0; j < ARRAY_SIZE(r8a7779_pm_domains); j++)
-               r8a7779_init_pm_domain(&r8a7779_pm_domains[j]);
-}
-
-#endif /* CONFIG_PM */
-
 void __init r8a7779_pm_init(void)
 {
        static int once;
index a5b96b990aea8dfc551ea56f0421cd0837b68a82..46d0a1ddce755e80ffc3f8f1bc6a510287da7906 100644 (file)
@@ -12,6 +12,7 @@
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
  */
+#include <linux/clk/shmobile.h>
 #include <linux/console.h>
 #include <linux/delay.h>
 #include <linux/of.h>
@@ -124,36 +125,6 @@ static bool rmobile_pd_active_wakeup(struct device *dev)
        return true;
 }
 
-static int rmobile_pd_attach_dev(struct generic_pm_domain *domain,
-                                struct device *dev)
-{
-       int error;
-
-       error = pm_clk_create(dev);
-       if (error) {
-               dev_err(dev, "pm_clk_create failed %d\n", error);
-               return error;
-       }
-
-       error = pm_clk_add(dev, NULL);
-       if (error) {
-               dev_err(dev, "pm_clk_add failed %d\n", error);
-               goto fail;
-       }
-
-       return 0;
-
-fail:
-       pm_clk_destroy(dev);
-       return error;
-}
-
-static void rmobile_pd_detach_dev(struct generic_pm_domain *domain,
-                                 struct device *dev)
-{
-       pm_clk_destroy(dev);
-}
-
 static void rmobile_init_pm_domain(struct rmobile_pm_domain *rmobile_pd)
 {
        struct generic_pm_domain *genpd = &rmobile_pd->genpd;
@@ -164,8 +135,8 @@ static void rmobile_init_pm_domain(struct rmobile_pm_domain *rmobile_pd)
        genpd->dev_ops.active_wakeup    = rmobile_pd_active_wakeup;
        genpd->power_off                = rmobile_pd_power_down;
        genpd->power_on                 = rmobile_pd_power_up;
-       genpd->attach_dev               = rmobile_pd_attach_dev;
-       genpd->detach_dev               = rmobile_pd_detach_dev;
+       genpd->attach_dev               = cpg_mstp_attach_dev;
+       genpd->detach_dev               = cpg_mstp_detach_dev;
        __rmobile_pd_power_up(rmobile_pd, false);
 }
 
@@ -342,8 +313,10 @@ static int __init rmobile_add_pm_domains(void __iomem *base,
                }
 
                pd = kzalloc(sizeof(*pd), GFP_KERNEL);
-               if (!pd)
+               if (!pd) {
+                       of_node_put(np);
                        return -ENOMEM;
+               }
 
                pd->genpd.name = np->name;
                pd->base = base;
index 30a4a421ee315b987946e0f005d199f3903112e4..8146bb6d7237eafc8c1cf5cc87a8c95f5fe62a6e 100644 (file)
 
 #include <linux/pm_domain.h>
 
-#define DEFAULT_DEV_LATENCY_NS 250000
-
-struct platform_device;
-
 struct rmobile_pm_domain {
        struct generic_pm_domain genpd;
        struct dev_power_governor *gov;
@@ -26,9 +22,4 @@ struct rmobile_pm_domain {
        bool no_debug;
 };
 
-struct pm_domain_device {
-       const char *domain_name;
-       struct platform_device *pdev;
-};
-
 #endif /* PM_RMOBILE_H */
diff --git a/arch/arm/mach-shmobile/r8a7778.h b/arch/arm/mach-shmobile/r8a7778.h
deleted file mode 100644 (file)
index f64fedb..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright (C) 2013  Renesas Solutions Corp.
- * Copyright (C) 2013  Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
- * Copyright (C) 2013  Cogent Embedded, Inc.
- *
- * 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 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- */
-#ifndef __ASM_R8A7778_H__
-#define __ASM_R8A7778_H__
-
-#include <linux/sh_eth.h>
-
-/* HPB-DMA slave IDs */
-enum {
-       HPBDMA_SLAVE_DUMMY,
-       HPBDMA_SLAVE_SDHI0_TX,
-       HPBDMA_SLAVE_SDHI0_RX,
-       HPBDMA_SLAVE_SSI0_TX,
-       HPBDMA_SLAVE_SSI0_RX,
-       HPBDMA_SLAVE_SSI1_TX,
-       HPBDMA_SLAVE_SSI1_RX,
-       HPBDMA_SLAVE_SSI2_TX,
-       HPBDMA_SLAVE_SSI2_RX,
-       HPBDMA_SLAVE_SSI3_TX,
-       HPBDMA_SLAVE_SSI3_RX,
-       HPBDMA_SLAVE_SSI4_TX,
-       HPBDMA_SLAVE_SSI4_RX,
-       HPBDMA_SLAVE_SSI5_TX,
-       HPBDMA_SLAVE_SSI5_RX,
-       HPBDMA_SLAVE_SSI6_TX,
-       HPBDMA_SLAVE_SSI6_RX,
-       HPBDMA_SLAVE_SSI7_TX,
-       HPBDMA_SLAVE_SSI7_RX,
-       HPBDMA_SLAVE_SSI8_TX,
-       HPBDMA_SLAVE_SSI8_RX,
-       HPBDMA_SLAVE_HPBIF0_TX,
-       HPBDMA_SLAVE_HPBIF0_RX,
-       HPBDMA_SLAVE_HPBIF1_TX,
-       HPBDMA_SLAVE_HPBIF1_RX,
-       HPBDMA_SLAVE_HPBIF2_TX,
-       HPBDMA_SLAVE_HPBIF2_RX,
-       HPBDMA_SLAVE_HPBIF3_TX,
-       HPBDMA_SLAVE_HPBIF3_RX,
-       HPBDMA_SLAVE_HPBIF4_TX,
-       HPBDMA_SLAVE_HPBIF4_RX,
-       HPBDMA_SLAVE_HPBIF5_TX,
-       HPBDMA_SLAVE_HPBIF5_RX,
-       HPBDMA_SLAVE_HPBIF6_TX,
-       HPBDMA_SLAVE_HPBIF6_RX,
-       HPBDMA_SLAVE_HPBIF7_TX,
-       HPBDMA_SLAVE_HPBIF7_RX,
-       HPBDMA_SLAVE_HPBIF8_TX,
-       HPBDMA_SLAVE_HPBIF8_RX,
-       HPBDMA_SLAVE_USBFUNC_TX,
-       HPBDMA_SLAVE_USBFUNC_RX,
-};
-
-extern void r8a7778_add_standard_devices(void);
-extern void r8a7778_add_standard_devices_dt(void);
-extern void r8a7778_add_dt_devices(void);
-
-extern void r8a7778_init_late(void);
-extern void r8a7778_init_irq_dt(void);
-extern void r8a7778_clock_init(void);
-extern void r8a7778_init_irq_extpin(int irlm);
-extern void r8a7778_init_irq_extpin_dt(int irlm);
-extern void r8a7778_pinmux_init(void);
-
-extern int r8a7778_usb_phy_power(bool enable);
-
-#endif /* __ASM_R8A7778_H__ */
index db303f76704e907547f35bc1973dc3a0b32fb264..e1aaa2ef9376c91de1696ce0b475387af6390012 100644 (file)
@@ -1,16 +1,8 @@
 #ifndef __ASM_R8A7779_H__
 #define __ASM_R8A7779_H__
 
-#include <linux/sh_clk.h>
-
 extern void r8a7779_pm_init(void);
 
-#ifdef CONFIG_PM
-extern void __init r8a7779_init_pm_domains(void);
-#else
-static inline void r8a7779_init_pm_domains(void) {}
-#endif /* CONFIG_PM */
-
 extern struct smp_operations r8a7779_smp_ops;
 
 #endif /* __ASM_R8A7779_H__ */
index b9116c81e54beb1dfdbd8f01a66f9d2941e2d137..0ab9d32728758a9aa17dc850696ace8e75b49637 100644 (file)
  */
 
 #include <linux/clk/shmobile.h>
-#include <linux/kernel.h>
 #include <linux/io.h>
-#include <linux/irqchip/arm-gic.h>
-#include <linux/of.h>
-#include <linux/of_platform.h>
-#include <linux/platform_data/dma-rcar-hpbdma.h>
-#include <linux/platform_data/gpio-rcar.h>
-#include <linux/platform_data/irq-renesas-intc-irqpin.h>
-#include <linux/platform_device.h>
 #include <linux/irqchip.h>
-#include <linux/serial_sci.h>
-#include <linux/sh_timer.h>
-#include <linux/pm_runtime.h>
-#include <linux/usb/phy.h>
-#include <linux/usb/hcd.h>
-#include <linux/usb/ehci_pdriver.h>
-#include <linux/usb/ohci_pdriver.h>
-#include <linux/dma-mapping.h>
 
 #include <asm/mach/arch.h>
-#include <asm/hardware/cache-l2x0.h>
 
 #include "common.h"
 #include "irqs.h"
-#include "r8a7778.h"
 
 #define MODEMR 0xffcc0020
 
-#ifdef CONFIG_COMMON_CLK
 static void __init r8a7778_timer_init(void)
 {
        u32 mode;
@@ -55,555 +36,21 @@ static void __init r8a7778_timer_init(void)
        iounmap(modemr);
        r8a7778_clocks_init(mode);
 }
-#endif
 
-/* SCIF */
-#define R8A7778_SCIF(index, baseaddr, irq)                     \
-static struct plat_sci_port scif##index##_platform_data = {    \
-       .flags          = UPF_BOOT_AUTOCONF | UPF_IOREMAP,      \
-       .scscr          = SCSCR_RE | SCSCR_TE | SCSCR_CKE1,     \
-       .type           = PORT_SCIF,                            \
-};                                                             \
-                                                               \
-static struct resource scif##index##_resources[] = {           \
-       DEFINE_RES_MEM(baseaddr, 0x100),                        \
-       DEFINE_RES_IRQ(irq),                                    \
-}
-
-R8A7778_SCIF(0, 0xffe40000, gic_iid(0x66));
-R8A7778_SCIF(1, 0xffe41000, gic_iid(0x67));
-R8A7778_SCIF(2, 0xffe42000, gic_iid(0x68));
-R8A7778_SCIF(3, 0xffe43000, gic_iid(0x69));
-R8A7778_SCIF(4, 0xffe44000, gic_iid(0x6a));
-R8A7778_SCIF(5, 0xffe45000, gic_iid(0x6b));
-
-#define r8a7778_register_scif(index)                                          \
-       platform_device_register_resndata(NULL, "sh-sci", index,               \
-                                         scif##index##_resources,             \
-                                         ARRAY_SIZE(scif##index##_resources), \
-                                         &scif##index##_platform_data,        \
-                                         sizeof(scif##index##_platform_data))
-
-/* TMU */
-static struct sh_timer_config sh_tmu0_platform_data = {
-       .channels_mask = 7,
-};
-
-static struct resource sh_tmu0_resources[] = {
-       DEFINE_RES_MEM(0xffd80000, 0x30),
-       DEFINE_RES_IRQ(gic_iid(0x40)),
-       DEFINE_RES_IRQ(gic_iid(0x41)),
-       DEFINE_RES_IRQ(gic_iid(0x42)),
-};
-
-#define r8a7778_register_tmu(idx)                      \
-       platform_device_register_resndata(              \
-               NULL, "sh-tmu", idx,                    \
-               sh_tmu##idx##_resources,                \
-               ARRAY_SIZE(sh_tmu##idx##_resources),    \
-               &sh_tmu##idx##_platform_data,           \
-               sizeof(sh_tmu##idx##_platform_data))
-
-int r8a7778_usb_phy_power(bool enable)
-{
-       static struct usb_phy *phy = NULL;
-       int ret = 0;
-
-       if (!phy)
-               phy = usb_get_phy(USB_PHY_TYPE_USB2);
-
-       if (IS_ERR(phy)) {
-               pr_err("kernel doesn't have usb phy driver\n");
-               return PTR_ERR(phy);
-       }
-
-       if (enable)
-               ret = usb_phy_init(phy);
-       else
-               usb_phy_shutdown(phy);
-
-       return ret;
-}
-
-/* USB */
-static int usb_power_on(struct platform_device *pdev)
-{
-       int ret = r8a7778_usb_phy_power(true);
-
-       if (ret)
-               return ret;
-
-       pm_runtime_enable(&pdev->dev);
-       pm_runtime_get_sync(&pdev->dev);
-
-       return 0;
-}
-
-static void usb_power_off(struct platform_device *pdev)
-{
-       if (r8a7778_usb_phy_power(false))
-               return;
-
-       pm_runtime_put_sync(&pdev->dev);
-       pm_runtime_disable(&pdev->dev);
-}
-
-static int ehci_init_internal_buffer(struct usb_hcd *hcd)
-{
-       /*
-        * Below are recommended values from the datasheet;
-        * see [USB :: Setting of EHCI Internal Buffer].
-        */
-       /* EHCI IP internal buffer setting */
-       iowrite32(0x00ff0040, hcd->regs + 0x0094);
-       /* EHCI IP internal buffer enable */
-       iowrite32(0x00000001, hcd->regs + 0x009C);
-
-       return 0;
-}
-
-static struct usb_ehci_pdata ehci_pdata __initdata = {
-       .power_on       = usb_power_on,
-       .power_off      = usb_power_off,
-       .power_suspend  = usb_power_off,
-       .pre_setup      = ehci_init_internal_buffer,
-};
-
-static struct resource ehci_resources[] __initdata = {
-       DEFINE_RES_MEM(0xffe70000, 0x400),
-       DEFINE_RES_IRQ(gic_iid(0x4c)),
-};
-
-static struct usb_ohci_pdata ohci_pdata __initdata = {
-       .power_on       = usb_power_on,
-       .power_off      = usb_power_off,
-       .power_suspend  = usb_power_off,
-};
-
-static struct resource ohci_resources[] __initdata = {
-       DEFINE_RES_MEM(0xffe70400, 0x400),
-       DEFINE_RES_IRQ(gic_iid(0x4c)),
-};
-
-#define USB_PLATFORM_INFO(hci)                                 \
-static struct platform_device_info hci##_info __initdata = {   \
-       .name           = #hci "-platform",                     \
-       .id             = -1,                                   \
-       .res            = hci##_resources,                      \
-       .num_res        = ARRAY_SIZE(hci##_resources),          \
-       .data           = &hci##_pdata,                         \
-       .size_data      = sizeof(hci##_pdata),                  \
-       .dma_mask       = DMA_BIT_MASK(32),                     \
-}
-
-USB_PLATFORM_INFO(ehci);
-USB_PLATFORM_INFO(ohci);
-
-/* PFC/GPIO */
-static struct resource pfc_resources[] __initdata = {
-       DEFINE_RES_MEM(0xfffc0000, 0x118),
-};
-
-#define R8A7778_GPIO(idx)                                              \
-static struct resource r8a7778_gpio##idx##_resources[] __initdata = {  \
-       DEFINE_RES_MEM(0xffc40000 + 0x1000 * (idx), 0x30),              \
-       DEFINE_RES_IRQ(gic_iid(0x87)),                                  \
-};                                                                     \
-                                                                       \
-static struct gpio_rcar_config r8a7778_gpio##idx##_platform_data __initdata = { \
-       .gpio_base      = 32 * (idx),                                   \
-       .irq_base       = GPIO_IRQ_BASE(idx),                           \
-       .number_of_pins = 32,                                           \
-       .pctl_name      = "pfc-r8a7778",                                \
-}
-
-R8A7778_GPIO(0);
-R8A7778_GPIO(1);
-R8A7778_GPIO(2);
-R8A7778_GPIO(3);
-R8A7778_GPIO(4);
-
-#define r8a7778_register_gpio(idx)                             \
-       platform_device_register_resndata(                      \
-               NULL, "gpio_rcar", idx,                         \
-               r8a7778_gpio##idx##_resources,                  \
-               ARRAY_SIZE(r8a7778_gpio##idx##_resources),      \
-               &r8a7778_gpio##idx##_platform_data,             \
-               sizeof(r8a7778_gpio##idx##_platform_data))
-
-void __init r8a7778_pinmux_init(void)
-{
-       platform_device_register_simple(
-               "pfc-r8a7778", -1,
-               pfc_resources,
-               ARRAY_SIZE(pfc_resources));
-
-       r8a7778_register_gpio(0);
-       r8a7778_register_gpio(1);
-       r8a7778_register_gpio(2);
-       r8a7778_register_gpio(3);
-       r8a7778_register_gpio(4);
-};
-
-/* I2C */
-static struct resource i2c_resources[] __initdata = {
-       /* I2C0 */
-       DEFINE_RES_MEM(0xffc70000, 0x1000),
-       DEFINE_RES_IRQ(gic_iid(0x63)),
-       /* I2C1 */
-       DEFINE_RES_MEM(0xffc71000, 0x1000),
-       DEFINE_RES_IRQ(gic_iid(0x6e)),
-       /* I2C2 */
-       DEFINE_RES_MEM(0xffc72000, 0x1000),
-       DEFINE_RES_IRQ(gic_iid(0x6c)),
-       /* I2C3 */
-       DEFINE_RES_MEM(0xffc73000, 0x1000),
-       DEFINE_RES_IRQ(gic_iid(0x6d)),
-};
-
-static void __init r8a7778_register_i2c(int id)
-{
-       BUG_ON(id < 0 || id > 3);
-
-       platform_device_register_simple(
-               "i2c-rcar", id,
-               i2c_resources + (2 * id), 2);
-}
-
-/* HSPI */
-static struct resource hspi_resources[] __initdata = {
-       /* HSPI0 */
-       DEFINE_RES_MEM(0xfffc7000, 0x18),
-       DEFINE_RES_IRQ(gic_iid(0x5f)),
-       /* HSPI1 */
-       DEFINE_RES_MEM(0xfffc8000, 0x18),
-       DEFINE_RES_IRQ(gic_iid(0x74)),
-       /* HSPI2 */
-       DEFINE_RES_MEM(0xfffc6000, 0x18),
-       DEFINE_RES_IRQ(gic_iid(0x75)),
-};
-
-static void __init r8a7778_register_hspi(int id)
-{
-       BUG_ON(id < 0 || id > 2);
-
-       platform_device_register_simple(
-               "sh-hspi", id,
-               hspi_resources + (2 * id), 2);
-}
-
-void __init r8a7778_add_dt_devices(void)
-{
-#ifdef CONFIG_CACHE_L2X0
-       void __iomem *base = ioremap_nocache(0xf0100000, 0x1000);
-       if (base) {
-               /*
-                * Shared attribute override enable, 64K*16way
-                * don't call iounmap(base)
-                */
-               l2x0_init(base, 0x00400000, 0xc20f0fff);
-       }
-#endif
-}
-
-/* HPB-DMA */
-
-/* Asynchronous mode register (ASYNCMDR) bits */
-#define HPB_DMAE_ASYNCMDR_ASMD22_MASK  BIT(2)  /* SDHI0 */
-#define HPB_DMAE_ASYNCMDR_ASMD22_SINGLE        BIT(2)  /* SDHI0 */
-#define HPB_DMAE_ASYNCMDR_ASMD22_MULTI 0       /* SDHI0 */
-#define HPB_DMAE_ASYNCMDR_ASMD21_MASK  BIT(1)  /* SDHI0 */
-#define HPB_DMAE_ASYNCMDR_ASMD21_SINGLE        BIT(1)  /* SDHI0 */
-#define HPB_DMAE_ASYNCMDR_ASMD21_MULTI 0       /* SDHI0 */
-
-#define HPBDMA_SSI(_id)                                \
-{                                              \
-       .id     = HPBDMA_SLAVE_SSI## _id ##_TX, \
-       .addr   = 0xffd91008 + (_id * 0x40),    \
-       .dcr    = HPB_DMAE_DCR_CT |             \
-                 HPB_DMAE_DCR_DIP |            \
-                 HPB_DMAE_DCR_SPDS_32BIT |     \
-                 HPB_DMAE_DCR_DMDL |           \
-                 HPB_DMAE_DCR_DPDS_32BIT,      \
-       .port   = _id + (_id << 8),             \
-       .dma_ch = (28 + _id),                   \
-}, {                                           \
-       .id     = HPBDMA_SLAVE_SSI## _id ##_RX, \
-       .addr   = 0xffd9100c + (_id * 0x40),    \
-       .dcr    = HPB_DMAE_DCR_CT |             \
-                 HPB_DMAE_DCR_DIP |            \
-                 HPB_DMAE_DCR_SMDL |           \
-                 HPB_DMAE_DCR_SPDS_32BIT |     \
-                 HPB_DMAE_DCR_DPDS_32BIT,      \
-       .port   = _id + (_id << 8),             \
-       .dma_ch = (28 + _id),                   \
-}
-
-#define HPBDMA_HPBIF(_id)                              \
-{                                                      \
-       .id     = HPBDMA_SLAVE_HPBIF## _id ##_TX,       \
-       .addr   = 0xffda0000 + (_id * 0x1000),          \
-       .dcr    = HPB_DMAE_DCR_CT |                     \
-                 HPB_DMAE_DCR_DIP |                    \
-                 HPB_DMAE_DCR_SPDS_32BIT |             \
-                 HPB_DMAE_DCR_DMDL |                   \
-                 HPB_DMAE_DCR_DPDS_32BIT,              \
-       .port   = 0x1111,                               \
-       .dma_ch = (28 + _id),                           \
-}, {                                                   \
-       .id     = HPBDMA_SLAVE_HPBIF## _id ##_RX,       \
-       .addr   = 0xffda0000 + (_id * 0x1000),          \
-       .dcr    = HPB_DMAE_DCR_CT |                     \
-                 HPB_DMAE_DCR_DIP |                    \
-                 HPB_DMAE_DCR_SMDL |                   \
-                 HPB_DMAE_DCR_SPDS_32BIT |             \
-                 HPB_DMAE_DCR_DPDS_32BIT,              \
-       .port   = 0x1111,                               \
-       .dma_ch = (28 + _id),                           \
-}
-
-static const struct hpb_dmae_slave_config hpb_dmae_slaves[] = {
-       {
-               .id     = HPBDMA_SLAVE_SDHI0_TX,
-               .addr   = 0xffe4c000 + 0x30,
-               .dcr    = HPB_DMAE_DCR_SPDS_16BIT |
-                         HPB_DMAE_DCR_DMDL |
-                         HPB_DMAE_DCR_DPDS_16BIT,
-               .rstr   = HPB_DMAE_ASYNCRSTR_ASRST21 |
-                         HPB_DMAE_ASYNCRSTR_ASRST22 |
-                         HPB_DMAE_ASYNCRSTR_ASRST23,
-               .mdr    = HPB_DMAE_ASYNCMDR_ASMD21_MULTI,
-               .mdm    = HPB_DMAE_ASYNCMDR_ASMD21_MASK,
-               .port   = 0x0D0C,
-               .flags  = HPB_DMAE_SET_ASYNC_RESET | HPB_DMAE_SET_ASYNC_MODE,
-               .dma_ch = 21,
-       }, {
-               .id     = HPBDMA_SLAVE_SDHI0_RX,
-               .addr   = 0xffe4c000 + 0x30,
-               .dcr    = HPB_DMAE_DCR_SMDL |
-                         HPB_DMAE_DCR_SPDS_16BIT |
-                         HPB_DMAE_DCR_DPDS_16BIT,
-               .rstr   = HPB_DMAE_ASYNCRSTR_ASRST21 |
-                         HPB_DMAE_ASYNCRSTR_ASRST22 |
-                         HPB_DMAE_ASYNCRSTR_ASRST23,
-               .mdr    = HPB_DMAE_ASYNCMDR_ASMD22_MULTI,
-               .mdm    = HPB_DMAE_ASYNCMDR_ASMD22_MASK,
-               .port   = 0x0D0C,
-               .flags  = HPB_DMAE_SET_ASYNC_RESET | HPB_DMAE_SET_ASYNC_MODE,
-               .dma_ch = 22,
-       }, {
-               .id     = HPBDMA_SLAVE_USBFUNC_TX, /* for D0 */
-               .addr   = 0xffe60018,
-               .dcr    = HPB_DMAE_DCR_SPDS_32BIT |
-                         HPB_DMAE_DCR_DMDL |
-                         HPB_DMAE_DCR_DPDS_32BIT,
-               .port   = 0x0000,
-               .dma_ch = 14,
-       }, {
-               .id     = HPBDMA_SLAVE_USBFUNC_RX, /* for D1 */
-               .addr   = 0xffe6001c,
-               .dcr    = HPB_DMAE_DCR_SMDL |
-                         HPB_DMAE_DCR_SPDS_32BIT |
-                         HPB_DMAE_DCR_DPDS_32BIT,
-               .port   = 0x0101,
-               .dma_ch = 15,
-       },
-
-       HPBDMA_SSI(0),
-       HPBDMA_SSI(1),
-       HPBDMA_SSI(2),
-       HPBDMA_SSI(3),
-       HPBDMA_SSI(4),
-       HPBDMA_SSI(5),
-       HPBDMA_SSI(6),
-       HPBDMA_SSI(7),
-       HPBDMA_SSI(8),
-
-       HPBDMA_HPBIF(0),
-       HPBDMA_HPBIF(1),
-       HPBDMA_HPBIF(2),
-       HPBDMA_HPBIF(3),
-       HPBDMA_HPBIF(4),
-       HPBDMA_HPBIF(5),
-       HPBDMA_HPBIF(6),
-       HPBDMA_HPBIF(7),
-       HPBDMA_HPBIF(8),
-};
-
-static const struct hpb_dmae_channel hpb_dmae_channels[] = {
-       HPB_DMAE_CHANNEL(0x7c, HPBDMA_SLAVE_USBFUNC_TX), /* ch. 14 */
-       HPB_DMAE_CHANNEL(0x7c, HPBDMA_SLAVE_USBFUNC_RX), /* ch. 15 */
-       HPB_DMAE_CHANNEL(0x7e, HPBDMA_SLAVE_SDHI0_TX), /* ch. 21 */
-       HPB_DMAE_CHANNEL(0x7e, HPBDMA_SLAVE_SDHI0_RX), /* ch. 22 */
-       HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_SSI0_TX),   /* ch. 28 */
-       HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_SSI0_RX),   /* ch. 28 */
-       HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_HPBIF0_TX), /* ch. 28 */
-       HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_HPBIF0_RX), /* ch. 28 */
-       HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_SSI1_TX),   /* ch. 29 */
-       HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_SSI1_RX),   /* ch. 29 */
-       HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_HPBIF1_TX), /* ch. 29 */
-       HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_HPBIF1_RX), /* ch. 29 */
-       HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_SSI2_TX),   /* ch. 30 */
-       HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_SSI2_RX),   /* ch. 30 */
-       HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_HPBIF2_TX), /* ch. 30 */
-       HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_HPBIF2_RX), /* ch. 30 */
-       HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_SSI3_TX),   /* ch. 31 */
-       HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_SSI3_RX),   /* ch. 31 */
-       HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_HPBIF3_TX), /* ch. 31 */
-       HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_HPBIF3_RX), /* ch. 31 */
-       HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_SSI4_TX),   /* ch. 32 */
-       HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_SSI4_RX),   /* ch. 32 */
-       HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_HPBIF4_TX), /* ch. 32 */
-       HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_HPBIF4_RX), /* ch. 32 */
-       HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_SSI5_TX),   /* ch. 33 */
-       HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_SSI5_RX),   /* ch. 33 */
-       HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_HPBIF5_TX), /* ch. 33 */
-       HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_HPBIF5_RX), /* ch. 33 */
-       HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_SSI6_TX),   /* ch. 34 */
-       HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_SSI6_RX),   /* ch. 34 */
-       HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_HPBIF6_TX), /* ch. 34 */
-       HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_HPBIF6_RX), /* ch. 34 */
-       HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_SSI7_TX),   /* ch. 35 */
-       HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_SSI7_RX),   /* ch. 35 */
-       HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_HPBIF7_TX), /* ch. 35 */
-       HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_HPBIF7_RX), /* ch. 35 */
-       HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_SSI8_TX),   /* ch. 36 */
-       HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_SSI8_RX),   /* ch. 36 */
-       HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_HPBIF8_TX), /* ch. 36 */
-       HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_HPBIF8_RX), /* ch. 36 */
-};
-
-static struct hpb_dmae_pdata dma_platform_data __initdata = {
-       .slaves                 = hpb_dmae_slaves,
-       .num_slaves             = ARRAY_SIZE(hpb_dmae_slaves),
-       .channels               = hpb_dmae_channels,
-       .num_channels           = ARRAY_SIZE(hpb_dmae_channels),
-       .ts_shift               = {
-               [XMIT_SZ_8BIT]  = 0,
-               [XMIT_SZ_16BIT] = 1,
-               [XMIT_SZ_32BIT] = 2,
-       },
-       .num_hw_channels        = 39,
-};
-
-static struct resource hpb_dmae_resources[] __initdata = {
-       /* Channel registers */
-       DEFINE_RES_MEM(0xffc08000, 0x1000),
-       /* Common registers */
-       DEFINE_RES_MEM(0xffc09000, 0x170),
-       /* Asynchronous reset registers */
-       DEFINE_RES_MEM(0xffc00300, 4),
-       /* Asynchronous mode registers */
-       DEFINE_RES_MEM(0xffc00400, 4),
-       /* IRQ for DMA channels */
-       DEFINE_RES_NAMED(gic_iid(0x7b), 5, NULL, IORESOURCE_IRQ),
-};
-
-static void __init r8a7778_register_hpb_dmae(void)
-{
-       platform_device_register_resndata(NULL, "hpb-dma-engine",
-                                         -1, hpb_dmae_resources,
-                                         ARRAY_SIZE(hpb_dmae_resources),
-                                         &dma_platform_data,
-                                         sizeof(dma_platform_data));
-}
-
-void __init r8a7778_add_standard_devices(void)
-{
-       r8a7778_add_dt_devices();
-       r8a7778_register_tmu(0);
-       r8a7778_register_scif(0);
-       r8a7778_register_scif(1);
-       r8a7778_register_scif(2);
-       r8a7778_register_scif(3);
-       r8a7778_register_scif(4);
-       r8a7778_register_scif(5);
-       r8a7778_register_i2c(0);
-       r8a7778_register_i2c(1);
-       r8a7778_register_i2c(2);
-       r8a7778_register_i2c(3);
-       r8a7778_register_hspi(0);
-       r8a7778_register_hspi(1);
-       r8a7778_register_hspi(2);
-
-       r8a7778_register_hpb_dmae();
-}
-
-void __init r8a7778_init_late(void)
-{
-       shmobile_init_late();
-       platform_device_register_full(&ehci_info);
-       platform_device_register_full(&ohci_info);
-}
-
-static struct renesas_intc_irqpin_config irqpin_platform_data __initdata = {
-       .irq_base = irq_pin(0), /* IRQ0 -> IRQ3 */
-       .sense_bitfield_width = 2,
-};
-
-static struct resource irqpin_resources[] __initdata = {
-       DEFINE_RES_MEM(0xfe78001c, 4), /* ICR1 */
-       DEFINE_RES_MEM(0xfe780010, 4), /* INTPRI */
-       DEFINE_RES_MEM(0xfe780024, 4), /* INTREQ */
-       DEFINE_RES_MEM(0xfe780044, 4), /* INTMSK0 */
-       DEFINE_RES_MEM(0xfe780064, 4), /* INTMSKCLR0 */
-       DEFINE_RES_IRQ(gic_iid(0x3b)), /* IRQ0 */
-       DEFINE_RES_IRQ(gic_iid(0x3c)), /* IRQ1 */
-       DEFINE_RES_IRQ(gic_iid(0x3d)), /* IRQ2 */
-       DEFINE_RES_IRQ(gic_iid(0x3e)), /* IRQ3 */
-};
-
-void __init r8a7778_init_irq_extpin_dt(int irlm)
-{
-       void __iomem *icr0 = ioremap_nocache(0xfe780000, PAGE_SIZE);
-       unsigned long tmp;
-
-       if (!icr0) {
-               pr_warn("r8a7778: unable to setup external irq pin mode\n");
-               return;
-       }
-
-       tmp = ioread32(icr0);
-       if (irlm)
-               tmp |= 1 << 23; /* IRQ0 -> IRQ3 as individual pins */
-       else
-               tmp &= ~(1 << 23); /* IRL mode - not supported */
-       tmp |= (1 << 21); /* LVLMODE = 1 */
-       iowrite32(tmp, icr0);
-       iounmap(icr0);
-}
-
-void __init r8a7778_init_irq_extpin(int irlm)
-{
-       r8a7778_init_irq_extpin_dt(irlm);
-       if (irlm)
-               platform_device_register_resndata(
-                       NULL, "renesas_intc_irqpin", -1,
-                       irqpin_resources, ARRAY_SIZE(irqpin_resources),
-                       &irqpin_platform_data, sizeof(irqpin_platform_data));
-}
-
-#ifdef CONFIG_USE_OF
 #define INT2SMSKCR0    0x82288 /* 0xfe782288 */
 #define INT2SMSKCR1    0x8228c /* 0xfe78228c */
 
 #define INT2NTSR0      0x00018 /* 0xfe700018 */
 #define INT2NTSR1      0x0002c /* 0xfe70002c */
-void __init r8a7778_init_irq_dt(void)
+
+static void __init r8a7778_init_irq_dt(void)
 {
        void __iomem *base = ioremap_nocache(0xfe700000, 0x00100000);
-#ifdef CONFIG_ARCH_SHMOBILE_LEGACY
-       void __iomem *gic_dist_base = ioremap_nocache(0xfe438000, 0x1000);
-       void __iomem *gic_cpu_base = ioremap_nocache(0xfe430000, 0x1000);
-#endif
 
        BUG_ON(!base);
 
-#ifdef CONFIG_ARCH_SHMOBILE_LEGACY
-       gic_init(0, 29, gic_dist_base, gic_cpu_base);
-#else
        irqchip_init();
-#endif
+
        /* route all interrupts to ARM */
        __raw_writel(0x73ffffff, base + INT2NTSR0);
        __raw_writel(0xffffffff, base + INT2NTSR1);
@@ -624,10 +71,6 @@ DT_MACHINE_START(R8A7778_DT, "Generic R8A7778 (Flattened Device Tree)")
        .init_early     = shmobile_init_delay,
        .init_irq       = r8a7778_init_irq_dt,
        .init_late      = shmobile_init_late,
-#ifdef CONFIG_COMMON_CLK
        .init_time      = r8a7778_timer_init,
-#endif
        .dt_compat      = r8a7778_compat_dt,
 MACHINE_END
-
-#endif /* CONFIG_USE_OF */
diff --git a/arch/arm/mach-shmobile/sh-gpio.h b/arch/arm/mach-shmobile/sh-gpio.h
deleted file mode 100644 (file)
index 2c41414..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Generic GPIO API and pinmux table support
- *
- * Copyright (c) 2008  Magnus Damm
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- */
-#ifndef __ASM_ARCH_GPIO_H
-#define __ASM_ARCH_GPIO_H
-
-#include <linux/kernel.h>
-#include <linux/errno.h>
-#include <linux/io.h>
-
-/*
- * FIXME !!
- *
- * current gpio frame work doesn't have
- * the method to control only pull up/down/free.
- * this function should be replaced by correct gpio function
- */
-static inline void __init gpio_direction_none(void __iomem * addr)
-{
-       __raw_writeb(0x00, addr);
-}
-
-#endif /* __ASM_ARCH_GPIO_H */
index f1d027aa7a81ac3361401380553771bdb37d47d2..c17d4d3881ffc45e5e169af4e91cf46744ac006d 100644 (file)
@@ -77,24 +77,3 @@ void __init shmobile_init_delay(void)
                        shmobile_setup_delay_hz(max_freq, 2, 4);
        }
 }
-
-static void __init shmobile_late_time_init(void)
-{
-       /*
-        * Make sure all compiled-in early timers register themselves.
-        *
-        * Run probe() for two "earlytimer" devices, these will be the
-        * clockevents and clocksource devices respectively. In the event
-        * that only a clockevents device is available, we -ENODEV on the
-        * clocksource and the jiffies clocksource is used transparently
-        * instead. No error handling is necessary here.
-        */
-       early_platform_driver_register_all("earlytimer");
-       early_platform_driver_probe("earlytimer", 2, 0);
-}
-
-void __init shmobile_earlytimer_init(void)
-{
-       late_time_init = shmobile_late_time_init;
-}
-
index d97749c642ce67b8bf721dc61461b5106594a3f3..12edd1cf8a12f11a2a07851f59bc5747e925cd36 100644 (file)
@@ -80,7 +80,7 @@ static inline void spear13xx_do_lowpower(unsigned int cpu, int *spurious)
  *
  * Called with IRQs disabled
  */
-void __ref spear13xx_cpu_die(unsigned int cpu)
+void spear13xx_cpu_die(unsigned int cpu)
 {
        int spurious = 0;
 
index 223c9e99380d89fa7658a46ba67534d9c3c47776..c2be98f38e73b2006ea664b7089dc427a2575d8e 100644 (file)
@@ -26,10 +26,11 @@ static const char * const sunxi_board_dt_compat[] = {
        "allwinner,sun4i-a10",
        "allwinner,sun5i-a10s",
        "allwinner,sun5i-a13",
+       "allwinner,sun5i-r8",
        NULL,
 };
 
-DT_MACHINE_START(SUNXI_DT, "Allwinner A1X (Device Tree)")
+DT_MACHINE_START(SUNXI_DT, "Allwinner sun4i/sun5i Families")
        .dt_compat      = sunxi_board_dt_compat,
        .init_late      = sunxi_dt_cpufreq_init,
 MACHINE_END
index fbe74c6806f3b53e726d96fe2c2f396ad81c9c5f..49d1110cff5341954e3d980d003fda4f516138f0 100644 (file)
@@ -39,8 +39,8 @@ static struct platform_device wifi_rfkill_device = {
 static struct gpiod_lookup_table wifi_gpio_lookup = {
        .dev_id = "rfkill_gpio",
        .table = {
-               GPIO_LOOKUP_IDX("tegra-gpio", 25, NULL, 0, 0),
-               GPIO_LOOKUP_IDX("tegra-gpio", 85, NULL, 1, 0),
+               GPIO_LOOKUP("tegra-gpio", 25, "reset", 0),
+               GPIO_LOOKUP("tegra-gpio", 85, "shutdown", 0),
                { },
        },
 };
index 6fc71f1534b069f9f8d28e0283e6a37812c3802d..1b129899a277f1853b6309782caac72f1f4a45d3 100644 (file)
@@ -37,7 +37,7 @@ int tegra_cpu_kill(unsigned cpu)
  *
  * Called with IRQs disabled
  */
-void __ref tegra_cpu_die(unsigned int cpu)
+void tegra_cpu_die(unsigned int cpu)
 {
        if (!tegra_hotplug_shutdown) {
                WARN(1, "hotplug is not yet initialized\n");
index 60bd2265f753e270295870693e58d4b476635b21..1233f9b610bc14a1bcae99d1f99c1ab46ad387d0 100644 (file)
@@ -1,2 +1,2 @@
 obj-y                  := uniphier.o
-obj-$(CONFIG_SMP)      += platsmp.o
+obj-$(CONFIG_SMP)      += platsmp.o headsmp.o
diff --git a/arch/arm/mach-uniphier/headsmp.S b/arch/arm/mach-uniphier/headsmp.S
new file mode 100644 (file)
index 0000000..c819dff
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2015 Masahiro Yamada <yamada.masahiro@socionext.com>
+ *
+ * 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; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include <linux/linkage.h>
+#include <asm/assembler.h>
+#include <asm/cp15.h>
+
+ENTRY(uniphier_smp_trampoline)
+ARM_BE8(setend be)                     @ ensure we are in BE8 mode
+       mrc     p15, 0, r0, c0, c0, 5   @ MPIDR (Multiprocessor Affinity Reg)
+       and     r2, r0, #0x3            @ CPU ID
+       ldr     r1, uniphier_smp_trampoline_jump
+       ldr     r3, uniphier_smp_trampoline_poll_addr
+       mrc     p15, 0, r0, c1, c0, 0   @ SCTLR (System Control Register)
+       orr     r0, r0, #CR_I           @ Enable ICache
+       bic     r0, r0, #(CR_C | CR_M)  @ Disable MMU and Dcache
+       mcr     p15, 0, r0, c1, c0, 0
+       b       1f                      @ cache the following 5 instructions
+0:     wfe
+1:     ldr     r0, [r3]
+       cmp     r0, r2
+       bxeq    r1                      @ branch to secondary_startup
+       b       0b
+       .globl  uniphier_smp_trampoline_jump
+uniphier_smp_trampoline_jump:
+       .word   0                       @ set virt_to_phys(secondary_startup)
+       .globl  uniphier_smp_trampoline_poll_addr
+uniphier_smp_trampoline_poll_addr:
+       .word   0                       @ set CPU ID to be kicked to this reg
+       .globl  uniphier_smp_trampoline_end
+uniphier_smp_trampoline_end:
+ENDPROC(uniphier_smp_trampoline)
index 4b784f7211350f6971d21b2031890a4a76057624..f0577664611c9a6456c8d371ff80955e2d19e011 100644 (file)
  * GNU General Public License for more details.
  */
 
-#include <linux/sizes.h>
-#include <linux/compiler.h>
+#define pr_fmt(fmt)            "uniphier: " fmt
+
 #include <linux/init.h>
 #include <linux/io.h>
-#include <linux/regmap.h>
-#include <linux/mfd/syscon.h>
+#include <linux/ioport.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/sizes.h>
+#include <asm/cacheflush.h>
+#include <asm/hardware/cache-uniphier.h>
+#include <asm/pgtable.h>
 #include <asm/smp.h>
 #include <asm/smp_scu.h>
 
-static struct regmap *sbcm_regmap;
+/*
+ * The secondary CPUs check this register from the boot ROM for the jump
+ * destination.  After that, it can be reused as a scratch register.
+ */
+#define UNIPHIER_SBC_ROM_BOOT_RSV2     0x1208
 
-static void __init uniphier_smp_prepare_cpus(unsigned int max_cpus)
+static void __iomem *uniphier_smp_rom_boot_rsv2;
+static unsigned int uniphier_smp_max_cpus;
+
+extern char uniphier_smp_trampoline;
+extern char uniphier_smp_trampoline_jump;
+extern char uniphier_smp_trampoline_poll_addr;
+extern char uniphier_smp_trampoline_end;
+
+/*
+ * Copy trampoline code to the tail of the 1st section of the page table used
+ * in the boot ROM.  This area is directly accessible by the secondary CPUs
+ * for all the UniPhier SoCs.
+ */
+static const phys_addr_t uniphier_smp_trampoline_dest_end = SECTION_SIZE;
+static phys_addr_t uniphier_smp_trampoline_dest;
+
+static int __init uniphier_smp_copy_trampoline(phys_addr_t poll_addr)
 {
-       static cpumask_t only_cpu_0 = { CPU_BITS_CPU0 };
-       unsigned long scu_base_phys = 0;
-       void __iomem *scu_base;
+       size_t trmp_size;
+       static void __iomem *trmp_base;
 
-       sbcm_regmap = syscon_regmap_lookup_by_compatible(
-                       "socionext,uniphier-system-bus-controller-misc");
-       if (IS_ERR(sbcm_regmap)) {
-               pr_err("failed to regmap system-bus-controller-misc\n");
-               goto err;
+       if (!uniphier_cache_l2_is_enabled()) {
+               pr_warn("outer cache is needed for SMP, but not enabled\n");
+               return -ENODEV;
        }
 
+       uniphier_cache_l2_set_locked_ways(1);
+
+       outer_flush_all();
+
+       trmp_size = &uniphier_smp_trampoline_end - &uniphier_smp_trampoline;
+       uniphier_smp_trampoline_dest = uniphier_smp_trampoline_dest_end -
+                                                               trmp_size;
+
+       uniphier_cache_l2_touch_range(uniphier_smp_trampoline_dest,
+                                     uniphier_smp_trampoline_dest_end);
+
+       trmp_base = ioremap_cache(uniphier_smp_trampoline_dest, trmp_size);
+       if (!trmp_base) {
+               pr_err("failed to map trampoline destination area\n");
+               return -ENOMEM;
+       }
+
+       memcpy(trmp_base, &uniphier_smp_trampoline, trmp_size);
+
+       writel(virt_to_phys(secondary_startup),
+              trmp_base + (&uniphier_smp_trampoline_jump -
+                           &uniphier_smp_trampoline));
+
+       writel(poll_addr, trmp_base + (&uniphier_smp_trampoline_poll_addr -
+                                      &uniphier_smp_trampoline));
+
+       flush_cache_all();      /* flush out trampoline code to outer cache */
+
+       iounmap(trmp_base);
+
+       return 0;
+}
+
+static int __init uniphier_smp_prepare_trampoline(unsigned int max_cpus)
+{
+       struct device_node *np;
+       struct resource res;
+       phys_addr_t rom_rsv2_phys;
+       int ret;
+
+       np = of_find_compatible_node(NULL, NULL,
+                               "socionext,uniphier-system-bus-controller");
+       ret = of_address_to_resource(np, 1, &res);
+       if (ret) {
+               pr_err("failed to get resource of system-bus-controller\n");
+               return ret;
+       }
+
+       rom_rsv2_phys = res.start + UNIPHIER_SBC_ROM_BOOT_RSV2;
+
+       ret = uniphier_smp_copy_trampoline(rom_rsv2_phys);
+       if (ret)
+               return ret;
+
+       uniphier_smp_rom_boot_rsv2 = ioremap(rom_rsv2_phys, sizeof(SZ_4));
+       if (!uniphier_smp_rom_boot_rsv2) {
+               pr_err("failed to map ROM_BOOT_RSV2 register\n");
+               return -ENOMEM;
+       }
+
+       writel(uniphier_smp_trampoline_dest, uniphier_smp_rom_boot_rsv2);
+       asm("sev"); /* Bring up all secondary CPUs to the trampoline code */
+
+       uniphier_smp_max_cpus = max_cpus;       /* save for later use */
+
+       return 0;
+}
+
+static void __init uniphier_smp_unprepare_trampoline(void)
+{
+       iounmap(uniphier_smp_rom_boot_rsv2);
+
+       if (uniphier_smp_trampoline_dest)
+               outer_inv_range(uniphier_smp_trampoline_dest,
+                               uniphier_smp_trampoline_dest_end);
+
+       uniphier_cache_l2_set_locked_ways(0);
+}
+
+static int __init uniphier_smp_enable_scu(void)
+{
+       unsigned long scu_base_phys = 0;
+       void __iomem *scu_base;
+
        if (scu_a9_has_base())
                scu_base_phys = scu_a9_get_base();
 
        if (!scu_base_phys) {
                pr_err("failed to get scu base\n");
-               goto err;
+               return -ENODEV;
        }
 
        scu_base = ioremap(scu_base_phys, SZ_128);
        if (!scu_base) {
-               pr_err("failed to remap scu base (0x%08lx)\n", scu_base_phys);
-               goto err;
+               pr_err("failed to map scu base\n");
+               return -ENOMEM;
        }
 
        scu_enable(scu_base);
        iounmap(scu_base);
 
+       return 0;
+}
+
+static void __init uniphier_smp_prepare_cpus(unsigned int max_cpus)
+{
+       static cpumask_t only_cpu_0 = { CPU_BITS_CPU0 };
+       int ret;
+
+       ret = uniphier_smp_prepare_trampoline(max_cpus);
+       if (ret)
+               goto err;
+
+       ret = uniphier_smp_enable_scu();
+       if (ret)
+               goto err;
+
        return;
 err:
        pr_warn("disabling SMP\n");
        init_cpu_present(&only_cpu_0);
-       sbcm_regmap = NULL;
+       uniphier_smp_unprepare_trampoline();
 }
 
-static int uniphier_boot_secondary(unsigned int cpu,
-                                  struct task_struct *idle)
+static int __init uniphier_smp_boot_secondary(unsigned int cpu,
+                                             struct task_struct *idle)
 {
-       int ret;
+       if (WARN_ON_ONCE(!uniphier_smp_rom_boot_rsv2))
+               return -EFAULT;
 
-       if (!sbcm_regmap)
-               return -ENODEV;
+       writel(cpu, uniphier_smp_rom_boot_rsv2);
+       readl(uniphier_smp_rom_boot_rsv2); /* relax */
 
-       ret = regmap_write(sbcm_regmap, 0x1208,
-                          virt_to_phys(secondary_startup));
-       if (!ret)
-               asm("sev"); /* wake up secondary CPU */
+       asm("sev"); /* wake up secondary CPUs sleeping in the trampoline */
+
+       if (cpu == uniphier_smp_max_cpus - 1) {
+               /* clean up resources if this is the last CPU */
+               uniphier_smp_unprepare_trampoline();
+       }
 
-       return ret;
+       return 0;
 }
 
-struct smp_operations uniphier_smp_ops __initdata = {
+static struct smp_operations uniphier_smp_ops __initdata = {
        .smp_prepare_cpus       = uniphier_smp_prepare_cpus,
-       .smp_boot_secondary     = uniphier_boot_secondary,
+       .smp_boot_secondary     = uniphier_smp_boot_secondary,
 };
 CPU_METHOD_OF_DECLARE(uniphier_smp, "socionext,uniphier-smp",
                      &uniphier_smp_ops);
index 2bc00b085e38d4b1540a25563058735cd67a1af4..1cbed0331fd3267be988866016dc025dd4068052 100644 (file)
@@ -21,7 +21,7 @@
  *
  * Called with IRQs disabled
  */
-void __ref ux500_cpu_die(unsigned int cpu)
+void ux500_cpu_die(unsigned int cpu)
 {
        /* directly enter low power state, skipping secure registers */
        for (;;) {
index f0ce6b8f5e71ba19900dee86e56274a526835bf2..f2fafc10a91d67f0e5f5d2a8c652406da554f361 100644 (file)
@@ -85,7 +85,7 @@ static inline void platform_do_lowpower(unsigned int cpu, int *spurious)
  *
  * Called with IRQs disabled
  */
-void __ref vexpress_cpu_die(unsigned int cpu)
+void vexpress_cpu_die(unsigned int cpu)
 {
        int spurious = 0;
 
index c21941349b3ef761680d4b2c9b58ee7cf4008f96..41218867a9a604286b83a14bc83fa7908f115dcc 100644 (file)
@@ -974,6 +974,16 @@ config CACHE_TAUROS2
          This option enables the Tauros2 L2 cache controller (as
          found on PJ1/PJ4).
 
+config CACHE_UNIPHIER
+       bool "Enable the UniPhier outer cache controller"
+       depends on ARCH_UNIPHIER
+       default y
+       select OUTER_CACHE
+       select OUTER_CACHE_SYNC
+       help
+         This option enables the UniPhier outer cache (system cache)
+         controller.
+
 config CACHE_XSC3L2
        bool "Enable the L2 cache on XScale3"
        depends on CPU_XSC3
index 57c8df500e8cbc9bc988e4ddd88391ace0eca2c3..7f76d96ce546476113f9a4e61625d9740929cedf 100644 (file)
@@ -103,3 +103,4 @@ obj-$(CONFIG_CACHE_FEROCEON_L2)     += cache-feroceon-l2.o
 obj-$(CONFIG_CACHE_L2X0)       += cache-l2x0.o l2c-l2x0-resume.o
 obj-$(CONFIG_CACHE_XSC3L2)     += cache-xsc3l2.o
 obj-$(CONFIG_CACHE_TAUROS2)    += cache-tauros2.o
+obj-$(CONFIG_CACHE_UNIPHIER)   += cache-uniphier.o
diff --git a/arch/arm/mm/cache-uniphier.c b/arch/arm/mm/cache-uniphier.c
new file mode 100644 (file)
index 0000000..0502ba1
--- /dev/null
@@ -0,0 +1,555 @@
+/*
+ * Copyright (C) 2015 Masahiro Yamada <yamada.masahiro@socionext.com>
+ *
+ * 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; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#define pr_fmt(fmt)            "uniphier: " fmt
+
+#include <linux/init.h>
+#include <linux/io.h>
+#include <linux/log2.h>
+#include <linux/of_address.h>
+#include <linux/slab.h>
+#include <asm/hardware/cache-uniphier.h>
+#include <asm/outercache.h>
+
+/* control registers */
+#define UNIPHIER_SSCC          0x0     /* Control Register */
+#define    UNIPHIER_SSCC_BST                   BIT(20) /* UCWG burst read */
+#define    UNIPHIER_SSCC_ACT                   BIT(19) /* Inst-Data separate */
+#define    UNIPHIER_SSCC_WTG                   BIT(18) /* WT gathering on */
+#define    UNIPHIER_SSCC_PRD                   BIT(17) /* enable pre-fetch */
+#define    UNIPHIER_SSCC_ON                    BIT(0)  /* enable cache */
+#define UNIPHIER_SSCLPDAWCR    0x30    /* Unified/Data Active Way Control */
+#define UNIPHIER_SSCLPIAWCR    0x34    /* Instruction Active Way Control */
+
+/* revision registers */
+#define UNIPHIER_SSCID         0x0     /* ID Register */
+
+/* operation registers */
+#define UNIPHIER_SSCOPE                0x244   /* Cache Operation Primitive Entry */
+#define    UNIPHIER_SSCOPE_CM_INV              0x0     /* invalidate */
+#define    UNIPHIER_SSCOPE_CM_CLEAN            0x1     /* clean */
+#define    UNIPHIER_SSCOPE_CM_FLUSH            0x2     /* flush */
+#define    UNIPHIER_SSCOPE_CM_SYNC             0x8     /* sync (drain bufs) */
+#define    UNIPHIER_SSCOPE_CM_FLUSH_PREFETCH   0x9     /* flush p-fetch buf */
+#define UNIPHIER_SSCOQM                0x248   /* Cache Operation Queue Mode */
+#define    UNIPHIER_SSCOQM_TID_MASK            (0x3 << 21)
+#define    UNIPHIER_SSCOQM_TID_LRU_DATA                (0x0 << 21)
+#define    UNIPHIER_SSCOQM_TID_LRU_INST                (0x1 << 21)
+#define    UNIPHIER_SSCOQM_TID_WAY             (0x2 << 21)
+#define    UNIPHIER_SSCOQM_S_MASK              (0x3 << 17)
+#define    UNIPHIER_SSCOQM_S_RANGE             (0x0 << 17)
+#define    UNIPHIER_SSCOQM_S_ALL               (0x1 << 17)
+#define    UNIPHIER_SSCOQM_S_WAY               (0x2 << 17)
+#define    UNIPHIER_SSCOQM_CE                  BIT(15) /* notify completion */
+#define    UNIPHIER_SSCOQM_CM_INV              0x0     /* invalidate */
+#define    UNIPHIER_SSCOQM_CM_CLEAN            0x1     /* clean */
+#define    UNIPHIER_SSCOQM_CM_FLUSH            0x2     /* flush */
+#define    UNIPHIER_SSCOQM_CM_PREFETCH         0x3     /* prefetch to cache */
+#define    UNIPHIER_SSCOQM_CM_PREFETCH_BUF     0x4     /* prefetch to pf-buf */
+#define    UNIPHIER_SSCOQM_CM_TOUCH            0x5     /* touch */
+#define    UNIPHIER_SSCOQM_CM_TOUCH_ZERO       0x6     /* touch to zero */
+#define    UNIPHIER_SSCOQM_CM_TOUCH_DIRTY      0x7     /* touch with dirty */
+#define UNIPHIER_SSCOQAD       0x24c   /* Cache Operation Queue Address */
+#define UNIPHIER_SSCOQSZ       0x250   /* Cache Operation Queue Size */
+#define UNIPHIER_SSCOQMASK     0x254   /* Cache Operation Queue Address Mask */
+#define UNIPHIER_SSCOQWN       0x258   /* Cache Operation Queue Way Number */
+#define UNIPHIER_SSCOPPQSEF    0x25c   /* Cache Operation Queue Set Complete*/
+#define    UNIPHIER_SSCOPPQSEF_FE              BIT(1)
+#define    UNIPHIER_SSCOPPQSEF_OE              BIT(0)
+#define UNIPHIER_SSCOLPQS      0x260   /* Cache Operation Queue Status */
+#define    UNIPHIER_SSCOLPQS_EF                        BIT(2)
+#define    UNIPHIER_SSCOLPQS_EST               BIT(1)
+#define    UNIPHIER_SSCOLPQS_QST               BIT(0)
+
+/* Is the touch/pre-fetch destination specified by ways? */
+#define UNIPHIER_SSCOQM_TID_IS_WAY(op) \
+               ((op & UNIPHIER_SSCOQM_TID_MASK) == UNIPHIER_SSCOQM_TID_WAY)
+/* Is the operation region specified by address range? */
+#define UNIPHIER_SSCOQM_S_IS_RANGE(op) \
+               ((op & UNIPHIER_SSCOQM_S_MASK) == UNIPHIER_SSCOQM_S_RANGE)
+
+/**
+ * uniphier_cache_data - UniPhier outer cache specific data
+ *
+ * @ctrl_base: virtual base address of control registers
+ * @rev_base: virtual base address of revision registers
+ * @op_base: virtual base address of operation registers
+ * @way_present_mask: each bit specifies if the way is present
+ * @way_locked_mask: each bit specifies if the way is locked
+ * @nsets: number of associativity sets
+ * @line_size: line size in bytes
+ * @range_op_max_size: max size that can be handled by a single range operation
+ * @list: list node to include this level in the whole cache hierarchy
+ */
+struct uniphier_cache_data {
+       void __iomem *ctrl_base;
+       void __iomem *rev_base;
+       void __iomem *op_base;
+       u32 way_present_mask;
+       u32 way_locked_mask;
+       u32 nsets;
+       u32 line_size;
+       u32 range_op_max_size;
+       struct list_head list;
+};
+
+/*
+ * List of the whole outer cache hierarchy.  This list is only modified during
+ * the early boot stage, so no mutex is taken for the access to the list.
+ */
+static LIST_HEAD(uniphier_cache_list);
+
+/**
+ * __uniphier_cache_sync - perform a sync point for a particular cache level
+ *
+ * @data: cache controller specific data
+ */
+static void __uniphier_cache_sync(struct uniphier_cache_data *data)
+{
+       /* This sequence need not be atomic.  Do not disable IRQ. */
+       writel_relaxed(UNIPHIER_SSCOPE_CM_SYNC,
+                      data->op_base + UNIPHIER_SSCOPE);
+       /* need a read back to confirm */
+       readl_relaxed(data->op_base + UNIPHIER_SSCOPE);
+}
+
+/**
+ * __uniphier_cache_maint_common - run a queue operation for a particular level
+ *
+ * @data: cache controller specific data
+ * @start: start address of range operation (don't care for "all" operation)
+ * @size: data size of range operation (don't care for "all" operation)
+ * @operation: flags to specify the desired cache operation
+ */
+static void __uniphier_cache_maint_common(struct uniphier_cache_data *data,
+                                         unsigned long start,
+                                         unsigned long size,
+                                         u32 operation)
+{
+       unsigned long flags;
+
+       /*
+        * No spin lock is necessary here because:
+        *
+        * [1] This outer cache controller is able to accept maintenance
+        * operations from multiple CPUs at a time in an SMP system; if a
+        * maintenance operation is under way and another operation is issued,
+        * the new one is stored in the queue.  The controller performs one
+        * operation after another.  If the queue is full, the status register,
+        * UNIPHIER_SSCOPPQSEF, indicates that the queue registration has
+        * failed.  The status registers, UNIPHIER_{SSCOPPQSEF, SSCOLPQS}, have
+        * different instances for each CPU, i.e. each CPU can track the status
+        * of the maintenance operations triggered by itself.
+        *
+        * [2] The cache command registers, UNIPHIER_{SSCOQM, SSCOQAD, SSCOQSZ,
+        * SSCOQWN}, are shared between multiple CPUs, but the hardware still
+        * guarantees the registration sequence is atomic; the write access to
+        * them are arbitrated by the hardware.  The first accessor to the
+        * register, UNIPHIER_SSCOQM, holds the access right and it is released
+        * by reading the status register, UNIPHIER_SSCOPPQSEF.  While one CPU
+        * is holding the access right, other CPUs fail to register operations.
+        * One CPU should not hold the access right for a long time, so local
+        * IRQs should be disabled while the following sequence.
+        */
+       local_irq_save(flags);
+
+       /* clear the complete notification flag */
+       writel_relaxed(UNIPHIER_SSCOLPQS_EF, data->op_base + UNIPHIER_SSCOLPQS);
+
+       do {
+               /* set cache operation */
+               writel_relaxed(UNIPHIER_SSCOQM_CE | operation,
+                              data->op_base + UNIPHIER_SSCOQM);
+
+               /* set address range if needed */
+               if (likely(UNIPHIER_SSCOQM_S_IS_RANGE(operation))) {
+                       writel_relaxed(start, data->op_base + UNIPHIER_SSCOQAD);
+                       writel_relaxed(size, data->op_base + UNIPHIER_SSCOQSZ);
+               }
+
+               /* set target ways if needed */
+               if (unlikely(UNIPHIER_SSCOQM_TID_IS_WAY(operation)))
+                       writel_relaxed(data->way_locked_mask,
+                                      data->op_base + UNIPHIER_SSCOQWN);
+       } while (unlikely(readl_relaxed(data->op_base + UNIPHIER_SSCOPPQSEF) &
+                         (UNIPHIER_SSCOPPQSEF_FE | UNIPHIER_SSCOPPQSEF_OE)));
+
+       /* wait until the operation is completed */
+       while (likely(readl_relaxed(data->op_base + UNIPHIER_SSCOLPQS) !=
+                     UNIPHIER_SSCOLPQS_EF))
+               cpu_relax();
+
+       local_irq_restore(flags);
+}
+
+static void __uniphier_cache_maint_all(struct uniphier_cache_data *data,
+                                      u32 operation)
+{
+       __uniphier_cache_maint_common(data, 0, 0,
+                                     UNIPHIER_SSCOQM_S_ALL | operation);
+
+       __uniphier_cache_sync(data);
+}
+
+static void __uniphier_cache_maint_range(struct uniphier_cache_data *data,
+                                        unsigned long start, unsigned long end,
+                                        u32 operation)
+{
+       unsigned long size;
+
+       /*
+        * If the start address is not aligned,
+        * perform a cache operation for the first cache-line
+        */
+       start = start & ~(data->line_size - 1);
+
+       size = end - start;
+
+       if (unlikely(size >= (unsigned long)(-data->line_size))) {
+               /* this means cache operation for all range */
+               __uniphier_cache_maint_all(data, operation);
+               return;
+       }
+
+       /*
+        * If the end address is not aligned,
+        * perform a cache operation for the last cache-line
+        */
+       size = ALIGN(size, data->line_size);
+
+       while (size) {
+               unsigned long chunk_size = min_t(unsigned long, size,
+                                                data->range_op_max_size);
+
+               __uniphier_cache_maint_common(data, start, chunk_size,
+                                       UNIPHIER_SSCOQM_S_RANGE | operation);
+
+               start += chunk_size;
+               size -= chunk_size;
+       }
+
+       __uniphier_cache_sync(data);
+}
+
+static void __uniphier_cache_enable(struct uniphier_cache_data *data, bool on)
+{
+       u32 val = 0;
+
+       if (on)
+               val = UNIPHIER_SSCC_WTG | UNIPHIER_SSCC_PRD | UNIPHIER_SSCC_ON;
+
+       writel_relaxed(val, data->ctrl_base + UNIPHIER_SSCC);
+}
+
+static void __init __uniphier_cache_set_locked_ways(
+                                       struct uniphier_cache_data *data,
+                                       u32 way_mask)
+{
+       data->way_locked_mask = way_mask & data->way_present_mask;
+
+       writel_relaxed(~data->way_locked_mask & data->way_present_mask,
+                      data->ctrl_base + UNIPHIER_SSCLPDAWCR);
+}
+
+static void uniphier_cache_maint_range(unsigned long start, unsigned long end,
+                                      u32 operation)
+{
+       struct uniphier_cache_data *data;
+
+       list_for_each_entry(data, &uniphier_cache_list, list)
+               __uniphier_cache_maint_range(data, start, end, operation);
+}
+
+static void uniphier_cache_maint_all(u32 operation)
+{
+       struct uniphier_cache_data *data;
+
+       list_for_each_entry(data, &uniphier_cache_list, list)
+               __uniphier_cache_maint_all(data, operation);
+}
+
+static void uniphier_cache_inv_range(unsigned long start, unsigned long end)
+{
+       uniphier_cache_maint_range(start, end, UNIPHIER_SSCOQM_CM_INV);
+}
+
+static void uniphier_cache_clean_range(unsigned long start, unsigned long end)
+{
+       uniphier_cache_maint_range(start, end, UNIPHIER_SSCOQM_CM_CLEAN);
+}
+
+static void uniphier_cache_flush_range(unsigned long start, unsigned long end)
+{
+       uniphier_cache_maint_range(start, end, UNIPHIER_SSCOQM_CM_FLUSH);
+}
+
+static void __init uniphier_cache_inv_all(void)
+{
+       uniphier_cache_maint_all(UNIPHIER_SSCOQM_CM_INV);
+}
+
+static void uniphier_cache_flush_all(void)
+{
+       uniphier_cache_maint_all(UNIPHIER_SSCOQM_CM_FLUSH);
+}
+
+static void uniphier_cache_disable(void)
+{
+       struct uniphier_cache_data *data;
+
+       list_for_each_entry_reverse(data, &uniphier_cache_list, list)
+               __uniphier_cache_enable(data, false);
+
+       uniphier_cache_flush_all();
+}
+
+static void __init uniphier_cache_enable(void)
+{
+       struct uniphier_cache_data *data;
+
+       uniphier_cache_inv_all();
+
+       list_for_each_entry(data, &uniphier_cache_list, list) {
+               __uniphier_cache_enable(data, true);
+               __uniphier_cache_set_locked_ways(data, 0);
+       }
+}
+
+static void uniphier_cache_sync(void)
+{
+       struct uniphier_cache_data *data;
+
+       list_for_each_entry(data, &uniphier_cache_list, list)
+               __uniphier_cache_sync(data);
+}
+
+int __init uniphier_cache_l2_is_enabled(void)
+{
+       struct uniphier_cache_data *data;
+
+       data = list_first_entry_or_null(&uniphier_cache_list,
+                                       struct uniphier_cache_data, list);
+       if (!data)
+               return 0;
+
+       return !!(readl_relaxed(data->ctrl_base + UNIPHIER_SSCC) &
+                 UNIPHIER_SSCC_ON);
+}
+
+void __init uniphier_cache_l2_touch_range(unsigned long start,
+                                         unsigned long end)
+{
+       struct uniphier_cache_data *data;
+
+       data = list_first_entry_or_null(&uniphier_cache_list,
+                                       struct uniphier_cache_data, list);
+       if (data)
+               __uniphier_cache_maint_range(data, start, end,
+                                            UNIPHIER_SSCOQM_TID_WAY |
+                                            UNIPHIER_SSCOQM_CM_TOUCH);
+}
+
+void __init uniphier_cache_l2_set_locked_ways(u32 way_mask)
+{
+       struct uniphier_cache_data *data;
+
+       data = list_first_entry_or_null(&uniphier_cache_list,
+                                       struct uniphier_cache_data, list);
+       if (data)
+               __uniphier_cache_set_locked_ways(data, way_mask);
+}
+
+static const struct of_device_id uniphier_cache_match[] __initconst = {
+       {
+               .compatible = "socionext,uniphier-system-cache",
+       },
+       { /* sentinel */ }
+};
+
+static struct device_node * __init uniphier_cache_get_next_level_node(
+                                                       struct device_node *np)
+{
+       u32 phandle;
+
+       if (of_property_read_u32(np, "next-level-cache", &phandle))
+               return NULL;
+
+       return of_find_node_by_phandle(phandle);
+}
+
+static int __init __uniphier_cache_init(struct device_node *np,
+                                       unsigned int *cache_level)
+{
+       struct uniphier_cache_data *data;
+       u32 level, cache_size;
+       struct device_node *next_np;
+       int ret = 0;
+
+       if (!of_match_node(uniphier_cache_match, np)) {
+               pr_err("L%d: not compatible with uniphier cache\n",
+                      *cache_level);
+               return -EINVAL;
+       }
+
+       if (of_property_read_u32(np, "cache-level", &level)) {
+               pr_err("L%d: cache-level is not specified\n", *cache_level);
+               return -EINVAL;
+       }
+
+       if (level != *cache_level) {
+               pr_err("L%d: cache-level is unexpected value %d\n",
+                      *cache_level, level);
+               return -EINVAL;
+       }
+
+       if (!of_property_read_bool(np, "cache-unified")) {
+               pr_err("L%d: cache-unified is not specified\n", *cache_level);
+               return -EINVAL;
+       }
+
+       data = kzalloc(sizeof(*data), GFP_KERNEL);
+       if (!data)
+               return -ENOMEM;
+
+       if (of_property_read_u32(np, "cache-line-size", &data->line_size) ||
+           !is_power_of_2(data->line_size)) {
+               pr_err("L%d: cache-line-size is unspecified or invalid\n",
+                      *cache_level);
+               ret = -EINVAL;
+               goto err;
+       }
+
+       if (of_property_read_u32(np, "cache-sets", &data->nsets) ||
+           !is_power_of_2(data->nsets)) {
+               pr_err("L%d: cache-sets is unspecified or invalid\n",
+                      *cache_level);
+               ret = -EINVAL;
+               goto err;
+       }
+
+       if (of_property_read_u32(np, "cache-size", &cache_size) ||
+           cache_size == 0 || cache_size % (data->nsets * data->line_size)) {
+               pr_err("L%d: cache-size is unspecified or invalid\n",
+                      *cache_level);
+               ret = -EINVAL;
+               goto err;
+       }
+
+       data->way_present_mask =
+               ((u32)1 << cache_size / data->nsets / data->line_size) - 1;
+
+       data->ctrl_base = of_iomap(np, 0);
+       if (!data->ctrl_base) {
+               pr_err("L%d: failed to map control register\n", *cache_level);
+               ret = -ENOMEM;
+               goto err;
+       }
+
+       data->rev_base = of_iomap(np, 1);
+       if (!data->rev_base) {
+               pr_err("L%d: failed to map revision register\n", *cache_level);
+               ret = -ENOMEM;
+               goto err;
+       }
+
+       data->op_base = of_iomap(np, 2);
+       if (!data->op_base) {
+               pr_err("L%d: failed to map operation register\n", *cache_level);
+               ret = -ENOMEM;
+               goto err;
+       }
+
+       if (*cache_level == 2) {
+               u32 revision = readl(data->rev_base + UNIPHIER_SSCID);
+               /*
+                * The size of range operation is limited to (1 << 22) or less
+                * for PH-sLD8 or older SoCs.
+                */
+               if (revision <= 0x16)
+                       data->range_op_max_size = (u32)1 << 22;
+       }
+
+       data->range_op_max_size -= data->line_size;
+
+       INIT_LIST_HEAD(&data->list);
+       list_add_tail(&data->list, &uniphier_cache_list); /* no mutex */
+
+       /*
+        * OK, this level has been successfully initialized.  Look for the next
+        * level cache.  Do not roll back even if the initialization of the
+        * next level cache fails because we want to continue with available
+        * cache levels.
+        */
+       next_np = uniphier_cache_get_next_level_node(np);
+       if (next_np) {
+               (*cache_level)++;
+               ret = __uniphier_cache_init(next_np, cache_level);
+       }
+       of_node_put(next_np);
+
+       return ret;
+err:
+       iounmap(data->op_base);
+       iounmap(data->rev_base);
+       iounmap(data->ctrl_base);
+       kfree(data);
+
+       return ret;
+}
+
+int __init uniphier_cache_init(void)
+{
+       struct device_node *np = NULL;
+       unsigned int cache_level;
+       int ret = 0;
+
+       /* look for level 2 cache */
+       while ((np = of_find_matching_node(np, uniphier_cache_match)))
+               if (!of_property_read_u32(np, "cache-level", &cache_level) &&
+                   cache_level == 2)
+                       break;
+
+       if (!np)
+               return -ENODEV;
+
+       ret = __uniphier_cache_init(np, &cache_level);
+       of_node_put(np);
+
+       if (ret) {
+               /*
+                * Error out iif L2 initialization fails.  Continue with any
+                * error on L3 or outer because they are optional.
+                */
+               if (cache_level == 2) {
+                       pr_err("failed to initialize L2 cache\n");
+                       return ret;
+               }
+
+               cache_level--;
+               ret = 0;
+       }
+
+       outer_cache.inv_range = uniphier_cache_inv_range;
+       outer_cache.clean_range = uniphier_cache_clean_range;
+       outer_cache.flush_range = uniphier_cache_flush_range;
+       outer_cache.flush_all = uniphier_cache_flush_all;
+       outer_cache.disable = uniphier_cache_disable;
+       outer_cache.sync = uniphier_cache_sync;
+
+       uniphier_cache_enable();
+
+       pr_info("enabled outer cache (cache level: %d)\n", cache_level);
+
+       return ret;
+}
index 23800a19a7bc5cc5bafc48c79e20fcb335ae97ea..4043c35962cca5411e4edf26c0fa8da50ab9fda9 100644 (file)
@@ -7,6 +7,7 @@ config ARCH_BCM_IPROC
 
 config ARCH_BERLIN
        bool "Marvell Berlin SoC Family"
+       select ARCH_REQUIRE_GPIOLIB
        select DW_APB_ICTL
        help
          This enables support for Marvell Berlin SoC Family
@@ -28,10 +29,10 @@ config ARCH_EXYNOS7
        help
          This enables support for Samsung Exynos7 SoC family
 
-config ARCH_FSL_LS2085A
-       bool "Freescale LS2085A SOC"
+config ARCH_LAYERSCAPE
+       bool "ARMv8 based Freescale Layerscape SoC family"
        help
-         This enables support for Freescale LS2085A SOC.
+         This enables support for the Freescale Layerscape SoC family.
 
 config ARCH_HISI
        bool "Hisilicon SoC Family"
@@ -66,6 +67,11 @@ config ARCH_SEATTLE
        help
          This enables support for AMD Seattle SOC Family
 
+config ARCH_STRATIX10
+       bool "Altera's Stratix 10 SoCFPGA Family"
+       help
+         This enables support for Altera's Stratix 10 SoCFPGA Family.
+
 config ARCH_TEGRA
        bool "NVIDIA Tegra SoC Family"
        select ARCH_HAS_RESET_CONTROLLER
index b01ec43d1ca9b4e80775d5336d8841600852c3a4..eb3c42d971750372d3194cf935f9148b9892f53c 100644 (file)
@@ -1,3 +1,4 @@
+dts-dirs += altera
 dts-dirs += amd
 dts-dirs += apm
 dts-dirs += arm
diff --git a/arch/arm64/boot/dts/altera/Makefile b/arch/arm64/boot/dts/altera/Makefile
new file mode 100644 (file)
index 0000000..d7a6416
--- /dev/null
@@ -0,0 +1,5 @@
+dtb-$(CONFIG_ARCH_STRATIX10) += socfpga_stratix10_socdk.dtb
+
+always         := $(dtb-y)
+subdir-y       := $(dts-dirs)
+clean-files    := *.dtb
diff --git a/arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi b/arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi
new file mode 100644 (file)
index 0000000..445aa67
--- /dev/null
@@ -0,0 +1,358 @@
+/*
+ * Copyright Altera Corporation (C) 2015. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/dts-v1/;
+
+/ {
+       compatible = "altr,socfpga-stratix10";
+       #address-cells = <2>;
+       #size-cells = <2>;
+
+       cpus {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               cpu0: cpu@0 {
+                       compatible = "arm,cortex-a53", "arm,armv8";
+                       device_type = "cpu";
+                       enable-method = "psci";
+                       reg = <0x0>;
+               };
+
+               cpu1: cpu@1 {
+                       compatible = "arm,cortex-a53", "arm,armv8";
+                       device_type = "cpu";
+                       enable-method = "psci";
+                       reg = <0x1>;
+               };
+
+               cpu2: cpu@2 {
+                       compatible = "arm,cortex-a53", "arm,armv8";
+                       device_type = "cpu";
+                       enable-method = "psci";
+                       reg = <0x2>;
+               };
+
+               cpu3: cpu@3 {
+                       compatible = "arm,cortex-a53", "arm,armv8";
+                       device_type = "cpu";
+                       enable-method = "psci";
+                       reg = <0x3>;
+               };
+       };
+
+       pmu {
+               compatible = "arm,armv8-pmuv3";
+               interrupts = <0 120 8>,
+                            <0 121 8>,
+                            <0 122 8>,
+                            <0 123 8>;
+               interrupt-affinity = <&cpu0>,
+                                    <&cpu1>,
+                                    <&cpu2>,
+                                    <&cpu3>;
+       };
+
+       psci {
+               compatible = "arm,psci-0.2";
+               method = "smc";
+       };
+
+       intc: intc@fffc1000 {
+               compatible = "arm,gic-400", "arm,cortex-a15-gic";
+               #interrupt-cells = <3>;
+               interrupt-controller;
+               reg = <0x0 0xfffc1000 0x1000>,
+                     <0x0 0xfffc2000 0x2000>,
+                     <0x0 0xfffc4000 0x2000>,
+                     <0x0 0xfffc6000 0x2000>;
+       };
+
+       soc {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "simple-bus";
+               device_type = "soc";
+               interrupt-parent = <&intc>;
+               ranges = <0 0 0 0xffffffff>;
+
+               clkmgr@ffd1000 {
+                       compatible = "altr,clk-mgr";
+                       reg = <0xffd10000 0x1000>;
+               };
+
+               gmac0: ethernet@ff800000 {
+                       compatible = "altr,socfpga-stmmac", "snps,dwmac-3.74a", "snps,dwmac";
+                       reg = <0xff800000 0x2000>;
+                       interrupts = <0 90 4>;
+                       interrupt-names = "macirq";
+                       mac-address = [00 00 00 00 00 00];
+                       status = "disabled";
+               };
+
+               gmac1: ethernet@ff802000 {
+                       compatible = "altr,socfpga-stmmac", "snps,dwmac-3.74a", "snps,dwmac";
+                       reg = <0xff802000 0x2000>;
+                       interrupts = <0 91 4>;
+                       interrupt-names = "macirq";
+                       mac-address = [00 00 00 00 00 00];
+                       status = "disabled";
+               };
+
+               gmac2: ethernet@ff804000 {
+                       compatible = "altr,socfpga-stmmac", "snps,dwmac-3.74a", "snps,dwmac";
+                       reg = <0xff804000 0x2000>;
+                       interrupts = <0 92 4>;
+                       interrupt-names = "macirq";
+                       mac-address = [00 00 00 00 00 00];
+                       status = "disabled";
+               };
+
+               gpio0: gpio@ffc03200 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "snps,dw-apb-gpio";
+                       reg = <0xffc03200 0x100>;
+                       status = "disabled";
+
+                       porta: gpio-controller@0 {
+                               compatible = "snps,dw-apb-gpio-port";
+                               gpio-controller;
+                               #gpio-cells = <2>;
+                               snps,nr-gpios = <24>;
+                               reg = <0>;
+                               interrupt-controller;
+                               #interrupt-cells = <2>;
+                               interrupts = <0 110 4>;
+                       };
+               };
+
+               gpio1: gpio@ffc03300 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "snps,dw-apb-gpio";
+                       reg = <0xffc03300 0x100>;
+                       status = "disabled";
+
+                       portb: gpio-controller@0 {
+                               compatible = "snps,dw-apb-gpio-port";
+                               gpio-controller;
+                               #gpio-cells = <2>;
+                               snps,nr-gpios = <24>;
+                               reg = <0>;
+                               interrupt-controller;
+                               #interrupt-cells = <2>;
+                               interrupts = <0 110 4>;
+                       };
+               };
+
+               i2c0: i2c@ffc02800 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "snps,designware-i2c";
+                       reg = <0xffc02800 0x100>;
+                       interrupts = <0 103 4>;
+                       status = "disabled";
+               };
+
+               i2c1: i2c@ffc02900 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "snps,designware-i2c";
+                       reg = <0xffc02900 0x100>;
+                       interrupts = <0 104 4>;
+                       status = "disabled";
+               };
+
+               i2c2: i2c@ffc02a00 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "snps,designware-i2c";
+                       reg = <0xffc02a00 0x100>;
+                       interrupts = <0 105 4>;
+                       status = "disabled";
+               };
+
+               i2c3: i2c@ffc02b00 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "snps,designware-i2c";
+                       reg = <0xffc02b00 0x100>;
+                       interrupts = <0 106 4>;
+                       status = "disabled";
+               };
+
+               i2c4: i2c@ffc02c00 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "snps,designware-i2c";
+                       reg = <0xffc02c00 0x100>;
+                       interrupts = <0 107 4>;
+                       status = "disabled";
+               };
+
+               mmc: dwmmc0@ff808000 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "altr,socfpga-dw-mshc";
+                       reg = <0xff808000 0x1000>;
+                       interrupts = <0 96 4>;
+                       fifo-depth = <0x400>;
+                       status = "disabled";
+               };
+
+               ocram: sram@ffe00000 {
+                       compatible = "mmio-sram";
+                       reg = <0xffe00000 0x100000>;
+               };
+
+               rst: rstmgr@ffd11000 {
+                       #reset-cells = <1>;
+                       compatible = "altr,rst-mgr";
+                       reg = <0xffd11000 0x1000>;
+               };
+
+               spi0: spi@ffda4000 {
+                       compatible = "snps,dw-apb-ssi";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <0xffda4000 0x1000>;
+                       interrupts = <0 101 4>;
+                       num-chipselect = <4>;
+                       bus-num = <0>;
+                       status = "disabled";
+               };
+
+               spi1: spi@ffda5000 {
+                       compatible = "snps,dw-apb-ssi";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <0xffda5000 0x1000>;
+                       interrupts = <0 102 4>;
+                       num-chipselect = <4>;
+                       bus-num = <0>;
+                       status = "disabled";
+               };
+
+               sysmgr: sysmgr@ffd12000 {
+                       compatible = "altr,sys-mgr", "syscon";
+                       reg = <0xffd12000 0x1000>;
+               };
+
+               /* Local timer */
+               timer {
+                       compatible = "arm,armv8-timer";
+                       interrupts = <1 13 0xf01>,
+                                    <1 14 0xf01>,
+                                    <1 11 0xf01>,
+                                    <1 10 0xf01>;
+               };
+
+               timer0: timer0@ffc03000 {
+                       compatible = "snps,dw-apb-timer";
+                       interrupts = <0 113 4>;
+                       reg = <0xffc03000 0x100>;
+               };
+
+               timer1: timer1@ffc03100 {
+                       compatible = "snps,dw-apb-timer";
+                       interrupts = <0 114 4>;
+                       reg = <0xffc03100 0x100>;
+               };
+
+               timer2: timer2@ffd00000 {
+                       compatible = "snps,dw-apb-timer";
+                       interrupts = <0 115 4>;
+                       reg = <0xffd00000 0x100>;
+               };
+
+               timer3: timer3@ffd00100 {
+                       compatible = "snps,dw-apb-timer";
+                       interrupts = <0 116 4>;
+                       reg = <0xffd00100 0x100>;
+               };
+
+               uart0: serial0@ffc02000 {
+                       compatible = "snps,dw-apb-uart";
+                       reg = <0xffc02000 0x100>;
+                       interrupts = <0 108 4>;
+                       reg-shift = <2>;
+                       reg-io-width = <4>;
+                       status = "disabled";
+               };
+
+               uart1: serial1@ffc02100 {
+                       compatible = "snps,dw-apb-uart";
+                       reg = <0xffc02100 0x100>;
+                       interrupts = <0 109 4>;
+                       reg-shift = <2>;
+                       reg-io-width = <4>;
+                       status = "disabled";
+               };
+
+               usbphy0: usbphy@0 {
+                       #phy-cells = <0>;
+                       compatible = "usb-nop-xceiv";
+                       status = "okay";
+               };
+
+               usb0: usb@ffb00000 {
+                       compatible = "snps,dwc2";
+                       reg = <0xffb00000 0x40000>;
+                       interrupts = <0 93 4>;
+                       phys = <&usbphy0>;
+                       phy-names = "usb2-phy";
+                       status = "disabled";
+               };
+
+               usb1: usb@ffb40000 {
+                       compatible = "snps,dwc2";
+                       reg = <0xffb40000 0x40000>;
+                       interrupts = <0 94 4>;
+                       phys = <&usbphy0>;
+                       phy-names = "usb2-phy";
+                       status = "disabled";
+               };
+
+               watchdog0: watchdog@ffd00200 {
+                       compatible = "snps,dw-wdt";
+                       reg = <0xffd00200 0x100>;
+                       interrupts = <0 117 4>;
+                       status = "disabled";
+               };
+
+               watchdog1: watchdog@ffd00300 {
+                       compatible = "snps,dw-wdt";
+                       reg = <0xffd00300 0x100>;
+                       interrupts = <0 118 4>;
+                       status = "disabled";
+               };
+
+               watchdog2: watchdog@ffd00400 {
+                       compatible = "snps,dw-wdt";
+                       reg = <0xffd00400 0x100>;
+                       interrupts = <0 125 4>;
+                       status = "disabled";
+               };
+
+               watchdog3: watchdog@ffd00500 {
+                       compatible = "snps,dw-wdt";
+                       reg = <0xffd00500 0x100>;
+                       interrupts = <0 126 4>;
+                       status = "disabled";
+               };
+       };
+};
diff --git a/arch/arm64/boot/dts/altera/socfpga_stratix10_socdk.dts b/arch/arm64/boot/dts/altera/socfpga_stratix10_socdk.dts
new file mode 100644 (file)
index 0000000..41ea2db
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * Copyright Altera Corporation (C) 2015. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/include/ "socfpga_stratix10.dtsi"
+
+/ {
+       model = "SoCFPGA Stratix 10 SoCDK";
+
+       aliases {
+               serial0 = &uart0;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       memory {
+               device_type = "memory";
+               /* We expect the bootloader to fill in the reg */
+               reg = <0 0 0 0>;
+       };
+};
+
+&uart0 {
+       status = "okay";
+};
index a2afabbc17174eed385aad24e721f35a8ffa8dda..c75f17a4947152da9fee611da3ace5d55a275fb6 100644 (file)
@@ -1,4 +1,5 @@
 dtb-$(CONFIG_ARCH_XGENE) += apm-mustang.dtb
+dtb-$(CONFIG_ARCH_XGENE) += apm-merlin.dtb
 
 always         := $(dtb-y)
 subdir-y       := $(dts-dirs)
diff --git a/arch/arm64/boot/dts/apm/apm-merlin.dts b/arch/arm64/boot/dts/apm/apm-merlin.dts
new file mode 100644 (file)
index 0000000..119a469
--- /dev/null
@@ -0,0 +1,72 @@
+/*
+ * dts file for AppliedMicro (APM) Merlin Board
+ *
+ * Copyright (C) 2015, Applied Micro Circuits 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; either version 2 of
+ * the License, or (at your option) any later version.
+ */
+
+/dts-v1/;
+
+/include/ "apm-shadowcat.dtsi"
+
+/ {
+       model = "APM X-Gene Merlin board";
+       compatible = "apm,merlin", "apm,xgene-shadowcat";
+
+       chosen { };
+
+       memory {
+               device_type = "memory";
+               reg = < 0x1 0x00000000 0x0 0x80000000 >;
+       };
+
+       gpio-keys {
+               compatible = "gpio-keys";
+               button@1 {
+                       label = "POWER";
+                       linux,code = <116>;
+                       linux,input-type = <0x1>;
+                       interrupts = <0x0 0x28 0x1>;
+               };
+       };
+
+       poweroff_mbox: poweroff_mbox@10548000 {
+               compatible = "syscon";
+               reg = <0x0 0x10548000 0x0 0x30>;
+       };
+
+       poweroff: poweroff@10548010 {
+               compatible = "syscon-poweroff";
+               regmap = <&poweroff_mbox>;
+               offset = <0x10>;
+               mask = <0x1>;
+       };
+};
+
+&serial0 {
+       status = "ok";
+};
+
+&sata1 {
+       status = "ok";
+};
+
+&sata2 {
+       status = "ok";
+};
+
+&sata3 {
+       status = "ok";
+};
+
+&sgenet0 {
+       status = "ok";
+};
+
+&xgenet1 {
+       status = "ok";
+};
index 4c55833d8a41a0b361faaf66ad72dffcc6885f02..01cdeda93c3a142d4963c5f6f9a1d81697b20592 100644 (file)
                        interrupts = <0x0 0x2d 0x1>;
                };
        };
+
+       poweroff_mbox: poweroff_mbox@10548000 {
+               compatible = "syscon";
+               reg = <0x0 0x10548000 0x0 0x30>;
+       };
+
+       poweroff: poweroff@10548010 {
+               compatible = "syscon-poweroff";
+               regmap = <&poweroff_mbox>;
+               offset = <0x10>;
+               mask = <0x1>;
+       };
 };
 
 &pcie0clk {
diff --git a/arch/arm64/boot/dts/apm/apm-shadowcat.dtsi b/arch/arm64/boot/dts/apm/apm-shadowcat.dtsi
new file mode 100644 (file)
index 0000000..c804f8f
--- /dev/null
@@ -0,0 +1,271 @@
+/*
+ * dts file for AppliedMicro (APM) X-Gene Shadowcat SOC
+ *
+ * Copyright (C) 2015, Applied Micro Circuits 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; either version 2 of
+ * the License, or (at your option) any later version.
+ */
+
+/ {
+       compatible = "apm,xgene-shadowcat";
+       interrupt-parent = <&gic>;
+       #address-cells = <2>;
+       #size-cells = <2>;
+
+       cpus {
+               #address-cells = <2>;
+               #size-cells = <0>;
+
+               cpu@000 {
+                       device_type = "cpu";
+                       compatible = "apm,strega", "arm,armv8";
+                       reg = <0x0 0x000>;
+                       enable-method = "spin-table";
+                       cpu-release-addr = <0x1 0x0000fff8>;
+               };
+               cpu@001 {
+                       device_type = "cpu";
+                       compatible = "apm,strega", "arm,armv8";
+                       reg = <0x0 0x001>;
+                       enable-method = "spin-table";
+                       cpu-release-addr = <0x1 0x0000fff8>;
+               };
+               cpu@100 {
+                       device_type = "cpu";
+                       compatible = "apm,strega", "arm,armv8";
+                       reg = <0x0 0x100>;
+                       enable-method = "spin-table";
+                       cpu-release-addr = <0x1 0x0000fff8>;
+               };
+               cpu@101 {
+                       device_type = "cpu";
+                       compatible = "apm,strega", "arm,armv8";
+                       reg = <0x0 0x101>;
+                       enable-method = "spin-table";
+                       cpu-release-addr = <0x1 0x0000fff8>;
+               };
+               cpu@200 {
+                       device_type = "cpu";
+                       compatible = "apm,strega", "arm,armv8";
+                       reg = <0x0 0x200>;
+                       enable-method = "spin-table";
+                       cpu-release-addr = <0x1 0x0000fff8>;
+               };
+               cpu@201 {
+                       device_type = "cpu";
+                       compatible = "apm,strega", "arm,armv8";
+                       reg = <0x0 0x201>;
+                       enable-method = "spin-table";
+                       cpu-release-addr = <0x1 0x0000fff8>;
+               };
+               cpu@300 {
+                       device_type = "cpu";
+                       compatible = "apm,strega", "arm,armv8";
+                       reg = <0x0 0x300>;
+                       enable-method = "spin-table";
+                       cpu-release-addr = <0x1 0x0000fff8>;
+               };
+               cpu@301 {
+                       device_type = "cpu";
+                       compatible = "apm,strega", "arm,armv8";
+                       reg = <0x0 0x301>;
+                       enable-method = "spin-table";
+                       cpu-release-addr = <0x1 0x0000fff8>;
+               };
+       };
+
+       gic: interrupt-controller@78090000 {
+               compatible = "arm,cortex-a15-gic";
+               #interrupt-cells = <3>;
+               #address-cells = <2>;
+               #size-cells = <2>;
+               interrupt-controller;
+               interrupts = <1 9 0xf04>;       /* GIC Maintenence IRQ */
+               ranges = <0 0 0 0x79000000 0x0 0x800000>; /* MSI Range */
+               reg = <0x0 0x78090000 0x0 0x10000>,     /* GIC Dist */
+                     <0x0 0x780A0000 0x0 0x20000>,     /* GIC CPU */
+                     <0x0 0x780C0000 0x0 0x10000>,     /* GIC VCPU Control */
+                     <0x0 0x780E0000 0x0 0x20000>;     /* GIC VCPU */
+       };
+
+       pmu {
+               compatible = "arm,armv8-pmuv3";
+               interrupts = <1 12 0xff04>;
+       };
+
+       timer {
+               compatible = "arm,armv8-timer";
+               interrupts = <1 0 0xff04>,      /* Secure Phys IRQ */
+                            <1 13 0xff04>,     /* Non-secure Phys IRQ */
+                            <1 14 0xff04>,     /* Virt IRQ */
+                            <1 15 0xff04>;     /* Hyp IRQ */
+               clock-frequency = <50000000>;
+       };
+
+       soc {
+               compatible = "simple-bus";
+               #address-cells = <2>;
+               #size-cells = <2>;
+               ranges;
+
+               clocks {
+                       #address-cells = <2>;
+                       #size-cells = <2>;
+                       ranges;
+
+                       refclk: refclk {
+                               compatible = "fixed-clock";
+                               #clock-cells = <1>;
+                               clock-frequency = <100000000>;
+                               clock-output-names = "refclk";
+                       };
+
+                       socpll: socpll@17000120 {
+                               compatible = "apm,xgene-socpll-clock";
+                               #clock-cells = <1>;
+                               clocks = <&refclk 0>;
+                               reg = <0x0 0x17000120 0x0 0x1000>;
+                               clock-output-names = "socpll";
+                       };
+
+                       socplldiv2: socplldiv2  {
+                               compatible = "fixed-factor-clock";
+                               #clock-cells = <1>;
+                               clocks = <&socpll 0>;
+                               clock-mult = <1>;
+                               clock-div = <2>;
+                               clock-output-names = "socplldiv2";
+                       };
+
+                       pcie0clk: pcie0clk@1f2bc000 {
+                               compatible = "apm,xgene-device-clock";
+                               #clock-cells = <1>;
+                               clocks = <&socplldiv2 0>;
+                               reg = <0x0 0x1f2bc000 0x0 0x1000>;
+                               reg-names = "csr-reg";
+                               clock-output-names = "pcie0clk";
+                       };
+
+                       xge0clk: xge0clk@1f61c000 {
+                               compatible = "apm,xgene-device-clock";
+                               #clock-cells = <1>;
+                               clocks = <&socplldiv2 0>;
+                               reg = <0x0 0x1f61c000 0x0 0x1000>;
+                               reg-names = "csr-reg";
+                               enable-mask = <0x3>;
+                               csr-mask = <0x3>;
+                               clock-output-names = "xge0clk";
+                       };
+
+                       xge1clk: xge1clk@1f62c000 {
+                               compatible = "apm,xgene-device-clock";
+                               #clock-cells = <1>;
+                               clocks = <&socplldiv2 0>;
+                               reg = <0x0 0x1f62c000 0x0 0x1000>;
+                               reg-names = "csr-reg";
+                               enable-mask = <0x3>;
+                               csr-mask = <0x3>;
+                               clock-output-names = "xge1clk";
+                       };
+               };
+
+               scu: system-clk-controller@17000000 {
+                       compatible = "apm,xgene-scu","syscon";
+                       reg = <0x0 0x17000000 0x0 0x400>;
+               };
+
+               reboot: reboot@17000014 {
+                       compatible = "syscon-reboot";
+                       regmap = <&scu>;
+                       offset = <0x14>;
+                       mask = <0x1>;
+               };
+
+               serial0: serial@10600000 {
+                       device_type = "serial";
+                       compatible = "ns16550";
+                       reg = <0 0x10600000 0x0 0x1000>;
+                       reg-shift = <2>;
+                       clock-frequency = <10000000>;
+                       interrupt-parent = <&gic>;
+                       interrupts = <0x0 0x4c 0x4>;
+               };
+
+               sata1: sata@1a000000 {
+                       compatible = "apm,xgene-ahci";
+                       reg = <0x0 0x1a000000 0x0 0x1000>,
+                             <0x0 0x1f200000 0x0 0x1000>,
+                             <0x0 0x1f20d000 0x0 0x1000>,
+                             <0x0 0x1f20e000 0x0 0x1000>;
+                       interrupts = <0x0 0x5a 0x4>;
+                       dma-coherent;
+               };
+
+               sata2: sata@1a200000 {
+                       compatible = "apm,xgene-ahci";
+                       reg = <0x0 0x1a200000 0x0 0x1000>,
+                             <0x0 0x1f210000 0x0 0x1000>,
+                             <0x0 0x1f21d000 0x0 0x1000>,
+                             <0x0 0x1f21e000 0x0 0x1000>;
+                       interrupts = <0x0 0x5b 0x4>;
+                       dma-coherent;
+               };
+
+               sata3: sata@1a400000 {
+                       compatible = "apm,xgene-ahci";
+                       reg = <0x0 0x1a400000 0x0 0x1000>,
+                             <0x0 0x1f220000 0x0 0x1000>,
+                             <0x0 0x1f22d000 0x0 0x1000>,
+                             <0x0 0x1f22e000 0x0 0x1000>;
+                       interrupts = <0x0 0x5c 0x4>;
+                       dma-coherent;
+               };
+
+               sbgpio: sbgpio@17001000{
+                       compatible = "apm,xgene-gpio-sb";
+                       reg = <0x0 0x17001000 0x0 0x400>;
+                       #gpio-cells = <2>;
+                       gpio-controller;
+                       interrupts = <0x0 0x28 0x1>,
+                                    <0x0 0x29 0x1>,
+                                    <0x0 0x2a 0x1>,
+                                    <0x0 0x2b 0x1>,
+                                    <0x0 0x2c 0x1>,
+                                    <0x0 0x2d 0x1>,
+                                    <0x0 0x2e 0x1>,
+                                    <0x0 0x2f 0x1>;
+               };
+
+               sgenet0: ethernet@1f610000 {
+                       compatible = "apm,xgene2-sgenet";
+                       status = "disabled";
+                       reg = <0x0 0x1f610000 0x0 0x10000>,
+                             <0x0 0x1f600000 0x0 0Xd100>,
+                             <0x0 0x20000000 0x0 0X20000>;
+                       interrupts = <0 96 4>,
+                                    <0 97 4>;
+                       dma-coherent;
+                       clocks = <&xge0clk 0>;
+                       local-mac-address = [00 01 73 00 00 01];
+                       phy-connection-type = "sgmii";
+               };
+
+               xgenet1: ethernet@1f620000 {
+                       compatible = "apm,xgene2-xgenet";
+                       status = "disabled";
+                       reg = <0x0 0x1f620000 0x0 0x10000>,
+                             <0x0 0x1f600000 0x0 0Xd100>,
+                             <0x0 0x20000000 0x0 0X220000>;
+                       interrupts = <0 108 4>,
+                                    <0 109 4>;
+                       port-id = <1>;
+                       dma-coherent;
+                       clocks = <&xge1clk 0>;
+                       local-mac-address = [00 01 73 00 00 02];
+                       phy-connection-type = "xgmii";
+               };
+       };
+};
index d6c9630a5c20a817e840e8f5ed8e00c3a25b3c38..6c5ed119934f5cec0afeafedda99856d639ba391 100644 (file)
                clock-frequency = <50000000>;
        };
 
+       pmu {
+               compatible = "apm,potenza-pmu", "arm,armv8-pmuv3";
+               interrupts = <1 12 0xff04>;
+       };
+
        soc {
                compatible = "simple-bus";
                #address-cells = <2>;
                                        0x0 0x1f 0x4>;
                };
 
+               scu: system-clk-controller@17000000 {
+                       compatible = "apm,xgene-scu","syscon";
+                       reg = <0x0 0x17000000 0x0 0x400>;
+               };
+
+               reboot: reboot@17000014 {
+                       compatible = "syscon-reboot";
+                       regmap = <&scu>;
+                       offset = <0x14>;
+                       mask = <0x1>;
+               };
+
                csw: csw@7e200000 {
                        compatible = "apm,xgene-csw", "syscon";
                        reg = <0x0 0x7e200000 0x0 0x1000>;
index e3ee96036eca17a04b513880f29d65c6fe71a532..dd5158eb5872396693bba678cda765a719e25e97 100644 (file)
                };
        };
 
+       mailbox: mhu@2b1f0000 {
+               compatible = "arm,mhu", "arm,primecell";
+               reg = <0x0 0x2b1f0000 0x0 0x1000>;
+               interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH>;
+               interrupt-names = "mhu_lpri_rx",
+                                 "mhu_hpri_rx";
+               #mbox-cells = <1>;
+               clocks = <&soc_refclk100mhz>;
+               clock-names = "apb_pclk";
+       };
+
        gic: interrupt-controller@2c010000 {
                compatible = "arm,gic-400", "arm,cortex-a15-gic";
                reg = <0x0 0x2c010000 0 0x1000>,
                             <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(6) | IRQ_TYPE_LEVEL_LOW)>;
        };
 
+       sram: sram@2e000000 {
+               compatible = "arm,juno-sram-ns", "mmio-sram";
+               reg = <0x0 0x2e000000 0x0 0x8000>;
+
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges = <0 0x0 0x2e000000 0x8000>;
+
+               cpu_scp_lpri: scp-shmem@0 {
+                       compatible = "arm,juno-scp-shmem";
+                       reg = <0x0 0x200>;
+               };
+
+               cpu_scp_hpri: scp-shmem@200 {
+                       compatible = "arm,juno-scp-shmem";
+                       reg = <0x200 0x200>;
+               };
+       };
+
+       scpi {
+               compatible = "arm,scpi";
+               mboxes = <&mailbox 1>;
+               shmem = <&cpu_scp_hpri>;
+
+               clocks {
+                       compatible = "arm,scpi-clocks";
+
+                       scpi_dvfs: scpi_clocks@0 {
+                               compatible = "arm,scpi-dvfs-clocks";
+                               #clock-cells = <1>;
+                               clock-indices = <0>, <1>, <2>;
+                               clock-output-names = "atlclk", "aplclk","gpuclk";
+                       };
+                       scpi_clk: scpi_clocks@3 {
+                               compatible = "arm,scpi-variable-clocks";
+                               #clock-cells = <1>;
+                               clock-indices = <3>, <4>;
+                               clock-output-names = "pxlclk0", "pxlclk1";
+                       };
+               };
+
+               scpi_sensors0: sensors {
+                       compatible = "arm,scpi-sensors";
+                       #thermal-sensor-cells = <1>;
+               };
+       };
+
        /include/ "juno-clocks.dtsi"
 
        dma@7ff00000 {
index 3c386680357ebc2af6b0b734e26cdb1165194020..413f1b9ebcd45669f97def0a27d49547959f6028 100644 (file)
                                };
                        };
 
+                       flash@0,00000000 {
+                               /* 2 * 32MiB NOR Flash memory mounted on CS0 */
+                               compatible = "arm,vexpress-flash", "cfi-flash";
+                               linux,part-probe = "afs";
+                               reg = <0 0x00000000 0x04000000>;
+                               bank-width = <4>;
+                               /*
+                                * Unfortunately, accessing the flash disturbs
+                                * the CPU idle states (suspend) and CPU
+                                * hotplug of the platform. For this reason,
+                                * flash hardware access is disabled by default.
+                                */
+                               status = "disabled";
+                       };
+
                        ethernet@2,00000000 {
                                compatible = "smsc,lan9118", "smsc,lan9115";
                                reg = <2 0x00000000 0x10000>;
index 734e1272b19f526957e37eebd463a3af890816b7..93bc3d7d51c0f32f6894e9210ef9f41df3913e0a 100644 (file)
                #address-cells = <2>;
                #size-cells = <0>;
 
+               cpu-map {
+                       cluster0 {
+                               core0 {
+                                       cpu = <&A57_0>;
+                               };
+                               core1 {
+                                       cpu = <&A57_1>;
+                               };
+                       };
+
+                       cluster1 {
+                               core0 {
+                                       cpu = <&A53_0>;
+                               };
+                               core1 {
+                                       cpu = <&A53_1>;
+                               };
+                               core2 {
+                                       cpu = <&A53_2>;
+                               };
+                               core3 {
+                                       cpu = <&A53_3>;
+                               };
+                       };
+               };
+
                A57_0: cpu@0 {
                        compatible = "arm,cortex-a57","arm,armv8";
                        reg = <0x0 0x0>;
                        device_type = "cpu";
                        enable-method = "psci";
                        next-level-cache = <&A57_L2>;
+                       clocks = <&scpi_dvfs 0>;
                };
 
                A57_1: cpu@1 {
@@ -48,6 +75,7 @@
                        device_type = "cpu";
                        enable-method = "psci";
                        next-level-cache = <&A57_L2>;
+                       clocks = <&scpi_dvfs 0>;
                };
 
                A53_0: cpu@100 {
@@ -56,6 +84,7 @@
                        device_type = "cpu";
                        enable-method = "psci";
                        next-level-cache = <&A53_L2>;
+                       clocks = <&scpi_dvfs 1>;
                };
 
                A53_1: cpu@101 {
@@ -64,6 +93,7 @@
                        device_type = "cpu";
                        enable-method = "psci";
                        next-level-cache = <&A53_L2>;
+                       clocks = <&scpi_dvfs 1>;
                };
 
                A53_2: cpu@102 {
                        device_type = "cpu";
                        enable-method = "psci";
                        next-level-cache = <&A53_L2>;
+                       clocks = <&scpi_dvfs 1>;
                };
 
                A53_3: cpu@103 {
                        device_type = "cpu";
                        enable-method = "psci";
                        next-level-cache = <&A53_L2>;
+                       clocks = <&scpi_dvfs 1>;
                };
 
                A57_L2: l2-cache0 {
 
        #include "juno-base.dtsi"
 
+       pcie-controller@40000000 {
+               compatible = "arm,juno-r1-pcie", "plda,xpressrich3-axi", "pci-host-ecam-generic";
+               device_type = "pci";
+               reg = <0 0x40000000 0 0x10000000>;      /* ECAM config space */
+               bus-range = <0 255>;
+               linux,pci-domain = <0>;
+               #address-cells = <3>;
+               #size-cells = <2>;
+               dma-coherent;
+               ranges = <0x01000000 0x00 0x5f800000 0x00 0x5f800000 0x0 0x00800000>,
+                        <0x02000000 0x00 0x50000000 0x00 0x50000000 0x0 0x08000000>,
+                        <0x42000000 0x40 0x00000000 0x40 0x00000000 0x1 0x00000000>;
+               #interrupt-cells = <1>;
+               interrupt-map-mask = <0 0 0 7>;
+               interrupt-map = <0 0 0 1 &gic 0 0 0 136 4>,
+                               <0 0 0 2 &gic 0 0 0 137 4>,
+                               <0 0 0 3 &gic 0 0 0 138 4>,
+                               <0 0 0 4 &gic 0 0 0 139 4>;
+               msi-parent = <&v2m_0>;
+       };
 };
 
 &memtimer {
index ffa05aeab3c72158630f9831fa2764f3dd900cc5..53442b5ee4ff99170056ddb15eee296461d167a0 100644 (file)
                #address-cells = <2>;
                #size-cells = <0>;
 
+               cpu-map {
+                       cluster0 {
+                               core0 {
+                                       cpu = <&A57_0>;
+                               };
+                               core1 {
+                                       cpu = <&A57_1>;
+                               };
+                       };
+
+                       cluster1 {
+                               core0 {
+                                       cpu = <&A53_0>;
+                               };
+                               core1 {
+                                       cpu = <&A53_1>;
+                               };
+                               core2 {
+                                       cpu = <&A53_2>;
+                               };
+                               core3 {
+                                       cpu = <&A53_3>;
+                               };
+                       };
+               };
+
                A57_0: cpu@0 {
                        compatible = "arm,cortex-a57","arm,armv8";
                        reg = <0x0 0x0>;
                        device_type = "cpu";
                        enable-method = "psci";
                        next-level-cache = <&A57_L2>;
+                       clocks = <&scpi_dvfs 0>;
                };
 
                A57_1: cpu@1 {
@@ -48,6 +75,7 @@
                        device_type = "cpu";
                        enable-method = "psci";
                        next-level-cache = <&A57_L2>;
+                       clocks = <&scpi_dvfs 0>;
                };
 
                A53_0: cpu@100 {
@@ -56,6 +84,7 @@
                        device_type = "cpu";
                        enable-method = "psci";
                        next-level-cache = <&A53_L2>;
+                       clocks = <&scpi_dvfs 1>;
                };
 
                A53_1: cpu@101 {
@@ -64,6 +93,7 @@
                        device_type = "cpu";
                        enable-method = "psci";
                        next-level-cache = <&A53_L2>;
+                       clocks = <&scpi_dvfs 1>;
                };
 
                A53_2: cpu@102 {
                        device_type = "cpu";
                        enable-method = "psci";
                        next-level-cache = <&A53_L2>;
+                       clocks = <&scpi_dvfs 1>;
                };
 
                A53_3: cpu@103 {
                        device_type = "cpu";
                        enable-method = "psci";
                        next-level-cache = <&A53_L2>;
+                       clocks = <&scpi_dvfs 1>;
                };
 
                A57_L2: l2-cache0 {
index 5b1d0181023bed3b7ec19f0a933b690dbb599c5a..bb3c26d1154dab80648e7724e173bf1272617bb3 100644 (file)
                                <0 0 41 &gic GIC_SPI 41 IRQ_TYPE_LEVEL_HIGH>,
                                <0 0 42 &gic GIC_SPI 42 IRQ_TYPE_LEVEL_HIGH>;
 
-               /include/ "../../../../arm/boot/dts/vexpress-v2m-rs1.dtsi"
+               /include/ "vexpress-v2m-rs1.dtsi"
        };
 };
diff --git a/arch/arm64/boot/dts/arm/vexpress-v2m-rs1.dtsi b/arch/arm64/boot/dts/arm/vexpress-v2m-rs1.dtsi
new file mode 120000 (symlink)
index 0000000..68fd0f8
--- /dev/null
@@ -0,0 +1 @@
+../../../../arm/boot/dts/vexpress-v2m-rs1.dtsi
\ No newline at end of file
index 2eef4a279131d2f68b6eba4ee0c8616b5940c957..f77ddaf21d040ca6ec5864ca8a9ad73bff3e436b 100644 (file)
                samsung,pin-drv = <2>;
        };
 };
+
+&pinctrl_bus1 {
+       gpf0: gpf0 {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       gpf1: gpf1 {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       gpf2: gpf2 {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       gpf3: gpf3 {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       gpf4: gpf4 {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       gpf5: gpf5 {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       gpg1: gpg1 {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       gpg2: gpg2 {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       gph1: gph1 {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       gpv6: gpv6 {
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               interrupt-controller;
+               #interrupt-cells = <2>;
+       };
+
+       spi5_bus: spi5-bus {
+               samsung,pins = "gpf2-0", "gpf2-1", "gpf2-2", "gpf2-3";
+               samsung,pin-function = <2>;
+               samsung,pin-pud = <3>;
+               samsung,pin-drv = <0>;
+       };
+
+       ufs_refclk_out: ufs-refclk-out {
+               samsung,pins = "gpg2-4";
+               samsung,pin-function = <2>;
+               samsung,pin-pud = <0>;
+               samsung,pin-drv = <2>;
+       };
+
+       ufs_rst_n: ufs-rst-n {
+               samsung,pins = "gph1-5";
+               samsung,pin-function = <2>;
+               samsung,pin-pud = <3>;
+               samsung,pin-drv = <0>;
+       };
+};
index d7a37c3a6b521f268d5a840dbc4c36e07b6e3f76..f9c5a549c2c02ca691b75eadcd73032492528099 100644 (file)
@@ -26,6 +26,7 @@
                pinctrl5 = &pinctrl_ese;
                pinctrl6 = &pinctrl_fsys0;
                pinctrl7 = &pinctrl_fsys1;
+               pinctrl8 = &pinctrl_bus1;
        };
 
        cpus {
                        interrupts = <0 203 0>;
                };
 
+               pinctrl_bus1: pinctrl@14870000 {
+                       compatible = "samsung,exynos7-pinctrl";
+                       reg = <0x14870000 0x1000>;
+                       interrupts = <0 384 0>;
+               };
+
                hsi2c_0: hsi2c@13640000 {
                        compatible = "samsung,exynos7-hsi2c";
                        reg = <0x13640000 0x1000>;
index 4f2de3e789eefb9fe5653188f7025db31c137321..c4957a4aa5aa625f6659c351db64293342b1da28 100644 (file)
@@ -1,4 +1,6 @@
-dtb-$(CONFIG_ARCH_FSL_LS2085A) += fsl-ls2085a-simu.dtb
+dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls2080a-qds.dtb
+dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls2080a-rdb.dtb
+dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls2080a-simu.dtb
  
 always         := $(dtb-y)
 subdir-y       := $(dts-dirs)
diff --git a/arch/arm64/boot/dts/freescale/fsl-ls2080a-qds.dts b/arch/arm64/boot/dts/freescale/fsl-ls2080a-qds.dts
new file mode 100644 (file)
index 0000000..4cb996d
--- /dev/null
@@ -0,0 +1,204 @@
+/*
+ * Device Tree file for Freescale LS2080a QDS Board.
+ *
+ * Copyright (C) 2015, Freescale Semiconductor
+ *
+ * Bhupesh Sharma <bhupesh.sharma@freescale.com>
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPLv2 or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This library 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; either version 2 of the
+ *     License, or (at your option) any later version.
+ *
+ *     This library is distributed in the hope that it will be useful,
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ * Or, alternatively,
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use,
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/dts-v1/;
+
+/include/ "fsl-ls2080a.dtsi"
+
+/ {
+       model = "Freescale Layerscape 2080a QDS Board";
+       compatible = "fsl,ls2080a-qds", "fsl,ls2080a";
+
+       aliases {
+               serial0 = &serial0;
+               serial1 = &serial1;
+       };
+
+};
+
+&esdhc {
+       status = "okay";
+};
+
+&ifc {
+       status = "okay";
+       #address-cells = <2>;
+       #size-cells = <1>;
+       ranges = <0x0 0x0 0x5 0x80000000 0x08000000
+                 0x2 0x0 0x5 0x30000000 0x00010000
+                 0x3 0x0 0x5 0x20000000 0x00010000>;
+
+       nor@0,0 {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "cfi-flash";
+               reg = <0x0 0x0 0x8000000>;
+               bank-width = <2>;
+               device-width = <1>;
+       };
+
+       nand@2,0 {
+            compatible = "fsl,ifc-nand";
+            reg = <0x2 0x0 0x10000>;
+       };
+
+       cpld@3,0 {
+            reg = <0x3 0x0 0x10000>;
+            compatible = "fsl,ls2080aqds-fpga", "fsl,fpga-qixis";
+       };
+};
+
+&i2c0 {
+       status = "okay";
+       pca9547@77 {
+               compatible = "nxp,pca9547";
+               reg = <0x77>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+               i2c@0 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <0x00>;
+                       rtc@68 {
+                               compatible = "dallas,ds3232";
+                               reg = <0x68>;
+                       };
+               };
+
+               i2c@2 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <0x02>;
+
+                       ina220@40 {
+                               compatible = "ti,ina220";
+                               reg = <0x40>;
+                               shunt-resistor = <500>;
+                       };
+
+                       ina220@41 {
+                               compatible = "ti,ina220";
+                               reg = <0x41>;
+                               shunt-resistor = <1000>;
+                       };
+               };
+
+               i2c@3 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <0x3>;
+
+                       adt7481@4c {
+                               compatible = "adi,adt7461";
+                               reg = <0x4c>;
+                       };
+               };
+       };
+};
+
+&i2c1 {
+       status = "disabled";
+};
+
+&i2c2 {
+       status = "disabled";
+};
+
+&i2c3 {
+       status = "disabled";
+};
+
+&dspi {
+       status = "okay";
+       dflash0: n25q128a {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "st,m25p80";
+               spi-max-frequency = <3000000>;
+               reg = <0>;
+       };
+       dflash1: sst25wf040b {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "st,m25p80";
+               spi-max-frequency = <3000000>;
+               reg = <1>;
+       };
+       dflash2: en25s64 {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "st,m25p80";
+               spi-max-frequency = <3000000>;
+               reg = <2>;
+       };
+};
+
+&qspi {
+       status = "okay";
+       qflash0: s25fl008k {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "st,m25p80";
+               spi-max-frequency = <20000000>;
+               reg = <0>;
+       };
+};
+
+&sata0 {
+       status = "okay";
+};
+
+&sata1 {
+       status = "okay";
+};
+
+&usb0 {
+       status = "okay";
+};
+
+&usb1 {
+       status = "okay";
+};
diff --git a/arch/arm64/boot/dts/freescale/fsl-ls2080a-rdb.dts b/arch/arm64/boot/dts/freescale/fsl-ls2080a-rdb.dts
new file mode 100644 (file)
index 0000000..e127f0b
--- /dev/null
@@ -0,0 +1,166 @@
+/*
+ * Device Tree file for Freescale LS2080a RDB Board.
+ *
+ * Copyright (C) 2015, Freescale Semiconductor
+ *
+ * Bhupesh Sharma <bhupesh.sharma@freescale.com>
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPLv2 or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This library 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; either version 2 of the
+ *     License, or (at your option) any later version.
+ *
+ *     This library is distributed in the hope that it will be useful,
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ * Or, alternatively,
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use,
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/dts-v1/;
+
+/include/ "fsl-ls2080a.dtsi"
+
+/ {
+       model = "Freescale Layerscape 2080a RDB Board";
+       compatible = "fsl,ls2080a-rdb", "fsl,ls2080a";
+
+       aliases {
+               serial0 = &serial0;
+               serial1 = &serial1;
+       };
+};
+
+&esdhc {
+       status = "okay";
+};
+
+&ifc {
+       status = "okay";
+       #address-cells = <2>;
+       #size-cells = <1>;
+       ranges = <0x0 0x0 0x5 0x80000000 0x08000000
+                 0x2 0x0 0x5 0x30000000 0x00010000
+                 0x3 0x0 0x5 0x20000000 0x00010000>;
+
+       nor@0,0 {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "cfi-flash";
+               reg = <0x0 0x0 0x8000000>;
+               bank-width = <2>;
+               device-width = <1>;
+       };
+
+       nand@2,0 {
+            compatible = "fsl,ifc-nand";
+            reg = <0x2 0x0 0x10000>;
+       };
+
+       cpld@3,0 {
+            reg = <0x3 0x0 0x10000>;
+            compatible = "fsl,ls2080aqds-fpga", "fsl,fpga-qixis";
+       };
+
+};
+
+&i2c0 {
+       status = "okay";
+       pca9547@75 {
+               compatible = "nxp,pca9547";
+               reg = <0x75>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+               status = "disabled";
+               i2c@1 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <0x01>;
+                       rtc@68 {
+                               compatible = "dallas,ds3232";
+                               reg = <0x68>;
+                       };
+               };
+
+               i2c@3 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <0x3>;
+
+                       adt7481@4c {
+                               compatible = "adi,adt7461";
+                               reg = <0x4c>;
+                       };
+               };
+       };
+};
+
+&i2c1 {
+       status = "disabled";
+};
+
+&i2c2 {
+       status = "disabled";
+};
+
+&i2c3 {
+       status = "disabled";
+};
+
+&dspi {
+       status = "okay";
+       dflash0: n25q512a {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "st,m25p80";
+               spi-max-frequency = <3000000>;
+               reg = <0>;
+       };
+};
+
+&qspi {
+       status = "disabled";
+};
+
+&sata0 {
+       status = "okay";
+};
+
+&sata1 {
+       status = "okay";
+};
+
+&usb0 {
+       status = "okay";
+};
+
+&usb1 {
+       status = "okay";
+};
diff --git a/arch/arm64/boot/dts/freescale/fsl-ls2080a-simu.dts b/arch/arm64/boot/dts/freescale/fsl-ls2080a-simu.dts
new file mode 100644 (file)
index 0000000..505d038
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+ * Device Tree file for Freescale LS2080a software Simulator model
+ *
+ * Copyright (C) 2014-2015, Freescale Semiconductor
+ *
+ * Bhupesh Sharma <bhupesh.sharma@freescale.com>
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This library 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; either version 2 of the
+ *     License, or (at your option) any later version.
+ *
+ *     This library is distributed in the hope that it will be useful,
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ * Or, alternatively,
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use,
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/dts-v1/;
+
+/include/ "fsl-ls2080a.dtsi"
+
+/ {
+       model = "Freescale Layerscape 2080a software Simulator model";
+       compatible = "fsl,ls2080a-simu", "fsl,ls2080a";
+
+       aliases {
+               serial0 = &serial0;
+               serial1 = &serial1;
+       };
+
+       ethernet@2210000 {
+               compatible = "smsc,lan91c111";
+               reg = <0x0 0x2210000 0x0 0x100>;
+               interrupts = <0 58 0x1>;
+       };
+};
+
+&ifc {
+       status = "okay";
+};
+
diff --git a/arch/arm64/boot/dts/freescale/fsl-ls2080a.dtsi b/arch/arm64/boot/dts/freescale/fsl-ls2080a.dtsi
new file mode 100644 (file)
index 0000000..e81cd48
--- /dev/null
@@ -0,0 +1,515 @@
+/*
+ * Device Tree Include file for Freescale Layerscape-2080A family SoC.
+ *
+ * Copyright (C) 2014-2015, Freescale Semiconductor
+ *
+ * Bhupesh Sharma <bhupesh.sharma@freescale.com>
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPLv2 or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This library 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; either version 2 of the
+ *     License, or (at your option) any later version.
+ *
+ *     This library is distributed in the hope that it will be useful,
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ * Or, alternatively,
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use,
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/ {
+       compatible = "fsl,ls2080a";
+       interrupt-parent = <&gic>;
+       #address-cells = <2>;
+       #size-cells = <2>;
+
+       cpus {
+               #address-cells = <2>;
+               #size-cells = <0>;
+
+               /*
+                * We expect the enable-method for cpu's to be "psci", but this
+                * is dependent on the SoC FW, which will fill this in.
+                *
+                * Currently supported enable-method is psci v0.2
+                */
+
+               /* We have 4 clusters having 2 Cortex-A57 cores each */
+               cpu@0 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a57";
+                       reg = <0x0 0x0>;
+                       clocks = <&clockgen 1 0>;
+               };
+
+               cpu@1 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a57";
+                       reg = <0x0 0x1>;
+                       clocks = <&clockgen 1 0>;
+               };
+
+               cpu@100 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a57";
+                       reg = <0x0 0x100>;
+                       clocks = <&clockgen 1 1>;
+               };
+
+               cpu@101 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a57";
+                       reg = <0x0 0x101>;
+                       clocks = <&clockgen 1 1>;
+               };
+
+               cpu@200 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a57";
+                       reg = <0x0 0x200>;
+                       clocks = <&clockgen 1 2>;
+               };
+
+               cpu@201 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a57";
+                       reg = <0x0 0x201>;
+                       clocks = <&clockgen 1 2>;
+               };
+
+               cpu@300 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a57";
+                       reg = <0x0 0x300>;
+                       clocks = <&clockgen 1 3>;
+               };
+
+               cpu@301 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a57";
+                       reg = <0x0 0x301>;
+                       clocks = <&clockgen 1 3>;
+               };
+       };
+
+       memory@80000000 {
+               device_type = "memory";
+               reg = <0x00000000 0x80000000 0 0x80000000>;
+                     /* DRAM space - 1, size : 2 GB DRAM */
+       };
+
+       sysclk: sysclk {
+               compatible = "fixed-clock";
+               #clock-cells = <0>;
+               clock-frequency = <100000000>;
+               clock-output-names = "sysclk";
+       };
+
+       gic: interrupt-controller@6000000 {
+               compatible = "arm,gic-v3";
+               reg = <0x0 0x06000000 0 0x10000>, /* GIC Dist */
+                       <0x0 0x06100000 0 0x100000>, /* GICR (RD_base + SGI_base) */
+                       <0x0 0x0c0c0000 0 0x2000>, /* GICC */
+                       <0x0 0x0c0d0000 0 0x1000>, /* GICH */
+                       <0x0 0x0c0e0000 0 0x20000>; /* GICV */
+               #interrupt-cells = <3>;
+               #address-cells = <2>;
+               #size-cells = <2>;
+               ranges;
+               interrupt-controller;
+               interrupts = <1 9 0x4>;
+
+               its: gic-its@6020000 {
+                       compatible = "arm,gic-v3-its";
+                       msi-controller;
+                       reg = <0x0 0x6020000 0 0x20000>;
+               };
+       };
+
+       timer {
+               compatible = "arm,armv8-timer";
+               interrupts = <1 13 0x8>, /* Physical Secure PPI, active-low */
+                            <1 14 0x8>, /* Physical Non-Secure PPI, active-low */
+                            <1 11 0x8>, /* Virtual PPI, active-low */
+                            <1 10 0x8>; /* Hypervisor PPI, active-low */
+       };
+
+       pmu {
+               compatible = "arm,armv8-pmuv3";
+               interrupts = <1 7 0x8>; /* PMU PPI, Level low type */
+       };
+
+       soc {
+               compatible = "simple-bus";
+               #address-cells = <2>;
+               #size-cells = <2>;
+               ranges;
+
+               clockgen: clocking@1300000 {
+                       compatible = "fsl,ls2080a-clockgen";
+                       reg = <0 0x1300000 0 0xa0000>;
+                       #clock-cells = <2>;
+                       clocks = <&sysclk>;
+               };
+
+               serial0: serial@21c0500 {
+                       compatible = "fsl,ns16550", "ns16550a";
+                       reg = <0x0 0x21c0500 0x0 0x100>;
+                       clocks = <&clockgen 4 3>;
+                       interrupts = <0 32 0x4>; /* Level high type */
+               };
+
+               serial1: serial@21c0600 {
+                       compatible = "fsl,ns16550", "ns16550a";
+                       reg = <0x0 0x21c0600 0x0 0x100>;
+                       clocks = <&clockgen 4 3>;
+                       interrupts = <0 32 0x4>; /* Level high type */
+               };
+
+               fsl_mc: fsl-mc@80c000000 {
+                       compatible = "fsl,qoriq-mc";
+                       reg = <0x00000008 0x0c000000 0 0x40>,    /* MC portal base */
+                             <0x00000000 0x08340000 0 0x40000>; /* MC control reg */
+               };
+
+               smmu: iommu@5000000 {
+                       compatible = "arm,mmu-500";
+                       reg = <0 0x5000000 0 0x800000>;
+                       #global-interrupts = <12>;
+                       interrupts = <0 13 4>, /* global secure fault */
+                                    <0 14 4>, /* combined secure interrupt */
+                                    <0 15 4>, /* global non-secure fault */
+                                    <0 16 4>, /* combined non-secure interrupt */
+                               /* performance counter interrupts 0-7 */
+                                    <0 211 4>, <0 212 4>,
+                                    <0 213 4>, <0 214 4>,
+                                    <0 215 4>, <0 216 4>,
+                                    <0 217 4>, <0 218 4>,
+                               /* per context interrupt, 64 interrupts */
+                                    <0 146 4>, <0 147 4>,
+                                    <0 148 4>, <0 149 4>,
+                                    <0 150 4>, <0 151 4>,
+                                    <0 152 4>, <0 153 4>,
+                                    <0 154 4>, <0 155 4>,
+                                    <0 156 4>, <0 157 4>,
+                                    <0 158 4>, <0 159 4>,
+                                    <0 160 4>, <0 161 4>,
+                                    <0 162 4>, <0 163 4>,
+                                    <0 164 4>, <0 165 4>,
+                                    <0 166 4>, <0 167 4>,
+                                    <0 168 4>, <0 169 4>,
+                                    <0 170 4>, <0 171 4>,
+                                    <0 172 4>, <0 173 4>,
+                                    <0 174 4>, <0 175 4>,
+                                    <0 176 4>, <0 177 4>,
+                                    <0 178 4>, <0 179 4>,
+                                    <0 180 4>, <0 181 4>,
+                                    <0 182 4>, <0 183 4>,
+                                    <0 184 4>, <0 185 4>,
+                                    <0 186 4>, <0 187 4>,
+                                    <0 188 4>, <0 189 4>,
+                                    <0 190 4>, <0 191 4>,
+                                    <0 192 4>, <0 193 4>,
+                                    <0 194 4>, <0 195 4>,
+                                    <0 196 4>, <0 197 4>,
+                                    <0 198 4>, <0 199 4>,
+                                    <0 200 4>, <0 201 4>,
+                                    <0 202 4>, <0 203 4>,
+                                    <0 204 4>, <0 205 4>,
+                                    <0 206 4>, <0 207 4>,
+                                    <0 208 4>, <0 209 4>;
+                       mmu-masters = <&fsl_mc 0x300 0>;
+               };
+
+               dspi: dspi@2100000 {
+                       status = "disabled";
+                       compatible = "fsl,vf610-dspi";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <0x0 0x2100000 0x0 0x10000>;
+                       interrupts = <0 26 0x4>; /* Level high type */
+                       clocks = <&clockgen 4 3>;
+                       clock-names = "dspi";
+                       spi-num-chipselects = <5>;
+                       bus-num = <0>;
+               };
+
+               esdhc: esdhc@2140000 {
+                       status = "disabled";
+                       compatible = "fsl,ls2080a-esdhc", "fsl,esdhc";
+                       reg = <0x0 0x2140000 0x0 0x10000>;
+                       interrupts = <0 28 0x4>; /* Level high type */
+                       clock-frequency = <0>;  /* Updated by bootloader */
+                       voltage-ranges = <1800 1800 3300 3300>;
+                       sdhci,auto-cmd12;
+                       bus-width = <4>;
+               };
+
+               gpio0: gpio@2300000 {
+                       compatible = "fsl,qoriq-gpio";
+                       reg = <0x0 0x2300000 0x0 0x10000>;
+                       interrupts = <0 36 0x4>; /* Level high type */
+                       gpio-controller;
+                       #gpio-cells = <2>;
+                       interrupt-controller;
+                       #interrupt-cells = <2>;
+               };
+
+               gpio1: gpio@2310000 {
+                       compatible = "fsl,qoriq-gpio";
+                       reg = <0x0 0x2310000 0x0 0x10000>;
+                       interrupts = <0 36 0x4>; /* Level high type */
+                       gpio-controller;
+                       #gpio-cells = <2>;
+                       interrupt-controller;
+                       #interrupt-cells = <2>;
+               };
+
+               gpio2: gpio@2320000 {
+                       compatible = "fsl,qoriq-gpio";
+                       reg = <0x0 0x2320000 0x0 0x10000>;
+                       interrupts = <0 37 0x4>; /* Level high type */
+                       gpio-controller;
+                       #gpio-cells = <2>;
+                       interrupt-controller;
+                       #interrupt-cells = <2>;
+               };
+
+               gpio3: gpio@2330000 {
+                       compatible = "fsl,qoriq-gpio";
+                       reg = <0x0 0x2330000 0x0 0x10000>;
+                       interrupts = <0 37 0x4>; /* Level high type */
+                       gpio-controller;
+                       #gpio-cells = <2>;
+                       interrupt-controller;
+                       #interrupt-cells = <2>;
+               };
+
+               i2c0: i2c@2000000 {
+                       status = "disabled";
+                       compatible = "fsl,vf610-i2c";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <0x0 0x2000000 0x0 0x10000>;
+                       interrupts = <0 34 0x4>; /* Level high type */
+                       clock-names = "i2c";
+                       clocks = <&clockgen 4 3>;
+               };
+
+               i2c1: i2c@2010000 {
+                       status = "disabled";
+                       compatible = "fsl,vf610-i2c";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <0x0 0x2010000 0x0 0x10000>;
+                       interrupts = <0 34 0x4>; /* Level high type */
+                       clock-names = "i2c";
+                       clocks = <&clockgen 4 3>;
+               };
+
+               i2c2: i2c@2020000 {
+                       status = "disabled";
+                       compatible = "fsl,vf610-i2c";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <0x0 0x2020000 0x0 0x10000>;
+                       interrupts = <0 35 0x4>; /* Level high type */
+                       clock-names = "i2c";
+                       clocks = <&clockgen 4 3>;
+               };
+
+               i2c3: i2c@2030000 {
+                       status = "disabled";
+                       compatible = "fsl,vf610-i2c";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <0x0 0x2030000 0x0 0x10000>;
+                       interrupts = <0 35 0x4>; /* Level high type */
+                       clock-names = "i2c";
+                       clocks = <&clockgen 4 3>;
+               };
+
+               ifc: ifc@2240000 {
+                       compatible = "fsl,ifc", "simple-bus";
+                       reg = <0x0 0x2240000 0x0 0x20000>;
+                       interrupts = <0 21 0x4>; /* Level high type */
+                       little-endian;
+                       #address-cells = <2>;
+                       #size-cells = <1>;
+
+                       ranges = <0 0 0x5 0x80000000 0x08000000
+                                 2 0 0x5 0x30000000 0x00010000
+                                 3 0 0x5 0x20000000 0x00010000>;
+               };
+
+               qspi: quadspi@20c0000 {
+                       status = "disabled";
+                       compatible = "fsl,vf610-qspi";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <0x0 0x20c0000 0x0 0x10000>,
+                             <0x0 0x20000000 0x0 0x10000000>;
+                       reg-names = "QuadSPI", "QuadSPI-memory";
+                       interrupts = <0 25 0x4>; /* Level high type */
+                       clocks = <&clockgen 4 3>, <&clockgen 4 3>;
+                       clock-names = "qspi_en", "qspi";
+               };
+
+               pcie@3400000 {
+                       compatible = "fsl,ls2080a-pcie", "snps,dw-pcie";
+                       reg = <0x00 0x03400000 0x0 0x00100000   /* controller registers */
+                              0x10 0x00000000 0x0 0x00002000>; /* configuration space */
+                       reg-names = "regs", "config";
+                       interrupts = <0 108 0x4>; /* Level high type */
+                       interrupt-names = "intr";
+                       #address-cells = <3>;
+                       #size-cells = <2>;
+                       device_type = "pci";
+                       num-lanes = <4>;
+                       bus-range = <0x0 0xff>;
+                       ranges = <0x81000000 0x0 0x00000000 0x10 0x00010000 0x0 0x00010000   /* downstream I/O */
+                                 0x82000000 0x0 0x40000000 0x10 0x40000000 0x0 0x40000000>; /* non-prefetchable memory */
+                       msi-parent = <&its>;
+                       #interrupt-cells = <1>;
+                       interrupt-map-mask = <0 0 0 7>;
+                       interrupt-map = <0000 0 0 1 &gic 0 0 0 109 4>,
+                                       <0000 0 0 2 &gic 0 0 0 110 4>,
+                                       <0000 0 0 3 &gic 0 0 0 111 4>,
+                                       <0000 0 0 4 &gic 0 0 0 112 4>;
+               };
+
+               pcie@3500000 {
+                       compatible = "fsl,ls2080a-pcie", "snps,dw-pcie";
+                       reg = <0x00 0x03500000 0x0 0x00100000   /* controller registers */
+                              0x12 0x00000000 0x0 0x00002000>; /* configuration space */
+                       reg-names = "regs", "config";
+                       interrupts = <0 113 0x4>; /* Level high type */
+                       interrupt-names = "intr";
+                       #address-cells = <3>;
+                       #size-cells = <2>;
+                       device_type = "pci";
+                       num-lanes = <4>;
+                       bus-range = <0x0 0xff>;
+                       ranges = <0x81000000 0x0 0x00000000 0x12 0x00010000 0x0 0x00010000   /* downstream I/O */
+                                 0x82000000 0x0 0x40000000 0x12 0x40000000 0x0 0x40000000>; /* non-prefetchable memory */
+                       msi-parent = <&its>;
+                       #interrupt-cells = <1>;
+                       interrupt-map-mask = <0 0 0 7>;
+                       interrupt-map = <0000 0 0 1 &gic 0 0 0 114 4>,
+                                       <0000 0 0 2 &gic 0 0 0 115 4>,
+                                       <0000 0 0 3 &gic 0 0 0 116 4>,
+                                       <0000 0 0 4 &gic 0 0 0 117 4>;
+               };
+
+               pcie@3600000 {
+                       compatible = "fsl,ls2080a-pcie", "snps,dw-pcie";
+                       reg = <0x00 0x03600000 0x0 0x00100000   /* controller registers */
+                              0x14 0x00000000 0x0 0x00002000>; /* configuration space */
+                       reg-names = "regs", "config";
+                       interrupts = <0 118 0x4>; /* Level high type */
+                       interrupt-names = "intr";
+                       #address-cells = <3>;
+                       #size-cells = <2>;
+                       device_type = "pci";
+                       num-lanes = <8>;
+                       bus-range = <0x0 0xff>;
+                       ranges = <0x81000000 0x0 0x00000000 0x14 0x00010000 0x0 0x00010000   /* downstream I/O */
+                                 0x82000000 0x0 0x40000000 0x14 0x40000000 0x0 0x40000000>; /* non-prefetchable memory */
+                       msi-parent = <&its>;
+                       #interrupt-cells = <1>;
+                       interrupt-map-mask = <0 0 0 7>;
+                       interrupt-map = <0000 0 0 1 &gic 0 0 0 119 4>,
+                                       <0000 0 0 2 &gic 0 0 0 120 4>,
+                                       <0000 0 0 3 &gic 0 0 0 121 4>,
+                                       <0000 0 0 4 &gic 0 0 0 122 4>;
+               };
+
+               pcie@3700000 {
+                       compatible = "fsl,ls2080a-pcie", "snps,dw-pcie";
+                       reg = <0x00 0x03700000 0x0 0x00100000   /* controller registers */
+                              0x16 0x00000000 0x0 0x00002000>; /* configuration space */
+                       reg-names = "regs", "config";
+                       interrupts = <0 123 0x4>; /* Level high type */
+                       interrupt-names = "intr";
+                       #address-cells = <3>;
+                       #size-cells = <2>;
+                       device_type = "pci";
+                       num-lanes = <4>;
+                       bus-range = <0x0 0xff>;
+                       ranges = <0x81000000 0x0 0x00000000 0x16 0x00010000 0x0 0x00010000   /* downstream I/O */
+                                 0x82000000 0x0 0x40000000 0x16 0x40000000 0x0 0x40000000>; /* non-prefetchable memory */
+                       msi-parent = <&its>;
+                       #interrupt-cells = <1>;
+                       interrupt-map-mask = <0 0 0 7>;
+                       interrupt-map = <0000 0 0 1 &gic 0 0 0 124 4>,
+                                       <0000 0 0 2 &gic 0 0 0 125 4>,
+                                       <0000 0 0 3 &gic 0 0 0 126 4>,
+                                       <0000 0 0 4 &gic 0 0 0 127 4>;
+               };
+
+               sata0: sata@3200000 {
+                       status = "disabled";
+                       compatible = "fsl,ls2080a-ahci";
+                       reg = <0x0 0x3200000 0x0 0x10000>;
+                       interrupts = <0 133 0x4>; /* Level high type */
+                       clocks = <&clockgen 4 3>;
+               };
+
+               sata1: sata@3210000 {
+                       status = "disabled";
+                       compatible = "fsl,ls2080a-ahci";
+                       reg = <0x0 0x3210000 0x0 0x10000>;
+                       interrupts = <0 136 0x4>; /* Level high type */
+                       clocks = <&clockgen 4 3>;
+               };
+
+               usb0: usb3@3100000 {
+                       status = "disabled";
+                       compatible = "snps,dwc3";
+                       reg = <0x0 0x3100000 0x0 0x10000>;
+                       interrupts = <0 80 0x4>; /* Level high type */
+                       dr_mode = "host";
+               };
+
+               usb1: usb3@3110000 {
+                       status = "disabled";
+                       compatible = "snps,dwc3";
+                       reg = <0x0 0x3110000 0x0 0x10000>;
+                       interrupts = <0 81 0x4>; /* Level high type */
+                       dr_mode = "host";
+               };
+
+               ccn@4000000 {
+                       compatible = "arm,ccn-504";
+                       reg = <0x0 0x04000000 0x0 0x01000000>;
+                       interrupts = <0 12 4>;
+               };
+       };
+};
diff --git a/arch/arm64/boot/dts/freescale/fsl-ls2085a-simu.dts b/arch/arm64/boot/dts/freescale/fsl-ls2085a-simu.dts
deleted file mode 100644 (file)
index 82e2a6f..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Device Tree file for Freescale LS2085a software Simulator model
- *
- * Copyright (C) 2014, Freescale Semiconductor
- *
- * Bhupesh Sharma <bhupesh.sharma@freescale.com>
- *
- * This file is dual-licensed: you can use it either under the terms
- * of the GPL or the X11 license, at your option. Note that this dual
- * licensing only applies to this file, and not this project as a
- * whole.
- *
- *  a) This library 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; either version 2 of the
- *     License, or (at your option) any later version.
- *
- *     This library is distributed in the hope that it will be useful,
- *     but WITHOUT ANY WARRANTY; without even the implied warranty of
- *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *     GNU General Public License for more details.
- *
- *     You should have received a copy of the GNU General Public
- *     License along with this library; if not, write to the Free
- *     Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
- *     MA 02110-1301 USA
- *
- * Or, alternatively,
- *
- *  b) Permission is hereby granted, free of charge, to any person
- *     obtaining a copy of this software and associated documentation
- *     files (the "Software"), to deal in the Software without
- *     restriction, including without limitation the rights to use,
- *     copy, modify, merge, publish, distribute, sublicense, and/or
- *     sell copies of the Software, and to permit persons to whom the
- *     Software is furnished to do so, subject to the following
- *     conditions:
- *
- *     The above copyright notice and this permission notice shall be
- *     included in all copies or substantial portions of the Software.
- *
- *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- *     OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/dts-v1/;
-
-/include/ "fsl-ls2085a.dtsi"
-
-/ {
-       model = "Freescale Layerscape 2085a software Simulator model";
-       compatible = "fsl,ls2085a-simu", "fsl,ls2085a";
-
-       ethernet@2210000 {
-               compatible = "smsc,lan91c111";
-               reg = <0x0 0x2210000 0x0 0x100>;
-               interrupts = <0 58 0x1>;
-       };
-};
diff --git a/arch/arm64/boot/dts/freescale/fsl-ls2085a.dtsi b/arch/arm64/boot/dts/freescale/fsl-ls2085a.dtsi
deleted file mode 100644 (file)
index e281ceb..0000000
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- * Device Tree Include file for Freescale Layerscape-2085A family SoC.
- *
- * Copyright (C) 2014, Freescale Semiconductor
- *
- * Bhupesh Sharma <bhupesh.sharma@freescale.com>
- *
- * This file is dual-licensed: you can use it either under the terms
- * of the GPLv2 or the X11 license, at your option. Note that this dual
- * licensing only applies to this file, and not this project as a
- * whole.
- *
- *  a) This library 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; either version 2 of the
- *     License, or (at your option) any later version.
- *
- *     This library is distributed in the hope that it will be useful,
- *     but WITHOUT ANY WARRANTY; without even the implied warranty of
- *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *     GNU General Public License for more details.
- *
- *     You should have received a copy of the GNU General Public
- *     License along with this library; if not, write to the Free
- *     Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
- *     MA 02110-1301 USA
- *
- * Or, alternatively,
- *
- *  b) Permission is hereby granted, free of charge, to any person
- *     obtaining a copy of this software and associated documentation
- *     files (the "Software"), to deal in the Software without
- *     restriction, including without limitation the rights to use,
- *     copy, modify, merge, publish, distribute, sublicense, and/or
- *     sell copies of the Software, and to permit persons to whom the
- *     Software is furnished to do so, subject to the following
- *     conditions:
- *
- *     The above copyright notice and this permission notice shall be
- *     included in all copies or substantial portions of the Software.
- *
- *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- *     OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/ {
-       compatible = "fsl,ls2085a";
-       interrupt-parent = <&gic>;
-       #address-cells = <2>;
-       #size-cells = <2>;
-
-       cpus {
-               #address-cells = <2>;
-               #size-cells = <0>;
-
-               /*
-                * We expect the enable-method for cpu's to be "psci", but this
-                * is dependent on the SoC FW, which will fill this in.
-                *
-                * Currently supported enable-method is psci v0.2
-                */
-
-               /* We have 4 clusters having 2 Cortex-A57 cores each */
-               cpu@0 {
-                       device_type = "cpu";
-                       compatible = "arm,cortex-a57";
-                       reg = <0x0 0x0>;
-               };
-
-               cpu@1 {
-                       device_type = "cpu";
-                       compatible = "arm,cortex-a57";
-                       reg = <0x0 0x1>;
-               };
-
-               cpu@100 {
-                       device_type = "cpu";
-                       compatible = "arm,cortex-a57";
-                       reg = <0x0 0x100>;
-               };
-
-               cpu@101 {
-                       device_type = "cpu";
-                       compatible = "arm,cortex-a57";
-                       reg = <0x0 0x101>;
-               };
-
-               cpu@200 {
-                       device_type = "cpu";
-                       compatible = "arm,cortex-a57";
-                       reg = <0x0 0x200>;
-               };
-
-               cpu@201 {
-                       device_type = "cpu";
-                       compatible = "arm,cortex-a57";
-                       reg = <0x0 0x201>;
-               };
-
-               cpu@300 {
-                       device_type = "cpu";
-                       compatible = "arm,cortex-a57";
-                       reg = <0x0 0x300>;
-               };
-
-               cpu@301 {
-                       device_type = "cpu";
-                       compatible = "arm,cortex-a57";
-                       reg = <0x0 0x301>;
-               };
-       };
-
-       memory@80000000 {
-               device_type = "memory";
-               reg = <0x00000000 0x80000000 0 0x80000000>;
-                     /* DRAM space - 1, size : 2 GB DRAM */
-       };
-
-       gic: interrupt-controller@6000000 {
-               compatible = "arm,gic-v3";
-               reg = <0x0 0x06000000 0 0x10000>, /* GIC Dist */
-                     <0x0 0x06100000 0 0x100000>; /* GICR (RD_base + SGI_base) */
-               #interrupt-cells = <3>;
-               interrupt-controller;
-               interrupts = <1 9 0x4>;
-       };
-
-       timer {
-               compatible = "arm,armv8-timer";
-               interrupts = <1 13 0x8>, /* Physical Secure PPI, active-low */
-                            <1 14 0x8>, /* Physical Non-Secure PPI, active-low */
-                            <1 11 0x8>, /* Virtual PPI, active-low */
-                            <1 10 0x8>; /* Hypervisor PPI, active-low */
-       };
-
-       serial0: serial@21c0500 {
-               device_type = "serial";
-               compatible = "fsl,ns16550", "ns16550a";
-               reg = <0x0 0x21c0500 0x0 0x100>;
-               clock-frequency = <0>;  /* Updated by bootloader */
-               interrupts = <0 32 0x1>; /* edge triggered */
-       };
-
-       serial1: serial@21c0600 {
-               device_type = "serial";
-               compatible = "fsl,ns16550", "ns16550a";
-               reg = <0x0 0x21c0600 0x0 0x100>;
-               clock-frequency = <0>;  /* Updated by bootloader */
-               interrupts = <0 32 0x1>; /* edge triggered */
-       };
-
-       fsl_mc: fsl-mc@80c000000 {
-               compatible = "fsl,qoriq-mc";
-               reg = <0x00000008 0x0c000000 0 0x40>,    /* MC portal base */
-                     <0x00000000 0x08340000 0 0x40000>; /* MC control reg */
-       };
-};
index fa81a6ee6473e05f2c0f9db102e91bf3170e8bda..cd158b80e29b4e0b66e6d4f071d5b2efd60ef432 100644 (file)
@@ -1,4 +1,4 @@
-dtb-$(CONFIG_ARCH_HISI) += hi6220-hikey.dtb
+dtb-$(CONFIG_ARCH_HISI) += hi6220-hikey.dtb hip05-d02.dtb
 
 always         := $(dtb-y)
 subdir-y       := $(dts-dirs)
index e36a539468a5f35a825ad8f51ea7c510de0ecbdd..8d43a0fce5226946d78fb416037a7175efaa2e66 100644 (file)
        compatible = "hisilicon,hi6220-hikey", "hisilicon,hi6220";
 
        aliases {
-               serial0 = &uart0;
+               serial0 = &uart0; /* On board UART0 */
+               serial1 = &uart1; /* BT UART */
+               serial2 = &uart2; /* LS Expansion UART0 */
+               serial3 = &uart3; /* LS Expansion UART1 */
        };
 
        chosen {
-               stdout-path = "serial0:115200n8";
+               stdout-path = "serial3:115200n8";
        };
 
        memory@0 {
index 3f03380815b6579844ddb0554f1b531252d90b83..82d2488a0e869df4aea7f568d84aa2b29df82e73 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include <dt-bindings/interrupt-controller/arm-gic.h>
+#include <dt-bindings/clock/hi6220-clock.h>
 
 / {
        compatible = "hisilicon,hi6220";
                        compatible = "arm,pl011", "arm,primecell";
                        reg = <0x0 0xf8015000 0x0 0x1000>;
                        interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&ao_ctrl 36>, <&ao_ctrl 36>;
+                       clocks = <&ao_ctrl HI6220_UART0_PCLK>,
+                                <&ao_ctrl HI6220_UART0_PCLK>;
                        clock-names = "uartclk", "apb_pclk";
                };
+
+               uart1: uart@f7111000 {
+                       compatible = "arm,pl011", "arm,primecell";
+                       reg = <0x0 0xf7111000 0x0 0x1000>;
+                       interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&sys_ctrl HI6220_UART1_PCLK>,
+                                <&sys_ctrl HI6220_UART1_PCLK>;
+                       clock-names = "uartclk", "apb_pclk";
+                       status = "disabled";
+               };
+
+               uart2: uart@f7112000 {
+                       compatible = "arm,pl011", "arm,primecell";
+                       reg = <0x0 0xf7112000 0x0 0x1000>;
+                       interrupts = <GIC_SPI 38 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&sys_ctrl HI6220_UART2_PCLK>,
+                                <&sys_ctrl HI6220_UART2_PCLK>;
+                       clock-names = "uartclk", "apb_pclk";
+                       status = "disabled";
+               };
+
+               uart3: uart@f7113000 {
+                       compatible = "arm,pl011", "arm,primecell";
+                       reg = <0x0 0xf7113000 0x0 0x1000>;
+                       interrupts = <GIC_SPI 39 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&sys_ctrl HI6220_UART3_PCLK>,
+                                <&sys_ctrl HI6220_UART3_PCLK>;
+                       clock-names = "uartclk", "apb_pclk";
+               };
+
+               uart4: uart@f7114000 {
+                       compatible = "arm,pl011", "arm,primecell";
+                       reg = <0x0 0xf7114000 0x0 0x1000>;
+                       interrupts = <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&sys_ctrl HI6220_UART4_PCLK>,
+                                <&sys_ctrl HI6220_UART4_PCLK>;
+                       clock-names = "uartclk", "apb_pclk";
+                       status = "disabled";
+               };
        };
 };
diff --git a/arch/arm64/boot/dts/hisilicon/hip05-d02.dts b/arch/arm64/boot/dts/hisilicon/hip05-d02.dts
new file mode 100644 (file)
index 0000000..ae34e25
--- /dev/null
@@ -0,0 +1,36 @@
+/**
+ * dts file for Hisilicon D02 Development Board
+ *
+ * Copyright (C) 2014,2015 Hisilicon Ltd.
+ *
+ * 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
+ * publishhed by the Free Software Foundation.
+ *
+ */
+
+/dts-v1/;
+
+#include "hip05.dtsi"
+
+/ {
+       model = "Hisilicon Hip05 D02 Development Board";
+       compatible = "hisilicon,hip05-d02";
+
+       memory@00000000 {
+               device_type = "memory";
+               reg = <0x0 0x00000000 0x0 0x80000000>;
+       };
+
+       aliases {
+               serial0 = &uart0;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+};
+
+&uart0 {
+       status = "ok";
+};
diff --git a/arch/arm64/boot/dts/hisilicon/hip05.dtsi b/arch/arm64/boot/dts/hisilicon/hip05.dtsi
new file mode 100644 (file)
index 0000000..4ff16d0
--- /dev/null
@@ -0,0 +1,271 @@
+/**
+ * dts file for Hisilicon D02 Development Board
+ *
+ * Copyright (C) 2014,2015 Hisilicon Ltd.
+ *
+ * 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
+ * publishhed by the Free Software Foundation.
+ *
+ */
+
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+
+/ {
+       compatible = "hisilicon,hip05-d02";
+       interrupt-parent = <&gic>;
+       #address-cells = <2>;
+       #size-cells = <2>;
+
+       psci {
+               compatible = "arm,psci-0.2";
+               method = "smc";
+       };
+
+       cpus {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               cpu-map {
+                       cluster0 {
+                               core0 {
+                                       cpu = <&cpu0>;
+                               };
+                               core1 {
+                                       cpu = <&cpu1>;
+                               };
+                               core2 {
+                                       cpu = <&cpu2>;
+                               };
+                               core3 {
+                                       cpu = <&cpu3>;
+                               };
+                       };
+                       cluster1 {
+                               core0 {
+                                       cpu = <&cpu4>;
+                               };
+                               core1 {
+                                       cpu = <&cpu5>;
+                               };
+                               core2 {
+                                       cpu = <&cpu6>;
+                               };
+                               core3 {
+                                       cpu = <&cpu7>;
+                               };
+                       };
+                       cluster2 {
+                               core0 {
+                                       cpu = <&cpu8>;
+                               };
+                               core1 {
+                                       cpu = <&cpu9>;
+                               };
+                               core2 {
+                                       cpu = <&cpu10>;
+                               };
+                               core3 {
+                                       cpu = <&cpu11>;
+                               };
+                       };
+                       cluster3 {
+                               core0 {
+                                       cpu = <&cpu12>;
+                               };
+                               core1 {
+                                       cpu = <&cpu13>;
+                               };
+                               core2 {
+                                       cpu = <&cpu14>;
+                               };
+                               core3 {
+                                       cpu = <&cpu15>;
+                               };
+                       };
+               };
+
+               cpu0: cpu@20000 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a57", "arm,armv8";
+                       reg = <0x20000>;
+                       enable-method = "psci";
+               };
+
+               cpu1: cpu@20001 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a57", "arm,armv8";
+                       reg = <0x20001>;
+                       enable-method = "psci";
+               };
+
+               cpu2: cpu@20002 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a57", "arm,armv8";
+                       reg = <0x20002>;
+                       enable-method = "psci";
+               };
+
+               cpu3: cpu@20003 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a57", "arm,armv8";
+                       reg = <0x20003>;
+                       enable-method = "psci";
+               };
+
+               cpu4: cpu@20100 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a57", "arm,armv8";
+                       reg = <0x20100>;
+                       enable-method = "psci";
+               };
+
+               cpu5: cpu@20101 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a57", "arm,armv8";
+                       reg = <0x20101>;
+                       enable-method = "psci";
+               };
+
+               cpu6: cpu@20102 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a57", "arm,armv8";
+                       reg = <0x20102>;
+                       enable-method = "psci";
+               };
+
+               cpu7: cpu@20103 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a57", "arm,armv8";
+                       reg = <0x20103>;
+                       enable-method = "psci";
+               };
+
+               cpu8: cpu@20200 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a57", "arm,armv8";
+                       reg = <0x20200>;
+                       enable-method = "psci";
+               };
+
+               cpu9: cpu@20201 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a57", "arm,armv8";
+                       reg = <0x20201>;
+                       enable-method = "psci";
+               };
+
+               cpu10: cpu@20202 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a57", "arm,armv8";
+                       reg = <0x20202>;
+                       enable-method = "psci";
+               };
+
+               cpu11: cpu@20203 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a57", "arm,armv8";
+                       reg = <0x20203>;
+                       enable-method = "psci";
+               };
+
+               cpu12: cpu@20300 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a57", "arm,armv8";
+                       reg = <0x20300>;
+                       enable-method = "psci";
+               };
+
+               cpu13: cpu@20301 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a57", "arm,armv8";
+                       reg = <0x20301>;
+                       enable-method = "psci";
+               };
+
+               cpu14: cpu@20302 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a57", "arm,armv8";
+                       reg = <0x20302>;
+                       enable-method = "psci";
+               };
+
+               cpu15: cpu@20303 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a57", "arm,armv8";
+                       reg = <0x20303>;
+                       enable-method = "psci";
+               };
+       };
+
+       gic: interrupt-controller@8d000000 {
+               compatible = "arm,gic-v3";
+                #interrupt-cells = <3>;
+                #address-cells = <2>;
+                #size-cells = <2>;
+                ranges;
+                interrupt-controller;
+                #redistributor-regions = <1>;
+                redistributor-stride = <0x0 0x30000>;
+               reg = <0x0 0x8d000000 0 0x10000>,       /* GICD */
+                     <0x0 0x8d100000 0 0x300000>,      /* GICR */
+                     <0x0 0xfe000000 0 0x10000>,       /* GICC */
+                     <0x0 0xfe010000 0 0x10000>,       /* GICH */
+                     <0x0 0xfe020000 0 0x10000>;       /* GICV */
+               interrupts = <GIC_PPI 9 IRQ_TYPE_LEVEL_HIGH>;
+
+               its_totems: interrupt-controller@8c000000 {
+                       compatible = "arm,gic-v3-its";
+                       msi-controller;
+                       reg = <0x0 0x8c000000 0x0 0x40000>;
+               };
+       };
+
+       timer {
+               compatible = "arm,armv8-timer";
+               interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_LOW>,
+                            <GIC_PPI 14 IRQ_TYPE_LEVEL_LOW>,
+                            <GIC_PPI 11 IRQ_TYPE_LEVEL_LOW>,
+                            <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>;
+       };
+
+       pmu {
+               compatible = "arm,armv8-pmuv3";
+               interrupts = <GIC_PPI 7 IRQ_TYPE_LEVEL_HIGH>;
+       };
+
+       soc {
+               compatible = "simple-bus";
+               #address-cells = <2>;
+               #size-cells = <2>;
+               ranges;
+
+               refclk200mhz: refclk200mhz {
+                       compatible = "fixed-clock";
+                       #clock-cells = <0>;
+                       clock-frequency = <200000000>;
+               };
+
+               uart0: uart@80300000 {
+                       compatible = "snps,dw-apb-uart";
+                       reg = <0x0 0x80300000 0x0 0x10000>;
+                       interrupts = <GIC_SPI 317 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&refclk200mhz>;
+                       clock-names = "apb_pclk";
+                       reg-shift = <2>;
+                       reg-io-width = <4>;
+                       status = "disabled";
+               };
+
+               uart1: uart@80310000 {
+                       compatible = "snps,dw-apb-uart";
+                       reg = <0x0 0x80310000 0x0 0x10000>;
+                       interrupts = <GIC_SPI 318 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&refclk200mhz>;
+                       clock-names = "apb_pclk";
+                       reg-shift = <2>;
+                       reg-io-width = <4>;
+                       status = "disabled";
+               };
+       };
+};
index e2f6afa7f84910da7e371ddec3373fd18ddd4193..348f4db4f3139f4d765253b459382f682a85697b 100644 (file)
@@ -1,4 +1,5 @@
 dtb-$(CONFIG_ARCH_BERLIN) += berlin4ct-dmp.dtb
+dtb-$(CONFIG_ARCH_BERLIN) += berlin4ct-stb.dtb
 
 always         := $(dtb-y)
 subdir-y       := $(dts-dirs)
diff --git a/arch/arm64/boot/dts/marvell/berlin4ct-stb.dts b/arch/arm64/boot/dts/marvell/berlin4ct-stb.dts
new file mode 100644 (file)
index 0000000..348c37e
--- /dev/null
@@ -0,0 +1,66 @@
+/*
+ * Copyright (C) 2015 Marvell Technology Group Ltd.
+ *
+ * Author: Jisheng Zhang <jszhang@marvell.com>
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPLv2 or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This library 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; either version 2 of the
+ *     License, or (at your option) any later version.
+ *
+ *     This library is distributed in the hope that it will be useful,
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ * Or, alternatively,
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use,
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/dts-v1/;
+
+#include "berlin4ct.dtsi"
+
+/ {
+       model = "Marvell BG4CT STB board";
+       compatible = "marvell,berlin4ct-stb", "marvell,berlin4ct", "marvell,berlin";
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       memory {
+               device_type = "memory";
+               /* the first 16MB is for firmwares' usage */
+               reg = <0 0x01000000 0 0x7f000000>;
+       };
+};
+
+&uart0 {
+       status = "okay";
+};
index dd4a10d605d920498c1426bed25b99a8315a74f2..a3b5f1d4a240c59e9d6431ec7f8777532fafc5cb 100644 (file)
                        interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>;
                };
 
+               apb@e80000 {
+                       compatible = "simple-bus";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+
+                       ranges = <0 0xe80000 0x10000>;
+                       interrupt-parent = <&aic>;
+
+                       gpio0: gpio@0400 {
+                               compatible = "snps,dw-apb-gpio";
+                               reg = <0x0400 0x400>;
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               porta: gpio-port@0 {
+                                       compatible = "snps,dw-apb-gpio-port";
+                                       gpio-controller;
+                                       #gpio-cells = <2>;
+                                       snps,nr-gpios = <32>;
+                                       reg = <0>;
+                                       interrupt-controller;
+                                       #interrupt-cells = <2>;
+                                       interrupts = <0>;
+                               };
+                       };
+
+                       gpio1: gpio@0800 {
+                               compatible = "snps,dw-apb-gpio";
+                               reg = <0x0800 0x400>;
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               portb: gpio-port@1 {
+                                       compatible = "snps,dw-apb-gpio-port";
+                                       gpio-controller;
+                                       #gpio-cells = <2>;
+                                       snps,nr-gpios = <32>;
+                                       reg = <0>;
+                                       interrupt-controller;
+                                       #interrupt-cells = <2>;
+                                       interrupts = <1>;
+                               };
+                       };
+
+                       gpio2: gpio@0c00 {
+                               compatible = "snps,dw-apb-gpio";
+                               reg = <0x0c00 0x400>;
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               portc: gpio-port@2 {
+                                       compatible = "snps,dw-apb-gpio-port";
+                                       gpio-controller;
+                                       #gpio-cells = <2>;
+                                       snps,nr-gpios = <32>;
+                                       reg = <0>;
+                                       interrupt-controller;
+                                       #interrupt-cells = <2>;
+                                       interrupts = <2>;
+                               };
+                       };
+
+                       gpio3: gpio@1000 {
+                               compatible = "snps,dw-apb-gpio";
+                               reg = <0x1000 0x400>;
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               portd: gpio-port@3 {
+                                       compatible = "snps,dw-apb-gpio-port";
+                                       gpio-controller;
+                                       #gpio-cells = <2>;
+                                       snps,nr-gpios = <32>;
+                                       reg = <0>;
+                                       interrupt-controller;
+                                       #interrupt-cells = <2>;
+                                       interrupts = <3>;
+                               };
+                       };
+
+                       aic: interrupt-controller@3800 {
+                               compatible = "snps,dw-apb-ictl";
+                               reg = <0x3800 0x30>;
+                               interrupt-controller;
+                               #interrupt-cells = <1>;
+                               interrupt-parent = <&gic>;
+                               interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>;
+                       };
+               };
+
                apb@fc0000 {
                        compatible = "simple-bus";
                        #address-cells = <1>;
                                interrupts = <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>;
                        };
 
+                       sm_gpio0: gpio@8000 {
+                               compatible = "snps,dw-apb-gpio";
+                               reg = <0x8000 0x400>;
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               porte: gpio-port@4 {
+                                       compatible = "snps,dw-apb-gpio-port";
+                                       gpio-controller;
+                                       #gpio-cells = <2>;
+                                       snps,nr-gpios = <32>;
+                                       reg = <0>;
+                               };
+                       };
+
+                       sm_gpio1: gpio@9000 {
+                               compatible = "snps,dw-apb-gpio";
+                               reg = <0x9000 0x400>;
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               portf: gpio-port@5 {
+                                       compatible = "snps,dw-apb-gpio-port";
+                                       gpio-controller;
+                                       #gpio-cells = <2>;
+                                       snps,nr-gpios = <32>;
+                                       reg = <0>;
+                               };
+                       };
+
                        uart0: uart@d000 {
                                compatible = "snps,dw-apb-uart";
                                reg = <0xd000 0x100>;
index 4be66cadbc7c19220bafe8bba7e7a9eb1df80fc3..811cb760ba49dd4e4d53140d362a47ddf8121ced 100644 (file)
        };
 };
 
+&pio {
+       spi_pins_a: spi0 {
+               pins_spi {
+                       pinmux = <MT8173_PIN_69_SPI_CK__FUNC_SPI_CK_0_>,
+                               <MT8173_PIN_70_SPI_MI__FUNC_SPI_MI_0_>,
+                               <MT8173_PIN_71_SPI_MO__FUNC_SPI_MO_0_>,
+                               <MT8173_PIN_72_SPI_CS__FUNC_SPI_CS_0_>;
+               };
+       };
+};
+
+&spi {
+       pinctrl-names = "default";
+       pinctrl-0 = <&spi_pins_a>;
+       mediatek,pad-select = <0>;
+       status = "okay";
+};
+
 &uart0 {
        status = "okay";
 };
index 06a15644be38439e63dfee78f59f2f720921c24e..4dd5f93d0303f9302e80f171ed9bfbeff8bb994b 100644 (file)
                clock-output-names = "clk32k";
        };
 
+       cpum_ck: oscillator@2 {
+               compatible = "fixed-clock";
+               #clock-cells = <0>;
+               clock-frequency = <0>;
+               clock-output-names = "cpum_ck";
+       };
+
        timer {
                compatible = "arm,armv8-timer";
                interrupt-parent = <&gic>;
                        #power-domain-cells = <1>;
                        reg = <0 0x10006000 0 0x1000>;
                        clocks = <&clk26m>,
-                                <&topckgen CLK_TOP_MM_SEL>;
-                       clock-names = "mfg", "mm";
+                                <&topckgen CLK_TOP_MM_SEL>,
+                                <&topckgen CLK_TOP_VENC_SEL>,
+                                <&topckgen CLK_TOP_VENC_LT_SEL>;
+                       clock-names = "mfg", "mm", "venc", "venc_lt";
                        infracfg = <&infracfg>;
                };
 
                        status = "disabled";
                };
 
-               i2c3: i2c3@11010000 {
+               spi: spi@1100a000 {
+                       compatible = "mediatek,mt8173-spi";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <0 0x1100a000 0 0x1000>;
+                       interrupts = <GIC_SPI 110 IRQ_TYPE_LEVEL_LOW>;
+                       clocks = <&topckgen CLK_TOP_SYSPLL3_D2>,
+                                <&topckgen CLK_TOP_SPI_SEL>,
+                                <&pericfg CLK_PERI_SPI0>;
+                       clock-names = "parent-clk", "sel-clk", "spi-clk";
+                       status = "disabled";
+               };
+
+               i2c3: i2c@11010000 {
                        compatible = "mediatek,mt8173-i2c";
                        reg = <0 0x11010000 0 0x70>,
                              <0 0x11000280 0 0x80>;
                        status = "disabled";
                };
 
-               i2c4: i2c4@11011000 {
+               i2c4: i2c@11011000 {
                        compatible = "mediatek,mt8173-i2c";
                        reg = <0 0x11011000 0 0x70>,
                              <0 0x11000300 0 0x80>;
                        status = "disabled";
                };
 
-               i2c6: i2c6@11013000 {
+               i2c6: i2c@11013000 {
                        compatible = "mediatek,mt8173-i2c";
                        reg = <0 0x11013000 0 0x70>,
                              <0 0x11000080 0 0x80>;
                        clock-names = "source", "hclk";
                        status = "disabled";
                };
+
+               mmsys: clock-controller@14000000 {
+                       compatible = "mediatek,mt8173-mmsys", "syscon";
+                       reg = <0 0x14000000 0 0x1000>;
+                       #clock-cells = <1>;
+               };
+
+               imgsys: clock-controller@15000000 {
+                       compatible = "mediatek,mt8173-imgsys", "syscon";
+                       reg = <0 0x15000000 0 0x1000>;
+                       #clock-cells = <1>;
+               };
+
+               vdecsys: clock-controller@16000000 {
+                       compatible = "mediatek,mt8173-vdecsys", "syscon";
+                       reg = <0 0x16000000 0 0x1000>;
+                       #clock-cells = <1>;
+               };
+
+               vencsys: clock-controller@18000000 {
+                       compatible = "mediatek,mt8173-vencsys", "syscon";
+                       reg = <0 0x18000000 0 0x1000>;
+                       #clock-cells = <1>;
+               };
+
+               vencltsys: clock-controller@19000000 {
+                       compatible = "mediatek,mt8173-vencltsys", "syscon";
+                       reg = <0 0x19000000 0 0x1000>;
+                       #clock-cells = <1>;
+               };
        };
 };
 
index 66804ffbc6d29724f2bc5a83a869042ad7159f15..6b8abbe6874622ffe7d3a28b7b71041959b90418 100644 (file)
@@ -19,6 +19,7 @@
 / {
        aliases {
                serial0 = &blsp1_uart2;
+               serial1 = &blsp1_uart1;
        };
 
        chosen {
                        pinctrl-1 = <&blsp1_uart2_sleep>;
                };
 
+               i2c@78b6000 {
+               /* On Low speed expansion */
+                       status = "okay";
+               };
+
+               i2c@78b8000 {
+               /* On High speed expansion */
+                       status = "okay";
+               };
+
+               i2c@78ba000 {
+               /* On Low speed expansion */
+                       status = "okay";
+               };
+
+               spi@78b7000 {
+               /* On High speed expansion */
+                       status = "okay";
+               };
+
+               spi@78b9000 {
+               /* On Low speed expansion */
+                       status = "okay";
+               };
+
                leds {
                        pinctrl-names = "default";
                        pinctrl-0 = <&msmgpio_leds>,
                };
        };
 };
+
+&sdhc_1 {
+       status = "okay";
+};
index 568956859088c168573b1306ae4808a6de275e41..49ec55a376140d406873607c6e6a3dcbfc9633e2 100644 (file)
 
 &msmgpio {
 
+       blsp1_uart1_default: blsp1_uart1_default {
+               pinmux {
+                       function = "blsp_uart1";
+                       pins = "gpio0", "gpio1";
+               };
+               pinconf {
+                       pins = "gpio0", "gpio1";
+                       drive-strength = <16>;
+                       bias-disable;
+               };
+       };
+
+       blsp1_uart1_sleep: blsp1_uart1_sleep {
+               pinmux {
+                       function = "gpio";
+                       pins = "gpio0", "gpio1";
+               };
+               pinconf {
+                       pins = "gpio0", "gpio1";
+                       drive-strength = <2>;
+                       bias-pull-down;
+               };
+       };
+
        blsp1_uart2_default: blsp1_uart2_default {
                pinmux {
                        function = "blsp_uart2";
@@ -27,7 +51,7 @@
 
        blsp1_uart2_sleep: blsp1_uart2_sleep {
                pinmux {
-                       function = "blsp_uart2";
+                       function = "gpio";
                        pins = "gpio4", "gpio5";
                };
                pinconf {
                };
        };
 
+       i2c2_default: i2c2_default {
+               pinmux {
+                       function = "blsp_i2c2";
+                       pins = "gpio6", "gpio7";
+               };
+               pinconf {
+                       pins = "gpio6", "gpio7";
+                       drive-strength = <2>;
+                       bias-disable = <0>;
+               };
+       };
+
+       i2c2_sleep: i2c2_sleep {
+               pinmux {
+                       function = "gpio";
+                       pins = "gpio6", "gpio7";
+               };
+               pinconf {
+                       pins = "gpio6", "gpio7";
+                       drive-strength = <2>;
+                       bias-disable = <0>;
+               };
+       };
+
        i2c4_default: i2c4_default {
                pinmux {
                        function = "blsp_i2c4";
 
        i2c4_sleep: i2c4_sleep {
                pinmux {
-                       function = "blsp_i2c4";
+                       function = "gpio";
                        pins = "gpio14", "gpio15";
                };
                pinconf {
                };
        };
 
+       i2c6_default: i2c6_default {
+               pinmux {
+                       function = "blsp_i2c6";
+                       pins = "gpio22", "gpio23";
+               };
+               pinconf {
+                       pins = "gpio22", "gpio23";
+                       drive-strength = <2>;
+                       bias-disable = <0>;
+               };
+       };
+
+       i2c6_sleep: i2c6_sleep {
+               pinmux {
+                       function = "gpio";
+                       pins = "gpio22", "gpio23";
+               };
+               pinconf {
+                       pins = "gpio22", "gpio23";
+                       drive-strength = <2>;
+                       bias-disable = <0>;
+               };
+       };
+
        sdhc2_cd_pin {
                sdc2_cd_on: cd_on {
                        pinmux {
index 5911de008dd5010da246c809c0252babcd606ab3..8d184ff196429f2d7300d4f03a4edde343235b5b 100644 (file)
                        compatible = "qcom,gcc-msm8916";
                        #clock-cells = <1>;
                        #reset-cells = <1>;
+                       #power-domain-cells = <1>;
                        reg = <0x1800000 0x80000>;
                };
 
+               blsp1_uart1: serial@78af000 {
+                       compatible = "qcom,msm-uartdm-v1.4", "qcom,msm-uartdm";
+                       reg = <0x78af000 0x200>;
+                       interrupts = <GIC_SPI 107 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&gcc GCC_BLSP1_UART1_APPS_CLK>, <&gcc GCC_BLSP1_AHB_CLK>;
+                       clock-names = "core", "iface";
+                       status = "disabled";
+               };
+
                blsp1_uart2: serial@78b0000 {
                        compatible = "qcom,msm-uartdm-v1.4", "qcom,msm-uartdm";
                        reg = <0x78b0000 0x200>;
                        status = "disabled";
                };
 
+               blsp_i2c2: i2c@78b6000 {
+                       compatible = "qcom,i2c-qup-v2.2.1";
+                       reg = <0x78b6000 0x1000>;
+                       interrupts = <GIC_SPI 96 0>;
+                       clocks = <&gcc GCC_BLSP1_AHB_CLK>,
+                               <&gcc GCC_BLSP1_QUP2_I2C_APPS_CLK>;
+                       clock-names = "iface", "core";
+                       pinctrl-names = "default", "sleep";
+                       pinctrl-0 = <&i2c2_default>;
+                       pinctrl-1 = <&i2c2_sleep>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       status = "disabled";
+               };
+
                blsp_i2c4: i2c@78b8000 {
                        compatible = "qcom,i2c-qup-v2.2.1";
                        reg = <0x78b8000 0x1000>;
                        status = "disabled";
                };
 
+               blsp_i2c6: i2c@78ba000 {
+                       compatible = "qcom,i2c-qup-v2.2.1";
+                       reg = <0x78ba000 0x1000>;
+                       interrupts = <GIC_SPI 100 0>;
+                       clocks = <&gcc GCC_BLSP1_AHB_CLK>,
+                               <&gcc GCC_BLSP1_QUP6_I2C_APPS_CLK>;
+                       clock-names = "iface", "core";
+                       pinctrl-names = "default", "sleep";
+                       pinctrl-0 = <&i2c6_default>;
+                       pinctrl-1 = <&i2c6_sleep>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       status = "disabled";
+               };
+
                sdhc_1: sdhci@07824000 {
                        compatible = "qcom,sdhci-msm-v4";
                        reg = <0x07824900 0x11c>, <0x07824000 0x800>;
                        interrupt-controller;
                        #interrupt-cells = <4>;
                };
+
+               rng@22000 {
+                       compatible = "qcom,prng";
+                       reg = <0x00022000 0x200>;
+                       clocks = <&gcc GCC_PRNG_AHB_CLK>;
+                       clock-names = "core";
+               };
        };
 };
 
index 5f760347aee2d240614ae61cb284e4c08396f5bc..2f71f9cdd39c90be282b09d44bb0e795ab0181c6 100644 (file)
@@ -34,11 +34,12 @@ CONFIG_MODULE_UNLOAD=y
 CONFIG_ARCH_BCM_IPROC=y
 CONFIG_ARCH_BERLIN=y
 CONFIG_ARCH_EXYNOS7=y
-CONFIG_ARCH_FSL_LS2085A=y
+CONFIG_ARCH_LAYERSCAPE=y
 CONFIG_ARCH_HISI=y
 CONFIG_ARCH_MEDIATEK=y
 CONFIG_ARCH_ROCKCHIP=y
 CONFIG_ARCH_SEATTLE=y
+CONFIG_ARCH_STRATIX10=y
 CONFIG_ARCH_TEGRA=y
 CONFIG_ARCH_TEGRA_132_SOC=y
 CONFIG_ARCH_QCOM=y
@@ -49,6 +50,7 @@ CONFIG_ARCH_XGENE=y
 CONFIG_ARCH_ZYNQMP=y
 CONFIG_PCI=y
 CONFIG_PCI_MSI=y
+CONFIG_PCI_HOST_GENERIC=y
 CONFIG_PCI_XGENE=y
 CONFIG_SMP=y
 CONFIG_SCHED_MC=y
@@ -121,8 +123,11 @@ CONFIG_SERIAL_XILINX_PS_UART=y
 CONFIG_SERIAL_XILINX_PS_UART_CONSOLE=y
 CONFIG_VIRTIO_CONSOLE=y
 # CONFIG_HW_RANDOM is not set
+CONFIG_I2C=y
+CONFIG_I2C_QUP=y
 CONFIG_SPI=y
 CONFIG_SPI_PL022=y
+CONFIG_SPI_QUP=y
 CONFIG_PINCTRL_MSM8916=y
 CONFIG_GPIO_PL061=y
 CONFIG_GPIO_XGENE=y
@@ -131,6 +136,7 @@ CONFIG_POWER_RESET_SYSCON=y
 # CONFIG_HWMON is not set
 CONFIG_REGULATOR=y
 CONFIG_REGULATOR_FIXED_VOLTAGE=y
+CONFIG_REGULATOR_QCOM_SMD_RPM=y
 CONFIG_FB=y
 CONFIG_FB_ARMCLCD=y
 CONFIG_FRAMEBUFFER_CONSOLE=y
@@ -163,12 +169,18 @@ CONFIG_LEDS_TRIGGER_CPU=y
 CONFIG_RTC_CLASS=y
 CONFIG_RTC_DRV_EFI=y
 CONFIG_RTC_DRV_XGENE=y
+CONFIG_DMADEVICES=y
+CONFIG_QCOM_BAM_DMA=y
 CONFIG_VIRTIO_PCI=y
 CONFIG_VIRTIO_BALLOON=y
 CONFIG_VIRTIO_MMIO=y
 CONFIG_COMMON_CLK_QCOM=y
 CONFIG_MSM_GCC_8916=y
+CONFIG_HWSPINLOCK_QCOM=y
 # CONFIG_IOMMU_SUPPORT is not set
+CONFIG_QCOM_SMEM=y
+CONFIG_QCOM_SMD=y
+CONFIG_QCOM_SMD_RPM=y
 CONFIG_PHY_XGENE=y
 CONFIG_EXT2_FS=y
 CONFIG_EXT3_FS=y
index aa94a88f6279963ae7ef0c6477215894859c9aff..f67f35b6edb12e4d34e1db17750b07a0bec72e39 100644 (file)
 #include <asm/smp_plat.h>
 #include <asm/suspend.h>
 
-static bool psci_power_state_loses_context(u32 state)
-{
-       return state & PSCI_0_2_POWER_STATE_TYPE_MASK;
-}
-
-static bool psci_power_state_is_valid(u32 state)
-{
-       const u32 valid_mask = PSCI_0_2_POWER_STATE_ID_MASK |
-                              PSCI_0_2_POWER_STATE_TYPE_MASK |
-                              PSCI_0_2_POWER_STATE_AFFL_MASK;
-
-       return !(state & ~valid_mask);
-}
-
 static DEFINE_PER_CPU_READ_MOSTLY(u32 *, psci_power_state);
 
 static int __maybe_unused cpu_psci_cpu_init_idle(unsigned int cpu)
index f2a00c591bf792162ff69eaebf60c04f4d0d1669..e9110b9b8bcdec50ec26ef974557447ebadb213a 100644 (file)
@@ -59,7 +59,7 @@ struct nfhd_device {
        struct gendisk *disk;
 };
 
-static void nfhd_make_request(struct request_queue *queue, struct bio *bio)
+static blk_qc_t nfhd_make_request(struct request_queue *queue, struct bio *bio)
 {
        struct nfhd_device *dev = queue->queuedata;
        struct bio_vec bvec;
@@ -77,6 +77,7 @@ static void nfhd_make_request(struct request_queue *queue, struct bio *bio)
                sec += len;
        }
        bio_endio(bio);
+       return BLK_QC_T_NONE;
 }
 
 static int nfhd_getgeo(struct block_device *bdev, struct hd_geometry *geo)
index ad6bd0edbc3bf8a43a3796f1c11eb49e8a7ec0b9..6ac6d4a051ddd6ad812571080b1c7c1f8f9e8a6d 100644 (file)
@@ -6,8 +6,12 @@ extern void irq_ctx_init(int cpu);
 extern void irq_ctx_exit(int cpu);
 # define __ARCH_HAS_DO_SOFTIRQ
 #else
-# define irq_ctx_init(cpu) do { } while (0)
-# define irq_ctx_exit(cpu) do { } while (0)
+static inline void irq_ctx_init(int cpu)
+{
+}
+static inline void irq_ctx_exit(int cpu)
+{
+}
 #endif
 
 void tbi_startup_interrupt(int);
index ac3a199e33e714d772f688b7f9620cb964d29a0f..c3c6f086488169cc06e53b1eb6eb07ea6b2e68ee 100644 (file)
@@ -312,6 +312,7 @@ void cpu_die(void)
 {
        local_irq_disable();
        idle_task_exit();
+       irq_ctx_exit(smp_processor_id());
 
        (void)cpu_report_death();
 
@@ -366,6 +367,7 @@ asmlinkage void secondary_start_kernel(void)
                panic("No TBI found!");
 
        per_cpu_trap_init(cpu);
+       irq_ctx_init(cpu);
 
        preempt_disable();
 
index d2b79bc336c1036885a289ab227319ef0e6eb81f..7a399b4d60a03a5a83d091113cfb257c45f92b39 100644 (file)
@@ -103,7 +103,7 @@ axon_ram_irq_handler(int irq, void *dev)
  * axon_ram_make_request - make_request() method for block device
  * @queue, @bio: see blk_queue_make_request()
  */
-static void
+static blk_qc_t
 axon_ram_make_request(struct request_queue *queue, struct bio *bio)
 {
        struct axon_ram_bank *bank = bio->bi_bdev->bd_disk->private_data;
@@ -120,7 +120,7 @@ axon_ram_make_request(struct request_queue *queue, struct bio *bio)
        bio_for_each_segment(vec, bio, iter) {
                if (unlikely(phys_mem + vec.bv_len > phys_end)) {
                        bio_io_error(bio);
-                       return;
+                       return BLK_QC_T_NONE;
                }
 
                user_mem = page_address(vec.bv_page) + vec.bv_offset;
@@ -133,6 +133,7 @@ axon_ram_make_request(struct request_queue *queue, struct bio *bio)
                transfered += vec.bv_len;
        }
        bio_endio(bio);
+       return BLK_QC_T_NONE;
 }
 
 /**
index e3abe6f3156d3fbacca4003c072954619c7e1bb1..25ed4098640eecf5fc23ae5a8a494b7275badb4a 100644 (file)
@@ -131,7 +131,7 @@ export LDS_ELF_FORMAT := $(ELF_FORMAT)
 # The wrappers will select whether using "malloc" or the kernel allocator.
 LINK_WRAPS = -Wl,--wrap,malloc -Wl,--wrap,free -Wl,--wrap,calloc
 
-LD_FLAGS_CMDLINE = $(foreach opt,$(LDFLAGS),-Wl,$(opt))
+LD_FLAGS_CMDLINE = $(foreach opt,$(LDFLAGS),-Wl,$(opt)) -lrt
 
 # Used by link-vmlinux.sh which has special support for um link
 export CFLAGS_vmlinux := $(LINK-y) $(LINK_WRAPS) $(LD_FLAGS_CMDLINE)
index f70dd540655de57bdcddf8c0e2ab1fc6e0e611ba..9ef669d24bb22098f42ca8bd5253616a54647151 100644 (file)
@@ -388,7 +388,7 @@ static const struct net_device_ops uml_netdev_ops = {
 static int driver_registered;
 
 static void eth_configure(int n, void *init, char *mac,
-                         struct transport *transport)
+                         struct transport *transport, gfp_t gfp_mask)
 {
        struct uml_net *device;
        struct net_device *dev;
@@ -397,7 +397,7 @@ static void eth_configure(int n, void *init, char *mac,
 
        size = transport->private_size + sizeof(struct uml_net_private);
 
-       device = kzalloc(sizeof(*device), GFP_KERNEL);
+       device = kzalloc(sizeof(*device), gfp_mask);
        if (device == NULL) {
                printk(KERN_ERR "eth_configure failed to allocate struct "
                       "uml_net\n");
@@ -568,7 +568,7 @@ static LIST_HEAD(transports);
 static LIST_HEAD(eth_cmd_line);
 
 static int check_transport(struct transport *transport, char *eth, int n,
-                          void **init_out, char **mac_out)
+                          void **init_out, char **mac_out, gfp_t gfp_mask)
 {
        int len;
 
@@ -582,7 +582,7 @@ static int check_transport(struct transport *transport, char *eth, int n,
        else if (*eth != '\0')
                return 0;
 
-       *init_out = kmalloc(transport->setup_size, GFP_KERNEL);
+       *init_out = kmalloc(transport->setup_size, gfp_mask);
        if (*init_out == NULL)
                return 1;
 
@@ -609,11 +609,11 @@ void register_transport(struct transport *new)
        list_for_each_safe(ele, next, &eth_cmd_line) {
                eth = list_entry(ele, struct eth_init, list);
                match = check_transport(new, eth->init, eth->index, &init,
-                                       &mac);
+                                       &mac, GFP_KERNEL);
                if (!match)
                        continue;
                else if (init != NULL) {
-                       eth_configure(eth->index, init, mac, new);
+                       eth_configure(eth->index, init, mac, new, GFP_KERNEL);
                        kfree(init);
                }
                list_del(&eth->list);
@@ -631,10 +631,11 @@ static int eth_setup_common(char *str, int index)
        spin_lock(&transports_lock);
        list_for_each(ele, &transports) {
                transport = list_entry(ele, struct transport, list);
-               if (!check_transport(transport, str, index, &init, &mac))
+               if (!check_transport(transport, str, index, &init,
+                                       &mac, GFP_ATOMIC))
                        continue;
                if (init != NULL) {
-                       eth_configure(index, init, mac, transport);
+                       eth_configure(index, init, mac, transport, GFP_ATOMIC);
                        kfree(init);
                }
                found = 1;
index 2966adbbdf6c954650c7327c77060c18deae797f..5ab20620fc977e7b1be8b2f5359c7012c89b8225 100644 (file)
@@ -27,6 +27,8 @@ struct pt_regs {
 
 #define instruction_pointer(regs) PT_REGS_IP(regs)
 
+#define PTRACE_OLDSETOPTIONS 21
+
 struct task_struct;
 
 extern long subarch_ptrace(struct task_struct *child, long request,
index ad3fa3ae6d3436616029f1009723acae46c9f3fc..868e6c3f83dd2f7f1b50f7c16fe2ec71bfb026f4 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * Copyright (C) 2015 Anton Ivanov (aivanov@{brocade.com,kot-begemot.co.uk})
+ * Copyright (C) 2015 Thomas Meyer (thomas@m3y3r.de)
  * Copyright (C) 2002 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
  * Licensed under the GPL
  */
@@ -183,6 +185,7 @@ extern int create_mem_file(unsigned long long len);
 /* process.c */
 extern unsigned long os_process_pc(int pid);
 extern int os_process_parent(int pid);
+extern void os_alarm_process(int pid);
 extern void os_stop_process(int pid);
 extern void os_kill_process(int pid, int reap_child);
 extern void os_kill_ptraced_process(int pid, int reap_child);
@@ -217,7 +220,7 @@ extern int set_umid(char *name);
 extern char *get_umid(void);
 
 /* signal.c */
-extern void timer_init(void);
+extern void timer_set_signal_handler(void);
 extern void set_sigstack(void *sig_stack, int size);
 extern void remove_sigstack(void);
 extern void set_handler(int sig);
@@ -227,6 +230,7 @@ extern void unblock_signals(void);
 extern int get_signals(void);
 extern int set_signals(int enable);
 extern int os_is_signal_stack(void);
+extern void deliver_alarm(void);
 
 /* util.c */
 extern void stack_protections(unsigned long address);
@@ -238,12 +242,16 @@ extern void um_early_printk(const char *s, unsigned int n);
 extern void os_fix_helper_signals(void);
 
 /* time.c */
-extern void idle_sleep(unsigned long long nsecs);
-extern int set_interval(void);
-extern int timer_one_shot(int ticks);
-extern long long disable_timer(void);
+extern void os_idle_sleep(unsigned long long nsecs);
+extern int os_timer_create(void* timer);
+extern int os_timer_set_interval(void* timer, void* its);
+extern int os_timer_one_shot(int ticks);
+extern long long os_timer_disable(void);
+extern long os_timer_remain(void* timer);
 extern void uml_idle_timer(void);
+extern long long os_persistent_clock_emulation(void);
 extern long long os_nsecs(void);
+extern long long os_vnsecs(void);
 
 /* skas/mem.c */
 extern long run_syscall_stub(struct mm_id * mm_idp,
@@ -274,6 +282,7 @@ extern void initial_thread_cb_skas(void (*proc)(void *),
                                 void *arg);
 extern void halt_skas(void);
 extern void reboot_skas(void);
+extern int get_syscall(struct uml_pt_regs *regs);
 
 /* irq.c */
 extern int os_waiting_for_events(struct irq_fd *active_fds);
index f6ed92c3727da982cbbcc75802abb4c2cc9c9ff7..a9deece956bf4b43f1a864ba2f223f4b463c1815 100644 (file)
@@ -1,4 +1,6 @@
 /*
+
+ * Copyright (C) 2015 Thomas Meyer (thomas@m3y3r.de)
  * Copyright (C) 2005 Jeff Dike (jdike@karaya.com)
  * Licensed under the GPL
  */
@@ -6,12 +8,11 @@
 #ifndef __STUB_DATA_H
 #define __STUB_DATA_H
 
-#include <sys/time.h>
+#include <time.h>
 
 struct stub_data {
-       long offset;
+       unsigned long offset;
        int fd;
-       struct itimerval timer;
        long err;
 };
 
diff --git a/arch/um/include/shared/timer-internal.h b/arch/um/include/shared/timer-internal.h
new file mode 100644 (file)
index 0000000..03e6f21
--- /dev/null
@@ -0,0 +1,13 @@
+/*
+ * Copyright (C) 2012 - 2014 Cisco Systems
+ * Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
+ * Licensed under the GPL
+ */
+
+#ifndef __TIMER_INTERNAL_H__
+#define __TIMER_INTERNAL_H__
+
+#define TIMER_MULTIPLIER 256
+#define TIMER_MIN_DELTA  500
+
+#endif
index a6d922672b9f36b5f6e9d07a959c48e2751dcab5..48af59aae129d088cd6c074d39e167cbf871417a 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * Copyright (C) 2015 Anton Ivanov (aivanov@{brocade.com,kot-begemot.co.uk})
+ * Copyright (C) 2015 Thomas Meyer (thomas@m3y3r.de)
  * Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
  * Copyright 2003 PathScale, Inc.
  * Licensed under the GPL
@@ -27,6 +29,7 @@
 #include <kern_util.h>
 #include <os.h>
 #include <skas.h>
+#include <timer-internal.h>
 
 /*
  * This is a per-cpu array.  A processor only modifies its entry and it only
@@ -203,11 +206,8 @@ void initial_thread_cb(void (*proc)(void *), void *arg)
 
 void arch_cpu_idle(void)
 {
-       unsigned long long nsecs;
-
        cpu_tasks[current_thread_info()->cpu].pid = os_getpid();
-       nsecs = disable_timer();
-       idle_sleep(nsecs);
+       os_idle_sleep(UM_NSEC_PER_SEC);
        local_irq_enable();
 }
 
index 289771dadf81f9343816e6c81176a626a52a8dbb..0f25d41b1031b828912bc9bfaa650096e9985f68 100644 (file)
@@ -1,4 +1,5 @@
 /*
+ * Copyright (C) 2015 Thomas Meyer (thomas@m3y3r.de)
  * Copyright (C) 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
  * Licensed under the GPL
  */
@@ -35,11 +36,6 @@ stub_clone_handler(void)
        if (err)
                goto out;
 
-       err = stub_syscall3(__NR_setitimer, ITIMER_VIRTUAL,
-                           (long) &data->timer, 0);
-       if (err)
-               goto out;
-
        remap_stack(data->fd, data->offset);
        goto done;
 
index fda1deba17571b4effca3dd8dfed5f2003fbf612..9591a66aa5c513b5fe8773e2b21634c19b3758ed 100644 (file)
@@ -1,4 +1,5 @@
 /*
+ * Copyright (C) 2015 Thomas Meyer (thomas@m3y3r.de)
  * Copyright (C) 2002 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
  * Licensed under the GPL
  */
@@ -61,10 +62,12 @@ int init_new_context(struct task_struct *task, struct mm_struct *mm)
        if (current->mm != NULL && current->mm != &init_mm)
                from_mm = &current->mm->context;
 
+       block_signals();
        if (from_mm)
                to_mm->id.u.pid = copy_context_skas0(stack,
                                                     from_mm->id.u.pid);
        else to_mm->id.u.pid = start_userspace(stack);
+       unblock_signals();
 
        if (to_mm->id.u.pid < 0) {
                ret = to_mm->id.u.pid;
index d9ec0068b623e573854089b13718042df8b73852..1683b8efdfdafe916c2768457e68f2dd5fd5b2d0 100644 (file)
@@ -8,9 +8,7 @@
 #include <kern_util.h>
 #include <sysdep/ptrace.h>
 #include <sysdep/syscalls.h>
-
-extern int syscall_table_size;
-#define NR_SYSCALLS (syscall_table_size / sizeof(void *))
+#include <os.h>
 
 void handle_syscall(struct uml_pt_regs *r)
 {
@@ -23,19 +21,12 @@ void handle_syscall(struct uml_pt_regs *r)
                goto out;
        }
 
-       /*
-        * This should go in the declaration of syscall, but when I do that,
-        * strace -f -c bash -c 'ls ; ls' breaks, sometimes not tracing
-        * children at all, sometimes hanging when bash doesn't see the first
-        * ls exit.
-        * The assembly looks functionally the same to me.  This is
-        *     gcc version 4.0.1 20050727 (Red Hat 4.0.1-5)
-        * in case it's a compiler bug.
-        */
-       syscall = UPT_SYSCALL_NR(r);
-       if ((syscall >= NR_SYSCALLS) || (syscall < 0))
+       syscall = get_syscall(r);
+
+       if ((syscall > __NR_syscall_max) || syscall < 0)
                result = -ENOSYS;
-       else result = EXECUTE_SYSCALL(syscall, regs);
+       else
+               result = EXECUTE_SYSCALL(syscall, regs);
 
 out:
        PT_REGS_SET_SYSCALL_RETURN(regs, result);
index 5af441efb37754fb7c76483c37e8aa50eb1d0848..25c23666d5924836c1ab19a95cbdefa1c70e7ab1 100644 (file)
@@ -1,4 +1,7 @@
 /*
+ * Copyright (C) 2015 Anton Ivanov (aivanov@{brocade.com,kot-begemot.co.uk})
+ * Copyright (C) 2015 Thomas Meyer (thomas@m3y3r.de)
+ * Copyright (C) 2012-2014 Cisco Systems
  * Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
  * Licensed under the GPL
  */
 #include <linux/init.h>
 #include <linux/interrupt.h>
 #include <linux/jiffies.h>
+#include <linux/mm.h>
+#include <linux/sched.h>
+#include <linux/spinlock.h>
 #include <linux/threads.h>
 #include <asm/irq.h>
 #include <asm/param.h>
 #include <kern_util.h>
 #include <os.h>
+#include <timer-internal.h>
 
 void timer_handler(int sig, struct siginfo *unused_si, struct uml_pt_regs *regs)
 {
@@ -24,81 +31,97 @@ void timer_handler(int sig, struct siginfo *unused_si, struct uml_pt_regs *regs)
 
 static int itimer_shutdown(struct clock_event_device *evt)
 {
-       disable_timer();
+       os_timer_disable();
        return 0;
 }
 
 static int itimer_set_periodic(struct clock_event_device *evt)
 {
-       set_interval();
+       os_timer_set_interval(NULL, NULL);
        return 0;
 }
 
 static int itimer_next_event(unsigned long delta,
                             struct clock_event_device *evt)
 {
-       return timer_one_shot(delta + 1);
+       return os_timer_one_shot(delta);
 }
 
-static struct clock_event_device itimer_clockevent = {
-       .name                   = "itimer",
+static int itimer_one_shot(struct clock_event_device *evt)
+{
+       os_timer_one_shot(1);
+       return 0;
+}
+
+static struct clock_event_device timer_clockevent = {
+       .name                   = "posix-timer",
        .rating                 = 250,
        .cpumask                = cpu_all_mask,
        .features               = CLOCK_EVT_FEAT_PERIODIC |
                                  CLOCK_EVT_FEAT_ONESHOT,
        .set_state_shutdown     = itimer_shutdown,
        .set_state_periodic     = itimer_set_periodic,
-       .set_state_oneshot      = itimer_shutdown,
+       .set_state_oneshot      = itimer_one_shot,
        .set_next_event         = itimer_next_event,
-       .shift                  = 32,
+       .shift                  = 0,
+       .max_delta_ns           = 0xffffffff,
+       .min_delta_ns           = TIMER_MIN_DELTA, //microsecond resolution should be enough for anyone, same as 640K RAM
        .irq                    = 0,
+       .mult                   = 1,
 };
 
 static irqreturn_t um_timer(int irq, void *dev)
 {
-       (*itimer_clockevent.event_handler)(&itimer_clockevent);
+       if (get_current()->mm != NULL)
+       {
+        /* userspace - relay signal, results in correct userspace timers */
+               os_alarm_process(get_current()->mm->context.id.u.pid);
+       }
+
+       (*timer_clockevent.event_handler)(&timer_clockevent);
 
        return IRQ_HANDLED;
 }
 
-static cycle_t itimer_read(struct clocksource *cs)
+static cycle_t timer_read(struct clocksource *cs)
 {
-       return os_nsecs() / 1000;
+       return os_nsecs() / TIMER_MULTIPLIER;
 }
 
-static struct clocksource itimer_clocksource = {
-       .name           = "itimer",
+static struct clocksource timer_clocksource = {
+       .name           = "timer",
        .rating         = 300,
-       .read           = itimer_read,
+       .read           = timer_read,
        .mask           = CLOCKSOURCE_MASK(64),
        .flags          = CLOCK_SOURCE_IS_CONTINUOUS,
 };
 
-static void __init setup_itimer(void)
+static void __init timer_setup(void)
 {
        int err;
 
-       err = request_irq(TIMER_IRQ, um_timer, 0, "timer", NULL);
+       err = request_irq(TIMER_IRQ, um_timer, IRQF_TIMER, "hr timer", NULL);
        if (err != 0)
                printk(KERN_ERR "register_timer : request_irq failed - "
                       "errno = %d\n", -err);
 
-       itimer_clockevent.mult = div_sc(HZ, NSEC_PER_SEC, 32);
-       itimer_clockevent.max_delta_ns =
-               clockevent_delta2ns(60 * HZ, &itimer_clockevent);
-       itimer_clockevent.min_delta_ns =
-               clockevent_delta2ns(1, &itimer_clockevent);
-       err = clocksource_register_hz(&itimer_clocksource, USEC_PER_SEC);
+       err = os_timer_create(NULL);
+       if (err != 0) {
+               printk(KERN_ERR "creation of timer failed - errno = %d\n", -err);
+               return;
+       }
+
+       err = clocksource_register_hz(&timer_clocksource, NSEC_PER_SEC/TIMER_MULTIPLIER);
        if (err) {
                printk(KERN_ERR "clocksource_register_hz returned %d\n", err);
                return;
        }
-       clockevents_register_device(&itimer_clockevent);
+       clockevents_register_device(&timer_clockevent);
 }
 
 void read_persistent_clock(struct timespec *ts)
 {
-       long long nsecs = os_nsecs();
+       long long nsecs = os_persistent_clock_emulation();
 
        set_normalized_timespec(ts, nsecs / NSEC_PER_SEC,
                                nsecs % NSEC_PER_SEC);
@@ -106,6 +129,6 @@ void read_persistent_clock(struct timespec *ts)
 
 void __init time_init(void)
 {
-       timer_init();
-       late_time_init = setup_itimer;
+       timer_set_signal_handler();
+       late_time_init = timer_setup;
 }
index 2077248e8a7213e928ebf0fdc38179a8990f9d2c..3777b82759bda134a0a960a7c624802476b3eb73 100644 (file)
@@ -50,6 +50,13 @@ struct host_vm_change {
           .index       = 0, \
           .force       = force })
 
+static void report_enomem(void)
+{
+       printk(KERN_ERR "UML ran out of memory on the host side! "
+                       "This can happen due to a memory limitation or "
+                       "vm.max_map_count has been reached.\n");
+}
+
 static int do_ops(struct host_vm_change *hvc, int end,
                  int finished)
 {
@@ -81,6 +88,9 @@ static int do_ops(struct host_vm_change *hvc, int end,
                }
        }
 
+       if (ret == -ENOMEM)
+               report_enomem();
+
        return ret;
 }
 
@@ -433,8 +443,12 @@ void flush_tlb_page(struct vm_area_struct *vma, unsigned long address)
        else if (pte_newprot(*pte))
                err = protect(mm_id, address, PAGE_SIZE, prot, 1, &flush);
 
-       if (err)
+       if (err) {
+               if (err == -ENOMEM)
+                       report_enomem();
+
                goto kill;
+       }
 
        *pte = pte_mkuptodate(*pte);
 
diff --git a/arch/um/os-Linux/internal.h b/arch/um/os-Linux/internal.h
deleted file mode 100644 (file)
index 0dc2c9f..0000000
+++ /dev/null
@@ -1 +0,0 @@
-void alarm_handler(int sig, struct siginfo *unused_si, mcontext_t *mc);
index df9191acd926cfb3b5a0c3582549105ac0729d5a..9d499de87e63e5e5b46a5dca97224fefd9067512 100644 (file)
@@ -1,4 +1,5 @@
 /*
+ * Copyright (C) 2015 Thomas Meyer (thomas@m3y3r.de)
  * Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
  * Licensed under the GPL
  */
@@ -163,13 +164,13 @@ int __init main(int argc, char **argv, char **envp)
 
        /*
         * This signal stuff used to be in the reboot case.  However,
-        * sometimes a SIGVTALRM can come in when we're halting (reproducably
+        * sometimes a timer signal can come in when we're halting (reproducably
         * when writing out gcov information, presumably because that takes
         * some time) and cause a segfault.
         */
 
-       /* stop timers and set SIGVTALRM to be ignored */
-       disable_timer();
+       /* stop timers and set timer signal to be ignored */
+       os_timer_disable();
 
        /* disable SIGIO for the fds and set SIGIO to be ignored */
        err = deactivate_all_fds();
index 8408aba915b29f7e603233fc5c27e80abd081864..b3e0d40932e1128031dc192dca7e220891de0c84 100644 (file)
@@ -1,4 +1,5 @@
 /*
+ * Copyright (C) 2015 Thomas Meyer (thomas@m3y3r.de)
  * Copyright (C) 2002 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
  * Licensed under the GPL
  */
@@ -89,6 +90,11 @@ int os_process_parent(int pid)
        return parent;
 }
 
+void os_alarm_process(int pid)
+{
+       kill(pid, SIGALRM);
+}
+
 void os_stop_process(int pid)
 {
        kill(pid, SIGSTOP);
index 036d0dbc7b52730ece2a72d69ed95570269fef76..c211153ca69a18f95d74cd6661ecffcb91e270bb 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * Copyright (C) 2015 Anton Ivanov (aivanov@{brocade.com,kot-begemot.co.uk})
+ * Copyright (C) 2015 Thomas Meyer (thomas@m3y3r.de)
  * Copyright (C) 2004 PathScale, Inc
  * Copyright (C) 2004 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
  * Licensed under the GPL
@@ -13,7 +15,6 @@
 #include <kern_util.h>
 #include <os.h>
 #include <sysdep/mcontext.h>
-#include "internal.h"
 
 void (*sig_info[NSIG])(int, struct siginfo *, struct uml_pt_regs *) = {
        [SIGTRAP]       = relay_signal,
@@ -23,7 +24,8 @@ void (*sig_info[NSIG])(int, struct siginfo *, struct uml_pt_regs *) = {
        [SIGBUS]        = bus_handler,
        [SIGSEGV]       = segv_handler,
        [SIGIO]         = sigio_handler,
-       [SIGVTALRM]     = timer_handler };
+       [SIGALRM]       = timer_handler
+};
 
 static void sig_handler_common(int sig, struct siginfo *si, mcontext_t *mc)
 {
@@ -38,7 +40,7 @@ static void sig_handler_common(int sig, struct siginfo *si, mcontext_t *mc)
        }
 
        /* enable signals if sig isn't IRQ signal */
-       if ((sig != SIGIO) && (sig != SIGWINCH) && (sig != SIGVTALRM))
+       if ((sig != SIGIO) && (sig != SIGWINCH) && (sig != SIGALRM))
                unblock_signals();
 
        (*sig_info[sig])(sig, si, &r);
@@ -55,8 +57,8 @@ static void sig_handler_common(int sig, struct siginfo *si, mcontext_t *mc)
 #define SIGIO_BIT 0
 #define SIGIO_MASK (1 << SIGIO_BIT)
 
-#define SIGVTALRM_BIT 1
-#define SIGVTALRM_MASK (1 << SIGVTALRM_BIT)
+#define SIGALRM_BIT 1
+#define SIGALRM_MASK (1 << SIGALRM_BIT)
 
 static int signals_enabled;
 static unsigned int signals_pending;
@@ -78,36 +80,38 @@ void sig_handler(int sig, struct siginfo *si, mcontext_t *mc)
        set_signals(enabled);
 }
 
-static void real_alarm_handler(mcontext_t *mc)
+static void timer_real_alarm_handler(mcontext_t *mc)
 {
        struct uml_pt_regs regs;
 
        if (mc != NULL)
                get_regs_from_mc(&regs, mc);
-       regs.is_user = 0;
-       unblock_signals();
-       timer_handler(SIGVTALRM, NULL, &regs);
+       timer_handler(SIGALRM, NULL, &regs);
 }
 
-void alarm_handler(int sig, struct siginfo *unused_si, mcontext_t *mc)
+void timer_alarm_handler(int sig, struct siginfo *unused_si, mcontext_t *mc)
 {
        int enabled;
 
        enabled = signals_enabled;
        if (!signals_enabled) {
-               signals_pending |= SIGVTALRM_MASK;
+               signals_pending |= SIGALRM_MASK;
                return;
        }
 
        block_signals();
 
-       real_alarm_handler(mc);
+       timer_real_alarm_handler(mc);
        set_signals(enabled);
 }
 
-void timer_init(void)
+void deliver_alarm(void) {
+    timer_alarm_handler(SIGALRM, NULL, NULL);
+}
+
+void timer_set_signal_handler(void)
 {
-       set_handler(SIGVTALRM);
+       set_handler(SIGALRM);
 }
 
 void set_sigstack(void *sig_stack, int size)
@@ -131,10 +135,9 @@ static void (*handlers[_NSIG])(int sig, struct siginfo *si, mcontext_t *mc) = {
 
        [SIGIO] = sig_handler,
        [SIGWINCH] = sig_handler,
-       [SIGVTALRM] = alarm_handler
+       [SIGALRM] = timer_alarm_handler
 };
 
-
 static void hard_handler(int sig, siginfo_t *si, void *p)
 {
        struct ucontext *uc = p;
@@ -188,9 +191,9 @@ void set_handler(int sig)
 
        /* block irq ones */
        sigemptyset(&action.sa_mask);
-       sigaddset(&action.sa_mask, SIGVTALRM);
        sigaddset(&action.sa_mask, SIGIO);
        sigaddset(&action.sa_mask, SIGWINCH);
+       sigaddset(&action.sa_mask, SIGALRM);
 
        if (sig == SIGSEGV)
                flags |= SA_NODEFER;
@@ -283,8 +286,8 @@ void unblock_signals(void)
                if (save_pending & SIGIO_MASK)
                        sig_handler_common(SIGIO, NULL, NULL);
 
-               if (save_pending & SIGVTALRM_MASK)
-                       real_alarm_handler(NULL);
+               if (save_pending & SIGALRM_MASK)
+                       timer_real_alarm_handler(NULL);
        }
 }
 
index 3dddedba3a07f6ca423d6b8e16d79189cbc799de..b856c66ebd3a2be7c2a61027eb8ea616fe4cb1b9 100644 (file)
@@ -1,4 +1,5 @@
 /*
+ * Copyright (C) 2015 Thomas Meyer (thomas@m3y3r.de)
  * Copyright (C) 2002- 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
  * Licensed under the GPL
  */
@@ -45,7 +46,7 @@ static int ptrace_dump_regs(int pid)
  * Signals that are OK to receive in the stub - we'll just continue it.
  * SIGWINCH will happen when UML is inside a detached screen.
  */
-#define STUB_SIG_MASK ((1 << SIGVTALRM) | (1 << SIGWINCH))
+#define STUB_SIG_MASK ((1 << SIGALRM) | (1 << SIGWINCH))
 
 /* Signals that the stub will finish with - anything else is an error */
 #define STUB_DONE_MASK (1 << SIGTRAP)
@@ -137,9 +138,6 @@ static void handle_trap(int pid, struct uml_pt_regs *regs,
        if ((UPT_IP(regs) >= STUB_START) && (UPT_IP(regs) < STUB_END))
                fatal_sigsegv();
 
-       /* Mark this as a syscall */
-       UPT_SYSCALL_NR(regs) = PT_SYSCALL_NR(regs->gp);
-
        if (!local_using_sysemu)
        {
                err = ptrace(PTRACE_POKEUSER, pid, PT_SYSCALL_NR_OFFSET,
@@ -174,24 +172,25 @@ static void handle_trap(int pid, struct uml_pt_regs *regs,
        handle_syscall(regs);
 }
 
+int get_syscall(struct uml_pt_regs *regs)
+{
+       UPT_SYSCALL_NR(regs) = PT_SYSCALL_NR(regs->gp);
+
+       return UPT_SYSCALL_NR(regs);
+}
+
 extern char __syscall_stub_start[];
 
 static int userspace_tramp(void *stack)
 {
        void *addr;
-       int err, fd;
+       int fd;
        unsigned long long offset;
 
        ptrace(PTRACE_TRACEME, 0, 0, 0);
 
        signal(SIGTERM, SIG_DFL);
        signal(SIGWINCH, SIG_IGN);
-       err = set_interval();
-       if (err) {
-               printk(UM_KERN_ERR "userspace_tramp - setting timer failed, "
-                      "errno = %d\n", err);
-               exit(1);
-       }
 
        /*
         * This has a pte, but it can't be mapped in with the usual
@@ -282,7 +281,7 @@ int start_userspace(unsigned long stub_stack)
                               "errno = %d\n", errno);
                        goto out_kill;
                }
-       } while (WIFSTOPPED(status) && (WSTOPSIG(status) == SIGVTALRM));
+       } while (WIFSTOPPED(status) && (WSTOPSIG(status) == SIGALRM));
 
        if (!WIFSTOPPED(status) || (WSTOPSIG(status) != SIGSTOP)) {
                err = -EINVAL;
@@ -315,8 +314,6 @@ int start_userspace(unsigned long stub_stack)
 
 void userspace(struct uml_pt_regs *regs)
 {
-       struct itimerval timer;
-       unsigned long long nsecs, now;
        int err, status, op, pid = userspace_pid[0];
        /* To prevent races if using_sysemu changes under us.*/
        int local_using_sysemu;
@@ -325,13 +322,8 @@ void userspace(struct uml_pt_regs *regs)
        /* Handle any immediate reschedules or signals */
        interrupt_end();
 
-       if (getitimer(ITIMER_VIRTUAL, &timer))
-               printk(UM_KERN_ERR "Failed to get itimer, errno = %d\n", errno);
-       nsecs = timer.it_value.tv_sec * UM_NSEC_PER_SEC +
-               timer.it_value.tv_usec * UM_NSEC_PER_USEC;
-       nsecs += os_nsecs();
-
        while (1) {
+
                /*
                 * This can legitimately fail if the process loads a
                 * bogus value into a segment register.  It will
@@ -401,18 +393,7 @@ void userspace(struct uml_pt_regs *regs)
                        case SIGTRAP:
                                relay_signal(SIGTRAP, (struct siginfo *)&si, regs);
                                break;
-                       case SIGVTALRM:
-                               now = os_nsecs();
-                               if (now < nsecs)
-                                       break;
-                               block_signals();
-                               (*sig_info[sig])(sig, (struct siginfo *)&si, regs);
-                               unblock_signals();
-                               nsecs = timer.it_value.tv_sec *
-                                       UM_NSEC_PER_SEC +
-                                       timer.it_value.tv_usec *
-                                       UM_NSEC_PER_USEC;
-                               nsecs += os_nsecs();
+                       case SIGALRM:
                                break;
                        case SIGIO:
                        case SIGILL:
@@ -460,7 +441,6 @@ __initcall(init_thread_regs);
 
 int copy_context_skas0(unsigned long new_stack, int pid)
 {
-       struct timeval tv = { .tv_sec = 0, .tv_usec = UM_USEC_PER_SEC / UM_HZ };
        int err;
        unsigned long current_stack = current_stub_stack();
        struct stub_data *data = (struct stub_data *) current_stack;
@@ -472,11 +452,10 @@ int copy_context_skas0(unsigned long new_stack, int pid)
         * prepare offset and fd of child's stack as argument for parent's
         * and child's mmap2 calls
         */
-       *data = ((struct stub_data) { .offset   = MMAP_OFFSET(new_offset),
-                                     .fd       = new_fd,
-                                     .timer    = ((struct itimerval)
-                                                  { .it_value = tv,
-                                                    .it_interval = tv }) });
+       *data = ((struct stub_data) {
+                       .offset = MMAP_OFFSET(new_offset),
+                       .fd     = new_fd
+       });
 
        err = ptrace_setregs(pid, thread_regs);
        if (err < 0) {
index e9824d5dd7d5d2587cc41532461b93c6a0264f40..0e39b9978729ff8068670ef8f7d1ee8399326067 100644 (file)
@@ -1,4 +1,7 @@
 /*
+ * Copyright (C) 2015 Anton Ivanov (aivanov@{brocade.com,kot-begemot.co.uk})
+ * Copyright (C) 2015 Thomas Meyer (thomas@m3y3r.de)
+ * Copyright (C) 2012-2014 Cisco Systems
  * Copyright (C) 2000 - 2007 Jeff Dike (jdike{addtoit,linux.intel}.com)
  * Licensed under the GPL
  */
 #include <sys/time.h>
 #include <kern_util.h>
 #include <os.h>
-#include "internal.h"
+#include <string.h>
+#include <timer-internal.h>
 
-int set_interval(void)
-{
-       int usec = UM_USEC_PER_SEC / UM_HZ;
-       struct itimerval interval = ((struct itimerval) { { 0, usec },
-                                                         { 0, usec } });
-
-       if (setitimer(ITIMER_VIRTUAL, &interval, NULL) == -1)
-               return -errno;
+static timer_t event_high_res_timer = 0;
 
-       return 0;
+static inline long long timeval_to_ns(const struct timeval *tv)
+{
+       return ((long long) tv->tv_sec * UM_NSEC_PER_SEC) +
+               tv->tv_usec * UM_NSEC_PER_USEC;
 }
 
-int timer_one_shot(int ticks)
+static inline long long timespec_to_ns(const struct timespec *ts)
 {
-       unsigned long usec = ticks * UM_USEC_PER_SEC / UM_HZ;
-       unsigned long sec = usec / UM_USEC_PER_SEC;
-       struct itimerval interval;
-
-       usec %= UM_USEC_PER_SEC;
-       interval = ((struct itimerval) { { 0, 0 }, { sec, usec } });
+       return ((long long) ts->tv_sec * UM_NSEC_PER_SEC) +
+               ts->tv_nsec;
+}
 
-       if (setitimer(ITIMER_VIRTUAL, &interval, NULL) == -1)
-               return -errno;
+long long os_persistent_clock_emulation (void) {
+       struct timespec realtime_tp;
 
-       return 0;
+       clock_gettime(CLOCK_REALTIME, &realtime_tp);
+       return timespec_to_ns(&realtime_tp);
 }
 
 /**
- * timeval_to_ns - Convert timeval to nanoseconds
- * @ts:                pointer to the timeval variable to be converted
- *
- * Returns the scalar nanosecond representation of the timeval
- * parameter.
- *
- * Ripped from linux/time.h because it's a kernel header, and thus
- * unusable from here.
+ * os_timer_create() - create an new posix (interval) timer
  */
-static inline long long timeval_to_ns(const struct timeval *tv)
-{
-       return ((long long) tv->tv_sec * UM_NSEC_PER_SEC) +
-               tv->tv_usec * UM_NSEC_PER_USEC;
+int os_timer_create(void* timer) {
+
+       timer_t* t = timer;
+
+       if(t == NULL) {
+               t = &event_high_res_timer;
+       }
+
+       if (timer_create(
+               CLOCK_MONOTONIC,
+               NULL,
+               t) == -1) {
+               return -1;
+       }
+       return 0;
 }
 
-long long disable_timer(void)
+int os_timer_set_interval(void* timer, void* i)
 {
-       struct itimerval time = ((struct itimerval) { { 0, 0 }, { 0, 0 } });
-       long long remain, max = UM_NSEC_PER_SEC / UM_HZ;
+       struct itimerspec its;
+       unsigned long long nsec;
+       timer_t* t = timer;
+       struct itimerspec* its_in = i;
 
-       if (setitimer(ITIMER_VIRTUAL, &time, &time) < 0)
-               printk(UM_KERN_ERR "disable_timer - setitimer failed, "
-                      "errno = %d\n", errno);
+       if(t == NULL) {
+               t = &event_high_res_timer;
+       }
 
-       remain = timeval_to_ns(&time.it_value);
-       if (remain > max)
-               remain = max;
+       nsec = UM_NSEC_PER_SEC / UM_HZ;
 
-       return remain;
-}
+       if(its_in != NULL) {
+               its.it_value.tv_sec = its_in->it_value.tv_sec;
+               its.it_value.tv_nsec = its_in->it_value.tv_nsec;
+       } else {
+               its.it_value.tv_sec = 0;
+               its.it_value.tv_nsec = nsec;
+       }
 
-long long os_nsecs(void)
-{
-       struct timeval tv;
+       its.it_interval.tv_sec = 0;
+       its.it_interval.tv_nsec = nsec;
 
-       gettimeofday(&tv, NULL);
-       return timeval_to_ns(&tv);
-}
+       if(timer_settime(*t, 0, &its, NULL) == -1) {
+               return -errno;
+       }
 
-#ifdef UML_CONFIG_NO_HZ_COMMON
-static int after_sleep_interval(struct timespec *ts)
-{
        return 0;
 }
 
-static void deliver_alarm(void)
+/**
+ * os_timer_remain() - returns the remaining nano seconds of the given interval
+ *                     timer
+ * Because this is the remaining time of an interval timer, which correspondends
+ * to HZ, this value can never be bigger than one second. Just
+ * the nanosecond part of the timer is returned.
+ * The returned time is relative to the start time of the interval timer.
+ * Return an negative value in an error case.
+ */
+long os_timer_remain(void* timer)
 {
-       alarm_handler(SIGVTALRM, NULL, NULL);
-}
+       struct itimerspec its;
+       timer_t* t = timer;
 
-static unsigned long long sleep_time(unsigned long long nsecs)
-{
-       return nsecs;
-}
+       if(t == NULL) {
+               t = &event_high_res_timer;
+       }
 
-#else
-unsigned long long last_tick;
-unsigned long long skew;
+       if(timer_gettime(t, &its) == -1) {
+               return -errno;
+       }
 
-static void deliver_alarm(void)
-{
-       unsigned long long this_tick = os_nsecs();
-       int one_tick = UM_NSEC_PER_SEC / UM_HZ;
+       return its.it_value.tv_nsec;
+}
 
-       /* Protection against the host's time going backwards */
-       if ((last_tick != 0) && (this_tick < last_tick))
-               this_tick = last_tick;
+int os_timer_one_shot(int ticks)
+{
+       struct itimerspec its;
+       unsigned long long nsec;
+       unsigned long sec;
 
-       if (last_tick == 0)
-               last_tick = this_tick - one_tick;
+    nsec = (ticks + 1);
+    sec = nsec / UM_NSEC_PER_SEC;
+       nsec = nsec % UM_NSEC_PER_SEC;
 
-       skew += this_tick - last_tick;
+       its.it_value.tv_sec = nsec / UM_NSEC_PER_SEC;
+       its.it_value.tv_nsec = nsec;
 
-       while (skew >= one_tick) {
-               alarm_handler(SIGVTALRM, NULL, NULL);
-               skew -= one_tick;
-       }
+       its.it_interval.tv_sec = 0;
+       its.it_interval.tv_nsec = 0; // we cheat here
 
-       last_tick = this_tick;
+       timer_settime(event_high_res_timer, 0, &its, NULL);
+       return 0;
 }
 
-static unsigned long long sleep_time(unsigned long long nsecs)
+/**
+ * os_timer_disable() - disable the posix (interval) timer
+ * Returns the remaining interval timer time in nanoseconds
+ */
+long long os_timer_disable(void)
 {
-       return nsecs > skew ? nsecs - skew : 0;
-}
+       struct itimerspec its;
 
-static inline long long timespec_to_us(const struct timespec *ts)
-{
-       return ((long long) ts->tv_sec * UM_USEC_PER_SEC) +
-               ts->tv_nsec / UM_NSEC_PER_USEC;
+       memset(&its, 0, sizeof(struct itimerspec));
+       timer_settime(event_high_res_timer, 0, &its, &its);
+
+       return its.it_value.tv_sec * UM_NSEC_PER_SEC + its.it_value.tv_nsec;
 }
 
-static int after_sleep_interval(struct timespec *ts)
+long long os_vnsecs(void)
 {
-       int usec = UM_USEC_PER_SEC / UM_HZ;
-       long long start_usecs = timespec_to_us(ts);
-       struct timeval tv;
-       struct itimerval interval;
-
-       /*
-        * It seems that rounding can increase the value returned from
-        * setitimer to larger than the one passed in.  Over time,
-        * this will cause the remaining time to be greater than the
-        * tick interval.  If this happens, then just reduce the first
-        * tick to the interval value.
-        */
-       if (start_usecs > usec)
-               start_usecs = usec;
-
-       start_usecs -= skew / UM_NSEC_PER_USEC;
-       if (start_usecs < 0)
-               start_usecs = 0;
+       struct timespec ts;
 
-       tv = ((struct timeval) { .tv_sec  = start_usecs / UM_USEC_PER_SEC,
-                                .tv_usec = start_usecs % UM_USEC_PER_SEC });
-       interval = ((struct itimerval) { { 0, usec }, tv });
+       clock_gettime(CLOCK_PROCESS_CPUTIME_ID,&ts);
+       return timespec_to_ns(&ts);
+}
 
-       if (setitimer(ITIMER_VIRTUAL, &interval, NULL) == -1)
-               return -errno;
+long long os_nsecs(void)
+{
+       struct timespec ts;
 
-       return 0;
+       clock_gettime(CLOCK_MONOTONIC,&ts);
+       return timespec_to_ns(&ts);
 }
-#endif
 
-void idle_sleep(unsigned long long nsecs)
+/**
+ * os_idle_sleep() - sleep for a given time of nsecs
+ * @nsecs: nanoseconds to sleep
+ */
+void os_idle_sleep(unsigned long long nsecs)
 {
        struct timespec ts;
 
-       /*
-        * nsecs can come in as zero, in which case, this starts a
-        * busy loop.  To prevent this, reset nsecs to the tick
-        * interval if it is zero.
-        */
-       if (nsecs == 0)
-               nsecs = UM_NSEC_PER_SEC / UM_HZ;
+       if (nsecs <= 0) {
+               return;
+       }
 
-       nsecs = sleep_time(nsecs);
-       ts = ((struct timespec) { .tv_sec       = nsecs / UM_NSEC_PER_SEC,
-                                 .tv_nsec      = nsecs % UM_NSEC_PER_SEC });
+       ts = ((struct timespec) {
+                       .tv_sec  = nsecs / UM_NSEC_PER_SEC,
+                       .tv_nsec = nsecs % UM_NSEC_PER_SEC
+       });
 
-       if (nanosleep(&ts, &ts) == 0)
+       /*
+        * Relay the signal if clock_nanosleep is interrupted.
+        */
+       if (clock_nanosleep(CLOCK_MONOTONIC, 0, &ts, NULL)) {
                deliver_alarm();
-       after_sleep_interval(&ts);
+       }
 }
index 1f37cb2b56a9938784ba64abb4db0e51de0c70b9..493f54172b4a5c90b1596708f1d5cb2a0f15156c 100644 (file)
@@ -354,7 +354,7 @@ static int __meminit split_mem_range(struct map_range *mr, int nr_range,
        }
 
        for (i = 0; i < nr_range; i++)
-               printk(KERN_DEBUG " [mem %#010lx-%#010lx] page %s\n",
+               pr_debug(" [mem %#010lx-%#010lx] page %s\n",
                                mr[i].start, mr[i].end - 1,
                                page_size_string(&mr[i]));
 
@@ -401,7 +401,7 @@ unsigned long __init_refok init_memory_mapping(unsigned long start,
        unsigned long ret = 0;
        int nr_range, i;
 
-       pr_info("init_memory_mapping: [mem %#010lx-%#010lx]\n",
+       pr_debug("init_memory_mapping: [mem %#010lx-%#010lx]\n",
               start, end - 1);
 
        memset(mr, 0, sizeof(mr));
index 5ed62eff31bd5e7fe2e711a4204afbaad60e2437..ec081fe0ce2c10246fec7126dd213aa6b4d75dbb 100644 (file)
@@ -1270,7 +1270,7 @@ static int __meminit vmemmap_populate_hugepages(unsigned long start,
                                /* check to see if we have contiguous blocks */
                                if (p_end != p || node_start != node) {
                                        if (p_start)
-                                               printk(KERN_DEBUG " [%lx-%lx] PMD -> [%p-%p] on node %d\n",
+                                               pr_debug(" [%lx-%lx] PMD -> [%p-%p] on node %d\n",
                                                       addr_start, addr_end-1, p_start, p_end-1, node_start);
                                        addr_start = addr;
                                        node_start = node;
@@ -1368,7 +1368,7 @@ void register_page_bootmem_memmap(unsigned long section_nr,
 void __meminit vmemmap_populate_print_last(void)
 {
        if (p_start) {
-               printk(KERN_DEBUG " [%lx-%lx] PMD -> [%p-%p] on node %d\n",
+               pr_debug(" [%lx-%lx] PMD -> [%p-%p] on node %d\n",
                        addr_start, addr_end-1, p_start, p_end-1, node_start);
                p_start = NULL;
                p_end = NULL;
index b972649d3a18f08683587a2cef6c0f3f51a79b39..98816804e131fcb8701f3b360055de2501a8300a 100644 (file)
@@ -1,6 +1,5 @@
 #include <as-layout.h>
 
-       .globl syscall_stub
 .section .__syscall_stub, "ax"
 
        .globl batch_syscall_stub
index 7160b20172d0a4671d1e5dd6d8fe77956e32a47a..ba914b3b8cc4d960203ba3a038afbeb00cab0d1d 100644 (file)
@@ -1,25 +1,9 @@
 #include <as-layout.h>
 
-       .globl syscall_stub
 .section .__syscall_stub, "ax"
-syscall_stub:
-       syscall
-       /* We don't have 64-bit constants, so this constructs the address
-        * we need.
-        */
-       movq    $(STUB_DATA >> 32), %rbx
-       salq    $32, %rbx
-       movq    $(STUB_DATA & 0xffffffff), %rcx
-       or      %rcx, %rbx
-       movq    %rax, (%rbx)
-       int3
-
        .globl batch_syscall_stub
 batch_syscall_stub:
-       mov     $(STUB_DATA >> 32), %rbx
-       sal     $32, %rbx
-       mov     $(STUB_DATA & 0xffffffff), %rax
-       or      %rax, %rbx
+       mov     $(STUB_DATA), %rbx
        /* load pointer to first operation */
        mov     %rbx, %rsp
        add     $0x10, %rsp
index fa84ca990caa199991163f30daf82e64d152e33a..3c3ace2c46b613522ddccbd6ee7c357507b65ea4 100644 (file)
@@ -101,7 +101,7 @@ static void simdisk_transfer(struct simdisk *dev, unsigned long sector,
        spin_unlock(&dev->lock);
 }
 
-static void simdisk_make_request(struct request_queue *q, struct bio *bio)
+static blk_qc_t simdisk_make_request(struct request_queue *q, struct bio *bio)
 {
        struct simdisk *dev = q->queuedata;
        struct bio_vec bvec;
@@ -119,6 +119,7 @@ static void simdisk_make_request(struct request_queue *q, struct bio *bio)
        }
 
        bio_endio(bio);
+       return BLK_QC_T_NONE;
 }
 
 static int simdisk_open(struct block_device *bdev, fmode_t mode)
index 590cca21c24a771fe04339046ef172a23b278f35..2bbf08cd29007a8da2db6e9cca053c79094ee504 100644 (file)
@@ -809,7 +809,7 @@ blk_init_queue_node(request_fn_proc *rfn, spinlock_t *lock, int node_id)
 }
 EXPORT_SYMBOL(blk_init_queue_node);
 
-static void blk_queue_bio(struct request_queue *q, struct bio *bio);
+static blk_qc_t blk_queue_bio(struct request_queue *q, struct bio *bio);
 
 struct request_queue *
 blk_init_allocated_queue(struct request_queue *q, request_fn_proc *rfn,
@@ -1678,7 +1678,7 @@ void init_request_from_bio(struct request *req, struct bio *bio)
        blk_rq_bio_prep(req->q, req, bio);
 }
 
-static void blk_queue_bio(struct request_queue *q, struct bio *bio)
+static blk_qc_t blk_queue_bio(struct request_queue *q, struct bio *bio)
 {
        const bool sync = !!(bio->bi_rw & REQ_SYNC);
        struct blk_plug *plug;
@@ -1698,7 +1698,7 @@ static void blk_queue_bio(struct request_queue *q, struct bio *bio)
        if (bio_integrity_enabled(bio) && bio_integrity_prep(bio)) {
                bio->bi_error = -EIO;
                bio_endio(bio);
-               return;
+               return BLK_QC_T_NONE;
        }
 
        if (bio->bi_rw & (REQ_FLUSH | REQ_FUA)) {
@@ -1713,7 +1713,7 @@ static void blk_queue_bio(struct request_queue *q, struct bio *bio)
         */
        if (!blk_queue_nomerges(q)) {
                if (blk_attempt_plug_merge(q, bio, &request_count, NULL))
-                       return;
+                       return BLK_QC_T_NONE;
        } else
                request_count = blk_plug_queued_count(q);
 
@@ -1791,6 +1791,8 @@ get_rq:
 out_unlock:
                spin_unlock_irq(q->queue_lock);
        }
+
+       return BLK_QC_T_NONE;
 }
 
 /*
@@ -1996,12 +1998,13 @@ end_io:
  * a lower device by calling into generic_make_request recursively, which
  * means the bio should NOT be touched after the call to ->make_request_fn.
  */
-void generic_make_request(struct bio *bio)
+blk_qc_t generic_make_request(struct bio *bio)
 {
        struct bio_list bio_list_on_stack;
+       blk_qc_t ret = BLK_QC_T_NONE;
 
        if (!generic_make_request_checks(bio))
-               return;
+               goto out;
 
        /*
         * We only want one ->make_request_fn to be active at a time, else
@@ -2015,7 +2018,7 @@ void generic_make_request(struct bio *bio)
         */
        if (current->bio_list) {
                bio_list_add(current->bio_list, bio);
-               return;
+               goto out;
        }
 
        /* following loop may be a bit non-obvious, and so deserves some
@@ -2040,7 +2043,7 @@ void generic_make_request(struct bio *bio)
 
                if (likely(blk_queue_enter(q, __GFP_DIRECT_RECLAIM) == 0)) {
 
-                       q->make_request_fn(q, bio);
+                       ret = q->make_request_fn(q, bio);
 
                        blk_queue_exit(q);
 
@@ -2053,6 +2056,9 @@ void generic_make_request(struct bio *bio)
                }
        } while (bio);
        current->bio_list = NULL; /* deactivate */
+
+out:
+       return ret;
 }
 EXPORT_SYMBOL(generic_make_request);
 
@@ -2066,7 +2072,7 @@ EXPORT_SYMBOL(generic_make_request);
  * interfaces; @bio must be presetup and ready for I/O.
  *
  */
-void submit_bio(int rw, struct bio *bio)
+blk_qc_t submit_bio(int rw, struct bio *bio)
 {
        bio->bi_rw |= rw;
 
@@ -2100,7 +2106,7 @@ void submit_bio(int rw, struct bio *bio)
                }
        }
 
-       generic_make_request(bio);
+       return generic_make_request(bio);
 }
 EXPORT_SYMBOL(submit_bio);
 
@@ -3306,6 +3312,47 @@ void blk_finish_plug(struct blk_plug *plug)
 }
 EXPORT_SYMBOL(blk_finish_plug);
 
+bool blk_poll(struct request_queue *q, blk_qc_t cookie)
+{
+       struct blk_plug *plug;
+       long state;
+
+       if (!q->mq_ops || !q->mq_ops->poll || !blk_qc_t_valid(cookie) ||
+           !test_bit(QUEUE_FLAG_POLL, &q->queue_flags))
+               return false;
+
+       plug = current->plug;
+       if (plug)
+               blk_flush_plug_list(plug, false);
+
+       state = current->state;
+       while (!need_resched()) {
+               unsigned int queue_num = blk_qc_t_to_queue_num(cookie);
+               struct blk_mq_hw_ctx *hctx = q->queue_hw_ctx[queue_num];
+               int ret;
+
+               hctx->poll_invoked++;
+
+               ret = q->mq_ops->poll(hctx, blk_qc_t_to_tag(cookie));
+               if (ret > 0) {
+                       hctx->poll_success++;
+                       set_current_state(TASK_RUNNING);
+                       return true;
+               }
+
+               if (signal_pending_state(state, current))
+                       set_current_state(TASK_RUNNING);
+
+               if (current->state == TASK_RUNNING)
+                       return true;
+               if (ret < 0)
+                       break;
+               cpu_relax();
+       }
+
+       return false;
+}
+
 #ifdef CONFIG_PM
 /**
  * blk_pm_runtime_init - Block layer runtime PM initialization routine
index 6f57a110289c54c8e293b00aad0b42acb55ed6fc..1cf18784c5cf3c44be94dbd003ca9d7088f883e0 100644 (file)
@@ -174,6 +174,11 @@ static ssize_t blk_mq_sysfs_rq_list_show(struct blk_mq_ctx *ctx, char *page)
        return ret;
 }
 
+static ssize_t blk_mq_hw_sysfs_poll_show(struct blk_mq_hw_ctx *hctx, char *page)
+{
+       return sprintf(page, "invoked=%lu, success=%lu\n", hctx->poll_invoked, hctx->poll_success);
+}
+
 static ssize_t blk_mq_hw_sysfs_queued_show(struct blk_mq_hw_ctx *hctx,
                                           char *page)
 {
@@ -295,6 +300,10 @@ static struct blk_mq_hw_ctx_sysfs_entry blk_mq_hw_sysfs_cpus = {
        .attr = {.name = "cpu_list", .mode = S_IRUGO },
        .show = blk_mq_hw_sysfs_cpus_show,
 };
+static struct blk_mq_hw_ctx_sysfs_entry blk_mq_hw_sysfs_poll = {
+       .attr = {.name = "io_poll", .mode = S_IRUGO },
+       .show = blk_mq_hw_sysfs_poll_show,
+};
 
 static struct attribute *default_hw_ctx_attrs[] = {
        &blk_mq_hw_sysfs_queued.attr,
@@ -304,6 +313,7 @@ static struct attribute *default_hw_ctx_attrs[] = {
        &blk_mq_hw_sysfs_tags.attr,
        &blk_mq_hw_sysfs_cpus.attr,
        &blk_mq_hw_sysfs_active.attr,
+       &blk_mq_hw_sysfs_poll.attr,
        NULL,
 };
 
index 694f8703f83cf4b5db887399bbde818bde492eaf..86bd5b25288e29c0415700db4993cd239183366e 100644 (file)
@@ -1198,7 +1198,7 @@ static struct request *blk_mq_map_request(struct request_queue *q,
        return rq;
 }
 
-static int blk_mq_direct_issue_request(struct request *rq)
+static int blk_mq_direct_issue_request(struct request *rq, blk_qc_t *cookie)
 {
        int ret;
        struct request_queue *q = rq->q;
@@ -1209,6 +1209,7 @@ static int blk_mq_direct_issue_request(struct request *rq)
                .list = NULL,
                .last = 1
        };
+       blk_qc_t new_cookie = blk_tag_to_qc_t(rq->tag, hctx->queue_num);
 
        /*
         * For OK queue, we are done. For error, kill it. Any other
@@ -1216,18 +1217,21 @@ static int blk_mq_direct_issue_request(struct request *rq)
         * would have done
         */
        ret = q->mq_ops->queue_rq(hctx, &bd);
-       if (ret == BLK_MQ_RQ_QUEUE_OK)
+       if (ret == BLK_MQ_RQ_QUEUE_OK) {
+               *cookie = new_cookie;
                return 0;
-       else {
-               __blk_mq_requeue_request(rq);
+       }
 
-               if (ret == BLK_MQ_RQ_QUEUE_ERROR) {
-                       rq->errors = -EIO;
-                       blk_mq_end_request(rq, rq->errors);
-                       return 0;
-               }
-               return -1;
+       __blk_mq_requeue_request(rq);
+
+       if (ret == BLK_MQ_RQ_QUEUE_ERROR) {
+               *cookie = BLK_QC_T_NONE;
+               rq->errors = -EIO;
+               blk_mq_end_request(rq, rq->errors);
+               return 0;
        }
+
+       return -1;
 }
 
 /*
@@ -1235,7 +1239,7 @@ static int blk_mq_direct_issue_request(struct request *rq)
  * but will attempt to bypass the hctx queueing if we can go straight to
  * hardware for SYNC IO.
  */
-static void blk_mq_make_request(struct request_queue *q, struct bio *bio)
+static blk_qc_t blk_mq_make_request(struct request_queue *q, struct bio *bio)
 {
        const int is_sync = rw_is_sync(bio->bi_rw);
        const int is_flush_fua = bio->bi_rw & (REQ_FLUSH | REQ_FUA);
@@ -1244,12 +1248,13 @@ static void blk_mq_make_request(struct request_queue *q, struct bio *bio)
        unsigned int request_count = 0;
        struct blk_plug *plug;
        struct request *same_queue_rq = NULL;
+       blk_qc_t cookie;
 
        blk_queue_bounce(q, &bio);
 
        if (bio_integrity_enabled(bio) && bio_integrity_prep(bio)) {
                bio_io_error(bio);
-               return;
+               return BLK_QC_T_NONE;
        }
 
        blk_queue_split(q, &bio, q->bio_split);
@@ -1257,13 +1262,15 @@ static void blk_mq_make_request(struct request_queue *q, struct bio *bio)
        if (!is_flush_fua && !blk_queue_nomerges(q)) {
                if (blk_attempt_plug_merge(q, bio, &request_count,
                                           &same_queue_rq))
-                       return;
+                       return BLK_QC_T_NONE;
        } else
                request_count = blk_plug_queued_count(q);
 
        rq = blk_mq_map_request(q, bio, &data);
        if (unlikely(!rq))
-               return;
+               return BLK_QC_T_NONE;
+
+       cookie = blk_tag_to_qc_t(rq->tag, data.hctx->queue_num);
 
        if (unlikely(is_flush_fua)) {
                blk_mq_bio_to_request(rq, bio);
@@ -1302,11 +1309,11 @@ static void blk_mq_make_request(struct request_queue *q, struct bio *bio)
                        old_rq = rq;
                blk_mq_put_ctx(data.ctx);
                if (!old_rq)
-                       return;
-               if (!blk_mq_direct_issue_request(old_rq))
-                       return;
+                       goto done;
+               if (!blk_mq_direct_issue_request(old_rq, &cookie))
+                       goto done;
                blk_mq_insert_request(old_rq, false, true, true);
-               return;
+               goto done;
        }
 
        if (!blk_mq_merge_queue_io(data.hctx, data.ctx, rq, bio)) {
@@ -1320,13 +1327,15 @@ run_queue:
                blk_mq_run_hw_queue(data.hctx, !is_sync || is_flush_fua);
        }
        blk_mq_put_ctx(data.ctx);
+done:
+       return cookie;
 }
 
 /*
  * Single hardware queue variant. This will attempt to use any per-process
  * plug for merging and IO deferral.
  */
-static void blk_sq_make_request(struct request_queue *q, struct bio *bio)
+static blk_qc_t blk_sq_make_request(struct request_queue *q, struct bio *bio)
 {
        const int is_sync = rw_is_sync(bio->bi_rw);
        const int is_flush_fua = bio->bi_rw & (REQ_FLUSH | REQ_FUA);
@@ -1334,23 +1343,26 @@ static void blk_sq_make_request(struct request_queue *q, struct bio *bio)
        unsigned int request_count = 0;
        struct blk_map_ctx data;
        struct request *rq;
+       blk_qc_t cookie;
 
        blk_queue_bounce(q, &bio);
 
        if (bio_integrity_enabled(bio) && bio_integrity_prep(bio)) {
                bio_io_error(bio);
-               return;
+               return BLK_QC_T_NONE;
        }
 
        blk_queue_split(q, &bio, q->bio_split);
 
        if (!is_flush_fua && !blk_queue_nomerges(q) &&
            blk_attempt_plug_merge(q, bio, &request_count, NULL))
-               return;
+               return BLK_QC_T_NONE;
 
        rq = blk_mq_map_request(q, bio, &data);
        if (unlikely(!rq))
-               return;
+               return BLK_QC_T_NONE;
+
+       cookie = blk_tag_to_qc_t(rq->tag, data.hctx->queue_num);
 
        if (unlikely(is_flush_fua)) {
                blk_mq_bio_to_request(rq, bio);
@@ -1374,7 +1386,7 @@ static void blk_sq_make_request(struct request_queue *q, struct bio *bio)
                }
                list_add_tail(&rq->queuelist, &plug->mq_list);
                blk_mq_put_ctx(data.ctx);
-               return;
+               return cookie;
        }
 
        if (!blk_mq_merge_queue_io(data.hctx, data.ctx, rq, bio)) {
@@ -1389,6 +1401,7 @@ run_queue:
        }
 
        blk_mq_put_ctx(data.ctx);
+       return cookie;
 }
 
 /*
index 31849e328b452a8fdd26d202a30edc86e6d451df..565b8dac578297edf327e7451dedfe80a75e5751 100644 (file)
@@ -317,6 +317,34 @@ queue_rq_affinity_store(struct request_queue *q, const char *page, size_t count)
        return ret;
 }
 
+static ssize_t queue_poll_show(struct request_queue *q, char *page)
+{
+       return queue_var_show(test_bit(QUEUE_FLAG_POLL, &q->queue_flags), page);
+}
+
+static ssize_t queue_poll_store(struct request_queue *q, const char *page,
+                               size_t count)
+{
+       unsigned long poll_on;
+       ssize_t ret;
+
+       if (!q->mq_ops || !q->mq_ops->poll)
+               return -EINVAL;
+
+       ret = queue_var_store(&poll_on, page, count);
+       if (ret < 0)
+               return ret;
+
+       spin_lock_irq(q->queue_lock);
+       if (poll_on)
+               queue_flag_set(QUEUE_FLAG_POLL, q);
+       else
+               queue_flag_clear(QUEUE_FLAG_POLL, q);
+       spin_unlock_irq(q->queue_lock);
+
+       return ret;
+}
+
 static struct queue_sysfs_entry queue_requests_entry = {
        .attr = {.name = "nr_requests", .mode = S_IRUGO | S_IWUSR },
        .show = queue_requests_show,
@@ -442,6 +470,12 @@ static struct queue_sysfs_entry queue_random_entry = {
        .store = queue_store_random,
 };
 
+static struct queue_sysfs_entry queue_poll_entry = {
+       .attr = {.name = "io_poll", .mode = S_IRUGO | S_IWUSR },
+       .show = queue_poll_show,
+       .store = queue_poll_store,
+};
+
 static struct attribute *default_attrs[] = {
        &queue_requests_entry.attr,
        &queue_ra_entry.attr,
@@ -466,6 +500,7 @@ static struct attribute *default_attrs[] = {
        &queue_rq_affinity_entry.attr,
        &queue_iostats_entry.attr,
        &queue_random_entry.attr,
+       &queue_poll_entry.attr,
        NULL,
 };
 
index 6e26761a27dae90d0671b1edf38b2e8533d56df3..f7dab53b352ae0f70838d622ba32da62eb381d83 100644 (file)
@@ -33,6 +33,15 @@ static bool force_enable_dimms;
 module_param(force_enable_dimms, bool, S_IRUGO|S_IWUSR);
 MODULE_PARM_DESC(force_enable_dimms, "Ignore _STA (ACPI DIMM device) status");
 
+struct nfit_table_prev {
+       struct list_head spas;
+       struct list_head memdevs;
+       struct list_head dcrs;
+       struct list_head bdws;
+       struct list_head idts;
+       struct list_head flushes;
+};
+
 static u8 nfit_uuid[NFIT_UUID_MAX][16];
 
 const u8 *to_nfit_uuid(enum nfit_uuids id)
@@ -221,12 +230,20 @@ static int nfit_spa_type(struct acpi_nfit_system_address *spa)
 }
 
 static bool add_spa(struct acpi_nfit_desc *acpi_desc,
+               struct nfit_table_prev *prev,
                struct acpi_nfit_system_address *spa)
 {
        struct device *dev = acpi_desc->dev;
-       struct nfit_spa *nfit_spa = devm_kzalloc(dev, sizeof(*nfit_spa),
-                       GFP_KERNEL);
+       struct nfit_spa *nfit_spa;
+
+       list_for_each_entry(nfit_spa, &prev->spas, list) {
+               if (memcmp(nfit_spa->spa, spa, sizeof(*spa)) == 0) {
+                       list_move_tail(&nfit_spa->list, &acpi_desc->spas);
+                       return true;
+               }
+       }
 
+       nfit_spa = devm_kzalloc(dev, sizeof(*nfit_spa), GFP_KERNEL);
        if (!nfit_spa)
                return false;
        INIT_LIST_HEAD(&nfit_spa->list);
@@ -239,12 +256,19 @@ static bool add_spa(struct acpi_nfit_desc *acpi_desc,
 }
 
 static bool add_memdev(struct acpi_nfit_desc *acpi_desc,
+               struct nfit_table_prev *prev,
                struct acpi_nfit_memory_map *memdev)
 {
        struct device *dev = acpi_desc->dev;
-       struct nfit_memdev *nfit_memdev = devm_kzalloc(dev,
-                       sizeof(*nfit_memdev), GFP_KERNEL);
+       struct nfit_memdev *nfit_memdev;
 
+       list_for_each_entry(nfit_memdev, &prev->memdevs, list)
+               if (memcmp(nfit_memdev->memdev, memdev, sizeof(*memdev)) == 0) {
+                       list_move_tail(&nfit_memdev->list, &acpi_desc->memdevs);
+                       return true;
+               }
+
+       nfit_memdev = devm_kzalloc(dev, sizeof(*nfit_memdev), GFP_KERNEL);
        if (!nfit_memdev)
                return false;
        INIT_LIST_HEAD(&nfit_memdev->list);
@@ -257,12 +281,19 @@ static bool add_memdev(struct acpi_nfit_desc *acpi_desc,
 }
 
 static bool add_dcr(struct acpi_nfit_desc *acpi_desc,
+               struct nfit_table_prev *prev,
                struct acpi_nfit_control_region *dcr)
 {
        struct device *dev = acpi_desc->dev;
-       struct nfit_dcr *nfit_dcr = devm_kzalloc(dev, sizeof(*nfit_dcr),
-                       GFP_KERNEL);
+       struct nfit_dcr *nfit_dcr;
+
+       list_for_each_entry(nfit_dcr, &prev->dcrs, list)
+               if (memcmp(nfit_dcr->dcr, dcr, sizeof(*dcr)) == 0) {
+                       list_move_tail(&nfit_dcr->list, &acpi_desc->dcrs);
+                       return true;
+               }
 
+       nfit_dcr = devm_kzalloc(dev, sizeof(*nfit_dcr), GFP_KERNEL);
        if (!nfit_dcr)
                return false;
        INIT_LIST_HEAD(&nfit_dcr->list);
@@ -274,12 +305,19 @@ static bool add_dcr(struct acpi_nfit_desc *acpi_desc,
 }
 
 static bool add_bdw(struct acpi_nfit_desc *acpi_desc,
+               struct nfit_table_prev *prev,
                struct acpi_nfit_data_region *bdw)
 {
        struct device *dev = acpi_desc->dev;
-       struct nfit_bdw *nfit_bdw = devm_kzalloc(dev, sizeof(*nfit_bdw),
-                       GFP_KERNEL);
+       struct nfit_bdw *nfit_bdw;
+
+       list_for_each_entry(nfit_bdw, &prev->bdws, list)
+               if (memcmp(nfit_bdw->bdw, bdw, sizeof(*bdw)) == 0) {
+                       list_move_tail(&nfit_bdw->list, &acpi_desc->bdws);
+                       return true;
+               }
 
+       nfit_bdw = devm_kzalloc(dev, sizeof(*nfit_bdw), GFP_KERNEL);
        if (!nfit_bdw)
                return false;
        INIT_LIST_HEAD(&nfit_bdw->list);
@@ -291,12 +329,19 @@ static bool add_bdw(struct acpi_nfit_desc *acpi_desc,
 }
 
 static bool add_idt(struct acpi_nfit_desc *acpi_desc,
+               struct nfit_table_prev *prev,
                struct acpi_nfit_interleave *idt)
 {
        struct device *dev = acpi_desc->dev;
-       struct nfit_idt *nfit_idt = devm_kzalloc(dev, sizeof(*nfit_idt),
-                       GFP_KERNEL);
+       struct nfit_idt *nfit_idt;
+
+       list_for_each_entry(nfit_idt, &prev->idts, list)
+               if (memcmp(nfit_idt->idt, idt, sizeof(*idt)) == 0) {
+                       list_move_tail(&nfit_idt->list, &acpi_desc->idts);
+                       return true;
+               }
 
+       nfit_idt = devm_kzalloc(dev, sizeof(*nfit_idt), GFP_KERNEL);
        if (!nfit_idt)
                return false;
        INIT_LIST_HEAD(&nfit_idt->list);
@@ -308,12 +353,19 @@ static bool add_idt(struct acpi_nfit_desc *acpi_desc,
 }
 
 static bool add_flush(struct acpi_nfit_desc *acpi_desc,
+               struct nfit_table_prev *prev,
                struct acpi_nfit_flush_address *flush)
 {
        struct device *dev = acpi_desc->dev;
-       struct nfit_flush *nfit_flush = devm_kzalloc(dev, sizeof(*nfit_flush),
-                       GFP_KERNEL);
+       struct nfit_flush *nfit_flush;
 
+       list_for_each_entry(nfit_flush, &prev->flushes, list)
+               if (memcmp(nfit_flush->flush, flush, sizeof(*flush)) == 0) {
+                       list_move_tail(&nfit_flush->list, &acpi_desc->flushes);
+                       return true;
+               }
+
+       nfit_flush = devm_kzalloc(dev, sizeof(*nfit_flush), GFP_KERNEL);
        if (!nfit_flush)
                return false;
        INIT_LIST_HEAD(&nfit_flush->list);
@@ -324,8 +376,8 @@ static bool add_flush(struct acpi_nfit_desc *acpi_desc,
        return true;
 }
 
-static void *add_table(struct acpi_nfit_desc *acpi_desc, void *table,
-               const void *end)
+static void *add_table(struct acpi_nfit_desc *acpi_desc,
+               struct nfit_table_prev *prev, void *table, const void *end)
 {
        struct device *dev = acpi_desc->dev;
        struct acpi_nfit_header *hdr;
@@ -335,29 +387,35 @@ static void *add_table(struct acpi_nfit_desc *acpi_desc, void *table,
                return NULL;
 
        hdr = table;
+       if (!hdr->length) {
+               dev_warn(dev, "found a zero length table '%d' parsing nfit\n",
+                       hdr->type);
+               return NULL;
+       }
+
        switch (hdr->type) {
        case ACPI_NFIT_TYPE_SYSTEM_ADDRESS:
-               if (!add_spa(acpi_desc, table))
+               if (!add_spa(acpi_desc, prev, table))
                        return err;
                break;
        case ACPI_NFIT_TYPE_MEMORY_MAP:
-               if (!add_memdev(acpi_desc, table))
+               if (!add_memdev(acpi_desc, prev, table))
                        return err;
                break;
        case ACPI_NFIT_TYPE_CONTROL_REGION:
-               if (!add_dcr(acpi_desc, table))
+               if (!add_dcr(acpi_desc, prev, table))
                        return err;
                break;
        case ACPI_NFIT_TYPE_DATA_REGION:
-               if (!add_bdw(acpi_desc, table))
+               if (!add_bdw(acpi_desc, prev, table))
                        return err;
                break;
        case ACPI_NFIT_TYPE_INTERLEAVE:
-               if (!add_idt(acpi_desc, table))
+               if (!add_idt(acpi_desc, prev, table))
                        return err;
                break;
        case ACPI_NFIT_TYPE_FLUSH_ADDRESS:
-               if (!add_flush(acpi_desc, table))
+               if (!add_flush(acpi_desc, prev, table))
                        return err;
                break;
        case ACPI_NFIT_TYPE_SMBIOS:
@@ -802,12 +860,7 @@ static int acpi_nfit_register_dimms(struct acpi_nfit_desc *acpi_desc)
                device_handle = __to_nfit_memdev(nfit_mem)->device_handle;
                nvdimm = acpi_nfit_dimm_by_handle(acpi_desc, device_handle);
                if (nvdimm) {
-                       /*
-                        * If for some reason we find multiple DCRs the
-                        * first one wins
-                        */
-                       dev_err(acpi_desc->dev, "duplicate DCR detected: %s\n",
-                                       nvdimm_name(nvdimm));
+                       dimm_count++;
                        continue;
                }
 
@@ -1476,6 +1529,9 @@ static int acpi_nfit_register_region(struct acpi_nfit_desc *acpi_desc,
        struct resource res;
        int count = 0, rc;
 
+       if (nfit_spa->is_registered)
+               return 0;
+
        if (spa->range_index == 0) {
                dev_dbg(acpi_desc->dev, "%s: detected invalid spa index\n",
                                __func__);
@@ -1529,6 +1585,8 @@ static int acpi_nfit_register_region(struct acpi_nfit_desc *acpi_desc,
                if (!nvdimm_volatile_region_create(nvdimm_bus, ndr_desc))
                        return -ENOMEM;
        }
+
+       nfit_spa->is_registered = 1;
        return 0;
 }
 
@@ -1545,71 +1603,101 @@ static int acpi_nfit_register_regions(struct acpi_nfit_desc *acpi_desc)
        return 0;
 }
 
+static int acpi_nfit_check_deletions(struct acpi_nfit_desc *acpi_desc,
+               struct nfit_table_prev *prev)
+{
+       struct device *dev = acpi_desc->dev;
+
+       if (!list_empty(&prev->spas) ||
+                       !list_empty(&prev->memdevs) ||
+                       !list_empty(&prev->dcrs) ||
+                       !list_empty(&prev->bdws) ||
+                       !list_empty(&prev->idts) ||
+                       !list_empty(&prev->flushes)) {
+               dev_err(dev, "new nfit deletes entries (unsupported)\n");
+               return -ENXIO;
+       }
+       return 0;
+}
+
 int acpi_nfit_init(struct acpi_nfit_desc *acpi_desc, acpi_size sz)
 {
        struct device *dev = acpi_desc->dev;
+       struct nfit_table_prev prev;
        const void *end;
        u8 *data;
        int rc;
 
-       INIT_LIST_HEAD(&acpi_desc->spa_maps);
-       INIT_LIST_HEAD(&acpi_desc->spas);
-       INIT_LIST_HEAD(&acpi_desc->dcrs);
-       INIT_LIST_HEAD(&acpi_desc->bdws);
-       INIT_LIST_HEAD(&acpi_desc->idts);
-       INIT_LIST_HEAD(&acpi_desc->flushes);
-       INIT_LIST_HEAD(&acpi_desc->memdevs);
-       INIT_LIST_HEAD(&acpi_desc->dimms);
-       mutex_init(&acpi_desc->spa_map_mutex);
+       mutex_lock(&acpi_desc->init_mutex);
+
+       INIT_LIST_HEAD(&prev.spas);
+       INIT_LIST_HEAD(&prev.memdevs);
+       INIT_LIST_HEAD(&prev.dcrs);
+       INIT_LIST_HEAD(&prev.bdws);
+       INIT_LIST_HEAD(&prev.idts);
+       INIT_LIST_HEAD(&prev.flushes);
+
+       list_cut_position(&prev.spas, &acpi_desc->spas,
+                               acpi_desc->spas.prev);
+       list_cut_position(&prev.memdevs, &acpi_desc->memdevs,
+                               acpi_desc->memdevs.prev);
+       list_cut_position(&prev.dcrs, &acpi_desc->dcrs,
+                               acpi_desc->dcrs.prev);
+       list_cut_position(&prev.bdws, &acpi_desc->bdws,
+                               acpi_desc->bdws.prev);
+       list_cut_position(&prev.idts, &acpi_desc->idts,
+                               acpi_desc->idts.prev);
+       list_cut_position(&prev.flushes, &acpi_desc->flushes,
+                               acpi_desc->flushes.prev);
 
        data = (u8 *) acpi_desc->nfit;
        end = data + sz;
        data += sizeof(struct acpi_table_nfit);
        while (!IS_ERR_OR_NULL(data))
-               data = add_table(acpi_desc, data, end);
+               data = add_table(acpi_desc, &prev, data, end);
 
        if (IS_ERR(data)) {
                dev_dbg(dev, "%s: nfit table parsing error: %ld\n", __func__,
                                PTR_ERR(data));
-               return PTR_ERR(data);
+               rc = PTR_ERR(data);
+               goto out_unlock;
        }
 
-       if (nfit_mem_init(acpi_desc) != 0)
-               return -ENOMEM;
+       rc = acpi_nfit_check_deletions(acpi_desc, &prev);
+       if (rc)
+               goto out_unlock;
+
+       if (nfit_mem_init(acpi_desc) != 0) {
+               rc = -ENOMEM;
+               goto out_unlock;
+       }
 
        acpi_nfit_init_dsms(acpi_desc);
 
        rc = acpi_nfit_register_dimms(acpi_desc);
        if (rc)
-               return rc;
+               goto out_unlock;
+
+       rc = acpi_nfit_register_regions(acpi_desc);
 
-       return acpi_nfit_register_regions(acpi_desc);
+ out_unlock:
+       mutex_unlock(&acpi_desc->init_mutex);
+       return rc;
 }
 EXPORT_SYMBOL_GPL(acpi_nfit_init);
 
-static int acpi_nfit_add(struct acpi_device *adev)
+static struct acpi_nfit_desc *acpi_nfit_desc_init(struct acpi_device *adev)
 {
        struct nvdimm_bus_descriptor *nd_desc;
        struct acpi_nfit_desc *acpi_desc;
        struct device *dev = &adev->dev;
-       struct acpi_table_header *tbl;
-       acpi_status status = AE_OK;
-       acpi_size sz;
-       int rc;
-
-       status = acpi_get_table_with_size("NFIT", 0, &tbl, &sz);
-       if (ACPI_FAILURE(status)) {
-               dev_err(dev, "failed to find NFIT\n");
-               return -ENXIO;
-       }
 
        acpi_desc = devm_kzalloc(dev, sizeof(*acpi_desc), GFP_KERNEL);
        if (!acpi_desc)
-               return -ENOMEM;
+               return ERR_PTR(-ENOMEM);
 
        dev_set_drvdata(dev, acpi_desc);
        acpi_desc->dev = dev;
-       acpi_desc->nfit = (struct acpi_table_nfit *) tbl;
        acpi_desc->blk_do_io = acpi_nfit_blk_region_do_io;
        nd_desc = &acpi_desc->nd_desc;
        nd_desc->provider_name = "ACPI.NFIT";
@@ -1617,8 +1705,57 @@ static int acpi_nfit_add(struct acpi_device *adev)
        nd_desc->attr_groups = acpi_nfit_attribute_groups;
 
        acpi_desc->nvdimm_bus = nvdimm_bus_register(dev, nd_desc);
-       if (!acpi_desc->nvdimm_bus)
-               return -ENXIO;
+       if (!acpi_desc->nvdimm_bus) {
+               devm_kfree(dev, acpi_desc);
+               return ERR_PTR(-ENXIO);
+       }
+
+       INIT_LIST_HEAD(&acpi_desc->spa_maps);
+       INIT_LIST_HEAD(&acpi_desc->spas);
+       INIT_LIST_HEAD(&acpi_desc->dcrs);
+       INIT_LIST_HEAD(&acpi_desc->bdws);
+       INIT_LIST_HEAD(&acpi_desc->idts);
+       INIT_LIST_HEAD(&acpi_desc->flushes);
+       INIT_LIST_HEAD(&acpi_desc->memdevs);
+       INIT_LIST_HEAD(&acpi_desc->dimms);
+       mutex_init(&acpi_desc->spa_map_mutex);
+       mutex_init(&acpi_desc->init_mutex);
+
+       return acpi_desc;
+}
+
+static int acpi_nfit_add(struct acpi_device *adev)
+{
+       struct acpi_buffer buf = { ACPI_ALLOCATE_BUFFER, NULL };
+       struct acpi_nfit_desc *acpi_desc;
+       struct device *dev = &adev->dev;
+       struct acpi_table_header *tbl;
+       acpi_status status = AE_OK;
+       acpi_size sz;
+       int rc;
+
+       status = acpi_get_table_with_size("NFIT", 0, &tbl, &sz);
+       if (ACPI_FAILURE(status)) {
+               /* This is ok, we could have an nvdimm hotplugged later */
+               dev_dbg(dev, "failed to find NFIT at startup\n");
+               return 0;
+       }
+
+       acpi_desc = acpi_nfit_desc_init(adev);
+       if (IS_ERR(acpi_desc)) {
+               dev_err(dev, "%s: error initializing acpi_desc: %ld\n",
+                               __func__, PTR_ERR(acpi_desc));
+               return PTR_ERR(acpi_desc);
+       }
+
+       acpi_desc->nfit = (struct acpi_table_nfit *) tbl;
+
+       /* Evaluate _FIT and override with that if present */
+       status = acpi_evaluate_object(adev->handle, "_FIT", NULL, &buf);
+       if (ACPI_SUCCESS(status) && buf.length > 0) {
+               acpi_desc->nfit = (struct acpi_table_nfit *)buf.pointer;
+               sz = buf.length;
+       }
 
        rc = acpi_nfit_init(acpi_desc, sz);
        if (rc) {
@@ -1636,6 +1773,54 @@ static int acpi_nfit_remove(struct acpi_device *adev)
        return 0;
 }
 
+static void acpi_nfit_notify(struct acpi_device *adev, u32 event)
+{
+       struct acpi_nfit_desc *acpi_desc = dev_get_drvdata(&adev->dev);
+       struct acpi_buffer buf = { ACPI_ALLOCATE_BUFFER, NULL };
+       struct acpi_table_nfit *nfit_saved;
+       struct device *dev = &adev->dev;
+       acpi_status status;
+       int ret;
+
+       dev_dbg(dev, "%s: event: %d\n", __func__, event);
+
+       device_lock(dev);
+       if (!dev->driver) {
+               /* dev->driver may be null if we're being removed */
+               dev_dbg(dev, "%s: no driver found for dev\n", __func__);
+               return;
+       }
+
+       if (!acpi_desc) {
+               acpi_desc = acpi_nfit_desc_init(adev);
+               if (IS_ERR(acpi_desc)) {
+                       dev_err(dev, "%s: error initializing acpi_desc: %ld\n",
+                               __func__, PTR_ERR(acpi_desc));
+                       goto out_unlock;
+               }
+       }
+
+       /* Evaluate _FIT */
+       status = acpi_evaluate_object(adev->handle, "_FIT", NULL, &buf);
+       if (ACPI_FAILURE(status)) {
+               dev_err(dev, "failed to evaluate _FIT\n");
+               goto out_unlock;
+       }
+
+       nfit_saved = acpi_desc->nfit;
+       acpi_desc->nfit = (struct acpi_table_nfit *)buf.pointer;
+       ret = acpi_nfit_init(acpi_desc, buf.length);
+       if (!ret) {
+               /* Merge failed, restore old nfit, and exit */
+               acpi_desc->nfit = nfit_saved;
+               dev_err(dev, "failed to merge updated NFIT\n");
+       }
+       kfree(buf.pointer);
+
+ out_unlock:
+       device_unlock(dev);
+}
+
 static const struct acpi_device_id acpi_nfit_ids[] = {
        { "ACPI0012", 0 },
        { "", 0 },
@@ -1648,6 +1833,7 @@ static struct acpi_driver acpi_nfit_driver = {
        .ops = {
                .add = acpi_nfit_add,
                .remove = acpi_nfit_remove,
+               .notify = acpi_nfit_notify,
        },
 };
 
index 329a1eba0c164e79cac859c28afeab456755ca89..2ea5c0797c8f4575c090a34352ceba14d9a5af40 100644 (file)
@@ -48,6 +48,7 @@ enum {
 struct nfit_spa {
        struct acpi_nfit_system_address *spa;
        struct list_head list;
+       int is_registered;
 };
 
 struct nfit_dcr {
@@ -97,6 +98,7 @@ struct acpi_nfit_desc {
        struct nvdimm_bus_descriptor nd_desc;
        struct acpi_table_nfit *nfit;
        struct mutex spa_map_mutex;
+       struct mutex init_mutex;
        struct list_head spa_maps;
        struct list_head memdevs;
        struct list_head flushes;
index 87546469011741d7ce20b03bd5870e0f48eca641..8fc654f0807bff66c2473b88010e67fe5ab0cb36 100644 (file)
@@ -82,12 +82,12 @@ static struct devres_group * node_to_group(struct devres_node *node)
 }
 
 static __always_inline struct devres * alloc_dr(dr_release_t release,
-                                               size_t size, gfp_t gfp)
+                                               size_t size, gfp_t gfp, int nid)
 {
        size_t tot_size = sizeof(struct devres) + size;
        struct devres *dr;
 
-       dr = kmalloc_track_caller(tot_size, gfp);
+       dr = kmalloc_node_track_caller(tot_size, gfp, nid);
        if (unlikely(!dr))
                return NULL;
 
@@ -106,24 +106,25 @@ static void add_dr(struct device *dev, struct devres_node *node)
 }
 
 #ifdef CONFIG_DEBUG_DEVRES
-void * __devres_alloc(dr_release_t release, size_t size, gfp_t gfp,
+void * __devres_alloc_node(dr_release_t release, size_t size, gfp_t gfp, int nid,
                      const char *name)
 {
        struct devres *dr;
 
-       dr = alloc_dr(release, size, gfp | __GFP_ZERO);
+       dr = alloc_dr(release, size, gfp | __GFP_ZERO, nid);
        if (unlikely(!dr))
                return NULL;
        set_node_dbginfo(&dr->node, name, size);
        return dr->data;
 }
-EXPORT_SYMBOL_GPL(__devres_alloc);
+EXPORT_SYMBOL_GPL(__devres_alloc_node);
 #else
 /**
  * devres_alloc - Allocate device resource data
  * @release: Release function devres will be associated with
  * @size: Allocation size
  * @gfp: Allocation flags
+ * @nid: NUMA node
  *
  * Allocate devres of @size bytes.  The allocated area is zeroed, then
  * associated with @release.  The returned pointer can be passed to
@@ -132,16 +133,16 @@ EXPORT_SYMBOL_GPL(__devres_alloc);
  * RETURNS:
  * Pointer to allocated devres on success, NULL on failure.
  */
-void * devres_alloc(dr_release_t release, size_t size, gfp_t gfp)
+void * devres_alloc_node(dr_release_t release, size_t size, gfp_t gfp, int nid)
 {
        struct devres *dr;
 
-       dr = alloc_dr(release, size, gfp | __GFP_ZERO);
+       dr = alloc_dr(release, size, gfp | __GFP_ZERO, nid);
        if (unlikely(!dr))
                return NULL;
        return dr->data;
 }
-EXPORT_SYMBOL_GPL(devres_alloc);
+EXPORT_SYMBOL_GPL(devres_alloc_node);
 #endif
 
 /**
@@ -776,7 +777,7 @@ void * devm_kmalloc(struct device *dev, size_t size, gfp_t gfp)
        struct devres *dr;
 
        /* use raw alloc_dr for kmalloc caller tracing */
-       dr = alloc_dr(devm_kmalloc_release, size, gfp);
+       dr = alloc_dr(devm_kmalloc_release, size, gfp, dev_to_node(dev));
        if (unlikely(!dr))
                return NULL;
 
index fd0973b922a7508629b5d33348ccc7535989ca78..60ee5591ee8f0d58d8229bad412d0f5882064e6a 100644 (file)
@@ -93,7 +93,7 @@ static int __pm_clk_add(struct device *dev, const char *con_id,
                        return -ENOMEM;
                }
        } else {
-               if (IS_ERR(clk) || !__clk_get(clk)) {
+               if (IS_ERR(clk)) {
                        kfree(ce);
                        return -ENOENT;
                }
@@ -127,7 +127,9 @@ int pm_clk_add(struct device *dev, const char *con_id)
  * @clk: Clock pointer
  *
  * Add the clock to the list of clocks used for the power management of @dev.
- * It will increment refcount on clock pointer, use clk_put() on it when done.
+ * The power-management code will take control of the clock reference, so
+ * callers should not call clk_put() on @clk after this function sucessfully
+ * returned.
  */
 int pm_clk_add_clk(struct device *dev, struct clk *clk)
 {
index b9794aeeb878cc7a054be313063191399b717159..c9f9c30d646756296e0e4bdd212a33ba28a479b6 100644 (file)
@@ -323,7 +323,7 @@ out:
        return err;
 }
 
-static void brd_make_request(struct request_queue *q, struct bio *bio)
+static blk_qc_t brd_make_request(struct request_queue *q, struct bio *bio)
 {
        struct block_device *bdev = bio->bi_bdev;
        struct brd_device *brd = bdev->bd_disk->private_data;
@@ -358,9 +358,10 @@ static void brd_make_request(struct request_queue *q, struct bio *bio)
 
 out:
        bio_endio(bio);
-       return;
+       return BLK_QC_T_NONE;
 io_error:
        bio_io_error(bio);
+       return BLK_QC_T_NONE;
 }
 
 static int brd_rw_page(struct block_device *bdev, sector_t sector,
index 015c6e91b75683c000f9342b00e7898abb6be8df..e66d453a5f2b1bcdf10ffa367917205081bd7587 100644 (file)
@@ -1448,7 +1448,7 @@ extern int proc_details;
 /* drbd_req */
 extern void do_submit(struct work_struct *ws);
 extern void __drbd_make_request(struct drbd_device *, struct bio *, unsigned long);
-extern void drbd_make_request(struct request_queue *q, struct bio *bio);
+extern blk_qc_t drbd_make_request(struct request_queue *q, struct bio *bio);
 extern int drbd_read_remote(struct drbd_device *device, struct drbd_request *req);
 extern int is_valid_ar_handle(struct drbd_request *, sector_t);
 
index 211592682169656ef4ea66f3def62ac45000b3eb..3ae2c00865635f889e4040d0e218786c237ff3e6 100644 (file)
@@ -1494,7 +1494,7 @@ void do_submit(struct work_struct *ws)
        }
 }
 
-void drbd_make_request(struct request_queue *q, struct bio *bio)
+blk_qc_t drbd_make_request(struct request_queue *q, struct bio *bio)
 {
        struct drbd_device *device = (struct drbd_device *) q->queuedata;
        unsigned long start_jif;
@@ -1510,6 +1510,7 @@ void drbd_make_request(struct request_queue *q, struct bio *bio)
 
        inc_ap_bio(device);
        __drbd_make_request(device, bio, start_jif);
+       return BLK_QC_T_NONE;
 }
 
 void request_timer_fn(unsigned long data)
index 1c9e4fe5aa440cbde62bb5e6c0cf0c397d8417a7..6255d1c4bba46c802548806ff95ee213ffd3f0e6 100644 (file)
@@ -321,7 +321,7 @@ static struct nullb_queue *nullb_to_queue(struct nullb *nullb)
        return &nullb->queues[index];
 }
 
-static void null_queue_bio(struct request_queue *q, struct bio *bio)
+static blk_qc_t null_queue_bio(struct request_queue *q, struct bio *bio)
 {
        struct nullb *nullb = q->queuedata;
        struct nullb_queue *nq = nullb_to_queue(nullb);
@@ -331,6 +331,7 @@ static void null_queue_bio(struct request_queue *q, struct bio *bio)
        cmd->bio = bio;
 
        null_handle_cmd(cmd);
+       return BLK_QC_T_NONE;
 }
 
 static int null_rq_prep_fn(struct request_queue *q, struct request *req)
index 2f477d45d6cfa42d586080db8c293d41406055ae..d06c62eccdf00b81241fba6b3e6d3a05e4e4c923 100644 (file)
@@ -2441,7 +2441,7 @@ static void pkt_make_request_write(struct request_queue *q, struct bio *bio)
        }
 }
 
-static void pkt_make_request(struct request_queue *q, struct bio *bio)
+static blk_qc_t pkt_make_request(struct request_queue *q, struct bio *bio)
 {
        struct pktcdvd_device *pd;
        char b[BDEVNAME_SIZE];
@@ -2467,7 +2467,7 @@ static void pkt_make_request(struct request_queue *q, struct bio *bio)
         */
        if (bio_data_dir(bio) == READ) {
                pkt_make_request_read(pd, bio);
-               return;
+               return BLK_QC_T_NONE;
        }
 
        if (!test_bit(PACKET_WRITABLE, &pd->flags)) {
@@ -2499,13 +2499,12 @@ static void pkt_make_request(struct request_queue *q, struct bio *bio)
                pkt_make_request_write(q, split);
        } while (split != bio);
 
-       return;
+       return BLK_QC_T_NONE;
 end_io:
        bio_io_error(bio);
+       return BLK_QC_T_NONE;
 }
 
-
-
 static void pkt_init_queue(struct pktcdvd_device *pd)
 {
        struct request_queue *q = pd->disk->queue;
index d89fcac59515193c0507ab10fde01c47f3640b84..56847fcda0860aad24b0dbf84c822691e343dce3 100644 (file)
@@ -598,7 +598,7 @@ out:
        return next;
 }
 
-static void ps3vram_make_request(struct request_queue *q, struct bio *bio)
+static blk_qc_t ps3vram_make_request(struct request_queue *q, struct bio *bio)
 {
        struct ps3_system_bus_device *dev = q->queuedata;
        struct ps3vram_priv *priv = ps3_system_bus_get_drvdata(dev);
@@ -614,11 +614,13 @@ static void ps3vram_make_request(struct request_queue *q, struct bio *bio)
        spin_unlock_irq(&priv->lock);
 
        if (busy)
-               return;
+               return BLK_QC_T_NONE;
 
        do {
                bio = ps3vram_do_bio(dev, bio);
        } while (bio);
+
+       return BLK_QC_T_NONE;
 }
 
 static int ps3vram_probe(struct ps3_system_bus_device *dev)
index 3163e4cdc2cc54a18af9ac8845311dce0440995c..e1b8b7061d2f8b224f851131e9324726bf89277c 100644 (file)
@@ -145,7 +145,7 @@ static void bio_dma_done_cb(struct rsxx_cardinfo *card,
        }
 }
 
-static void rsxx_make_request(struct request_queue *q, struct bio *bio)
+static blk_qc_t rsxx_make_request(struct request_queue *q, struct bio *bio)
 {
        struct rsxx_cardinfo *card = q->queuedata;
        struct rsxx_bio_meta *bio_meta;
@@ -199,7 +199,7 @@ static void rsxx_make_request(struct request_queue *q, struct bio *bio)
        if (st)
                goto queue_err;
 
-       return;
+       return BLK_QC_T_NONE;
 
 queue_err:
        kmem_cache_free(bio_meta_pool, bio_meta);
@@ -207,6 +207,7 @@ req_err:
        if (st)
                bio->bi_error = st;
        bio_endio(bio);
+       return BLK_QC_T_NONE;
 }
 
 /*----------------- Device Setup -------------------*/
index 04d65790a8862a91be1d1b40f8baef7f850824d6..7939b9f8744135d137e222c6593cc0a96b94c18a 100644 (file)
@@ -524,7 +524,7 @@ static int mm_check_plugged(struct cardinfo *card)
        return !!blk_check_plugged(mm_unplug, card, sizeof(struct blk_plug_cb));
 }
 
-static void mm_make_request(struct request_queue *q, struct bio *bio)
+static blk_qc_t mm_make_request(struct request_queue *q, struct bio *bio)
 {
        struct cardinfo *card = q->queuedata;
        pr_debug("mm_make_request %llu %u\n",
@@ -541,7 +541,7 @@ static void mm_make_request(struct request_queue *q, struct bio *bio)
                activate(card);
        spin_unlock_irq(&card->lock);
 
-       return;
+       return BLK_QC_T_NONE;
 }
 
 static irqreturn_t mm_interrupt(int irq, void *__card)
index 81a557c33a1f8b4a41b19f39b58d8c0e0e40ae35..47915d736f8d4fd2f145dca24f97c015fa76a245 100644 (file)
@@ -894,7 +894,7 @@ out:
 /*
  * Handler function for all zram I/O requests.
  */
-static void zram_make_request(struct request_queue *queue, struct bio *bio)
+static blk_qc_t zram_make_request(struct request_queue *queue, struct bio *bio)
 {
        struct zram *zram = queue->queuedata;
 
@@ -911,11 +911,12 @@ static void zram_make_request(struct request_queue *queue, struct bio *bio)
 
        __zram_make_request(zram, bio);
        zram_meta_put(zram);
-       return;
+       return BLK_QC_T_NONE;
 put_zram:
        zram_meta_put(zram);
 error:
        bio_io_error(bio);
+       return BLK_QC_T_NONE;
 }
 
 static void zram_slot_free_notify(struct block_device *bdev,
index e33dacf5bd98765178ddac60f7d50d742de555ac..92f0ee388f9e0bfddd0cdf32b684edf25741d991 100644 (file)
@@ -1372,6 +1372,8 @@ static void btusb_work(struct work_struct *work)
                }
 
                if (data->isoc_altsetting != new_alts) {
+                       unsigned long flags;
+
                        clear_bit(BTUSB_ISOC_RUNNING, &data->flags);
                        usb_kill_anchored_urbs(&data->isoc_anchor);
 
@@ -1384,10 +1386,10 @@ static void btusb_work(struct work_struct *work)
                         * Clear outstanding fragment when selecting a new
                         * alternate setting.
                         */
-                       spin_lock(&data->rxlock);
+                       spin_lock_irqsave(&data->rxlock, flags);
                        kfree_skb(data->sco_skb);
                        data->sco_skb = NULL;
-                       spin_unlock(&data->rxlock);
+                       spin_unlock_irqrestore(&data->rxlock, flags);
 
                        if (__set_isoc_interface(hdev, new_alts) < 0)
                                return;
index 0ebca8ba7bc4103eeeb48c2fe245404091e0c9d3..116b363b79872ddbb724a6b8a6ee042d960ba9b5 100644 (file)
@@ -120,6 +120,17 @@ config SIMPLE_PM_BUS
          Controller (BSC, sometimes called "LBSC within Bus Bridge", or
          "External Bus Interface") as found on several Renesas ARM SoCs.
 
+config SUNXI_RSB
+       tristate "Allwinner sunXi Reduced Serial Bus Driver"
+         default MACH_SUN8I || MACH_SUN9I
+         depends on ARCH_SUNXI
+         select REGMAP
+         help
+         Say y here to enable support for Allwinner's Reduced Serial Bus
+         (RSB) support. This controller is responsible for communicating
+         with various RSB based devices, such as AXP223, AXP8XX PMICs,
+         and AC100/AC200 ICs.
+
 config VEXPRESS_CONFIG
        bool "Versatile Express configuration bus"
        default y if ARCH_VEXPRESS
index 790e7b933fb2f9b2a266d43ecfec16620605fe2f..fcb9f9794a1f575979e466d5a7b72f68dac8057a 100644 (file)
@@ -15,5 +15,6 @@ obj-$(CONFIG_MVEBU_MBUS)      += mvebu-mbus.o
 obj-$(CONFIG_OMAP_INTERCONNECT)        += omap_l3_smx.o omap_l3_noc.o
 
 obj-$(CONFIG_OMAP_OCP2SCP)     += omap-ocp2scp.o
+obj-$(CONFIG_SUNXI_RSB)                += sunxi-rsb.o
 obj-$(CONFIG_SIMPLE_PM_BUS)    += simple-pm-bus.o
 obj-$(CONFIG_VEXPRESS_CONFIG)  += vexpress-config.o
diff --git a/drivers/bus/sunxi-rsb.c b/drivers/bus/sunxi-rsb.c
new file mode 100644 (file)
index 0000000..846bc29
--- /dev/null
@@ -0,0 +1,783 @@
+/*
+ * RSB (Reduced Serial Bus) driver.
+ *
+ * Author: Chen-Yu Tsai <wens@csie.org>
+ *
+ * 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.
+ *
+ * The RSB controller looks like an SMBus controller which only supports
+ * byte and word data transfers. But, it differs from standard SMBus
+ * protocol on several aspects:
+ * - it uses addresses set at runtime to address slaves. Runtime addresses
+ *   are sent to slaves using their 12bit hardware addresses. Up to 15
+ *   runtime addresses are available.
+ * - it adds a parity bit every 8bits of data and address for read and
+ *   write accesses; this replaces the ack bit
+ * - only one read access is required to read a byte (instead of a write
+ *   followed by a read access in standard SMBus protocol)
+ * - there's no Ack bit after each read access
+ *
+ * This means this bus cannot be used to interface with standard SMBus
+ * devices. Devices known to support this interface include the AXP223,
+ * AXP809, and AXP806 PMICs, and the AC100 audio codec, all from X-Powers.
+ *
+ * A description of the operation and wire protocol can be found in the
+ * RSB section of Allwinner's A80 user manual, which can be found at
+ *
+ *     https://github.com/allwinner-zh/documents/tree/master/A80
+ *
+ * This document is officially released by Allwinner.
+ *
+ * This driver is based on i2c-sun6i-p2wi.c, the P2WI bus driver.
+ *
+ */
+
+#include <linux/clk.h>
+#include <linux/clk/clk-conf.h>
+#include <linux/device.h>
+#include <linux/interrupt.h>
+#include <linux/io.h>
+#include <linux/iopoll.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/of_irq.h>
+#include <linux/of_platform.h>
+#include <linux/platform_device.h>
+#include <linux/regmap.h>
+#include <linux/reset.h>
+#include <linux/slab.h>
+#include <linux/sunxi-rsb.h>
+#include <linux/types.h>
+
+/* RSB registers */
+#define RSB_CTRL       0x0     /* Global control */
+#define RSB_CCR                0x4     /* Clock control */
+#define RSB_INTE       0x8     /* Interrupt controls */
+#define RSB_INTS       0xc     /* Interrupt status */
+#define RSB_ADDR       0x10    /* Address to send with read/write command */
+#define RSB_DATA       0x1c    /* Data to read/write */
+#define RSB_LCR                0x24    /* Line control */
+#define RSB_DMCR       0x28    /* Device mode (init) control */
+#define RSB_CMD                0x2c    /* RSB Command */
+#define RSB_DAR                0x30    /* Device address / runtime address */
+
+/* CTRL fields */
+#define RSB_CTRL_START_TRANS           BIT(7)
+#define RSB_CTRL_ABORT_TRANS           BIT(6)
+#define RSB_CTRL_GLOBAL_INT_ENB                BIT(1)
+#define RSB_CTRL_SOFT_RST              BIT(0)
+
+/* CLK CTRL fields */
+#define RSB_CCR_SDA_OUT_DELAY(v)       (((v) & 0x7) << 8)
+#define RSB_CCR_MAX_CLK_DIV            0xff
+#define RSB_CCR_CLK_DIV(v)             ((v) & RSB_CCR_MAX_CLK_DIV)
+
+/* STATUS fields */
+#define RSB_INTS_TRANS_ERR_ACK         BIT(16)
+#define RSB_INTS_TRANS_ERR_DATA_BIT(v) (((v) >> 8) & 0xf)
+#define RSB_INTS_TRANS_ERR_DATA                GENMASK(11, 8)
+#define RSB_INTS_LOAD_BSY              BIT(2)
+#define RSB_INTS_TRANS_ERR             BIT(1)
+#define RSB_INTS_TRANS_OVER            BIT(0)
+
+/* LINE CTRL fields*/
+#define RSB_LCR_SCL_STATE              BIT(5)
+#define RSB_LCR_SDA_STATE              BIT(4)
+#define RSB_LCR_SCL_CTL                        BIT(3)
+#define RSB_LCR_SCL_CTL_EN             BIT(2)
+#define RSB_LCR_SDA_CTL                        BIT(1)
+#define RSB_LCR_SDA_CTL_EN             BIT(0)
+
+/* DEVICE MODE CTRL field values */
+#define RSB_DMCR_DEVICE_START          BIT(31)
+#define RSB_DMCR_MODE_DATA             (0x7c << 16)
+#define RSB_DMCR_MODE_REG              (0x3e << 8)
+#define RSB_DMCR_DEV_ADDR              0x00
+
+/* CMD values */
+#define RSB_CMD_RD8                    0x8b
+#define RSB_CMD_RD16                   0x9c
+#define RSB_CMD_RD32                   0xa6
+#define RSB_CMD_WR8                    0x4e
+#define RSB_CMD_WR16                   0x59
+#define RSB_CMD_WR32                   0x63
+#define RSB_CMD_STRA                   0xe8
+
+/* DAR fields */
+#define RSB_DAR_RTA(v)                 (((v) & 0xff) << 16)
+#define RSB_DAR_DA(v)                  ((v) & 0xffff)
+
+#define RSB_MAX_FREQ                   20000000
+
+#define RSB_CTRL_NAME                  "sunxi-rsb"
+
+struct sunxi_rsb_addr_map {
+       u16 hwaddr;
+       u8 rtaddr;
+};
+
+struct sunxi_rsb {
+       struct device *dev;
+       void __iomem *regs;
+       struct clk *clk;
+       struct reset_control *rstc;
+       struct completion complete;
+       struct mutex lock;
+       unsigned int status;
+};
+
+/* bus / slave device related functions */
+static struct bus_type sunxi_rsb_bus;
+
+static int sunxi_rsb_device_match(struct device *dev, struct device_driver *drv)
+{
+       return of_driver_match_device(dev, drv);
+}
+
+static int sunxi_rsb_device_probe(struct device *dev)
+{
+       const struct sunxi_rsb_driver *drv = to_sunxi_rsb_driver(dev->driver);
+       struct sunxi_rsb_device *rdev = to_sunxi_rsb_device(dev);
+       int ret;
+
+       if (!drv->probe)
+               return -ENODEV;
+
+       if (!rdev->irq) {
+               int irq = -ENOENT;
+
+               if (dev->of_node)
+                       irq = of_irq_get(dev->of_node, 0);
+
+               if (irq == -EPROBE_DEFER)
+                       return irq;
+               if (irq < 0)
+                       irq = 0;
+
+               rdev->irq = irq;
+       }
+
+       ret = of_clk_set_defaults(dev->of_node, false);
+       if (ret < 0)
+               return ret;
+
+       return drv->probe(rdev);
+}
+
+static int sunxi_rsb_device_remove(struct device *dev)
+{
+       const struct sunxi_rsb_driver *drv = to_sunxi_rsb_driver(dev->driver);
+
+       return drv->remove(to_sunxi_rsb_device(dev));
+}
+
+static struct bus_type sunxi_rsb_bus = {
+       .name           = RSB_CTRL_NAME,
+       .match          = sunxi_rsb_device_match,
+       .probe          = sunxi_rsb_device_probe,
+       .remove         = sunxi_rsb_device_remove,
+};
+
+static void sunxi_rsb_dev_release(struct device *dev)
+{
+       struct sunxi_rsb_device *rdev = to_sunxi_rsb_device(dev);
+
+       kfree(rdev);
+}
+
+/**
+ * sunxi_rsb_device_create() - allocate and add an RSB device
+ * @rsb:       RSB controller
+ * @node:      RSB slave device node
+ * @hwaddr:    RSB slave hardware address
+ * @rtaddr:    RSB slave runtime address
+ */
+static struct sunxi_rsb_device *sunxi_rsb_device_create(struct sunxi_rsb *rsb,
+               struct device_node *node, u16 hwaddr, u8 rtaddr)
+{
+       int err;
+       struct sunxi_rsb_device *rdev;
+
+       rdev = kzalloc(sizeof(*rdev), GFP_KERNEL);
+       if (!rdev)
+               return ERR_PTR(-ENOMEM);
+
+       rdev->rsb = rsb;
+       rdev->hwaddr = hwaddr;
+       rdev->rtaddr = rtaddr;
+       rdev->dev.bus = &sunxi_rsb_bus;
+       rdev->dev.parent = rsb->dev;
+       rdev->dev.of_node = node;
+       rdev->dev.release = sunxi_rsb_dev_release;
+
+       dev_set_name(&rdev->dev, "%s-%x", RSB_CTRL_NAME, hwaddr);
+
+       err = device_register(&rdev->dev);
+       if (err < 0) {
+               dev_err(&rdev->dev, "Can't add %s, status %d\n",
+                       dev_name(&rdev->dev), err);
+               goto err_device_add;
+       }
+
+       dev_dbg(&rdev->dev, "device %s registered\n", dev_name(&rdev->dev));
+
+err_device_add:
+       put_device(&rdev->dev);
+
+       return ERR_PTR(err);
+}
+
+/**
+ * sunxi_rsb_device_unregister(): unregister an RSB device
+ * @rdev:      rsb_device to be removed
+ */
+static void sunxi_rsb_device_unregister(struct sunxi_rsb_device *rdev)
+{
+       device_unregister(&rdev->dev);
+}
+
+static int sunxi_rsb_remove_devices(struct device *dev, void *data)
+{
+       struct sunxi_rsb_device *rdev = to_sunxi_rsb_device(dev);
+
+       if (dev->bus == &sunxi_rsb_bus)
+               sunxi_rsb_device_unregister(rdev);
+
+       return 0;
+}
+
+/**
+ * sunxi_rsb_driver_register() - Register device driver with RSB core
+ * @rdrv:      device driver to be associated with slave-device.
+ *
+ * This API will register the client driver with the RSB framework.
+ * It is typically called from the driver's module-init function.
+ */
+int sunxi_rsb_driver_register(struct sunxi_rsb_driver *rdrv)
+{
+       rdrv->driver.bus = &sunxi_rsb_bus;
+       return driver_register(&rdrv->driver);
+}
+EXPORT_SYMBOL_GPL(sunxi_rsb_driver_register);
+
+/* common code that starts a transfer */
+static int _sunxi_rsb_run_xfer(struct sunxi_rsb *rsb)
+{
+       if (readl(rsb->regs + RSB_CTRL) & RSB_CTRL_START_TRANS) {
+               dev_dbg(rsb->dev, "RSB transfer still in progress\n");
+               return -EBUSY;
+       }
+
+       reinit_completion(&rsb->complete);
+
+       writel(RSB_INTS_LOAD_BSY | RSB_INTS_TRANS_ERR | RSB_INTS_TRANS_OVER,
+              rsb->regs + RSB_INTE);
+       writel(RSB_CTRL_START_TRANS | RSB_CTRL_GLOBAL_INT_ENB,
+              rsb->regs + RSB_CTRL);
+
+       if (!wait_for_completion_io_timeout(&rsb->complete,
+                                           msecs_to_jiffies(100))) {
+               dev_dbg(rsb->dev, "RSB timeout\n");
+
+               /* abort the transfer */
+               writel(RSB_CTRL_ABORT_TRANS, rsb->regs + RSB_CTRL);
+
+               /* clear any interrupt flags */
+               writel(readl(rsb->regs + RSB_INTS), rsb->regs + RSB_INTS);
+
+               return -ETIMEDOUT;
+       }
+
+       if (rsb->status & RSB_INTS_LOAD_BSY) {
+               dev_dbg(rsb->dev, "RSB busy\n");
+               return -EBUSY;
+       }
+
+       if (rsb->status & RSB_INTS_TRANS_ERR) {
+               if (rsb->status & RSB_INTS_TRANS_ERR_ACK) {
+                       dev_dbg(rsb->dev, "RSB slave nack\n");
+                       return -EINVAL;
+               }
+
+               if (rsb->status & RSB_INTS_TRANS_ERR_DATA) {
+                       dev_dbg(rsb->dev, "RSB transfer data error\n");
+                       return -EIO;
+               }
+       }
+
+       return 0;
+}
+
+static int sunxi_rsb_read(struct sunxi_rsb *rsb, u8 rtaddr, u8 addr,
+                         u32 *buf, size_t len)
+{
+       u32 cmd;
+       int ret;
+
+       if (!buf)
+               return -EINVAL;
+
+       switch (len) {
+       case 1:
+               cmd = RSB_CMD_RD8;
+               break;
+       case 2:
+               cmd = RSB_CMD_RD16;
+               break;
+       case 4:
+               cmd = RSB_CMD_RD32;
+               break;
+       default:
+               dev_err(rsb->dev, "Invalid access width: %d\n", len);
+               return -EINVAL;
+       }
+
+       mutex_lock(&rsb->lock);
+
+       writel(addr, rsb->regs + RSB_ADDR);
+       writel(RSB_DAR_RTA(rtaddr), rsb->regs + RSB_DAR);
+       writel(cmd, rsb->regs + RSB_CMD);
+
+       ret = _sunxi_rsb_run_xfer(rsb);
+       if (ret)
+               goto out;
+
+       *buf = readl(rsb->regs + RSB_DATA);
+
+       mutex_unlock(&rsb->lock);
+
+out:
+       return ret;
+}
+
+static int sunxi_rsb_write(struct sunxi_rsb *rsb, u8 rtaddr, u8 addr,
+                          const u32 *buf, size_t len)
+{
+       u32 cmd;
+       int ret;
+
+       if (!buf)
+               return -EINVAL;
+
+       switch (len) {
+       case 1:
+               cmd = RSB_CMD_WR8;
+               break;
+       case 2:
+               cmd = RSB_CMD_WR16;
+               break;
+       case 4:
+               cmd = RSB_CMD_WR32;
+               break;
+       default:
+               dev_err(rsb->dev, "Invalid access width: %d\n", len);
+               return -EINVAL;
+       }
+
+       mutex_lock(&rsb->lock);
+
+       writel(addr, rsb->regs + RSB_ADDR);
+       writel(RSB_DAR_RTA(rtaddr), rsb->regs + RSB_DAR);
+       writel(*buf, rsb->regs + RSB_DATA);
+       writel(cmd, rsb->regs + RSB_CMD);
+       ret = _sunxi_rsb_run_xfer(rsb);
+
+       mutex_unlock(&rsb->lock);
+
+       return ret;
+}
+
+/* RSB regmap functions */
+struct sunxi_rsb_ctx {
+       struct sunxi_rsb_device *rdev;
+       int size;
+};
+
+static int regmap_sunxi_rsb_reg_read(void *context, unsigned int reg,
+                                    unsigned int *val)
+{
+       struct sunxi_rsb_ctx *ctx = context;
+       struct sunxi_rsb_device *rdev = ctx->rdev;
+
+       if (reg > 0xff)
+               return -EINVAL;
+
+       return sunxi_rsb_read(rdev->rsb, rdev->rtaddr, reg, val, ctx->size);
+}
+
+static int regmap_sunxi_rsb_reg_write(void *context, unsigned int reg,
+                                     unsigned int val)
+{
+       struct sunxi_rsb_ctx *ctx = context;
+       struct sunxi_rsb_device *rdev = ctx->rdev;
+
+       return sunxi_rsb_write(rdev->rsb, rdev->rtaddr, reg, &val, ctx->size);
+}
+
+static void regmap_sunxi_rsb_free_ctx(void *context)
+{
+       struct sunxi_rsb_ctx *ctx = context;
+
+       kfree(ctx);
+}
+
+static struct regmap_bus regmap_sunxi_rsb = {
+       .reg_write = regmap_sunxi_rsb_reg_write,
+       .reg_read = regmap_sunxi_rsb_reg_read,
+       .free_context = regmap_sunxi_rsb_free_ctx,
+       .reg_format_endian_default = REGMAP_ENDIAN_NATIVE,
+       .val_format_endian_default = REGMAP_ENDIAN_NATIVE,
+};
+
+static struct sunxi_rsb_ctx *regmap_sunxi_rsb_init_ctx(struct sunxi_rsb_device *rdev,
+               const struct regmap_config *config)
+{
+       struct sunxi_rsb_ctx *ctx;
+
+       switch (config->val_bits) {
+       case 8:
+       case 16:
+       case 32:
+               break;
+       default:
+               return ERR_PTR(-EINVAL);
+       }
+
+       ctx = kzalloc(sizeof(*ctx), GFP_KERNEL);
+       if (!ctx)
+               return ERR_PTR(-ENOMEM);
+
+       ctx->rdev = rdev;
+       ctx->size = config->val_bits / 8;
+
+       return ctx;
+}
+
+struct regmap *__devm_regmap_init_sunxi_rsb(struct sunxi_rsb_device *rdev,
+                                           const struct regmap_config *config,
+                                           struct lock_class_key *lock_key,
+                                           const char *lock_name)
+{
+       struct sunxi_rsb_ctx *ctx = regmap_sunxi_rsb_init_ctx(rdev, config);
+
+       if (IS_ERR(ctx))
+               return ERR_CAST(ctx);
+
+       return __devm_regmap_init(&rdev->dev, &regmap_sunxi_rsb, ctx, config,
+                                 lock_key, lock_name);
+}
+EXPORT_SYMBOL_GPL(__devm_regmap_init_sunxi_rsb);
+
+/* RSB controller driver functions */
+static irqreturn_t sunxi_rsb_irq(int irq, void *dev_id)
+{
+       struct sunxi_rsb *rsb = dev_id;
+       u32 status;
+
+       status = readl(rsb->regs + RSB_INTS);
+       rsb->status = status;
+
+       /* Clear interrupts */
+       status &= (RSB_INTS_LOAD_BSY | RSB_INTS_TRANS_ERR |
+                  RSB_INTS_TRANS_OVER);
+       writel(status, rsb->regs + RSB_INTS);
+
+       complete(&rsb->complete);
+
+       return IRQ_HANDLED;
+}
+
+static int sunxi_rsb_init_device_mode(struct sunxi_rsb *rsb)
+{
+       int ret = 0;
+       u32 reg;
+
+       /* send init sequence */
+       writel(RSB_DMCR_DEVICE_START | RSB_DMCR_MODE_DATA |
+              RSB_DMCR_MODE_REG | RSB_DMCR_DEV_ADDR, rsb->regs + RSB_DMCR);
+
+       readl_poll_timeout(rsb->regs + RSB_DMCR, reg,
+                          !(reg & RSB_DMCR_DEVICE_START), 100, 250000);
+       if (reg & RSB_DMCR_DEVICE_START)
+               ret = -ETIMEDOUT;
+
+       /* clear interrupt status bits */
+       writel(readl(rsb->regs + RSB_INTS), rsb->regs + RSB_INTS);
+
+       return ret;
+}
+
+/*
+ * There are 15 valid runtime addresses, though Allwinner typically
+ * skips the first, for unknown reasons, and uses the following three.
+ *
+ * 0x17, 0x2d, 0x3a, 0x4e, 0x59, 0x63, 0x74, 0x8b,
+ * 0x9c, 0xa6, 0xb1, 0xc5, 0xd2, 0xe8, 0xff
+ *
+ * No designs with 2 RSB slave devices sharing identical hardware
+ * addresses on the same bus have been seen in the wild. All designs
+ * use 0x2d for the primary PMIC, 0x3a for the secondary PMIC if
+ * there is one, and 0x45 for peripheral ICs.
+ *
+ * The hardware does not seem to support re-setting runtime addresses.
+ * Attempts to do so result in the slave devices returning a NACK.
+ * Hence we just hardcode the mapping here, like Allwinner does.
+ */
+
+static const struct sunxi_rsb_addr_map sunxi_rsb_addr_maps[] = {
+       { 0x3e3, 0x2d }, /* Primary PMIC: AXP223, AXP809, AXP81X, ... */
+       { 0x745, 0x3a }, /* Secondary PMIC: AXP806, ... */
+       { 0xe89, 0x45 }, /* Peripheral IC: AC100, ... */
+};
+
+static u8 sunxi_rsb_get_rtaddr(u16 hwaddr)
+{
+       int i;
+
+       for (i = 0; i < ARRAY_SIZE(sunxi_rsb_addr_maps); i++)
+               if (hwaddr == sunxi_rsb_addr_maps[i].hwaddr)
+                       return sunxi_rsb_addr_maps[i].rtaddr;
+
+       return 0; /* 0 is an invalid runtime address */
+}
+
+static int of_rsb_register_devices(struct sunxi_rsb *rsb)
+{
+       struct device *dev = rsb->dev;
+       struct device_node *child, *np = dev->of_node;
+       u32 hwaddr;
+       u8 rtaddr;
+       int ret;
+
+       if (!np)
+               return -EINVAL;
+
+       /* Runtime addresses for all slaves should be set first */
+       for_each_available_child_of_node(np, child) {
+               dev_dbg(dev, "setting child %s runtime address\n",
+                       child->full_name);
+
+               ret = of_property_read_u32(child, "reg", &hwaddr);
+               if (ret) {
+                       dev_err(dev, "%s: invalid 'reg' property: %d\n",
+                               child->full_name, ret);
+                       continue;
+               }
+
+               rtaddr = sunxi_rsb_get_rtaddr(hwaddr);
+               if (!rtaddr) {
+                       dev_err(dev, "%s: unknown hardware device address\n",
+                               child->full_name);
+                       continue;
+               }
+
+               /*
+                * Since no devices have been registered yet, we are the
+                * only ones using the bus, we can skip locking the bus.
+                */
+
+               /* setup command parameters */
+               writel(RSB_CMD_STRA, rsb->regs + RSB_CMD);
+               writel(RSB_DAR_RTA(rtaddr) | RSB_DAR_DA(hwaddr),
+                      rsb->regs + RSB_DAR);
+
+               /* send command */
+               ret = _sunxi_rsb_run_xfer(rsb);
+               if (ret)
+                       dev_warn(dev, "%s: set runtime address failed: %d\n",
+                                child->full_name, ret);
+       }
+
+       /* Then we start adding devices and probing them */
+       for_each_available_child_of_node(np, child) {
+               struct sunxi_rsb_device *rdev;
+
+               dev_dbg(dev, "adding child %s\n", child->full_name);
+
+               ret = of_property_read_u32(child, "reg", &hwaddr);
+               if (ret)
+                       continue;
+
+               rtaddr = sunxi_rsb_get_rtaddr(hwaddr);
+               if (!rtaddr)
+                       continue;
+
+               rdev = sunxi_rsb_device_create(rsb, child, hwaddr, rtaddr);
+               if (IS_ERR(rdev))
+                       dev_err(dev, "failed to add child device %s: %ld\n",
+                               child->full_name, PTR_ERR(rdev));
+       }
+
+       return 0;
+}
+
+static const struct of_device_id sunxi_rsb_of_match_table[] = {
+       { .compatible = "allwinner,sun8i-a23-rsb" },
+       {}
+};
+MODULE_DEVICE_TABLE(of, sunxi_rsb_of_match_table);
+
+static int sunxi_rsb_probe(struct platform_device *pdev)
+{
+       struct device *dev = &pdev->dev;
+       struct device_node *np = dev->of_node;
+       struct resource *r;
+       struct sunxi_rsb *rsb;
+       unsigned long p_clk_freq;
+       u32 clk_delay, clk_freq = 3000000;
+       int clk_div, irq, ret;
+       u32 reg;
+
+       of_property_read_u32(np, "clock-frequency", &clk_freq);
+       if (clk_freq > RSB_MAX_FREQ) {
+               dev_err(dev,
+                       "clock-frequency (%u Hz) is too high (max = 20MHz)\n",
+                       clk_freq);
+               return -EINVAL;
+       }
+
+       rsb = devm_kzalloc(dev, sizeof(*rsb), GFP_KERNEL);
+       if (!rsb)
+               return -ENOMEM;
+
+       rsb->dev = dev;
+       platform_set_drvdata(pdev, rsb);
+       r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+       rsb->regs = devm_ioremap_resource(dev, r);
+       if (IS_ERR(rsb->regs))
+               return PTR_ERR(rsb->regs);
+
+       irq = platform_get_irq(pdev, 0);
+       if (irq < 0) {
+               dev_err(dev, "failed to retrieve irq: %d\n", irq);
+               return irq;
+       }
+
+       rsb->clk = devm_clk_get(dev, NULL);
+       if (IS_ERR(rsb->clk)) {
+               ret = PTR_ERR(rsb->clk);
+               dev_err(dev, "failed to retrieve clk: %d\n", ret);
+               return ret;
+       }
+
+       ret = clk_prepare_enable(rsb->clk);
+       if (ret) {
+               dev_err(dev, "failed to enable clk: %d\n", ret);
+               return ret;
+       }
+
+       p_clk_freq = clk_get_rate(rsb->clk);
+
+       rsb->rstc = devm_reset_control_get(dev, NULL);
+       if (IS_ERR(rsb->rstc)) {
+               ret = PTR_ERR(rsb->rstc);
+               dev_err(dev, "failed to retrieve reset controller: %d\n", ret);
+               goto err_clk_disable;
+       }
+
+       ret = reset_control_deassert(rsb->rstc);
+       if (ret) {
+               dev_err(dev, "failed to deassert reset line: %d\n", ret);
+               goto err_clk_disable;
+       }
+
+       init_completion(&rsb->complete);
+       mutex_init(&rsb->lock);
+
+       /* reset the controller */
+       writel(RSB_CTRL_SOFT_RST, rsb->regs + RSB_CTRL);
+       readl_poll_timeout(rsb->regs + RSB_CTRL, reg,
+                          !(reg & RSB_CTRL_SOFT_RST), 1000, 100000);
+
+       /*
+        * Clock frequency and delay calculation code is from
+        * Allwinner U-boot sources.
+        *
+        * From A83 user manual:
+        * bus clock frequency = parent clock frequency / (2 * (divider + 1))
+        */
+       clk_div = p_clk_freq / clk_freq / 2;
+       if (!clk_div)
+               clk_div = 1;
+       else if (clk_div > RSB_CCR_MAX_CLK_DIV + 1)
+               clk_div = RSB_CCR_MAX_CLK_DIV + 1;
+
+       clk_delay = clk_div >> 1;
+       if (!clk_delay)
+               clk_delay = 1;
+
+       dev_info(dev, "RSB running at %lu Hz\n", p_clk_freq / clk_div / 2);
+       writel(RSB_CCR_SDA_OUT_DELAY(clk_delay) | RSB_CCR_CLK_DIV(clk_div - 1),
+              rsb->regs + RSB_CCR);
+
+       ret = devm_request_irq(dev, irq, sunxi_rsb_irq, 0, RSB_CTRL_NAME, rsb);
+       if (ret) {
+               dev_err(dev, "can't register interrupt handler irq %d: %d\n",
+                       irq, ret);
+               goto err_reset_assert;
+       }
+
+       /* initialize all devices on the bus into RSB mode */
+       ret = sunxi_rsb_init_device_mode(rsb);
+       if (ret)
+               dev_warn(dev, "Initialize device mode failed: %d\n", ret);
+
+       of_rsb_register_devices(rsb);
+
+       return 0;
+
+err_reset_assert:
+       reset_control_assert(rsb->rstc);
+
+err_clk_disable:
+       clk_disable_unprepare(rsb->clk);
+
+       return ret;
+}
+
+static int sunxi_rsb_remove(struct platform_device *pdev)
+{
+       struct sunxi_rsb *rsb = platform_get_drvdata(pdev);
+
+       device_for_each_child(rsb->dev, NULL, sunxi_rsb_remove_devices);
+       reset_control_assert(rsb->rstc);
+       clk_disable_unprepare(rsb->clk);
+
+       return 0;
+}
+
+static struct platform_driver sunxi_rsb_driver = {
+       .probe = sunxi_rsb_probe,
+       .remove = sunxi_rsb_remove,
+       .driver = {
+               .name = RSB_CTRL_NAME,
+               .of_match_table = sunxi_rsb_of_match_table,
+       },
+};
+
+static int __init sunxi_rsb_init(void)
+{
+       int ret;
+
+       ret = bus_register(&sunxi_rsb_bus);
+       if (ret) {
+               pr_err("failed to register sunxi sunxi_rsb bus: %d\n", ret);
+               return ret;
+       }
+
+       return platform_driver_register(&sunxi_rsb_driver);
+}
+module_init(sunxi_rsb_init);
+
+static void __exit sunxi_rsb_exit(void)
+{
+       platform_driver_unregister(&sunxi_rsb_driver);
+       bus_unregister(&sunxi_rsb_bus);
+}
+module_exit(sunxi_rsb_exit);
+
+MODULE_AUTHOR("Chen-Yu Tsai <wens@csie.org>");
+MODULE_DESCRIPTION("Allwinner sunXi Reduced Serial Bus controller driver");
+MODULE_LICENSE("GPL v2");
index 7a1ab24052b86ba6160010d03b483f266391288a..c3e3a02f7f1f9b288ac93a524db3615f6abb72ae 100644 (file)
@@ -60,6 +60,16 @@ config COMMON_CLK_RK808
          clocked at 32KHz each. Clkout1 is always on, Clkout2 can off
          by control register.
 
+config COMMON_CLK_SCPI
+       tristate "Clock driver controlled via SCPI interface"
+       depends on ARM_SCPI_PROTOCOL || COMPILE_TEST
+         ---help---
+         This driver provides support for clocks that are controlled
+         by firmware that implements the SCPI interface.
+
+         This driver uses SCPI Message Protocol to interact with the
+         firmware providing all the clock controls.
+
 config COMMON_CLK_SI5351
        tristate "Clock driver for SiLabs 5351A/B/C"
        depends on I2C
index d3e1910eebaba6ed0bf765549582345d2470933e..820714c72d368e29fe211d1699c9a68202c98359 100644 (file)
@@ -36,6 +36,7 @@ obj-$(CONFIG_COMMON_CLK_PALMAS)               += clk-palmas.o
 obj-$(CONFIG_CLK_QORIQ)                        += clk-qoriq.o
 obj-$(CONFIG_COMMON_CLK_RK808)         += clk-rk808.o
 obj-$(CONFIG_COMMON_CLK_S2MPS11)       += clk-s2mps11.o
+obj-$(CONFIG_COMMON_CLK_SCPI)           += clk-scpi.o
 obj-$(CONFIG_COMMON_CLK_SI5351)                += clk-si5351.o
 obj-$(CONFIG_COMMON_CLK_SI514)         += clk-si514.o
 obj-$(CONFIG_COMMON_CLK_SI570)         += clk-si570.o
index 243f421abcb45815f2bd55a5bb22697346fac648..f144547cf76ca94767eac93de9e8d82a0b4d7c7d 100644 (file)
@@ -45,7 +45,7 @@
 #define REG_SDIO0XIN_CLKCTL    0x0158
 #define REG_SDIO1XIN_CLKCTL    0x015c
 
-#define        MAX_CLKS 27
+#define        MAX_CLKS 28
 static struct clk *clks[MAX_CLKS];
 static struct clk_onecell_data clk_data;
 static DEFINE_SPINLOCK(lock);
@@ -356,13 +356,13 @@ static void __init berlin2q_clock_setup(struct device_node *np)
                            gd->bit_idx, 0, &lock);
        }
 
-       /*
-        * twdclk is derived from cpu/3
-        * TODO: use cpupll until cpuclk is not available
-        */
+       /* cpuclk divider is fixed to 1 */
+       clks[CLKID_CPU] =
+               clk_register_fixed_factor(NULL, "cpu", clk_names[CPUPLL],
+                                         0, 1, 1);
+       /* twdclk is derived from cpu/3 */
        clks[CLKID_TWD] =
-               clk_register_fixed_factor(NULL, "twd", clk_names[CPUPLL],
-                                         0, 1, 3);
+               clk_register_fixed_factor(NULL, "twd", "cpu", 0, 1, 3);
 
        /* check for errors on leaf clocks */
        for (n = 0; n < MAX_CLKS; n++) {
diff --git a/drivers/clk/clk-scpi.c b/drivers/clk/clk-scpi.c
new file mode 100644 (file)
index 0000000..0b501a9
--- /dev/null
@@ -0,0 +1,325 @@
+/*
+ * System Control and Power Interface (SCPI) Protocol based clock driver
+ *
+ * Copyright (C) 2015 ARM Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <linux/clk-provider.h>
+#include <linux/device.h>
+#include <linux/err.h>
+#include <linux/of.h>
+#include <linux/module.h>
+#include <linux/of_platform.h>
+#include <linux/platform_device.h>
+#include <linux/scpi_protocol.h>
+
+struct scpi_clk {
+       u32 id;
+       struct clk_hw hw;
+       struct scpi_dvfs_info *info;
+       struct scpi_ops *scpi_ops;
+};
+
+#define to_scpi_clk(clk) container_of(clk, struct scpi_clk, hw)
+
+static struct platform_device *cpufreq_dev;
+
+static unsigned long scpi_clk_recalc_rate(struct clk_hw *hw,
+                                         unsigned long parent_rate)
+{
+       struct scpi_clk *clk = to_scpi_clk(hw);
+
+       return clk->scpi_ops->clk_get_val(clk->id);
+}
+
+static long scpi_clk_round_rate(struct clk_hw *hw, unsigned long rate,
+                               unsigned long *parent_rate)
+{
+       /*
+        * We can't figure out what rate it will be, so just return the
+        * rate back to the caller. scpi_clk_recalc_rate() will be called
+        * after the rate is set and we'll know what rate the clock is
+        * running at then.
+        */
+       return rate;
+}
+
+static int scpi_clk_set_rate(struct clk_hw *hw, unsigned long rate,
+                            unsigned long parent_rate)
+{
+       struct scpi_clk *clk = to_scpi_clk(hw);
+
+       return clk->scpi_ops->clk_set_val(clk->id, rate);
+}
+
+static const struct clk_ops scpi_clk_ops = {
+       .recalc_rate = scpi_clk_recalc_rate,
+       .round_rate = scpi_clk_round_rate,
+       .set_rate = scpi_clk_set_rate,
+};
+
+/* find closest match to given frequency in OPP table */
+static int __scpi_dvfs_round_rate(struct scpi_clk *clk, unsigned long rate)
+{
+       int idx;
+       u32 fmin = 0, fmax = ~0, ftmp;
+       const struct scpi_opp *opp = clk->info->opps;
+
+       for (idx = 0; idx < clk->info->count; idx++, opp++) {
+               ftmp = opp->freq;
+               if (ftmp >= (u32)rate) {
+                       if (ftmp <= fmax)
+                               fmax = ftmp;
+                       break;
+               } else if (ftmp >= fmin) {
+                       fmin = ftmp;
+               }
+       }
+       return fmax != ~0 ? fmax : fmin;
+}
+
+static unsigned long scpi_dvfs_recalc_rate(struct clk_hw *hw,
+                                          unsigned long parent_rate)
+{
+       struct scpi_clk *clk = to_scpi_clk(hw);
+       int idx = clk->scpi_ops->dvfs_get_idx(clk->id);
+       const struct scpi_opp *opp;
+
+       if (idx < 0)
+               return 0;
+
+       opp = clk->info->opps + idx;
+       return opp->freq;
+}
+
+static long scpi_dvfs_round_rate(struct clk_hw *hw, unsigned long rate,
+                                unsigned long *parent_rate)
+{
+       struct scpi_clk *clk = to_scpi_clk(hw);
+
+       return __scpi_dvfs_round_rate(clk, rate);
+}
+
+static int __scpi_find_dvfs_index(struct scpi_clk *clk, unsigned long rate)
+{
+       int idx, max_opp = clk->info->count;
+       const struct scpi_opp *opp = clk->info->opps;
+
+       for (idx = 0; idx < max_opp; idx++, opp++)
+               if (opp->freq == rate)
+                       return idx;
+       return -EINVAL;
+}
+
+static int scpi_dvfs_set_rate(struct clk_hw *hw, unsigned long rate,
+                             unsigned long parent_rate)
+{
+       struct scpi_clk *clk = to_scpi_clk(hw);
+       int ret = __scpi_find_dvfs_index(clk, rate);
+
+       if (ret < 0)
+               return ret;
+       return clk->scpi_ops->dvfs_set_idx(clk->id, (u8)ret);
+}
+
+static const struct clk_ops scpi_dvfs_ops = {
+       .recalc_rate = scpi_dvfs_recalc_rate,
+       .round_rate = scpi_dvfs_round_rate,
+       .set_rate = scpi_dvfs_set_rate,
+};
+
+static const struct of_device_id scpi_clk_match[] = {
+       { .compatible = "arm,scpi-dvfs-clocks", .data = &scpi_dvfs_ops, },
+       { .compatible = "arm,scpi-variable-clocks", .data = &scpi_clk_ops, },
+       {}
+};
+
+static struct clk *
+scpi_clk_ops_init(struct device *dev, const struct of_device_id *match,
+                 struct scpi_clk *sclk, const char *name)
+{
+       struct clk_init_data init;
+       struct clk *clk;
+       unsigned long min = 0, max = 0;
+
+       init.name = name;
+       init.flags = CLK_IS_ROOT;
+       init.num_parents = 0;
+       init.ops = match->data;
+       sclk->hw.init = &init;
+       sclk->scpi_ops = get_scpi_ops();
+
+       if (init.ops == &scpi_dvfs_ops) {
+               sclk->info = sclk->scpi_ops->dvfs_get_info(sclk->id);
+               if (IS_ERR(sclk->info))
+                       return NULL;
+       } else if (init.ops == &scpi_clk_ops) {
+               if (sclk->scpi_ops->clk_get_range(sclk->id, &min, &max) || !max)
+                       return NULL;
+       } else {
+               return NULL;
+       }
+
+       clk = devm_clk_register(dev, &sclk->hw);
+       if (!IS_ERR(clk) && max)
+               clk_hw_set_rate_range(&sclk->hw, min, max);
+       return clk;
+}
+
+struct scpi_clk_data {
+       struct scpi_clk **clk;
+       unsigned int clk_num;
+};
+
+static struct clk *
+scpi_of_clk_src_get(struct of_phandle_args *clkspec, void *data)
+{
+       struct scpi_clk *sclk;
+       struct scpi_clk_data *clk_data = data;
+       unsigned int idx = clkspec->args[0], count;
+
+       for (count = 0; count < clk_data->clk_num; count++) {
+               sclk = clk_data->clk[count];
+               if (idx == sclk->id)
+                       return sclk->hw.clk;
+       }
+
+       return ERR_PTR(-EINVAL);
+}
+
+static int scpi_clk_add(struct device *dev, struct device_node *np,
+                       const struct of_device_id *match)
+{
+       struct clk **clks;
+       int idx, count;
+       struct scpi_clk_data *clk_data;
+
+       count = of_property_count_strings(np, "clock-output-names");
+       if (count < 0) {
+               dev_err(dev, "%s: invalid clock output count\n", np->name);
+               return -EINVAL;
+       }
+
+       clk_data = devm_kmalloc(dev, sizeof(*clk_data), GFP_KERNEL);
+       if (!clk_data)
+               return -ENOMEM;
+
+       clk_data->clk_num = count;
+       clk_data->clk = devm_kcalloc(dev, count, sizeof(*clk_data->clk),
+                                    GFP_KERNEL);
+       if (!clk_data->clk)
+               return -ENOMEM;
+
+       clks = devm_kcalloc(dev, count, sizeof(*clks), GFP_KERNEL);
+       if (!clks)
+               return -ENOMEM;
+
+       for (idx = 0; idx < count; idx++) {
+               struct scpi_clk *sclk;
+               const char *name;
+               u32 val;
+
+               sclk = devm_kzalloc(dev, sizeof(*sclk), GFP_KERNEL);
+               if (!sclk)
+                       return -ENOMEM;
+
+               if (of_property_read_string_index(np, "clock-output-names",
+                                                 idx, &name)) {
+                       dev_err(dev, "invalid clock name @ %s\n", np->name);
+                       return -EINVAL;
+               }
+
+               if (of_property_read_u32_index(np, "clock-indices",
+                                              idx, &val)) {
+                       dev_err(dev, "invalid clock index @ %s\n", np->name);
+                       return -EINVAL;
+               }
+
+               sclk->id = val;
+
+               clks[idx] = scpi_clk_ops_init(dev, match, sclk, name);
+               if (IS_ERR_OR_NULL(clks[idx]))
+                       dev_err(dev, "failed to register clock '%s'\n", name);
+               else
+                       dev_dbg(dev, "Registered clock '%s'\n", name);
+               clk_data->clk[idx] = sclk;
+       }
+
+       return of_clk_add_provider(np, scpi_of_clk_src_get, clk_data);
+}
+
+static int scpi_clocks_remove(struct platform_device *pdev)
+{
+       struct device *dev = &pdev->dev;
+       struct device_node *child, *np = dev->of_node;
+
+       if (cpufreq_dev) {
+               platform_device_unregister(cpufreq_dev);
+               cpufreq_dev = NULL;
+       }
+
+       for_each_available_child_of_node(np, child)
+               of_clk_del_provider(np);
+       return 0;
+}
+
+static int scpi_clocks_probe(struct platform_device *pdev)
+{
+       int ret;
+       struct device *dev = &pdev->dev;
+       struct device_node *child, *np = dev->of_node;
+       const struct of_device_id *match;
+
+       if (!get_scpi_ops())
+               return -ENXIO;
+
+       for_each_available_child_of_node(np, child) {
+               match = of_match_node(scpi_clk_match, child);
+               if (!match)
+                       continue;
+               ret = scpi_clk_add(dev, child, match);
+               if (ret) {
+                       scpi_clocks_remove(pdev);
+                       return ret;
+               }
+       }
+       /* Add the virtual cpufreq device */
+       cpufreq_dev = platform_device_register_simple("scpi-cpufreq",
+                                                     -1, NULL, 0);
+       if (!cpufreq_dev)
+               pr_warn("unable to register cpufreq device");
+
+       return 0;
+}
+
+static const struct of_device_id scpi_clocks_ids[] = {
+       { .compatible = "arm,scpi-clocks", },
+       {}
+};
+MODULE_DEVICE_TABLE(of, scpi_clocks_ids);
+
+static struct platform_driver scpi_clocks_driver = {
+       .driver = {
+               .name = "scpi_clocks",
+               .of_match_table = scpi_clocks_ids,
+       },
+       .probe = scpi_clocks_probe,
+       .remove = scpi_clocks_remove,
+};
+module_platform_driver(scpi_clocks_driver);
+
+MODULE_AUTHOR("Sudeep Holla <sudeep.holla@arm.com>");
+MODULE_DESCRIPTION("ARM SCPI clock driver");
+MODULE_LICENSE("GPL v2");
index 55b83c7ef878bfa8c3fbb683fc6ba329db4a58c3..5bebf8cb0d70f3daeff4bb2d3f14eb67e1444451 100644 (file)
@@ -222,9 +222,13 @@ PNAME(mout_mpll_user_p)    = { "fin_pll", "mout_mpll" };
 PNAME(mout_bpll_user_p)        = { "fin_pll", "mout_bpll" };
 PNAME(mout_aclk166_p)  = { "mout_cpll", "mout_mpll_user" };
 PNAME(mout_aclk200_p)  = { "mout_mpll_user", "mout_bpll_user" };
+PNAME(mout_aclk300_p)  = { "mout_aclk300_disp1_mid",
+                           "mout_aclk300_disp1_mid1" };
 PNAME(mout_aclk400_p)  = { "mout_aclk400_g3d_mid", "mout_gpll" };
 PNAME(mout_aclk200_sub_p) = { "fin_pll", "div_aclk200" };
 PNAME(mout_aclk266_sub_p) = { "fin_pll", "div_aclk266" };
+PNAME(mout_aclk300_sub_p) = { "fin_pll", "div_aclk300_disp" };
+PNAME(mout_aclk300_disp1_mid1_p) = { "mout_vpll", "mout_cpll" };
 PNAME(mout_aclk333_sub_p) = { "fin_pll", "div_aclk333" };
 PNAME(mout_aclk400_isp_sub_p) = { "fin_pll", "div_aclk400_isp" };
 PNAME(mout_hdmi_p)     = { "div_hdmi_pixel", "sclk_hdmiphy" };
@@ -303,9 +307,13 @@ static struct samsung_mux_clock exynos5250_mux_clks[] __initdata = {
         */
        MUX(0, "mout_aclk166", mout_aclk166_p, SRC_TOP0, 8, 1),
        MUX(0, "mout_aclk200", mout_aclk200_p, SRC_TOP0, 12, 1),
+       MUX(0, "mout_aclk300_disp1_mid", mout_aclk200_p, SRC_TOP0, 14, 1),
+       MUX(0, "mout_aclk300", mout_aclk300_p, SRC_TOP0, 15, 1),
        MUX(0, "mout_aclk333", mout_aclk166_p, SRC_TOP0, 16, 1),
        MUX(0, "mout_aclk400_g3d_mid", mout_aclk200_p, SRC_TOP0, 20, 1),
 
+       MUX(0, "mout_aclk300_disp1_mid1", mout_aclk300_disp1_mid1_p, SRC_TOP1,
+               8, 1),
        MUX(0, "mout_aclk400_isp", mout_aclk200_p, SRC_TOP1, 24, 1),
        MUX(0, "mout_aclk400_g3d", mout_aclk400_p, SRC_TOP1, 28, 1),
 
@@ -316,7 +324,10 @@ static struct samsung_mux_clock exynos5250_mux_clks[] __initdata = {
        MUX(0, "mout_bpll_user", mout_bpll_user_p, SRC_TOP2, 24, 1),
        MUX(CLK_MOUT_GPLL, "mout_gpll", mout_gpll_p, SRC_TOP2, 28, 1),
 
-       MUX(0, "mout_aclk200_disp1_sub", mout_aclk200_sub_p, SRC_TOP3, 4, 1),
+       MUX(CLK_MOUT_ACLK200_DISP1_SUB, "mout_aclk200_disp1_sub",
+               mout_aclk200_sub_p, SRC_TOP3, 4, 1),
+       MUX(CLK_MOUT_ACLK300_DISP1_SUB, "mout_aclk300_disp1_sub",
+               mout_aclk300_sub_p, SRC_TOP3, 6, 1),
        MUX(0, "mout_aclk266_gscl_sub", mout_aclk266_sub_p, SRC_TOP3, 8, 1),
        MUX(0, "mout_aclk_266_isp_sub", mout_aclk266_sub_p, SRC_TOP3, 16, 1),
        MUX(0, "mout_aclk_400_isp_sub", mout_aclk400_isp_sub_p,
@@ -392,6 +403,7 @@ static struct samsung_div_clock exynos5250_div_clks[] __initdata = {
        DIV(0, "div_aclk333", "mout_aclk333", DIV_TOP0, 20, 3),
        DIV(0, "div_aclk400_g3d", "mout_aclk400_g3d", DIV_TOP0,
                                                        24, 3),
+       DIV(0, "div_aclk300_disp", "mout_aclk300", DIV_TOP0, 28, 3),
 
        DIV(0, "div_aclk400_isp", "mout_aclk400_isp", DIV_TOP1, 20, 3),
        DIV(0, "div_aclk66_pre", "mout_mpll_user", DIV_TOP1, 24, 3),
index 4abf21172625e81a7036dad77f90ea2d4158039c..3b09716ebda28227eebd52da5616c40245e490d5 100644 (file)
@@ -259,6 +259,10 @@ int cpg_mstp_attach_dev(struct generic_pm_domain *domain, struct device *dev)
                                            "renesas,cpg-mstp-clocks"))
                        goto found;
 
+               /* BSC on r8a73a4/sh73a0 uses zb_clk instead of an mstp clock */
+               if (!strcmp(clkspec.np->name, "zb_clk"))
+                       goto found;
+
                of_node_put(clkspec.np);
                i++;
        }
index 413070d07b3f1f255a8229a259eeb97c5aaf94ae..9c79af0c03b2115a422f49414e9b431ed0d8ab36 100644 (file)
@@ -1196,6 +1196,7 @@ static void __init sun5i_init_clocks(struct device_node *node)
 }
 CLK_OF_DECLARE(sun5i_a10s_clk_init, "allwinner,sun5i-a10s", sun5i_init_clocks);
 CLK_OF_DECLARE(sun5i_a13_clk_init, "allwinner,sun5i-a13", sun5i_init_clocks);
+CLK_OF_DECLARE(sun5i_r8_clk_init, "allwinner,sun5i-r8", sun5i_init_clocks);
 CLK_OF_DECLARE(sun7i_a20_clk_init, "allwinner,sun7i-a20", sun5i_init_clocks);
 
 static const char *sun6i_critical_clocks[] __initdata = {
index 9ceaef7eb81d6522f2bcf6c9973023e29c568cf2..71cfdf7c97086273b1cc8ae1235ecf919abcfda1 100644 (file)
@@ -123,6 +123,14 @@ config CLKSRC_PISTACHIO
        bool
        select CLKSRC_OF
 
+config CLKSRC_TI_32K
+       bool "Texas Instruments 32.768 Hz Clocksource" if COMPILE_TEST
+       depends on GENERIC_SCHED_CLOCK
+       select CLKSRC_OF if OF
+       help
+         This option enables support for Texas Instruments 32.768 Hz clocksource
+         available on many OMAP-like platforms.
+
 config CLKSRC_STM32
        bool "Clocksource for STM32 SoCs" if !ARCH_STM32
        depends on OF && ARM && (ARCH_STM32 || COMPILE_TEST)
index e8aec9dfa597255b3ca167de8456fa8434383c92..56bd16e77ae37147da0fa4e977adffcb9bc1a4c6 100644 (file)
@@ -45,6 +45,7 @@ obj-$(CONFIG_VF_PIT_TIMER)    += vf_pit_timer.o
 obj-$(CONFIG_CLKSRC_QCOM)      += qcom-timer.o
 obj-$(CONFIG_MTK_TIMER)                += mtk_timer.o
 obj-$(CONFIG_CLKSRC_PISTACHIO) += time-pistachio.o
+obj-$(CONFIG_CLKSRC_TI_32K)    += timer-ti-32k.o
 
 obj-$(CONFIG_ARM_ARCH_TIMER)           += arm_arch_timer.o
 obj-$(CONFIG_ARM_GLOBAL_TIMER)         += arm_global_timer.o
index d28d2fe798d570a4f3e59f34a549c82ea8ab50c6..6ee91401918eba99a33c67b554da853747a0c5fa 100644 (file)
@@ -193,10 +193,17 @@ static int __init setup_clkevents(struct atmel_tc *tc, int clk32k_divisor_idx)
        struct clk *t2_clk = tc->clk[2];
        int irq = tc->irq[2];
 
+       ret = clk_prepare_enable(tc->slow_clk);
+       if (ret)
+               return ret;
+
        /* try to enable t2 clk to avoid future errors in mode change */
        ret = clk_prepare_enable(t2_clk);
-       if (ret)
+       if (ret) {
+               clk_disable_unprepare(tc->slow_clk);
                return ret;
+       }
+
        clk_disable(t2_clk);
 
        clkevt.regs = tc->regs;
@@ -208,7 +215,8 @@ static int __init setup_clkevents(struct atmel_tc *tc, int clk32k_divisor_idx)
 
        ret = request_irq(irq, ch2_irq, IRQF_TIMER, "tc_clkevt", &clkevt);
        if (ret) {
-               clk_disable_unprepare(t2_clk);
+               clk_unprepare(t2_clk);
+               clk_disable_unprepare(tc->slow_clk);
                return ret;
        }
 
index 41b7b6dc1d0d1ff32a0be15c2c394d000195a6a8..29d21d68df5a231d78f586b2ac64ce56ed8e68b1 100644 (file)
@@ -22,6 +22,7 @@
 #include <linux/kernel.h>
 #include <linux/interrupt.h>
 #include <linux/irq.h>
+#include <linux/clk.h>
 #include <linux/clockchips.h>
 #include <linux/export.h>
 #include <linux/mfd/syscon.h>
@@ -33,9 +34,7 @@ static unsigned long last_crtr;
 static u32 irqmask;
 static struct clock_event_device clkevt;
 static struct regmap *regmap_st;
-
-#define AT91_SLOW_CLOCK                32768
-#define RM9200_TIMER_LATCH     ((AT91_SLOW_CLOCK + HZ/2) / HZ)
+static int timer_latch;
 
 /*
  * The ST_CRTR is updated asynchronously to the master clock ... but
@@ -82,8 +81,8 @@ static irqreturn_t at91rm9200_timer_interrupt(int irq, void *dev_id)
        if (sr & AT91_ST_PITS) {
                u32     crtr = read_CRTR();
 
-               while (((crtr - last_crtr) & AT91_ST_CRTV) >= RM9200_TIMER_LATCH) {
-                       last_crtr += RM9200_TIMER_LATCH;
+               while (((crtr - last_crtr) & AT91_ST_CRTV) >= timer_latch) {
+                       last_crtr += timer_latch;
                        clkevt.event_handler(&clkevt);
                }
                return IRQ_HANDLED;
@@ -144,7 +143,7 @@ static int clkevt32k_set_periodic(struct clock_event_device *dev)
 
        /* PIT for periodic irqs; fixed rate of 1/HZ */
        irqmask = AT91_ST_PITS;
-       regmap_write(regmap_st, AT91_ST_PIMR, RM9200_TIMER_LATCH);
+       regmap_write(regmap_st, AT91_ST_PIMR, timer_latch);
        regmap_write(regmap_st, AT91_ST_IER, irqmask);
        return 0;
 }
@@ -197,7 +196,8 @@ static struct clock_event_device clkevt = {
  */
 static void __init atmel_st_timer_init(struct device_node *node)
 {
-       unsigned int val;
+       struct clk *sclk;
+       unsigned int sclk_rate, val;
        int irq, ret;
 
        regmap_st = syscon_node_to_regmap(node);
@@ -221,6 +221,19 @@ static void __init atmel_st_timer_init(struct device_node *node)
        if (ret)
                panic(pr_fmt("Unable to setup IRQ\n"));
 
+       sclk = of_clk_get(node, 0);
+       if (IS_ERR(sclk))
+               panic(pr_fmt("Unable to get slow clock\n"));
+
+       clk_prepare_enable(sclk);
+       if (ret)
+               panic(pr_fmt("Could not enable slow clock\n"));
+
+       sclk_rate = clk_get_rate(sclk);
+       if (!sclk_rate)
+               panic(pr_fmt("Invalid slow clock rate\n"));
+       timer_latch = (sclk_rate + HZ / 2) / HZ;
+
        /* The 32KiHz "Slow Clock" (tick every 30517.58 nanoseconds) is used
         * directly for the clocksource and all clockevents, after adjusting
         * its prescaler from the 1 Hz default.
@@ -229,11 +242,11 @@ static void __init atmel_st_timer_init(struct device_node *node)
 
        /* Setup timer clockevent, with minimum of two ticks (important!!) */
        clkevt.cpumask = cpumask_of(0);
-       clockevents_config_and_register(&clkevt, AT91_SLOW_CLOCK,
+       clockevents_config_and_register(&clkevt, sclk_rate,
                                        2, AT91_ST_ALMV);
 
        /* register clocksource */
-       clocksource_register_hz(&clk32k, AT91_SLOW_CLOCK);
+       clocksource_register_hz(&clk32k, sclk_rate);
 }
 CLOCKSOURCE_OF_DECLARE(atmel_st_timer, "atmel,at91rm9200-st",
                       atmel_st_timer_init);
diff --git a/drivers/clocksource/timer-ti-32k.c b/drivers/clocksource/timer-ti-32k.c
new file mode 100644 (file)
index 0000000..8518d9d
--- /dev/null
@@ -0,0 +1,126 @@
+/**
+ * timer-ti-32k.c - OMAP2 32k Timer Support
+ *
+ * Copyright (C) 2009 Nokia Corporation
+ *
+ * Update to use new clocksource/clockevent layers
+ * Author: Kevin Hilman, MontaVista Software, Inc. <source@mvista.com>
+ * Copyright (C) 2007 MontaVista Software, Inc.
+ *
+ * Original driver:
+ * Copyright (C) 2005 Nokia Corporation
+ * Author: Paul Mundt <paul.mundt@nokia.com>
+ *         Juha Yrjölä <juha.yrjola@nokia.com>
+ * OMAP Dual-mode timer framework support by Timo Teras
+ *
+ * Some parts based off of TI's 24xx code:
+ *
+ * Copyright (C) 2004-2009 Texas Instruments, Inc.
+ *
+ * Roughly modelled after the OMAP1 MPU timer code.
+ * Added OMAP4 support - Santosh Shilimkar <santosh.shilimkar@ti.com>
+ *
+ * Copyright (C) 2015 Texas Instruments Incorporated - http://www.ti.com
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2  of
+ * the License as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <linux/init.h>
+#include <linux/time.h>
+#include <linux/sched_clock.h>
+#include <linux/clocksource.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
+
+/*
+ * 32KHz clocksource ... always available, on pretty most chips except
+ * OMAP 730 and 1510.  Other timers could be used as clocksources, with
+ * higher resolution in free-running counter modes (e.g. 12 MHz xtal),
+ * but systems won't necessarily want to spend resources that way.
+ */
+
+#define OMAP2_32KSYNCNT_REV_OFF                0x0
+#define OMAP2_32KSYNCNT_REV_SCHEME     (0x3 << 30)
+#define OMAP2_32KSYNCNT_CR_OFF_LOW     0x10
+#define OMAP2_32KSYNCNT_CR_OFF_HIGH    0x30
+
+struct ti_32k {
+       void __iomem            *base;
+       void __iomem            *counter;
+       struct clocksource      cs;
+};
+
+static inline struct ti_32k *to_ti_32k(struct clocksource *cs)
+{
+       return container_of(cs, struct ti_32k, cs);
+}
+
+static cycle_t ti_32k_read_cycles(struct clocksource *cs)
+{
+       struct ti_32k *ti = to_ti_32k(cs);
+
+       return (cycle_t)readl_relaxed(ti->counter);
+}
+
+static struct ti_32k ti_32k_timer = {
+       .cs = {
+               .name           = "32k_counter",
+               .rating         = 250,
+               .read           = ti_32k_read_cycles,
+               .mask           = CLOCKSOURCE_MASK(32),
+               .flags          = CLOCK_SOURCE_IS_CONTINUOUS |
+                               CLOCK_SOURCE_SUSPEND_NONSTOP,
+       },
+};
+
+static u64 notrace omap_32k_read_sched_clock(void)
+{
+       return ti_32k_read_cycles(&ti_32k_timer.cs);
+}
+
+static void __init ti_32k_timer_init(struct device_node *np)
+{
+       int ret;
+
+       ti_32k_timer.base = of_iomap(np, 0);
+       if (!ti_32k_timer.base) {
+               pr_err("Can't ioremap 32k timer base\n");
+               return;
+       }
+
+       ti_32k_timer.counter = ti_32k_timer.base;
+
+       /*
+        * 32k sync Counter IP register offsets vary between the highlander
+        * version and the legacy ones.
+        *
+        * The 'SCHEME' bits(30-31) of the revision register is used to identify
+        * the version.
+        */
+       if (readl_relaxed(ti_32k_timer.base + OMAP2_32KSYNCNT_REV_OFF) &
+                       OMAP2_32KSYNCNT_REV_SCHEME)
+               ti_32k_timer.counter += OMAP2_32KSYNCNT_CR_OFF_HIGH;
+       else
+               ti_32k_timer.counter += OMAP2_32KSYNCNT_CR_OFF_LOW;
+
+       ret = clocksource_register_hz(&ti_32k_timer.cs, 32768);
+       if (ret) {
+               pr_err("32k_counter: can't register clocksource\n");
+               return;
+       }
+
+       sched_clock_register(omap_32k_read_sched_clock, 32, 32768);
+       pr_info("OMAP clocksource: 32k_counter at 32768 Hz\n");
+}
+CLOCKSOURCE_OF_DECLARE(ti_32k_timer, "ti,omap-counter32k",
+               ti_32k_timer_init);
index 642fd49793b0a9284a83eddb3275ff627ca46763..1582c1c016b098b7d40cccbaf52f7d715a0586d2 100644 (file)
@@ -199,6 +199,16 @@ config ARM_SA1100_CPUFREQ
 config ARM_SA1110_CPUFREQ
        bool
 
+config ARM_SCPI_CPUFREQ
+        tristate "SCPI based CPUfreq driver"
+       depends on ARM_BIG_LITTLE_CPUFREQ && ARM_SCPI_PROTOCOL
+        help
+         This adds the CPUfreq driver support for ARM big.LITTLE platforms
+         using SCPI protocol for CPU power management.
+
+         This driver uses SCPI Message Protocol driver to interact with the
+         firmware providing the CPU DVFS functionality.
+
 config ARM_SPEAR_CPUFREQ
        bool "SPEAr CPUFreq support"
        depends on PLAT_SPEAR
index d11309c487d0ef1be2de721a137e888159fe418f..c0af1a1281c89134269445f9330d4d449c37135e 100644 (file)
@@ -71,6 +71,7 @@ obj-$(CONFIG_ARM_S3C64XX_CPUFREQ)     += s3c64xx-cpufreq.o
 obj-$(CONFIG_ARM_S5PV210_CPUFREQ)      += s5pv210-cpufreq.o
 obj-$(CONFIG_ARM_SA1100_CPUFREQ)       += sa1100-cpufreq.o
 obj-$(CONFIG_ARM_SA1110_CPUFREQ)       += sa1110-cpufreq.o
+obj-$(CONFIG_ARM_SCPI_CPUFREQ)         += scpi-cpufreq.o
 obj-$(CONFIG_ARM_SPEAR_CPUFREQ)                += spear-cpufreq.o
 obj-$(CONFIG_ARM_TEGRA20_CPUFREQ)      += tegra20-cpufreq.o
 obj-$(CONFIG_ARM_TEGRA124_CPUFREQ)     += tegra124-cpufreq.o
diff --git a/drivers/cpufreq/scpi-cpufreq.c b/drivers/cpufreq/scpi-cpufreq.c
new file mode 100644 (file)
index 0000000..2c3b16f
--- /dev/null
@@ -0,0 +1,124 @@
+/*
+ * System Control and Power Interface (SCPI) based CPUFreq Interface driver
+ *
+ * It provides necessary ops to arm_big_little cpufreq driver.
+ *
+ * Copyright (C) 2015 ARM Ltd.
+ * Sudeep Holla <sudeep.holla@arm.com>
+ *
+ * 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.
+ *
+ * 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.
+ */
+
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
+#include <linux/cpufreq.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/pm_opp.h>
+#include <linux/scpi_protocol.h>
+#include <linux/types.h>
+
+#include "arm_big_little.h"
+
+static struct scpi_ops *scpi_ops;
+
+static struct scpi_dvfs_info *scpi_get_dvfs_info(struct device *cpu_dev)
+{
+       u8 domain = topology_physical_package_id(cpu_dev->id);
+
+       if (domain < 0)
+               return ERR_PTR(-EINVAL);
+       return scpi_ops->dvfs_get_info(domain);
+}
+
+static int scpi_opp_table_ops(struct device *cpu_dev, bool remove)
+{
+       int idx, ret = 0;
+       struct scpi_opp *opp;
+       struct scpi_dvfs_info *info = scpi_get_dvfs_info(cpu_dev);
+
+       if (IS_ERR(info))
+               return PTR_ERR(info);
+
+       if (!info->opps)
+               return -EIO;
+
+       for (opp = info->opps, idx = 0; idx < info->count; idx++, opp++) {
+               if (remove)
+                       dev_pm_opp_remove(cpu_dev, opp->freq);
+               else
+                       ret = dev_pm_opp_add(cpu_dev, opp->freq,
+                                            opp->m_volt * 1000);
+               if (ret) {
+                       dev_warn(cpu_dev, "failed to add opp %uHz %umV\n",
+                                opp->freq, opp->m_volt);
+                       while (idx-- > 0)
+                               dev_pm_opp_remove(cpu_dev, (--opp)->freq);
+                       return ret;
+               }
+       }
+       return ret;
+}
+
+static int scpi_get_transition_latency(struct device *cpu_dev)
+{
+       struct scpi_dvfs_info *info = scpi_get_dvfs_info(cpu_dev);
+
+       if (IS_ERR(info))
+               return PTR_ERR(info);
+       return info->latency;
+}
+
+static int scpi_init_opp_table(struct device *cpu_dev)
+{
+       return scpi_opp_table_ops(cpu_dev, false);
+}
+
+static void scpi_free_opp_table(struct device *cpu_dev)
+{
+       scpi_opp_table_ops(cpu_dev, true);
+}
+
+static struct cpufreq_arm_bL_ops scpi_cpufreq_ops = {
+       .name   = "scpi",
+       .get_transition_latency = scpi_get_transition_latency,
+       .init_opp_table = scpi_init_opp_table,
+       .free_opp_table = scpi_free_opp_table,
+};
+
+static int scpi_cpufreq_probe(struct platform_device *pdev)
+{
+       scpi_ops = get_scpi_ops();
+       if (!scpi_ops)
+               return -EIO;
+
+       return bL_cpufreq_register(&scpi_cpufreq_ops);
+}
+
+static int scpi_cpufreq_remove(struct platform_device *pdev)
+{
+       bL_cpufreq_unregister(&scpi_cpufreq_ops);
+       scpi_ops = NULL;
+       return 0;
+}
+
+static struct platform_driver scpi_cpufreq_platdrv = {
+       .driver = {
+               .name   = "scpi-cpufreq",
+               .owner  = THIS_MODULE,
+       },
+       .probe          = scpi_cpufreq_probe,
+       .remove         = scpi_cpufreq_remove,
+};
+module_platform_driver(scpi_cpufreq_platdrv);
+
+MODULE_AUTHOR("Sudeep Holla <sudeep.holla@arm.com>");
+MODULE_DESCRIPTION("ARM SCPI CPUFreq interface driver");
+MODULE_LICENSE("GPL v2");
index 665efca59487a3eb4d341570002794e09f7bd11a..cf478fe6b335bc2cde8da7ae7f6695f9576f38ef 100644 (file)
@@ -8,6 +8,25 @@ menu "Firmware Drivers"
 config ARM_PSCI_FW
        bool
 
+config ARM_SCPI_PROTOCOL
+       tristate "ARM System Control and Power Interface (SCPI) Message Protocol"
+       depends on ARM_MHU
+       help
+         System Control and Power Interface (SCPI) Message Protocol is
+         defined for the purpose of communication between the Application
+         Cores(AP) and the System Control Processor(SCP). The MHU peripheral
+         provides a mechanism for inter-processor communication between SCP
+         and AP.
+
+         SCP controls most of the power managament on the Application
+         Processors. It offers control and management of: the core/cluster
+         power states, various power domain DVFS including the core/cluster,
+         certain system clocks configuration, thermal sensors and many
+         others.
+
+         This protocol library provides interface for all the client drivers
+         making use of the features offered by the SCP.
+
 config EDD
        tristate "BIOS Enhanced Disk Drive calls determine boot disk"
        depends on X86
@@ -135,6 +154,13 @@ config ISCSI_IBFT
          detect iSCSI boot parameters dynamically during system boot, say Y.
          Otherwise, say N.
 
+config RASPBERRYPI_FIRMWARE
+       tristate "Raspberry Pi Firmware Driver"
+       depends on BCM2835_MBOX
+       help
+         This option enables support for communicating with the firmware on the
+         Raspberry Pi.
+
 config QCOM_SCM
        bool
        depends on ARM || ARM64
index 2ee83474a3c1fec73d8e587465c9b5fb71b333b3..48dd4175297e6cb24151fab67e4c822c940ddf5c 100644 (file)
@@ -2,6 +2,7 @@
 # Makefile for the linux kernel.
 #
 obj-$(CONFIG_ARM_PSCI_FW)      += psci.o
+obj-$(CONFIG_ARM_SCPI_PROTOCOL)        += arm_scpi.o
 obj-$(CONFIG_DMI)              += dmi_scan.o
 obj-$(CONFIG_DMI_SYSFS)                += dmi-sysfs.o
 obj-$(CONFIG_EDD)              += edd.o
@@ -12,10 +13,11 @@ obj-$(CONFIG_DMIID)         += dmi-id.o
 obj-$(CONFIG_ISCSI_IBFT_FIND)  += iscsi_ibft_find.o
 obj-$(CONFIG_ISCSI_IBFT)       += iscsi_ibft.o
 obj-$(CONFIG_FIRMWARE_MEMMAP)  += memmap.o
+obj-$(CONFIG_RASPBERRYPI_FIRMWARE) += raspberrypi.o
 obj-$(CONFIG_QCOM_SCM)         += qcom_scm.o
 obj-$(CONFIG_QCOM_SCM_64)      += qcom_scm-64.o
 obj-$(CONFIG_QCOM_SCM_32)      += qcom_scm-32.o
-CFLAGS_qcom_scm-32.o :=$(call as-instr,.arch_extension sec,-DREQUIRES_SEC=1)
+CFLAGS_qcom_scm-32.o :=$(call as-instr,.arch armv7-a\n.arch_extension sec,-DREQUIRES_SEC=1) -march=armv7-a
 
 obj-y                          += broadcom/
 obj-$(CONFIG_GOOGLE_FIRMWARE)  += google/
diff --git a/drivers/firmware/arm_scpi.c b/drivers/firmware/arm_scpi.c
new file mode 100644 (file)
index 0000000..6174db8
--- /dev/null
@@ -0,0 +1,771 @@
+/*
+ * System Control and Power Interface (SCPI) Message Protocol driver
+ *
+ * SCPI Message Protocol is used between the System Control Processor(SCP)
+ * and the Application Processors(AP). The Message Handling Unit(MHU)
+ * provides a mechanism for inter-processor communication between SCP's
+ * Cortex M3 and AP.
+ *
+ * SCP offers control and management of the core/cluster power states,
+ * various power domain DVFS including the core/cluster, certain system
+ * clocks configuration, thermal sensors and many others.
+ *
+ * Copyright (C) 2015 ARM Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
+#include <linux/bitmap.h>
+#include <linux/device.h>
+#include <linux/err.h>
+#include <linux/export.h>
+#include <linux/io.h>
+#include <linux/kernel.h>
+#include <linux/list.h>
+#include <linux/mailbox_client.h>
+#include <linux/module.h>
+#include <linux/of_address.h>
+#include <linux/of_platform.h>
+#include <linux/printk.h>
+#include <linux/scpi_protocol.h>
+#include <linux/slab.h>
+#include <linux/sort.h>
+#include <linux/spinlock.h>
+
+#define CMD_ID_SHIFT           0
+#define CMD_ID_MASK            0x7f
+#define CMD_TOKEN_ID_SHIFT     8
+#define CMD_TOKEN_ID_MASK      0xff
+#define CMD_DATA_SIZE_SHIFT    16
+#define CMD_DATA_SIZE_MASK     0x1ff
+#define PACK_SCPI_CMD(cmd_id, tx_sz)                   \
+       ((((cmd_id) & CMD_ID_MASK) << CMD_ID_SHIFT) |   \
+       (((tx_sz) & CMD_DATA_SIZE_MASK) << CMD_DATA_SIZE_SHIFT))
+#define ADD_SCPI_TOKEN(cmd, token)                     \
+       ((cmd) |= (((token) & CMD_TOKEN_ID_MASK) << CMD_TOKEN_ID_SHIFT))
+
+#define CMD_SIZE(cmd)  (((cmd) >> CMD_DATA_SIZE_SHIFT) & CMD_DATA_SIZE_MASK)
+#define CMD_UNIQ_MASK  (CMD_TOKEN_ID_MASK << CMD_TOKEN_ID_SHIFT | CMD_ID_MASK)
+#define CMD_XTRACT_UNIQ(cmd)   ((cmd) & CMD_UNIQ_MASK)
+
+#define SCPI_SLOT              0
+
+#define MAX_DVFS_DOMAINS       8
+#define MAX_DVFS_OPPS          8
+#define DVFS_LATENCY(hdr)      (le32_to_cpu(hdr) >> 16)
+#define DVFS_OPP_COUNT(hdr)    ((le32_to_cpu(hdr) >> 8) & 0xff)
+
+#define PROTOCOL_REV_MINOR_BITS        16
+#define PROTOCOL_REV_MINOR_MASK        ((1U << PROTOCOL_REV_MINOR_BITS) - 1)
+#define PROTOCOL_REV_MAJOR(x)  ((x) >> PROTOCOL_REV_MINOR_BITS)
+#define PROTOCOL_REV_MINOR(x)  ((x) & PROTOCOL_REV_MINOR_MASK)
+
+#define FW_REV_MAJOR_BITS      24
+#define FW_REV_MINOR_BITS      16
+#define FW_REV_PATCH_MASK      ((1U << FW_REV_MINOR_BITS) - 1)
+#define FW_REV_MINOR_MASK      ((1U << FW_REV_MAJOR_BITS) - 1)
+#define FW_REV_MAJOR(x)                ((x) >> FW_REV_MAJOR_BITS)
+#define FW_REV_MINOR(x)                (((x) & FW_REV_MINOR_MASK) >> FW_REV_MINOR_BITS)
+#define FW_REV_PATCH(x)                ((x) & FW_REV_PATCH_MASK)
+
+#define MAX_RX_TIMEOUT         (msecs_to_jiffies(20))
+
+enum scpi_error_codes {
+       SCPI_SUCCESS = 0, /* Success */
+       SCPI_ERR_PARAM = 1, /* Invalid parameter(s) */
+       SCPI_ERR_ALIGN = 2, /* Invalid alignment */
+       SCPI_ERR_SIZE = 3, /* Invalid size */
+       SCPI_ERR_HANDLER = 4, /* Invalid handler/callback */
+       SCPI_ERR_ACCESS = 5, /* Invalid access/permission denied */
+       SCPI_ERR_RANGE = 6, /* Value out of range */
+       SCPI_ERR_TIMEOUT = 7, /* Timeout has occurred */
+       SCPI_ERR_NOMEM = 8, /* Invalid memory area or pointer */
+       SCPI_ERR_PWRSTATE = 9, /* Invalid power state */
+       SCPI_ERR_SUPPORT = 10, /* Not supported or disabled */
+       SCPI_ERR_DEVICE = 11, /* Device error */
+       SCPI_ERR_BUSY = 12, /* Device busy */
+       SCPI_ERR_MAX
+};
+
+enum scpi_std_cmd {
+       SCPI_CMD_INVALID                = 0x00,
+       SCPI_CMD_SCPI_READY             = 0x01,
+       SCPI_CMD_SCPI_CAPABILITIES      = 0x02,
+       SCPI_CMD_SET_CSS_PWR_STATE      = 0x03,
+       SCPI_CMD_GET_CSS_PWR_STATE      = 0x04,
+       SCPI_CMD_SET_SYS_PWR_STATE      = 0x05,
+       SCPI_CMD_SET_CPU_TIMER          = 0x06,
+       SCPI_CMD_CANCEL_CPU_TIMER       = 0x07,
+       SCPI_CMD_DVFS_CAPABILITIES      = 0x08,
+       SCPI_CMD_GET_DVFS_INFO          = 0x09,
+       SCPI_CMD_SET_DVFS               = 0x0a,
+       SCPI_CMD_GET_DVFS               = 0x0b,
+       SCPI_CMD_GET_DVFS_STAT          = 0x0c,
+       SCPI_CMD_CLOCK_CAPABILITIES     = 0x0d,
+       SCPI_CMD_GET_CLOCK_INFO         = 0x0e,
+       SCPI_CMD_SET_CLOCK_VALUE        = 0x0f,
+       SCPI_CMD_GET_CLOCK_VALUE        = 0x10,
+       SCPI_CMD_PSU_CAPABILITIES       = 0x11,
+       SCPI_CMD_GET_PSU_INFO           = 0x12,
+       SCPI_CMD_SET_PSU                = 0x13,
+       SCPI_CMD_GET_PSU                = 0x14,
+       SCPI_CMD_SENSOR_CAPABILITIES    = 0x15,
+       SCPI_CMD_SENSOR_INFO            = 0x16,
+       SCPI_CMD_SENSOR_VALUE           = 0x17,
+       SCPI_CMD_SENSOR_CFG_PERIODIC    = 0x18,
+       SCPI_CMD_SENSOR_CFG_BOUNDS      = 0x19,
+       SCPI_CMD_SENSOR_ASYNC_VALUE     = 0x1a,
+       SCPI_CMD_SET_DEVICE_PWR_STATE   = 0x1b,
+       SCPI_CMD_GET_DEVICE_PWR_STATE   = 0x1c,
+       SCPI_CMD_COUNT
+};
+
+struct scpi_xfer {
+       u32 slot; /* has to be first element */
+       u32 cmd;
+       u32 status;
+       const void *tx_buf;
+       void *rx_buf;
+       unsigned int tx_len;
+       unsigned int rx_len;
+       struct list_head node;
+       struct completion done;
+};
+
+struct scpi_chan {
+       struct mbox_client cl;
+       struct mbox_chan *chan;
+       void __iomem *tx_payload;
+       void __iomem *rx_payload;
+       struct list_head rx_pending;
+       struct list_head xfers_list;
+       struct scpi_xfer *xfers;
+       spinlock_t rx_lock; /* locking for the rx pending list */
+       struct mutex xfers_lock;
+       u8 token;
+};
+
+struct scpi_drvinfo {
+       u32 protocol_version;
+       u32 firmware_version;
+       int num_chans;
+       atomic_t next_chan;
+       struct scpi_ops *scpi_ops;
+       struct scpi_chan *channels;
+       struct scpi_dvfs_info *dvfs[MAX_DVFS_DOMAINS];
+};
+
+/*
+ * The SCP firmware only executes in little-endian mode, so any buffers
+ * shared through SCPI should have their contents converted to little-endian
+ */
+struct scpi_shared_mem {
+       __le32 command;
+       __le32 status;
+       u8 payload[0];
+} __packed;
+
+struct scp_capabilities {
+       __le32 protocol_version;
+       __le32 event_version;
+       __le32 platform_version;
+       __le32 commands[4];
+} __packed;
+
+struct clk_get_info {
+       __le16 id;
+       __le16 flags;
+       __le32 min_rate;
+       __le32 max_rate;
+       u8 name[20];
+} __packed;
+
+struct clk_get_value {
+       __le32 rate;
+} __packed;
+
+struct clk_set_value {
+       __le16 id;
+       __le16 reserved;
+       __le32 rate;
+} __packed;
+
+struct dvfs_info {
+       __le32 header;
+       struct {
+               __le32 freq;
+               __le32 m_volt;
+       } opps[MAX_DVFS_OPPS];
+} __packed;
+
+struct dvfs_get {
+       u8 index;
+} __packed;
+
+struct dvfs_set {
+       u8 domain;
+       u8 index;
+} __packed;
+
+struct sensor_capabilities {
+       __le16 sensors;
+} __packed;
+
+struct _scpi_sensor_info {
+       __le16 sensor_id;
+       u8 class;
+       u8 trigger_type;
+       char name[20];
+};
+
+struct sensor_value {
+       __le32 val;
+} __packed;
+
+static struct scpi_drvinfo *scpi_info;
+
+static int scpi_linux_errmap[SCPI_ERR_MAX] = {
+       /* better than switch case as long as return value is continuous */
+       0, /* SCPI_SUCCESS */
+       -EINVAL, /* SCPI_ERR_PARAM */
+       -ENOEXEC, /* SCPI_ERR_ALIGN */
+       -EMSGSIZE, /* SCPI_ERR_SIZE */
+       -EINVAL, /* SCPI_ERR_HANDLER */
+       -EACCES, /* SCPI_ERR_ACCESS */
+       -ERANGE, /* SCPI_ERR_RANGE */
+       -ETIMEDOUT, /* SCPI_ERR_TIMEOUT */
+       -ENOMEM, /* SCPI_ERR_NOMEM */
+       -EINVAL, /* SCPI_ERR_PWRSTATE */
+       -EOPNOTSUPP, /* SCPI_ERR_SUPPORT */
+       -EIO, /* SCPI_ERR_DEVICE */
+       -EBUSY, /* SCPI_ERR_BUSY */
+};
+
+static inline int scpi_to_linux_errno(int errno)
+{
+       if (errno >= SCPI_SUCCESS && errno < SCPI_ERR_MAX)
+               return scpi_linux_errmap[errno];
+       return -EIO;
+}
+
+static void scpi_process_cmd(struct scpi_chan *ch, u32 cmd)
+{
+       unsigned long flags;
+       struct scpi_xfer *t, *match = NULL;
+
+       spin_lock_irqsave(&ch->rx_lock, flags);
+       if (list_empty(&ch->rx_pending)) {
+               spin_unlock_irqrestore(&ch->rx_lock, flags);
+               return;
+       }
+
+       list_for_each_entry(t, &ch->rx_pending, node)
+               if (CMD_XTRACT_UNIQ(t->cmd) == CMD_XTRACT_UNIQ(cmd)) {
+                       list_del(&t->node);
+                       match = t;
+                       break;
+               }
+       /* check if wait_for_completion is in progress or timed-out */
+       if (match && !completion_done(&match->done)) {
+               struct scpi_shared_mem *mem = ch->rx_payload;
+               unsigned int len = min(match->rx_len, CMD_SIZE(cmd));
+
+               match->status = le32_to_cpu(mem->status);
+               memcpy_fromio(match->rx_buf, mem->payload, len);
+               if (match->rx_len > len)
+                       memset(match->rx_buf + len, 0, match->rx_len - len);
+               complete(&match->done);
+       }
+       spin_unlock_irqrestore(&ch->rx_lock, flags);
+}
+
+static void scpi_handle_remote_msg(struct mbox_client *c, void *msg)
+{
+       struct scpi_chan *ch = container_of(c, struct scpi_chan, cl);
+       struct scpi_shared_mem *mem = ch->rx_payload;
+       u32 cmd = le32_to_cpu(mem->command);
+
+       scpi_process_cmd(ch, cmd);
+}
+
+static void scpi_tx_prepare(struct mbox_client *c, void *msg)
+{
+       unsigned long flags;
+       struct scpi_xfer *t = msg;
+       struct scpi_chan *ch = container_of(c, struct scpi_chan, cl);
+       struct scpi_shared_mem *mem = (struct scpi_shared_mem *)ch->tx_payload;
+
+       if (t->tx_buf)
+               memcpy_toio(mem->payload, t->tx_buf, t->tx_len);
+       if (t->rx_buf) {
+               if (!(++ch->token))
+                       ++ch->token;
+               ADD_SCPI_TOKEN(t->cmd, ch->token);
+               spin_lock_irqsave(&ch->rx_lock, flags);
+               list_add_tail(&t->node, &ch->rx_pending);
+               spin_unlock_irqrestore(&ch->rx_lock, flags);
+       }
+       mem->command = cpu_to_le32(t->cmd);
+}
+
+static struct scpi_xfer *get_scpi_xfer(struct scpi_chan *ch)
+{
+       struct scpi_xfer *t;
+
+       mutex_lock(&ch->xfers_lock);
+       if (list_empty(&ch->xfers_list)) {
+               mutex_unlock(&ch->xfers_lock);
+               return NULL;
+       }
+       t = list_first_entry(&ch->xfers_list, struct scpi_xfer, node);
+       list_del(&t->node);
+       mutex_unlock(&ch->xfers_lock);
+       return t;
+}
+
+static void put_scpi_xfer(struct scpi_xfer *t, struct scpi_chan *ch)
+{
+       mutex_lock(&ch->xfers_lock);
+       list_add_tail(&t->node, &ch->xfers_list);
+       mutex_unlock(&ch->xfers_lock);
+}
+
+static int scpi_send_message(u8 cmd, void *tx_buf, unsigned int tx_len,
+                            void *rx_buf, unsigned int rx_len)
+{
+       int ret;
+       u8 chan;
+       struct scpi_xfer *msg;
+       struct scpi_chan *scpi_chan;
+
+       chan = atomic_inc_return(&scpi_info->next_chan) % scpi_info->num_chans;
+       scpi_chan = scpi_info->channels + chan;
+
+       msg = get_scpi_xfer(scpi_chan);
+       if (!msg)
+               return -ENOMEM;
+
+       msg->slot = BIT(SCPI_SLOT);
+       msg->cmd = PACK_SCPI_CMD(cmd, tx_len);
+       msg->tx_buf = tx_buf;
+       msg->tx_len = tx_len;
+       msg->rx_buf = rx_buf;
+       msg->rx_len = rx_len;
+       init_completion(&msg->done);
+
+       ret = mbox_send_message(scpi_chan->chan, msg);
+       if (ret < 0 || !rx_buf)
+               goto out;
+
+       if (!wait_for_completion_timeout(&msg->done, MAX_RX_TIMEOUT))
+               ret = -ETIMEDOUT;
+       else
+               /* first status word */
+               ret = le32_to_cpu(msg->status);
+out:
+       if (ret < 0 && rx_buf) /* remove entry from the list if timed-out */
+               scpi_process_cmd(scpi_chan, msg->cmd);
+
+       put_scpi_xfer(msg, scpi_chan);
+       /* SCPI error codes > 0, translate them to Linux scale*/
+       return ret > 0 ? scpi_to_linux_errno(ret) : ret;
+}
+
+static u32 scpi_get_version(void)
+{
+       return scpi_info->protocol_version;
+}
+
+static int
+scpi_clk_get_range(u16 clk_id, unsigned long *min, unsigned long *max)
+{
+       int ret;
+       struct clk_get_info clk;
+       __le16 le_clk_id = cpu_to_le16(clk_id);
+
+       ret = scpi_send_message(SCPI_CMD_GET_CLOCK_INFO, &le_clk_id,
+                               sizeof(le_clk_id), &clk, sizeof(clk));
+       if (!ret) {
+               *min = le32_to_cpu(clk.min_rate);
+               *max = le32_to_cpu(clk.max_rate);
+       }
+       return ret;
+}
+
+static unsigned long scpi_clk_get_val(u16 clk_id)
+{
+       int ret;
+       struct clk_get_value clk;
+       __le16 le_clk_id = cpu_to_le16(clk_id);
+
+       ret = scpi_send_message(SCPI_CMD_GET_CLOCK_VALUE, &le_clk_id,
+                               sizeof(le_clk_id), &clk, sizeof(clk));
+       return ret ? ret : le32_to_cpu(clk.rate);
+}
+
+static int scpi_clk_set_val(u16 clk_id, unsigned long rate)
+{
+       int stat;
+       struct clk_set_value clk = {
+               .id = cpu_to_le16(clk_id),
+               .rate = cpu_to_le32(rate)
+       };
+
+       return scpi_send_message(SCPI_CMD_SET_CLOCK_VALUE, &clk, sizeof(clk),
+                                &stat, sizeof(stat));
+}
+
+static int scpi_dvfs_get_idx(u8 domain)
+{
+       int ret;
+       struct dvfs_get dvfs;
+
+       ret = scpi_send_message(SCPI_CMD_GET_DVFS, &domain, sizeof(domain),
+                               &dvfs, sizeof(dvfs));
+       return ret ? ret : dvfs.index;
+}
+
+static int scpi_dvfs_set_idx(u8 domain, u8 index)
+{
+       int stat;
+       struct dvfs_set dvfs = {domain, index};
+
+       return scpi_send_message(SCPI_CMD_SET_DVFS, &dvfs, sizeof(dvfs),
+                                &stat, sizeof(stat));
+}
+
+static int opp_cmp_func(const void *opp1, const void *opp2)
+{
+       const struct scpi_opp *t1 = opp1, *t2 = opp2;
+
+       return t1->freq - t2->freq;
+}
+
+static struct scpi_dvfs_info *scpi_dvfs_get_info(u8 domain)
+{
+       struct scpi_dvfs_info *info;
+       struct scpi_opp *opp;
+       struct dvfs_info buf;
+       int ret, i;
+
+       if (domain >= MAX_DVFS_DOMAINS)
+               return ERR_PTR(-EINVAL);
+
+       if (scpi_info->dvfs[domain])    /* data already populated */
+               return scpi_info->dvfs[domain];
+
+       ret = scpi_send_message(SCPI_CMD_GET_DVFS_INFO, &domain, sizeof(domain),
+                               &buf, sizeof(buf));
+
+       if (ret)
+               return ERR_PTR(ret);
+
+       info = kmalloc(sizeof(*info), GFP_KERNEL);
+       if (!info)
+               return ERR_PTR(-ENOMEM);
+
+       info->count = DVFS_OPP_COUNT(buf.header);
+       info->latency = DVFS_LATENCY(buf.header) * 1000; /* uS to nS */
+
+       info->opps = kcalloc(info->count, sizeof(*opp), GFP_KERNEL);
+       if (!info->opps) {
+               kfree(info);
+               return ERR_PTR(-ENOMEM);
+       }
+
+       for (i = 0, opp = info->opps; i < info->count; i++, opp++) {
+               opp->freq = le32_to_cpu(buf.opps[i].freq);
+               opp->m_volt = le32_to_cpu(buf.opps[i].m_volt);
+       }
+
+       sort(info->opps, info->count, sizeof(*opp), opp_cmp_func, NULL);
+
+       scpi_info->dvfs[domain] = info;
+       return info;
+}
+
+static int scpi_sensor_get_capability(u16 *sensors)
+{
+       struct sensor_capabilities cap_buf;
+       int ret;
+
+       ret = scpi_send_message(SCPI_CMD_SENSOR_CAPABILITIES, NULL, 0, &cap_buf,
+                               sizeof(cap_buf));
+       if (!ret)
+               *sensors = le16_to_cpu(cap_buf.sensors);
+
+       return ret;
+}
+
+static int scpi_sensor_get_info(u16 sensor_id, struct scpi_sensor_info *info)
+{
+       __le16 id = cpu_to_le16(sensor_id);
+       struct _scpi_sensor_info _info;
+       int ret;
+
+       ret = scpi_send_message(SCPI_CMD_SENSOR_INFO, &id, sizeof(id),
+                               &_info, sizeof(_info));
+       if (!ret) {
+               memcpy(info, &_info, sizeof(*info));
+               info->sensor_id = le16_to_cpu(_info.sensor_id);
+       }
+
+       return ret;
+}
+
+int scpi_sensor_get_value(u16 sensor, u32 *val)
+{
+       struct sensor_value buf;
+       int ret;
+
+       ret = scpi_send_message(SCPI_CMD_SENSOR_VALUE, &sensor, sizeof(sensor),
+                               &buf, sizeof(buf));
+       if (!ret)
+               *val = le32_to_cpu(buf.val);
+
+       return ret;
+}
+
+static struct scpi_ops scpi_ops = {
+       .get_version = scpi_get_version,
+       .clk_get_range = scpi_clk_get_range,
+       .clk_get_val = scpi_clk_get_val,
+       .clk_set_val = scpi_clk_set_val,
+       .dvfs_get_idx = scpi_dvfs_get_idx,
+       .dvfs_set_idx = scpi_dvfs_set_idx,
+       .dvfs_get_info = scpi_dvfs_get_info,
+       .sensor_get_capability = scpi_sensor_get_capability,
+       .sensor_get_info = scpi_sensor_get_info,
+       .sensor_get_value = scpi_sensor_get_value,
+};
+
+struct scpi_ops *get_scpi_ops(void)
+{
+       return scpi_info ? scpi_info->scpi_ops : NULL;
+}
+EXPORT_SYMBOL_GPL(get_scpi_ops);
+
+static int scpi_init_versions(struct scpi_drvinfo *info)
+{
+       int ret;
+       struct scp_capabilities caps;
+
+       ret = scpi_send_message(SCPI_CMD_SCPI_CAPABILITIES, NULL, 0,
+                               &caps, sizeof(caps));
+       if (!ret) {
+               info->protocol_version = le32_to_cpu(caps.protocol_version);
+               info->firmware_version = le32_to_cpu(caps.platform_version);
+       }
+       return ret;
+}
+
+static ssize_t protocol_version_show(struct device *dev,
+                                    struct device_attribute *attr, char *buf)
+{
+       struct scpi_drvinfo *scpi_info = dev_get_drvdata(dev);
+
+       return sprintf(buf, "%d.%d\n",
+                      PROTOCOL_REV_MAJOR(scpi_info->protocol_version),
+                      PROTOCOL_REV_MINOR(scpi_info->protocol_version));
+}
+static DEVICE_ATTR_RO(protocol_version);
+
+static ssize_t firmware_version_show(struct device *dev,
+                                    struct device_attribute *attr, char *buf)
+{
+       struct scpi_drvinfo *scpi_info = dev_get_drvdata(dev);
+
+       return sprintf(buf, "%d.%d.%d\n",
+                      FW_REV_MAJOR(scpi_info->firmware_version),
+                      FW_REV_MINOR(scpi_info->firmware_version),
+                      FW_REV_PATCH(scpi_info->firmware_version));
+}
+static DEVICE_ATTR_RO(firmware_version);
+
+static struct attribute *versions_attrs[] = {
+       &dev_attr_firmware_version.attr,
+       &dev_attr_protocol_version.attr,
+       NULL,
+};
+ATTRIBUTE_GROUPS(versions);
+
+static void
+scpi_free_channels(struct device *dev, struct scpi_chan *pchan, int count)
+{
+       int i;
+
+       for (i = 0; i < count && pchan->chan; i++, pchan++) {
+               mbox_free_channel(pchan->chan);
+               devm_kfree(dev, pchan->xfers);
+               devm_iounmap(dev, pchan->rx_payload);
+       }
+}
+
+static int scpi_remove(struct platform_device *pdev)
+{
+       int i;
+       struct device *dev = &pdev->dev;
+       struct scpi_drvinfo *info = platform_get_drvdata(pdev);
+
+       scpi_info = NULL; /* stop exporting SCPI ops through get_scpi_ops */
+
+       of_platform_depopulate(dev);
+       sysfs_remove_groups(&dev->kobj, versions_groups);
+       scpi_free_channels(dev, info->channels, info->num_chans);
+       platform_set_drvdata(pdev, NULL);
+
+       for (i = 0; i < MAX_DVFS_DOMAINS && info->dvfs[i]; i++) {
+               kfree(info->dvfs[i]->opps);
+               kfree(info->dvfs[i]);
+       }
+       devm_kfree(dev, info->channels);
+       devm_kfree(dev, info);
+
+       return 0;
+}
+
+#define MAX_SCPI_XFERS         10
+static int scpi_alloc_xfer_list(struct device *dev, struct scpi_chan *ch)
+{
+       int i;
+       struct scpi_xfer *xfers;
+
+       xfers = devm_kzalloc(dev, MAX_SCPI_XFERS * sizeof(*xfers), GFP_KERNEL);
+       if (!xfers)
+               return -ENOMEM;
+
+       ch->xfers = xfers;
+       for (i = 0; i < MAX_SCPI_XFERS; i++, xfers++)
+               list_add_tail(&xfers->node, &ch->xfers_list);
+       return 0;
+}
+
+static int scpi_probe(struct platform_device *pdev)
+{
+       int count, idx, ret;
+       struct resource res;
+       struct scpi_chan *scpi_chan;
+       struct device *dev = &pdev->dev;
+       struct device_node *np = dev->of_node;
+
+       scpi_info = devm_kzalloc(dev, sizeof(*scpi_info), GFP_KERNEL);
+       if (!scpi_info)
+               return -ENOMEM;
+
+       count = of_count_phandle_with_args(np, "mboxes", "#mbox-cells");
+       if (count < 0) {
+               dev_err(dev, "no mboxes property in '%s'\n", np->full_name);
+               return -ENODEV;
+       }
+
+       scpi_chan = devm_kcalloc(dev, count, sizeof(*scpi_chan), GFP_KERNEL);
+       if (!scpi_chan)
+               return -ENOMEM;
+
+       for (idx = 0; idx < count; idx++) {
+               resource_size_t size;
+               struct scpi_chan *pchan = scpi_chan + idx;
+               struct mbox_client *cl = &pchan->cl;
+               struct device_node *shmem = of_parse_phandle(np, "shmem", idx);
+
+               if (of_address_to_resource(shmem, 0, &res)) {
+                       dev_err(dev, "failed to get SCPI payload mem resource\n");
+                       ret = -EINVAL;
+                       goto err;
+               }
+
+               size = resource_size(&res);
+               pchan->rx_payload = devm_ioremap(dev, res.start, size);
+               if (!pchan->rx_payload) {
+                       dev_err(dev, "failed to ioremap SCPI payload\n");
+                       ret = -EADDRNOTAVAIL;
+                       goto err;
+               }
+               pchan->tx_payload = pchan->rx_payload + (size >> 1);
+
+               cl->dev = dev;
+               cl->rx_callback = scpi_handle_remote_msg;
+               cl->tx_prepare = scpi_tx_prepare;
+               cl->tx_block = true;
+               cl->tx_tout = 50;
+               cl->knows_txdone = false; /* controller can't ack */
+
+               INIT_LIST_HEAD(&pchan->rx_pending);
+               INIT_LIST_HEAD(&pchan->xfers_list);
+               spin_lock_init(&pchan->rx_lock);
+               mutex_init(&pchan->xfers_lock);
+
+               ret = scpi_alloc_xfer_list(dev, pchan);
+               if (!ret) {
+                       pchan->chan = mbox_request_channel(cl, idx);
+                       if (!IS_ERR(pchan->chan))
+                               continue;
+                       ret = PTR_ERR(pchan->chan);
+                       if (ret != -EPROBE_DEFER)
+                               dev_err(dev, "failed to get channel%d err %d\n",
+                                       idx, ret);
+               }
+err:
+               scpi_free_channels(dev, scpi_chan, idx);
+               scpi_info = NULL;
+               return ret;
+       }
+
+       scpi_info->channels = scpi_chan;
+       scpi_info->num_chans = count;
+       platform_set_drvdata(pdev, scpi_info);
+
+       ret = scpi_init_versions(scpi_info);
+       if (ret) {
+               dev_err(dev, "incorrect or no SCP firmware found\n");
+               scpi_remove(pdev);
+               return ret;
+       }
+
+       _dev_info(dev, "SCP Protocol %d.%d Firmware %d.%d.%d version\n",
+                 PROTOCOL_REV_MAJOR(scpi_info->protocol_version),
+                 PROTOCOL_REV_MINOR(scpi_info->protocol_version),
+                 FW_REV_MAJOR(scpi_info->firmware_version),
+                 FW_REV_MINOR(scpi_info->firmware_version),
+                 FW_REV_PATCH(scpi_info->firmware_version));
+       scpi_info->scpi_ops = &scpi_ops;
+
+       ret = sysfs_create_groups(&dev->kobj, versions_groups);
+       if (ret)
+               dev_err(dev, "unable to create sysfs version group\n");
+
+       return of_platform_populate(dev->of_node, NULL, NULL, dev);
+}
+
+static const struct of_device_id scpi_of_match[] = {
+       {.compatible = "arm,scpi"},
+       {},
+};
+
+MODULE_DEVICE_TABLE(of, scpi_of_match);
+
+static struct platform_driver scpi_driver = {
+       .driver = {
+               .name = "scpi_protocol",
+               .of_match_table = scpi_of_match,
+       },
+       .probe = scpi_probe,
+       .remove = scpi_remove,
+};
+module_platform_driver(scpi_driver);
+
+MODULE_AUTHOR("Sudeep Holla <sudeep.holla@arm.com>");
+MODULE_DESCRIPTION("ARM SCPI mailbox protocol driver");
+MODULE_LICENSE("GPL v2");
index 42700f09a8c5845f418709c8802c08d6043c2f10..d24f35d74b27079afeae5c08d601c3bcd899dee6 100644 (file)
 #include <linux/printk.h>
 #include <linux/psci.h>
 #include <linux/reboot.h>
+#include <linux/suspend.h>
 
 #include <uapi/linux/psci.h>
 
 #include <asm/cputype.h>
 #include <asm/system_misc.h>
 #include <asm/smp_plat.h>
+#include <asm/suspend.h>
 
 /*
  * While a 64-bit OS can make calls with SMC32 calling conventions, for some
- * calls it is necessary to use SMC64 to pass or return 64-bit values. For such
- * calls PSCI_0_2_FN_NATIVE(x) will choose the appropriate (native-width)
- * function ID.
+ * calls it is necessary to use SMC64 to pass or return 64-bit values.
+ * For such calls PSCI_FN_NATIVE(version, name) will choose the appropriate
+ * (native-width) function ID.
  */
 #ifdef CONFIG_64BIT
-#define PSCI_0_2_FN_NATIVE(name)       PSCI_0_2_FN64_##name
+#define PSCI_FN_NATIVE(version, name)  PSCI_##version##_FN64_##name
 #else
-#define PSCI_0_2_FN_NATIVE(name)       PSCI_0_2_FN_##name
+#define PSCI_FN_NATIVE(version, name)  PSCI_##version##_FN_##name
 #endif
 
 /*
@@ -70,6 +72,41 @@ enum psci_function {
 
 static u32 psci_function_id[PSCI_FN_MAX];
 
+#define PSCI_0_2_POWER_STATE_MASK              \
+                               (PSCI_0_2_POWER_STATE_ID_MASK | \
+                               PSCI_0_2_POWER_STATE_TYPE_MASK | \
+                               PSCI_0_2_POWER_STATE_AFFL_MASK)
+
+#define PSCI_1_0_EXT_POWER_STATE_MASK          \
+                               (PSCI_1_0_EXT_POWER_STATE_ID_MASK | \
+                               PSCI_1_0_EXT_POWER_STATE_TYPE_MASK)
+
+static u32 psci_cpu_suspend_feature;
+
+static inline bool psci_has_ext_power_state(void)
+{
+       return psci_cpu_suspend_feature &
+                               PSCI_1_0_FEATURES_CPU_SUSPEND_PF_MASK;
+}
+
+bool psci_power_state_loses_context(u32 state)
+{
+       const u32 mask = psci_has_ext_power_state() ?
+                                       PSCI_1_0_EXT_POWER_STATE_TYPE_MASK :
+                                       PSCI_0_2_POWER_STATE_TYPE_MASK;
+
+       return state & mask;
+}
+
+bool psci_power_state_is_valid(u32 state)
+{
+       const u32 valid_mask = psci_has_ext_power_state() ?
+                              PSCI_1_0_EXT_POWER_STATE_MASK :
+                              PSCI_0_2_POWER_STATE_MASK;
+
+       return !(state & ~valid_mask);
+}
+
 static int psci_to_linux_errno(int errno)
 {
        switch (errno) {
@@ -78,6 +115,7 @@ static int psci_to_linux_errno(int errno)
        case PSCI_RET_NOT_SUPPORTED:
                return -EOPNOTSUPP;
        case PSCI_RET_INVALID_PARAMS:
+       case PSCI_RET_INVALID_ADDRESS:
                return -EINVAL;
        case PSCI_RET_DENIED:
                return -EPERM;
@@ -134,7 +172,7 @@ static int psci_migrate(unsigned long cpuid)
 static int psci_affinity_info(unsigned long target_affinity,
                unsigned long lowest_affinity_level)
 {
-       return invoke_psci_fn(PSCI_0_2_FN_NATIVE(AFFINITY_INFO),
+       return invoke_psci_fn(PSCI_FN_NATIVE(0_2, AFFINITY_INFO),
                              target_affinity, lowest_affinity_level, 0);
 }
 
@@ -145,7 +183,7 @@ static int psci_migrate_info_type(void)
 
 static unsigned long psci_migrate_info_up_cpu(void)
 {
-       return invoke_psci_fn(PSCI_0_2_FN_NATIVE(MIGRATE_INFO_UP_CPU),
+       return invoke_psci_fn(PSCI_FN_NATIVE(0_2, MIGRATE_INFO_UP_CPU),
                              0, 0, 0);
 }
 
@@ -181,6 +219,49 @@ static void psci_sys_poweroff(void)
        invoke_psci_fn(PSCI_0_2_FN_SYSTEM_OFF, 0, 0, 0);
 }
 
+static int __init psci_features(u32 psci_func_id)
+{
+       return invoke_psci_fn(PSCI_1_0_FN_PSCI_FEATURES,
+                             psci_func_id, 0, 0);
+}
+
+static int psci_system_suspend(unsigned long unused)
+{
+       return invoke_psci_fn(PSCI_FN_NATIVE(1_0, SYSTEM_SUSPEND),
+                             virt_to_phys(cpu_resume), 0, 0);
+}
+
+static int psci_system_suspend_enter(suspend_state_t state)
+{
+       return cpu_suspend(0, psci_system_suspend);
+}
+
+static const struct platform_suspend_ops psci_suspend_ops = {
+       .valid          = suspend_valid_only_mem,
+       .enter          = psci_system_suspend_enter,
+};
+
+static void __init psci_init_system_suspend(void)
+{
+       int ret;
+
+       if (!IS_ENABLED(CONFIG_SUSPEND))
+               return;
+
+       ret = psci_features(PSCI_FN_NATIVE(1_0, SYSTEM_SUSPEND));
+
+       if (ret != PSCI_RET_NOT_SUPPORTED)
+               suspend_set_ops(&psci_suspend_ops);
+}
+
+static void __init psci_init_cpu_suspend(void)
+{
+       int feature = psci_features(psci_function_id[PSCI_FN_CPU_SUSPEND]);
+
+       if (feature != PSCI_RET_NOT_SUPPORTED)
+               psci_cpu_suspend_feature = feature;
+}
+
 /*
  * Detect the presence of a resident Trusted OS which may cause CPU_OFF to
  * return DENIED (which would be fatal).
@@ -224,16 +305,17 @@ static void __init psci_init_migrate(void)
 static void __init psci_0_2_set_functions(void)
 {
        pr_info("Using standard PSCI v0.2 function IDs\n");
-       psci_function_id[PSCI_FN_CPU_SUSPEND] = PSCI_0_2_FN_NATIVE(CPU_SUSPEND);
+       psci_function_id[PSCI_FN_CPU_SUSPEND] =
+                                       PSCI_FN_NATIVE(0_2, CPU_SUSPEND);
        psci_ops.cpu_suspend = psci_cpu_suspend;
 
        psci_function_id[PSCI_FN_CPU_OFF] = PSCI_0_2_FN_CPU_OFF;
        psci_ops.cpu_off = psci_cpu_off;
 
-       psci_function_id[PSCI_FN_CPU_ON] = PSCI_0_2_FN_NATIVE(CPU_ON);
+       psci_function_id[PSCI_FN_CPU_ON] = PSCI_FN_NATIVE(0_2, CPU_ON);
        psci_ops.cpu_on = psci_cpu_on;
 
-       psci_function_id[PSCI_FN_MIGRATE] = PSCI_0_2_FN_NATIVE(MIGRATE);
+       psci_function_id[PSCI_FN_MIGRATE] = PSCI_FN_NATIVE(0_2, MIGRATE);
        psci_ops.migrate = psci_migrate;
 
        psci_ops.affinity_info = psci_affinity_info;
@@ -265,6 +347,11 @@ static int __init psci_probe(void)
 
        psci_init_migrate();
 
+       if (PSCI_VERSION_MAJOR(ver) >= 1) {
+               psci_init_cpu_suspend();
+               psci_init_system_suspend();
+       }
+
        return 0;
 }
 
@@ -340,6 +427,7 @@ out_put_node:
 static const struct of_device_id const psci_of_match[] __initconst = {
        { .compatible = "arm,psci",     .data = psci_0_1_init},
        { .compatible = "arm,psci-0.2", .data = psci_0_2_init},
+       { .compatible = "arm,psci-1.0", .data = psci_0_2_init},
        {},
 };
 
index 29e6850665eb344cbbc946273343ec13cef81e12..0883292f640f4d512c8b198d90a65ed945c02f87 100644 (file)
@@ -480,15 +480,15 @@ void __qcom_scm_cpu_power_down(u32 flags)
 int __qcom_scm_is_call_available(u32 svc_id, u32 cmd_id)
 {
        int ret;
-       u32 svc_cmd = (svc_id << 10) | cmd_id;
-       u32 ret_val = 0;
+       __le32 svc_cmd = cpu_to_le32((svc_id << 10) | cmd_id);
+       __le32 ret_val = 0;
 
        ret = qcom_scm_call(QCOM_SCM_SVC_INFO, QCOM_IS_CALL_AVAIL_CMD, &svc_cmd,
                        sizeof(svc_cmd), &ret_val, sizeof(ret_val));
        if (ret)
                return ret;
 
-       return ret_val;
+       return le32_to_cpu(ret_val);
 }
 
 int __qcom_scm_hdcp_req(struct qcom_scm_hdcp_req *req, u32 req_cnt, u32 *resp)
diff --git a/drivers/firmware/raspberrypi.c b/drivers/firmware/raspberrypi.c
new file mode 100644 (file)
index 0000000..dd506cd
--- /dev/null
@@ -0,0 +1,260 @@
+/*
+ * Defines interfaces for interacting wtih the Raspberry Pi firmware's
+ * property channel.
+ *
+ * Copyright Â© 2015 Broadcom
+ *
+ * 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.
+ */
+
+#include <linux/dma-mapping.h>
+#include <linux/mailbox_client.h>
+#include <linux/module.h>
+#include <linux/of_platform.h>
+#include <linux/platform_device.h>
+#include <soc/bcm2835/raspberrypi-firmware.h>
+
+#define MBOX_MSG(chan, data28)         (((data28) & ~0xf) | ((chan) & 0xf))
+#define MBOX_CHAN(msg)                 ((msg) & 0xf)
+#define MBOX_DATA28(msg)               ((msg) & ~0xf)
+#define MBOX_CHAN_PROPERTY             8
+
+struct rpi_firmware {
+       struct mbox_client cl;
+       struct mbox_chan *chan; /* The property channel. */
+       struct completion c;
+       u32 enabled;
+};
+
+static DEFINE_MUTEX(transaction_lock);
+
+static void response_callback(struct mbox_client *cl, void *msg)
+{
+       struct rpi_firmware *fw = container_of(cl, struct rpi_firmware, cl);
+       complete(&fw->c);
+}
+
+/*
+ * Sends a request to the firmware through the BCM2835 mailbox driver,
+ * and synchronously waits for the reply.
+ */
+static int
+rpi_firmware_transaction(struct rpi_firmware *fw, u32 chan, u32 data)
+{
+       u32 message = MBOX_MSG(chan, data);
+       int ret;
+
+       WARN_ON(data & 0xf);
+
+       mutex_lock(&transaction_lock);
+       reinit_completion(&fw->c);
+       ret = mbox_send_message(fw->chan, &message);
+       if (ret >= 0) {
+               wait_for_completion(&fw->c);
+               ret = 0;
+       } else {
+               dev_err(fw->cl.dev, "mbox_send_message returned %d\n", ret);
+       }
+       mutex_unlock(&transaction_lock);
+
+       return ret;
+}
+
+/**
+ * rpi_firmware_property_list - Submit firmware property list
+ * @fw:                Pointer to firmware structure from rpi_firmware_get().
+ * @data:      Buffer holding tags.
+ * @tag_size:  Size of tags buffer.
+ *
+ * Submits a set of concatenated tags to the VPU firmware through the
+ * mailbox property interface.
+ *
+ * The buffer header and the ending tag are added by this function and
+ * don't need to be supplied, just the actual tags for your operation.
+ * See struct rpi_firmware_property_tag_header for the per-tag
+ * structure.
+ */
+int rpi_firmware_property_list(struct rpi_firmware *fw,
+                              void *data, size_t tag_size)
+{
+       size_t size = tag_size + 12;
+       u32 *buf;
+       dma_addr_t bus_addr;
+       int ret;
+
+       /* Packets are processed a dword at a time. */
+       if (size & 3)
+               return -EINVAL;
+
+       buf = dma_alloc_coherent(fw->cl.dev, PAGE_ALIGN(size), &bus_addr,
+                                GFP_ATOMIC);
+       if (!buf)
+               return -ENOMEM;
+
+       /* The firmware will error out without parsing in this case. */
+       WARN_ON(size >= 1024 * 1024);
+
+       buf[0] = size;
+       buf[1] = RPI_FIRMWARE_STATUS_REQUEST;
+       memcpy(&buf[2], data, tag_size);
+       buf[size / 4 - 1] = RPI_FIRMWARE_PROPERTY_END;
+       wmb();
+
+       ret = rpi_firmware_transaction(fw, MBOX_CHAN_PROPERTY, bus_addr);
+
+       rmb();
+       memcpy(data, &buf[2], tag_size);
+       if (ret == 0 && buf[1] != RPI_FIRMWARE_STATUS_SUCCESS) {
+               /*
+                * The tag name here might not be the one causing the
+                * error, if there were multiple tags in the request.
+                * But single-tag is the most common, so go with it.
+                */
+               dev_err(fw->cl.dev, "Request 0x%08x returned status 0x%08x\n",
+                       buf[2], buf[1]);
+               ret = -EINVAL;
+       }
+
+       dma_free_coherent(fw->cl.dev, PAGE_ALIGN(size), buf, bus_addr);
+
+       return ret;
+}
+EXPORT_SYMBOL_GPL(rpi_firmware_property_list);
+
+/**
+ * rpi_firmware_property - Submit single firmware property
+ * @fw:                Pointer to firmware structure from rpi_firmware_get().
+ * @tag:       One of enum_mbox_property_tag.
+ * @tag_data:  Tag data buffer.
+ * @buf_size:  Buffer size.
+ *
+ * Submits a single tag to the VPU firmware through the mailbox
+ * property interface.
+ *
+ * This is a convenience wrapper around
+ * rpi_firmware_property_list() to avoid some of the
+ * boilerplate in property calls.
+ */
+int rpi_firmware_property(struct rpi_firmware *fw,
+                         u32 tag, void *tag_data, size_t buf_size)
+{
+       /* Single tags are very small (generally 8 bytes), so the
+        * stack should be safe.
+        */
+       u8 data[buf_size + sizeof(struct rpi_firmware_property_tag_header)];
+       struct rpi_firmware_property_tag_header *header =
+               (struct rpi_firmware_property_tag_header *)data;
+       int ret;
+
+       header->tag = tag;
+       header->buf_size = buf_size;
+       header->req_resp_size = 0;
+       memcpy(data + sizeof(struct rpi_firmware_property_tag_header),
+              tag_data, buf_size);
+
+       ret = rpi_firmware_property_list(fw, &data, sizeof(data));
+       memcpy(tag_data,
+              data + sizeof(struct rpi_firmware_property_tag_header),
+              buf_size);
+
+       return ret;
+}
+EXPORT_SYMBOL_GPL(rpi_firmware_property);
+
+static void
+rpi_firmware_print_firmware_revision(struct rpi_firmware *fw)
+{
+       u32 packet;
+       int ret = rpi_firmware_property(fw,
+                                       RPI_FIRMWARE_GET_FIRMWARE_REVISION,
+                                       &packet, sizeof(packet));
+
+       if (ret == 0) {
+               struct tm tm;
+
+               time_to_tm(packet, 0, &tm);
+
+               dev_info(fw->cl.dev,
+                        "Attached to firmware from %04ld-%02d-%02d %02d:%02d\n",
+                        tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday,
+                        tm.tm_hour, tm.tm_min);
+       }
+}
+
+static int rpi_firmware_probe(struct platform_device *pdev)
+{
+       struct device *dev = &pdev->dev;
+       struct rpi_firmware *fw;
+
+       fw = devm_kzalloc(dev, sizeof(*fw), GFP_KERNEL);
+       if (!fw)
+               return -ENOMEM;
+
+       fw->cl.dev = dev;
+       fw->cl.rx_callback = response_callback;
+       fw->cl.tx_block = true;
+
+       fw->chan = mbox_request_channel(&fw->cl, 0);
+       if (IS_ERR(fw->chan)) {
+               int ret = PTR_ERR(fw->chan);
+               if (ret != -EPROBE_DEFER)
+                       dev_err(dev, "Failed to get mbox channel: %d\n", ret);
+               return ret;
+       }
+
+       init_completion(&fw->c);
+
+       platform_set_drvdata(pdev, fw);
+
+       rpi_firmware_print_firmware_revision(fw);
+
+       return 0;
+}
+
+static int rpi_firmware_remove(struct platform_device *pdev)
+{
+       struct rpi_firmware *fw = platform_get_drvdata(pdev);
+
+       mbox_free_channel(fw->chan);
+
+       return 0;
+}
+
+/**
+ * rpi_firmware_get - Get pointer to rpi_firmware structure.
+ * @firmware_node:    Pointer to the firmware Device Tree node.
+ *
+ * Returns NULL is the firmware device is not ready.
+ */
+struct rpi_firmware *rpi_firmware_get(struct device_node *firmware_node)
+{
+       struct platform_device *pdev = of_find_device_by_node(firmware_node);
+
+       if (!pdev)
+               return NULL;
+
+       return platform_get_drvdata(pdev);
+}
+EXPORT_SYMBOL_GPL(rpi_firmware_get);
+
+static const struct of_device_id rpi_firmware_of_match[] = {
+       { .compatible = "raspberrypi,bcm2835-firmware", },
+       {},
+};
+MODULE_DEVICE_TABLE(of, rpi_firmware_of_match);
+
+static struct platform_driver rpi_firmware_driver = {
+       .driver = {
+               .name = "raspberrypi-firmware",
+               .of_match_table = rpi_firmware_of_match,
+       },
+       .probe          = rpi_firmware_probe,
+       .remove         = rpi_firmware_remove,
+};
+module_platform_driver(rpi_firmware_driver);
+
+MODULE_AUTHOR("Eric Anholt <eric@anholt.net>");
+MODULE_DESCRIPTION("Raspberry Pi firmware driver");
+MODULE_LICENSE("GPL v2");
index 86205a28e56b79ceeb247949343f7117a08c393c..05f6522c045719f9e63e520d9a80eca0f4e0a6d8 100644 (file)
@@ -315,6 +315,7 @@ int ast_framebuffer_init(struct drm_device *dev,
 int ast_fbdev_init(struct drm_device *dev);
 void ast_fbdev_fini(struct drm_device *dev);
 void ast_fbdev_set_suspend(struct drm_device *dev, int state);
+void ast_fbdev_set_base(struct ast_private *ast, unsigned long gpu_addr);
 
 struct ast_bo {
        struct ttm_buffer_object bo;
index f31db28a684b3e2cbfb042a9aebf11f0bd912105..a37e7ea4a00cc4cca2773a5da1622dec08472c67 100644 (file)
@@ -365,3 +365,10 @@ void ast_fbdev_set_suspend(struct drm_device *dev, int state)
 
        drm_fb_helper_set_suspend(&ast->fbdev->helper, state);
 }
+
+void ast_fbdev_set_base(struct ast_private *ast, unsigned long gpu_addr)
+{
+       ast->fbdev->helper.fbdev->fix.smem_start =
+               ast->fbdev->helper.fbdev->apertures->ranges[0].base + gpu_addr;
+       ast->fbdev->helper.fbdev->fix.smem_len = ast->vram_size - gpu_addr;
+}
index 838217f8ce7dd681de66fa976f8d8bc93b98ece7..541a610667add983ed234bb9e7807ed90ffb75ce 100644 (file)
@@ -448,6 +448,7 @@ int ast_driver_load(struct drm_device *dev, unsigned long flags)
        dev->mode_config.min_height = 0;
        dev->mode_config.preferred_depth = 24;
        dev->mode_config.prefer_shadow = 1;
+       dev->mode_config.fb_base = pci_resource_start(ast->dev->pdev, 0);
 
        if (ast->chip == AST2100 ||
            ast->chip == AST2200 ||
index b7ee2634e47cb420cb476c0f2a5906681b826601..69d19f3304a5ea67529393200979ae27ba796822 100644 (file)
@@ -547,6 +547,8 @@ static int ast_crtc_do_set_base(struct drm_crtc *crtc,
                ret = ttm_bo_kmap(&bo->bo, 0, bo->bo.num_pages, &bo->kmap);
                if (ret)
                        DRM_ERROR("failed to kmap fbcon\n");
+               else
+                       ast_fbdev_set_base(ast, gpu_addr);
        }
        ast_bo_unreserve(bo);
 
index fc419bb8eab74a749cd1ec370610e46e2ac36a9d..14107b5b7811c9d0180e4553adbac77ffd06a94a 100644 (file)
@@ -133,18 +133,24 @@ gk20a_instobj_size(struct nvkm_memory *memory)
 static void __iomem *
 gk20a_instobj_cpu_map_dma(struct nvkm_memory *memory)
 {
+#if defined(CONFIG_ARM) || defined(CONFIG_ARM64)
        struct gk20a_instobj_dma *node = gk20a_instobj_dma(memory);
        struct device *dev = node->base.imem->base.subdev.device->dev;
        int npages = nvkm_memory_size(memory) >> 12;
        struct page *pages[npages];
        int i;
 
+       /* we shouldn't see a gk20a on anything but arm/arm64 anyways */
        /* phys_to_page does not exist on all platforms... */
        pages[0] = pfn_to_page(dma_to_phys(dev, node->handle) >> PAGE_SHIFT);
        for (i = 1; i < npages; i++)
                pages[i] = pages[0] + i;
 
        return vmap(pages, npages, VM_MAP, pgprot_writecombine(PAGE_KERNEL));
+#else
+       BUG();
+       return NULL;
+#endif
 }
 
 static void __iomem *
index e502802d74b60432bd88fed1661d87b959ce5b0b..2d7d115ddf3fae6558ab42d80255917c5eabad1a 100644 (file)
@@ -1,9 +1,10 @@
 config DRM_VC4
        tristate "Broadcom VC4 Graphics"
        depends on ARCH_BCM2835 || COMPILE_TEST
-       depends on DRM
+       depends on DRM && HAVE_DMA_ATTRS
        select DRM_KMS_HELPER
        select DRM_KMS_CMA_HELPER
+       select DRM_GEM_CMA_HELPER
        help
          Choose this option if you have a system that has a Broadcom
          VC4 GPU, such as the Raspberry Pi or other BCM2708/BCM2835.
index 796569eeaf1d762c9d0283165b132c7a196d0e30..842b0043ad9477160194a7c7a94b03f7ab06d5a1 100644 (file)
@@ -321,6 +321,14 @@ config SENSORS_APPLESMC
          Say Y here if you have an applicable laptop and want to experience
          the awesome power of applesmc.
 
+config SENSORS_ARM_SCPI
+       tristate "ARM SCPI Sensors"
+       depends on ARM_SCPI_PROTOCOL
+       help
+         This driver provides support for temperature, voltage, current
+         and power sensors available on ARM Ltd's SCP based platforms. The
+         actual number and type of sensors exported depend on the platform.
+
 config SENSORS_ASB100
        tristate "Asus ASB100 Bach"
        depends on X86 && I2C
index 01855ee641d1d358dd01ed035ce6b20c0cbd080f..12a32398fdcc6c2e92a5645aebacddc4da0f52f2 100644 (file)
@@ -44,6 +44,7 @@ obj-$(CONFIG_SENSORS_ADT7462) += adt7462.o
 obj-$(CONFIG_SENSORS_ADT7470)  += adt7470.o
 obj-$(CONFIG_SENSORS_ADT7475)  += adt7475.o
 obj-$(CONFIG_SENSORS_APPLESMC) += applesmc.o
+obj-$(CONFIG_SENSORS_ARM_SCPI) += scpi-hwmon.o
 obj-$(CONFIG_SENSORS_ASC7621)  += asc7621.o
 obj-$(CONFIG_SENSORS_ATXP1)    += atxp1.o
 obj-$(CONFIG_SENSORS_CORETEMP) += coretemp.o
diff --git a/drivers/hwmon/scpi-hwmon.c b/drivers/hwmon/scpi-hwmon.c
new file mode 100644 (file)
index 0000000..2c1241b
--- /dev/null
@@ -0,0 +1,288 @@
+/*
+ * System Control and Power Interface(SCPI) based hwmon sensor driver
+ *
+ * Copyright (C) 2015 ARM Ltd.
+ * Punit Agrawal <punit.agrawal@arm.com>
+ *
+ * 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.
+ *
+ * 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/hwmon.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/scpi_protocol.h>
+#include <linux/slab.h>
+#include <linux/sysfs.h>
+#include <linux/thermal.h>
+
+struct sensor_data {
+       struct scpi_sensor_info info;
+       struct device_attribute dev_attr_input;
+       struct device_attribute dev_attr_label;
+       char input[20];
+       char label[20];
+};
+
+struct scpi_thermal_zone {
+       struct list_head list;
+       int sensor_id;
+       struct scpi_sensors *scpi_sensors;
+       struct thermal_zone_device *tzd;
+};
+
+struct scpi_sensors {
+       struct scpi_ops *scpi_ops;
+       struct sensor_data *data;
+       struct list_head thermal_zones;
+       struct attribute **attrs;
+       struct attribute_group group;
+       const struct attribute_group *groups[2];
+};
+
+static int scpi_read_temp(void *dev, int *temp)
+{
+       struct scpi_thermal_zone *zone = dev;
+       struct scpi_sensors *scpi_sensors = zone->scpi_sensors;
+       struct scpi_ops *scpi_ops = scpi_sensors->scpi_ops;
+       struct sensor_data *sensor = &scpi_sensors->data[zone->sensor_id];
+       u32 value;
+       int ret;
+
+       ret = scpi_ops->sensor_get_value(sensor->info.sensor_id, &value);
+       if (ret)
+               return ret;
+
+       *temp = value;
+       return 0;
+}
+
+/* hwmon callback functions */
+static ssize_t
+scpi_show_sensor(struct device *dev, struct device_attribute *attr, char *buf)
+{
+       struct scpi_sensors *scpi_sensors = dev_get_drvdata(dev);
+       struct scpi_ops *scpi_ops = scpi_sensors->scpi_ops;
+       struct sensor_data *sensor;
+       u32 value;
+       int ret;
+
+       sensor = container_of(attr, struct sensor_data, dev_attr_input);
+
+       ret = scpi_ops->sensor_get_value(sensor->info.sensor_id, &value);
+       if (ret)
+               return ret;
+
+       return sprintf(buf, "%u\n", value);
+}
+
+static ssize_t
+scpi_show_label(struct device *dev, struct device_attribute *attr, char *buf)
+{
+       struct sensor_data *sensor;
+
+       sensor = container_of(attr, struct sensor_data, dev_attr_label);
+
+       return sprintf(buf, "%s\n", sensor->info.name);
+}
+
+static void
+unregister_thermal_zones(struct platform_device *pdev,
+                        struct scpi_sensors *scpi_sensors)
+{
+       struct list_head *pos;
+
+       list_for_each(pos, &scpi_sensors->thermal_zones) {
+               struct scpi_thermal_zone *zone;
+
+               zone = list_entry(pos, struct scpi_thermal_zone, list);
+               thermal_zone_of_sensor_unregister(&pdev->dev, zone->tzd);
+       }
+}
+
+static struct thermal_zone_of_device_ops scpi_sensor_ops = {
+       .get_temp = scpi_read_temp,
+};
+
+static int scpi_hwmon_probe(struct platform_device *pdev)
+{
+       u16 nr_sensors, i;
+       int num_temp = 0, num_volt = 0, num_current = 0, num_power = 0;
+       struct scpi_ops *scpi_ops;
+       struct device *hwdev, *dev = &pdev->dev;
+       struct scpi_sensors *scpi_sensors;
+       int ret;
+
+       scpi_ops = get_scpi_ops();
+       if (!scpi_ops)
+               return -EPROBE_DEFER;
+
+       ret = scpi_ops->sensor_get_capability(&nr_sensors);
+       if (ret)
+               return ret;
+
+       if (!nr_sensors)
+               return -ENODEV;
+
+       scpi_sensors = devm_kzalloc(dev, sizeof(*scpi_sensors), GFP_KERNEL);
+       if (!scpi_sensors)
+               return -ENOMEM;
+
+       scpi_sensors->data = devm_kcalloc(dev, nr_sensors,
+                                  sizeof(*scpi_sensors->data), GFP_KERNEL);
+       if (!scpi_sensors->data)
+               return -ENOMEM;
+
+       scpi_sensors->attrs = devm_kcalloc(dev, (nr_sensors * 2) + 1,
+                                  sizeof(*scpi_sensors->attrs), GFP_KERNEL);
+       if (!scpi_sensors->attrs)
+               return -ENOMEM;
+
+       scpi_sensors->scpi_ops = scpi_ops;
+
+       for (i = 0; i < nr_sensors; i++) {
+               struct sensor_data *sensor = &scpi_sensors->data[i];
+
+               ret = scpi_ops->sensor_get_info(i, &sensor->info);
+               if (ret)
+                       return ret;
+
+               switch (sensor->info.class) {
+               case TEMPERATURE:
+                       snprintf(sensor->input, sizeof(sensor->input),
+                                "temp%d_input", num_temp + 1);
+                       snprintf(sensor->label, sizeof(sensor->input),
+                                "temp%d_label", num_temp + 1);
+                       num_temp++;
+                       break;
+               case VOLTAGE:
+                       snprintf(sensor->input, sizeof(sensor->input),
+                                "in%d_input", num_volt);
+                       snprintf(sensor->label, sizeof(sensor->input),
+                                "in%d_label", num_volt);
+                       num_volt++;
+                       break;
+               case CURRENT:
+                       snprintf(sensor->input, sizeof(sensor->input),
+                                "curr%d_input", num_current + 1);
+                       snprintf(sensor->label, sizeof(sensor->input),
+                                "curr%d_label", num_current + 1);
+                       num_current++;
+                       break;
+               case POWER:
+                       snprintf(sensor->input, sizeof(sensor->input),
+                                "power%d_input", num_power + 1);
+                       snprintf(sensor->label, sizeof(sensor->input),
+                                "power%d_label", num_power + 1);
+                       num_power++;
+                       break;
+               default:
+                       break;
+               }
+
+               sensor->dev_attr_input.attr.mode = S_IRUGO;
+               sensor->dev_attr_input.show = scpi_show_sensor;
+               sensor->dev_attr_input.attr.name = sensor->input;
+
+               sensor->dev_attr_label.attr.mode = S_IRUGO;
+               sensor->dev_attr_label.show = scpi_show_label;
+               sensor->dev_attr_label.attr.name = sensor->label;
+
+               scpi_sensors->attrs[i << 1] = &sensor->dev_attr_input.attr;
+               scpi_sensors->attrs[(i << 1) + 1] = &sensor->dev_attr_label.attr;
+
+               sysfs_attr_init(scpi_sensors->attrs[i << 1]);
+               sysfs_attr_init(scpi_sensors->attrs[(i << 1) + 1]);
+       }
+
+       scpi_sensors->group.attrs = scpi_sensors->attrs;
+       scpi_sensors->groups[0] = &scpi_sensors->group;
+
+       platform_set_drvdata(pdev, scpi_sensors);
+
+       hwdev = devm_hwmon_device_register_with_groups(dev,
+                       "scpi_sensors", scpi_sensors, scpi_sensors->groups);
+
+       if (IS_ERR(hwdev))
+               return PTR_ERR(hwdev);
+
+       /*
+        * Register the temperature sensors with the thermal framework
+        * to allow their usage in setting up the thermal zones from
+        * device tree.
+        *
+        * NOTE: Not all temperature sensors maybe used for thermal
+        * control
+        */
+       INIT_LIST_HEAD(&scpi_sensors->thermal_zones);
+       for (i = 0; i < nr_sensors; i++) {
+               struct sensor_data *sensor = &scpi_sensors->data[i];
+               struct scpi_thermal_zone *zone;
+
+               if (sensor->info.class != TEMPERATURE)
+                       continue;
+
+               zone = devm_kzalloc(dev, sizeof(*zone), GFP_KERNEL);
+               if (!zone) {
+                       ret = -ENOMEM;
+                       goto unregister_tzd;
+               }
+
+               zone->sensor_id = i;
+               zone->scpi_sensors = scpi_sensors;
+               zone->tzd = thermal_zone_of_sensor_register(dev, i, zone,
+                                                           &scpi_sensor_ops);
+               /*
+                * The call to thermal_zone_of_sensor_register returns
+                * an error for sensors that are not associated with
+                * any thermal zones or if the thermal subsystem is
+                * not configured.
+                */
+               if (IS_ERR(zone->tzd)) {
+                       devm_kfree(dev, zone);
+                       continue;
+               }
+               list_add(&zone->list, &scpi_sensors->thermal_zones);
+       }
+
+       return 0;
+
+unregister_tzd:
+       unregister_thermal_zones(pdev, scpi_sensors);
+       return ret;
+}
+
+static int scpi_hwmon_remove(struct platform_device *pdev)
+{
+       struct scpi_sensors *scpi_sensors = platform_get_drvdata(pdev);
+
+       unregister_thermal_zones(pdev, scpi_sensors);
+
+       return 0;
+}
+
+static const struct of_device_id scpi_of_match[] = {
+       {.compatible = "arm,scpi-sensors"},
+       {},
+};
+
+static struct platform_driver scpi_hwmon_platdrv = {
+       .driver = {
+               .name   = "scpi-hwmon",
+               .owner  = THIS_MODULE,
+               .of_match_table = scpi_of_match,
+       },
+       .probe          = scpi_hwmon_probe,
+       .remove         = scpi_hwmon_remove,
+};
+module_platform_driver(scpi_hwmon_platdrv);
+
+MODULE_AUTHOR("Punit Agrawal <punit.agrawal@arm.com>");
+MODULE_DESCRIPTION("ARM SCPI HWMON interface driver");
+MODULE_LICENSE("GPL v2");
index 08b86178e8fba99679b5e61977338779204643b0..e24c2b680b475880dd56d0bfb6f2691c00d26801 100644 (file)
@@ -124,6 +124,8 @@ config I2C_I801
            BayTrail (SOC)
            Sunrise Point-H (PCH)
            Sunrise Point-LP (PCH)
+           DNV (SOC)
+           Broxton (SOC)
 
          This driver can also be built as a module.  If so, the module
          will be called i2c-i801.
@@ -422,7 +424,7 @@ config I2C_BLACKFIN_TWI_CLK_KHZ
 
 config I2C_CADENCE
        tristate "Cadence I2C Controller"
-       depends on ARCH_ZYNQ
+       depends on ARCH_ZYNQ || ARM64
        help
          Say yes here to select Cadence I2C Host Controller. This controller is
          e.g. used by Xilinx Zynq.
@@ -582,10 +584,10 @@ config I2C_IMG
 
 config I2C_IMX
        tristate "IMX I2C interface"
-       depends on ARCH_MXC
+       depends on ARCH_MXC || ARCH_LAYERSCAPE
        help
          Say Y here if you want to use the IIC bus controller on
-         the Freescale i.MX/MXC processors.
+         the Freescale i.MX/MXC or Layerscape processors.
 
          This driver can also be built as a module.  If so, the module
          will be called i2c-imx.
@@ -902,6 +904,22 @@ config I2C_TEGRA
          If you say yes to this option, support will be included for the
          I2C controller embedded in NVIDIA Tegra SOCs
 
+config I2C_UNIPHIER
+       tristate "UniPhier FIFO-less I2C controller"
+       depends on ARCH_UNIPHIER
+       help
+         If you say yes to this option, support will be included for
+         the UniPhier FIFO-less I2C interface embedded in PH1-LD4, PH1-sLD8,
+         or older UniPhier SoCs.
+
+config I2C_UNIPHIER_F
+       tristate "UniPhier FIFO-builtin I2C controller"
+       depends on ARCH_UNIPHIER
+       help
+         If you say yes to this option, support will be included for
+         the UniPhier FIFO-builtin I2C interface embedded in PH1-Pro4,
+         PH1-Pro5, or newer UniPhier SoCs.
+
 config I2C_VERSATILE
        tristate "ARM Versatile/Realview I2C bus support"
        depends on ARCH_VERSATILE || ARCH_REALVIEW || ARCH_VEXPRESS
index 6df3b303bd092bb3bf093dade0bc8e7c32ec51ca..37f2819b4560b0e0947b74c214f5c5a0952bc0ae 100644 (file)
@@ -87,6 +87,8 @@ obj-$(CONFIG_I2C_ST)          += i2c-st.o
 obj-$(CONFIG_I2C_STU300)       += i2c-stu300.o
 obj-$(CONFIG_I2C_SUN6I_P2WI)   += i2c-sun6i-p2wi.o
 obj-$(CONFIG_I2C_TEGRA)                += i2c-tegra.o
+obj-$(CONFIG_I2C_UNIPHIER)     += i2c-uniphier.o
+obj-$(CONFIG_I2C_UNIPHIER_F)   += i2c-uniphier-f.o
 obj-$(CONFIG_I2C_VERSATILE)    += i2c-versatile.o
 obj-$(CONFIG_I2C_WMT)          += i2c-wmt.o
 obj-$(CONFIG_I2C_OCTEON)       += i2c-octeon.o
index 1c758cd1e1ba82d4acb56f1684270e5af5437c2e..10835d1f559ba99f9b0118b19f55b7187a980dea 100644 (file)
@@ -347,8 +347,14 @@ error:
 
 static void at91_twi_read_next_byte(struct at91_twi_dev *dev)
 {
-       if (!dev->buf_len)
+       /*
+        * If we are in this case, it means there is garbage data in RHR, so
+        * delete them.
+        */
+       if (!dev->buf_len) {
+               at91_twi_read(dev, AT91_TWI_RHR);
                return;
+       }
 
        /* 8bit read works with and without FIFO */
        *dev->buf = readb_relaxed(dev->base + AT91_TWI_RHR);
@@ -465,19 +471,73 @@ static irqreturn_t atmel_twi_interrupt(int irq, void *dev_id)
 
        if (!irqstatus)
                return IRQ_NONE;
-       else if (irqstatus & AT91_TWI_RXRDY)
+       /*
+        * In reception, the behavior of the twi device (before sama5d2) is
+        * weird. There is some magic about RXRDY flag! When a data has been
+        * almost received, the reception of a new one is anticipated if there
+        * is no stop command to send. That is the reason why ask for sending
+        * the stop command not on the last data but on the second last one.
+        *
+        * Unfortunately, we could still have the RXRDY flag set even if the
+        * transfer is done and we have read the last data. It might happen
+        * when the i2c slave device sends too quickly data after receiving the
+        * ack from the master. The data has been almost received before having
+        * the order to send stop. In this case, sending the stop command could
+        * cause a RXRDY interrupt with a TXCOMP one. It is better to manage
+        * the RXRDY interrupt first in order to not keep garbage data in the
+        * Receive Holding Register for the next transfer.
+        */
+       if (irqstatus & AT91_TWI_RXRDY)
                at91_twi_read_next_byte(dev);
-       else if (irqstatus & AT91_TWI_TXRDY)
-               at91_twi_write_next_byte(dev);
-
-       /* catch error flags */
-       dev->transfer_status |= status;
 
+       /*
+        * When a NACK condition is detected, the I2C controller sets the NACK,
+        * TXCOMP and TXRDY bits all together in the Status Register (SR).
+        *
+        * 1 - Handling NACK errors with CPU write transfer.
+        *
+        * In such case, we should not write the next byte into the Transmit
+        * Holding Register (THR) otherwise the I2C controller would start a new
+        * transfer and the I2C slave is likely to reply by another NACK.
+        *
+        * 2 - Handling NACK errors with DMA write transfer.
+        *
+        * By setting the TXRDY bit in the SR, the I2C controller also triggers
+        * the DMA controller to write the next data into the THR. Then the
+        * result depends on the hardware version of the I2C controller.
+        *
+        * 2a - Without support of the Alternative Command mode.
+        *
+        * This is the worst case: the DMA controller is triggered to write the
+        * next data into the THR, hence starting a new transfer: the I2C slave
+        * is likely to reply by another NACK.
+        * Concurrently, this interrupt handler is likely to be called to manage
+        * the first NACK before the I2C controller detects the second NACK and
+        * sets once again the NACK bit into the SR.
+        * When handling the first NACK, this interrupt handler disables the I2C
+        * controller interruptions, especially the NACK interrupt.
+        * Hence, the NACK bit is pending into the SR. This is why we should
+        * read the SR to clear all pending interrupts at the beginning of
+        * at91_do_twi_transfer() before actually starting a new transfer.
+        *
+        * 2b - With support of the Alternative Command mode.
+        *
+        * When a NACK condition is detected, the I2C controller also locks the
+        * THR (and sets the LOCK bit in the SR): even though the DMA controller
+        * is triggered by the TXRDY bit to write the next data into the THR,
+        * this data actually won't go on the I2C bus hence a second NACK is not
+        * generated.
+        */
        if (irqstatus & (AT91_TWI_TXCOMP | AT91_TWI_NACK)) {
                at91_disable_twi_interrupts(dev);
                complete(&dev->cmd_complete);
+       } else if (irqstatus & AT91_TWI_TXRDY) {
+               at91_twi_write_next_byte(dev);
        }
 
+       /* catch error flags */
+       dev->transfer_status |= status;
+
        return IRQ_HANDLED;
 }
 
@@ -537,6 +597,9 @@ static int at91_do_twi_transfer(struct at91_twi_dev *dev)
        reinit_completion(&dev->cmd_complete);
        dev->transfer_status = 0;
 
+       /* Clear pending interrupts, such as NACK. */
+       at91_twi_read(dev, AT91_TWI_SR);
+
        if (dev->fifo_size) {
                unsigned fifo_mr = at91_twi_read(dev, AT91_TWI_FMR);
 
@@ -558,11 +621,6 @@ static int at91_do_twi_transfer(struct at91_twi_dev *dev)
        } else if (dev->msg->flags & I2C_M_RD) {
                unsigned start_flags = AT91_TWI_START;
 
-               if (at91_twi_read(dev, AT91_TWI_SR) & AT91_TWI_RXRDY) {
-                       dev_err(dev->dev, "RXRDY still set!");
-                       at91_twi_read(dev, AT91_TWI_RHR);
-               }
-
                /* if only one byte is to be read, immediately stop transfer */
                if (!has_alt_cmd && dev->buf_len <= 1 &&
                    !(dev->msg->flags & I2C_M_RECV_LEN))
index a6aae84e570656d9ef9b54bed57142c438d59211..5bcb1f0bb334e2a9ce6761348427779ff9567d0b 100644 (file)
@@ -48,7 +48,6 @@ struct i2c_au1550_data {
        void __iomem *psc_base;
        int     xfer_timeout;
        struct i2c_adapter adap;
-       struct resource *ioarea;
 };
 
 static inline void WR(struct i2c_au1550_data *a, int r, unsigned long v)
@@ -284,10 +283,10 @@ static void i2c_au1550_setup(struct i2c_au1550_data *priv)
        /* Set the protocol timer values.  See Table 71 in the
         * Au1550 Data Book for standard timing values.
         */
-       WR(priv, PSC_SMBTMR, PSC_SMBTMR_SET_TH(0) | PSC_SMBTMR_SET_PS(15) | \
-               PSC_SMBTMR_SET_PU(15) | PSC_SMBTMR_SET_SH(15) | \
-               PSC_SMBTMR_SET_SU(15) | PSC_SMBTMR_SET_CL(15) | \
-               PSC_SMBTMR_SET_CH(15));
+       WR(priv, PSC_SMBTMR, PSC_SMBTMR_SET_TH(0) | PSC_SMBTMR_SET_PS(20) | \
+               PSC_SMBTMR_SET_PU(20) | PSC_SMBTMR_SET_SH(20) | \
+               PSC_SMBTMR_SET_SU(20) | PSC_SMBTMR_SET_CL(20) | \
+               PSC_SMBTMR_SET_CH(20));
 
        cfg |= PSC_SMBCFG_DE_ENABLE;
        WR(priv, PSC_SMBCFG, cfg);
@@ -315,30 +314,16 @@ i2c_au1550_probe(struct platform_device *pdev)
        struct resource *r;
        int ret;
 
-       r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       if (!r) {
-               ret = -ENODEV;
-               goto out;
-       }
+       priv = devm_kzalloc(&pdev->dev, sizeof(struct i2c_au1550_data),
+                           GFP_KERNEL);
+       if (!priv)
+               return -ENOMEM;
 
-       priv = kzalloc(sizeof(struct i2c_au1550_data), GFP_KERNEL);
-       if (!priv) {
-               ret = -ENOMEM;
-               goto out;
-       }
-
-       priv->ioarea = request_mem_region(r->start, resource_size(r),
-                                         pdev->name);
-       if (!priv->ioarea) {
-               ret = -EBUSY;
-               goto out_mem;
-       }
+       r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+       priv->psc_base = devm_ioremap_resource(&pdev->dev, r);
+       if (IS_ERR(priv->psc_base))
+               return PTR_ERR(priv->psc_base);
 
-       priv->psc_base = ioremap(r->start, resource_size(r));
-       if (!priv->psc_base) {
-               ret = -EIO;
-               goto out_map;
-       }
        priv->xfer_timeout = 200;
 
        priv->adap.nr = pdev->id;
@@ -351,20 +336,13 @@ i2c_au1550_probe(struct platform_device *pdev)
        i2c_au1550_setup(priv);
 
        ret = i2c_add_numbered_adapter(&priv->adap);
-       if (ret == 0) {
-               platform_set_drvdata(pdev, priv);
-               return 0;
+       if (ret) {
+               i2c_au1550_disable(priv);
+               return ret;
        }
 
-       i2c_au1550_disable(priv);
-       iounmap(priv->psc_base);
-out_map:
-       release_resource(priv->ioarea);
-       kfree(priv->ioarea);
-out_mem:
-       kfree(priv);
-out:
-       return ret;
+       platform_set_drvdata(pdev, priv);
+       return 0;
 }
 
 static int i2c_au1550_remove(struct platform_device *pdev)
@@ -373,10 +351,6 @@ static int i2c_au1550_remove(struct platform_device *pdev)
 
        i2c_del_adapter(&priv->adap);
        i2c_au1550_disable(priv);
-       iounmap(priv->psc_base);
-       release_resource(priv->ioarea);
-       kfree(priv->ioarea);
-       kfree(priv);
        return 0;
 }
 
index 3fbb9a035532b7705076e77229c737850d389bec..c5628a42170acf83d0a2c5d2dffa6a50e6572c59 100644 (file)
@@ -181,6 +181,7 @@ static void i2c_davinci_calc_clk_dividers(struct davinci_i2c_dev *dev)
        u32 clkh;
        u32 clkl;
        u32 input_clock = clk_get_rate(dev->clk);
+       struct device_node *of_node = dev->dev->of_node;
 
        /* NOTE: I2C Clock divider programming info
         * As per I2C specs the following formulas provide prescaler
@@ -196,6 +197,9 @@ static void i2c_davinci_calc_clk_dividers(struct davinci_i2c_dev *dev)
         * where if PSC == 0, d = 7,
         *       if PSC == 1, d = 6
         *       if PSC > 1 , d = 5
+        *
+        * Note:
+        * d is always 6 on Keystone I2C controller
         */
 
        /* get minimum of 7 MHz clock, but max of 12 MHz */
@@ -204,6 +208,9 @@ static void i2c_davinci_calc_clk_dividers(struct davinci_i2c_dev *dev)
                psc++;  /* better to run under spec than over */
        d = (psc >= 2) ? 5 : 7 - psc;
 
+       if (of_node && of_device_is_compatible(of_node, "ti,keystone-i2c"))
+               d = 6;
+
        clk = ((input_clock / (psc + 1)) / (pdata->bus_freq * 1000));
        /* Avoid driving the bus too fast because of rounding errors above */
        if (input_clock / (psc + 1) / clk > pdata->bus_freq * 1000)
@@ -726,6 +733,7 @@ static struct i2c_algorithm i2c_davinci_algo = {
 
 static const struct of_device_id davinci_i2c_of_match[] = {
        {.compatible = "ti,davinci-i2c", },
+       {.compatible = "ti,keystone-i2c", },
        {},
 };
 MODULE_DEVICE_TABLE(of, davinci_i2c_of_match);
index 7441cdc1b34a6a67f85fd3bfd71db40b5076734c..8c48b27ba05975e51a40ddaab979e7b23302e3e0 100644 (file)
@@ -165,7 +165,7 @@ static char *abort_sources[] = {
                "lost arbitration",
 };
 
-u32 dw_readl(struct dw_i2c_dev *dev, int offset)
+static u32 dw_readl(struct dw_i2c_dev *dev, int offset)
 {
        u32 value;
 
@@ -181,7 +181,7 @@ u32 dw_readl(struct dw_i2c_dev *dev, int offset)
                return value;
 }
 
-void dw_writel(struct dw_i2c_dev *dev, u32 b, int offset)
+static void dw_writel(struct dw_i2c_dev *dev, u32 b, int offset)
 {
        if (dev->accessor_flags & ACCESS_SWAP)
                b = swab32(b);
@@ -438,7 +438,7 @@ static void i2c_dw_xfer_init(struct dw_i2c_dev *dev)
        __i2c_dw_enable(dev, true);
 
        /* Clear and enable interrupts */
-       i2c_dw_clear_int(dev);
+       dw_readl(dev, DW_IC_CLR_INTR);
        dw_writel(dev, DW_IC_INTR_DEFAULT_MASK, DW_IC_INTR_MASK);
 }
 
@@ -618,7 +618,7 @@ static int i2c_dw_handle_tx_abort(struct dw_i2c_dev *dev)
 /*
  * Prepare controller for a transaction and call i2c_dw_xfer_msg
  */
-int
+static int
 i2c_dw_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num)
 {
        struct dw_i2c_dev *dev = i2c_get_adapdata(adap);
@@ -702,14 +702,17 @@ done_nolock:
 
        return ret;
 }
-EXPORT_SYMBOL_GPL(i2c_dw_xfer);
 
-u32 i2c_dw_func(struct i2c_adapter *adap)
+static u32 i2c_dw_func(struct i2c_adapter *adap)
 {
        struct dw_i2c_dev *dev = i2c_get_adapdata(adap);
        return dev->functionality;
 }
-EXPORT_SYMBOL_GPL(i2c_dw_func);
+
+static struct i2c_algorithm i2c_dw_algo = {
+       .master_xfer    = i2c_dw_xfer,
+       .functionality  = i2c_dw_func,
+};
 
 static u32 i2c_dw_read_clear_intrbits(struct dw_i2c_dev *dev)
 {
@@ -770,7 +773,7 @@ static u32 i2c_dw_read_clear_intrbits(struct dw_i2c_dev *dev)
  * Interrupt service routine. This gets called whenever an I2C interrupt
  * occurs.
  */
-irqreturn_t i2c_dw_isr(int this_irq, void *dev_id)
+static irqreturn_t i2c_dw_isr(int this_irq, void *dev_id)
 {
        struct dw_i2c_dev *dev = dev_id;
        u32 stat, enabled;
@@ -813,20 +816,6 @@ tx_aborted:
 
        return IRQ_HANDLED;
 }
-EXPORT_SYMBOL_GPL(i2c_dw_isr);
-
-void i2c_dw_enable(struct dw_i2c_dev *dev)
-{
-       /* Enable the adapter */
-       __i2c_dw_enable(dev, true);
-}
-EXPORT_SYMBOL_GPL(i2c_dw_enable);
-
-u32 i2c_dw_is_enabled(struct dw_i2c_dev *dev)
-{
-       return dw_readl(dev, DW_IC_ENABLE);
-}
-EXPORT_SYMBOL_GPL(i2c_dw_is_enabled);
 
 void i2c_dw_disable(struct dw_i2c_dev *dev)
 {
@@ -839,12 +828,6 @@ void i2c_dw_disable(struct dw_i2c_dev *dev)
 }
 EXPORT_SYMBOL_GPL(i2c_dw_disable);
 
-void i2c_dw_clear_int(struct dw_i2c_dev *dev)
-{
-       dw_readl(dev, DW_IC_CLR_INTR);
-}
-EXPORT_SYMBOL_GPL(i2c_dw_clear_int);
-
 void i2c_dw_disable_int(struct dw_i2c_dev *dev)
 {
        dw_writel(dev, 0, DW_IC_INTR_MASK);
@@ -857,5 +840,40 @@ u32 i2c_dw_read_comp_param(struct dw_i2c_dev *dev)
 }
 EXPORT_SYMBOL_GPL(i2c_dw_read_comp_param);
 
+int i2c_dw_probe(struct dw_i2c_dev *dev)
+{
+       struct i2c_adapter *adap = &dev->adapter;
+       int r;
+
+       init_completion(&dev->cmd_complete);
+       mutex_init(&dev->lock);
+
+       r = i2c_dw_init(dev);
+       if (r)
+               return r;
+
+       snprintf(adap->name, sizeof(adap->name),
+                "Synopsys DesignWare I2C adapter");
+       adap->algo = &i2c_dw_algo;
+       adap->dev.parent = dev->dev;
+       i2c_set_adapdata(adap, dev);
+
+       i2c_dw_disable_int(dev);
+       r = devm_request_irq(dev->dev, dev->irq, i2c_dw_isr, IRQF_SHARED,
+                            dev_name(dev->dev), dev);
+       if (r) {
+               dev_err(dev->dev, "failure requesting irq %i: %d\n",
+                       dev->irq, r);
+               return r;
+       }
+
+       r = i2c_add_numbered_adapter(adap);
+       if (r)
+               dev_err(dev->dev, "failure adding adapter: %d\n", r);
+
+       return r;
+}
+EXPORT_SYMBOL_GPL(i2c_dw_probe);
+
 MODULE_DESCRIPTION("Synopsys DesignWare I2C bus adapter core");
 MODULE_LICENSE("GPL");
index 9630222abf32197f48d580e43a14b049821f570f..1d50898e7b2403868c239f2ebc236a240a755bc7 100644 (file)
@@ -112,19 +112,11 @@ struct dw_i2c_dev {
 #define ACCESS_SWAP            0x00000001
 #define ACCESS_16BIT           0x00000002
 
-extern u32 dw_readl(struct dw_i2c_dev *dev, int offset);
-extern void dw_writel(struct dw_i2c_dev *dev, u32 b, int offset);
 extern int i2c_dw_init(struct dw_i2c_dev *dev);
-extern int i2c_dw_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[],
-               int num);
-extern u32 i2c_dw_func(struct i2c_adapter *adap);
-extern irqreturn_t i2c_dw_isr(int this_irq, void *dev_id);
-extern void i2c_dw_enable(struct dw_i2c_dev *dev);
-extern u32 i2c_dw_is_enabled(struct dw_i2c_dev *dev);
 extern void i2c_dw_disable(struct dw_i2c_dev *dev);
-extern void i2c_dw_clear_int(struct dw_i2c_dev *dev);
 extern void i2c_dw_disable_int(struct dw_i2c_dev *dev);
 extern u32 i2c_dw_read_comp_param(struct dw_i2c_dev *dev);
+extern int i2c_dw_probe(struct dw_i2c_dev *dev);
 
 #if IS_ENABLED(CONFIG_I2C_DESIGNWARE_BAYTRAIL)
 extern int i2c_dw_eval_lock_support(struct dw_i2c_dev *dev);
index df23e8c30e6f8a37556de068cd816493d5574184..1543d35d228dfaf9c02f9b19a3a59c82503d0870 100644 (file)
@@ -35,6 +35,7 @@
 #include <linux/slab.h>
 #include <linux/pci.h>
 #include <linux/pm_runtime.h>
+#include <linux/acpi.h>
 #include "i2c-designware-core.h"
 
 #define DRIVER_NAME "i2c-designware-pci"
@@ -158,11 +159,6 @@ static struct dw_pci_controller dw_pci_controllers[] = {
        },
 };
 
-static struct i2c_algorithm i2c_dw_algo = {
-       .master_xfer    = i2c_dw_xfer,
-       .functionality  = i2c_dw_func,
-};
-
 #ifdef CONFIG_PM
 static int i2c_dw_pci_suspend(struct device *dev)
 {
@@ -222,13 +218,12 @@ static int i2c_dw_pci_probe(struct pci_dev *pdev,
        if (!dev)
                return -ENOMEM;
 
-       init_completion(&dev->cmd_complete);
-       mutex_init(&dev->lock);
        dev->clk = NULL;
        dev->controller = controller;
        dev->get_clk_rate_khz = i2c_dw_get_clk_rate_khz;
        dev->base = pcim_iomap_table(pdev)[0];
        dev->dev = &pdev->dev;
+       dev->irq = pdev->irq;
        dev->functionality = controller->functionality |
                                DW_DEFAULT_FUNCTIONALITY;
 
@@ -246,34 +241,16 @@ static int i2c_dw_pci_probe(struct pci_dev *pdev,
 
        dev->tx_fifo_depth = controller->tx_fifo_depth;
        dev->rx_fifo_depth = controller->rx_fifo_depth;
-       r = i2c_dw_init(dev);
-       if (r)
-               return r;
 
        adap = &dev->adapter;
-       i2c_set_adapdata(adap, dev);
        adap->owner = THIS_MODULE;
        adap->class = 0;
-       adap->algo = &i2c_dw_algo;
-       adap->dev.parent = &pdev->dev;
+       ACPI_COMPANION_SET(&adap->dev, ACPI_COMPANION(&pdev->dev));
        adap->nr = controller->bus_num;
 
-       snprintf(adap->name, sizeof(adap->name), "i2c-designware-pci");
-
-       r = devm_request_irq(&pdev->dev, pdev->irq, i2c_dw_isr,
-                       IRQF_SHARED | IRQF_COND_SUSPEND, adap->name, dev);
-       if (r) {
-               dev_err(&pdev->dev, "failure requesting irq %i\n", dev->irq);
-               return r;
-       }
-
-       i2c_dw_disable_int(dev);
-       i2c_dw_clear_int(dev);
-       r = i2c_add_numbered_adapter(adap);
-       if (r) {
-               dev_err(&pdev->dev, "failure adding adapter\n");
+       r = i2c_dw_probe(dev);
+       if (r)
                return r;
-       }
 
        pm_runtime_set_autosuspend_delay(&pdev->dev, 1000);
        pm_runtime_use_autosuspend(&pdev->dev);
index 472b88285c755e5f18d25ba2c935dbdaca449546..809579ecb5a44fed6745af1274ed46864763651c 100644 (file)
 #include <linux/platform_data/i2c-designware.h>
 #include "i2c-designware-core.h"
 
-static struct i2c_algorithm i2c_dw_algo = {
-       .master_xfer    = i2c_dw_xfer,
-       .functionality  = i2c_dw_func,
-};
 static u32 i2c_dw_get_clk_rate_khz(struct dw_i2c_dev *dev)
 {
        return clk_get_rate(dev->clk)/1000;
@@ -97,7 +93,6 @@ static void dw_i2c_acpi_params(struct platform_device *pdev, char method[],
 static int dw_i2c_acpi_configure(struct platform_device *pdev)
 {
        struct dw_i2c_dev *dev = platform_get_drvdata(pdev);
-       const struct acpi_device_id *id;
 
        dev->adapter.nr = -1;
        dev->tx_fifo_depth = 32;
@@ -111,29 +106,9 @@ static int dw_i2c_acpi_configure(struct platform_device *pdev)
        dw_i2c_acpi_params(pdev, "FMCN", &dev->fs_hcnt, &dev->fs_lcnt,
                           &dev->sda_hold_time);
 
-       /*
-        * Provide a way for Designware I2C host controllers that are not
-        * based on Intel LPSS to specify their input clock frequency via
-        * id->driver_data.
-        */
-       id = acpi_match_device(pdev->dev.driver->acpi_match_table, &pdev->dev);
-       if (id && id->driver_data)
-               clk_register_fixed_rate(&pdev->dev, dev_name(&pdev->dev), NULL,
-                                       CLK_IS_ROOT, id->driver_data);
-
        return 0;
 }
 
-static void dw_i2c_acpi_unconfigure(struct platform_device *pdev)
-{
-       struct dw_i2c_dev *dev = platform_get_drvdata(pdev);
-       const struct acpi_device_id *id;
-
-       id = acpi_match_device(pdev->dev.driver->acpi_match_table, &pdev->dev);
-       if (id && id->driver_data)
-               clk_unregister(dev->clk);
-}
-
 static const struct acpi_device_id dw_i2c_acpi_match[] = {
        { "INT33C2", 0 },
        { "INT33C3", 0 },
@@ -141,7 +116,7 @@ static const struct acpi_device_id dw_i2c_acpi_match[] = {
        { "INT3433", 0 },
        { "80860F41", 0 },
        { "808622C1", 0 },
-       { "AMD0010", 133 * 1000 * 1000 },
+       { "AMD0010", 0 },
        { }
 };
 MODULE_DEVICE_TABLE(acpi, dw_i2c_acpi_match);
@@ -150,10 +125,9 @@ static inline int dw_i2c_acpi_configure(struct platform_device *pdev)
 {
        return -ENODEV;
 }
-static inline void dw_i2c_acpi_unconfigure(struct platform_device *pdev) { }
 #endif
 
-static int dw_i2c_probe(struct platform_device *pdev)
+static int dw_i2c_plat_probe(struct platform_device *pdev)
 {
        struct dw_i2c_dev *dev;
        struct i2c_adapter *adap;
@@ -175,8 +149,6 @@ static int dw_i2c_probe(struct platform_device *pdev)
        if (IS_ERR(dev->base))
                return PTR_ERR(dev->base);
 
-       init_completion(&dev->cmd_complete);
-       mutex_init(&dev->lock);
        dev->dev = &pdev->dev;
        dev->irq = irq;
        platform_set_drvdata(pdev, dev);
@@ -251,26 +223,11 @@ static int dw_i2c_probe(struct platform_device *pdev)
                dev->rx_fifo_depth = ((param1 >> 8)  & 0xff) + 1;
                dev->adapter.nr = pdev->id;
        }
-       r = i2c_dw_init(dev);
-       if (r)
-               return r;
-
-       i2c_dw_disable_int(dev);
-       r = devm_request_irq(&pdev->dev, dev->irq, i2c_dw_isr, IRQF_SHARED,
-                       pdev->name, dev);
-       if (r) {
-               dev_err(&pdev->dev, "failure requesting irq %i\n", dev->irq);
-               return r;
-       }
 
        adap = &dev->adapter;
-       i2c_set_adapdata(adap, dev);
        adap->owner = THIS_MODULE;
        adap->class = I2C_CLASS_DEPRECATED;
-       strlcpy(adap->name, "Synopsys DesignWare I2C adapter",
-                       sizeof(adap->name));
-       adap->algo = &i2c_dw_algo;
-       adap->dev.parent = &pdev->dev;
+       ACPI_COMPANION_SET(&adap->dev, ACPI_COMPANION(&pdev->dev));
        adap->dev.of_node = pdev->dev.of_node;
 
        if (dev->pm_runtime_disabled) {
@@ -282,9 +239,8 @@ static int dw_i2c_probe(struct platform_device *pdev)
                pm_runtime_enable(&pdev->dev);
        }
 
-       r = i2c_add_numbered_adapter(adap);
+       r = i2c_dw_probe(dev);
        if (r) {
-               dev_err(&pdev->dev, "failure adding adapter\n");
                pm_runtime_disable(&pdev->dev);
                return r;
        }
@@ -292,7 +248,7 @@ static int dw_i2c_probe(struct platform_device *pdev)
        return 0;
 }
 
-static int dw_i2c_remove(struct platform_device *pdev)
+static int dw_i2c_plat_remove(struct platform_device *pdev)
 {
        struct dw_i2c_dev *dev = platform_get_drvdata(pdev);
 
@@ -306,9 +262,6 @@ static int dw_i2c_remove(struct platform_device *pdev)
        pm_runtime_put_sync(&pdev->dev);
        pm_runtime_disable(&pdev->dev);
 
-       if (has_acpi_companion(&pdev->dev))
-               dw_i2c_acpi_unconfigure(pdev);
-
        return 0;
 }
 
@@ -321,23 +274,23 @@ MODULE_DEVICE_TABLE(of, dw_i2c_of_match);
 #endif
 
 #ifdef CONFIG_PM_SLEEP
-static int dw_i2c_prepare(struct device *dev)
+static int dw_i2c_plat_prepare(struct device *dev)
 {
        return pm_runtime_suspended(dev);
 }
 
-static void dw_i2c_complete(struct device *dev)
+static void dw_i2c_plat_complete(struct device *dev)
 {
        if (dev->power.direct_complete)
                pm_request_resume(dev);
 }
 #else
-#define dw_i2c_prepare NULL
-#define dw_i2c_complete        NULL
+#define dw_i2c_plat_prepare    NULL
+#define dw_i2c_plat_complete   NULL
 #endif
 
 #ifdef CONFIG_PM
-static int dw_i2c_suspend(struct device *dev)
+static int dw_i2c_plat_suspend(struct device *dev)
 {
        struct platform_device *pdev = to_platform_device(dev);
        struct dw_i2c_dev *i_dev = platform_get_drvdata(pdev);
@@ -348,7 +301,7 @@ static int dw_i2c_suspend(struct device *dev)
        return 0;
 }
 
-static int dw_i2c_resume(struct device *dev)
+static int dw_i2c_plat_resume(struct device *dev)
 {
        struct platform_device *pdev = to_platform_device(dev);
        struct dw_i2c_dev *i_dev = platform_get_drvdata(pdev);
@@ -362,10 +315,10 @@ static int dw_i2c_resume(struct device *dev)
 }
 
 static const struct dev_pm_ops dw_i2c_dev_pm_ops = {
-       .prepare = dw_i2c_prepare,
-       .complete = dw_i2c_complete,
-       SET_SYSTEM_SLEEP_PM_OPS(dw_i2c_suspend, dw_i2c_resume)
-       SET_RUNTIME_PM_OPS(dw_i2c_suspend, dw_i2c_resume, NULL)
+       .prepare = dw_i2c_plat_prepare,
+       .complete = dw_i2c_plat_complete,
+       SET_SYSTEM_SLEEP_PM_OPS(dw_i2c_plat_suspend, dw_i2c_plat_resume)
+       SET_RUNTIME_PM_OPS(dw_i2c_plat_suspend, dw_i2c_plat_resume, NULL)
 };
 
 #define DW_I2C_DEV_PMOPS (&dw_i2c_dev_pm_ops)
@@ -377,8 +330,8 @@ static const struct dev_pm_ops dw_i2c_dev_pm_ops = {
 MODULE_ALIAS("platform:i2c_designware");
 
 static struct platform_driver dw_i2c_driver = {
-       .probe = dw_i2c_probe,
-       .remove = dw_i2c_remove,
+       .probe = dw_i2c_plat_probe,
+       .remove = dw_i2c_plat_remove,
        .driver         = {
                .name   = "i2c_designware",
                .of_match_table = of_match_ptr(dw_i2c_of_match),
index eaef9bc9d88c469bfa1b4516b9ecb88c0211480d..c306751ceadb44c24757b02281de24779038b1cb 100644 (file)
@@ -60,6 +60,8 @@
  * BayTrail (SOC)              0x0f12  32      hard    yes     yes     yes
  * Sunrise Point-H (PCH)       0xa123  32      hard    yes     yes     yes
  * Sunrise Point-LP (PCH)      0x9d23  32      hard    yes     yes     yes
+ * DNV (SOC)                   0x19df  32      hard    yes     yes     yes
+ * Broxton (SOC)               0x5ad4  32      hard    yes     yes     yes
  *
  * Features supported by this driver:
  * Software PEC                                no
 #define PCI_DEVICE_ID_INTEL_WILDCATPOINT_LP_SMBUS      0x9ca2
 #define PCI_DEVICE_ID_INTEL_SUNRISEPOINT_H_SMBUS       0xa123
 #define PCI_DEVICE_ID_INTEL_SUNRISEPOINT_LP_SMBUS      0x9d23
+#define PCI_DEVICE_ID_INTEL_DNV_SMBUS                  0x19df
+#define PCI_DEVICE_ID_INTEL_BROXTON_SMBUS              0x5ad4
 
 struct i801_mux_config {
        char *gpio_chip;
@@ -863,6 +867,8 @@ static const struct pci_device_id i801_ids[] = {
        { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_BRASWELL_SMBUS) },
        { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SUNRISEPOINT_H_SMBUS) },
        { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SUNRISEPOINT_LP_SMBUS) },
+       { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_DNV_SMBUS) },
+       { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_BROXTON_SMBUS) },
        { 0, }
 };
 
@@ -1251,11 +1257,15 @@ static int i801_probe(struct pci_dev *dev, const struct pci_device_id *id)
        priv->adapter.owner = THIS_MODULE;
        priv->adapter.class = i801_get_adapter_class(priv);
        priv->adapter.algo = &smbus_algorithm;
+       priv->adapter.dev.parent = &dev->dev;
+       ACPI_COMPANION_SET(&priv->adapter.dev, ACPI_COMPANION(&dev->dev));
+       priv->adapter.retries = 3;
 
        priv->pci_dev = dev;
        switch (dev->device) {
        case PCI_DEVICE_ID_INTEL_SUNRISEPOINT_H_SMBUS:
        case PCI_DEVICE_ID_INTEL_SUNRISEPOINT_LP_SMBUS:
+       case PCI_DEVICE_ID_INTEL_DNV_SMBUS:
                priv->features |= FEATURE_I2C_BLOCK_READ;
                priv->features |= FEATURE_IRQ;
                priv->features |= FEATURE_SMBUS_PEC;
@@ -1381,12 +1391,6 @@ static int i801_probe(struct pci_dev *dev, const struct pci_device_id *id)
 
        i801_add_tco(priv);
 
-       /* set up the sysfs linkage to our parent device */
-       priv->adapter.dev.parent = &dev->dev;
-
-       /* Retry up to 3 times on lost arbitration */
-       priv->adapter.retries = 3;
-
        snprintf(priv->adapter.name, sizeof(priv->adapter.name),
                "SMBus I801 adapter at %04lx", priv->smba);
        err = i2c_add_adapter(&priv->adapter);
index 722f839cfa3c8287fe21fe347f1625389e60afb4..ab492301581a0d717566c7ff473c4d7c3adacca3 100644 (file)
@@ -798,6 +798,7 @@ static const struct of_device_id ibm_iic_match[] = {
        { .compatible = "ibm,iic", },
        {}
 };
+MODULE_DEVICE_TABLE(of, ibm_iic_match);
 
 static struct platform_driver ibm_iic_driver = {
        .driver = {
index 00ffd661368069ab24e4d67ab2abcecd06333ab0..3795fe130ef27e94851d944b19ff8ad709f6428b 100644 (file)
 #define ISR_COMPLETE(err)      (ISR_COMPLETE_M | (ISR_STATUS_M & (err)))
 #define ISR_FATAL(err)         (ISR_COMPLETE(err) | ISR_FATAL_M)
 
-#define REL_SOC_IP_SCB_2_2_1   0x00020201
-
 enum img_i2c_mode {
        MODE_INACTIVE,
        MODE_RAW,
@@ -536,6 +534,7 @@ static void img_i2c_read_fifo(struct img_i2c *i2c)
                u32 fifo_status;
                u8 data;
 
+               img_i2c_wr_rd_fence(i2c);
                fifo_status = img_i2c_readl(i2c, SCB_FIFO_STATUS_REG);
                if (fifo_status & FIFO_READ_EMPTY)
                        break;
@@ -544,7 +543,6 @@ static void img_i2c_read_fifo(struct img_i2c *i2c)
                *i2c->msg.buf = data;
 
                img_i2c_writel(i2c, SCB_READ_FIFO_REG, 0xff);
-               img_i2c_wr_rd_fence(i2c);
                i2c->msg.len--;
                i2c->msg.buf++;
        }
@@ -556,12 +554,12 @@ static void img_i2c_write_fifo(struct img_i2c *i2c)
        while (i2c->msg.len) {
                u32 fifo_status;
 
+               img_i2c_wr_rd_fence(i2c);
                fifo_status = img_i2c_readl(i2c, SCB_FIFO_STATUS_REG);
                if (fifo_status & FIFO_WRITE_FULL)
                        break;
 
                img_i2c_writel(i2c, SCB_WRITE_DATA_REG, *i2c->msg.buf);
-               img_i2c_wr_rd_fence(i2c);
                i2c->msg.len--;
                i2c->msg.buf++;
        }
@@ -859,7 +857,7 @@ static unsigned int img_i2c_auto(struct img_i2c *i2c,
        }
 
        /* Enable transaction halt on start bit */
-       if (!i2c->last_msg && i2c->line_status & LINESTAT_START_BIT_DET) {
+       if (!i2c->last_msg && line_status & LINESTAT_START_BIT_DET) {
                img_i2c_transaction_halt(i2c, true);
                /* we're no longer interested in the slave event */
                i2c->int_enable &= ~INT_SLAVE_EVENT;
@@ -1062,6 +1060,15 @@ static int img_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
                i2c->last_msg = (i == num - 1);
                reinit_completion(&i2c->msg_complete);
 
+               /*
+                * Clear line status and all interrupts before starting a
+                * transfer, as we may have unserviced interrupts from
+                * previous transfers that might be handled in the context
+                * of the new transfer.
+                */
+               img_i2c_writel(i2c, SCB_INT_CLEAR_REG, ~0);
+               img_i2c_writel(i2c, SCB_CLEAR_REG, ~0);
+
                if (atomic)
                        img_i2c_atomic_start(i2c);
                else if (msg->flags & I2C_M_RD)
@@ -1120,13 +1127,8 @@ static int img_i2c_init(struct img_i2c *i2c)
                return -EINVAL;
        }
 
-       if (rev == REL_SOC_IP_SCB_2_2_1) {
-               i2c->need_wr_rd_fence = true;
-               dev_info(i2c->adap.dev.parent, "fence quirk enabled");
-       }
-
-       bitrate_khz = i2c->bitrate / 1000;
-       clk_khz = clk_get_rate(i2c->scb_clk) / 1000;
+       /* Fencing enabled by default. */
+       i2c->need_wr_rd_fence = true;
 
        /* Determine what mode we're in from the bitrate */
        timing = timings[0];
@@ -1136,6 +1138,17 @@ static int img_i2c_init(struct img_i2c *i2c)
                        break;
                }
        }
+       if (i2c->bitrate > timings[ARRAY_SIZE(timings) - 1].max_bitrate) {
+               dev_warn(i2c->adap.dev.parent,
+                        "requested bitrate (%u) is higher than the max bitrate supported (%u)\n",
+                        i2c->bitrate,
+                        timings[ARRAY_SIZE(timings) - 1].max_bitrate);
+               timing = timings[ARRAY_SIZE(timings) - 1];
+               i2c->bitrate = timing.max_bitrate;
+       }
+
+       bitrate_khz = i2c->bitrate / 1000;
+       clk_khz = clk_get_rate(i2c->scb_clk) / 1000;
 
        /* Find the prescale that would give us that inc (approx delay = 0) */
        prescale = SCB_OPT_INC * clk_khz / (256 * 16 * bitrate_khz);
@@ -1182,32 +1195,32 @@ static int img_i2c_init(struct img_i2c *i2c)
            ((bitrate_khz * clk_period) / 2))
                int_bitrate++;
 
-       /* Setup TCKH value */
-       tckh = timing.tckh / clk_period;
-       if (timing.tckh % clk_period)
-               tckh++;
+       /*
+        * Setup clock duty cycle, start with 50% and adjust TCKH and TCKL
+        * values from there if they don't meet minimum timing requirements
+        */
+       tckh = int_bitrate / 2;
+       tckl = int_bitrate - tckh;
 
-       if (tckh > 0)
-               data = tckh - 1;
-       else
-               data = 0;
+       /* Adjust TCKH and TCKL values */
+       data = DIV_ROUND_UP(timing.tckl, clk_period);
 
-       img_i2c_writel(i2c, SCB_TIME_TCKH_REG, data);
+       if (tckl < data) {
+               tckl = data;
+               tckh = int_bitrate - tckl;
+       }
 
-       /* Setup TCKL value */
-       tckl = int_bitrate - tckh;
+       if (tckh > 0)
+               --tckh;
 
        if (tckl > 0)
-               data = tckl - 1;
-       else
-               data = 0;
+               --tckl;
 
-       img_i2c_writel(i2c, SCB_TIME_TCKL_REG, data);
+       img_i2c_writel(i2c, SCB_TIME_TCKH_REG, tckh);
+       img_i2c_writel(i2c, SCB_TIME_TCKL_REG, tckl);
 
        /* Setup TSDH value */
-       tsdh = timing.tsdh / clk_period;
-       if (timing.tsdh % clk_period)
-               tsdh++;
+       tsdh = DIV_ROUND_UP(timing.tsdh, clk_period);
 
        if (tsdh > 1)
                data = tsdh - 1;
index 785aa674a4da19524a94be3aa6c9b5d66cc8058c..1e4d99da41646d98a85340369828bb262c77075f 100644 (file)
@@ -49,6 +49,7 @@
 #include <linux/of.h>
 #include <linux/of_device.h>
 #include <linux/of_dma.h>
+#include <linux/of_gpio.h>
 #include <linux/platform_data/i2c-imx.h>
 #include <linux/platform_device.h>
 #include <linux/sched.h>
@@ -207,6 +208,11 @@ struct imx_i2c_struct {
        unsigned int            cur_clk;
        unsigned int            bitrate;
        const struct imx_i2c_hwdata     *hwdata;
+       struct i2c_bus_recovery_info rinfo;
+
+       struct pinctrl *pinctrl;
+       struct pinctrl_state *pinctrl_pins_default;
+       struct pinctrl_state *pinctrl_pins_gpio;
 
        struct imx_i2c_dma      *dma;
 };
@@ -461,7 +467,7 @@ static int i2c_imx_acked(struct imx_i2c_struct *i2c_imx)
 {
        if (imx_i2c_read_reg(i2c_imx, IMX_I2C_I2SR) & I2SR_RXAK) {
                dev_dbg(&i2c_imx->adapter.dev, "<%s> No ACK\n", __func__);
-               return -EIO;  /* No ACK */
+               return -ENXIO;  /* No ACK */
        }
 
        dev_dbg(&i2c_imx->adapter.dev, "<%s> ACK received\n", __func__);
@@ -896,6 +902,13 @@ static int i2c_imx_xfer(struct i2c_adapter *adapter,
 
        /* Start I2C transfer */
        result = i2c_imx_start(i2c_imx);
+       if (result) {
+               if (i2c_imx->adapter.bus_recovery_info) {
+                       i2c_recover_bus(&i2c_imx->adapter);
+                       result = i2c_imx_start(i2c_imx);
+               }
+       }
+
        if (result)
                goto fail0;
 
@@ -956,6 +969,55 @@ fail0:
        return (result < 0) ? result : num;
 }
 
+static void i2c_imx_prepare_recovery(struct i2c_adapter *adap)
+{
+       struct imx_i2c_struct *i2c_imx;
+
+       i2c_imx = container_of(adap, struct imx_i2c_struct, adapter);
+
+       pinctrl_select_state(i2c_imx->pinctrl, i2c_imx->pinctrl_pins_gpio);
+}
+
+static void i2c_imx_unprepare_recovery(struct i2c_adapter *adap)
+{
+       struct imx_i2c_struct *i2c_imx;
+
+       i2c_imx = container_of(adap, struct imx_i2c_struct, adapter);
+
+       pinctrl_select_state(i2c_imx->pinctrl, i2c_imx->pinctrl_pins_default);
+}
+
+static void i2c_imx_init_recovery_info(struct imx_i2c_struct *i2c_imx,
+               struct platform_device *pdev)
+{
+       struct i2c_bus_recovery_info *rinfo = &i2c_imx->rinfo;
+
+       i2c_imx->pinctrl_pins_default = pinctrl_lookup_state(i2c_imx->pinctrl,
+                       PINCTRL_STATE_DEFAULT);
+       i2c_imx->pinctrl_pins_gpio = pinctrl_lookup_state(i2c_imx->pinctrl,
+                       "gpio");
+       rinfo->sda_gpio = of_get_named_gpio_flags(pdev->dev.of_node,
+                       "sda-gpios", 0, NULL);
+       rinfo->scl_gpio = of_get_named_gpio_flags(pdev->dev.of_node,
+                       "scl-gpios", 0, NULL);
+
+       if (!gpio_is_valid(rinfo->sda_gpio) ||
+           !gpio_is_valid(rinfo->scl_gpio) ||
+           IS_ERR(i2c_imx->pinctrl_pins_default) ||
+           IS_ERR(i2c_imx->pinctrl_pins_gpio)) {
+               dev_dbg(&pdev->dev, "recovery information incomplete\n");
+               return;
+       }
+
+       dev_dbg(&pdev->dev, "using scl-gpio %d and sda-gpio %d for recovery\n",
+                       rinfo->sda_gpio, rinfo->scl_gpio);
+
+       rinfo->prepare_recovery = i2c_imx_prepare_recovery;
+       rinfo->unprepare_recovery = i2c_imx_unprepare_recovery;
+       rinfo->recover_bus = i2c_generic_gpio_recovery;
+       i2c_imx->adapter.bus_recovery_info = rinfo;
+}
+
 static u32 i2c_imx_func(struct i2c_adapter *adapter)
 {
        return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL
@@ -1023,6 +1085,13 @@ static int i2c_imx_probe(struct platform_device *pdev)
                dev_err(&pdev->dev, "can't enable I2C clock\n");
                return ret;
        }
+
+       i2c_imx->pinctrl = devm_pinctrl_get(&pdev->dev);
+       if (IS_ERR(i2c_imx->pinctrl)) {
+               ret = PTR_ERR(i2c_imx->pinctrl);
+               goto clk_disable;
+       }
+
        /* Request IRQ */
        ret = devm_request_irq(&pdev->dev, irq, i2c_imx_isr, 0,
                                pdev->name, i2c_imx);
@@ -1056,6 +1125,8 @@ static int i2c_imx_probe(struct platform_device *pdev)
                goto clk_disable;
        }
 
+       i2c_imx_init_recovery_info(i2c_imx, pdev);
+
        /* Set up platform driver data */
        platform_set_drvdata(pdev, i2c_imx);
        clk_disable_unprepare(i2c_imx->clk);
index 39becbbdfd999b55080aac5856a343ac24f02f2d..7ba795b24e75d4d212972ddfa0675d582a9ef671 100644 (file)
@@ -165,14 +165,13 @@ struct ismt_desc {
 
 struct ismt_priv {
        struct i2c_adapter adapter;
-       void *smba;                             /* PCI BAR */
+       void __iomem *smba;                     /* PCI BAR */
        struct pci_dev *pci_dev;
        struct ismt_desc *hw;                   /* descriptor virt base addr */
        dma_addr_t io_rng_dma;                  /* descriptor HW base addr */
        u8 head;                                /* ring buffer head pointer */
        struct completion cmp;                  /* interrupt completion */
        u8 dma_buffer[I2C_SMBUS_BLOCK_MAX + 1]; /* temp R/W data buffer */
-       bool using_msi;                         /* type of interrupt flag */
 };
 
 /**
@@ -398,7 +397,7 @@ static int ismt_access(struct i2c_adapter *adap, u16 addr,
        desc->tgtaddr_rw = ISMT_DESC_ADDR_RW(addr, read_write);
 
        /* Initialize common control bits */
-       if (likely(priv->using_msi))
+       if (likely(pci_dev_msi_enabled(priv->pci_dev)))
                desc->control = ISMT_DESC_INT | ISMT_DESC_FAIR;
        else
                desc->control = ISMT_DESC_FAIR;
@@ -789,11 +788,8 @@ static int ismt_int_init(struct ismt_priv *priv)
 
        /* Try using MSI interrupts */
        err = pci_enable_msi(priv->pci_dev);
-       if (err) {
-               dev_warn(&priv->pci_dev->dev,
-                        "Unable to use MSI interrupts, falling back to legacy\n");
+       if (err)
                goto intx;
-       }
 
        err = devm_request_irq(&priv->pci_dev->dev,
                               priv->pci_dev->irq,
@@ -806,11 +802,13 @@ static int ismt_int_init(struct ismt_priv *priv)
                goto intx;
        }
 
-       priv->using_msi = true;
-       goto done;
+       return 0;
 
        /* Try using legacy interrupts */
 intx:
+       dev_warn(&priv->pci_dev->dev,
+                "Unable to use MSI interrupts, falling back to legacy\n");
+
        err = devm_request_irq(&priv->pci_dev->dev,
                               priv->pci_dev->irq,
                               ismt_do_interrupt,
@@ -819,12 +817,9 @@ intx:
                               priv);
        if (err) {
                dev_err(&priv->pci_dev->dev, "no usable interrupts\n");
-               return -ENODEV;
+               return err;
        }
 
-       priv->using_msi = false;
-
-done:
        return 0;
 }
 
@@ -847,17 +842,13 @@ ismt_probe(struct pci_dev *pdev, const struct pci_device_id *id)
                return -ENOMEM;
 
        pci_set_drvdata(pdev, priv);
+
        i2c_set_adapdata(&priv->adapter, priv);
        priv->adapter.owner = THIS_MODULE;
-
        priv->adapter.class = I2C_CLASS_HWMON;
-
        priv->adapter.algo = &smbus_algorithm;
-
-       /* set up the sysfs linkage to our parent device */
        priv->adapter.dev.parent = &pdev->dev;
-
-       /* number of retries on lost arbitration */
+       ACPI_COMPANION_SET(&priv->adapter.dev, ACPI_COMPANION(&pdev->dev));
        priv->adapter.retries = ISMT_MAX_RETRIES;
 
        priv->pci_dev = pdev;
@@ -904,8 +895,7 @@ ismt_probe(struct pci_dev *pdev, const struct pci_device_id *id)
        priv->smba = pcim_iomap(pdev, SMBBAR, len);
        if (!priv->smba) {
                dev_err(&pdev->dev, "Unable to ioremap SMBus BAR\n");
-               err = -ENODEV;
-               goto fail;
+               return -ENODEV;
        }
 
        if ((pci_set_dma_mask(pdev, DMA_BIT_MASK(64)) != 0) ||
@@ -915,32 +905,26 @@ ismt_probe(struct pci_dev *pdev, const struct pci_device_id *id)
                                                 DMA_BIT_MASK(32)) != 0)) {
                        dev_err(&pdev->dev, "pci_set_dma_mask fail %p\n",
                                pdev);
-                       err = -ENODEV;
-                       goto fail;
+                       return -ENODEV;
                }
        }
 
        err = ismt_dev_init(priv);
        if (err)
-               goto fail;
+               return err;
 
        ismt_hw_init(priv);
 
        err = ismt_int_init(priv);
        if (err)
-               goto fail;
+               return err;
 
        err = i2c_add_adapter(&priv->adapter);
        if (err) {
                dev_err(&pdev->dev, "Failed to add SMBus iSMT adapter\n");
-               err = -ENODEV;
-               goto fail;
+               return -ENODEV;
        }
        return 0;
-
-fail:
-       pci_release_region(pdev, SMBBAR);
-       return err;
 }
 
 /**
@@ -952,47 +936,13 @@ static void ismt_remove(struct pci_dev *pdev)
        struct ismt_priv *priv = pci_get_drvdata(pdev);
 
        i2c_del_adapter(&priv->adapter);
-       pci_release_region(pdev, SMBBAR);
 }
 
-/**
- * ismt_suspend() - place the device in suspend
- * @pdev: PCI-Express device
- * @mesg: PM message
- */
-#ifdef CONFIG_PM
-static int ismt_suspend(struct pci_dev *pdev, pm_message_t mesg)
-{
-       pci_save_state(pdev);
-       pci_set_power_state(pdev, pci_choose_state(pdev, mesg));
-       return 0;
-}
-
-/**
- * ismt_resume() - PCI resume code
- * @pdev: PCI-Express device
- */
-static int ismt_resume(struct pci_dev *pdev)
-{
-       pci_set_power_state(pdev, PCI_D0);
-       pci_restore_state(pdev);
-       return pci_enable_device(pdev);
-}
-
-#else
-
-#define ismt_suspend NULL
-#define ismt_resume NULL
-
-#endif
-
 static struct pci_driver ismt_driver = {
        .name = "ismt_smbus",
        .id_table = ismt_ids,
        .probe = ismt_probe,
        .remove = ismt_remove,
-       .suspend = ismt_suspend,
-       .resume = ismt_resume,
 };
 
 module_pci_driver(ismt_driver);
index 5e176adca8e8a7b4326f2aa3d95c6188cb15ff16..71d3929adf54ed074e1600fcfd0b844f6e6574d6 100644 (file)
@@ -475,6 +475,7 @@ static const struct of_device_id meson_i2c_match[] = {
        { .compatible = "amlogic,meson6-i2c" },
        { },
 };
+MODULE_DEVICE_TABLE(of, meson_i2c_match);
 
 static struct platform_driver meson_i2c_driver = {
        .probe   = meson_i2c_probe,
index c02e6c018c39f0034dd9dab70c2f61ce290094b8..9b867169142fd811fe1cda81d834860f9e31af8b 100644 (file)
@@ -728,11 +728,27 @@ static int mtk_i2c_remove(struct platform_device *pdev)
        return 0;
 }
 
+#ifdef CONFIG_PM_SLEEP
+static int mtk_i2c_resume(struct device *dev)
+{
+       struct mtk_i2c *i2c = dev_get_drvdata(dev);
+
+       mtk_i2c_init_hw(i2c);
+
+       return 0;
+}
+#endif
+
+static const struct dev_pm_ops mtk_i2c_pm = {
+       SET_SYSTEM_SLEEP_PM_OPS(NULL, mtk_i2c_resume)
+};
+
 static struct platform_driver mtk_i2c_driver = {
        .probe = mtk_i2c_probe,
        .remove = mtk_i2c_remove,
        .driver = {
                .name = I2C_DRV_NAME,
+               .pm = &mtk_i2c_pm,
                .of_match_table = of_match_ptr(mtk_i2c_of_match),
        },
 };
index abf5db7e441ebab65fc7c8ad99b5f9bca6218b15..11b7b87311ed2ffb602dad86a31649bec0428dd8 100644 (file)
@@ -92,6 +92,16 @@ static void oc_setreg_32(struct ocores_i2c *i2c, int reg, u8 value)
        iowrite32(value, i2c->base + (reg << i2c->reg_shift));
 }
 
+static void oc_setreg_16be(struct ocores_i2c *i2c, int reg, u8 value)
+{
+       iowrite16be(value, i2c->base + (reg << i2c->reg_shift));
+}
+
+static void oc_setreg_32be(struct ocores_i2c *i2c, int reg, u8 value)
+{
+       iowrite32be(value, i2c->base + (reg << i2c->reg_shift));
+}
+
 static inline u8 oc_getreg_8(struct ocores_i2c *i2c, int reg)
 {
        return ioread8(i2c->base + (reg << i2c->reg_shift));
@@ -107,6 +117,16 @@ static inline u8 oc_getreg_32(struct ocores_i2c *i2c, int reg)
        return ioread32(i2c->base + (reg << i2c->reg_shift));
 }
 
+static inline u8 oc_getreg_16be(struct ocores_i2c *i2c, int reg)
+{
+       return ioread16be(i2c->base + (reg << i2c->reg_shift));
+}
+
+static inline u8 oc_getreg_32be(struct ocores_i2c *i2c, int reg)
+{
+       return ioread32be(i2c->base + (reg << i2c->reg_shift));
+}
+
 static inline void oc_setreg(struct ocores_i2c *i2c, int reg, u8 value)
 {
        i2c->setreg(i2c, reg, value);
@@ -428,6 +448,9 @@ static int ocores_i2c_probe(struct platform_device *pdev)
                i2c->reg_io_width = 1; /* Set to default value */
 
        if (!i2c->setreg || !i2c->getreg) {
+               bool be = pdata ? pdata->big_endian :
+                       of_device_is_big_endian(pdev->dev.of_node);
+
                switch (i2c->reg_io_width) {
                case 1:
                        i2c->setreg = oc_setreg_8;
@@ -435,13 +458,13 @@ static int ocores_i2c_probe(struct platform_device *pdev)
                        break;
 
                case 2:
-                       i2c->setreg = oc_setreg_16;
-                       i2c->getreg = oc_getreg_16;
+                       i2c->setreg = be ? oc_setreg_16be : oc_setreg_16;
+                       i2c->getreg = be ? oc_getreg_16be : oc_getreg_16;
                        break;
 
                case 4:
-                       i2c->setreg = oc_setreg_32;
-                       i2c->getreg = oc_getreg_32;
+                       i2c->setreg = be ? oc_setreg_32be : oc_setreg_32;
+                       i2c->getreg = be ? oc_getreg_32be : oc_getreg_32;
                        break;
 
                default:
index 6f8b446be5b0e5787deede7f675044332d72f8cb..7ea67aa46fb730d62342f8ec1a7be58369ca3122 100644 (file)
@@ -496,7 +496,7 @@ i2c_pnx_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
        struct i2c_msg *pmsg;
        int rc = 0, completed = 0, i;
        struct i2c_pnx_algo_data *alg_data = adap->algo_data;
-       u32 stat = ioread32(I2C_REG_STS(alg_data));
+       u32 stat;
 
        dev_dbg(&alg_data->adapter.dev,
                "%s(): entering: %d messages, stat = %04x.\n",
@@ -659,9 +659,8 @@ static int i2c_pnx_probe(struct platform_device *pdev)
        if (IS_ERR(alg_data->clk))
                return PTR_ERR(alg_data->clk);
 
-       init_timer(&alg_data->mif.timer);
-       alg_data->mif.timer.function = i2c_pnx_timeout;
-       alg_data->mif.timer.data = (unsigned long)alg_data;
+       setup_timer(&alg_data->mif.timer, i2c_pnx_timeout,
+                       (unsigned long)alg_data);
 
        snprintf(alg_data->adapter.name, sizeof(alg_data->adapter.name),
                 "%s", pdev->name);
index 645e4b79d968155c8f55ec28cb2aa3e5d1953626..0d351954db02b9d0c80a9a34d354e3805b9106d2 100644 (file)
@@ -46,12 +46,15 @@ struct pxa_reg_layout {
        u32 icr;
        u32 isr;
        u32 isar;
+       u32 ilcr;
+       u32 iwcr;
 };
 
 enum pxa_i2c_types {
        REGS_PXA2XX,
        REGS_PXA3XX,
        REGS_CE4100,
+       REGS_PXA910,
 };
 
 /*
@@ -79,12 +82,22 @@ static struct pxa_reg_layout pxa_reg_layout[] = {
                .isr =  0x04,
                /* no isar register */
        },
+       [REGS_PXA910] = {
+               .ibmr = 0x00,
+               .idbr = 0x08,
+               .icr =  0x10,
+               .isr =  0x18,
+               .isar = 0x20,
+               .ilcr = 0x28,
+               .iwcr = 0x30,
+       },
 };
 
 static const struct platform_device_id i2c_pxa_id_table[] = {
        { "pxa2xx-i2c",         REGS_PXA2XX },
        { "pxa3xx-pwri2c",      REGS_PXA3XX },
        { "ce4100-i2c",         REGS_CE4100 },
+       { "pxa910-i2c",         REGS_PXA910 },
        { },
 };
 MODULE_DEVICE_TABLE(platform, i2c_pxa_id_table);
@@ -124,6 +137,23 @@ MODULE_DEVICE_TABLE(platform, i2c_pxa_id_table);
 #define ISR_SAD                (1 << 9)           /* slave address detected */
 #define ISR_BED                (1 << 10)          /* bus error no ACK/NAK */
 
+/* bit field shift & mask */
+#define ILCR_SLV_SHIFT         0
+#define ILCR_SLV_MASK          (0x1FF << ILCR_SLV_SHIFT)
+#define ILCR_FLV_SHIFT         9
+#define ILCR_FLV_MASK          (0x1FF << ILCR_FLV_SHIFT)
+#define ILCR_HLVL_SHIFT                18
+#define ILCR_HLVL_MASK         (0x1FF << ILCR_HLVL_SHIFT)
+#define ILCR_HLVH_SHIFT                27
+#define ILCR_HLVH_MASK         (0x1F << ILCR_HLVH_SHIFT)
+
+#define IWCR_CNT_SHIFT         0
+#define IWCR_CNT_MASK          (0x1F << IWCR_CNT_SHIFT)
+#define IWCR_HS_CNT1_SHIFT     5
+#define IWCR_HS_CNT1_MASK      (0x1F << IWCR_HS_CNT1_SHIFT)
+#define IWCR_HS_CNT2_SHIFT     10
+#define IWCR_HS_CNT2_MASK      (0x1F << IWCR_HS_CNT2_SHIFT)
+
 struct pxa_i2c {
        spinlock_t              lock;
        wait_queue_head_t       wait;
@@ -150,6 +180,8 @@ struct pxa_i2c {
        void __iomem            *reg_icr;
        void __iomem            *reg_isr;
        void __iomem            *reg_isar;
+       void __iomem            *reg_ilcr;
+       void __iomem            *reg_iwcr;
 
        unsigned long           iobase;
        unsigned long           iosize;
@@ -168,6 +200,8 @@ struct pxa_i2c {
 #define _ICR(i2c)      ((i2c)->reg_icr)
 #define _ISR(i2c)      ((i2c)->reg_isr)
 #define _ISAR(i2c)     ((i2c)->reg_isar)
+#define _ILCR(i2c)     ((i2c)->reg_ilcr)
+#define _IWCR(i2c)     ((i2c)->reg_iwcr)
 
 /*
  * I2C Slave mode address
@@ -1102,7 +1136,7 @@ static const struct i2c_algorithm i2c_pxa_pio_algorithm = {
 static const struct of_device_id i2c_pxa_dt_ids[] = {
        { .compatible = "mrvl,pxa-i2c", .data = (void *)REGS_PXA2XX },
        { .compatible = "mrvl,pwri2c", .data = (void *)REGS_PXA3XX },
-       { .compatible = "mrvl,mmp-twsi", .data = (void *)REGS_PXA2XX },
+       { .compatible = "mrvl,mmp-twsi", .data = (void *)REGS_PXA910 },
        {}
 };
 MODULE_DEVICE_TABLE(of, i2c_pxa_dt_ids);
@@ -1203,6 +1237,11 @@ static int i2c_pxa_probe(struct platform_device *dev)
        if (i2c_type != REGS_CE4100)
                i2c->reg_isar = i2c->reg_base + pxa_reg_layout[i2c_type].isar;
 
+       if (i2c_type == REGS_PXA910) {
+               i2c->reg_ilcr = i2c->reg_base + pxa_reg_layout[i2c_type].ilcr;
+               i2c->reg_iwcr = i2c->reg_base + pxa_reg_layout[i2c_type].iwcr;
+       }
+
        i2c->iobase = res->start;
        i2c->iosize = resource_size(res);
 
index d8b5a8fee1e6c85588dd569b80894306b1c76b1a..b0ae560b38c308335229f0f9b2317f0361b6b8a3 100644 (file)
@@ -27,7 +27,6 @@
 #include <linux/interrupt.h>
 #include <linux/io.h>
 #include <linux/i2c.h>
-#include <linux/i2c/i2c-rcar.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/of_device.h>
 enum rcar_i2c_type {
        I2C_RCAR_GEN1,
        I2C_RCAR_GEN2,
+       I2C_RCAR_GEN3,
 };
 
 struct rcar_i2c_priv {
@@ -178,6 +178,7 @@ static int rcar_i2c_clock_calculate(struct rcar_i2c_priv *priv,
                cdf_width = 2;
                break;
        case I2C_RCAR_GEN2:
+       case I2C_RCAR_GEN3:
                cdf_width = 3;
                break;
        default:
@@ -625,13 +626,13 @@ static const struct of_device_id rcar_i2c_dt_ids[] = {
        { .compatible = "renesas,i2c-r8a7792", .data = (void *)I2C_RCAR_GEN2 },
        { .compatible = "renesas,i2c-r8a7793", .data = (void *)I2C_RCAR_GEN2 },
        { .compatible = "renesas,i2c-r8a7794", .data = (void *)I2C_RCAR_GEN2 },
+       { .compatible = "renesas,i2c-r8a7795", .data = (void *)I2C_RCAR_GEN3 },
        {},
 };
 MODULE_DEVICE_TABLE(of, rcar_i2c_dt_ids);
 
 static int rcar_i2c_probe(struct platform_device *pdev)
 {
-       struct i2c_rcar_platform_data *pdata = dev_get_platdata(&pdev->dev);
        struct rcar_i2c_priv *priv;
        struct i2c_adapter *adap;
        struct resource *res;
@@ -650,15 +651,9 @@ static int rcar_i2c_probe(struct platform_device *pdev)
        }
 
        bus_speed = 100000; /* default 100 kHz */
-       ret = of_property_read_u32(dev->of_node, "clock-frequency", &bus_speed);
-       if (ret < 0 && pdata && pdata->bus_speed)
-               bus_speed = pdata->bus_speed;
+       of_property_read_u32(dev->of_node, "clock-frequency", &bus_speed);
 
-       if (pdev->dev.of_node)
-               priv->devtype = (long)of_match_device(rcar_i2c_dt_ids,
-                                                     dev)->data;
-       else
-               priv->devtype = platform_get_device_id(pdev)->driver_data;
+       priv->devtype = (enum rcar_i2c_type)of_match_device(rcar_i2c_dt_ids, dev)->data;
 
        ret = rcar_i2c_clock_calculate(priv, bus_speed, dev);
        if (ret < 0)
@@ -716,14 +711,6 @@ static int rcar_i2c_remove(struct platform_device *pdev)
        return 0;
 }
 
-static const struct platform_device_id rcar_i2c_id_table[] = {
-       { "i2c-rcar",           I2C_RCAR_GEN1 },
-       { "i2c-rcar_gen1",      I2C_RCAR_GEN1 },
-       { "i2c-rcar_gen2",      I2C_RCAR_GEN2 },
-       {},
-};
-MODULE_DEVICE_TABLE(platform, rcar_i2c_id_table);
-
 static struct platform_driver rcar_i2c_driver = {
        .driver = {
                .name   = "i2c-rcar",
@@ -731,7 +718,6 @@ static struct platform_driver rcar_i2c_driver = {
        },
        .probe          = rcar_i2c_probe,
        .remove         = rcar_i2c_remove,
-       .id_table       = rcar_i2c_id_table,
 };
 
 module_platform_driver(rcar_i2c_driver);
index 72e97e306bd925f8421dfa4be3979c1d25667d9c..c1935ebd6a9c38971b6539cc1d1ae03dfc276d17 100644 (file)
@@ -858,6 +858,7 @@ static const struct of_device_id rk3x_i2c_match[] = {
        { .compatible = "rockchip,rk3288-i2c", .data = (void *)&soc_data[2] },
        {},
 };
+MODULE_DEVICE_TABLE(of, rk3x_i2c_match);
 
 static int rk3x_i2c_probe(struct platform_device *pdev)
 {
index 47659a925e09cd5f8f7ebb7b928c2d6b8699bc4a..7d2bd3ec2d2d252e97ccdc064c6289f6ededc522 100644 (file)
@@ -836,6 +836,7 @@ static const struct of_device_id sh_mobile_i2c_dt_ids[] = {
        { .compatible = "renesas,iic-r8a7792", .data = &fast_clock_dt_config },
        { .compatible = "renesas,iic-r8a7793", .data = &fast_clock_dt_config },
        { .compatible = "renesas,iic-r8a7794", .data = &fast_clock_dt_config },
+       { .compatible = "renesas,iic-r8a7795", .data = &fast_clock_dt_config },
        { .compatible = "renesas,iic-sh73a0", .data = &fast_clock_dt_config },
        {},
 };
index 1092d4eeeb5440691c9ca425ab40cd0780e4b416..13e51ef6af73dfb1285aa75362163b448a867bb1 100644 (file)
@@ -358,11 +358,29 @@ static int i2c_sirfsoc_probe(struct platform_device *pdev)
        if (err < 0)
                bitrate = SIRFSOC_I2C_DEFAULT_SPEED;
 
-       if (bitrate < 100000)
-               regval =
-                       (2 * ctrl_speed) / (bitrate * 11);
-       else
+       /*
+        * Due to some hardware design issues, we need to tune the formula.
+        * Since i2c is open drain interface that allows the slave to
+        * stall the transaction by holding the SCL line at '0', the RTL
+        * implementation is waiting for SCL feedback from the pin after
+        * setting it to High-Z ('1'). This wait adds to the high-time
+        * interval counter few cycles of the input synchronization
+        * (depending on the SCL_FILTER_REG field), and also the time it
+        * takes for the board pull-up resistor to rise the SCL line.
+        * For slow SCL settings these additions are negligible,
+        * but they start to affect the speed when clock is set to faster
+        * frequencies.
+        * Through the actual tests, use the different user_div value(which
+        * in the divider formular 'Fio / (Fi2c * user_div)') to adapt
+        * the different ranges of i2c bus clock frequency, to make the SCL
+        * more accurate.
+        */
+       if (bitrate <= 30000)
                regval = ctrl_speed / (bitrate * 5);
+       else if (bitrate > 30000 && bitrate <= 280000)
+               regval = (2 * ctrl_speed) / (bitrate * 11);
+       else
+               regval = ctrl_speed / (bitrate * 6);
 
        writel(regval, siic->base + SIRFSOC_I2C_CLK_CTRL);
        if (regval > 0xFF)
index 4885da9e929824011756f97851f4c27a5c2b4aab..460c134832ac3039e9fd246f9263203b93453622 100644 (file)
@@ -977,6 +977,7 @@ static const struct of_device_id stu300_dt_match[] = {
        { .compatible = "st,ddci2c" },
        {},
 };
+MODULE_DEVICE_TABLE(of, stu300_dt_match);
 
 static struct platform_driver stu300_i2c_driver = {
        .driver = {
index b7e1a365542100c6b2bc6bf12184a4e8fd3d4103..a0522fcc4ff875b72448f346f3ed93276f2261b0 100644 (file)
@@ -873,7 +873,6 @@ static int tegra_i2c_probe(struct platform_device *pdev)
        i2c_dev->adapter.class = I2C_CLASS_DEPRECATED;
        strlcpy(i2c_dev->adapter.name, "Tegra I2C adapter",
                sizeof(i2c_dev->adapter.name));
-       i2c_dev->adapter.algo = &tegra_i2c_algo;
        i2c_dev->adapter.dev.parent = &pdev->dev;
        i2c_dev->adapter.nr = pdev->id;
        i2c_dev->adapter.dev.of_node = pdev->dev.of_node;
diff --git a/drivers/i2c/busses/i2c-uniphier-f.c b/drivers/i2c/busses/i2c-uniphier-f.c
new file mode 100644 (file)
index 0000000..e8d03bc
--- /dev/null
@@ -0,0 +1,584 @@
+/*
+ * Copyright (C) 2015 Masahiro Yamada <yamada.masahiro@socionext.com>
+ *
+ * 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; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include <linux/clk.h>
+#include <linux/i2c.h>
+#include <linux/interrupt.h>
+#include <linux/io.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
+
+#define UNIPHIER_FI2C_CR       0x00    /* control register */
+#define     UNIPHIER_FI2C_CR_MST       BIT(3)  /* master mode */
+#define     UNIPHIER_FI2C_CR_STA       BIT(2)  /* start condition */
+#define     UNIPHIER_FI2C_CR_STO       BIT(1)  /* stop condition */
+#define     UNIPHIER_FI2C_CR_NACK      BIT(0)  /* do not return ACK */
+#define UNIPHIER_FI2C_DTTX     0x04    /* TX FIFO */
+#define     UNIPHIER_FI2C_DTTX_CMD     BIT(8)  /* send command (slave addr) */
+#define     UNIPHIER_FI2C_DTTX_RD      BIT(0)  /* read transaction */
+#define UNIPHIER_FI2C_DTRX     0x04    /* RX FIFO */
+#define UNIPHIER_FI2C_SLAD     0x0c    /* slave address */
+#define UNIPHIER_FI2C_CYC      0x10    /* clock cycle control */
+#define UNIPHIER_FI2C_LCTL     0x14    /* clock low period control */
+#define UNIPHIER_FI2C_SSUT     0x18    /* restart/stop setup time control */
+#define UNIPHIER_FI2C_DSUT     0x1c    /* data setup time control */
+#define UNIPHIER_FI2C_INT      0x20    /* interrupt status */
+#define UNIPHIER_FI2C_IE       0x24    /* interrupt enable */
+#define UNIPHIER_FI2C_IC       0x28    /* interrupt clear */
+#define     UNIPHIER_FI2C_INT_TE       BIT(9)  /* TX FIFO empty */
+#define     UNIPHIER_FI2C_INT_RF       BIT(8)  /* RX FIFO full */
+#define     UNIPHIER_FI2C_INT_TC       BIT(7)  /* send complete (STOP) */
+#define     UNIPHIER_FI2C_INT_RC       BIT(6)  /* receive complete (STOP) */
+#define     UNIPHIER_FI2C_INT_TB       BIT(5)  /* sent specified bytes */
+#define     UNIPHIER_FI2C_INT_RB       BIT(4)  /* received specified bytes */
+#define     UNIPHIER_FI2C_INT_NA       BIT(2)  /* no ACK */
+#define     UNIPHIER_FI2C_INT_AL       BIT(1)  /* arbitration lost */
+#define UNIPHIER_FI2C_SR       0x2c    /* status register */
+#define     UNIPHIER_FI2C_SR_DB                BIT(12) /* device busy */
+#define     UNIPHIER_FI2C_SR_STS       BIT(11) /* stop condition detected */
+#define     UNIPHIER_FI2C_SR_BB                BIT(8)  /* bus busy */
+#define     UNIPHIER_FI2C_SR_RFF       BIT(3)  /* RX FIFO full */
+#define     UNIPHIER_FI2C_SR_RNE       BIT(2)  /* RX FIFO not empty */
+#define     UNIPHIER_FI2C_SR_TNF       BIT(1)  /* TX FIFO not full */
+#define     UNIPHIER_FI2C_SR_TFE       BIT(0)  /* TX FIFO empty */
+#define UNIPHIER_FI2C_RST      0x34    /* reset control */
+#define     UNIPHIER_FI2C_RST_TBRST    BIT(2)  /* clear TX FIFO */
+#define     UNIPHIER_FI2C_RST_RBRST    BIT(1)  /* clear RX FIFO */
+#define     UNIPHIER_FI2C_RST_RST      BIT(0)  /* forcible bus reset */
+#define UNIPHIER_FI2C_BM       0x38    /* bus monitor */
+#define     UNIPHIER_FI2C_BM_SDAO      BIT(3)  /* output for SDA line */
+#define     UNIPHIER_FI2C_BM_SDAS      BIT(2)  /* readback of SDA line */
+#define     UNIPHIER_FI2C_BM_SCLO      BIT(1)  /* output for SCL line */
+#define     UNIPHIER_FI2C_BM_SCLS      BIT(0)  /* readback of SCL line */
+#define UNIPHIER_FI2C_NOISE    0x3c    /* noise filter control */
+#define UNIPHIER_FI2C_TBC      0x40    /* TX byte count setting */
+#define UNIPHIER_FI2C_RBC      0x44    /* RX byte count setting */
+#define UNIPHIER_FI2C_TBCM     0x48    /* TX byte count monitor */
+#define UNIPHIER_FI2C_RBCM     0x4c    /* RX byte count monitor */
+#define UNIPHIER_FI2C_BRST     0x50    /* bus reset */
+#define     UNIPHIER_FI2C_BRST_FOEN    BIT(1)  /* normal operation */
+#define     UNIPHIER_FI2C_BRST_RSCL    BIT(0)  /* release SCL */
+
+#define UNIPHIER_FI2C_INT_FAULTS       \
+                               (UNIPHIER_FI2C_INT_NA | UNIPHIER_FI2C_INT_AL)
+#define UNIPHIER_FI2C_INT_STOP         \
+                               (UNIPHIER_FI2C_INT_TC | UNIPHIER_FI2C_INT_RC)
+
+#define UNIPHIER_FI2C_RD               BIT(0)
+#define UNIPHIER_FI2C_STOP             BIT(1)
+#define UNIPHIER_FI2C_MANUAL_NACK      BIT(2)
+#define UNIPHIER_FI2C_BYTE_WISE                BIT(3)
+#define UNIPHIER_FI2C_DEFER_STOP_COMP  BIT(4)
+
+#define UNIPHIER_FI2C_DEFAULT_SPEED    100000
+#define UNIPHIER_FI2C_MAX_SPEED                400000
+#define UNIPHIER_FI2C_FIFO_SIZE                8
+
+struct uniphier_fi2c_priv {
+       struct completion comp;
+       struct i2c_adapter adap;
+       void __iomem *membase;
+       struct clk *clk;
+       unsigned int len;
+       u8 *buf;
+       u32 enabled_irqs;
+       int error;
+       unsigned int flags;
+       unsigned int busy_cnt;
+};
+
+static void uniphier_fi2c_fill_txfifo(struct uniphier_fi2c_priv *priv,
+                                     bool first)
+{
+       int fifo_space = UNIPHIER_FI2C_FIFO_SIZE;
+
+       /*
+        * TX-FIFO stores slave address in it for the first access.
+        * Decrement the counter.
+        */
+       if (first)
+               fifo_space--;
+
+       while (priv->len) {
+               if (fifo_space-- <= 0)
+                       break;
+
+               dev_dbg(&priv->adap.dev, "write data: %02x\n", *priv->buf);
+               writel(*priv->buf++, priv->membase + UNIPHIER_FI2C_DTTX);
+               priv->len--;
+       }
+}
+
+static void uniphier_fi2c_drain_rxfifo(struct uniphier_fi2c_priv *priv)
+{
+       int fifo_left = priv->flags & UNIPHIER_FI2C_BYTE_WISE ?
+                                               1 : UNIPHIER_FI2C_FIFO_SIZE;
+
+       while (priv->len) {
+               if (fifo_left-- <= 0)
+                       break;
+
+               *priv->buf++ = readl(priv->membase + UNIPHIER_FI2C_DTRX);
+               dev_dbg(&priv->adap.dev, "read data: %02x\n", priv->buf[-1]);
+               priv->len--;
+       }
+}
+
+static void uniphier_fi2c_set_irqs(struct uniphier_fi2c_priv *priv)
+{
+       writel(priv->enabled_irqs, priv->membase + UNIPHIER_FI2C_IE);
+}
+
+static void uniphier_fi2c_clear_irqs(struct uniphier_fi2c_priv *priv)
+{
+       writel(-1, priv->membase + UNIPHIER_FI2C_IC);
+}
+
+static void uniphier_fi2c_stop(struct uniphier_fi2c_priv *priv)
+{
+       dev_dbg(&priv->adap.dev, "stop condition\n");
+
+       priv->enabled_irqs |= UNIPHIER_FI2C_INT_STOP;
+       uniphier_fi2c_set_irqs(priv);
+       writel(UNIPHIER_FI2C_CR_MST | UNIPHIER_FI2C_CR_STO,
+              priv->membase + UNIPHIER_FI2C_CR);
+}
+
+static irqreturn_t uniphier_fi2c_interrupt(int irq, void *dev_id)
+{
+       struct uniphier_fi2c_priv *priv = dev_id;
+       u32 irq_status;
+
+       irq_status = readl(priv->membase + UNIPHIER_FI2C_INT);
+
+       dev_dbg(&priv->adap.dev,
+               "interrupt: enabled_irqs=%04x, irq_status=%04x\n",
+               priv->enabled_irqs, irq_status);
+
+       if (irq_status & UNIPHIER_FI2C_INT_STOP)
+               goto complete;
+
+       if (unlikely(irq_status & UNIPHIER_FI2C_INT_AL)) {
+               dev_dbg(&priv->adap.dev, "arbitration lost\n");
+               priv->error = -EAGAIN;
+               goto complete;
+       }
+
+       if (unlikely(irq_status & UNIPHIER_FI2C_INT_NA)) {
+               dev_dbg(&priv->adap.dev, "could not get ACK\n");
+               priv->error = -ENXIO;
+               if (priv->flags & UNIPHIER_FI2C_RD) {
+                       /*
+                        * work around a hardware bug:
+                        * The receive-completed interrupt is never set even if
+                        * STOP condition is detected after the address phase
+                        * of read transaction fails to get ACK.
+                        * To avoid time-out error, we issue STOP here,
+                        * but do not wait for its completion.
+                        * It should be checked after exiting this handler.
+                        */
+                       uniphier_fi2c_stop(priv);
+                       priv->flags |= UNIPHIER_FI2C_DEFER_STOP_COMP;
+                       goto complete;
+               }
+               goto stop;
+       }
+
+       if (irq_status & UNIPHIER_FI2C_INT_TE) {
+               if (!priv->len)
+                       goto data_done;
+
+               uniphier_fi2c_fill_txfifo(priv, false);
+               goto handled;
+       }
+
+       if (irq_status & (UNIPHIER_FI2C_INT_RF | UNIPHIER_FI2C_INT_RB)) {
+               uniphier_fi2c_drain_rxfifo(priv);
+               if (!priv->len)
+                       goto data_done;
+
+               if (unlikely(priv->flags & UNIPHIER_FI2C_MANUAL_NACK)) {
+                       if (priv->len <= UNIPHIER_FI2C_FIFO_SIZE &&
+                           !(priv->flags & UNIPHIER_FI2C_BYTE_WISE)) {
+                               dev_dbg(&priv->adap.dev,
+                                       "enable read byte count IRQ\n");
+                               priv->enabled_irqs |= UNIPHIER_FI2C_INT_RB;
+                               uniphier_fi2c_set_irqs(priv);
+                               priv->flags |= UNIPHIER_FI2C_BYTE_WISE;
+                       }
+                       if (priv->len <= 1) {
+                               dev_dbg(&priv->adap.dev, "set NACK\n");
+                               writel(UNIPHIER_FI2C_CR_MST |
+                                      UNIPHIER_FI2C_CR_NACK,
+                                      priv->membase + UNIPHIER_FI2C_CR);
+                       }
+               }
+
+               goto handled;
+       }
+
+       return IRQ_NONE;
+
+data_done:
+       if (priv->flags & UNIPHIER_FI2C_STOP) {
+stop:
+               uniphier_fi2c_stop(priv);
+       } else {
+complete:
+               priv->enabled_irqs = 0;
+               uniphier_fi2c_set_irqs(priv);
+               complete(&priv->comp);
+       }
+
+handled:
+       uniphier_fi2c_clear_irqs(priv);
+
+       return IRQ_HANDLED;
+}
+
+static void uniphier_fi2c_tx_init(struct uniphier_fi2c_priv *priv, u16 addr)
+{
+       priv->enabled_irqs |= UNIPHIER_FI2C_INT_TE;
+       /* do not use TX byte counter */
+       writel(0, priv->membase + UNIPHIER_FI2C_TBC);
+       /* set slave address */
+       writel(UNIPHIER_FI2C_DTTX_CMD | addr << 1,
+              priv->membase + UNIPHIER_FI2C_DTTX);
+       /* first chunk of data */
+       uniphier_fi2c_fill_txfifo(priv, true);
+}
+
+static void uniphier_fi2c_rx_init(struct uniphier_fi2c_priv *priv, u16 addr)
+{
+       priv->flags |= UNIPHIER_FI2C_RD;
+
+       if (likely(priv->len < 256)) {
+               /*
+                * If possible, use RX byte counter.
+                * It can automatically handle NACK for the last byte.
+                */
+               writel(priv->len, priv->membase + UNIPHIER_FI2C_RBC);
+               priv->enabled_irqs |= UNIPHIER_FI2C_INT_RF |
+                                     UNIPHIER_FI2C_INT_RB;
+       } else {
+               /*
+                * The byte counter can not count over 256.  In this case,
+                * do not use it at all.  Drain data when FIFO gets full,
+                * but treat the last portion as a special case.
+                */
+               writel(0, priv->membase + UNIPHIER_FI2C_RBC);
+               priv->flags |= UNIPHIER_FI2C_MANUAL_NACK;
+               priv->enabled_irqs |= UNIPHIER_FI2C_INT_RF;
+       }
+
+       /* set slave address with RD bit */
+       writel(UNIPHIER_FI2C_DTTX_CMD | UNIPHIER_FI2C_DTTX_RD | addr << 1,
+              priv->membase + UNIPHIER_FI2C_DTTX);
+}
+
+static void uniphier_fi2c_reset(struct uniphier_fi2c_priv *priv)
+{
+       writel(UNIPHIER_FI2C_RST_RST, priv->membase + UNIPHIER_FI2C_RST);
+}
+
+static void uniphier_fi2c_prepare_operation(struct uniphier_fi2c_priv *priv)
+{
+       writel(UNIPHIER_FI2C_BRST_FOEN | UNIPHIER_FI2C_BRST_RSCL,
+              priv->membase + UNIPHIER_FI2C_BRST);
+}
+
+static void uniphier_fi2c_recover(struct uniphier_fi2c_priv *priv)
+{
+       uniphier_fi2c_reset(priv);
+       i2c_recover_bus(&priv->adap);
+}
+
+static int uniphier_fi2c_master_xfer_one(struct i2c_adapter *adap,
+                                        struct i2c_msg *msg, bool stop)
+{
+       struct uniphier_fi2c_priv *priv = i2c_get_adapdata(adap);
+       bool is_read = msg->flags & I2C_M_RD;
+       unsigned long time_left;
+
+       dev_dbg(&adap->dev, "%s: addr=0x%02x, len=%d, stop=%d\n",
+               is_read ? "receive" : "transmit", msg->addr, msg->len, stop);
+
+       priv->len = msg->len;
+       priv->buf = msg->buf;
+       priv->enabled_irqs = UNIPHIER_FI2C_INT_FAULTS;
+       priv->error = 0;
+       priv->flags = 0;
+
+       if (stop)
+               priv->flags |= UNIPHIER_FI2C_STOP;
+
+       reinit_completion(&priv->comp);
+       uniphier_fi2c_clear_irqs(priv);
+       writel(UNIPHIER_FI2C_RST_TBRST | UNIPHIER_FI2C_RST_RBRST,
+              priv->membase + UNIPHIER_FI2C_RST);      /* reset TX/RX FIFO */
+
+       if (is_read)
+               uniphier_fi2c_rx_init(priv, msg->addr);
+       else
+               uniphier_fi2c_tx_init(priv, msg->addr);
+
+       uniphier_fi2c_set_irqs(priv);
+
+       dev_dbg(&adap->dev, "start condition\n");
+       writel(UNIPHIER_FI2C_CR_MST | UNIPHIER_FI2C_CR_STA,
+              priv->membase + UNIPHIER_FI2C_CR);
+
+       time_left = wait_for_completion_timeout(&priv->comp, adap->timeout);
+       if (!time_left) {
+               dev_err(&adap->dev, "transaction timeout.\n");
+               uniphier_fi2c_recover(priv);
+               return -ETIMEDOUT;
+       }
+       dev_dbg(&adap->dev, "complete\n");
+
+       if (unlikely(priv->flags & UNIPHIER_FI2C_DEFER_STOP_COMP)) {
+               u32 status = readl(priv->membase + UNIPHIER_FI2C_SR);
+
+               if (!(status & UNIPHIER_FI2C_SR_STS) ||
+                   status & UNIPHIER_FI2C_SR_BB) {
+                       dev_err(&adap->dev,
+                               "stop condition was not completed.\n");
+                       uniphier_fi2c_recover(priv);
+                       return -EBUSY;
+               }
+       }
+
+       return priv->error;
+}
+
+static int uniphier_fi2c_check_bus_busy(struct i2c_adapter *adap)
+{
+       struct uniphier_fi2c_priv *priv = i2c_get_adapdata(adap);
+
+       if (readl(priv->membase + UNIPHIER_FI2C_SR) & UNIPHIER_FI2C_SR_DB) {
+               if (priv->busy_cnt++ > 3) {
+                       /*
+                        * If bus busy continues too long, it is probably
+                        * in a wrong state.  Try bus recovery.
+                        */
+                       uniphier_fi2c_recover(priv);
+                       priv->busy_cnt = 0;
+               }
+
+               return -EAGAIN;
+       }
+
+       priv->busy_cnt = 0;
+       return 0;
+}
+
+static int uniphier_fi2c_master_xfer(struct i2c_adapter *adap,
+                                    struct i2c_msg *msgs, int num)
+{
+       struct i2c_msg *msg, *emsg = msgs + num;
+       int ret;
+
+       ret = uniphier_fi2c_check_bus_busy(adap);
+       if (ret)
+               return ret;
+
+       for (msg = msgs; msg < emsg; msg++) {
+               /* If next message is read, skip the stop condition */
+               bool stop = !(msg + 1 < emsg && msg[1].flags & I2C_M_RD);
+               /* but, force it if I2C_M_STOP is set */
+               if (msg->flags & I2C_M_STOP)
+                       stop = true;
+
+               ret = uniphier_fi2c_master_xfer_one(adap, msg, stop);
+               if (ret)
+                       return ret;
+       }
+
+       return num;
+}
+
+static u32 uniphier_fi2c_functionality(struct i2c_adapter *adap)
+{
+       return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL;
+}
+
+static const struct i2c_algorithm uniphier_fi2c_algo = {
+       .master_xfer = uniphier_fi2c_master_xfer,
+       .functionality = uniphier_fi2c_functionality,
+};
+
+static int uniphier_fi2c_get_scl(struct i2c_adapter *adap)
+{
+       struct uniphier_fi2c_priv *priv = i2c_get_adapdata(adap);
+
+       return !!(readl(priv->membase + UNIPHIER_FI2C_BM) &
+                                                       UNIPHIER_FI2C_BM_SCLS);
+}
+
+static void uniphier_fi2c_set_scl(struct i2c_adapter *adap, int val)
+{
+       struct uniphier_fi2c_priv *priv = i2c_get_adapdata(adap);
+
+       writel(val ? UNIPHIER_FI2C_BRST_RSCL : 0,
+              priv->membase + UNIPHIER_FI2C_BRST);
+}
+
+static int uniphier_fi2c_get_sda(struct i2c_adapter *adap)
+{
+       struct uniphier_fi2c_priv *priv = i2c_get_adapdata(adap);
+
+       return !!(readl(priv->membase + UNIPHIER_FI2C_BM) &
+                                                       UNIPHIER_FI2C_BM_SDAS);
+}
+
+static void uniphier_fi2c_unprepare_recovery(struct i2c_adapter *adap)
+{
+       uniphier_fi2c_prepare_operation(i2c_get_adapdata(adap));
+}
+
+static struct i2c_bus_recovery_info uniphier_fi2c_bus_recovery_info = {
+       .recover_bus = i2c_generic_scl_recovery,
+       .get_scl = uniphier_fi2c_get_scl,
+       .set_scl = uniphier_fi2c_set_scl,
+       .get_sda = uniphier_fi2c_get_sda,
+       .unprepare_recovery = uniphier_fi2c_unprepare_recovery,
+};
+
+static int uniphier_fi2c_clk_init(struct device *dev,
+                                 struct uniphier_fi2c_priv *priv)
+{
+       struct device_node *np = dev->of_node;
+       unsigned long clk_rate;
+       u32 bus_speed, clk_count;
+       int ret;
+
+       if (of_property_read_u32(np, "clock-frequency", &bus_speed))
+               bus_speed = UNIPHIER_FI2C_DEFAULT_SPEED;
+
+       if (bus_speed > UNIPHIER_FI2C_MAX_SPEED)
+               bus_speed = UNIPHIER_FI2C_MAX_SPEED;
+
+       /* Get input clk rate through clk driver */
+       priv->clk = devm_clk_get(dev, NULL);
+       if (IS_ERR(priv->clk)) {
+               dev_err(dev, "failed to get clock\n");
+               return PTR_ERR(priv->clk);
+       }
+
+       ret = clk_prepare_enable(priv->clk);
+       if (ret)
+               return ret;
+
+       clk_rate = clk_get_rate(priv->clk);
+
+       uniphier_fi2c_reset(priv);
+
+       clk_count = clk_rate / bus_speed;
+
+       writel(clk_count, priv->membase + UNIPHIER_FI2C_CYC);
+       writel(clk_count / 2, priv->membase + UNIPHIER_FI2C_LCTL);
+       writel(clk_count / 2, priv->membase + UNIPHIER_FI2C_SSUT);
+       writel(clk_count / 16, priv->membase + UNIPHIER_FI2C_DSUT);
+
+       uniphier_fi2c_prepare_operation(priv);
+
+       return 0;
+}
+
+static int uniphier_fi2c_probe(struct platform_device *pdev)
+{
+       struct device *dev = &pdev->dev;
+       struct uniphier_fi2c_priv *priv;
+       struct resource *regs;
+       int irq;
+       int ret;
+
+       priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
+       if (!priv)
+               return -ENOMEM;
+
+       regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+       priv->membase = devm_ioremap_resource(dev, regs);
+       if (IS_ERR(priv->membase))
+               return PTR_ERR(priv->membase);
+
+       irq = platform_get_irq(pdev, 0);
+       if (irq < 0) {
+               dev_err(dev, "failed to get IRQ number");
+               return irq;
+       }
+
+       init_completion(&priv->comp);
+       priv->adap.owner = THIS_MODULE;
+       priv->adap.algo = &uniphier_fi2c_algo;
+       priv->adap.dev.parent = dev;
+       priv->adap.dev.of_node = dev->of_node;
+       strlcpy(priv->adap.name, "UniPhier FI2C", sizeof(priv->adap.name));
+       priv->adap.bus_recovery_info = &uniphier_fi2c_bus_recovery_info;
+       i2c_set_adapdata(&priv->adap, priv);
+       platform_set_drvdata(pdev, priv);
+
+       ret = uniphier_fi2c_clk_init(dev, priv);
+       if (ret)
+               return ret;
+
+       ret = devm_request_irq(dev, irq, uniphier_fi2c_interrupt, 0,
+                              pdev->name, priv);
+       if (ret) {
+               dev_err(dev, "failed to request irq %d\n", irq);
+               goto err;
+       }
+
+       ret = i2c_add_adapter(&priv->adap);
+       if (ret) {
+               dev_err(dev, "failed to add I2C adapter\n");
+               goto err;
+       }
+
+err:
+       if (ret)
+               clk_disable_unprepare(priv->clk);
+
+       return ret;
+}
+
+static int uniphier_fi2c_remove(struct platform_device *pdev)
+{
+       struct uniphier_fi2c_priv *priv = platform_get_drvdata(pdev);
+
+       i2c_del_adapter(&priv->adap);
+       clk_disable_unprepare(priv->clk);
+
+       return 0;
+}
+
+static const struct of_device_id uniphier_fi2c_match[] = {
+       { .compatible = "socionext,uniphier-fi2c" },
+       { /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, uniphier_fi2c_match);
+
+static struct platform_driver uniphier_fi2c_drv = {
+       .probe  = uniphier_fi2c_probe,
+       .remove = uniphier_fi2c_remove,
+       .driver = {
+               .name  = "uniphier-fi2c",
+               .of_match_table = uniphier_fi2c_match,
+       },
+};
+module_platform_driver(uniphier_fi2c_drv);
+
+MODULE_AUTHOR("Masahiro Yamada <yamada.masahiro@socionext.com>");
+MODULE_DESCRIPTION("UniPhier FIFO-builtin I2C bus driver");
+MODULE_LICENSE("GPL");
diff --git a/drivers/i2c/busses/i2c-uniphier.c b/drivers/i2c/busses/i2c-uniphier.c
new file mode 100644 (file)
index 0000000..e3c3861
--- /dev/null
@@ -0,0 +1,441 @@
+/*
+ * Copyright (C) 2015 Masahiro Yamada <yamada.masahiro@socionext.com>
+ *
+ * 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; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include <linux/clk.h>
+#include <linux/i2c.h>
+#include <linux/interrupt.h>
+#include <linux/io.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
+
+#define UNIPHIER_I2C_DTRM      0x00    /* TX register */
+#define     UNIPHIER_I2C_DTRM_IRQEN    BIT(11) /* enable interrupt */
+#define     UNIPHIER_I2C_DTRM_STA      BIT(10) /* start condition */
+#define     UNIPHIER_I2C_DTRM_STO      BIT(9)  /* stop condition */
+#define     UNIPHIER_I2C_DTRM_NACK     BIT(8)  /* do not return ACK */
+#define     UNIPHIER_I2C_DTRM_RD       BIT(0)  /* read transaction */
+#define UNIPHIER_I2C_DREC      0x04    /* RX register */
+#define     UNIPHIER_I2C_DREC_MST      BIT(14) /* 1 = master, 0 = slave */
+#define     UNIPHIER_I2C_DREC_TX       BIT(13) /* 1 = transmit, 0 = receive */
+#define     UNIPHIER_I2C_DREC_STS      BIT(12) /* stop condition detected */
+#define     UNIPHIER_I2C_DREC_LRB      BIT(11) /* no ACK */
+#define     UNIPHIER_I2C_DREC_LAB      BIT(9)  /* arbitration lost */
+#define     UNIPHIER_I2C_DREC_BBN      BIT(8)  /* bus not busy */
+#define UNIPHIER_I2C_MYAD      0x08    /* slave address */
+#define UNIPHIER_I2C_CLK       0x0c    /* clock frequency control */
+#define UNIPHIER_I2C_BRST      0x10    /* bus reset */
+#define     UNIPHIER_I2C_BRST_FOEN     BIT(1)  /* normal operation */
+#define     UNIPHIER_I2C_BRST_RSCL     BIT(0)  /* release SCL */
+#define UNIPHIER_I2C_HOLD      0x14    /* hold time control */
+#define UNIPHIER_I2C_BSTS      0x18    /* bus status monitor */
+#define     UNIPHIER_I2C_BSTS_SDA      BIT(1)  /* readback of SDA line */
+#define     UNIPHIER_I2C_BSTS_SCL      BIT(0)  /* readback of SCL line */
+#define UNIPHIER_I2C_NOISE     0x1c    /* noise filter control */
+#define UNIPHIER_I2C_SETUP     0x20    /* setup time control */
+
+#define UNIPHIER_I2C_DEFAULT_SPEED     100000
+#define UNIPHIER_I2C_MAX_SPEED         400000
+
+struct uniphier_i2c_priv {
+       struct completion comp;
+       struct i2c_adapter adap;
+       void __iomem *membase;
+       struct clk *clk;
+       unsigned int busy_cnt;
+};
+
+static irqreturn_t uniphier_i2c_interrupt(int irq, void *dev_id)
+{
+       struct uniphier_i2c_priv *priv = dev_id;
+
+       /*
+        * This hardware uses edge triggered interrupt.  Do not touch the
+        * hardware registers in this handler to make sure to catch the next
+        * interrupt edge.  Just send a complete signal and return.
+        */
+       complete(&priv->comp);
+
+       return IRQ_HANDLED;
+}
+
+static int uniphier_i2c_xfer_byte(struct i2c_adapter *adap, u32 txdata,
+                                 u32 *rxdatap)
+{
+       struct uniphier_i2c_priv *priv = i2c_get_adapdata(adap);
+       unsigned long time_left;
+       u32 rxdata;
+
+       reinit_completion(&priv->comp);
+
+       txdata |= UNIPHIER_I2C_DTRM_IRQEN;
+       dev_dbg(&adap->dev, "write data: 0x%04x\n", txdata);
+       writel(txdata, priv->membase + UNIPHIER_I2C_DTRM);
+
+       time_left = wait_for_completion_timeout(&priv->comp, adap->timeout);
+       if (unlikely(!time_left)) {
+               dev_err(&adap->dev, "transaction timeout\n");
+               return -ETIMEDOUT;
+       }
+
+       rxdata = readl(priv->membase + UNIPHIER_I2C_DREC);
+       dev_dbg(&adap->dev, "read data: 0x%04x\n", rxdata);
+
+       if (rxdatap)
+               *rxdatap = rxdata;
+
+       return 0;
+}
+
+static int uniphier_i2c_send_byte(struct i2c_adapter *adap, u32 txdata)
+{
+       u32 rxdata;
+       int ret;
+
+       ret = uniphier_i2c_xfer_byte(adap, txdata, &rxdata);
+       if (ret)
+               return ret;
+
+       if (unlikely(rxdata & UNIPHIER_I2C_DREC_LAB)) {
+               dev_dbg(&adap->dev, "arbitration lost\n");
+               return -EAGAIN;
+       }
+       if (unlikely(rxdata & UNIPHIER_I2C_DREC_LRB)) {
+               dev_dbg(&adap->dev, "could not get ACK\n");
+               return -ENXIO;
+       }
+
+       return 0;
+}
+
+static int uniphier_i2c_tx(struct i2c_adapter *adap, u16 addr, u16 len,
+                          const u8 *buf)
+{
+       int ret;
+
+       dev_dbg(&adap->dev, "start condition\n");
+       ret = uniphier_i2c_send_byte(adap, addr << 1 |
+                                    UNIPHIER_I2C_DTRM_STA |
+                                    UNIPHIER_I2C_DTRM_NACK);
+       if (ret)
+               return ret;
+
+       while (len--) {
+               ret = uniphier_i2c_send_byte(adap,
+                                            UNIPHIER_I2C_DTRM_NACK | *buf++);
+               if (ret)
+                       return ret;
+       }
+
+       return 0;
+}
+
+static int uniphier_i2c_rx(struct i2c_adapter *adap, u16 addr, u16 len,
+                          u8 *buf)
+{
+       int ret;
+
+       dev_dbg(&adap->dev, "start condition\n");
+       ret = uniphier_i2c_send_byte(adap, addr << 1 |
+                                    UNIPHIER_I2C_DTRM_STA |
+                                    UNIPHIER_I2C_DTRM_NACK |
+                                    UNIPHIER_I2C_DTRM_RD);
+       if (ret)
+               return ret;
+
+       while (len--) {
+               u32 rxdata;
+
+               ret = uniphier_i2c_xfer_byte(adap,
+                                            len ? 0 : UNIPHIER_I2C_DTRM_NACK,
+                                            &rxdata);
+               if (ret)
+                       return ret;
+               *buf++ = rxdata;
+       }
+
+       return 0;
+}
+
+static int uniphier_i2c_stop(struct i2c_adapter *adap)
+{
+       dev_dbg(&adap->dev, "stop condition\n");
+       return uniphier_i2c_send_byte(adap, UNIPHIER_I2C_DTRM_STO |
+                                     UNIPHIER_I2C_DTRM_NACK);
+}
+
+static int uniphier_i2c_master_xfer_one(struct i2c_adapter *adap,
+                                       struct i2c_msg *msg, bool stop)
+{
+       bool is_read = msg->flags & I2C_M_RD;
+       bool recovery = false;
+       int ret;
+
+       dev_dbg(&adap->dev, "%s: addr=0x%02x, len=%d, stop=%d\n",
+               is_read ? "receive" : "transmit", msg->addr, msg->len, stop);
+
+       if (is_read)
+               ret = uniphier_i2c_rx(adap, msg->addr, msg->len, msg->buf);
+       else
+               ret = uniphier_i2c_tx(adap, msg->addr, msg->len, msg->buf);
+
+       if (ret == -EAGAIN) /* could not acquire bus. bail out without STOP */
+               return ret;
+
+       if (ret == -ETIMEDOUT) {
+               /* This error is fatal.  Needs recovery. */
+               stop = false;
+               recovery = true;
+       }
+
+       if (stop) {
+               int ret2 = uniphier_i2c_stop(adap);
+
+               if (ret2) {
+                       /* Failed to issue STOP.  The bus needs recovery. */
+                       recovery = true;
+                       ret = ret ?: ret2;
+               }
+       }
+
+       if (recovery)
+               i2c_recover_bus(adap);
+
+       return ret;
+}
+
+static int uniphier_i2c_check_bus_busy(struct i2c_adapter *adap)
+{
+       struct uniphier_i2c_priv *priv = i2c_get_adapdata(adap);
+
+       if (!(readl(priv->membase + UNIPHIER_I2C_DREC) &
+                                               UNIPHIER_I2C_DREC_BBN)) {
+               if (priv->busy_cnt++ > 3) {
+                       /*
+                        * If bus busy continues too long, it is probably
+                        * in a wrong state.  Try bus recovery.
+                        */
+                       i2c_recover_bus(adap);
+                       priv->busy_cnt = 0;
+               }
+
+               return -EAGAIN;
+       }
+
+       priv->busy_cnt = 0;
+       return 0;
+}
+
+static int uniphier_i2c_master_xfer(struct i2c_adapter *adap,
+                                   struct i2c_msg *msgs, int num)
+{
+       struct i2c_msg *msg, *emsg = msgs + num;
+       int ret;
+
+       ret = uniphier_i2c_check_bus_busy(adap);
+       if (ret)
+               return ret;
+
+       for (msg = msgs; msg < emsg; msg++) {
+               /* If next message is read, skip the stop condition */
+               bool stop = !(msg + 1 < emsg && msg[1].flags & I2C_M_RD);
+               /* but, force it if I2C_M_STOP is set */
+               if (msg->flags & I2C_M_STOP)
+                       stop = true;
+
+               ret = uniphier_i2c_master_xfer_one(adap, msg, stop);
+               if (ret)
+                       return ret;
+       }
+
+       return num;
+}
+
+static u32 uniphier_i2c_functionality(struct i2c_adapter *adap)
+{
+       return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL;
+}
+
+static const struct i2c_algorithm uniphier_i2c_algo = {
+       .master_xfer = uniphier_i2c_master_xfer,
+       .functionality = uniphier_i2c_functionality,
+};
+
+static void uniphier_i2c_reset(struct uniphier_i2c_priv *priv, bool reset_on)
+{
+       u32 val = UNIPHIER_I2C_BRST_RSCL;
+
+       val |= reset_on ? 0 : UNIPHIER_I2C_BRST_FOEN;
+       writel(val, priv->membase + UNIPHIER_I2C_BRST);
+}
+
+static int uniphier_i2c_get_scl(struct i2c_adapter *adap)
+{
+       struct uniphier_i2c_priv *priv = i2c_get_adapdata(adap);
+
+       return !!(readl(priv->membase + UNIPHIER_I2C_BSTS) &
+                                                       UNIPHIER_I2C_BSTS_SCL);
+}
+
+static void uniphier_i2c_set_scl(struct i2c_adapter *adap, int val)
+{
+       struct uniphier_i2c_priv *priv = i2c_get_adapdata(adap);
+
+       writel(val ? UNIPHIER_I2C_BRST_RSCL : 0,
+              priv->membase + UNIPHIER_I2C_BRST);
+}
+
+static int uniphier_i2c_get_sda(struct i2c_adapter *adap)
+{
+       struct uniphier_i2c_priv *priv = i2c_get_adapdata(adap);
+
+       return !!(readl(priv->membase + UNIPHIER_I2C_BSTS) &
+                                                       UNIPHIER_I2C_BSTS_SDA);
+}
+
+static void uniphier_i2c_unprepare_recovery(struct i2c_adapter *adap)
+{
+       uniphier_i2c_reset(i2c_get_adapdata(adap), false);
+}
+
+static struct i2c_bus_recovery_info uniphier_i2c_bus_recovery_info = {
+       .recover_bus = i2c_generic_scl_recovery,
+       .get_scl = uniphier_i2c_get_scl,
+       .set_scl = uniphier_i2c_set_scl,
+       .get_sda = uniphier_i2c_get_sda,
+       .unprepare_recovery = uniphier_i2c_unprepare_recovery,
+};
+
+static int uniphier_i2c_clk_init(struct device *dev,
+                                struct uniphier_i2c_priv *priv)
+{
+       struct device_node *np = dev->of_node;
+       unsigned long clk_rate;
+       u32 bus_speed;
+       int ret;
+
+       if (of_property_read_u32(np, "clock-frequency", &bus_speed))
+               bus_speed = UNIPHIER_I2C_DEFAULT_SPEED;
+
+       if (bus_speed > UNIPHIER_I2C_MAX_SPEED)
+               bus_speed = UNIPHIER_I2C_MAX_SPEED;
+
+       /* Get input clk rate through clk driver */
+       priv->clk = devm_clk_get(dev, NULL);
+       if (IS_ERR(priv->clk)) {
+               dev_err(dev, "failed to get clock\n");
+               return PTR_ERR(priv->clk);
+       }
+
+       ret = clk_prepare_enable(priv->clk);
+       if (ret)
+               return ret;
+
+       clk_rate = clk_get_rate(priv->clk);
+
+       uniphier_i2c_reset(priv, true);
+
+       writel((clk_rate / bus_speed / 2 << 16) | (clk_rate / bus_speed),
+              priv->membase + UNIPHIER_I2C_CLK);
+
+       uniphier_i2c_reset(priv, false);
+
+       return 0;
+}
+
+static int uniphier_i2c_probe(struct platform_device *pdev)
+{
+       struct device *dev = &pdev->dev;
+       struct uniphier_i2c_priv *priv;
+       struct resource *regs;
+       int irq;
+       int ret;
+
+       priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
+       if (!priv)
+               return -ENOMEM;
+
+       regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+       priv->membase = devm_ioremap_resource(dev, regs);
+       if (IS_ERR(priv->membase))
+               return PTR_ERR(priv->membase);
+
+       irq = platform_get_irq(pdev, 0);
+       if (irq < 0) {
+               dev_err(dev, "failed to get IRQ number");
+               return irq;
+       }
+
+       init_completion(&priv->comp);
+       priv->adap.owner = THIS_MODULE;
+       priv->adap.algo = &uniphier_i2c_algo;
+       priv->adap.dev.parent = dev;
+       priv->adap.dev.of_node = dev->of_node;
+       strlcpy(priv->adap.name, "UniPhier I2C", sizeof(priv->adap.name));
+       priv->adap.bus_recovery_info = &uniphier_i2c_bus_recovery_info;
+       i2c_set_adapdata(&priv->adap, priv);
+       platform_set_drvdata(pdev, priv);
+
+       ret = uniphier_i2c_clk_init(dev, priv);
+       if (ret)
+               return ret;
+
+       ret = devm_request_irq(dev, irq, uniphier_i2c_interrupt, 0, pdev->name,
+                              priv);
+       if (ret) {
+               dev_err(dev, "failed to request irq %d\n", irq);
+               goto err;
+       }
+
+       ret = i2c_add_adapter(&priv->adap);
+       if (ret) {
+               dev_err(dev, "failed to add I2C adapter\n");
+               goto err;
+       }
+
+err:
+       if (ret)
+               clk_disable_unprepare(priv->clk);
+
+       return ret;
+}
+
+static int uniphier_i2c_remove(struct platform_device *pdev)
+{
+       struct uniphier_i2c_priv *priv = platform_get_drvdata(pdev);
+
+       i2c_del_adapter(&priv->adap);
+       clk_disable_unprepare(priv->clk);
+
+       return 0;
+}
+
+static const struct of_device_id uniphier_i2c_match[] = {
+       { .compatible = "socionext,uniphier-i2c" },
+       { /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, uniphier_i2c_match);
+
+static struct platform_driver uniphier_i2c_drv = {
+       .probe  = uniphier_i2c_probe,
+       .remove = uniphier_i2c_remove,
+       .driver = {
+               .name  = "uniphier-i2c",
+               .of_match_table = uniphier_i2c_match,
+       },
+};
+module_platform_driver(uniphier_i2c_drv);
+
+MODULE_AUTHOR("Masahiro Yamada <yamada.masahiro@socionext.com>");
+MODULE_DESCRIPTION("UniPhier I2C bus driver");
+MODULE_LICENSE("GPL");
index a59c3111f7fb98df957e19d1fa93faac16322e20..040af5cc8143f1aff2ce8ebaf0143482ddfeee02 100644 (file)
@@ -99,27 +99,40 @@ struct gsb_buffer {
        };
 } __packed;
 
-static int acpi_i2c_add_resource(struct acpi_resource *ares, void *data)
+struct acpi_i2c_lookup {
+       struct i2c_board_info *info;
+       acpi_handle adapter_handle;
+       acpi_handle device_handle;
+};
+
+static int acpi_i2c_find_address(struct acpi_resource *ares, void *data)
 {
-       struct i2c_board_info *info = data;
+       struct acpi_i2c_lookup *lookup = data;
+       struct i2c_board_info *info = lookup->info;
+       struct acpi_resource_i2c_serialbus *sb;
+       acpi_handle adapter_handle;
+       acpi_status status;
 
-       if (ares->type == ACPI_RESOURCE_TYPE_SERIAL_BUS) {
-               struct acpi_resource_i2c_serialbus *sb;
+       if (info->addr || ares->type != ACPI_RESOURCE_TYPE_SERIAL_BUS)
+               return 1;
 
-               sb = &ares->data.i2c_serial_bus;
-               if (!info->addr && sb->type == ACPI_RESOURCE_SERIAL_TYPE_I2C) {
-                       info->addr = sb->slave_address;
-                       if (sb->access_mode == ACPI_I2C_10BIT_MODE)
-                               info->flags |= I2C_CLIENT_TEN;
-               }
-       } else if (!info->irq) {
-               struct resource r;
+       sb = &ares->data.i2c_serial_bus;
+       if (sb->type != ACPI_RESOURCE_SERIAL_TYPE_I2C)
+               return 1;
 
-               if (acpi_dev_resource_interrupt(ares, 0, &r))
-                       info->irq = r.start;
+       /*
+        * Extract the ResourceSource and make sure that the handle matches
+        * with the I2C adapter handle.
+        */
+       status = acpi_get_handle(lookup->device_handle,
+                                sb->resource_source.string_ptr,
+                                &adapter_handle);
+       if (ACPI_SUCCESS(status) && adapter_handle == lookup->adapter_handle) {
+               info->addr = sb->slave_address;
+               if (sb->access_mode == ACPI_I2C_10BIT_MODE)
+                       info->flags |= I2C_CLIENT_TEN;
        }
 
-       /* Tell the ACPI core to skip this resource */
        return 1;
 }
 
@@ -128,6 +141,8 @@ static acpi_status acpi_i2c_add_device(acpi_handle handle, u32 level,
 {
        struct i2c_adapter *adapter = data;
        struct list_head resource_list;
+       struct acpi_i2c_lookup lookup;
+       struct resource_entry *entry;
        struct i2c_board_info info;
        struct acpi_device *adev;
        int ret;
@@ -140,14 +155,37 @@ static acpi_status acpi_i2c_add_device(acpi_handle handle, u32 level,
        memset(&info, 0, sizeof(info));
        info.fwnode = acpi_fwnode_handle(adev);
 
+       memset(&lookup, 0, sizeof(lookup));
+       lookup.adapter_handle = ACPI_HANDLE(&adapter->dev);
+       lookup.device_handle = handle;
+       lookup.info = &info;
+
+       /*
+        * Look up for I2cSerialBus resource with ResourceSource that
+        * matches with this adapter.
+        */
        INIT_LIST_HEAD(&resource_list);
        ret = acpi_dev_get_resources(adev, &resource_list,
-                                    acpi_i2c_add_resource, &info);
+                                    acpi_i2c_find_address, &lookup);
        acpi_dev_free_resource_list(&resource_list);
 
        if (ret < 0 || !info.addr)
                return AE_OK;
 
+       /* Then fill IRQ number if any */
+       ret = acpi_dev_get_resources(adev, &resource_list, NULL, NULL);
+       if (ret < 0)
+               return AE_OK;
+
+       resource_list_for_each_entry(entry, &resource_list) {
+               if (resource_type(entry->res) == IORESOURCE_IRQ) {
+                       info.irq = entry->res->start;
+                       break;
+               }
+       }
+
+       acpi_dev_free_resource_list(&resource_list);
+
        adev->power.flags.ignore_parent = true;
        strlcpy(info.type, dev_name(&adev->dev), sizeof(info.type));
        if (!i2c_new_device(adapter, &info)) {
@@ -160,6 +198,8 @@ static acpi_status acpi_i2c_add_device(acpi_handle handle, u32 level,
        return AE_OK;
 }
 
+#define ACPI_I2C_MAX_SCAN_DEPTH 32
+
 /**
  * acpi_i2c_register_devices - enumerate I2C slave devices behind adapter
  * @adap: pointer to adapter
@@ -170,17 +210,13 @@ static acpi_status acpi_i2c_add_device(acpi_handle handle, u32 level,
  */
 static void acpi_i2c_register_devices(struct i2c_adapter *adap)
 {
-       acpi_handle handle;
        acpi_status status;
 
-       if (!adap->dev.parent)
-               return;
-
-       handle = ACPI_HANDLE(adap->dev.parent);
-       if (!handle)
+       if (!has_acpi_companion(&adap->dev))
                return;
 
-       status = acpi_walk_namespace(ACPI_TYPE_DEVICE, handle, 1,
+       status = acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
+                                    ACPI_I2C_MAX_SCAN_DEPTH,
                                     acpi_i2c_add_device, NULL,
                                     adap, NULL);
        if (ACPI_FAILURE(status))
index 71c7a3975b6287927c4bb666f433cf2787e20a54..2413ec9f8207eeffcfbeeb5480043e4651fdf15a 100644 (file)
@@ -235,7 +235,7 @@ static int i2cdev_check_addr(struct i2c_adapter *adapter, unsigned int addr)
        return result;
 }
 
-static noinline int i2cdev_ioctl_rdrw(struct i2c_client *client,
+static noinline int i2cdev_ioctl_rdwr(struct i2c_client *client,
                unsigned long arg)
 {
        struct i2c_rdwr_ioctl_data rdwr_arg;
@@ -250,7 +250,7 @@ static noinline int i2cdev_ioctl_rdrw(struct i2c_client *client,
 
        /* Put an arbitrary limit on the number of messages that can
         * be sent at once */
-       if (rdwr_arg.nmsgs > I2C_RDRW_IOCTL_MAX_MSGS)
+       if (rdwr_arg.nmsgs > I2C_RDWR_IOCTL_MAX_MSGS)
                return -EINVAL;
 
        rdwr_pa = memdup_user(rdwr_arg.msgs,
@@ -421,16 +421,6 @@ static long i2cdev_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
        switch (cmd) {
        case I2C_SLAVE:
        case I2C_SLAVE_FORCE:
-               /* NOTE:  devices set up to work with "new style" drivers
-                * can't use I2C_SLAVE, even when the device node is not
-                * bound to a driver.  Only I2C_SLAVE_FORCE will work.
-                *
-                * Setting the PEC flag here won't affect kernel drivers,
-                * which will be using the i2c_client node registered with
-                * the driver model core.  Likewise, when that client has
-                * the PEC flag already set, the i2c-dev driver won't see
-                * (or use) this setting.
-                */
                if ((arg > 0x3ff) ||
                    (((client->flags & I2C_M_TEN) == 0) && arg > 0x7f))
                        return -EINVAL;
@@ -446,6 +436,13 @@ static long i2cdev_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
                        client->flags &= ~I2C_M_TEN;
                return 0;
        case I2C_PEC:
+               /*
+                * Setting the PEC flag here won't affect kernel drivers,
+                * which will be using the i2c_client node registered with
+                * the driver model core.  Likewise, when that client has
+                * the PEC flag already set, the i2c-dev driver won't see
+                * (or use) this setting.
+                */
                if (arg)
                        client->flags |= I2C_CLIENT_PEC;
                else
@@ -456,7 +453,7 @@ static long i2cdev_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
                return put_user(funcs, (unsigned long __user *)arg);
 
        case I2C_RDWR:
-               return i2cdev_ioctl_rdrw(client, arg);
+               return i2cdev_ioctl_rdwr(client, arg);
 
        case I2C_SMBUS:
                return i2cdev_ioctl_smbus(client, arg);
index 2ba7c0fbc6150b46835dffdae06de3cd5f8617d1..00fc5b1c7b66bb20f6ab1a54e6add6875f546c48 100644 (file)
@@ -25,6 +25,7 @@
 #include <linux/i2c.h>
 #include <linux/i2c-mux.h>
 #include <linux/of.h>
+#include <linux/acpi.h>
 
 /* multiplexer per channel data */
 struct i2c_mux_priv {
@@ -173,6 +174,13 @@ struct i2c_adapter *i2c_add_mux_adapter(struct i2c_adapter *parent,
                }
        }
 
+       /*
+        * Associate the mux channel with an ACPI node.
+        */
+       if (has_acpi_companion(mux_dev))
+               acpi_preset_companion(&priv->adap.dev, ACPI_COMPANION(mux_dev),
+                                     chan_id);
+
        if (force_nr) {
                priv->adap.nr = force_nr;
                ret = i2c_add_numbered_adapter(&priv->adap);
index 64a888a5e9b3d4ba41901843b557092e725f0717..7ba64c87ba1c10306c9b96d132f0d2f869a628da 100644 (file)
@@ -803,7 +803,7 @@ static int rrpc_submit_io(struct rrpc *rrpc, struct bio *bio,
        return NVM_IO_OK;
 }
 
-static void rrpc_make_rq(struct request_queue *q, struct bio *bio)
+static blk_qc_t rrpc_make_rq(struct request_queue *q, struct bio *bio)
 {
        struct rrpc *rrpc = q->queuedata;
        struct nvm_rq *rqd;
@@ -811,21 +811,21 @@ static void rrpc_make_rq(struct request_queue *q, struct bio *bio)
 
        if (bio->bi_rw & REQ_DISCARD) {
                rrpc_discard(rrpc, bio);
-               return;
+               return BLK_QC_T_NONE;
        }
 
        rqd = mempool_alloc(rrpc->rq_pool, GFP_KERNEL);
        if (!rqd) {
                pr_err_ratelimited("rrpc: not able to queue bio.");
                bio_io_error(bio);
-               return;
+               return BLK_QC_T_NONE;
        }
        memset(rqd, 0, sizeof(struct nvm_rq));
 
        err = rrpc_submit_io(rrpc, bio, rqd, NVM_IOTYPE_NONE);
        switch (err) {
        case NVM_IO_OK:
-               return;
+               return BLK_QC_T_NONE;
        case NVM_IO_ERR:
                bio_io_error(bio);
                break;
@@ -841,6 +841,7 @@ static void rrpc_make_rq(struct request_queue *q, struct bio *bio)
        }
 
        mempool_free(rqd, rrpc->rq_pool);
+       return BLK_QC_T_NONE;
 }
 
 static void rrpc_requeue(struct work_struct *work)
index 3e01e6fb342468269eccf6ef71032a625087913c..7913fdcfc8496bdd7c719a8c3334f6136c74eced 100644 (file)
@@ -123,6 +123,7 @@ config MD_RAID456
        tristate "RAID-4/RAID-5/RAID-6 mode"
        depends on BLK_DEV_MD
        select RAID6_PQ
+       select LIBCRC32C
        select ASYNC_MEMCPY
        select ASYNC_XOR
        select ASYNC_PQ
index 8e9877b046371f89e4b0e35f312f25e476e674b2..25fa8445bb2422ba29f745aa2c0b68e37b3ec326 100644 (file)
@@ -958,7 +958,8 @@ static void cached_dev_nodata(struct closure *cl)
 
 /* Cached devices - read & write stuff */
 
-static void cached_dev_make_request(struct request_queue *q, struct bio *bio)
+static blk_qc_t cached_dev_make_request(struct request_queue *q,
+                                       struct bio *bio)
 {
        struct search *s;
        struct bcache_device *d = bio->bi_bdev->bd_disk->private_data;
@@ -997,6 +998,8 @@ static void cached_dev_make_request(struct request_queue *q, struct bio *bio)
                else
                        generic_make_request(bio);
        }
+
+       return BLK_QC_T_NONE;
 }
 
 static int cached_dev_ioctl(struct bcache_device *d, fmode_t mode,
@@ -1070,7 +1073,8 @@ static void flash_dev_nodata(struct closure *cl)
        continue_at(cl, search_free, NULL);
 }
 
-static void flash_dev_make_request(struct request_queue *q, struct bio *bio)
+static blk_qc_t flash_dev_make_request(struct request_queue *q,
+                                            struct bio *bio)
 {
        struct search *s;
        struct closure *cl;
@@ -1093,7 +1097,7 @@ static void flash_dev_make_request(struct request_queue *q, struct bio *bio)
                continue_at_nobarrier(&s->cl,
                                      flash_dev_nodata,
                                      bcache_wq);
-               return;
+               return BLK_QC_T_NONE;
        } else if (rw) {
                bch_keybuf_check_overlapping(&s->iop.c->moving_gc_keys,
                                        &KEY(d->id, bio->bi_iter.bi_sector, 0),
@@ -1109,6 +1113,7 @@ static void flash_dev_make_request(struct request_queue *q, struct bio *bio)
        }
 
        continue_at(cl, search_free, NULL);
+       return BLK_QC_T_NONE;
 }
 
 static int flash_dev_ioctl(struct bcache_device *d, fmode_t mode,
index 32440ad5f6844a7eeef767aed2be4c7727fc036a..6e15f3565892fce8315cef992e0b2721e8c20088 100644 (file)
@@ -1755,7 +1755,7 @@ static void __split_and_process_bio(struct mapped_device *md,
  * The request function that just remaps the bio built up by
  * dm_merge_bvec.
  */
-static void dm_make_request(struct request_queue *q, struct bio *bio)
+static blk_qc_t dm_make_request(struct request_queue *q, struct bio *bio)
 {
        int rw = bio_data_dir(bio);
        struct mapped_device *md = q->queuedata;
@@ -1774,12 +1774,12 @@ static void dm_make_request(struct request_queue *q, struct bio *bio)
                        queue_io(md, bio);
                else
                        bio_io_error(bio);
-               return;
+               return BLK_QC_T_NONE;
        }
 
        __split_and_process_bio(md, map, bio);
        dm_put_live_table(md, srcu_idx);
-       return;
+       return BLK_QC_T_NONE;
 }
 
 int dm_request_based(struct mapped_device *md)
index 3f9a514b5b9d78c9c6f5f0e57e143e60c8c685ad..807095f4c793bb4f1d4119f81abf2653b83240cb 100644 (file)
@@ -250,7 +250,7 @@ static DEFINE_SPINLOCK(all_mddevs_lock);
  * call has finished, the bio has been linked into some internal structure
  * and so is visible to ->quiesce(), so we don't need the refcount any more.
  */
-static void md_make_request(struct request_queue *q, struct bio *bio)
+static blk_qc_t md_make_request(struct request_queue *q, struct bio *bio)
 {
        const int rw = bio_data_dir(bio);
        struct mddev *mddev = q->queuedata;
@@ -262,13 +262,13 @@ static void md_make_request(struct request_queue *q, struct bio *bio)
        if (mddev == NULL || mddev->pers == NULL
            || !mddev->ready) {
                bio_io_error(bio);
-               return;
+               return BLK_QC_T_NONE;
        }
        if (mddev->ro == 1 && unlikely(rw == WRITE)) {
                if (bio_sectors(bio) != 0)
                        bio->bi_error = -EROFS;
                bio_endio(bio);
-               return;
+               return BLK_QC_T_NONE;
        }
        smp_rmb(); /* Ensure implications of  'active' are visible */
        rcu_read_lock();
@@ -302,6 +302,8 @@ static void md_make_request(struct request_queue *q, struct bio *bio)
 
        if (atomic_dec_and_test(&mddev->active_io) && mddev->suspended)
                wake_up(&mddev->sb_wait);
+
+       return BLK_QC_T_NONE;
 }
 
 /* mddev_suspend makes sure no new requests are submitted
index b2ef6072fbf41193d636ff88415ee033e42021aa..ff57195b4e37ef98a399f6bb2ad1d98c8f2cdcdf 100644 (file)
@@ -118,7 +118,8 @@ static int pl172_setup_static(struct amba_device *adev,
        if (of_property_read_bool(np, "mpmc,extended-wait"))
                cfg |= MPMC_STATIC_CFG_EW;
 
-       if (of_property_read_bool(np, "mpmc,buffer-enable"))
+       if (amba_part(adev) == 0x172 &&
+           of_property_read_bool(np, "mpmc,buffer-enable"))
                cfg |= MPMC_STATIC_CFG_B;
 
        if (of_property_read_bool(np, "mpmc,write-protect"))
@@ -190,6 +191,8 @@ static int pl172_parse_cs_config(struct amba_device *adev,
 }
 
 static const char * const pl172_revisions[] = {"r1", "r2", "r2p3", "r2p4"};
+static const char * const pl175_revisions[] = {"r1"};
+static const char * const pl176_revisions[] = {"r0"};
 
 static int pl172_probe(struct amba_device *adev, const struct amba_id *id)
 {
@@ -202,6 +205,12 @@ static int pl172_probe(struct amba_device *adev, const struct amba_id *id)
        if (amba_part(adev) == 0x172) {
                if (amba_rev(adev) < ARRAY_SIZE(pl172_revisions))
                        rev = pl172_revisions[amba_rev(adev)];
+       } else if (amba_part(adev) == 0x175) {
+               if (amba_rev(adev) < ARRAY_SIZE(pl175_revisions))
+                       rev = pl175_revisions[amba_rev(adev)];
+       } else if (amba_part(adev) == 0x176) {
+               if (amba_rev(adev) < ARRAY_SIZE(pl176_revisions))
+                       rev = pl176_revisions[amba_rev(adev)];
        }
 
        dev_info(dev, "ARM PL%x revision %s\n", amba_part(adev), rev);
@@ -278,9 +287,20 @@ static int pl172_remove(struct amba_device *adev)
 }
 
 static const struct amba_id pl172_ids[] = {
+       /*  PrimeCell MPMC PL172, EMC found on NXP LPC18xx and LPC43xx */
        {
-               .id     = 0x07341172,
-               .mask   = 0xffffffff,
+               .id     = 0x07041172,
+               .mask   = 0x3f0fffff,
+       },
+       /* PrimeCell MPMC PL175, EMC found on NXP LPC32xx */
+       {
+               .id     = 0x07041175,
+               .mask   = 0x3f0fffff,
+       },
+       /* PrimeCell MPMC PL176 */
+       {
+               .id     = 0x89041176,
+               .mask   = 0xff0fffff,
        },
        { 0, 0 },
 };
index 0ca05c3ec8d68ac78d5268b8accca776647d12c0..ac24a4bd63f755d2aa08e9fa2310072d0c65b719 100644 (file)
@@ -125,6 +125,10 @@ static int __init tc_probe(struct platform_device *pdev)
        if (IS_ERR(clk))
                return PTR_ERR(clk);
 
+       tc->slow_clk = devm_clk_get(&pdev->dev, "slow_clk");
+       if (IS_ERR(tc->slow_clk))
+               return PTR_ERR(tc->slow_clk);
+
        r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        tc->regs = devm_ioremap_resource(&pdev->dev, r);
        if (IS_ERR(tc->regs))
index 68eea5befaf12c96db4063a32ab81c20a8abfd96..c1aaf0336cf2e389386b4a6f7c87a8609652b474 100644 (file)
@@ -1209,9 +1209,7 @@ static void destroy_ai(struct ubi_attach_info *ai)
                }
        }
 
-       if (ai->aeb_slab_cache)
-               kmem_cache_destroy(ai->aeb_slab_cache);
-
+       kmem_cache_destroy(ai->aeb_slab_cache);
        kfree(ai);
 }
 
index d16fccf791791356b864dac759b654a20c7e6640..54e056d3be0250910f464732bacc13bfd7eee50b 100644 (file)
@@ -949,7 +949,7 @@ static long ubi_cdev_ioctl(struct file *file, unsigned int cmd,
                if (!req) {
                        err = -ENOMEM;
                        break;
-               };
+               }
 
                err = copy_from_user(req, argp, sizeof(struct ubi_rnvol_req));
                if (err) {
index 51bca035cd83c5b60d8912d22f358984f13abe1f..5b9834cf2820f184577345b74993868149bdc985 100644 (file)
@@ -1358,7 +1358,7 @@ int self_check_eba(struct ubi_device *ubi, struct ubi_attach_info *ai_fastmap,
                                        continue;
 
                                ubi_err(ubi, "LEB:%i:%i is PEB:%i instead of %i!",
-                                       vol->vol_id, i, fm_eba[i][j],
+                                       vol->vol_id, j, fm_eba[i][j],
                                        scan_eba[i][j]);
                                ubi_assert(0);
                        }
index b2a665398bcaf41225f6a9cbe858e8df209c3b89..30d3999dddbae93a6fd362c3bcd8fa40e0e6c8f1 100644 (file)
@@ -171,6 +171,30 @@ void ubi_refill_pools(struct ubi_device *ubi)
        spin_unlock(&ubi->wl_lock);
 }
 
+/**
+ * produce_free_peb - produce a free physical eraseblock.
+ * @ubi: UBI device description object
+ *
+ * This function tries to make a free PEB by means of synchronous execution of
+ * pending works. This may be needed if, for example the background thread is
+ * disabled. Returns zero in case of success and a negative error code in case
+ * of failure.
+ */
+static int produce_free_peb(struct ubi_device *ubi)
+{
+       int err;
+
+       while (!ubi->free.rb_node && ubi->works_count) {
+               dbg_wl("do one work synchronously");
+               err = do_work(ubi);
+
+               if (err)
+                       return err;
+       }
+
+       return 0;
+}
+
 /**
  * ubi_wl_get_peb - get a physical eraseblock.
  * @ubi: UBI device description object
@@ -213,6 +237,11 @@ again:
                }
                retried = 1;
                up_read(&ubi->fm_eba_sem);
+               ret = produce_free_peb(ubi);
+               if (ret < 0) {
+                       down_read(&ubi->fm_eba_sem);
+                       goto out;
+               }
                goto again;
        }
 
index 4aa2fd8633e769b0ae6b09ecf3e267031a00c1f3..263b439e21a88fc1df3e21f3e2eb4a0da43b8d1f 100644 (file)
@@ -450,7 +450,7 @@ static void unmap_peb(struct ubi_attach_info *ai, int pnum)
  * < 0 indicates an internal error.
  */
 static int scan_pool(struct ubi_device *ubi, struct ubi_attach_info *ai,
-                    int *pebs, int pool_size, unsigned long long *max_sqnum,
+                    __be32 *pebs, int pool_size, unsigned long long *max_sqnum,
                     struct list_head *free)
 {
        struct ubi_vid_hdr *vh;
@@ -775,7 +775,7 @@ static int ubi_attach_fastmap(struct ubi_device *ubi,
                for (j = 0; j < be32_to_cpu(fm_eba->reserved_pebs); j++) {
                        int pnum = be32_to_cpu(fm_eba->pnum[j]);
 
-                       if ((int)be32_to_cpu(fm_eba->pnum[j]) < 0)
+                       if (pnum < 0)
                                continue;
 
                        aeb = NULL;
index d0d072e7ccd2f78fa1ee6df63934308bffe43177..22ed3f627506c4e2b4daee328b97fa8dbfce3896 100644 (file)
@@ -500,7 +500,7 @@ struct ubi_fm_volhdr {
 /* struct ubi_fm_volhdr is followed by one struct ubi_fm_eba records */
 
 /**
- * struct ubi_fm_eba - denotes an association beween a PEB and LEB
+ * struct ubi_fm_eba - denotes an association between a PEB and LEB
  * @magic: EBA table magic number
  * @reserved_pebs: number of table entries
  * @pnum: PEB number of LEB (LEB is the index)
index b4351caf8e013dbe15fcaf7402e8c9dbaeee9abb..9e0f8a7ef8b1695e0b79c8324e6adfe2e0ed9f4e 100644 (file)
@@ -1749,6 +1749,7 @@ err_undo_flags:
                                            slave_dev->dev_addr))
                        eth_hw_addr_random(bond_dev);
                if (bond_dev->type != ARPHRD_ETHER) {
+                       dev_close(bond_dev);
                        ether_setup(bond_dev);
                        bond_dev->flags |= IFF_MASTER;
                        bond_dev->priv_flags &= ~IFF_TX_SKB_SHARING;
index de3962014af70c8a979f4cb63b063583ba4927a9..4721948a92f6a1db9cea13d66810041be5ec88e4 100644 (file)
@@ -730,11 +730,14 @@ int cfspi_spi_probe(struct platform_device *pdev)
        int res;
        dev = (struct cfspi_dev *)pdev->dev.platform_data;
 
-       ndev = alloc_netdev(sizeof(struct cfspi), "cfspi%d",
-                           NET_NAME_UNKNOWN, cfspi_setup);
        if (!dev)
                return -ENODEV;
 
+       ndev = alloc_netdev(sizeof(struct cfspi), "cfspi%d",
+                           NET_NAME_UNKNOWN, cfspi_setup);
+       if (!ndev)
+               return -ENOMEM;
+
        cfspi = netdev_priv(ndev);
        netif_stop_queue(ndev);
        cfspi->ndev = ndev;
index 54aa00012dd0ce5ca36427c0cfb41f773ea47138..6e18213b9c04434a1feaae0c87da255859632732 100644 (file)
@@ -103,6 +103,8 @@ struct dsa_switch_driver mv88e6171_switch_driver = {
 #endif
        .get_regs_len           = mv88e6xxx_get_regs_len,
        .get_regs               = mv88e6xxx_get_regs,
+       .port_join_bridge       = mv88e6xxx_port_bridge_join,
+       .port_leave_bridge      = mv88e6xxx_port_bridge_leave,
        .port_stp_update        = mv88e6xxx_port_stp_update,
        .port_pvid_get          = mv88e6xxx_port_pvid_get,
        .port_vlan_prepare      = mv88e6xxx_port_vlan_prepare,
index ff846d0cfcebeff1b332b8f8ae1ca48d106c667d..cc6c5455341839eb91ba55dfd23e96e954c41fb7 100644 (file)
@@ -323,6 +323,8 @@ struct dsa_switch_driver mv88e6352_switch_driver = {
        .set_eeprom             = mv88e6352_set_eeprom,
        .get_regs_len           = mv88e6xxx_get_regs_len,
        .get_regs               = mv88e6xxx_get_regs,
+       .port_join_bridge       = mv88e6xxx_port_bridge_join,
+       .port_leave_bridge      = mv88e6xxx_port_bridge_leave,
        .port_stp_update        = mv88e6xxx_port_stp_update,
        .port_pvid_get          = mv88e6xxx_port_pvid_get,
        .port_vlan_prepare      = mv88e6xxx_port_vlan_prepare,
index 04cff58d771bd5a86f3b2a0bf2a047de1ee4b6f4..b06dba05594aaeb79988487bc431412b3dfae2c4 100644 (file)
@@ -1462,6 +1462,10 @@ int mv88e6xxx_port_vlan_prepare(struct dsa_switch *ds, int port,
                                const struct switchdev_obj_port_vlan *vlan,
                                struct switchdev_trans *trans)
 {
+       /* We reserve a few VLANs to isolate unbridged ports */
+       if (vlan->vid_end >= 4000)
+               return -EOPNOTSUPP;
+
        /* We don't need any dynamic resource from the kernel (yet),
         * so skip the prepare phase.
         */
@@ -1870,6 +1874,36 @@ unlock:
        return err;
 }
 
+int mv88e6xxx_port_bridge_join(struct dsa_switch *ds, int port, u32 members)
+{
+       struct mv88e6xxx_priv_state *ps = ds_to_priv(ds);
+       const u16 pvid = 4000 + ds->index * DSA_MAX_PORTS + port;
+       int err;
+
+       /* The port joined a bridge, so leave its reserved VLAN */
+       mutex_lock(&ps->smi_mutex);
+       err = _mv88e6xxx_port_vlan_del(ds, port, pvid);
+       if (!err)
+               err = _mv88e6xxx_port_pvid_set(ds, port, 0);
+       mutex_unlock(&ps->smi_mutex);
+       return err;
+}
+
+int mv88e6xxx_port_bridge_leave(struct dsa_switch *ds, int port, u32 members)
+{
+       struct mv88e6xxx_priv_state *ps = ds_to_priv(ds);
+       const u16 pvid = 4000 + ds->index * DSA_MAX_PORTS + port;
+       int err;
+
+       /* The port left the bridge, so join its reserved VLAN */
+       mutex_lock(&ps->smi_mutex);
+       err = _mv88e6xxx_port_vlan_add(ds, port, pvid, true);
+       if (!err)
+               err = _mv88e6xxx_port_pvid_set(ds, port, pvid);
+       mutex_unlock(&ps->smi_mutex);
+       return err;
+}
+
 static void mv88e6xxx_bridge_work(struct work_struct *work)
 {
        struct mv88e6xxx_priv_state *ps;
@@ -2140,6 +2174,14 @@ int mv88e6xxx_setup_ports(struct dsa_switch *ds)
                ret = mv88e6xxx_setup_port(ds, i);
                if (ret < 0)
                        return ret;
+
+               if (dsa_is_cpu_port(ds, i) || dsa_is_dsa_port(ds, i))
+                       continue;
+
+               /* setup the unbridged state */
+               ret = mv88e6xxx_port_bridge_leave(ds, i, 0);
+               if (ret < 0)
+                       return ret;
        }
        return 0;
 }
index fb9a8739712f3cfc8a4f1736d594d221dedeeb89..21c8daa03f788e369caa9eb2fe12c764607acd62 100644 (file)
@@ -468,6 +468,8 @@ int mv88e6xxx_phy_write_indirect(struct dsa_switch *ds, int addr, int regnum,
 int mv88e6xxx_get_eee(struct dsa_switch *ds, int port, struct ethtool_eee *e);
 int mv88e6xxx_set_eee(struct dsa_switch *ds, int port,
                      struct phy_device *phydev, struct ethtool_eee *e);
+int mv88e6xxx_port_bridge_join(struct dsa_switch *ds, int port, u32 members);
+int mv88e6xxx_port_bridge_leave(struct dsa_switch *ds, int port, u32 members);
 int mv88e6xxx_port_stp_update(struct dsa_switch *ds, int port, u8 state);
 int mv88e6xxx_port_vlan_prepare(struct dsa_switch *ds, int port,
                                const struct switchdev_obj_port_vlan *vlan,
index 33850a0f7e823b08a322cd53107904da7d1f78da..c31e691d11fc2eb5b786fc3769f700563f63a0da 100644 (file)
@@ -459,6 +459,45 @@ static void xgene_gmac_reset(struct xgene_enet_pdata *pdata)
        xgene_enet_wr_mcx_mac(pdata, MAC_CONFIG_1_ADDR, 0);
 }
 
+static void xgene_enet_configure_clock(struct xgene_enet_pdata *pdata)
+{
+       struct device *dev = &pdata->pdev->dev;
+
+       if (dev->of_node) {
+               struct clk *parent = clk_get_parent(pdata->clk);
+
+               switch (pdata->phy_speed) {
+               case SPEED_10:
+                       clk_set_rate(parent, 2500000);
+                       break;
+               case SPEED_100:
+                       clk_set_rate(parent, 25000000);
+                       break;
+               default:
+                       clk_set_rate(parent, 125000000);
+                       break;
+               }
+       }
+#ifdef CONFIG_ACPI
+       else {
+               switch (pdata->phy_speed) {
+               case SPEED_10:
+                       acpi_evaluate_object(ACPI_HANDLE(dev),
+                                            "S10", NULL, NULL);
+                       break;
+               case SPEED_100:
+                       acpi_evaluate_object(ACPI_HANDLE(dev),
+                                            "S100", NULL, NULL);
+                       break;
+               default:
+                       acpi_evaluate_object(ACPI_HANDLE(dev),
+                                            "S1G", NULL, NULL);
+                       break;
+               }
+       }
+#endif
+}
+
 static void xgene_gmac_init(struct xgene_enet_pdata *pdata)
 {
        struct device *dev = &pdata->pdev->dev;
@@ -477,12 +516,14 @@ static void xgene_gmac_init(struct xgene_enet_pdata *pdata)
        switch (pdata->phy_speed) {
        case SPEED_10:
                ENET_INTERFACE_MODE2_SET(&mc2, 1);
+               intf_ctl &= ~(ENET_LHD_MODE | ENET_GHD_MODE);
                CFG_MACMODE_SET(&icm0, 0);
                CFG_WAITASYNCRD_SET(&icm2, 500);
                rgmii &= ~CFG_SPEED_1250;
                break;
        case SPEED_100:
                ENET_INTERFACE_MODE2_SET(&mc2, 1);
+               intf_ctl &= ~ENET_GHD_MODE;
                intf_ctl |= ENET_LHD_MODE;
                CFG_MACMODE_SET(&icm0, 1);
                CFG_WAITASYNCRD_SET(&icm2, 80);
@@ -490,12 +531,15 @@ static void xgene_gmac_init(struct xgene_enet_pdata *pdata)
                break;
        default:
                ENET_INTERFACE_MODE2_SET(&mc2, 2);
+               intf_ctl &= ~ENET_LHD_MODE;
                intf_ctl |= ENET_GHD_MODE;
-
+               CFG_MACMODE_SET(&icm0, 2);
+               CFG_WAITASYNCRD_SET(&icm2, 0);
                if (dev->of_node) {
                        CFG_TXCLK_MUXSEL0_SET(&rgmii, pdata->tx_delay);
                        CFG_RXCLK_MUXSEL0_SET(&rgmii, pdata->rx_delay);
                }
+               rgmii |= CFG_SPEED_1250;
 
                xgene_enet_rd_csr(pdata, DEBUG_REG_ADDR, &value);
                value |= CFG_BYPASS_UNISEC_TX | CFG_BYPASS_UNISEC_RX;
@@ -503,7 +547,7 @@ static void xgene_gmac_init(struct xgene_enet_pdata *pdata)
                break;
        }
 
-       mc2 |= FULL_DUPLEX2;
+       mc2 |= FULL_DUPLEX2 | PAD_CRC;
        xgene_enet_wr_mcx_mac(pdata, MAC_CONFIG_2_ADDR, mc2);
        xgene_enet_wr_mcx_mac(pdata, INTERFACE_CONTROL_ADDR, intf_ctl);
 
@@ -522,6 +566,7 @@ static void xgene_gmac_init(struct xgene_enet_pdata *pdata)
        /* Rtype should be copied from FP */
        xgene_enet_wr_csr(pdata, RSIF_RAM_DBG_REG0_ADDR, 0);
        xgene_enet_wr_csr(pdata, RGMII_REG_0_ADDR, rgmii);
+       xgene_enet_configure_clock(pdata);
 
        /* Rx-Tx traffic resume */
        xgene_enet_wr_csr(pdata, CFG_LINK_AGGR_RESUME_0_ADDR, TX_PORT0);
index 6dee73c3c1e132a7be7387e6e72be7c9b5239afe..c153a1dc5ff78136c4fc99d1ec60970d99e095a0 100644 (file)
@@ -181,6 +181,7 @@ enum xgene_enet_rm {
 #define ENET_LHD_MODE                  BIT(25)
 #define ENET_GHD_MODE                  BIT(26)
 #define FULL_DUPLEX2                   BIT(0)
+#define PAD_CRC                                BIT(2)
 #define SCAN_AUTO_INCR                 BIT(5)
 #define TBYT_ADDR                      0x38
 #define TPKT_ADDR                      0x39
index ce1068771b327e711fd1723065f9f3ad3c5dadc3..991412ce6f48fbbf6fdfd6255003a0aa90e67e01 100644 (file)
@@ -698,7 +698,6 @@ static int xgene_enet_open(struct net_device *ndev)
        else
                schedule_delayed_work(&pdata->link_work, PHY_POLL_LINK_OFF);
 
-       netif_carrier_off(ndev);
        netif_start_queue(ndev);
 
        return ret;
index 67a7d520d9f54fcf9eadf4fa81b05b17d76dd55a..8550df189ceb709290c8b1caad4a3132dcb6a810 100644 (file)
@@ -173,6 +173,7 @@ config SYSTEMPORT
 config BNXT
        tristate "Broadcom NetXtreme-C/E support"
        depends on PCI
+       depends on VXLAN || VXLAN=n
        select FW_LOADER
        select LIBCRC32C
        ---help---
index 6c2e0c622831c13f12fc1bd238bfc69f56cc5443..db15c5ee09c53a528ea405961734dae927af0e06 100644 (file)
@@ -1292,8 +1292,6 @@ static inline int bnxt_has_work(struct bnxt *bp, struct bnxt_cp_ring_info *cpr)
        return TX_CMP_VALID(txcmp, raw_cons);
 }
 
-#define CAG_LEGACY_INT_STATUS  0x2014
-
 static irqreturn_t bnxt_inta(int irq, void *dev_instance)
 {
        struct bnxt_napi *bnapi = dev_instance;
@@ -1305,7 +1303,7 @@ static irqreturn_t bnxt_inta(int irq, void *dev_instance)
        prefetch(&cpr->cp_desc_ring[CP_RING(cons)][CP_IDX(cons)]);
 
        if (!bnxt_has_work(bp, cpr)) {
-               int_status = readl(bp->bar0 + CAG_LEGACY_INT_STATUS);
+               int_status = readl(bp->bar0 + BNXT_CAG_REG_LEGACY_INT_STATUS);
                /* return if erroneous interrupt */
                if (!(int_status & (0x10000 << cpr->cp_ring_struct.fw_ring_id)))
                        return IRQ_NONE;
@@ -4527,10 +4525,25 @@ static int bnxt_update_phy_setting(struct bnxt *bp)
        return rc;
 }
 
+/* Common routine to pre-map certain register block to different GRC window.
+ * A PF has 16 4K windows and a VF has 4 4K windows. However, only 15 windows
+ * in PF and 3 windows in VF that can be customized to map in different
+ * register blocks.
+ */
+static void bnxt_preset_reg_win(struct bnxt *bp)
+{
+       if (BNXT_PF(bp)) {
+               /* CAG registers map to GRC window #4 */
+               writel(BNXT_CAG_REG_BASE,
+                      bp->bar0 + BNXT_GRCPF_REG_WINDOW_BASE_OUT + 12);
+       }
+}
+
 static int __bnxt_open_nic(struct bnxt *bp, bool irq_re_init, bool link_re_init)
 {
        int rc = 0;
 
+       bnxt_preset_reg_win(bp);
        netif_carrier_off(bp->dev);
        if (irq_re_init) {
                rc = bnxt_setup_int_mode(bp);
@@ -5294,7 +5307,7 @@ static int bnxt_rx_flow_steer(struct net_device *dev, const struct sk_buff *skb,
        struct bnxt_ntuple_filter *fltr, *new_fltr;
        struct flow_keys *fkeys;
        struct ethhdr *eth = (struct ethhdr *)skb_mac_header(skb);
-       int rc = 0, idx;
+       int rc = 0, idx, bit_id;
        struct hlist_head *head;
 
        if (skb->encapsulation)
@@ -5332,14 +5345,15 @@ static int bnxt_rx_flow_steer(struct net_device *dev, const struct sk_buff *skb,
        rcu_read_unlock();
 
        spin_lock_bh(&bp->ntp_fltr_lock);
-       new_fltr->sw_id = bitmap_find_free_region(bp->ntp_fltr_bmap,
-                                                 BNXT_NTP_FLTR_MAX_FLTR, 0);
-       if (new_fltr->sw_id < 0) {
+       bit_id = bitmap_find_free_region(bp->ntp_fltr_bmap,
+                                        BNXT_NTP_FLTR_MAX_FLTR, 0);
+       if (bit_id < 0) {
                spin_unlock_bh(&bp->ntp_fltr_lock);
                rc = -ENOMEM;
                goto err_free;
        }
 
+       new_fltr->sw_id = (u16)bit_id;
        new_fltr->flow_id = flow_id;
        new_fltr->rxq = rxq_index;
        hlist_add_head_rcu(&new_fltr->hash, head);
index 4f2267ca482d1d7fcf2d32efbcccf966e5089445..674bc5159b91c7cd4972561fae11dd1bbed7d53c 100644 (file)
@@ -166,9 +166,11 @@ struct rx_cmp {
 #define RX_CMP_HASH_VALID(rxcmp)                               \
        ((rxcmp)->rx_cmp_len_flags_type & cpu_to_le32(RX_CMP_FLAGS_RSS_VALID))
 
+#define RSS_PROFILE_ID_MASK    0x1f
+
 #define RX_CMP_HASH_TYPE(rxcmp)                                        \
-       ((le32_to_cpu((rxcmp)->rx_cmp_misc_v1) & RX_CMP_RSS_HASH_TYPE) >>\
-        RX_CMP_RSS_HASH_TYPE_SHIFT)
+       (((le32_to_cpu((rxcmp)->rx_cmp_misc_v1) & RX_CMP_RSS_HASH_TYPE) >>\
+         RX_CMP_RSS_HASH_TYPE_SHIFT) & RSS_PROFILE_ID_MASK)
 
 struct rx_cmp_ext {
        __le32 rx_cmp_flags2;
@@ -282,9 +284,9 @@ struct rx_tpa_start_cmp {
         cpu_to_le32(RX_TPA_START_CMP_FLAGS_RSS_VALID))
 
 #define TPA_START_HASH_TYPE(rx_tpa_start)                              \
-       ((le32_to_cpu((rx_tpa_start)->rx_tpa_start_cmp_misc_v1) &       \
-         RX_TPA_START_CMP_RSS_HASH_TYPE) >>                            \
-        RX_TPA_START_CMP_RSS_HASH_TYPE_SHIFT)
+       (((le32_to_cpu((rx_tpa_start)->rx_tpa_start_cmp_misc_v1) &      \
+          RX_TPA_START_CMP_RSS_HASH_TYPE) >>                           \
+         RX_TPA_START_CMP_RSS_HASH_TYPE_SHIFT) & RSS_PROFILE_ID_MASK)
 
 #define TPA_START_AGG_ID(rx_tpa_start)                                 \
        ((le32_to_cpu((rx_tpa_start)->rx_tpa_start_cmp_misc_v1) &       \
@@ -839,6 +841,10 @@ struct bnxt_queue_info {
        u8      queue_profile;
 };
 
+#define BNXT_GRCPF_REG_WINDOW_BASE_OUT 0x400
+#define BNXT_CAG_REG_LEGACY_INT_STATUS 0x4014
+#define BNXT_CAG_REG_BASE              0x300000
+
 struct bnxt {
        void __iomem            *bar0;
        void __iomem            *bar1;
@@ -959,11 +965,11 @@ struct bnxt {
 #define BNXT_RX_MASK_SP_EVENT          0
 #define BNXT_RX_NTP_FLTR_SP_EVENT      1
 #define BNXT_LINK_CHNG_SP_EVENT                2
-#define BNXT_HWRM_EXEC_FWD_REQ_SP_EVENT        4
-#define BNXT_VXLAN_ADD_PORT_SP_EVENT   8
-#define BNXT_VXLAN_DEL_PORT_SP_EVENT   16
-#define BNXT_RESET_TASK_SP_EVENT       32
-#define BNXT_RST_RING_SP_EVENT         64
+#define BNXT_HWRM_EXEC_FWD_REQ_SP_EVENT        3
+#define BNXT_VXLAN_ADD_PORT_SP_EVENT   4
+#define BNXT_VXLAN_DEL_PORT_SP_EVENT   5
+#define BNXT_RESET_TASK_SP_EVENT       6
+#define BNXT_RST_RING_SP_EVENT         7
 
        struct bnxt_pf_info     pf;
 #ifdef CONFIG_BNXT_SRIOV
index 60989e7e266a212033f39f58f9927bbdd3da4854..f4cf6886106906d90bff221038b83914d9bbbd24 100644 (file)
@@ -258,7 +258,7 @@ static int bnxt_set_vf_attr(struct bnxt *bp, int num_vfs)
        return 0;
 }
 
-static int bnxt_hwrm_func_vf_resource_free(struct bnxt *bp)
+static int bnxt_hwrm_func_vf_resource_free(struct bnxt *bp, int num_vfs)
 {
        int i, rc = 0;
        struct bnxt_pf_info *pf = &bp->pf;
@@ -267,7 +267,7 @@ static int bnxt_hwrm_func_vf_resource_free(struct bnxt *bp)
        bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_FUNC_VF_RESC_FREE, -1, -1);
 
        mutex_lock(&bp->hwrm_cmd_lock);
-       for (i = pf->first_vf_id; i < pf->first_vf_id + pf->active_vfs; i++) {
+       for (i = pf->first_vf_id; i < pf->first_vf_id + num_vfs; i++) {
                req.vf_id = cpu_to_le16(i);
                rc = _hwrm_send_message(bp, &req, sizeof(req),
                                        HWRM_CMD_TIMEOUT);
@@ -509,7 +509,7 @@ static int bnxt_sriov_enable(struct bnxt *bp, int *num_vfs)
 
 err_out2:
        /* Free the resources reserved for various VF's */
-       bnxt_hwrm_func_vf_resource_free(bp);
+       bnxt_hwrm_func_vf_resource_free(bp, *num_vfs);
 
 err_out1:
        bnxt_free_vf_resources(bp);
@@ -519,13 +519,19 @@ err_out1:
 
 void bnxt_sriov_disable(struct bnxt *bp)
 {
-       if (!bp->pf.active_vfs)
-               return;
+       u16 num_vfs = pci_num_vf(bp->pdev);
 
-       pci_disable_sriov(bp->pdev);
+       if (!num_vfs)
+               return;
 
-       /* Free the resources reserved for various VF's */
-       bnxt_hwrm_func_vf_resource_free(bp);
+       if (pci_vfs_assigned(bp->pdev)) {
+               netdev_warn(bp->dev, "Unable to free %d VFs because some are assigned to VMs.\n",
+                           num_vfs);
+       } else {
+               pci_disable_sriov(bp->pdev);
+               /* Free the HW resources reserved for various VF's */
+               bnxt_hwrm_func_vf_resource_free(bp, num_vfs);
+       }
 
        bnxt_free_vf_resources(bp);
 
@@ -552,17 +558,25 @@ int bnxt_sriov_configure(struct pci_dev *pdev, int num_vfs)
        }
        bp->sriov_cfg = true;
        rtnl_unlock();
-       if (!num_vfs) {
-               bnxt_sriov_disable(bp);
-               return 0;
+
+       if (pci_vfs_assigned(bp->pdev)) {
+               netdev_warn(dev, "Unable to configure SRIOV since some VFs are assigned to VMs.\n");
+               num_vfs = 0;
+               goto sriov_cfg_exit;
        }
 
        /* Check if enabled VFs is same as requested */
-       if (num_vfs == bp->pf.active_vfs)
-               return 0;
+       if (num_vfs && num_vfs == bp->pf.active_vfs)
+               goto sriov_cfg_exit;
+
+       /* if there are previous existing VFs, clean them up */
+       bnxt_sriov_disable(bp);
+       if (!num_vfs)
+               goto sriov_cfg_exit;
 
        bnxt_sriov_enable(bp, &num_vfs);
 
+sriov_cfg_exit:
        bp->sriov_cfg = false;
        wake_up(&bp->sriov_cfg_wait);
 
index f250dec488fd2a2b908a0cb67bb2df61c53ac7ee..74beb1867230c9cf62a60a2843825316e6d9cdbc 100644 (file)
@@ -5,7 +5,8 @@
 config NET_VENDOR_HISILICON
        bool "Hisilicon devices"
        default y
-       depends on OF && (ARM || ARM64 || COMPILE_TEST)
+       depends on OF && HAS_DMA
+       depends on ARM || ARM64 || COMPILE_TEST
        ---help---
          If you have a network (Ethernet) card belonging to this class, say Y.
 
index 80af9ffce5ead1bd62e61499ff2e0ff9f6e04732..a1c862b4664de02667f7d4c751f1d9a7e8686ee6 100644 (file)
@@ -44,6 +44,7 @@ config MVNETA
        tristate "Marvell Armada 370/38x/XP network interface support"
        depends on PLAT_ORION
        select MVMDIO
+       select FIXED_PHY
        ---help---
          This driver supports the network interface units in the
          Marvell ARMADA XP, ARMADA 370 and ARMADA 38x SoC family.
index a47496a020d99eb2b56f185c3be8f1cf797b567a..e84c7f2634d3759805326707a29c33737bcad615 100644 (file)
@@ -1493,9 +1493,9 @@ static void mvneta_rxq_drop_pkts(struct mvneta_port *pp,
                struct mvneta_rx_desc *rx_desc = rxq->descs + i;
                void *data = (void *)rx_desc->buf_cookie;
 
-               mvneta_frag_free(pp, data);
                dma_unmap_single(pp->dev->dev.parent, rx_desc->buf_phys_addr,
                                 MVNETA_RX_BUF_SIZE(pp->pkt_size), DMA_FROM_DEVICE);
+               mvneta_frag_free(pp, data);
        }
 
        if (rx_done)
index 30a6f246dfc9f004ac68f4b2cc84658186dce9e6..ddcfcab034c23b122596b5e733708d8666737ae6 100644 (file)
@@ -94,6 +94,7 @@ config NETXEN_NIC
 config QED
        tristate "QLogic QED 25/40/100Gb core driver"
        depends on PCI
+       select ZLIB_INFLATE
        ---help---
          This enables the support for ...
 
index b9b7b7e6fa534cc70cd96a97aaf7afb12f734b3f..803b190ccada97b30b28098666146f9d05ad1c54 100644 (file)
@@ -223,6 +223,7 @@ int qed_resc_alloc(struct qed_dev *cdev)
                if (!p_hwfn->p_tx_cids) {
                        DP_NOTICE(p_hwfn,
                                  "Failed to allocate memory for Tx Cids\n");
+                       rc = -ENOMEM;
                        goto alloc_err;
                }
 
@@ -230,6 +231,7 @@ int qed_resc_alloc(struct qed_dev *cdev)
                if (!p_hwfn->p_rx_cids) {
                        DP_NOTICE(p_hwfn,
                                  "Failed to allocate memory for Rx Cids\n");
+                       rc = -ENOMEM;
                        goto alloc_err;
                }
        }
@@ -281,14 +283,17 @@ int qed_resc_alloc(struct qed_dev *cdev)
 
                /* EQ */
                p_eq = qed_eq_alloc(p_hwfn, 256);
-
-               if (!p_eq)
+               if (!p_eq) {
+                       rc = -ENOMEM;
                        goto alloc_err;
+               }
                p_hwfn->p_eq = p_eq;
 
                p_consq = qed_consq_alloc(p_hwfn);
-               if (!p_consq)
+               if (!p_consq) {
+                       rc = -ENOMEM;
                        goto alloc_err;
+               }
                p_hwfn->p_consq = p_consq;
 
                /* DMA info initialization */
@@ -303,6 +308,7 @@ int qed_resc_alloc(struct qed_dev *cdev)
        cdev->reset_stats = kzalloc(sizeof(*cdev->reset_stats), GFP_KERNEL);
        if (!cdev->reset_stats) {
                DP_NOTICE(cdev, "Failed to allocate reset statistics\n");
+               rc = -ENOMEM;
                goto alloc_err;
        }
 
@@ -562,7 +568,7 @@ static int qed_hw_init_pf(struct qed_hwfn *p_hwfn,
        }
 
        /* Enable classification by MAC if needed */
-       if (hw_mode & MODE_MF_SI) {
+       if (hw_mode & (1 << MODE_MF_SI)) {
                DP_VERBOSE(p_hwfn, NETIF_MSG_HW,
                           "Configuring TAGMAC_CLS_TYPE\n");
                STORE_RT_REG(p_hwfn,
index 2e399b6137a27899e97108cf5f35024f8b4d2ed0..de50e84902afe3b6a26c422d34a687ec9bc523ec 100644 (file)
@@ -251,11 +251,6 @@ void qed_int_sp_dpc(unsigned long hwfn_cookie)
        int arr_size;
        u16 rc = 0;
 
-       if (!p_hwfn) {
-               DP_ERR(p_hwfn->cdev, "DPC called - no hwfn!\n");
-               return;
-       }
-
        if (!p_hwfn->p_sp_sb) {
                DP_ERR(p_hwfn->cdev, "DPC called - no p_sp_sb\n");
                return;
index d4481454b5f8d8e6951c942d505f080074edc650..1205f6f9c941735a9f7bafb88e36705e4a5de7f2 100644 (file)
@@ -353,7 +353,8 @@ static int qlcnic_set_mac(struct net_device *netdev, void *p)
        if (!is_valid_ether_addr(addr->sa_data))
                return -EINVAL;
 
-       if (ether_addr_equal_unaligned(adapter->mac_addr, addr->sa_data))
+       if (ether_addr_equal_unaligned(adapter->mac_addr, addr->sa_data) &&
+           ether_addr_equal_unaligned(netdev->dev_addr, addr->sa_data))
                return 0;
 
        if (test_bit(__QLCNIC_DEV_UP, &adapter->state)) {
index 6150a235b72ccaf8bf58dd862362b02fe7f0cfae..e7bab7909ed9e1868dd5f8457b3cfc96c92788f1 100644 (file)
@@ -1098,7 +1098,7 @@ static struct mdiobb_ops bb_ops = {
 static void sh_eth_ring_free(struct net_device *ndev)
 {
        struct sh_eth_private *mdp = netdev_priv(ndev);
-       int i;
+       int ringsize, i;
 
        /* Free Rx skb ringbuffer */
        if (mdp->rx_skbuff) {
@@ -1115,6 +1115,20 @@ static void sh_eth_ring_free(struct net_device *ndev)
        }
        kfree(mdp->tx_skbuff);
        mdp->tx_skbuff = NULL;
+
+       if (mdp->rx_ring) {
+               ringsize = sizeof(struct sh_eth_rxdesc) * mdp->num_rx_ring;
+               dma_free_coherent(NULL, ringsize, mdp->rx_ring,
+                                 mdp->rx_desc_dma);
+               mdp->rx_ring = NULL;
+       }
+
+       if (mdp->tx_ring) {
+               ringsize = sizeof(struct sh_eth_txdesc) * mdp->num_tx_ring;
+               dma_free_coherent(NULL, ringsize, mdp->tx_ring,
+                                 mdp->tx_desc_dma);
+               mdp->tx_ring = NULL;
+       }
 }
 
 /* format skb and descriptor buffer */
@@ -1199,7 +1213,7 @@ static void sh_eth_ring_format(struct net_device *ndev)
 static int sh_eth_ring_init(struct net_device *ndev)
 {
        struct sh_eth_private *mdp = netdev_priv(ndev);
-       int rx_ringsize, tx_ringsize, ret = 0;
+       int rx_ringsize, tx_ringsize;
 
        /* +26 gets the maximum ethernet encapsulation, +7 & ~7 because the
         * card needs room to do 8 byte alignment, +2 so we can reserve
@@ -1214,26 +1228,20 @@ static int sh_eth_ring_init(struct net_device *ndev)
        /* Allocate RX and TX skb rings */
        mdp->rx_skbuff = kcalloc(mdp->num_rx_ring, sizeof(*mdp->rx_skbuff),
                                 GFP_KERNEL);
-       if (!mdp->rx_skbuff) {
-               ret = -ENOMEM;
-               return ret;
-       }
+       if (!mdp->rx_skbuff)
+               return -ENOMEM;
 
        mdp->tx_skbuff = kcalloc(mdp->num_tx_ring, sizeof(*mdp->tx_skbuff),
                                 GFP_KERNEL);
-       if (!mdp->tx_skbuff) {
-               ret = -ENOMEM;
-               goto skb_ring_free;
-       }
+       if (!mdp->tx_skbuff)
+               goto ring_free;
 
        /* Allocate all Rx descriptors. */
        rx_ringsize = sizeof(struct sh_eth_rxdesc) * mdp->num_rx_ring;
        mdp->rx_ring = dma_alloc_coherent(NULL, rx_ringsize, &mdp->rx_desc_dma,
                                          GFP_KERNEL);
-       if (!mdp->rx_ring) {
-               ret = -ENOMEM;
-               goto skb_ring_free;
-       }
+       if (!mdp->rx_ring)
+               goto ring_free;
 
        mdp->dirty_rx = 0;
 
@@ -1241,42 +1249,15 @@ static int sh_eth_ring_init(struct net_device *ndev)
        tx_ringsize = sizeof(struct sh_eth_txdesc) * mdp->num_tx_ring;
        mdp->tx_ring = dma_alloc_coherent(NULL, tx_ringsize, &mdp->tx_desc_dma,
                                          GFP_KERNEL);
-       if (!mdp->tx_ring) {
-               ret = -ENOMEM;
-               goto desc_ring_free;
-       }
-       return ret;
-
-desc_ring_free:
-       /* free DMA buffer */
-       dma_free_coherent(NULL, rx_ringsize, mdp->rx_ring, mdp->rx_desc_dma);
+       if (!mdp->tx_ring)
+               goto ring_free;
+       return 0;
 
-skb_ring_free:
-       /* Free Rx and Tx skb ring buffer */
+ring_free:
+       /* Free Rx and Tx skb ring buffer and DMA buffer */
        sh_eth_ring_free(ndev);
-       mdp->tx_ring = NULL;
-       mdp->rx_ring = NULL;
-
-       return ret;
-}
-
-static void sh_eth_free_dma_buffer(struct sh_eth_private *mdp)
-{
-       int ringsize;
-
-       if (mdp->rx_ring) {
-               ringsize = sizeof(struct sh_eth_rxdesc) * mdp->num_rx_ring;
-               dma_free_coherent(NULL, ringsize, mdp->rx_ring,
-                                 mdp->rx_desc_dma);
-               mdp->rx_ring = NULL;
-       }
 
-       if (mdp->tx_ring) {
-               ringsize = sizeof(struct sh_eth_txdesc) * mdp->num_tx_ring;
-               dma_free_coherent(NULL, ringsize, mdp->tx_ring,
-                                 mdp->tx_desc_dma);
-               mdp->tx_ring = NULL;
-       }
+       return -ENOMEM;
 }
 
 static int sh_eth_dev_init(struct net_device *ndev, bool start)
@@ -2239,10 +2220,8 @@ static int sh_eth_set_ringparam(struct net_device *ndev,
 
                sh_eth_dev_exit(ndev);
 
-               /* Free all the skbuffs in the Rx queue. */
+               /* Free all the skbuffs in the Rx queue and the DMA buffers. */
                sh_eth_ring_free(ndev);
-               /* Free DMA buffer */
-               sh_eth_free_dma_buffer(mdp);
        }
 
        /* Set new parameters */
@@ -2487,12 +2466,9 @@ static int sh_eth_close(struct net_device *ndev)
 
        free_irq(ndev->irq, ndev);
 
-       /* Free all the skbuffs in the Rx queue. */
+       /* Free all the skbuffs in the Rx queue and the DMA buffer. */
        sh_eth_ring_free(ndev);
 
-       /* free DMA buffer */
-       sh_eth_free_dma_buffer(mdp);
-
        pm_runtime_put_sync(&mdp->pdev->dev);
 
        mdp->is_opened = 0;
index 11baa4b197793f583eba9a5dc5c53aefb145ff9b..0cd3ecff768b3df5a3dbd7bdf2b73e06d81affff 100644 (file)
@@ -354,7 +354,7 @@ static int gmac_clk_init(struct rk_priv_data *bsp_priv)
 
 static int gmac_clk_enable(struct rk_priv_data *bsp_priv, bool enable)
 {
-       int phy_iface = phy_iface = bsp_priv->phy_iface;
+       int phy_iface = bsp_priv->phy_iface;
 
        if (enable) {
                if (!bsp_priv->clk_enabled) {
index 85b3326775b821f99be5d5e3dc5a065517797852..9066d7a8483c34ed5ee1ca2a697453eb55564584 100644 (file)
@@ -2970,8 +2970,7 @@ err_out_unregister_netdev:
 err_out_clk_dis_aper:
        clk_disable_unprepare(lp->apb_pclk);
 err_out_free_netdev:
-       if (lp->phy_node)
-               of_node_put(lp->phy_node);
+       of_node_put(lp->phy_node);
        free_netdev(ndev);
        platform_set_drvdata(pdev, NULL);
        return ret;
index 040fbc1e55080a4d025df2a2fae888da6151008c..48b92c9de12a5af4f75ab6b48b4ffd39a77d6ed5 100644 (file)
@@ -2037,6 +2037,19 @@ static int cpsw_probe_dt(struct cpsw_priv *priv,
                        continue;
 
                priv->phy_node = of_parse_phandle(slave_node, "phy-handle", 0);
+               if (of_phy_is_fixed_link(slave_node)) {
+                       struct phy_device *pd;
+
+                       ret = of_phy_register_fixed_link(slave_node);
+                       if (ret)
+                               return ret;
+                       pd = of_phy_find_device(slave_node);
+                       if (!pd)
+                               return -ENODEV;
+                       snprintf(slave_data->phy_id, sizeof(slave_data->phy_id),
+                                PHY_ID_FMT, pd->bus->id, pd->phy_id);
+                       goto no_phy_slave;
+               }
                parp = of_get_property(slave_node, "phy_id", &lenp);
                if ((parp == NULL) || (lenp != (sizeof(void *) * 2))) {
                        dev_err(&pdev->dev, "Missing slave[%d] phy_id property\n", i);
index 2d3848c9dc35a7f0047fb0189c0669b70dc776dc..bb8b5304d85117354595d707585613e572ce24c0 100644 (file)
@@ -143,9 +143,7 @@ static int fjes_hw_alloc_epbuf(struct epbuf_handler *epbh)
 
 static void fjes_hw_free_epbuf(struct epbuf_handler *epbh)
 {
-       if (epbh->buffer)
-               vfree(epbh->buffer);
-
+       vfree(epbh->buffer);
        epbh->buffer = NULL;
        epbh->size = 0;
 
index 197c93937c2d577e56cf7fab8dcef07313bf75f4..54036ae0a388c9a34cbb92fc832980fc1e584dc2 100644 (file)
@@ -935,6 +935,9 @@ static ssize_t macvtap_do_read(struct macvtap_queue *q,
                /* Nothing to read, let's sleep */
                schedule();
        }
+       if (!noblock)
+               finish_wait(sk_sleep(&q->sk), &wait);
+
        if (skb) {
                ret = macvtap_put_user(q, skb, to);
                if (unlikely(ret < 0))
@@ -942,8 +945,6 @@ static ssize_t macvtap_do_read(struct macvtap_queue *q,
                else
                        consume_skb(skb);
        }
-       if (!noblock)
-               finish_wait(sk_sleep(&q->sk), &wait);
        return ret;
 }
 
index c54719984c4bdd0da0e36dd54ab1430708483b0b..34799eaace41bcdb93cfa4c1ed76af31ae052ef3 100644 (file)
@@ -771,6 +771,7 @@ static const struct usb_device_id products[] = {
        {QMI_GOBI_DEVICE(0x05c6, 0x9245)},      /* Samsung Gobi 2000 Modem device (VL176) */
        {QMI_GOBI_DEVICE(0x03f0, 0x251d)},      /* HP Gobi 2000 Modem device (VP412) */
        {QMI_GOBI_DEVICE(0x05c6, 0x9215)},      /* Acer Gobi 2000 Modem device (VP413) */
+       {QMI_FIXED_INTF(0x05c6, 0x9215, 4)},    /* Quectel EC20 Mini PCIe */
        {QMI_GOBI_DEVICE(0x05c6, 0x9265)},      /* Asus Gobi 2000 Modem device (VR305) */
        {QMI_GOBI_DEVICE(0x05c6, 0x9235)},      /* Top Global Gobi 2000 Modem device (VR306) */
        {QMI_GOBI_DEVICE(0x05c6, 0x9275)},      /* iRex Technologies Gobi 2000 Modem device (VR307) */
@@ -802,10 +803,24 @@ static const struct usb_device_id products[] = {
 };
 MODULE_DEVICE_TABLE(usb, products);
 
+static bool quectel_ec20_detected(struct usb_interface *intf)
+{
+       struct usb_device *dev = interface_to_usbdev(intf);
+
+       if (dev->actconfig &&
+           le16_to_cpu(dev->descriptor.idVendor) == 0x05c6 &&
+           le16_to_cpu(dev->descriptor.idProduct) == 0x9215 &&
+           dev->actconfig->desc.bNumInterfaces == 5)
+               return true;
+
+       return false;
+}
+
 static int qmi_wwan_probe(struct usb_interface *intf,
                          const struct usb_device_id *prod)
 {
        struct usb_device_id *id = (struct usb_device_id *)prod;
+       struct usb_interface_descriptor *desc = &intf->cur_altsetting->desc;
 
        /* Workaround to enable dynamic IDs.  This disables usbnet
         * blacklisting functionality.  Which, if required, can be
@@ -817,6 +832,12 @@ static int qmi_wwan_probe(struct usb_interface *intf,
                id->driver_info = (unsigned long)&qmi_wwan_info;
        }
 
+       /* Quectel EC20 quirk where we've QMI on interface 4 instead of 0 */
+       if (quectel_ec20_detected(intf) && desc->bInterfaceNumber == 0) {
+               dev_dbg(&intf->dev, "Quectel EC20 quirk, skipping interface 0\n");
+               return -ENODEV;
+       }
+
        return usbnet_probe(intf, id);
 }
 
index 444ca94697d96e213d69020f14e4535e0366f3e4..670af76922e03e94c8f33f8399b01df7afefae00 100644 (file)
@@ -44,7 +44,7 @@ config NFC_MRVL_I2C
 
 config NFC_MRVL_SPI
        tristate "Marvell NFC-over-SPI driver"
-       depends on NFC_MRVL && SPI
+       depends on NFC_MRVL && NFC_NCI_SPI
        help
          Marvell NFC-over-SPI driver.
 
index bfa771392b1fb47669b914f9000a8f2be6fd9133..f8dcdf4b24f6ff8b63a1a70e9e5249b997209780 100644 (file)
@@ -113,9 +113,12 @@ static void fw_dnld_over(struct nfcmrvl_private *priv, u32 error)
        }
 
        atomic_set(&priv->ndev->cmd_cnt, 0);
-       del_timer_sync(&priv->ndev->cmd_timer);
 
-       del_timer_sync(&priv->fw_dnld.timer);
+       if (timer_pending(&priv->ndev->cmd_timer))
+               del_timer_sync(&priv->ndev->cmd_timer);
+
+       if (timer_pending(&priv->fw_dnld.timer))
+               del_timer_sync(&priv->fw_dnld.timer);
 
        nfc_info(priv->dev, "FW loading over (%d)]\n", error);
 
@@ -472,9 +475,12 @@ void       nfcmrvl_fw_dnld_deinit(struct nfcmrvl_private *priv)
 void   nfcmrvl_fw_dnld_recv_frame(struct nfcmrvl_private *priv,
                                   struct sk_buff *skb)
 {
+       /* Discard command timer */
+       if (timer_pending(&priv->ndev->cmd_timer))
+               del_timer_sync(&priv->ndev->cmd_timer);
+
        /* Allow next command */
        atomic_set(&priv->ndev->cmd_cnt, 1);
-       del_timer_sync(&priv->ndev->cmd_timer);
 
        /* Queue and trigger rx work */
        skb_queue_tail(&priv->fw_dnld.rx_q, skb);
index 8079ae0de21ebac54153e7202bb469ae413ed765..51c8240a1672a1a329d40b4cb97dbf3582e48f83 100644 (file)
@@ -194,6 +194,9 @@ void nfcmrvl_nci_unregister_dev(struct nfcmrvl_private *priv)
 
        nfcmrvl_fw_dnld_deinit(priv);
 
+       if (priv->config.reset_n_io)
+               devm_gpio_free(priv->dev, priv->config.reset_n_io);
+
        nci_unregister_device(ndev);
        nci_free_device(ndev);
        kfree(priv);
@@ -251,8 +254,6 @@ void nfcmrvl_chip_halt(struct nfcmrvl_private *priv)
                gpio_set_value(priv->config.reset_n_io, 0);
 }
 
-#ifdef CONFIG_OF
-
 int nfcmrvl_parse_dt(struct device_node *node,
                     struct nfcmrvl_platform_data *pdata)
 {
@@ -275,16 +276,6 @@ int nfcmrvl_parse_dt(struct device_node *node,
 
        return 0;
 }
-
-#else
-
-int nfcmrvl_parse_dt(struct device_node *node,
-                    struct nfcmrvl_platform_data *pdata)
-{
-       return -ENODEV;
-}
-
-#endif
 EXPORT_SYMBOL_GPL(nfcmrvl_parse_dt);
 
 MODULE_AUTHOR("Marvell International Ltd.");
index f3d041c4f249e05dced87bd76786bc8a612fd915..83a99e38e7bd316d949e44d1bc530865ac22befe 100644 (file)
@@ -67,8 +67,6 @@ static struct nfcmrvl_if_ops uart_ops = {
        .nci_update_config = nfcmrvl_uart_nci_update_config
 };
 
-#ifdef CONFIG_OF
-
 static int nfcmrvl_uart_parse_dt(struct device_node *node,
                                 struct nfcmrvl_platform_data *pdata)
 {
@@ -102,16 +100,6 @@ static int nfcmrvl_uart_parse_dt(struct device_node *node,
        return 0;
 }
 
-#else
-
-static int nfcmrvl_uart_parse_dt(struct device_node *node,
-                                struct nfcmrvl_platform_data *pdata)
-{
-       return -ENODEV;
-}
-
-#endif
-
 /*
 ** NCI UART OPS
 */
@@ -152,10 +140,6 @@ static int nfcmrvl_nci_uart_open(struct nci_uart *nu)
        nu->drv_data = priv;
        nu->ndev = priv->ndev;
 
-       /* Set BREAK */
-       if (priv->config.break_control && nu->tty->ops->break_ctl)
-               nu->tty->ops->break_ctl(nu->tty, -1);
-
        return 0;
 }
 
@@ -174,6 +158,9 @@ static void nfcmrvl_nci_uart_tx_start(struct nci_uart *nu)
 {
        struct nfcmrvl_private *priv = (struct nfcmrvl_private *)nu->drv_data;
 
+       if (priv->ndev->nfc_dev->fw_download_in_progress)
+               return;
+
        /* Remove BREAK to wake up the NFCC */
        if (priv->config.break_control && nu->tty->ops->break_ctl) {
                nu->tty->ops->break_ctl(nu->tty, 0);
@@ -185,13 +172,18 @@ static void nfcmrvl_nci_uart_tx_done(struct nci_uart *nu)
 {
        struct nfcmrvl_private *priv = (struct nfcmrvl_private *)nu->drv_data;
 
+       if (priv->ndev->nfc_dev->fw_download_in_progress)
+               return;
+
        /*
        ** To ensure that if the NFCC goes in DEEP SLEEP sate we can wake him
        ** up. we set BREAK. Once we will be ready to send again we will remove
        ** it.
        */
-       if (priv->config.break_control && nu->tty->ops->break_ctl)
+       if (priv->config.break_control && nu->tty->ops->break_ctl) {
                nu->tty->ops->break_ctl(nu->tty, -1);
+               usleep_range(1000, 3000);
+       }
 }
 
 static struct nci_uart nfcmrvl_nci_uart = {
index 0df77cb07df64538d77529d2be497907e39dafe2..91a336ea8c4f2148079aeca7f03ca625824bfd4e 100644 (file)
@@ -161,7 +161,7 @@ static int nd_blk_do_bvec(struct nd_blk_device *blk_dev,
        return err;
 }
 
-static void nd_blk_make_request(struct request_queue *q, struct bio *bio)
+static blk_qc_t nd_blk_make_request(struct request_queue *q, struct bio *bio)
 {
        struct block_device *bdev = bio->bi_bdev;
        struct gendisk *disk = bdev->bd_disk;
@@ -208,6 +208,7 @@ static void nd_blk_make_request(struct request_queue *q, struct bio *bio)
 
  out:
        bio_endio(bio);
+       return BLK_QC_T_NONE;
 }
 
 static int nd_blk_rw_bytes(struct nd_namespace_common *ndns,
index eae93ab8ffcded3060c072a5299909ebee89aa7d..efb2c1ceef989b1eccc83e324d8daca08e1502e4 100644 (file)
@@ -1150,7 +1150,7 @@ static int btt_do_bvec(struct btt *btt, struct bio_integrity_payload *bip,
        return ret;
 }
 
-static void btt_make_request(struct request_queue *q, struct bio *bio)
+static blk_qc_t btt_make_request(struct request_queue *q, struct bio *bio)
 {
        struct bio_integrity_payload *bip = bio_integrity(bio);
        struct btt *btt = q->queuedata;
@@ -1198,6 +1198,7 @@ static void btt_make_request(struct request_queue *q, struct bio *bio)
 
 out:
        bio_endio(bio);
+       return BLK_QC_T_NONE;
 }
 
 static int btt_rw_page(struct block_device *bdev, sector_t sector,
index 0ba6a978f227e76a4b0c27046e2736d43cf37e45..012e0649f1ac48374de47a690a2d0ac1d1865cac 100644 (file)
@@ -64,7 +64,7 @@ static void pmem_do_bvec(struct pmem_device *pmem, struct page *page,
        kunmap_atomic(mem);
 }
 
-static void pmem_make_request(struct request_queue *q, struct bio *bio)
+static blk_qc_t pmem_make_request(struct request_queue *q, struct bio *bio)
 {
        bool do_acct;
        unsigned long start;
@@ -84,6 +84,7 @@ static void pmem_make_request(struct request_queue *q, struct bio *bio)
                wmb_pmem();
 
        bio_endio(bio);
+       return BLK_QC_T_NONE;
 }
 
 static int pmem_rw_page(struct block_device *bdev, sector_t sector,
@@ -150,18 +151,15 @@ static struct pmem_device *pmem_alloc(struct device *dev,
                return ERR_PTR(-EBUSY);
        }
 
-       if (pmem_should_map_pages(dev)) {
-               void *addr = devm_memremap_pages(dev, res);
+       if (pmem_should_map_pages(dev))
+               pmem->virt_addr = (void __pmem *) devm_memremap_pages(dev, res);
+       else
+               pmem->virt_addr = (void __pmem *) devm_memremap(dev,
+                               pmem->phys_addr, pmem->size,
+                               ARCH_MEMREMAP_PMEM);
 
-               if (IS_ERR(addr))
-                       return addr;
-               pmem->virt_addr = (void __pmem *) addr;
-       } else {
-               pmem->virt_addr = memremap_pmem(dev, pmem->phys_addr,
-                               pmem->size);
-               if (!pmem->virt_addr)
-                       return ERR_PTR(-ENXIO);
-       }
+       if (IS_ERR(pmem->virt_addr))
+               return (void __force *) pmem->virt_addr;
 
        return pmem;
 }
@@ -179,9 +177,10 @@ static void pmem_detach_disk(struct pmem_device *pmem)
 static int pmem_attach_disk(struct device *dev,
                struct nd_namespace_common *ndns, struct pmem_device *pmem)
 {
+       int nid = dev_to_node(dev);
        struct gendisk *disk;
 
-       pmem->pmem_queue = blk_alloc_queue(GFP_KERNEL);
+       pmem->pmem_queue = blk_alloc_queue_node(GFP_KERNEL, nid);
        if (!pmem->pmem_queue)
                return -ENOMEM;
 
@@ -191,7 +190,7 @@ static int pmem_attach_disk(struct device *dev,
        blk_queue_bounce_limit(pmem->pmem_queue, BLK_BOUNCE_ANY);
        queue_flag_set_unlocked(QUEUE_FLAG_NONROT, pmem->pmem_queue);
 
-       disk = alloc_disk(0);
+       disk = alloc_disk_node(0, nid);
        if (!disk) {
                blk_cleanup_queue(pmem->pmem_queue);
                return -ENOMEM;
@@ -363,8 +362,8 @@ static int nvdimm_namespace_attach_pfn(struct nd_namespace_common *ndns)
 
        /* establish pfn range for lookup, and switch to direct map */
        pmem = dev_get_drvdata(dev);
-       memunmap_pmem(dev, pmem->virt_addr);
-       pmem->virt_addr = (void __pmem *)devm_memremap_pages(dev, &nsio->res);
+       devm_memunmap(dev, (void __force *) pmem->virt_addr);
+       pmem->virt_addr = (void __pmem *) devm_memremap_pages(dev, &nsio->res);
        if (IS_ERR(pmem->virt_addr)) {
                rc = PTR_ERR(pmem->virt_addr);
                goto err;
index 97b6640a3745922fe030bbf04525a4b6de6566d6..3dfc28875cc31338be0c33ff040185d03302a3b7 100644 (file)
@@ -90,7 +90,7 @@ static struct class *nvme_class;
 
 static int __nvme_reset(struct nvme_dev *dev);
 static int nvme_reset(struct nvme_dev *dev);
-static int nvme_process_cq(struct nvme_queue *nvmeq);
+static void nvme_process_cq(struct nvme_queue *nvmeq);
 static void nvme_dead_ctrl(struct nvme_dev *dev);
 
 struct async_cmd_info {
@@ -935,7 +935,7 @@ static int nvme_queue_rq(struct blk_mq_hw_ctx *hctx,
        return BLK_MQ_RQ_QUEUE_BUSY;
 }
 
-static int nvme_process_cq(struct nvme_queue *nvmeq)
+static void __nvme_process_cq(struct nvme_queue *nvmeq, unsigned int *tag)
 {
        u16 head, phase;
 
@@ -953,6 +953,8 @@ static int nvme_process_cq(struct nvme_queue *nvmeq)
                        head = 0;
                        phase = !phase;
                }
+               if (tag && *tag == cqe.command_id)
+                       *tag = -1;
                ctx = nvme_finish_cmd(nvmeq, cqe.command_id, &fn);
                fn(nvmeq, ctx, &cqe);
        }
@@ -964,14 +966,18 @@ static int nvme_process_cq(struct nvme_queue *nvmeq)
         * a big problem.
         */
        if (head == nvmeq->cq_head && phase == nvmeq->cq_phase)
-               return 0;
+               return;
 
        writel(head, nvmeq->q_db + nvmeq->dev->db_stride);
        nvmeq->cq_head = head;
        nvmeq->cq_phase = phase;
 
        nvmeq->cqe_seen = 1;
-       return 1;
+}
+
+static void nvme_process_cq(struct nvme_queue *nvmeq)
+{
+       __nvme_process_cq(nvmeq, NULL);
 }
 
 static irqreturn_t nvme_irq(int irq, void *data)
@@ -995,6 +1001,23 @@ static irqreturn_t nvme_irq_check(int irq, void *data)
        return IRQ_WAKE_THREAD;
 }
 
+static int nvme_poll(struct blk_mq_hw_ctx *hctx, unsigned int tag)
+{
+       struct nvme_queue *nvmeq = hctx->driver_data;
+
+       if ((le16_to_cpu(nvmeq->cqes[nvmeq->cq_head].status) & 1) ==
+           nvmeq->cq_phase) {
+               spin_lock_irq(&nvmeq->q_lock);
+               __nvme_process_cq(nvmeq, &tag);
+               spin_unlock_irq(&nvmeq->q_lock);
+
+               if (tag == -1)
+                       return 1;
+       }
+
+       return 0;
+}
+
 /*
  * Returns 0 on success.  If the result is negative, it's a Linux error code;
  * if the result is positive, it's an NVM Express status code
@@ -1656,6 +1679,7 @@ static struct blk_mq_ops nvme_mq_ops = {
        .init_hctx      = nvme_init_hctx,
        .init_request   = nvme_init_request,
        .timeout        = nvme_timeout,
+       .poll           = nvme_poll,
 };
 
 static void nvme_dev_remove_admin(struct nvme_dev *dev)
index 6da01b3bf6f463b606cac8e3b5cb2d834243456a..75db585a2a9486e354c08cf971b46507f014c3d4 100644 (file)
@@ -305,7 +305,7 @@ static int atmel_tcb_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm,
         */
        if (i == 5) {
                i = slowclk;
-               rate = 32768;
+               rate = clk_get_rate(tc->slow_clk);
                min = div_u64(NSEC_PER_SEC, rate);
                max = min << tc->tcb_config->counter_width;
 
@@ -387,9 +387,9 @@ static int atmel_tcb_pwm_probe(struct platform_device *pdev)
 
        tcbpwm = devm_kzalloc(&pdev->dev, sizeof(*tcbpwm), GFP_KERNEL);
        if (tcbpwm == NULL) {
-               atmel_tc_free(tc);
+               err = -ENOMEM;
                dev_err(&pdev->dev, "failed to allocate memory\n");
-               return -ENOMEM;
+               goto err_free_tc;
        }
 
        tcbpwm->chip.dev = &pdev->dev;
@@ -400,17 +400,27 @@ static int atmel_tcb_pwm_probe(struct platform_device *pdev)
        tcbpwm->chip.npwm = NPWM;
        tcbpwm->tc = tc;
 
+       err = clk_prepare_enable(tc->slow_clk);
+       if (err)
+               goto err_free_tc;
+
        spin_lock_init(&tcbpwm->lock);
 
        err = pwmchip_add(&tcbpwm->chip);
-       if (err < 0) {
-               atmel_tc_free(tc);
-               return err;
-       }
+       if (err < 0)
+               goto err_disable_clk;
 
        platform_set_drvdata(pdev, tcbpwm);
 
        return 0;
+
+err_disable_clk:
+       clk_disable_unprepare(tcbpwm->tc->slow_clk);
+
+err_free_tc:
+       atmel_tc_free(tc);
+
+       return err;
 }
 
 static int atmel_tcb_pwm_remove(struct platform_device *pdev)
@@ -418,6 +428,8 @@ static int atmel_tcb_pwm_remove(struct platform_device *pdev)
        struct atmel_tcb_pwm_chip *tcbpwm = platform_get_drvdata(pdev);
        int err;
 
+       clk_disable_unprepare(tcbpwm->tc->slow_clk);
+
        err = pwmchip_remove(&tcbpwm->chip);
        if (err < 0)
                return err;
index 5ed44fe21380645f56c73dc0bef067bffc09c59e..94a8f4ab57bc4c5fa6ccf3fca0002daa25e6a010 100644 (file)
@@ -27,7 +27,8 @@
 
 static int dcssblk_open(struct block_device *bdev, fmode_t mode);
 static void dcssblk_release(struct gendisk *disk, fmode_t mode);
-static void dcssblk_make_request(struct request_queue *q, struct bio *bio);
+static blk_qc_t dcssblk_make_request(struct request_queue *q,
+                                               struct bio *bio);
 static long dcssblk_direct_access(struct block_device *bdev, sector_t secnum,
                         void __pmem **kaddr, unsigned long *pfn);
 
@@ -815,7 +816,7 @@ dcssblk_release(struct gendisk *disk, fmode_t mode)
        up_write(&dcssblk_devices_sem);
 }
 
-static void
+static blk_qc_t
 dcssblk_make_request(struct request_queue *q, struct bio *bio)
 {
        struct dcssblk_dev_info *dev_info;
@@ -874,9 +875,10 @@ dcssblk_make_request(struct request_queue *q, struct bio *bio)
                bytes_done += bvec.bv_len;
        }
        bio_endio(bio);
-       return;
+       return BLK_QC_T_NONE;
 fail:
        bio_io_error(bio);
+       return BLK_QC_T_NONE;
 }
 
 static long
index 02871f1db562ef42a4f6a60b50dc943a550ba251..288f59a4147b1ffee2c330166c957f29406ed500 100644 (file)
@@ -181,7 +181,7 @@ static unsigned long xpram_highest_page_index(void)
 /*
  * Block device make request function.
  */
-static void xpram_make_request(struct request_queue *q, struct bio *bio)
+static blk_qc_t xpram_make_request(struct request_queue *q, struct bio *bio)
 {
        xpram_device_t *xdev = bio->bi_bdev->bd_disk->private_data;
        struct bio_vec bvec;
@@ -223,9 +223,10 @@ static void xpram_make_request(struct request_queue *q, struct bio *bio)
                }
        }
        bio_endio(bio);
-       return;
+       return BLK_QC_T_NONE;
 fail:
        bio_io_error(bio);
+       return BLK_QC_T_NONE;
 }
 
 static int xpram_getgeo(struct block_device *bdev, struct hd_geometry *geo)
index 96ddecb922545e9294040e05950e6c695e01b3c6..4e853ed2c82b937ebd8fb6cf4c22288a122fca3a 100644 (file)
@@ -1,7 +1,9 @@
 menu "SOC (System On Chip) specific Drivers"
 
+source "drivers/soc/brcmstb/Kconfig"
 source "drivers/soc/mediatek/Kconfig"
 source "drivers/soc/qcom/Kconfig"
+source "drivers/soc/rockchip/Kconfig"
 source "drivers/soc/sunxi/Kconfig"
 source "drivers/soc/ti/Kconfig"
 source "drivers/soc/versatile/Kconfig"
index 0b12d777d3c4a9114fa80911b27fbb496c0ae307..f2ba2e932ae10c5d2cda1de269b826b9875a4a5c 100644 (file)
@@ -2,9 +2,11 @@
 # Makefile for the Linux Kernel SOC specific device drivers.
 #
 
+obj-$(CONFIG_SOC_BRCMSTB)      += brcmstb/
 obj-$(CONFIG_MACH_DOVE)                += dove/
 obj-$(CONFIG_ARCH_MEDIATEK)    += mediatek/
 obj-$(CONFIG_ARCH_QCOM)                += qcom/
+obj-$(CONFIG_ARCH_ROCKCHIP)            += rockchip/
 obj-$(CONFIG_ARCH_SUNXI)       += sunxi/
 obj-$(CONFIG_ARCH_TEGRA)       += tegra/
 obj-$(CONFIG_SOC_TI)           += ti/
diff --git a/drivers/soc/brcmstb/Kconfig b/drivers/soc/brcmstb/Kconfig
new file mode 100644 (file)
index 0000000..39cab3b
--- /dev/null
@@ -0,0 +1,9 @@
+menuconfig SOC_BRCMSTB
+       bool "Broadcom STB SoC drivers"
+       depends on ARM
+       help
+         Enables drivers for the Broadcom Set-Top Box (STB) series of chips.
+         This option alone enables only some support code, while the drivers
+         can be enabled individually within this menu.
+
+         If unsure, say N.
diff --git a/drivers/soc/brcmstb/Makefile b/drivers/soc/brcmstb/Makefile
new file mode 100644 (file)
index 0000000..9120b27
--- /dev/null
@@ -0,0 +1 @@
+obj-y                          += common.o biuctrl.o
diff --git a/drivers/soc/brcmstb/biuctrl.c b/drivers/soc/brcmstb/biuctrl.c
new file mode 100644 (file)
index 0000000..9049c07
--- /dev/null
@@ -0,0 +1,116 @@
+/*
+ * Broadcom STB SoCs Bus Unit Interface controls
+ *
+ * Copyright (C) 2015, Broadcom Corporation
+ *
+ * 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.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#define pr_fmt(fmt)    "brcmstb: " KBUILD_MODNAME ": " fmt
+
+#include <linux/kernel.h>
+#include <linux/io.h>
+#include <linux/of_address.h>
+#include <linux/syscore_ops.h>
+
+#define CPU_CREDIT_REG_OFFSET                  0x184
+#define  CPU_CREDIT_REG_MCPx_WR_PAIRING_EN_MASK        0x70000000
+
+static void __iomem *cpubiuctrl_base;
+static bool mcp_wr_pairing_en;
+
+static int __init mcp_write_pairing_set(void)
+{
+       u32 creds = 0;
+
+       if (!cpubiuctrl_base)
+               return -1;
+
+       creds = readl_relaxed(cpubiuctrl_base + CPU_CREDIT_REG_OFFSET);
+       if (mcp_wr_pairing_en) {
+               pr_info("MCP: Enabling write pairing\n");
+               writel_relaxed(creds | CPU_CREDIT_REG_MCPx_WR_PAIRING_EN_MASK,
+                            cpubiuctrl_base + CPU_CREDIT_REG_OFFSET);
+       } else if (creds & CPU_CREDIT_REG_MCPx_WR_PAIRING_EN_MASK) {
+               pr_info("MCP: Disabling write pairing\n");
+               writel_relaxed(creds & ~CPU_CREDIT_REG_MCPx_WR_PAIRING_EN_MASK,
+                               cpubiuctrl_base + CPU_CREDIT_REG_OFFSET);
+       } else {
+               pr_info("MCP: Write pairing already disabled\n");
+       }
+
+       return 0;
+}
+
+static int __init setup_hifcpubiuctrl_regs(void)
+{
+       struct device_node *np;
+       int ret = 0;
+
+       np = of_find_compatible_node(NULL, NULL, "brcm,brcmstb-cpu-biu-ctrl");
+       if (!np) {
+               pr_err("missing BIU control node\n");
+               return -ENODEV;
+       }
+
+       cpubiuctrl_base = of_iomap(np, 0);
+       if (!cpubiuctrl_base) {
+               pr_err("failed to remap BIU control base\n");
+               ret = -ENOMEM;
+               goto out;
+       }
+
+       mcp_wr_pairing_en = of_property_read_bool(np, "brcm,write-pairing");
+out:
+       of_node_put(np);
+       return ret;
+}
+
+#ifdef CONFIG_PM_SLEEP
+static u32 cpu_credit_reg_dump;  /* for save/restore */
+
+static int brcmstb_cpu_credit_reg_suspend(void)
+{
+       if (cpubiuctrl_base)
+               cpu_credit_reg_dump =
+                       readl_relaxed(cpubiuctrl_base + CPU_CREDIT_REG_OFFSET);
+       return 0;
+}
+
+static void brcmstb_cpu_credit_reg_resume(void)
+{
+       if (cpubiuctrl_base)
+               writel_relaxed(cpu_credit_reg_dump,
+                               cpubiuctrl_base + CPU_CREDIT_REG_OFFSET);
+}
+
+static struct syscore_ops brcmstb_cpu_credit_syscore_ops = {
+       .suspend = brcmstb_cpu_credit_reg_suspend,
+       .resume = brcmstb_cpu_credit_reg_resume,
+};
+#endif
+
+
+void __init brcmstb_biuctrl_init(void)
+{
+       int ret;
+
+       setup_hifcpubiuctrl_regs();
+
+       ret = mcp_write_pairing_set();
+       if (ret) {
+               pr_err("MCP: Unable to disable write pairing!\n");
+               return;
+       }
+
+#ifdef CONFIG_PM_SLEEP
+       register_syscore_ops(&brcmstb_cpu_credit_syscore_ops);
+#endif
+}
diff --git a/drivers/soc/brcmstb/common.c b/drivers/soc/brcmstb/common.c
new file mode 100644 (file)
index 0000000..c262c02
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * Copyright Â© 2014 NVIDIA Corporation
+ * Copyright Â© 2015 Broadcom Corporation
+ *
+ * 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.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#include <linux/of.h>
+
+#include <soc/brcmstb/common.h>
+
+static const struct of_device_id brcmstb_machine_match[] = {
+       { .compatible = "brcm,brcmstb", },
+       { }
+};
+
+bool soc_is_brcmstb(void)
+{
+       struct device_node *root;
+
+       root = of_find_node_by_path("/");
+       if (!root)
+               return false;
+
+       return of_match_node(brcmstb_machine_match, root) != NULL;
+}
index 8bc7b41b09fd218bb0e540933c1c07be95005dcb..105597a885cb4f2db4314e5cc9194d701cf843b0 100644 (file)
@@ -725,10 +725,6 @@ static int pwrap_init(struct pmic_wrapper *wrp)
        pwrap_writel(wrp, 0x1, PWRAP_WACS2_EN);
        pwrap_writel(wrp, 0x5, PWRAP_STAUPD_PRD);
        pwrap_writel(wrp, 0xff, PWRAP_STAUPD_GRPEN);
-       pwrap_writel(wrp, 0xf, PWRAP_WDT_UNIT);
-       pwrap_writel(wrp, 0xffffffff, PWRAP_WDT_SRC_EN);
-       pwrap_writel(wrp, 0x1, PWRAP_TIMER_EN);
-       pwrap_writel(wrp, ~((1 << 31) | (1 << 1)), PWRAP_INT_EN);
 
        if (pwrap_is_mt8135(wrp)) {
                /* enable pwrap events and pwrap bridge in AP side */
@@ -896,6 +892,12 @@ static int pwrap_probe(struct platform_device *pdev)
                return -ENODEV;
        }
 
+       /* Initialize watchdog, may not be done by the bootloader */
+       pwrap_writel(wrp, 0xf, PWRAP_WDT_UNIT);
+       pwrap_writel(wrp, 0xffffffff, PWRAP_WDT_SRC_EN);
+       pwrap_writel(wrp, 0x1, PWRAP_TIMER_EN);
+       pwrap_writel(wrp, ~((1 << 31) | (1 << 1)), PWRAP_INT_EN);
+
        irq = platform_get_irq(pdev, 0);
        ret = devm_request_irq(wrp->dev, irq, pwrap_interrupt, IRQF_TRIGGER_HIGH,
                        "mt-pmic-pwrap", wrp);
index 164a7d8439b148de97d7a3f4153786c52277df5b..4d4203c896c40e71486dd27e60e0918071c1e0ae 100644 (file)
 #define PWR_STATUS_USB                 BIT(25)
 
 enum clk_id {
+       MT8173_CLK_NONE,
        MT8173_CLK_MM,
        MT8173_CLK_MFG,
-       MT8173_CLK_NONE,
-       MT8173_CLK_MAX = MT8173_CLK_NONE,
+       MT8173_CLK_VENC,
+       MT8173_CLK_VENC_LT,
+       MT8173_CLK_MAX,
 };
 
+#define MAX_CLKS       2
+
 struct scp_domain_data {
        const char *name;
        u32 sta_mask;
@@ -67,7 +71,8 @@ struct scp_domain_data {
        u32 sram_pdn_bits;
        u32 sram_pdn_ack_bits;
        u32 bus_prot_mask;
-       enum clk_id clk_id;
+       enum clk_id clk_id[MAX_CLKS];
+       bool active_wakeup;
 };
 
 static const struct scp_domain_data scp_domain_data[] __initconst = {
@@ -77,7 +82,7 @@ static const struct scp_domain_data scp_domain_data[] __initconst = {
                .ctl_offs = SPM_VDE_PWR_CON,
                .sram_pdn_bits = GENMASK(11, 8),
                .sram_pdn_ack_bits = GENMASK(12, 12),
-               .clk_id = MT8173_CLK_MM,
+               .clk_id = {MT8173_CLK_MM},
        },
        [MT8173_POWER_DOMAIN_VENC] = {
                .name = "venc",
@@ -85,7 +90,7 @@ static const struct scp_domain_data scp_domain_data[] __initconst = {
                .ctl_offs = SPM_VEN_PWR_CON,
                .sram_pdn_bits = GENMASK(11, 8),
                .sram_pdn_ack_bits = GENMASK(15, 12),
-               .clk_id = MT8173_CLK_MM,
+               .clk_id = {MT8173_CLK_MM, MT8173_CLK_VENC},
        },
        [MT8173_POWER_DOMAIN_ISP] = {
                .name = "isp",
@@ -93,7 +98,7 @@ static const struct scp_domain_data scp_domain_data[] __initconst = {
                .ctl_offs = SPM_ISP_PWR_CON,
                .sram_pdn_bits = GENMASK(11, 8),
                .sram_pdn_ack_bits = GENMASK(13, 12),
-               .clk_id = MT8173_CLK_MM,
+               .clk_id = {MT8173_CLK_MM},
        },
        [MT8173_POWER_DOMAIN_MM] = {
                .name = "mm",
@@ -101,7 +106,7 @@ static const struct scp_domain_data scp_domain_data[] __initconst = {
                .ctl_offs = SPM_DIS_PWR_CON,
                .sram_pdn_bits = GENMASK(11, 8),
                .sram_pdn_ack_bits = GENMASK(12, 12),
-               .clk_id = MT8173_CLK_MM,
+               .clk_id = {MT8173_CLK_MM},
                .bus_prot_mask = MT8173_TOP_AXI_PROT_EN_MM_M0 |
                        MT8173_TOP_AXI_PROT_EN_MM_M1,
        },
@@ -111,7 +116,7 @@ static const struct scp_domain_data scp_domain_data[] __initconst = {
                .ctl_offs = SPM_VEN2_PWR_CON,
                .sram_pdn_bits = GENMASK(11, 8),
                .sram_pdn_ack_bits = GENMASK(15, 12),
-               .clk_id = MT8173_CLK_MM,
+               .clk_id = {MT8173_CLK_MM, MT8173_CLK_VENC_LT},
        },
        [MT8173_POWER_DOMAIN_AUDIO] = {
                .name = "audio",
@@ -119,7 +124,7 @@ static const struct scp_domain_data scp_domain_data[] __initconst = {
                .ctl_offs = SPM_AUDIO_PWR_CON,
                .sram_pdn_bits = GENMASK(11, 8),
                .sram_pdn_ack_bits = GENMASK(15, 12),
-               .clk_id = MT8173_CLK_NONE,
+               .clk_id = {MT8173_CLK_NONE},
        },
        [MT8173_POWER_DOMAIN_USB] = {
                .name = "usb",
@@ -127,7 +132,8 @@ static const struct scp_domain_data scp_domain_data[] __initconst = {
                .ctl_offs = SPM_USB_PWR_CON,
                .sram_pdn_bits = GENMASK(11, 8),
                .sram_pdn_ack_bits = GENMASK(15, 12),
-               .clk_id = MT8173_CLK_NONE,
+               .clk_id = {MT8173_CLK_NONE},
+               .active_wakeup = true,
        },
        [MT8173_POWER_DOMAIN_MFG_ASYNC] = {
                .name = "mfg_async",
@@ -135,7 +141,7 @@ static const struct scp_domain_data scp_domain_data[] __initconst = {
                .ctl_offs = SPM_MFG_ASYNC_PWR_CON,
                .sram_pdn_bits = GENMASK(11, 8),
                .sram_pdn_ack_bits = 0,
-               .clk_id = MT8173_CLK_MFG,
+               .clk_id = {MT8173_CLK_MFG},
        },
        [MT8173_POWER_DOMAIN_MFG_2D] = {
                .name = "mfg_2d",
@@ -143,7 +149,7 @@ static const struct scp_domain_data scp_domain_data[] __initconst = {
                .ctl_offs = SPM_MFG_2D_PWR_CON,
                .sram_pdn_bits = GENMASK(11, 8),
                .sram_pdn_ack_bits = GENMASK(13, 12),
-               .clk_id = MT8173_CLK_NONE,
+               .clk_id = {MT8173_CLK_NONE},
        },
        [MT8173_POWER_DOMAIN_MFG] = {
                .name = "mfg",
@@ -151,7 +157,7 @@ static const struct scp_domain_data scp_domain_data[] __initconst = {
                .ctl_offs = SPM_MFG_PWR_CON,
                .sram_pdn_bits = GENMASK(13, 8),
                .sram_pdn_ack_bits = GENMASK(21, 16),
-               .clk_id = MT8173_CLK_NONE,
+               .clk_id = {MT8173_CLK_NONE},
                .bus_prot_mask = MT8173_TOP_AXI_PROT_EN_MFG_S |
                        MT8173_TOP_AXI_PROT_EN_MFG_M0 |
                        MT8173_TOP_AXI_PROT_EN_MFG_M1 |
@@ -166,12 +172,13 @@ struct scp;
 struct scp_domain {
        struct generic_pm_domain genpd;
        struct scp *scp;
-       struct clk *clk;
+       struct clk *clk[MAX_CLKS];
        u32 sta_mask;
        void __iomem *ctl_addr;
        u32 sram_pdn_bits;
        u32 sram_pdn_ack_bits;
        u32 bus_prot_mask;
+       bool active_wakeup;
 };
 
 struct scp {
@@ -212,11 +219,16 @@ static int scpsys_power_on(struct generic_pm_domain *genpd)
        u32 sram_pdn_ack = scpd->sram_pdn_ack_bits;
        u32 val;
        int ret;
+       int i;
+
+       for (i = 0; i < MAX_CLKS && scpd->clk[i]; i++) {
+               ret = clk_prepare_enable(scpd->clk[i]);
+               if (ret) {
+                       for (--i; i >= 0; i--)
+                               clk_disable_unprepare(scpd->clk[i]);
 
-       if (scpd->clk) {
-               ret = clk_prepare_enable(scpd->clk);
-               if (ret)
                        goto err_clk;
+               }
        }
 
        val = readl(ctl_addr);
@@ -282,7 +294,10 @@ static int scpsys_power_on(struct generic_pm_domain *genpd)
        return 0;
 
 err_pwr_ack:
-       clk_disable_unprepare(scpd->clk);
+       for (i = MAX_CLKS - 1; i >= 0; i--) {
+               if (scpd->clk[i])
+                       clk_disable_unprepare(scpd->clk[i]);
+       }
 err_clk:
        dev_err(scp->dev, "Failed to power on domain %s\n", genpd->name);
 
@@ -299,6 +314,7 @@ static int scpsys_power_off(struct generic_pm_domain *genpd)
        u32 pdn_ack = scpd->sram_pdn_ack_bits;
        u32 val;
        int ret;
+       int i;
 
        if (scpd->bus_prot_mask) {
                ret = mtk_infracfg_set_bus_protection(scp->infracfg,
@@ -360,8 +376,8 @@ static int scpsys_power_off(struct generic_pm_domain *genpd)
                        expired = true;
        }
 
-       if (scpd->clk)
-               clk_disable_unprepare(scpd->clk);
+       for (i = 0; i < MAX_CLKS && scpd->clk[i]; i++)
+               clk_disable_unprepare(scpd->clk[i]);
 
        return 0;
 
@@ -371,11 +387,22 @@ out:
        return ret;
 }
 
+static bool scpsys_active_wakeup(struct device *dev)
+{
+       struct generic_pm_domain *genpd;
+       struct scp_domain *scpd;
+
+       genpd = pd_to_genpd(dev->pm_domain);
+       scpd = container_of(genpd, struct scp_domain, genpd);
+
+       return scpd->active_wakeup;
+}
+
 static int __init scpsys_probe(struct platform_device *pdev)
 {
        struct genpd_onecell_data *pd_data;
        struct resource *res;
-       int i, ret;
+       int i, j, ret;
        struct scp *scp;
        struct clk *clk[MT8173_CLK_MAX];
 
@@ -405,6 +432,14 @@ static int __init scpsys_probe(struct platform_device *pdev)
        if (IS_ERR(clk[MT8173_CLK_MFG]))
                return PTR_ERR(clk[MT8173_CLK_MFG]);
 
+       clk[MT8173_CLK_VENC] = devm_clk_get(&pdev->dev, "venc");
+       if (IS_ERR(clk[MT8173_CLK_VENC]))
+               return PTR_ERR(clk[MT8173_CLK_VENC]);
+
+       clk[MT8173_CLK_VENC_LT] = devm_clk_get(&pdev->dev, "venc_lt");
+       if (IS_ERR(clk[MT8173_CLK_VENC_LT]))
+               return PTR_ERR(clk[MT8173_CLK_VENC_LT]);
+
        scp->infracfg = syscon_regmap_lookup_by_phandle(pdev->dev.of_node,
                        "infracfg");
        if (IS_ERR(scp->infracfg)) {
@@ -428,12 +463,14 @@ static int __init scpsys_probe(struct platform_device *pdev)
                scpd->sram_pdn_bits = data->sram_pdn_bits;
                scpd->sram_pdn_ack_bits = data->sram_pdn_ack_bits;
                scpd->bus_prot_mask = data->bus_prot_mask;
-               if (data->clk_id != MT8173_CLK_NONE)
-                       scpd->clk = clk[data->clk_id];
+               scpd->active_wakeup = data->active_wakeup;
+               for (j = 0; j < MAX_CLKS && data->clk_id[j]; j++)
+                       scpd->clk[j] = clk[data->clk_id[j]];
 
                genpd->name = data->name;
                genpd->power_off = scpsys_power_off;
                genpd->power_on = scpsys_power_on;
+               genpd->dev_ops.active_wakeup = scpsys_active_wakeup;
 
                /*
                 * Initially turn on all domains to make the domains usable
index ba47b70f4d856d23a58ae6df69577b2dbc1932d8..eec76141d9b9a64cb0e606b069c8a63984fcb1ca 100644 (file)
@@ -19,6 +19,15 @@ config QCOM_PM
          modes. It interface with various system drivers to put the cores in
          low power modes.
 
+config QCOM_SMEM
+       tristate "Qualcomm Shared Memory Manager (SMEM)"
+       depends on ARCH_QCOM
+       depends on HWSPINLOCK
+       help
+         Say y here to enable support for the Qualcomm Shared Memory Manager.
+         The driver provides an interface to items in a heap shared among all
+         processors in a Qualcomm platform.
+
 config QCOM_SMD
        tristate "Qualcomm Shared Memory Driver (SMD)"
        depends on QCOM_SMEM
@@ -40,11 +49,3 @@ config QCOM_SMD_RPM
 
          Say M here if you want to include support for the Qualcomm RPM as a
          module. This will build a module called "qcom-smd-rpm".
-
-config QCOM_SMEM
-       tristate "Qualcomm Shared Memory Manager (SMEM)"
-       depends on ARCH_QCOM
-       help
-         Say y here to enable support for the Qualcomm Shared Memory Manager.
-         The driver provides an interface to items in a heap shared among all
-         processors in a Qualcomm platform.
index 1392ccf14a201b2ba01c76fdebc356c90cc99c4f..2969321e1b095fa6869e23e95a6825748d8ed58d 100644 (file)
@@ -17,6 +17,7 @@
 #include <linux/of_platform.h>
 #include <linux/io.h>
 #include <linux/interrupt.h>
+#include <linux/slab.h>
 
 #include <linux/soc/qcom/smd.h>
 #include <linux/soc/qcom/smd-rpm.h>
@@ -44,8 +45,8 @@ struct qcom_smd_rpm {
  * @length:            length of the payload
  */
 struct qcom_rpm_header {
-       u32 service_type;
-       u32 length;
+       __le32 service_type;
+       __le32 length;
 };
 
 /**
@@ -57,11 +58,11 @@ struct qcom_rpm_header {
  * @data_len:  length of the payload following this header
  */
 struct qcom_rpm_request {
-       u32 msg_id;
-       u32 flags;
-       u32 type;
-       u32 id;
-       u32 data_len;
+       __le32 msg_id;
+       __le32 flags;
+       __le32 type;
+       __le32 id;
+       __le32 data_len;
 };
 
 /**
@@ -74,10 +75,10 @@ struct qcom_rpm_request {
  * Multiple of these messages can be stacked in an rpm message.
  */
 struct qcom_rpm_message {
-       u32 msg_type;
-       u32 length;
+       __le32 msg_type;
+       __le32 length;
        union {
-               u32 msg_id;
+               __le32 msg_id;
                u8 message[0];
        };
 };
@@ -104,30 +105,34 @@ int qcom_rpm_smd_write(struct qcom_smd_rpm *rpm,
        static unsigned msg_id = 1;
        int left;
        int ret;
-
        struct {
                struct qcom_rpm_header hdr;
                struct qcom_rpm_request req;
-               u8 payload[count];
-       } pkt;
+               u8 payload[];
+       } *pkt;
+       size_t size = sizeof(*pkt) + count;
 
        /* SMD packets to the RPM may not exceed 256 bytes */
-       if (WARN_ON(sizeof(pkt) >= 256))
+       if (WARN_ON(size >= 256))
                return -EINVAL;
 
+       pkt = kmalloc(size, GFP_KERNEL);
+       if (!pkt)
+               return -ENOMEM;
+
        mutex_lock(&rpm->lock);
 
-       pkt.hdr.service_type = RPM_SERVICE_TYPE_REQUEST;
-       pkt.hdr.length = sizeof(struct qcom_rpm_request) + count;
+       pkt->hdr.service_type = cpu_to_le32(RPM_SERVICE_TYPE_REQUEST);
+       pkt->hdr.length = cpu_to_le32(sizeof(struct qcom_rpm_request) + count);
 
-       pkt.req.msg_id = msg_id++;
-       pkt.req.flags = BIT(state);
-       pkt.req.type = type;
-       pkt.req.id = id;
-       pkt.req.data_len = count;
-       memcpy(pkt.payload, buf, count);
+       pkt->req.msg_id = cpu_to_le32(msg_id++);
+       pkt->req.flags = cpu_to_le32(state);
+       pkt->req.type = cpu_to_le32(type);
+       pkt->req.id = cpu_to_le32(id);
+       pkt->req.data_len = cpu_to_le32(count);
+       memcpy(pkt->payload, buf, count);
 
-       ret = qcom_smd_send(rpm->rpm_channel, &pkt, sizeof(pkt));
+       ret = qcom_smd_send(rpm->rpm_channel, pkt, size);
        if (ret)
                goto out;
 
@@ -138,6 +143,7 @@ int qcom_rpm_smd_write(struct qcom_smd_rpm *rpm,
                ret = rpm->ack_status;
 
 out:
+       kfree(pkt);
        mutex_unlock(&rpm->lock);
        return ret;
 }
@@ -148,27 +154,29 @@ static int qcom_smd_rpm_callback(struct qcom_smd_device *qsdev,
                                 size_t count)
 {
        const struct qcom_rpm_header *hdr = data;
+       size_t hdr_length = le32_to_cpu(hdr->length);
        const struct qcom_rpm_message *msg;
        struct qcom_smd_rpm *rpm = dev_get_drvdata(&qsdev->dev);
        const u8 *buf = data + sizeof(struct qcom_rpm_header);
-       const u8 *end = buf + hdr->length;
+       const u8 *end = buf + hdr_length;
        char msgbuf[32];
        int status = 0;
-       u32 len;
+       u32 len, msg_length;
 
-       if (hdr->service_type != RPM_SERVICE_TYPE_REQUEST ||
-           hdr->length < sizeof(struct qcom_rpm_message)) {
+       if (le32_to_cpu(hdr->service_type) != RPM_SERVICE_TYPE_REQUEST ||
+           hdr_length < sizeof(struct qcom_rpm_message)) {
                dev_err(&qsdev->dev, "invalid request\n");
                return 0;
        }
 
        while (buf < end) {
                msg = (struct qcom_rpm_message *)buf;
-               switch (msg->msg_type) {
+               msg_length = le32_to_cpu(msg->length);
+               switch (le32_to_cpu(msg->msg_type)) {
                case RPM_MSG_TYPE_MSG_ID:
                        break;
                case RPM_MSG_TYPE_ERR:
-                       len = min_t(u32, ALIGN(msg->length, 4), sizeof(msgbuf));
+                       len = min_t(u32, ALIGN(msg_length, 4), sizeof(msgbuf));
                        memcpy_fromio(msgbuf, msg->message, len);
                        msgbuf[len - 1] = 0;
 
@@ -179,7 +187,7 @@ static int qcom_smd_rpm_callback(struct qcom_smd_device *qsdev,
                        break;
                }
 
-               buf = PTR_ALIGN(buf + 2 * sizeof(u32) + msg->length, 4);
+               buf = PTR_ALIGN(buf + 2 * sizeof(u32) + msg_length, 4);
        }
 
        rpm->ack_status = status;
index a6155c917d52d03a088a2ccbbd5a25220f392c60..86b598cff91a95a38003a65682135989dfa8f3e3 100644 (file)
@@ -65,7 +65,9 @@
  */
 
 struct smd_channel_info;
+struct smd_channel_info_pair;
 struct smd_channel_info_word;
+struct smd_channel_info_word_pair;
 
 #define SMD_ALLOC_TBL_COUNT    2
 #define SMD_ALLOC_TBL_SIZE     64
@@ -85,8 +87,8 @@ static const struct {
                .fifo_base_id = 338
        },
        {
-               .alloc_tbl_id = 14,
-               .info_base_id = 266,
+               .alloc_tbl_id = 266,
+               .info_base_id = 138,
                .fifo_base_id = 202,
        },
 };
@@ -151,10 +153,8 @@ enum smd_channel_state {
  * @name:              name of the channel
  * @state:             local state of the channel
  * @remote_state:      remote state of the channel
- * @tx_info:           byte aligned outgoing channel info
- * @rx_info:           byte aligned incoming channel info
- * @tx_info_word:      word aligned outgoing channel info
- * @rx_info_word:      word aligned incoming channel info
+ * @info:              byte aligned outgoing/incoming channel info
+ * @info_word:         word aligned outgoing/incoming channel info
  * @tx_lock:           lock to make writes to the channel mutually exclusive
  * @fblockread_event:  wakeup event tied to tx fBLOCKREADINTR
  * @tx_fifo:           pointer to the outgoing ring buffer
@@ -175,11 +175,8 @@ struct qcom_smd_channel {
        enum smd_channel_state state;
        enum smd_channel_state remote_state;
 
-       struct smd_channel_info *tx_info;
-       struct smd_channel_info *rx_info;
-
-       struct smd_channel_info_word *tx_info_word;
-       struct smd_channel_info_word *rx_info_word;
+       struct smd_channel_info_pair *info;
+       struct smd_channel_info_word_pair *info_word;
 
        struct mutex tx_lock;
        wait_queue_head_t fblockread_event;
@@ -215,7 +212,7 @@ struct qcom_smd {
  * Format of the smd_info smem items, for byte aligned channels.
  */
 struct smd_channel_info {
-       u32 state;
+       __le32 state;
        u8  fDSR;
        u8  fCTS;
        u8  fCD;
@@ -224,46 +221,104 @@ struct smd_channel_info {
        u8  fTAIL;
        u8  fSTATE;
        u8  fBLOCKREADINTR;
-       u32 tail;
-       u32 head;
+       __le32 tail;
+       __le32 head;
+};
+
+struct smd_channel_info_pair {
+       struct smd_channel_info tx;
+       struct smd_channel_info rx;
 };
 
 /*
  * Format of the smd_info smem items, for word aligned channels.
  */
 struct smd_channel_info_word {
-       u32 state;
-       u32 fDSR;
-       u32 fCTS;
-       u32 fCD;
-       u32 fRI;
-       u32 fHEAD;
-       u32 fTAIL;
-       u32 fSTATE;
-       u32 fBLOCKREADINTR;
-       u32 tail;
-       u32 head;
+       __le32 state;
+       __le32 fDSR;
+       __le32 fCTS;
+       __le32 fCD;
+       __le32 fRI;
+       __le32 fHEAD;
+       __le32 fTAIL;
+       __le32 fSTATE;
+       __le32 fBLOCKREADINTR;
+       __le32 tail;
+       __le32 head;
 };
 
-#define GET_RX_CHANNEL_INFO(channel, param) \
-       (channel->rx_info_word ? \
-               channel->rx_info_word->param : \
-               channel->rx_info->param)
-
-#define SET_RX_CHANNEL_INFO(channel, param, value) \
-       (channel->rx_info_word ? \
-               (channel->rx_info_word->param = value) : \
-               (channel->rx_info->param = value))
-
-#define GET_TX_CHANNEL_INFO(channel, param) \
-       (channel->tx_info_word ? \
-               channel->tx_info_word->param : \
-               channel->tx_info->param)
+struct smd_channel_info_word_pair {
+       struct smd_channel_info_word tx;
+       struct smd_channel_info_word rx;
+};
 
-#define SET_TX_CHANNEL_INFO(channel, param, value) \
-       (channel->tx_info_word ? \
-               (channel->tx_info_word->param = value) : \
-               (channel->tx_info->param = value))
+#define GET_RX_CHANNEL_FLAG(channel, param)                                 \
+       ({                                                                   \
+               BUILD_BUG_ON(sizeof(channel->info->rx.param) != sizeof(u8)); \
+               channel->info_word ?                                         \
+                       le32_to_cpu(channel->info_word->rx.param) :          \
+                       channel->info->rx.param;                             \
+       })
+
+#define GET_RX_CHANNEL_INFO(channel, param)                                  \
+       ({                                                                    \
+               BUILD_BUG_ON(sizeof(channel->info->rx.param) != sizeof(u32)); \
+               le32_to_cpu(channel->info_word ?                              \
+                       channel->info_word->rx.param :                        \
+                       channel->info->rx.param);                             \
+       })
+
+#define SET_RX_CHANNEL_FLAG(channel, param, value)                          \
+       ({                                                                   \
+               BUILD_BUG_ON(sizeof(channel->info->rx.param) != sizeof(u8)); \
+               if (channel->info_word)                                      \
+                       channel->info_word->rx.param = cpu_to_le32(value);   \
+               else                                                         \
+                       channel->info->rx.param = value;                     \
+       })
+
+#define SET_RX_CHANNEL_INFO(channel, param, value)                           \
+       ({                                                                    \
+               BUILD_BUG_ON(sizeof(channel->info->rx.param) != sizeof(u32)); \
+               if (channel->info_word)                                       \
+                       channel->info_word->rx.param = cpu_to_le32(value);    \
+               else                                                          \
+                       channel->info->rx.param = cpu_to_le32(value);         \
+       })
+
+#define GET_TX_CHANNEL_FLAG(channel, param)                                 \
+       ({                                                                   \
+               BUILD_BUG_ON(sizeof(channel->info->tx.param) != sizeof(u8)); \
+               channel->info_word ?                                         \
+                       le32_to_cpu(channel->info_word->tx.param) :          \
+                       channel->info->tx.param;                             \
+       })
+
+#define GET_TX_CHANNEL_INFO(channel, param)                                  \
+       ({                                                                    \
+               BUILD_BUG_ON(sizeof(channel->info->tx.param) != sizeof(u32)); \
+               le32_to_cpu(channel->info_word ?                              \
+                       channel->info_word->tx.param :                        \
+                       channel->info->tx.param);                             \
+       })
+
+#define SET_TX_CHANNEL_FLAG(channel, param, value)                          \
+       ({                                                                   \
+               BUILD_BUG_ON(sizeof(channel->info->tx.param) != sizeof(u8)); \
+               if (channel->info_word)                                      \
+                       channel->info_word->tx.param = cpu_to_le32(value);   \
+               else                                                         \
+                       channel->info->tx.param = value;                     \
+       })
+
+#define SET_TX_CHANNEL_INFO(channel, param, value)                           \
+       ({                                                                    \
+               BUILD_BUG_ON(sizeof(channel->info->tx.param) != sizeof(u32)); \
+               if (channel->info_word)                                       \
+                       channel->info_word->tx.param = cpu_to_le32(value);   \
+               else                                                          \
+                       channel->info->tx.param = cpu_to_le32(value);         \
+       })
 
 /**
  * struct qcom_smd_alloc_entry - channel allocation entry
@@ -274,9 +329,9 @@ struct smd_channel_info_word {
  */
 struct qcom_smd_alloc_entry {
        u8 name[20];
-       u32 cid;
-       u32 flags;
-       u32 ref_count;
+       __le32 cid;
+       __le32 flags;
+       __le32 ref_count;
 } __packed;
 
 #define SMD_CHANNEL_FLAGS_EDGE_MASK    0xff
@@ -305,14 +360,14 @@ static void qcom_smd_signal_channel(struct qcom_smd_channel *channel)
 static void qcom_smd_channel_reset(struct qcom_smd_channel *channel)
 {
        SET_TX_CHANNEL_INFO(channel, state, SMD_CHANNEL_CLOSED);
-       SET_TX_CHANNEL_INFO(channel, fDSR, 0);
-       SET_TX_CHANNEL_INFO(channel, fCTS, 0);
-       SET_TX_CHANNEL_INFO(channel, fCD, 0);
-       SET_TX_CHANNEL_INFO(channel, fRI, 0);
-       SET_TX_CHANNEL_INFO(channel, fHEAD, 0);
-       SET_TX_CHANNEL_INFO(channel, fTAIL, 0);
-       SET_TX_CHANNEL_INFO(channel, fSTATE, 1);
-       SET_TX_CHANNEL_INFO(channel, fBLOCKREADINTR, 1);
+       SET_TX_CHANNEL_FLAG(channel, fDSR, 0);
+       SET_TX_CHANNEL_FLAG(channel, fCTS, 0);
+       SET_TX_CHANNEL_FLAG(channel, fCD, 0);
+       SET_TX_CHANNEL_FLAG(channel, fRI, 0);
+       SET_TX_CHANNEL_FLAG(channel, fHEAD, 0);
+       SET_TX_CHANNEL_FLAG(channel, fTAIL, 0);
+       SET_TX_CHANNEL_FLAG(channel, fSTATE, 1);
+       SET_TX_CHANNEL_FLAG(channel, fBLOCKREADINTR, 1);
        SET_TX_CHANNEL_INFO(channel, head, 0);
        SET_TX_CHANNEL_INFO(channel, tail, 0);
 
@@ -350,12 +405,12 @@ static void qcom_smd_channel_set_state(struct qcom_smd_channel *channel,
 
        dev_dbg(edge->smd->dev, "set_state(%s, %d)\n", channel->name, state);
 
-       SET_TX_CHANNEL_INFO(channel, fDSR, is_open);
-       SET_TX_CHANNEL_INFO(channel, fCTS, is_open);
-       SET_TX_CHANNEL_INFO(channel, fCD, is_open);
+       SET_TX_CHANNEL_FLAG(channel, fDSR, is_open);
+       SET_TX_CHANNEL_FLAG(channel, fCTS, is_open);
+       SET_TX_CHANNEL_FLAG(channel, fCD, is_open);
 
        SET_TX_CHANNEL_INFO(channel, state, state);
-       SET_TX_CHANNEL_INFO(channel, fSTATE, 1);
+       SET_TX_CHANNEL_FLAG(channel, fSTATE, 1);
 
        channel->state = state;
        qcom_smd_signal_channel(channel);
@@ -364,20 +419,15 @@ static void qcom_smd_channel_set_state(struct qcom_smd_channel *channel,
 /*
  * Copy count bytes of data using 32bit accesses, if that's required.
  */
-static void smd_copy_to_fifo(void __iomem *_dst,
-                            const void *_src,
+static void smd_copy_to_fifo(void __iomem *dst,
+                            const void *src,
                             size_t count,
                             bool word_aligned)
 {
-       u32 *dst = (u32 *)_dst;
-       u32 *src = (u32 *)_src;
-
        if (word_aligned) {
-               count /= sizeof(u32);
-               while (count--)
-                       writel_relaxed(*src++, dst++);
+               __iowrite32_copy(dst, src, count / sizeof(u32));
        } else {
-               memcpy_toio(_dst, _src, count);
+               memcpy_toio(dst, src, count);
        }
 }
 
@@ -395,7 +445,7 @@ static void smd_copy_from_fifo(void *_dst,
        if (word_aligned) {
                count /= sizeof(u32);
                while (count--)
-                       *dst++ = readl_relaxed(src++);
+                       *dst++ = __raw_readl(src++);
        } else {
                memcpy_fromio(_dst, _src, count);
        }
@@ -412,7 +462,7 @@ static size_t qcom_smd_channel_peek(struct qcom_smd_channel *channel,
        unsigned tail;
        size_t len;
 
-       word_aligned = channel->rx_info_word != NULL;
+       word_aligned = channel->info_word;
        tail = GET_RX_CHANNEL_INFO(channel, tail);
 
        len = min_t(size_t, count, channel->fifo_size - tail);
@@ -491,7 +541,7 @@ static bool qcom_smd_channel_intr(struct qcom_smd_channel *channel)
 {
        bool need_state_scan = false;
        int remote_state;
-       u32 pktlen;
+       __le32 pktlen;
        int avail;
        int ret;
 
@@ -502,10 +552,10 @@ static bool qcom_smd_channel_intr(struct qcom_smd_channel *channel)
                need_state_scan = true;
        }
        /* Indicate that we have seen any state change */
-       SET_RX_CHANNEL_INFO(channel, fSTATE, 0);
+       SET_RX_CHANNEL_FLAG(channel, fSTATE, 0);
 
        /* Signal waiting qcom_smd_send() about the interrupt */
-       if (!GET_TX_CHANNEL_INFO(channel, fBLOCKREADINTR))
+       if (!GET_TX_CHANNEL_FLAG(channel, fBLOCKREADINTR))
                wake_up_interruptible(&channel->fblockread_event);
 
        /* Don't consume any data until we've opened the channel */
@@ -513,7 +563,7 @@ static bool qcom_smd_channel_intr(struct qcom_smd_channel *channel)
                goto out;
 
        /* Indicate that we've seen the new data */
-       SET_RX_CHANNEL_INFO(channel, fHEAD, 0);
+       SET_RX_CHANNEL_FLAG(channel, fHEAD, 0);
 
        /* Consume data */
        for (;;) {
@@ -522,7 +572,7 @@ static bool qcom_smd_channel_intr(struct qcom_smd_channel *channel)
                if (!channel->pkt_size && avail >= SMD_PACKET_HEADER_LEN) {
                        qcom_smd_channel_peek(channel, &pktlen, sizeof(pktlen));
                        qcom_smd_channel_advance(channel, SMD_PACKET_HEADER_LEN);
-                       channel->pkt_size = pktlen;
+                       channel->pkt_size = le32_to_cpu(pktlen);
                } else if (channel->pkt_size && avail >= channel->pkt_size) {
                        ret = qcom_smd_channel_recv_single(channel);
                        if (ret)
@@ -533,10 +583,10 @@ static bool qcom_smd_channel_intr(struct qcom_smd_channel *channel)
        }
 
        /* Indicate that we have seen and updated tail */
-       SET_RX_CHANNEL_INFO(channel, fTAIL, 1);
+       SET_RX_CHANNEL_FLAG(channel, fTAIL, 1);
 
        /* Signal the remote that we've consumed the data (if requested) */
-       if (!GET_RX_CHANNEL_INFO(channel, fBLOCKREADINTR)) {
+       if (!GET_RX_CHANNEL_FLAG(channel, fBLOCKREADINTR)) {
                /* Ensure ordering of channel info updates */
                wmb();
 
@@ -627,7 +677,7 @@ static int qcom_smd_write_fifo(struct qcom_smd_channel *channel,
        unsigned head;
        size_t len;
 
-       word_aligned = channel->tx_info_word != NULL;
+       word_aligned = channel->info_word;
        head = GET_TX_CHANNEL_INFO(channel, head);
 
        len = min_t(size_t, count, channel->fifo_size - head);
@@ -665,12 +715,16 @@ static int qcom_smd_write_fifo(struct qcom_smd_channel *channel,
  */
 int qcom_smd_send(struct qcom_smd_channel *channel, const void *data, int len)
 {
-       u32 hdr[5] = {len,};
+       __le32 hdr[5] = { cpu_to_le32(len), };
        int tlen = sizeof(hdr) + len;
        int ret;
 
        /* Word aligned channels only accept word size aligned data */
-       if (channel->rx_info_word != NULL && len % 4)
+       if (channel->info_word && len % 4)
+               return -EINVAL;
+
+       /* Reject packets that are too big */
+       if (tlen >= channel->fifo_size)
                return -EINVAL;
 
        ret = mutex_lock_interruptible(&channel->tx_lock);
@@ -683,7 +737,7 @@ int qcom_smd_send(struct qcom_smd_channel *channel, const void *data, int len)
                        goto out;
                }
 
-               SET_TX_CHANNEL_INFO(channel, fBLOCKREADINTR, 0);
+               SET_TX_CHANNEL_FLAG(channel, fBLOCKREADINTR, 0);
 
                ret = wait_event_interruptible(channel->fblockread_event,
                                       qcom_smd_get_tx_avail(channel) >= tlen ||
@@ -691,15 +745,15 @@ int qcom_smd_send(struct qcom_smd_channel *channel, const void *data, int len)
                if (ret)
                        goto out;
 
-               SET_TX_CHANNEL_INFO(channel, fBLOCKREADINTR, 1);
+               SET_TX_CHANNEL_FLAG(channel, fBLOCKREADINTR, 1);
        }
 
-       SET_TX_CHANNEL_INFO(channel, fTAIL, 0);
+       SET_TX_CHANNEL_FLAG(channel, fTAIL, 0);
 
        qcom_smd_write_fifo(channel, hdr, sizeof(hdr));
        qcom_smd_write_fifo(channel, data, len);
 
-       SET_TX_CHANNEL_INFO(channel, fHEAD, 1);
+       SET_TX_CHANNEL_FLAG(channel, fHEAD, 1);
 
        /* Ensure ordering of channel info updates */
        wmb();
@@ -727,6 +781,19 @@ static struct qcom_smd_driver *to_smd_driver(struct device *dev)
 
 static int qcom_smd_dev_match(struct device *dev, struct device_driver *drv)
 {
+       struct qcom_smd_device *qsdev = to_smd_device(dev);
+       struct qcom_smd_driver *qsdrv = container_of(drv, struct qcom_smd_driver, driver);
+       const struct qcom_smd_id *match = qsdrv->smd_match_table;
+       const char *name = qsdev->channel->name;
+
+       if (match) {
+               while (match->name[0]) {
+                       if (!strcmp(match->name, name))
+                               return 1;
+                       match++;
+               }
+       }
+
        return of_driver_match_device(dev, drv);
 }
 
@@ -854,10 +921,8 @@ static struct device_node *qcom_smd_match_channel(struct device_node *edge_node,
        for_each_available_child_of_node(edge_node, child) {
                key = "qcom,smd-channels";
                ret = of_property_read_string(child, key, &name);
-               if (ret) {
-                       of_node_put(child);
+               if (ret)
                        continue;
-               }
 
                if (strcmp(name, channel) == 0)
                        return child;
@@ -880,19 +945,17 @@ static int qcom_smd_create_device(struct qcom_smd_channel *channel)
        if (channel->qsdev)
                return -EEXIST;
 
-       node = qcom_smd_match_channel(edge->of_node, channel->name);
-       if (!node) {
-               dev_dbg(smd->dev, "no match for '%s'\n", channel->name);
-               return -ENXIO;
-       }
-
        dev_dbg(smd->dev, "registering '%s'\n", channel->name);
 
        qsdev = kzalloc(sizeof(*qsdev), GFP_KERNEL);
        if (!qsdev)
                return -ENOMEM;
 
-       dev_set_name(&qsdev->dev, "%s.%s", edge->of_node->name, node->name);
+       node = qcom_smd_match_channel(edge->of_node, channel->name);
+       dev_set_name(&qsdev->dev, "%s.%s",
+                    edge->of_node->name,
+                    node ? node->name : channel->name);
+
        qsdev->dev.parent = smd->dev;
        qsdev->dev.bus = &qcom_smd_bus;
        qsdev->dev.release = qcom_smd_release_device;
@@ -978,21 +1041,20 @@ static struct qcom_smd_channel *qcom_smd_create_channel(struct qcom_smd_edge *ed
        spin_lock_init(&channel->recv_lock);
        init_waitqueue_head(&channel->fblockread_event);
 
-       ret = qcom_smem_get(edge->remote_pid, smem_info_item, (void **)&info,
-                           &info_size);
-       if (ret)
+       info = qcom_smem_get(edge->remote_pid, smem_info_item, &info_size);
+       if (IS_ERR(info)) {
+               ret = PTR_ERR(info);
                goto free_name_and_channel;
+       }
 
        /*
         * Use the size of the item to figure out which channel info struct to
         * use.
         */
        if (info_size == 2 * sizeof(struct smd_channel_info_word)) {
-               channel->tx_info_word = info;
-               channel->rx_info_word = info + sizeof(struct smd_channel_info_word);
+               channel->info_word = info;
        } else if (info_size == 2 * sizeof(struct smd_channel_info)) {
-               channel->tx_info = info;
-               channel->rx_info = info + sizeof(struct smd_channel_info);
+               channel->info = info;
        } else {
                dev_err(smd->dev,
                        "channel info of size %zu not supported\n", info_size);
@@ -1000,10 +1062,11 @@ static struct qcom_smd_channel *qcom_smd_create_channel(struct qcom_smd_edge *ed
                goto free_name_and_channel;
        }
 
-       ret = qcom_smem_get(edge->remote_pid, smem_fifo_item, &fifo_base,
-                           &fifo_size);
-       if (ret)
+       fifo_base = qcom_smem_get(edge->remote_pid, smem_fifo_item, &fifo_size);
+       if (IS_ERR(fifo_base)) {
+               ret =  PTR_ERR(fifo_base);
                goto free_name_and_channel;
+       }
 
        /* The channel consist of a rx and tx fifo of equal size */
        fifo_size /= 2;
@@ -1040,20 +1103,19 @@ static void qcom_discover_channels(struct qcom_smd_edge *edge)
        unsigned long flags;
        unsigned fifo_id;
        unsigned info_id;
-       int ret;
        int tbl;
        int i;
+       u32 eflags, cid;
 
        for (tbl = 0; tbl < SMD_ALLOC_TBL_COUNT; tbl++) {
-               ret = qcom_smem_get(edge->remote_pid,
-                                   smem_items[tbl].alloc_tbl_id,
-                                   (void **)&alloc_tbl,
-                                   NULL);
-               if (ret < 0)
+               alloc_tbl = qcom_smem_get(edge->remote_pid,
+                                   smem_items[tbl].alloc_tbl_id, NULL);
+               if (IS_ERR(alloc_tbl))
                        continue;
 
                for (i = 0; i < SMD_ALLOC_TBL_SIZE; i++) {
                        entry = &alloc_tbl[i];
+                       eflags = le32_to_cpu(entry->flags);
                        if (test_bit(i, edge->allocated[tbl]))
                                continue;
 
@@ -1063,14 +1125,15 @@ static void qcom_discover_channels(struct qcom_smd_edge *edge)
                        if (!entry->name[0])
                                continue;
 
-                       if (!(entry->flags & SMD_CHANNEL_FLAGS_PACKET))
+                       if (!(eflags & SMD_CHANNEL_FLAGS_PACKET))
                                continue;
 
-                       if ((entry->flags & SMD_CHANNEL_FLAGS_EDGE_MASK) != edge->edge_id)
+                       if ((eflags & SMD_CHANNEL_FLAGS_EDGE_MASK) != edge->edge_id)
                                continue;
 
-                       info_id = smem_items[tbl].info_base_id + entry->cid;
-                       fifo_id = smem_items[tbl].fifo_base_id + entry->cid;
+                       cid = le32_to_cpu(entry->cid);
+                       info_id = smem_items[tbl].info_base_id + cid;
+                       fifo_id = smem_items[tbl].fifo_base_id + cid;
 
                        channel = qcom_smd_create_channel(edge, info_id, fifo_id, entry->name);
                        if (IS_ERR(channel))
@@ -1227,11 +1290,12 @@ static int qcom_smd_probe(struct platform_device *pdev)
        int num_edges;
        int ret;
        int i = 0;
+       void *p;
 
        /* Wait for smem */
-       ret = qcom_smem_get(QCOM_SMEM_HOST_ANY, smem_items[0].alloc_tbl_id, NULL, NULL);
-       if (ret == -EPROBE_DEFER)
-               return ret;
+       p = qcom_smem_get(QCOM_SMEM_HOST_ANY, smem_items[0].alloc_tbl_id, NULL);
+       if (PTR_ERR(p) == -EPROBE_DEFER)
+               return PTR_ERR(p);
 
        num_edges = of_get_available_child_count(pdev->dev.of_node);
        array_size = sizeof(*smd) + num_edges * sizeof(struct qcom_smd_edge);
index 52365188a1c20288a754dc7e1a530e4b25570ac3..19019aa092e86d76ad5a24b80f34616b9e38e320 100644 (file)
@@ -92,9 +92,9 @@
   * @params:   parameters to the command
   */
 struct smem_proc_comm {
-       u32 command;
-       u32 status;
-       u32 params[2];
+       __le32 command;
+       __le32 status;
+       __le32 params[2];
 };
 
 /**
@@ -106,10 +106,10 @@ struct smem_proc_comm {
  *             the default region. bits 0,1 are reserved
  */
 struct smem_global_entry {
-       u32 allocated;
-       u32 offset;
-       u32 size;
-       u32 aux_base; /* bits 1:0 reserved */
+       __le32 allocated;
+       __le32 offset;
+       __le32 size;
+       __le32 aux_base; /* bits 1:0 reserved */
 };
 #define AUX_BASE_MASK          0xfffffffc
 
@@ -125,11 +125,11 @@ struct smem_global_entry {
  */
 struct smem_header {
        struct smem_proc_comm proc_comm[4];
-       u32 version[32];
-       u32 initialized;
-       u32 free_offset;
-       u32 available;
-       u32 reserved;
+       __le32 version[32];
+       __le32 initialized;
+       __le32 free_offset;
+       __le32 available;
+       __le32 reserved;
        struct smem_global_entry toc[SMEM_ITEM_COUNT];
 };
 
@@ -143,12 +143,12 @@ struct smem_header {
  * @reserved:  reserved entries for later use
  */
 struct smem_ptable_entry {
-       u32 offset;
-       u32 size;
-       u32 flags;
-       u16 host0;
-       u16 host1;
-       u32 reserved[8];
+       __le32 offset;
+       __le32 size;
+       __le32 flags;
+       __le16 host0;
+       __le16 host1;
+       __le32 reserved[8];
 };
 
 /**
@@ -160,13 +160,14 @@ struct smem_ptable_entry {
  * @entry:     list of @smem_ptable_entry for the @num_entries partitions
  */
 struct smem_ptable {
-       u32 magic;
-       u32 version;
-       u32 num_entries;
-       u32 reserved[5];
+       u8 magic[4];
+       __le32 version;
+       __le32 num_entries;
+       __le32 reserved[5];
        struct smem_ptable_entry entry[];
 };
-#define SMEM_PTABLE_MAGIC      0x434f5424 /* "$TOC" */
+
+static const u8 SMEM_PTABLE_MAGIC[] = { 0x24, 0x54, 0x4f, 0x43 }; /* "$TOC" */
 
 /**
  * struct smem_partition_header - header of the partitions
@@ -181,15 +182,16 @@ struct smem_ptable {
  * @reserved:  for now reserved entries
  */
 struct smem_partition_header {
-       u32 magic;
-       u16 host0;
-       u16 host1;
-       u32 size;
-       u32 offset_free_uncached;
-       u32 offset_free_cached;
-       u32 reserved[3];
+       u8 magic[4];
+       __le16 host0;
+       __le16 host1;
+       __le32 size;
+       __le32 offset_free_uncached;
+       __le32 offset_free_cached;
+       __le32 reserved[3];
 };
-#define SMEM_PART_MAGIC                0x54525024 /* "$PRT" */
+
+static const u8 SMEM_PART_MAGIC[] = { 0x24, 0x50, 0x52, 0x54 };
 
 /**
  * struct smem_private_entry - header of each item in the private partition
@@ -201,12 +203,12 @@ struct smem_partition_header {
  * @reserved:  for now reserved entry
  */
 struct smem_private_entry {
-       u16 canary;
-       u16 item;
-       u32 size; /* includes padding bytes */
-       u16 padding_data;
-       u16 padding_hdr;
-       u32 reserved;
+       u16 canary; /* bytes are the same so no swapping needed */
+       __le16 item;
+       __le32 size; /* includes padding bytes */
+       __le16 padding_data;
+       __le16 padding_hdr;
+       __le32 reserved;
 };
 #define SMEM_PRIVATE_CANARY    0xa5a5
 
@@ -242,6 +244,45 @@ struct qcom_smem {
        struct smem_region regions[0];
 };
 
+static struct smem_private_entry *
+phdr_to_last_private_entry(struct smem_partition_header *phdr)
+{
+       void *p = phdr;
+
+       return p + le32_to_cpu(phdr->offset_free_uncached);
+}
+
+static void *phdr_to_first_cached_entry(struct smem_partition_header *phdr)
+{
+       void *p = phdr;
+
+       return p + le32_to_cpu(phdr->offset_free_cached);
+}
+
+static struct smem_private_entry *
+phdr_to_first_private_entry(struct smem_partition_header *phdr)
+{
+       void *p = phdr;
+
+       return p + sizeof(*phdr);
+}
+
+static struct smem_private_entry *
+private_entry_next(struct smem_private_entry *e)
+{
+       void *p = e;
+
+       return p + sizeof(*e) + le16_to_cpu(e->padding_hdr) +
+              le32_to_cpu(e->size);
+}
+
+static void *entry_to_item(struct smem_private_entry *e)
+{
+       void *p = e;
+
+       return p + sizeof(*e) + le16_to_cpu(e->padding_hdr);
+}
+
 /* Pointer to the one and only smem handle */
 static struct qcom_smem *__smem;
 
@@ -254,16 +295,16 @@ static int qcom_smem_alloc_private(struct qcom_smem *smem,
                                   size_t size)
 {
        struct smem_partition_header *phdr;
-       struct smem_private_entry *hdr;
+       struct smem_private_entry *hdr, *end;
        size_t alloc_size;
-       void *p;
+       void *cached;
 
        phdr = smem->partitions[host];
+       hdr = phdr_to_first_private_entry(phdr);
+       end = phdr_to_last_private_entry(phdr);
+       cached = phdr_to_first_cached_entry(phdr);
 
-       p = (void *)phdr + sizeof(*phdr);
-       while (p < (void *)phdr + phdr->offset_free_uncached) {
-               hdr = p;
-
+       while (hdr < end) {
                if (hdr->canary != SMEM_PRIVATE_CANARY) {
                        dev_err(smem->dev,
                                "Found invalid canary in host %d partition\n",
@@ -271,24 +312,23 @@ static int qcom_smem_alloc_private(struct qcom_smem *smem,
                        return -EINVAL;
                }
 
-               if (hdr->item == item)
+               if (le16_to_cpu(hdr->item) == item)
                        return -EEXIST;
 
-               p += sizeof(*hdr) + hdr->padding_hdr + hdr->size;
+               hdr = private_entry_next(hdr);
        }
 
        /* Check that we don't grow into the cached region */
        alloc_size = sizeof(*hdr) + ALIGN(size, 8);
-       if (p + alloc_size >= (void *)phdr + phdr->offset_free_cached) {
+       if ((void *)hdr + alloc_size >= cached) {
                dev_err(smem->dev, "Out of memory\n");
                return -ENOSPC;
        }
 
-       hdr = p;
        hdr->canary = SMEM_PRIVATE_CANARY;
-       hdr->item = item;
-       hdr->size = ALIGN(size, 8);
-       hdr->padding_data = hdr->size - size;
+       hdr->item = cpu_to_le16(item);
+       hdr->size = cpu_to_le32(ALIGN(size, 8));
+       hdr->padding_data = cpu_to_le16(le32_to_cpu(hdr->size) - size);
        hdr->padding_hdr = 0;
 
        /*
@@ -297,7 +337,7 @@ static int qcom_smem_alloc_private(struct qcom_smem *smem,
         * gets a consistent view of the linked list.
         */
        wmb();
-       phdr->offset_free_uncached += alloc_size;
+       le32_add_cpu(&phdr->offset_free_uncached, alloc_size);
 
        return 0;
 }
@@ -318,11 +358,11 @@ static int qcom_smem_alloc_global(struct qcom_smem *smem,
                return -EEXIST;
 
        size = ALIGN(size, 8);
-       if (WARN_ON(size > header->available))
+       if (WARN_ON(size > le32_to_cpu(header->available)))
                return -ENOMEM;
 
        entry->offset = header->free_offset;
-       entry->size = size;
+       entry->size = cpu_to_le32(size);
 
        /*
         * Ensure the header is consistent before we mark the item allocated,
@@ -330,10 +370,10 @@ static int qcom_smem_alloc_global(struct qcom_smem *smem,
         * even though they do not take the spinlock on read.
         */
        wmb();
-       entry->allocated = 1;
+       entry->allocated = cpu_to_le32(1);
 
-       header->free_offset += size;
-       header->available -= size;
+       le32_add_cpu(&header->free_offset, size);
+       le32_add_cpu(&header->available, -size);
 
        return 0;
 }
@@ -378,10 +418,9 @@ int qcom_smem_alloc(unsigned host, unsigned item, size_t size)
 }
 EXPORT_SYMBOL(qcom_smem_alloc);
 
-static int qcom_smem_get_global(struct qcom_smem *smem,
-                               unsigned item,
-                               void **ptr,
-                               size_t *size)
+static void *qcom_smem_get_global(struct qcom_smem *smem,
+                                 unsigned item,
+                                 size_t *size)
 {
        struct smem_header *header;
        struct smem_region *area;
@@ -390,100 +429,94 @@ static int qcom_smem_get_global(struct qcom_smem *smem,
        unsigned i;
 
        if (WARN_ON(item >= SMEM_ITEM_COUNT))
-               return -EINVAL;
+               return ERR_PTR(-EINVAL);
 
        header = smem->regions[0].virt_base;
        entry = &header->toc[item];
        if (!entry->allocated)
-               return -ENXIO;
+               return ERR_PTR(-ENXIO);
 
-       if (ptr != NULL) {
-               aux_base = entry->aux_base & AUX_BASE_MASK;
+       aux_base = le32_to_cpu(entry->aux_base) & AUX_BASE_MASK;
 
-               for (i = 0; i < smem->num_regions; i++) {
-                       area = &smem->regions[i];
+       for (i = 0; i < smem->num_regions; i++) {
+               area = &smem->regions[i];
 
-                       if (area->aux_base == aux_base || !aux_base) {
-                               *ptr = area->virt_base + entry->offset;
-                               break;
-                       }
+               if (area->aux_base == aux_base || !aux_base) {
+                       if (size != NULL)
+                               *size = le32_to_cpu(entry->size);
+                       return area->virt_base + le32_to_cpu(entry->offset);
                }
        }
-       if (size != NULL)
-               *size = entry->size;
 
-       return 0;
+       return ERR_PTR(-ENOENT);
 }
 
-static int qcom_smem_get_private(struct qcom_smem *smem,
-                                unsigned host,
-                                unsigned item,
-                                void **ptr,
-                                size_t *size)
+static void *qcom_smem_get_private(struct qcom_smem *smem,
+                                  unsigned host,
+                                  unsigned item,
+                                  size_t *size)
 {
        struct smem_partition_header *phdr;
-       struct smem_private_entry *hdr;
-       void *p;
+       struct smem_private_entry *e, *end;
 
        phdr = smem->partitions[host];
+       e = phdr_to_first_private_entry(phdr);
+       end = phdr_to_last_private_entry(phdr);
 
-       p = (void *)phdr + sizeof(*phdr);
-       while (p < (void *)phdr + phdr->offset_free_uncached) {
-               hdr = p;
-
-               if (hdr->canary != SMEM_PRIVATE_CANARY) {
+       while (e < end) {
+               if (e->canary != SMEM_PRIVATE_CANARY) {
                        dev_err(smem->dev,
                                "Found invalid canary in host %d partition\n",
                                host);
-                       return -EINVAL;
+                       return ERR_PTR(-EINVAL);
                }
 
-               if (hdr->item == item) {
-                       if (ptr != NULL)
-                               *ptr = p + sizeof(*hdr) + hdr->padding_hdr;
-
+               if (le16_to_cpu(e->item) == item) {
                        if (size != NULL)
-                               *size = hdr->size - hdr->padding_data;
+                               *size = le32_to_cpu(e->size) -
+                                       le16_to_cpu(e->padding_data);
 
-                       return 0;
+                       return entry_to_item(e);
                }
 
-               p += sizeof(*hdr) + hdr->padding_hdr + hdr->size;
+               e = private_entry_next(e);
        }
 
-       return -ENOENT;
+       return ERR_PTR(-ENOENT);
 }
 
 /**
  * qcom_smem_get() - resolve ptr of size of a smem item
  * @host:      the remote processor, or -1
  * @item:      smem item handle
- * @ptr:       pointer to be filled out with address of the item
  * @size:      pointer to be filled out with size of the item
  *
- * Looks up pointer and size of a smem item.
+ * Looks up smem item and returns pointer to it. Size of smem
+ * item is returned in @size.
  */
-int qcom_smem_get(unsigned host, unsigned item, void **ptr, size_t *size)
+void *qcom_smem_get(unsigned host, unsigned item, size_t *size)
 {
        unsigned long flags;
        int ret;
+       void *ptr = ERR_PTR(-EPROBE_DEFER);
 
        if (!__smem)
-               return -EPROBE_DEFER;
+               return ptr;
 
        ret = hwspin_lock_timeout_irqsave(__smem->hwlock,
                                          HWSPINLOCK_TIMEOUT,
                                          &flags);
        if (ret)
-               return ret;
+               return ERR_PTR(ret);
 
        if (host < SMEM_HOST_COUNT && __smem->partitions[host])
-               ret = qcom_smem_get_private(__smem, host, item, ptr, size);
+               ptr = qcom_smem_get_private(__smem, host, item, size);
        else
-               ret = qcom_smem_get_global(__smem, item, ptr, size);
+               ptr = qcom_smem_get_global(__smem, item, size);
 
        hwspin_unlock_irqrestore(__smem->hwlock, &flags);
-       return ret;
+
+       return ptr;
 
 }
 EXPORT_SYMBOL(qcom_smem_get);
@@ -506,10 +539,11 @@ int qcom_smem_get_free_space(unsigned host)
 
        if (host < SMEM_HOST_COUNT && __smem->partitions[host]) {
                phdr = __smem->partitions[host];
-               ret = phdr->offset_free_cached - phdr->offset_free_uncached;
+               ret = le32_to_cpu(phdr->offset_free_cached) -
+                     le32_to_cpu(phdr->offset_free_uncached);
        } else {
                header = __smem->regions[0].virt_base;
-               ret = header->available;
+               ret = le32_to_cpu(header->available);
        }
 
        return ret;
@@ -518,13 +552,11 @@ EXPORT_SYMBOL(qcom_smem_get_free_space);
 
 static int qcom_smem_get_sbl_version(struct qcom_smem *smem)
 {
-       unsigned *versions;
+       __le32 *versions;
        size_t size;
-       int ret;
 
-       ret = qcom_smem_get_global(smem, SMEM_ITEM_VERSION,
-                                  (void **)&versions, &size);
-       if (ret < 0) {
+       versions = qcom_smem_get_global(smem, SMEM_ITEM_VERSION, &size);
+       if (IS_ERR(versions)) {
                dev_err(smem->dev, "Unable to read the version item\n");
                return -ENOENT;
        }
@@ -534,7 +566,7 @@ static int qcom_smem_get_sbl_version(struct qcom_smem *smem)
                return -EINVAL;
        }
 
-       return versions[SMEM_MASTER_SBL_VERSION_INDEX];
+       return le32_to_cpu(versions[SMEM_MASTER_SBL_VERSION_INDEX]);
 }
 
 static int qcom_smem_enumerate_partitions(struct qcom_smem *smem,
@@ -544,35 +576,38 @@ static int qcom_smem_enumerate_partitions(struct qcom_smem *smem,
        struct smem_ptable_entry *entry;
        struct smem_ptable *ptable;
        unsigned remote_host;
+       u32 version, host0, host1;
        int i;
 
        ptable = smem->regions[0].virt_base + smem->regions[0].size - SZ_4K;
-       if (ptable->magic != SMEM_PTABLE_MAGIC)
+       if (memcmp(ptable->magic, SMEM_PTABLE_MAGIC, sizeof(ptable->magic)))
                return 0;
 
-       if (ptable->version != 1) {
+       version = le32_to_cpu(ptable->version);
+       if (version != 1) {
                dev_err(smem->dev,
-                       "Unsupported partition header version %d\n",
-                       ptable->version);
+                       "Unsupported partition header version %d\n", version);
                return -EINVAL;
        }
 
-       for (i = 0; i < ptable->num_entries; i++) {
+       for (i = 0; i < le32_to_cpu(ptable->num_entries); i++) {
                entry = &ptable->entry[i];
+               host0 = le16_to_cpu(entry->host0);
+               host1 = le16_to_cpu(entry->host1);
 
-               if (entry->host0 != local_host && entry->host1 != local_host)
+               if (host0 != local_host && host1 != local_host)
                        continue;
 
-               if (!entry->offset)
+               if (!le32_to_cpu(entry->offset))
                        continue;
 
-               if (!entry->size)
+               if (!le32_to_cpu(entry->size))
                        continue;
 
-               if (entry->host0 == local_host)
-                       remote_host = entry->host1;
+               if (host0 == local_host)
+                       remote_host = host1;
                else
-                       remote_host = entry->host0;
+                       remote_host = host0;
 
                if (remote_host >= SMEM_HOST_COUNT) {
                        dev_err(smem->dev,
@@ -588,21 +623,24 @@ static int qcom_smem_enumerate_partitions(struct qcom_smem *smem,
                        return -EINVAL;
                }
 
-               header = smem->regions[0].virt_base + entry->offset;
+               header = smem->regions[0].virt_base + le32_to_cpu(entry->offset);
+               host0 = le16_to_cpu(header->host0);
+               host1 = le16_to_cpu(header->host1);
 
-               if (header->magic != SMEM_PART_MAGIC) {
+               if (memcmp(header->magic, SMEM_PART_MAGIC,
+                           sizeof(header->magic))) {
                        dev_err(smem->dev,
                                "Partition %d has invalid magic\n", i);
                        return -EINVAL;
                }
 
-               if (header->host0 != local_host && header->host1 != local_host) {
+               if (host0 != local_host && host1 != local_host) {
                        dev_err(smem->dev,
                                "Partition %d hosts are invalid\n", i);
                        return -EINVAL;
                }
 
-               if (header->host0 != remote_host && header->host1 != remote_host) {
+               if (host0 != remote_host && host1 != remote_host) {
                        dev_err(smem->dev,
                                "Partition %d hosts are invalid\n", i);
                        return -EINVAL;
@@ -614,7 +652,7 @@ static int qcom_smem_enumerate_partitions(struct qcom_smem *smem,
                        return -EINVAL;
                }
 
-               if (header->offset_free_uncached > header->size) {
+               if (le32_to_cpu(header->offset_free_uncached) > le32_to_cpu(header->size)) {
                        dev_err(smem->dev,
                                "Partition %d has invalid free pointer\n", i);
                        return -EINVAL;
@@ -626,37 +664,47 @@ static int qcom_smem_enumerate_partitions(struct qcom_smem *smem,
        return 0;
 }
 
-static int qcom_smem_count_mem_regions(struct platform_device *pdev)
+static int qcom_smem_map_memory(struct qcom_smem *smem, struct device *dev,
+                               const char *name, int i)
 {
-       struct resource *res;
-       int num_regions = 0;
-       int i;
-
-       for (i = 0; i < pdev->num_resources; i++) {
-               res = &pdev->resource[i];
+       struct device_node *np;
+       struct resource r;
+       int ret;
 
-               if (resource_type(res) == IORESOURCE_MEM)
-                       num_regions++;
+       np = of_parse_phandle(dev->of_node, name, 0);
+       if (!np) {
+               dev_err(dev, "No %s specified\n", name);
+               return -EINVAL;
        }
 
-       return num_regions;
+       ret = of_address_to_resource(np, 0, &r);
+       of_node_put(np);
+       if (ret)
+               return ret;
+
+       smem->regions[i].aux_base = (u32)r.start;
+       smem->regions[i].size = resource_size(&r);
+       smem->regions[i].virt_base = devm_ioremap_nocache(dev, r.start,
+                                                         resource_size(&r));
+       if (!smem->regions[i].virt_base)
+               return -ENOMEM;
+
+       return 0;
 }
 
 static int qcom_smem_probe(struct platform_device *pdev)
 {
        struct smem_header *header;
-       struct device_node *np;
        struct qcom_smem *smem;
-       struct resource *res;
-       struct resource r;
        size_t array_size;
-       int num_regions = 0;
+       int num_regions;
        int hwlock_id;
        u32 version;
        int ret;
-       int i;
 
-       num_regions = qcom_smem_count_mem_regions(pdev) + 1;
+       num_regions = 1;
+       if (of_find_property(pdev->dev.of_node, "qcom,rpm-msg-ram", NULL))
+               num_regions++;
 
        array_size = num_regions * sizeof(struct smem_region);
        smem = devm_kzalloc(&pdev->dev, sizeof(*smem) + array_size, GFP_KERNEL);
@@ -666,39 +714,17 @@ static int qcom_smem_probe(struct platform_device *pdev)
        smem->dev = &pdev->dev;
        smem->num_regions = num_regions;
 
-       np = of_parse_phandle(pdev->dev.of_node, "memory-region", 0);
-       if (!np) {
-               dev_err(&pdev->dev, "No memory-region specified\n");
-               return -EINVAL;
-       }
-
-       ret = of_address_to_resource(np, 0, &r);
-       of_node_put(np);
+       ret = qcom_smem_map_memory(smem, &pdev->dev, "memory-region", 0);
        if (ret)
                return ret;
 
-       smem->regions[0].aux_base = (u32)r.start;
-       smem->regions[0].size = resource_size(&r);
-       smem->regions[0].virt_base = devm_ioremap_nocache(&pdev->dev,
-                                                         r.start,
-                                                         resource_size(&r));
-       if (!smem->regions[0].virt_base)
-               return -ENOMEM;
-
-       for (i = 1; i < num_regions; i++) {
-               res = platform_get_resource(pdev, IORESOURCE_MEM, i - 1);
-
-               smem->regions[i].aux_base = (u32)res->start;
-               smem->regions[i].size = resource_size(res);
-               smem->regions[i].virt_base = devm_ioremap_nocache(&pdev->dev,
-                                                                 res->start,
-                                                                 resource_size(res));
-               if (!smem->regions[i].virt_base)
-                       return -ENOMEM;
-       }
+       if (num_regions > 1 && (ret = qcom_smem_map_memory(smem, &pdev->dev,
+                                       "qcom,rpm-msg-ram", 1)))
+               return ret;
 
        header = smem->regions[0].virt_base;
-       if (header->initialized != 1 || header->reserved) {
+       if (le32_to_cpu(header->initialized) != 1 ||
+           le32_to_cpu(header->reserved)) {
                dev_err(&pdev->dev, "SMEM is not initialized by SBL\n");
                return -EINVAL;
        }
@@ -730,8 +756,8 @@ static int qcom_smem_probe(struct platform_device *pdev)
 
 static int qcom_smem_remove(struct platform_device *pdev)
 {
-       __smem = NULL;
        hwspin_lock_free(__smem->hwlock);
+       __smem = NULL;
 
        return 0;
 }
diff --git a/drivers/soc/rockchip/Kconfig b/drivers/soc/rockchip/Kconfig
new file mode 100644 (file)
index 0000000..7140ff8
--- /dev/null
@@ -0,0 +1,18 @@
+if ARCH_ROCKCHIP || COMPILE_TEST
+
+#
+# Rockchip Soc drivers
+#
+config ROCKCHIP_PM_DOMAINS
+        bool "Rockchip generic power domain"
+        depends on PM
+        select PM_GENERIC_DOMAINS
+        help
+          Say y here to enable power domain support.
+          In order to meet high performance and low power requirements, a power
+          management unit is designed or saving power when RK3288 in low power
+          mode. The RK3288 PMU is dedicated for managing the power of the whole chip.
+
+          If unsure, say N.
+
+endif
diff --git a/drivers/soc/rockchip/Makefile b/drivers/soc/rockchip/Makefile
new file mode 100644 (file)
index 0000000..3d73d06
--- /dev/null
@@ -0,0 +1,4 @@
+#
+# Rockchip Soc drivers
+#
+obj-$(CONFIG_ROCKCHIP_PM_DOMAINS) += pm_domains.o
diff --git a/drivers/soc/rockchip/pm_domains.c b/drivers/soc/rockchip/pm_domains.c
new file mode 100644 (file)
index 0000000..534c589
--- /dev/null
@@ -0,0 +1,490 @@
+/*
+ * Rockchip Generic power domain support.
+ *
+ * Copyright (c) 2015 ROCKCHIP, Co. Ltd.
+ *
+ * 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.
+ */
+
+#include <linux/io.h>
+#include <linux/err.h>
+#include <linux/pm_clock.h>
+#include <linux/pm_domain.h>
+#include <linux/of_address.h>
+#include <linux/of_platform.h>
+#include <linux/clk.h>
+#include <linux/regmap.h>
+#include <linux/mfd/syscon.h>
+#include <dt-bindings/power/rk3288-power.h>
+
+struct rockchip_domain_info {
+       int pwr_mask;
+       int status_mask;
+       int req_mask;
+       int idle_mask;
+       int ack_mask;
+};
+
+struct rockchip_pmu_info {
+       u32 pwr_offset;
+       u32 status_offset;
+       u32 req_offset;
+       u32 idle_offset;
+       u32 ack_offset;
+
+       u32 core_pwrcnt_offset;
+       u32 gpu_pwrcnt_offset;
+
+       unsigned int core_power_transition_time;
+       unsigned int gpu_power_transition_time;
+
+       int num_domains;
+       const struct rockchip_domain_info *domain_info;
+};
+
+struct rockchip_pm_domain {
+       struct generic_pm_domain genpd;
+       const struct rockchip_domain_info *info;
+       struct rockchip_pmu *pmu;
+       int num_clks;
+       struct clk *clks[];
+};
+
+struct rockchip_pmu {
+       struct device *dev;
+       struct regmap *regmap;
+       const struct rockchip_pmu_info *info;
+       struct mutex mutex; /* mutex lock for pmu */
+       struct genpd_onecell_data genpd_data;
+       struct generic_pm_domain *domains[];
+};
+
+#define to_rockchip_pd(gpd) container_of(gpd, struct rockchip_pm_domain, genpd)
+
+#define DOMAIN(pwr, status, req, idle, ack)    \
+{                                              \
+       .pwr_mask = BIT(pwr),                   \
+       .status_mask = BIT(status),             \
+       .req_mask = BIT(req),                   \
+       .idle_mask = BIT(idle),                 \
+       .ack_mask = BIT(ack),                   \
+}
+
+#define DOMAIN_RK3288(pwr, status, req)                \
+       DOMAIN(pwr, status, req, req, (req) + 16)
+
+static bool rockchip_pmu_domain_is_idle(struct rockchip_pm_domain *pd)
+{
+       struct rockchip_pmu *pmu = pd->pmu;
+       const struct rockchip_domain_info *pd_info = pd->info;
+       unsigned int val;
+
+       regmap_read(pmu->regmap, pmu->info->idle_offset, &val);
+       return (val & pd_info->idle_mask) == pd_info->idle_mask;
+}
+
+static int rockchip_pmu_set_idle_request(struct rockchip_pm_domain *pd,
+                                        bool idle)
+{
+       const struct rockchip_domain_info *pd_info = pd->info;
+       struct rockchip_pmu *pmu = pd->pmu;
+       unsigned int val;
+
+       regmap_update_bits(pmu->regmap, pmu->info->req_offset,
+                          pd_info->req_mask, idle ? -1U : 0);
+
+       dsb(sy);
+
+       do {
+               regmap_read(pmu->regmap, pmu->info->ack_offset, &val);
+       } while ((val & pd_info->ack_mask) != (idle ? pd_info->ack_mask : 0));
+
+       while (rockchip_pmu_domain_is_idle(pd) != idle)
+               cpu_relax();
+
+       return 0;
+}
+
+static bool rockchip_pmu_domain_is_on(struct rockchip_pm_domain *pd)
+{
+       struct rockchip_pmu *pmu = pd->pmu;
+       unsigned int val;
+
+       regmap_read(pmu->regmap, pmu->info->status_offset, &val);
+
+       /* 1'b0: power on, 1'b1: power off */
+       return !(val & pd->info->status_mask);
+}
+
+static void rockchip_do_pmu_set_power_domain(struct rockchip_pm_domain *pd,
+                                            bool on)
+{
+       struct rockchip_pmu *pmu = pd->pmu;
+
+       regmap_update_bits(pmu->regmap, pmu->info->pwr_offset,
+                          pd->info->pwr_mask, on ? 0 : -1U);
+
+       dsb(sy);
+
+       while (rockchip_pmu_domain_is_on(pd) != on)
+               cpu_relax();
+}
+
+static int rockchip_pd_power(struct rockchip_pm_domain *pd, bool power_on)
+{
+       int i;
+
+       mutex_lock(&pd->pmu->mutex);
+
+       if (rockchip_pmu_domain_is_on(pd) != power_on) {
+               for (i = 0; i < pd->num_clks; i++)
+                       clk_enable(pd->clks[i]);
+
+               if (!power_on) {
+                       /* FIXME: add code to save AXI_QOS */
+
+                       /* if powering down, idle request to NIU first */
+                       rockchip_pmu_set_idle_request(pd, true);
+               }
+
+               rockchip_do_pmu_set_power_domain(pd, power_on);
+
+               if (power_on) {
+                       /* if powering up, leave idle mode */
+                       rockchip_pmu_set_idle_request(pd, false);
+
+                       /* FIXME: add code to restore AXI_QOS */
+               }
+
+               for (i = pd->num_clks - 1; i >= 0; i--)
+                       clk_disable(pd->clks[i]);
+       }
+
+       mutex_unlock(&pd->pmu->mutex);
+       return 0;
+}
+
+static int rockchip_pd_power_on(struct generic_pm_domain *domain)
+{
+       struct rockchip_pm_domain *pd = to_rockchip_pd(domain);
+
+       return rockchip_pd_power(pd, true);
+}
+
+static int rockchip_pd_power_off(struct generic_pm_domain *domain)
+{
+       struct rockchip_pm_domain *pd = to_rockchip_pd(domain);
+
+       return rockchip_pd_power(pd, false);
+}
+
+static int rockchip_pd_attach_dev(struct generic_pm_domain *genpd,
+                                 struct device *dev)
+{
+       struct clk *clk;
+       int i;
+       int error;
+
+       dev_dbg(dev, "attaching to power domain '%s'\n", genpd->name);
+
+       error = pm_clk_create(dev);
+       if (error) {
+               dev_err(dev, "pm_clk_create failed %d\n", error);
+               return error;
+       }
+
+       i = 0;
+       while ((clk = of_clk_get(dev->of_node, i++)) && !IS_ERR(clk)) {
+               dev_dbg(dev, "adding clock '%pC' to list of PM clocks\n", clk);
+               error = pm_clk_add_clk(dev, clk);
+               if (error) {
+                       dev_err(dev, "pm_clk_add_clk failed %d\n", error);
+                       clk_put(clk);
+                       pm_clk_destroy(dev);
+                       return error;
+               }
+       }
+
+       return 0;
+}
+
+static void rockchip_pd_detach_dev(struct generic_pm_domain *genpd,
+                                  struct device *dev)
+{
+       dev_dbg(dev, "detaching from power domain '%s'\n", genpd->name);
+
+       pm_clk_destroy(dev);
+}
+
+static int rockchip_pm_add_one_domain(struct rockchip_pmu *pmu,
+                                     struct device_node *node)
+{
+       const struct rockchip_domain_info *pd_info;
+       struct rockchip_pm_domain *pd;
+       struct clk *clk;
+       int clk_cnt;
+       int i;
+       u32 id;
+       int error;
+
+       error = of_property_read_u32(node, "reg", &id);
+       if (error) {
+               dev_err(pmu->dev,
+                       "%s: failed to retrieve domain id (reg): %d\n",
+                       node->name, error);
+               return -EINVAL;
+       }
+
+       if (id >= pmu->info->num_domains) {
+               dev_err(pmu->dev, "%s: invalid domain id %d\n",
+                       node->name, id);
+               return -EINVAL;
+       }
+
+       pd_info = &pmu->info->domain_info[id];
+       if (!pd_info) {
+               dev_err(pmu->dev, "%s: undefined domain id %d\n",
+                       node->name, id);
+               return -EINVAL;
+       }
+
+       clk_cnt = of_count_phandle_with_args(node, "clocks", "#clock-cells");
+       pd = devm_kzalloc(pmu->dev,
+                         sizeof(*pd) + clk_cnt * sizeof(pd->clks[0]),
+                         GFP_KERNEL);
+       if (!pd)
+               return -ENOMEM;
+
+       pd->info = pd_info;
+       pd->pmu = pmu;
+
+       for (i = 0; i < clk_cnt; i++) {
+               clk = of_clk_get(node, i);
+               if (IS_ERR(clk)) {
+                       error = PTR_ERR(clk);
+                       dev_err(pmu->dev,
+                               "%s: failed to get clk at index %d: %d\n",
+                               node->name, i, error);
+                       goto err_out;
+               }
+
+               error = clk_prepare(clk);
+               if (error) {
+                       dev_err(pmu->dev,
+                               "%s: failed to prepare clk %pC (index %d): %d\n",
+                               node->name, clk, i, error);
+                       clk_put(clk);
+                       goto err_out;
+               }
+
+               pd->clks[pd->num_clks++] = clk;
+
+               dev_dbg(pmu->dev, "added clock '%pC' to domain '%s'\n",
+                       clk, node->name);
+       }
+
+       error = rockchip_pd_power(pd, true);
+       if (error) {
+               dev_err(pmu->dev,
+                       "failed to power on domain '%s': %d\n",
+                       node->name, error);
+               goto err_out;
+       }
+
+       pd->genpd.name = node->name;
+       pd->genpd.power_off = rockchip_pd_power_off;
+       pd->genpd.power_on = rockchip_pd_power_on;
+       pd->genpd.attach_dev = rockchip_pd_attach_dev;
+       pd->genpd.detach_dev = rockchip_pd_detach_dev;
+       pd->genpd.flags = GENPD_FLAG_PM_CLK;
+       pm_genpd_init(&pd->genpd, NULL, false);
+
+       pmu->genpd_data.domains[id] = &pd->genpd;
+       return 0;
+
+err_out:
+       while (--i >= 0) {
+               clk_unprepare(pd->clks[i]);
+               clk_put(pd->clks[i]);
+       }
+       return error;
+}
+
+static void rockchip_pm_remove_one_domain(struct rockchip_pm_domain *pd)
+{
+       int i;
+
+       for (i = 0; i < pd->num_clks; i++) {
+               clk_unprepare(pd->clks[i]);
+               clk_put(pd->clks[i]);
+       }
+
+       /* protect the zeroing of pm->num_clks */
+       mutex_lock(&pd->pmu->mutex);
+       pd->num_clks = 0;
+       mutex_unlock(&pd->pmu->mutex);
+
+       /* devm will free our memory */
+}
+
+static void rockchip_pm_domain_cleanup(struct rockchip_pmu *pmu)
+{
+       struct generic_pm_domain *genpd;
+       struct rockchip_pm_domain *pd;
+       int i;
+
+       for (i = 0; i < pmu->genpd_data.num_domains; i++) {
+               genpd = pmu->genpd_data.domains[i];
+               if (genpd) {
+                       pd = to_rockchip_pd(genpd);
+                       rockchip_pm_remove_one_domain(pd);
+               }
+       }
+
+       /* devm will free our memory */
+}
+
+static void rockchip_configure_pd_cnt(struct rockchip_pmu *pmu,
+                                     u32 domain_reg_offset,
+                                     unsigned int count)
+{
+       /* First configure domain power down transition count ... */
+       regmap_write(pmu->regmap, domain_reg_offset, count);
+       /* ... and then power up count. */
+       regmap_write(pmu->regmap, domain_reg_offset + 4, count);
+}
+
+static int rockchip_pm_domain_probe(struct platform_device *pdev)
+{
+       struct device *dev = &pdev->dev;
+       struct device_node *np = dev->of_node;
+       struct device_node *node;
+       struct device *parent;
+       struct rockchip_pmu *pmu;
+       const struct of_device_id *match;
+       const struct rockchip_pmu_info *pmu_info;
+       int error;
+
+       if (!np) {
+               dev_err(dev, "device tree node not found\n");
+               return -ENODEV;
+       }
+
+       match = of_match_device(dev->driver->of_match_table, dev);
+       if (!match || !match->data) {
+               dev_err(dev, "missing pmu data\n");
+               return -EINVAL;
+       }
+
+       pmu_info = match->data;
+
+       pmu = devm_kzalloc(dev,
+                          sizeof(*pmu) +
+                               pmu_info->num_domains * sizeof(pmu->domains[0]),
+                          GFP_KERNEL);
+       if (!pmu)
+               return -ENOMEM;
+
+       pmu->dev = &pdev->dev;
+       mutex_init(&pmu->mutex);
+
+       pmu->info = pmu_info;
+
+       pmu->genpd_data.domains = pmu->domains;
+       pmu->genpd_data.num_domains = pmu_info->num_domains;
+
+       parent = dev->parent;
+       if (!parent) {
+               dev_err(dev, "no parent for syscon devices\n");
+               return -ENODEV;
+       }
+
+       pmu->regmap = syscon_node_to_regmap(parent->of_node);
+
+       /*
+        * Configure power up and down transition delays for CORE
+        * and GPU domains.
+        */
+       rockchip_configure_pd_cnt(pmu, pmu_info->core_pwrcnt_offset,
+                                 pmu_info->core_power_transition_time);
+       rockchip_configure_pd_cnt(pmu, pmu_info->gpu_pwrcnt_offset,
+                                 pmu_info->gpu_power_transition_time);
+
+       error = -ENODEV;
+
+       for_each_available_child_of_node(np, node) {
+               error = rockchip_pm_add_one_domain(pmu, node);
+               if (error) {
+                       dev_err(dev, "failed to handle node %s: %d\n",
+                               node->name, error);
+                       goto err_out;
+               }
+       }
+
+       if (error) {
+               dev_dbg(dev, "no power domains defined\n");
+               goto err_out;
+       }
+
+       of_genpd_add_provider_onecell(np, &pmu->genpd_data);
+
+       return 0;
+
+err_out:
+       rockchip_pm_domain_cleanup(pmu);
+       return error;
+}
+
+static const struct rockchip_domain_info rk3288_pm_domains[] = {
+       [RK3288_PD_VIO]         = DOMAIN_RK3288(7, 7, 4),
+       [RK3288_PD_HEVC]        = DOMAIN_RK3288(14, 10, 9),
+       [RK3288_PD_VIDEO]       = DOMAIN_RK3288(8, 8, 3),
+       [RK3288_PD_GPU]         = DOMAIN_RK3288(9, 9, 2),
+};
+
+static const struct rockchip_pmu_info rk3288_pmu = {
+       .pwr_offset = 0x08,
+       .status_offset = 0x0c,
+       .req_offset = 0x10,
+       .idle_offset = 0x14,
+       .ack_offset = 0x14,
+
+       .core_pwrcnt_offset = 0x34,
+       .gpu_pwrcnt_offset = 0x3c,
+
+       .core_power_transition_time = 24, /* 1us */
+       .gpu_power_transition_time = 24, /* 1us */
+
+       .num_domains = ARRAY_SIZE(rk3288_pm_domains),
+       .domain_info = rk3288_pm_domains,
+};
+
+static const struct of_device_id rockchip_pm_domain_dt_match[] = {
+       {
+               .compatible = "rockchip,rk3288-power-controller",
+               .data = (void *)&rk3288_pmu,
+       },
+       { /* sentinel */ },
+};
+
+static struct platform_driver rockchip_pm_domain_driver = {
+       .probe = rockchip_pm_domain_probe,
+       .driver = {
+               .name   = "rockchip-pm-domain",
+               .of_match_table = rockchip_pm_domain_dt_match,
+               /*
+                * We can't forcibly eject devices form power domain,
+                * so we can't really remove power domains once they
+                * were added.
+                */
+               .suppress_bind_attrs = true,
+       },
+};
+
+static int __init rockchip_pm_domain_drv_register(void)
+{
+       return platform_driver_register(&rockchip_pm_domain_driver);
+}
+postcore_initcall(rockchip_pm_domain_drv_register);
index 51da2341280d76fcff7f0be7f7f4916363726fa5..6ff936cacb700e958dcbfa8086ce315d96a2d426 100644 (file)
@@ -135,9 +135,10 @@ struct knav_pdsp_info {
        };
        void __iomem                                    *intd;
        u32 __iomem                                     *iram;
-       const char                                      *firmware;
        u32                                             id;
        struct list_head                                list;
+       bool                                            loaded;
+       bool                                            started;
 };
 
 struct knav_qmgr_info {
index ef6f69db0bd04c06caa6c1b955e3dbbebc91677a..d2d48f2802bc45b0077c9ce39f496a07306648d9 100644 (file)
@@ -261,6 +261,10 @@ static int knav_range_setup_acc_irq(struct knav_range_info *range,
        if (old && !new) {
                dev_dbg(kdev->dev, "setup-acc-irq: freeing %s for channel %s\n",
                        acc->name, acc->name);
+               ret = irq_set_affinity_hint(irq, NULL);
+               if (ret)
+                       dev_warn(range->kdev->dev,
+                                "Failed to set IRQ affinity\n");
                free_irq(irq, range);
        }
 
@@ -482,8 +486,8 @@ struct knav_range_ops knav_acc_range_ops = {
  * Return 0 on success or error
  */
 int knav_init_acc_range(struct knav_device *kdev,
-                               struct device_node *node,
-                               struct knav_range_info *range)
+                       struct device_node *node,
+                       struct knav_range_info *range)
 {
        struct knav_acc_channel *acc;
        struct knav_pdsp_info *pdsp;
@@ -526,6 +530,12 @@ int knav_init_acc_range(struct knav_device *kdev,
                return -EINVAL;
        }
 
+       if (!pdsp->started) {
+               dev_err(kdev->dev, "pdsp id %d not started for range %s\n",
+                       info->pdsp_id, range->name);
+               return -ENODEV;
+       }
+
        info->pdsp = pdsp;
        channels = range->num_queues;
        if (of_get_property(node, "multi-queue", NULL)) {
index 6d8646db52cca164fa09c10faa5c59761e75ab2f..f3a0b6a4b54ef8093f2dbbabbcdd7c07de1cddbe 100644 (file)
@@ -68,6 +68,12 @@ static DEFINE_MUTEX(knav_dev_lock);
             idx < (kdev)->num_queues_in_use;                   \
             idx++, inst = knav_queue_idx_to_inst(kdev, idx))
 
+/* All firmware file names end up here. List the firmware file names below.
+ * Newest followed by older ones. Search is done from start of the array
+ * until a firmware file is found.
+ */
+const char *knav_acc_firmwares[] = {"ks2_qmss_pdsp_acc48.bin"};
+
 /**
  * knav_queue_notify: qmss queue notfier call
  *
@@ -1439,7 +1445,6 @@ static int knav_queue_init_pdsps(struct knav_device *kdev,
        struct device *dev = kdev->dev;
        struct knav_pdsp_info *pdsp;
        struct device_node *child;
-       int ret;
 
        for_each_child_of_node(pdsps, child) {
                pdsp = devm_kzalloc(dev, sizeof(*pdsp), GFP_KERNEL);
@@ -1448,17 +1453,6 @@ static int knav_queue_init_pdsps(struct knav_device *kdev,
                        return -ENOMEM;
                }
                pdsp->name = knav_queue_find_name(child);
-               ret = of_property_read_string(child, "firmware",
-                                             &pdsp->firmware);
-               if (ret < 0 || !pdsp->firmware) {
-                       dev_err(dev, "unknown firmware for pdsp %s\n",
-                               pdsp->name);
-                       devm_kfree(dev, pdsp);
-                       continue;
-               }
-               dev_dbg(dev, "pdsp name %s fw name :%s\n", pdsp->name,
-                       pdsp->firmware);
-
                pdsp->iram =
                        knav_queue_map_reg(kdev, child,
                                           KNAV_QUEUE_PDSP_IRAM_REG_INDEX);
@@ -1489,9 +1483,9 @@ static int knav_queue_init_pdsps(struct knav_device *kdev,
                }
                of_property_read_u32(child, "id", &pdsp->id);
                list_add_tail(&pdsp->list, &kdev->pdsps);
-               dev_dbg(dev, "added pdsp %s: command %p, iram %p, regs %p, intd %p, firmware %s\n",
+               dev_dbg(dev, "added pdsp %s: command %p, iram %p, regs %p, intd %p\n",
                        pdsp->name, pdsp->command, pdsp->iram, pdsp->regs,
-                       pdsp->intd, pdsp->firmware);
+                       pdsp->intd);
        }
        return 0;
 }
@@ -1510,6 +1504,8 @@ static int knav_queue_stop_pdsp(struct knav_device *kdev,
                dev_err(kdev->dev, "timed out on pdsp %s stop\n", pdsp->name);
                return ret;
        }
+       pdsp->loaded = false;
+       pdsp->started = false;
        return 0;
 }
 
@@ -1518,14 +1514,29 @@ static int knav_queue_load_pdsp(struct knav_device *kdev,
 {
        int i, ret, fwlen;
        const struct firmware *fw;
+       bool found = false;
        u32 *fwdata;
 
-       ret = request_firmware(&fw, pdsp->firmware, kdev->dev);
-       if (ret) {
-               dev_err(kdev->dev, "failed to get firmware %s for pdsp %s\n",
-                       pdsp->firmware, pdsp->name);
-               return ret;
+       for (i = 0; i < ARRAY_SIZE(knav_acc_firmwares); i++) {
+               if (knav_acc_firmwares[i]) {
+                       ret = request_firmware(&fw,
+                                              knav_acc_firmwares[i],
+                                              kdev->dev);
+                       if (!ret) {
+                               found = true;
+                               break;
+                       }
+               }
+       }
+
+       if (!found) {
+               dev_err(kdev->dev, "failed to get firmware for pdsp\n");
+               return -ENODEV;
        }
+
+       dev_info(kdev->dev, "firmware file %s downloaded for PDSP\n",
+                knav_acc_firmwares[i]);
+
        writel_relaxed(pdsp->id + 1, pdsp->command + 0x18);
        /* download the firmware */
        fwdata = (u32 *)fw->data;
@@ -1583,16 +1594,24 @@ static int knav_queue_start_pdsps(struct knav_device *kdev)
        int ret;
 
        knav_queue_stop_pdsps(kdev);
-       /* now load them all */
+       /* now load them all. We return success even if pdsp
+        * is not loaded as acc channels are optional on having
+        * firmware availability in the system. We set the loaded
+        * and stated flag and when initialize the acc range, check
+        * it and init the range only if pdsp is started.
+        */
        for_each_pdsp(kdev, pdsp) {
                ret = knav_queue_load_pdsp(kdev, pdsp);
-               if (ret < 0)
-                       return ret;
+               if (!ret)
+                       pdsp->loaded = true;
        }
 
        for_each_pdsp(kdev, pdsp) {
-               ret = knav_queue_start_pdsp(kdev, pdsp);
-               WARN_ON(ret);
+               if (pdsp->loaded) {
+                       ret = knav_queue_start_pdsp(kdev, pdsp);
+                       if (!ret)
+                               pdsp->started = true;
+               }
        }
        return 0;
 }
index e6974c36276d784be00eafcdeaad994a7188bc5d..fed50d538a414ca4534d36eaea57e9649db8d4d5 100644 (file)
@@ -333,7 +333,7 @@ static unsigned int loop_get_bio(struct lloop_device *lo, struct bio **req)
        return count;
 }
 
-static void loop_make_request(struct request_queue *q, struct bio *old_bio)
+static blk_qc_t loop_make_request(struct request_queue *q, struct bio *old_bio)
 {
        struct lloop_device *lo = q->queuedata;
        int rw = bio_rw(old_bio);
@@ -364,9 +364,10 @@ static void loop_make_request(struct request_queue *q, struct bio *old_bio)
                goto err;
        }
        loop_add_bio(lo, old_bio);
-       return;
+       return BLK_QC_T_NONE;
 err:
        bio_io_error(old_bio);
+       return BLK_QC_T_NONE;
 }
 
 static inline void loop_handle_bio(struct lloop_device *lo, struct bio *bio)
index 6b659967898ebc534c1ce8d91ff1179f050e8f34..5f399ea1d20a75301f31c0b4e50261319cd778f5 100644 (file)
@@ -35,6 +35,7 @@
 #include <linux/utsname.h>
 #include <linux/coredump.h>
 #include <linux/sched.h>
+#include <linux/dax.h>
 #include <asm/uaccess.h>
 #include <asm/param.h>
 #include <asm/page.h>
@@ -1236,6 +1237,15 @@ static unsigned long vma_dump_size(struct vm_area_struct *vma,
        if (vma->vm_flags & VM_DONTDUMP)
                return 0;
 
+       /* support for DAX */
+       if (vma_is_dax(vma)) {
+               if ((vma->vm_flags & VM_SHARED) && FILTER(DAX_SHARED))
+                       goto whole;
+               if (!(vma->vm_flags & VM_SHARED) && FILTER(DAX_PRIVATE))
+                       goto whole;
+               return 0;
+       }
+
        /* Hugetlb memory check */
        if (vma->vm_flags & VM_HUGETLB) {
                if ((vma->vm_flags & VM_SHARED) && FILTER(HUGETLB_SHARED))
index 50d15b7b0ca9f11953209bff7e03b8fb40358a57..b1adb92e69de7a8049dd914f3f8bb83d8d8b9c7f 100644 (file)
@@ -35,6 +35,7 @@
 #include <linux/elf-fdpic.h>
 #include <linux/elfcore.h>
 #include <linux/coredump.h>
+#include <linux/dax.h>
 
 #include <asm/uaccess.h>
 #include <asm/param.h>
@@ -1231,6 +1232,20 @@ static int maydump(struct vm_area_struct *vma, unsigned long mm_flags)
                return 0;
        }
 
+       /* support for DAX */
+       if (vma_is_dax(vma)) {
+               if (vma->vm_flags & VM_SHARED) {
+                       dump_ok = test_bit(MMF_DUMP_DAX_SHARED, &mm_flags);
+                       kdcore("%08lx: %08lx: %s (DAX shared)", vma->vm_start,
+                              vma->vm_flags, dump_ok ? "yes" : "no");
+               } else {
+                       dump_ok = test_bit(MMF_DUMP_DAX_PRIVATE, &mm_flags);
+                       kdcore("%08lx: %08lx: %s (DAX private)", vma->vm_start,
+                              vma->vm_flags, dump_ok ? "yes" : "no");
+               }
+               return dump_ok;
+       }
+
        /* By default, dump shared memory if mapped from an anonymous file. */
        if (vma->vm_flags & VM_SHARED) {
                if (file_inode(vma->vm_file)->i_nlink == 0) {
index 48851f6ea6ecc9af8c54b9e664909c878dc26bb7..dcf26537c935f25ed10a534a13e31492802c5369 100644 (file)
@@ -686,7 +686,7 @@ static int do_i2c_rdwr_ioctl(unsigned int fd, unsigned int cmd,
 
        if (get_user(nmsgs, &udata->nmsgs))
                return -EFAULT;
-       if (nmsgs > I2C_RDRW_IOCTL_MAX_MSGS)
+       if (nmsgs > I2C_RDWR_IOCTL_MAX_MSGS)
                return -EINVAL;
 
        if (get_user(datap, &udata->msgs))
index 18e7554cf94cac57d1eb3dc17ba4001e75cef5f6..cb5337d8c273a5dd58e97d9be587fb56d643e52a 100644 (file)
@@ -109,6 +109,8 @@ struct dio_submit {
 struct dio {
        int flags;                      /* doesn't change */
        int rw;
+       blk_qc_t bio_cookie;
+       struct block_device *bio_bdev;
        struct inode *inode;
        loff_t i_size;                  /* i_size when submitted */
        dio_iodone_t *end_io;           /* IO completion function */
@@ -397,11 +399,14 @@ static inline void dio_bio_submit(struct dio *dio, struct dio_submit *sdio)
        if (dio->is_async && dio->rw == READ && dio->should_dirty)
                bio_set_pages_dirty(bio);
 
-       if (sdio->submit_io)
+       dio->bio_bdev = bio->bi_bdev;
+
+       if (sdio->submit_io) {
                sdio->submit_io(dio->rw, bio, dio->inode,
                               sdio->logical_offset_in_bio);
-       else
-               submit_bio(dio->rw, bio);
+               dio->bio_cookie = BLK_QC_T_NONE;
+       } else
+               dio->bio_cookie = submit_bio(dio->rw, bio);
 
        sdio->bio = NULL;
        sdio->boundary = 0;
@@ -440,7 +445,8 @@ static struct bio *dio_await_one(struct dio *dio)
                __set_current_state(TASK_UNINTERRUPTIBLE);
                dio->waiter = current;
                spin_unlock_irqrestore(&dio->bio_lock, flags);
-               io_schedule();
+               if (!blk_poll(bdev_get_queue(dio->bio_bdev), dio->bio_cookie))
+                       io_schedule();
                /* wake up sets us TASK_RUNNING */
                spin_lock_irqsave(&dio->bio_lock, flags);
                dio->waiter = NULL;
index ba66d508006afe3acb2716a7da021ff484c436c0..7ff7712f284e030baf4e90a268c0577429497574 100644 (file)
@@ -35,3 +35,18 @@ config UBIFS_FS_ZLIB
        default y
        help
          Zlib compresses better than LZO but it is slower. Say 'Y' if unsure.
+
+config UBIFS_ATIME_SUPPORT
+       bool "Access time support" if UBIFS_FS
+       depends on UBIFS_FS
+       default n
+       help
+         Originally UBIFS did not support atime, because it looked like a bad idea due
+         increased flash wear. This option adds atime support and it is disabled by default
+         to preserve the old behavior. If you enable this option, UBIFS starts updating atime,
+         which means that file-system read operations will cause writes (inode atime
+         updates). This may affect file-system performance and increase flash device wear,
+         so be careful. How often atime is updated depends on the selected strategy:
+         strictatime is the "heavy", relatime is "lighter", etc.
+
+         If unsure, say 'N'
index 4c46a9865fa74b71d77e68273866c0f7a0849a18..595ca0debe1170c36c6b21af3d51226872db7939 100644 (file)
@@ -2573,7 +2573,7 @@ int dbg_leb_write(struct ubifs_info *c, int lnum, const void *buf,
 {
        int err, failing;
 
-       if (c->dbg->pc_happened)
+       if (dbg_is_power_cut(c))
                return -EROFS;
 
        failing = power_cut_emulated(c, lnum, 1);
@@ -2595,7 +2595,7 @@ int dbg_leb_change(struct ubifs_info *c, int lnum, const void *buf,
 {
        int err;
 
-       if (c->dbg->pc_happened)
+       if (dbg_is_power_cut(c))
                return -EROFS;
        if (power_cut_emulated(c, lnum, 1))
                return -EROFS;
@@ -2611,7 +2611,7 @@ int dbg_leb_unmap(struct ubifs_info *c, int lnum)
 {
        int err;
 
-       if (c->dbg->pc_happened)
+       if (dbg_is_power_cut(c))
                return -EROFS;
        if (power_cut_emulated(c, lnum, 0))
                return -EROFS;
@@ -2627,7 +2627,7 @@ int dbg_leb_map(struct ubifs_info *c, int lnum)
 {
        int err;
 
-       if (c->dbg->pc_happened)
+       if (dbg_is_power_cut(c))
                return -EROFS;
        if (power_cut_emulated(c, lnum, 0))
                return -EROFS;
index 5c27c66c224af38618ec4f92b453bd8e65d24608..e49bd2808bf3e397b9b499fe4d6036ad7600a71b 100644 (file)
@@ -449,13 +449,14 @@ static int ubifs_readdir(struct file *file, struct dir_context *ctx)
        }
 
 out:
+       kfree(file->private_data);
+       file->private_data = NULL;
+
        if (err != -ENOENT) {
                ubifs_err(c, "cannot find next direntry, error %d", err);
                return err;
        }
 
-       kfree(file->private_data);
-       file->private_data = NULL;
        /* 2 is a special value indicating that there are no more direntries */
        ctx->pos = 2;
        return 0;
@@ -787,9 +788,6 @@ static int ubifs_mknod(struct inode *dir, struct dentry *dentry,
 
        dbg_gen("dent '%pd' in dir ino %lu", dentry, dir->i_ino);
 
-       if (!new_valid_dev(rdev))
-               return -EINVAL;
-
        if (S_ISBLK(mode) || S_ISCHR(mode)) {
                dev = kmalloc(sizeof(union ubifs_dev_desc), GFP_NOFS);
                if (!dev)
@@ -1188,6 +1186,9 @@ const struct inode_operations ubifs_dir_inode_operations = {
        .getxattr    = ubifs_getxattr,
        .listxattr   = ubifs_listxattr,
        .removexattr = ubifs_removexattr,
+#ifdef CONFIG_UBIFS_ATIME_SUPPORT
+       .update_time = ubifs_update_time,
+#endif
 };
 
 const struct file_operations ubifs_dir_operations = {
index a3dfe2ae79f28592a0ba01feb6d0b1889345957c..0edc128561476a804656fba068810cf47a76fa32 100644 (file)
@@ -1354,6 +1354,47 @@ static inline int mctime_update_needed(const struct inode *inode,
        return 0;
 }
 
+#ifdef CONFIG_UBIFS_ATIME_SUPPORT
+/**
+ * ubifs_update_time - update time of inode.
+ * @inode: inode to update
+ *
+ * This function updates time of the inode.
+ */
+int ubifs_update_time(struct inode *inode, struct timespec *time,
+                            int flags)
+{
+       struct ubifs_inode *ui = ubifs_inode(inode);
+       struct ubifs_info *c = inode->i_sb->s_fs_info;
+       struct ubifs_budget_req req = { .dirtied_ino = 1,
+                       .dirtied_ino_d = ALIGN(ui->data_len, 8) };
+       int iflags = I_DIRTY_TIME;
+       int err, release;
+
+       err = ubifs_budget_space(c, &req);
+       if (err)
+               return err;
+
+       mutex_lock(&ui->ui_mutex);
+       if (flags & S_ATIME)
+               inode->i_atime = *time;
+       if (flags & S_CTIME)
+               inode->i_ctime = *time;
+       if (flags & S_MTIME)
+               inode->i_mtime = *time;
+
+       if (!(inode->i_sb->s_flags & MS_LAZYTIME))
+               iflags |= I_DIRTY_SYNC;
+
+       release = ui->dirty;
+       __mark_inode_dirty(inode, iflags);
+       mutex_unlock(&ui->ui_mutex);
+       if (release)
+               ubifs_release_budget(c, &req);
+       return 0;
+}
+#endif
+
 /**
  * update_ctime - update mtime and ctime of an inode.
  * @inode: inode to update
@@ -1537,6 +1578,9 @@ static int ubifs_file_mmap(struct file *file, struct vm_area_struct *vma)
        if (err)
                return err;
        vma->vm_ops = &ubifs_file_vm_ops;
+#ifdef CONFIG_UBIFS_ATIME_SUPPORT
+       file_accessed(file);
+#endif
        return 0;
 }
 
@@ -1557,6 +1601,9 @@ const struct inode_operations ubifs_file_inode_operations = {
        .getxattr    = ubifs_getxattr,
        .listxattr   = ubifs_listxattr,
        .removexattr = ubifs_removexattr,
+#ifdef CONFIG_UBIFS_ATIME_SUPPORT
+       .update_time = ubifs_update_time,
+#endif
 };
 
 const struct inode_operations ubifs_symlink_inode_operations = {
@@ -1568,6 +1615,9 @@ const struct inode_operations ubifs_symlink_inode_operations = {
        .getxattr    = ubifs_getxattr,
        .listxattr   = ubifs_listxattr,
        .removexattr = ubifs_removexattr,
+#ifdef CONFIG_UBIFS_ATIME_SUPPORT
+       .update_time = ubifs_update_time,
+#endif
 };
 
 const struct file_operations ubifs_file_operations = {
index dc9f27e9d61be5b8586af0025d95a0dc305afecc..9a517109da0feda2ac19ba4781072ab4ab4aad31 100644 (file)
@@ -1498,11 +1498,10 @@ static struct ubifs_nnode *dirty_cow_nnode(struct ubifs_info *c,
        }
 
        /* nnode is being committed, so copy it */
-       n = kmalloc(sizeof(struct ubifs_nnode), GFP_NOFS);
+       n = kmemdup(nnode, sizeof(struct ubifs_nnode), GFP_NOFS);
        if (unlikely(!n))
                return ERR_PTR(-ENOMEM);
 
-       memcpy(n, nnode, sizeof(struct ubifs_nnode));
        n->cnext = NULL;
        __set_bit(DIRTY_CNODE, &n->flags);
        __clear_bit(COW_CNODE, &n->flags);
@@ -1549,11 +1548,10 @@ static struct ubifs_pnode *dirty_cow_pnode(struct ubifs_info *c,
        }
 
        /* pnode is being committed, so copy it */
-       p = kmalloc(sizeof(struct ubifs_pnode), GFP_NOFS);
+       p = kmemdup(pnode, sizeof(struct ubifs_pnode), GFP_NOFS);
        if (unlikely(!p))
                return ERR_PTR(-ENOMEM);
 
-       memcpy(p, pnode, sizeof(struct ubifs_pnode));
        p->cnext = NULL;
        __set_bit(DIRTY_CNODE, &p->flags);
        __clear_bit(COW_CNODE, &p->flags);
index ee7cb5ebb6e8910f851469bce4dcb205785cb85c..8ece6ca58c0ba128f658ea0c42ddc7976d942314 100644 (file)
@@ -155,13 +155,8 @@ static inline int ubifs_wbuf_sync(struct ubifs_wbuf *wbuf)
  */
 static inline int ubifs_encode_dev(union ubifs_dev_desc *dev, dev_t rdev)
 {
-       if (new_valid_dev(rdev)) {
-               dev->new = cpu_to_le32(new_encode_dev(rdev));
-               return sizeof(dev->new);
-       } else {
-               dev->huge = cpu_to_le64(huge_encode_dev(rdev));
-               return sizeof(dev->huge);
-       }
+       dev->new = cpu_to_le32(new_encode_dev(rdev));
+       return sizeof(dev->new);
 }
 
 /**
index 695fc71d5244c6e0a24b2bb5ac80b9c72e421e28..586d59347fff00c4572af57bf6e487f6fa2932d8 100644 (file)
@@ -789,7 +789,7 @@ struct ubifs_scan_leb *ubifs_recover_leb(struct ubifs_info *c, int lnum,
 corrupted_rescan:
        /* Re-scan the corrupted data with verbose messages */
        ubifs_err(c, "corruption %d", ret);
-       ubifs_scan_a_node(c, buf, len, lnum, offs, 1);
+       ubifs_scan_a_node(c, buf, len, lnum, offs, 0);
 corrupted:
        ubifs_scanned_corruption(c, lnum, offs, buf);
        err = -EUCLEAN;
@@ -1331,8 +1331,7 @@ void ubifs_destroy_size_tree(struct ubifs_info *c)
        struct size_entry *e, *n;
 
        rbtree_postorder_for_each_entry_safe(e, n, &c->size_tree, rb) {
-               if (e->inode)
-                       iput(e->inode);
+               iput(e->inode);
                kfree(e);
        }
 
@@ -1533,8 +1532,7 @@ int ubifs_recover_size(struct ubifs_info *c)
                                err = fix_size_in_place(c, e);
                                if (err)
                                        return err;
-                               if (e->inode)
-                                       iput(e->inode);
+                               iput(e->inode);
                        }
                }
 
index 9547a27868ad49e11151c324c8f60a7db2bc92f6..8ee3133dd8e49af9f413025683236cf464a62f12 100644 (file)
@@ -128,7 +128,10 @@ struct inode *ubifs_iget(struct super_block *sb, unsigned long inum)
        if (err)
                goto out_ino;
 
-       inode->i_flags |= (S_NOCMTIME | S_NOATIME);
+       inode->i_flags |= S_NOCMTIME;
+#ifndef CONFIG_UBIFS_ATIME_SUPPORT
+       inode->i_flags |= S_NOATIME;
+#endif
        set_nlink(inode, le32_to_cpu(ino->nlink));
        i_uid_write(inode, le32_to_cpu(ino->uid));
        i_gid_write(inode, le32_to_cpu(ino->gid));
@@ -2139,7 +2142,12 @@ static struct dentry *ubifs_mount(struct file_system_type *fs_type, int flags,
                if (err)
                        goto out_deact;
                /* We do not support atime */
-               sb->s_flags |= MS_ACTIVE | MS_NOATIME;
+               sb->s_flags |= MS_ACTIVE;
+#ifndef CONFIG_UBIFS_ATIME_SUPPORT
+               sb->s_flags |= MS_NOATIME;
+#else
+               ubifs_msg(c, "full atime support is enabled.");
+#endif
        }
 
        /* 'fill_super()' opens ubi again so we must close it here */
index 957f5757f3742bf07cdb6747b27b60b8ff2bf97a..fa9a20cc60d6744e13ef7cc2f788f0fda0861d58 100644 (file)
@@ -198,11 +198,10 @@ static struct ubifs_znode *copy_znode(struct ubifs_info *c,
 {
        struct ubifs_znode *zn;
 
-       zn = kmalloc(c->max_znode_sz, GFP_NOFS);
+       zn = kmemdup(znode, c->max_znode_sz, GFP_NOFS);
        if (unlikely(!zn))
                return ERR_PTR(-ENOMEM);
 
-       memcpy(zn, znode, c->max_znode_sz);
        zn->cnext = NULL;
        __set_bit(DIRTY_ZNODE, &zn->flags);
        __clear_bit(COW_ZNODE, &zn->flags);
index de759022f3d636d74a62445ab33bd2b9b0e48dac..01142e129d168ccba3139992ce50df56c9acea3a 100644 (file)
@@ -858,9 +858,9 @@ struct ubifs_compressor {
  * @mod_dent: non-zero if the operation removes or modifies an existing
  *            directory entry
  * @new_ino: non-zero if the operation adds a new inode
- * @new_ino_d: now much data newly created inode contains
+ * @new_ino_d: how much data newly created inode contains
  * @dirtied_ino: how many inodes the operation makes dirty
- * @dirtied_ino_d: now much data dirtied inode contains
+ * @dirtied_ino_d: how much data dirtied inode contains
  * @idx_growth: how much the index will supposedly grow
  * @data_growth: how much new data the operation will supposedly add
  * @dd_growth: how much data that makes other data dirty the operation will
@@ -1746,6 +1746,9 @@ int ubifs_calc_dark(const struct ubifs_info *c, int spc);
 /* file.c */
 int ubifs_fsync(struct file *file, loff_t start, loff_t end, int datasync);
 int ubifs_setattr(struct dentry *dentry, struct iattr *attr);
+#ifdef CONFIG_UBIFS_ATIME_SUPPORT
+int ubifs_update_time(struct inode *inode, struct timespec *time, int flags);
+#endif
 
 /* dir.c */
 struct inode *ubifs_new_inode(struct ubifs_info *c, const struct inode *dir,
index fd65b3f1923ccdb609ee29601604624abf32333d..259fbabf143d8cb8cf4e88df59268710fd420137 100644 (file)
@@ -200,6 +200,7 @@ static int change_xattr(struct ubifs_info *c, struct inode *host,
        int err;
        struct ubifs_inode *host_ui = ubifs_inode(host);
        struct ubifs_inode *ui = ubifs_inode(inode);
+       void *buf = NULL;
        struct ubifs_budget_req req = { .dirtied_ino = 2,
                .dirtied_ino_d = ALIGN(size, 8) + ALIGN(host_ui->data_len, 8) };
 
@@ -208,14 +209,17 @@ static int change_xattr(struct ubifs_info *c, struct inode *host,
        if (err)
                return err;
 
-       kfree(ui->data);
-       ui->data = kmemdup(value, size, GFP_NOFS);
-       if (!ui->data) {
+       buf = kmemdup(value, size, GFP_NOFS);
+       if (!buf) {
                err = -ENOMEM;
                goto out_free;
        }
+       mutex_lock(&ui->ui_mutex);
+       kfree(ui->data);
+       ui->data = buf;
        inode->i_size = ui->ui_size = size;
        ui->data_len = size;
+       mutex_unlock(&ui->ui_mutex);
 
        mutex_lock(&host_ui->ui_mutex);
        host->i_ctime = ubifs_current_time(host);
@@ -409,6 +413,7 @@ ssize_t ubifs_getxattr(struct dentry *dentry, const char *name, void *buf,
        ubifs_assert(inode->i_size == ui->data_len);
        ubifs_assert(ubifs_inode(host)->xattr_size > ui->data_len);
 
+       mutex_lock(&ui->ui_mutex);
        if (buf) {
                /* If @buf is %NULL we are supposed to return the length */
                if (ui->data_len > size) {
@@ -423,6 +428,7 @@ ssize_t ubifs_getxattr(struct dentry *dentry, const char *name, void *buf,
        err = ui->data_len;
 
 out_iput:
+       mutex_unlock(&ui->ui_mutex);
        iput(inode);
 out_unlock:
        kfree(xent);
index 287fc3b4afb26cc59166a0a812ae6ce7dafe3acd..72eaf91c9ca6c76946365631a20348407684e3c1 100644 (file)
@@ -29,3 +29,4 @@
 #define CLKID_SMEMC            24
 #define CLKID_PCIE             25
 #define CLKID_TWD              26
+#define CLKID_CPU              27
index 8183d1c237d9562fc899ea44571a756a7f1491c7..15508adcdfde5451a8d8a230bf0f2e3c29cbd7a4 100644 (file)
 /* mux clocks */
 #define CLK_MOUT_HDMI          1024
 #define CLK_MOUT_GPLL          1025
+#define CLK_MOUT_ACLK200_DISP1_SUB     1026
+#define CLK_MOUT_ACLK300_DISP1_SUB     1027
 
 /* must be greater than maximal clock id */
-#define CLK_NR_CLKS            1026
+#define CLK_NR_CLKS            1028
 
 #endif /* _DT_BINDINGS_CLOCK_EXYNOS_5250_H */
diff --git a/include/dt-bindings/power/rk3288-power.h b/include/dt-bindings/power/rk3288-power.h
new file mode 100644 (file)
index 0000000..b8b1045
--- /dev/null
@@ -0,0 +1,31 @@
+#ifndef __DT_BINDINGS_POWER_RK3288_POWER_H__
+#define __DT_BINDINGS_POWER_RK3288_POWER_H__
+
+/**
+ * RK3288 Power Domain and Voltage Domain Summary.
+ */
+
+/* VD_CORE */
+#define RK3288_PD_A17_0                0
+#define RK3288_PD_A17_1                1
+#define RK3288_PD_A17_2                2
+#define RK3288_PD_A17_3                3
+#define RK3288_PD_SCU          4
+#define RK3288_PD_DEBUG                5
+#define RK3288_PD_MEM          6
+
+/* VD_LOGIC */
+#define RK3288_PD_BUS          7
+#define RK3288_PD_PERI         8
+#define RK3288_PD_VIO          9
+#define RK3288_PD_ALIVE                10
+#define RK3288_PD_HEVC         11
+#define RK3288_PD_VIDEO                12
+
+/* VD_GPU */
+#define RK3288_PD_GPU          13
+
+/* VD_PMU */
+#define RK3288_PD_PMU          14
+
+#endif
index d6f95bb481d447ae95046c523ae0a62f5ded234f..ebfac2fe0c813bea9d98d01e8dc4f244e1bd97d4 100644 (file)
@@ -514,6 +514,11 @@ static inline bool has_acpi_companion(struct device *dev)
        return false;
 }
 
+static inline void acpi_preset_companion(struct device *dev,
+                                        struct acpi_device *parent, u64 addr)
+{
+}
+
 static inline const char *acpi_dev_name(struct acpi_device *adev)
 {
        return NULL;
index b87c1c7c242a7eea1eff286b3f292e5fa8ccd2d4..468fdfa643f0d1c535becd96f4dd3b46d58e263f 100644 (file)
@@ -67,6 +67,7 @@ struct atmel_tc {
        const struct atmel_tcb_config *tcb_config;
        int                     irq[3];
        struct clk              *clk[3];
+       struct clk              *slow_clk;
        struct list_head        node;
        bool                    allocated;
 };
index 83cc9d4e545518e3cff6ff7d38067102e9398cf8..daf17d70aeca92a40a8efc112fc3b48ffe6501cb 100644 (file)
@@ -59,6 +59,9 @@ struct blk_mq_hw_ctx {
 
        struct blk_mq_cpu_notifier      cpu_notifier;
        struct kobject          kobj;
+
+       unsigned long           poll_invoked;
+       unsigned long           poll_success;
 };
 
 struct blk_mq_tag_set {
@@ -97,6 +100,8 @@ typedef void (exit_request_fn)(void *, struct request *, unsigned int,
 typedef void (busy_iter_fn)(struct blk_mq_hw_ctx *, struct request *, void *,
                bool);
 typedef void (busy_tag_iter_fn)(struct request *, void *, bool);
+typedef int (poll_fn)(struct blk_mq_hw_ctx *, unsigned int);
+
 
 struct blk_mq_ops {
        /*
@@ -114,6 +119,11 @@ struct blk_mq_ops {
         */
        timeout_fn              *timeout;
 
+       /*
+        * Called to poll for completion of a specific tag.
+        */
+       poll_fn                 *poll;
+
        softirq_done_fn         *complete;
 
        /*
index e8130138f29d43fe95d09e99442de1912e3895fb..641e5a3ed58c4d2e1d8fb5c64c216eb3b5b821a5 100644 (file)
@@ -244,4 +244,28 @@ enum rq_flag_bits {
 #define REQ_MQ_INFLIGHT                (1ULL << __REQ_MQ_INFLIGHT)
 #define REQ_NO_TIMEOUT         (1ULL << __REQ_NO_TIMEOUT)
 
+typedef unsigned int blk_qc_t;
+#define BLK_QC_T_NONE  -1U
+#define BLK_QC_T_SHIFT 16
+
+static inline bool blk_qc_t_valid(blk_qc_t cookie)
+{
+       return cookie != BLK_QC_T_NONE;
+}
+
+static inline blk_qc_t blk_tag_to_qc_t(unsigned int tag, unsigned int queue_num)
+{
+       return tag | (queue_num << BLK_QC_T_SHIFT);
+}
+
+static inline unsigned int blk_qc_t_to_queue_num(blk_qc_t cookie)
+{
+       return cookie >> BLK_QC_T_SHIFT;
+}
+
+static inline unsigned int blk_qc_t_to_tag(blk_qc_t cookie)
+{
+       return cookie & 0xffff;
+}
+
 #endif /* __LINUX_BLK_TYPES_H */
index d045ca8487af17eb2aee07a8aed267f5b74e1b83..3fe27f8d91f04f83751453f19f4e4bb6a4f9a2b4 100644 (file)
@@ -209,7 +209,7 @@ static inline unsigned short req_get_ioprio(struct request *req)
 struct blk_queue_ctx;
 
 typedef void (request_fn_proc) (struct request_queue *q);
-typedef void (make_request_fn) (struct request_queue *q, struct bio *bio);
+typedef blk_qc_t (make_request_fn) (struct request_queue *q, struct bio *bio);
 typedef int (prep_rq_fn) (struct request_queue *, struct request *);
 typedef void (unprep_rq_fn) (struct request_queue *, struct request *);
 
@@ -487,6 +487,7 @@ struct request_queue {
 #define QUEUE_FLAG_DEAD        19      /* queue tear-down finished */
 #define QUEUE_FLAG_INIT_DONE   20      /* queue is initialized */
 #define QUEUE_FLAG_NO_SG_MERGE 21      /* don't attempt to merge SG segments*/
+#define QUEUE_FLAG_POLL               22       /* IO polling enabled if set */
 
 #define QUEUE_FLAG_DEFAULT     ((1 << QUEUE_FLAG_IO_STAT) |            \
                                 (1 << QUEUE_FLAG_STACKABLE)    |       \
@@ -761,7 +762,7 @@ static inline void rq_flush_dcache_pages(struct request *rq)
 
 extern int blk_register_queue(struct gendisk *disk);
 extern void blk_unregister_queue(struct gendisk *disk);
-extern void generic_make_request(struct bio *bio);
+extern blk_qc_t generic_make_request(struct bio *bio);
 extern void blk_rq_init(struct request_queue *q, struct request *rq);
 extern void blk_put_request(struct request *);
 extern void __blk_put_request(struct request_queue *, struct request *);
@@ -814,6 +815,8 @@ extern int blk_execute_rq(struct request_queue *, struct gendisk *,
 extern void blk_execute_rq_nowait(struct request_queue *, struct gendisk *,
                                  struct request *, int, rq_end_io_fn *);
 
+bool blk_poll(struct request_queue *q, blk_qc_t cookie);
+
 static inline struct request_queue *bdev_get_queue(struct block_device *bdev)
 {
        return bdev->bd_disk->queue;    /* this is never NULL */
index 5d7bc6349930632e464402b2066bdacb25f28490..b8f411b57dcb2c77fcaee7194fd439b739bf1e04 100644 (file)
@@ -604,13 +604,21 @@ typedef void (*dr_release_t)(struct device *dev, void *res);
 typedef int (*dr_match_t)(struct device *dev, void *res, void *match_data);
 
 #ifdef CONFIG_DEBUG_DEVRES
-extern void *__devres_alloc(dr_release_t release, size_t size, gfp_t gfp,
-                            const char *name);
+extern void *__devres_alloc_node(dr_release_t release, size_t size, gfp_t gfp,
+                                int nid, const char *name);
 #define devres_alloc(release, size, gfp) \
-       __devres_alloc(release, size, gfp, #release)
+       __devres_alloc_node(release, size, gfp, NUMA_NO_NODE, #release)
+#define devres_alloc_node(release, size, gfp, nid) \
+       __devres_alloc_node(release, size, gfp, nid, #release)
 #else
-extern void *devres_alloc(dr_release_t release, size_t size, gfp_t gfp);
+extern void *devres_alloc_node(dr_release_t release, size_t size, gfp_t gfp,
+                              int nid);
+static inline void *devres_alloc(dr_release_t release, size_t size, gfp_t gfp)
+{
+       return devres_alloc_node(release, size, gfp, NUMA_NO_NODE);
+}
 #endif
+
 extern void devres_for_each_res(struct device *dev, dr_release_t release,
                                dr_match_t match, void *match_data,
                                void (*fn)(struct device *, void *, void *),
index 9a1cb8c605e0e290d5d5b63829eb151aa55aa180..6230eb2a9ccadc1657a25b88e48f09e9560e067f 100644 (file)
@@ -2613,7 +2613,7 @@ static inline void remove_inode_hash(struct inode *inode)
 extern void inode_sb_list_add(struct inode *inode);
 
 #ifdef CONFIG_BLOCK
-extern void submit_bio(int, struct bio *);
+extern blk_qc_t submit_bio(int, struct bio *);
 extern int bdev_read_only(struct block_device *);
 #endif
 extern int set_blocksize(struct block_device *, int);
index 1c06b5c7c308468204e53883398c11d29d12539a..01edd96fe1f76a3a1ccc06c49f49e2f0a6f3ce4a 100644 (file)
@@ -15,6 +15,7 @@ struct ocores_i2c_platform_data {
        u32 reg_shift; /* register offset shift value */
        u32 reg_io_width; /* register io read/write width */
        u32 clock_khz; /* input clock in kHz */
+       bool big_endian; /* registers are big endian */
        u8 num_devices; /* number of devices in the devices list */
        struct i2c_board_info const *devices; /* devices connected to the bus */
 };
diff --git a/include/linux/i2c/i2c-rcar.h b/include/linux/i2c/i2c-rcar.h
deleted file mode 100644 (file)
index 496f5c2..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#ifndef __I2C_R_CAR_H__
-#define __I2C_R_CAR_H__
-
-#include <linux/platform_device.h>
-
-struct i2c_rcar_platform_data {
-       u32 bus_speed;
-};
-
-#endif /* __I2C_R_CAR_H__ */
index 5ebd70d12f3534b09cbc5fe9e73d6f35639317e2..69c9057e1ab89330b1ed22cd0681bf5440ce0096 100644 (file)
@@ -426,7 +426,7 @@ static inline struct ppa_addr block_to_ppa(struct nvm_dev *dev,
        return ppa;
 }
 
-typedef void (nvm_tgt_make_rq_fn)(struct request_queue *, struct bio *);
+typedef blk_qc_t (nvm_tgt_make_rq_fn)(struct request_queue *, struct bio *);
 typedef sector_t (nvm_tgt_capacity_fn)(void *);
 typedef int (nvm_tgt_end_io_fn)(struct nvm_rq *, int);
 typedef void *(nvm_tgt_init_fn)(struct nvm_dev *, struct gendisk *, int, int);
diff --git a/include/linux/mfd/syscon/imx7-iomuxc-gpr.h b/include/linux/mfd/syscon/imx7-iomuxc-gpr.h
new file mode 100644 (file)
index 0000000..4585d61
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2015 Freescale Semiconductor, Inc.
+ *
+ * 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.
+ */
+
+#ifndef __LINUX_IMX7_IOMUXC_GPR_H
+#define __LINUX_IMX7_IOMUXC_GPR_H
+
+#define IOMUXC_GPR0    0x00
+#define IOMUXC_GPR1    0x04
+#define IOMUXC_GPR2    0x08
+#define IOMUXC_GPR3    0x0c
+#define IOMUXC_GPR4    0x10
+#define IOMUXC_GPR5    0x14
+#define IOMUXC_GPR6    0x18
+#define IOMUXC_GPR7    0x1c
+#define IOMUXC_GPR8    0x20
+#define IOMUXC_GPR9    0x24
+#define IOMUXC_GPR10   0x28
+#define IOMUXC_GPR11   0x2c
+#define IOMUXC_GPR12   0x30
+#define IOMUXC_GPR13   0x34
+#define IOMUXC_GPR14   0x38
+#define IOMUXC_GPR15   0x3c
+#define IOMUXC_GPR16   0x40
+#define IOMUXC_GPR17   0x44
+#define IOMUXC_GPR18   0x48
+#define IOMUXC_GPR19   0x4c
+#define IOMUXC_GPR20   0x50
+#define IOMUXC_GPR21   0x54
+#define IOMUXC_GPR22   0x58
+
+/* For imx7d iomux gpr register field define */
+#define IMX7D_GPR1_IRQ_MASK                    (0x1 << 12)
+#define IMX7D_GPR1_ENET1_TX_CLK_SEL_MASK       (0x1 << 13)
+#define IMX7D_GPR1_ENET2_TX_CLK_SEL_MASK       (0x1 << 14)
+#define IMX7D_GPR1_ENET_TX_CLK_SEL_MASK                (0x3 << 13)
+#define IMX7D_GPR1_ENET1_CLK_DIR_MASK          (0x1 << 17)
+#define IMX7D_GPR1_ENET2_CLK_DIR_MASK          (0x1 << 18)
+#define IMX7D_GPR1_ENET_CLK_DIR_MASK           (0x3 << 17)
+
+#define IMX7D_GPR5_CSI_MUX_CONTROL_MIPI                (0x1 << 4)
+
+#endif /* __LINUX_IMX7_IOMUXC_GPR_H */
index a9e3bf42d287317b17d5a6666658ba34b22381f8..d20891465247dfaa983225ce9336b14c91cb7fab 100644 (file)
@@ -1322,6 +1322,7 @@ enum netdev_priv_flags {
 #define IFF_L3MDEV_MASTER              IFF_L3MDEV_MASTER
 #define IFF_NO_QUEUE                   IFF_NO_QUEUE
 #define IFF_OPENVSWITCH                        IFF_OPENVSWITCH
+#define IFF_L3MDEV_SLAVE               IFF_L3MDEV_SLAVE
 
 /**
  *     struct net_device - The DEVICE structure.
index 91b16adab0cd2bf347e1d2fc89a9a149458d94e2..3c8825b67298fafe60f22c803206f9f0789fc8f7 100644 (file)
@@ -9,15 +9,7 @@
 
 #include <linux/mtd/nand.h>
 #include <linux/mtd/partitions.h>
-#include <linux/device.h>
-#include <linux/i2c.h>
-#include <linux/leds.h>
-#include <linux/spi/spi.h>
-#include <linux/usb/atmel_usba_udc.h>
-#include <linux/atmel-mci.h>
-#include <sound/atmel-ac97c.h>
 #include <linux/serial.h>
-#include <linux/platform_data/macb.h>
 
  /* Compact Flash */
 struct at91_cf_data {
index 85f810b339175f71367f6a06fe09a24f82f96f10..acfea8ce4a07be8b6291c76ca0f53728b06ae5fa 100644 (file)
@@ -65,11 +65,6 @@ static inline void memcpy_from_pmem(void *dst, void __pmem const *src, size_t si
        memcpy(dst, (void __force const *) src, size);
 }
 
-static inline void memunmap_pmem(struct device *dev, void __pmem *addr)
-{
-       devm_memunmap(dev, (void __force *) addr);
-}
-
 static inline bool arch_has_pmem_api(void)
 {
        return IS_ENABLED(CONFIG_ARCH_HAS_PMEM_API);
@@ -93,7 +88,7 @@ static inline bool arch_has_wmb_pmem(void)
  * These defaults seek to offer decent performance and minimize the
  * window between i/o completion and writes being durable on media.
  * However, it is undefined / architecture specific whether
- * default_memremap_pmem + default_memcpy_to_pmem is sufficient for
+ * ARCH_MEMREMAP_PMEM + default_memcpy_to_pmem is sufficient for
  * making data durable relative to i/o completion.
  */
 static inline void default_memcpy_to_pmem(void __pmem *dst, const void *src,
@@ -116,25 +111,6 @@ static inline void default_clear_pmem(void __pmem *addr, size_t size)
                memset((void __force *)addr, 0, size);
 }
 
-/**
- * memremap_pmem - map physical persistent memory for pmem api
- * @offset: physical address of persistent memory
- * @size: size of the mapping
- *
- * Establish a mapping of the architecture specific memory type expected
- * by memcpy_to_pmem() and wmb_pmem().  For example, it may be
- * the case that an uncacheable or writethrough mapping is sufficient,
- * or a writeback mapping provided memcpy_to_pmem() and
- * wmb_pmem() arrange for the data to be written through the
- * cache to persistent media.
- */
-static inline void __pmem *memremap_pmem(struct device *dev,
-               resource_size_t offset, unsigned long size)
-{
-       return (void __pmem *) devm_memremap(dev, offset, size,
-                       ARCH_MEMREMAP_PMEM);
-}
-
 /**
  * memcpy_to_pmem - copy data to persistent memory
  * @dst: destination buffer for the copy
index a682fcc91c3321b386a13313dd9135b590117ee4..12c4865457adc3d0412c573b710feec7d3d6fd81 100644 (file)
@@ -21,6 +21,8 @@
 #define PSCI_POWER_STATE_TYPE_POWER_DOWN       1
 
 bool psci_tos_resident_on(int cpu);
+bool psci_power_state_loses_context(u32 state);
+bool psci_power_state_is_valid(u32 state);
 
 struct psci_operations {
        int (*cpu_suspend)(u32 state, unsigned long entry_point);
index 6e7d5ec65838249cb8e5117eaa410c4d35adde5c..9e12000914b3451107abdde161e1ea64b7cfeb5e 100644 (file)
@@ -23,6 +23,8 @@ struct qcom_scm_hdcp_req {
        u32 val;
 };
 
+extern bool qcom_scm_is_available(void);
+
 extern bool qcom_scm_hdcp_available(void);
 extern int qcom_scm_hdcp_req(struct qcom_scm_hdcp_req *req, u32 req_cnt,
                u32 *resp);
index 4069febaa34af9e93be8bb98e807db04a67c4380..edad7a43edea141b3ada89f7f12edac2add7b68e 100644 (file)
@@ -484,9 +484,11 @@ static inline int get_dumpable(struct mm_struct *mm)
 #define MMF_DUMP_ELF_HEADERS   6
 #define MMF_DUMP_HUGETLB_PRIVATE 7
 #define MMF_DUMP_HUGETLB_SHARED  8
+#define MMF_DUMP_DAX_PRIVATE   9
+#define MMF_DUMP_DAX_SHARED    10
 
 #define MMF_DUMP_FILTER_SHIFT  MMF_DUMPABLE_BITS
-#define MMF_DUMP_FILTER_BITS   7
+#define MMF_DUMP_FILTER_BITS   9
 #define MMF_DUMP_FILTER_MASK \
        (((1 << MMF_DUMP_FILTER_BITS) - 1) << MMF_DUMP_FILTER_SHIFT)
 #define MMF_DUMP_FILTER_DEFAULT \
diff --git a/include/linux/scpi_protocol.h b/include/linux/scpi_protocol.h
new file mode 100644 (file)
index 0000000..80af3cd
--- /dev/null
@@ -0,0 +1,78 @@
+/*
+ * SCPI Message Protocol driver header
+ *
+ * Copyright (C) 2014 ARM Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+#include <linux/types.h>
+
+struct scpi_opp {
+       u32 freq;
+       u32 m_volt;
+} __packed;
+
+struct scpi_dvfs_info {
+       unsigned int count;
+       unsigned int latency; /* in nanoseconds */
+       struct scpi_opp *opps;
+};
+
+enum scpi_sensor_class {
+       TEMPERATURE,
+       VOLTAGE,
+       CURRENT,
+       POWER,
+};
+
+struct scpi_sensor_info {
+       u16 sensor_id;
+       u8 class;
+       u8 trigger_type;
+       char name[20];
+} __packed;
+
+/**
+ * struct scpi_ops - represents the various operations provided
+ *     by SCP through SCPI message protocol
+ * @get_version: returns the major and minor revision on the SCPI
+ *     message protocol
+ * @clk_get_range: gets clock range limit(min - max in Hz)
+ * @clk_get_val: gets clock value(in Hz)
+ * @clk_set_val: sets the clock value, setting to 0 will disable the
+ *     clock (if supported)
+ * @dvfs_get_idx: gets the Operating Point of the given power domain.
+ *     OPP is an index to the list return by @dvfs_get_info
+ * @dvfs_set_idx: sets the Operating Point of the given power domain.
+ *     OPP is an index to the list return by @dvfs_get_info
+ * @dvfs_get_info: returns the DVFS capabilities of the given power
+ *     domain. It includes the OPP list and the latency information
+ */
+struct scpi_ops {
+       u32 (*get_version)(void);
+       int (*clk_get_range)(u16, unsigned long *, unsigned long *);
+       unsigned long (*clk_get_val)(u16);
+       int (*clk_set_val)(u16, unsigned long);
+       int (*dvfs_get_idx)(u8);
+       int (*dvfs_set_idx)(u8, u8);
+       struct scpi_dvfs_info *(*dvfs_get_info)(u8);
+       int (*sensor_get_capability)(u16 *sensors);
+       int (*sensor_get_info)(u16 sensor_id, struct scpi_sensor_info *);
+       int (*sensor_get_value)(u16, u32 *);
+};
+
+#if IS_ENABLED(CONFIG_ARM_SCPI_PROTOCOL)
+struct scpi_ops *get_scpi_ops(void);
+#else
+static inline struct scpi_ops *get_scpi_ops(void) { return NULL; }
+#endif
diff --git a/include/linux/soc/brcmstb/brcmstb.h b/include/linux/soc/brcmstb/brcmstb.h
new file mode 100644 (file)
index 0000000..337ce41
--- /dev/null
@@ -0,0 +1,10 @@
+#ifndef __BRCMSTB_SOC_H
+#define __BRCMSTB_SOC_H
+
+/*
+ * Bus Interface Unit control register setup, must happen early during boot,
+ * before SMP is brought up, called by machine entry point.
+ */
+void brcmstb_biuctrl_init(void);
+
+#endif /* __BRCMSTB_SOC_H */
index d7e50aa6a4ac09884008377f7db668c5bac555bf..d0cb6d189a0a02bd28459c7b143229563f23c4e4 100644 (file)
@@ -8,6 +8,14 @@ struct qcom_smd;
 struct qcom_smd_channel;
 struct qcom_smd_lookup;
 
+/**
+ * struct qcom_smd_id - struct used for matching a smd device
+ * @name:      name of the channel
+ */
+struct qcom_smd_id {
+       char name[20];
+};
+
 /**
  * struct qcom_smd_device - smd device struct
  * @dev:       the device struct
@@ -21,6 +29,7 @@ struct qcom_smd_device {
 /**
  * struct qcom_smd_driver - smd driver struct
  * @driver:    underlying device driver
+ * @smd_match_table: static channel match table
  * @probe:     invoked when the smd channel is found
  * @remove:    invoked when the smd channel is closed
  * @callback:  invoked when an inbound message is received on the channel,
@@ -29,6 +38,8 @@ struct qcom_smd_device {
  */
 struct qcom_smd_driver {
        struct device_driver driver;
+       const struct qcom_smd_id *smd_match_table;
+
        int (*probe)(struct qcom_smd_device *dev);
        void (*remove)(struct qcom_smd_device *dev);
        int (*callback)(struct qcom_smd_device *, const void *, size_t);
index bc9630d3acede09a43b7be1bd03f37ac76266a46..785e196ee2cae6f1b0ec48fad8816db3839aa943 100644 (file)
@@ -4,7 +4,7 @@
 #define QCOM_SMEM_HOST_ANY -1
 
 int qcom_smem_alloc(unsigned host, unsigned item, size_t size);
-int qcom_smem_get(unsigned host, unsigned item, void **ptr, size_t *size);
+void *qcom_smem_get(unsigned host, unsigned item, size_t *size);
 
 int qcom_smem_get_free_space(unsigned host);
 
index 6d36dacec4baa1cd88a6bfebd259c4b685a34876..9ec4c147abbc7750710da12924c96a7343127364 100644 (file)
@@ -23,7 +23,6 @@ struct dma_chan;
 
 /* device.platform_data for SSP controller devices */
 struct pxa2xx_spi_master {
-       u32 clock_enable;
        u16 num_chipselect;
        u8 enable_dma;
 
diff --git a/include/linux/sunxi-rsb.h b/include/linux/sunxi-rsb.h
new file mode 100644 (file)
index 0000000..7e75bb0
--- /dev/null
@@ -0,0 +1,105 @@
+/*
+ * Allwinner Reduced Serial Bus Driver
+ *
+ * Copyright (c) 2015 Chen-Yu Tsai
+ *
+ * Author: Chen-Yu Tsai <wens@csie.org>
+ *
+ * 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.
+ */
+#ifndef _SUNXI_RSB_H
+#define _SUNXI_RSB_H
+
+#include <linux/device.h>
+#include <linux/regmap.h>
+#include <linux/types.h>
+
+struct sunxi_rsb;
+
+/**
+ * struct sunxi_rsb_device - Basic representation of an RSB device
+ * @dev:       Driver model representation of the device.
+ * @ctrl:      RSB controller managing the bus hosting this device.
+ * @rtaddr:    This device's runtime address
+ * @hwaddr:    This device's hardware address
+ */
+struct sunxi_rsb_device {
+       struct device           dev;
+       struct sunxi_rsb        *rsb;
+       int                     irq;
+       u8                      rtaddr;
+       u16                     hwaddr;
+};
+
+static inline struct sunxi_rsb_device *to_sunxi_rsb_device(struct device *d)
+{
+       return container_of(d, struct sunxi_rsb_device, dev);
+}
+
+static inline void *sunxi_rsb_device_get_drvdata(const struct sunxi_rsb_device *rdev)
+{
+       return dev_get_drvdata(&rdev->dev);
+}
+
+static inline void sunxi_rsb_device_set_drvdata(struct sunxi_rsb_device *rdev,
+                                               void *data)
+{
+       dev_set_drvdata(&rdev->dev, data);
+}
+
+/**
+ * struct sunxi_rsb_driver - RSB slave device driver
+ * @driver:    RSB device drivers should initialize name and owner field of
+ *             this structure.
+ * @probe:     binds this driver to a RSB device.
+ * @remove:    unbinds this driver from the RSB device.
+ */
+struct sunxi_rsb_driver {
+       struct device_driver driver;
+       int (*probe)(struct sunxi_rsb_device *rdev);
+       int (*remove)(struct sunxi_rsb_device *rdev);
+};
+
+static inline struct sunxi_rsb_driver *to_sunxi_rsb_driver(struct device_driver *d)
+{
+       return container_of(d, struct sunxi_rsb_driver, driver);
+}
+
+int sunxi_rsb_driver_register(struct sunxi_rsb_driver *rdrv);
+
+/**
+ * sunxi_rsb_driver_unregister() - unregister an RSB client driver
+ * @rdrv:      the driver to unregister
+ */
+static inline void sunxi_rsb_driver_unregister(struct sunxi_rsb_driver *rdrv)
+{
+       if (rdrv)
+               driver_unregister(&rdrv->driver);
+}
+
+#define module_sunxi_rsb_driver(__sunxi_rsb_driver) \
+       module_driver(__sunxi_rsb_driver, sunxi_rsb_driver_register, \
+                       sunxi_rsb_driver_unregister)
+
+struct regmap *__devm_regmap_init_sunxi_rsb(struct sunxi_rsb_device *rdev,
+                                           const struct regmap_config *config,
+                                           struct lock_class_key *lock_key,
+                                           const char *lock_name);
+
+/**
+ * devm_regmap_init_sunxi_rsb(): Initialise managed register map
+ *
+ * @rdev: Device that will be interacted with
+ * @config: Configuration for register map
+ *
+ * The return value will be an ERR_PTR() on error or a valid pointer
+ * to a struct regmap.  The regmap will be automatically freed by the
+ * device management code.
+ */
+#define devm_regmap_init_sunxi_rsb(rdev, config)                       \
+       __regmap_lockdep_wrapper(__devm_regmap_init_sunxi_rsb, #config, \
+                                rdev, config)
+
+#endif /* _SUNXI_RSB_H */
index c906f453458119324414f984ee60056194093988..b386361ba3e87226c329924bc1992252fcf0b9d6 100644 (file)
@@ -397,6 +397,13 @@ static inline void fastopen_queue_tune(struct sock *sk, int backlog)
        queue->fastopenq.max_qlen = min_t(unsigned int, backlog, somaxconn);
 }
 
+static inline void tcp_move_syn(struct tcp_sock *tp,
+                               struct request_sock *req)
+{
+       tp->saved_syn = req->saved_syn;
+       req->saved_syn = NULL;
+}
+
 static inline void tcp_saved_syn_free(struct tcp_sock *tp)
 {
        kfree(tp->saved_syn);
index c98afc08cc2612e046cd070b22d25aa18a88c457..52899291f40144c0dab97e135b0c9762ade5c8d1 100644 (file)
@@ -275,6 +275,8 @@ struct l2cap_conn_rsp {
 #define L2CAP_CR_AUTHORIZATION 0x0006
 #define L2CAP_CR_BAD_KEY_SIZE  0x0007
 #define L2CAP_CR_ENCRYPTION    0x0008
+#define L2CAP_CR_INVALID_SCID  0x0009
+#define L2CAP_CR_SCID_IN_USE   0x0010
 
 /* connect/create channel status */
 #define L2CAP_CS_NO_INFO       0x0000
index ce009710120ca8b541615b237a329ee089ec357b..6816f0fa5693dc275e1e4997375f29b5d99f7b64 100644 (file)
@@ -63,12 +63,13 @@ static inline struct metadata_dst *tun_rx_dst(int md_size)
 static inline struct metadata_dst *tun_dst_unclone(struct sk_buff *skb)
 {
        struct metadata_dst *md_dst = skb_metadata_dst(skb);
-       int md_size = md_dst->u.tun_info.options_len;
+       int md_size;
        struct metadata_dst *new_md;
 
        if (!md_dst)
                return ERR_PTR(-EINVAL);
 
+       md_size = md_dst->u.tun_info.options_len;
        new_md = metadata_dst_alloc(md_size, GFP_ATOMIC);
        if (!new_md)
                return ERR_PTR(-ENOMEM);
index f5bf7310e3343468bddf7e51940a77ed497ad7f1..2134e6d815bcb0611a2f65cd7b4da44cb7762b8c 100644 (file)
@@ -210,6 +210,18 @@ struct inet_sock {
 #define IP_CMSG_ORIGDSTADDR    BIT(6)
 #define IP_CMSG_CHECKSUM       BIT(7)
 
+/* SYNACK messages might be attached to request sockets.
+ * Some places want to reach the listener in this case.
+ */
+static inline struct sock *skb_to_full_sk(const struct sk_buff *skb)
+{
+       struct sock *sk = skb->sk;
+
+       if (sk && sk->sk_state == TCP_NEW_SYN_RECV)
+               sk = inet_reqsk(sk)->rsk_listener;
+       return sk;
+}
+
 static inline struct inet_sock *inet_sk(const struct sock *sk)
 {
        return (struct inet_sock *)sk;
diff --git a/include/soc/bcm2835/raspberrypi-firmware.h b/include/soc/bcm2835/raspberrypi-firmware.h
new file mode 100644 (file)
index 0000000..c07d74a
--- /dev/null
@@ -0,0 +1,120 @@
+/*
+ *  Copyright Â© 2015 Broadcom
+ *
+ * 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.
+ */
+
+#ifndef __SOC_RASPBERRY_FIRMWARE_H__
+#define __SOC_RASPBERRY_FIRMWARE_H__
+
+#include <linux/types.h>
+#include <linux/of_device.h>
+
+struct rpi_firmware;
+
+enum rpi_firmware_property_status {
+       RPI_FIRMWARE_STATUS_REQUEST = 0,
+       RPI_FIRMWARE_STATUS_SUCCESS = 0x80000000,
+       RPI_FIRMWARE_STATUS_ERROR =   0x80000001,
+};
+
+/**
+ * struct rpi_firmware_property_tag_header - Firmware property tag header
+ * @tag:               One of enum_mbox_property_tag.
+ * @buf_size:          The number of bytes in the value buffer following this
+ *                     struct.
+ * @req_resp_size:     On submit, the length of the request (though it doesn't
+ *                     appear to be currently used by the firmware).  On return,
+ *                     the length of the response (always 4 byte aligned), with
+ *                     the low bit set.
+ */
+struct rpi_firmware_property_tag_header {
+       u32 tag;
+       u32 buf_size;
+       u32 req_resp_size;
+};
+
+enum rpi_firmware_property_tag {
+       RPI_FIRMWARE_PROPERTY_END =                           0,
+       RPI_FIRMWARE_GET_FIRMWARE_REVISION =                  0x00000001,
+
+       RPI_FIRMWARE_SET_CURSOR_INFO =                        0x00008010,
+       RPI_FIRMWARE_SET_CURSOR_STATE =                       0x00008011,
+
+       RPI_FIRMWARE_GET_BOARD_MODEL =                        0x00010001,
+       RPI_FIRMWARE_GET_BOARD_REVISION =                     0x00010002,
+       RPI_FIRMWARE_GET_BOARD_MAC_ADDRESS =                  0x00010003,
+       RPI_FIRMWARE_GET_BOARD_SERIAL =                       0x00010004,
+       RPI_FIRMWARE_GET_ARM_MEMORY =                         0x00010005,
+       RPI_FIRMWARE_GET_VC_MEMORY =                          0x00010006,
+       RPI_FIRMWARE_GET_CLOCKS =                             0x00010007,
+       RPI_FIRMWARE_GET_POWER_STATE =                        0x00020001,
+       RPI_FIRMWARE_GET_TIMING =                             0x00020002,
+       RPI_FIRMWARE_SET_POWER_STATE =                        0x00028001,
+       RPI_FIRMWARE_GET_CLOCK_STATE =                        0x00030001,
+       RPI_FIRMWARE_GET_CLOCK_RATE =                         0x00030002,
+       RPI_FIRMWARE_GET_VOLTAGE =                            0x00030003,
+       RPI_FIRMWARE_GET_MAX_CLOCK_RATE =                     0x00030004,
+       RPI_FIRMWARE_GET_MAX_VOLTAGE =                        0x00030005,
+       RPI_FIRMWARE_GET_TEMPERATURE =                        0x00030006,
+       RPI_FIRMWARE_GET_MIN_CLOCK_RATE =                     0x00030007,
+       RPI_FIRMWARE_GET_MIN_VOLTAGE =                        0x00030008,
+       RPI_FIRMWARE_GET_TURBO =                              0x00030009,
+       RPI_FIRMWARE_GET_MAX_TEMPERATURE =                    0x0003000a,
+       RPI_FIRMWARE_ALLOCATE_MEMORY =                        0x0003000c,
+       RPI_FIRMWARE_LOCK_MEMORY =                            0x0003000d,
+       RPI_FIRMWARE_UNLOCK_MEMORY =                          0x0003000e,
+       RPI_FIRMWARE_RELEASE_MEMORY =                         0x0003000f,
+       RPI_FIRMWARE_EXECUTE_CODE =                           0x00030010,
+       RPI_FIRMWARE_EXECUTE_QPU =                            0x00030011,
+       RPI_FIRMWARE_SET_ENABLE_QPU =                         0x00030012,
+       RPI_FIRMWARE_GET_DISPMANX_RESOURCE_MEM_HANDLE =       0x00030014,
+       RPI_FIRMWARE_GET_EDID_BLOCK =                         0x00030020,
+       RPI_FIRMWARE_SET_CLOCK_STATE =                        0x00038001,
+       RPI_FIRMWARE_SET_CLOCK_RATE =                         0x00038002,
+       RPI_FIRMWARE_SET_VOLTAGE =                            0x00038003,
+       RPI_FIRMWARE_SET_TURBO =                              0x00038009,
+
+       /* Dispmanx TAGS */
+       RPI_FIRMWARE_FRAMEBUFFER_ALLOCATE =                   0x00040001,
+       RPI_FIRMWARE_FRAMEBUFFER_BLANK =                      0x00040002,
+       RPI_FIRMWARE_FRAMEBUFFER_GET_PHYSICAL_WIDTH_HEIGHT =  0x00040003,
+       RPI_FIRMWARE_FRAMEBUFFER_GET_VIRTUAL_WIDTH_HEIGHT =   0x00040004,
+       RPI_FIRMWARE_FRAMEBUFFER_GET_DEPTH =                  0x00040005,
+       RPI_FIRMWARE_FRAMEBUFFER_GET_PIXEL_ORDER =            0x00040006,
+       RPI_FIRMWARE_FRAMEBUFFER_GET_ALPHA_MODE =             0x00040007,
+       RPI_FIRMWARE_FRAMEBUFFER_GET_PITCH =                  0x00040008,
+       RPI_FIRMWARE_FRAMEBUFFER_GET_VIRTUAL_OFFSET =         0x00040009,
+       RPI_FIRMWARE_FRAMEBUFFER_GET_OVERSCAN =               0x0004000a,
+       RPI_FIRMWARE_FRAMEBUFFER_GET_PALETTE =                0x0004000b,
+       RPI_FIRMWARE_FRAMEBUFFER_RELEASE =                    0x00048001,
+       RPI_FIRMWARE_FRAMEBUFFER_TEST_PHYSICAL_WIDTH_HEIGHT = 0x00044003,
+       RPI_FIRMWARE_FRAMEBUFFER_TEST_VIRTUAL_WIDTH_HEIGHT =  0x00044004,
+       RPI_FIRMWARE_FRAMEBUFFER_TEST_DEPTH =                 0x00044005,
+       RPI_FIRMWARE_FRAMEBUFFER_TEST_PIXEL_ORDER =           0x00044006,
+       RPI_FIRMWARE_FRAMEBUFFER_TEST_ALPHA_MODE =            0x00044007,
+       RPI_FIRMWARE_FRAMEBUFFER_TEST_VIRTUAL_OFFSET =        0x00044009,
+       RPI_FIRMWARE_FRAMEBUFFER_TEST_OVERSCAN =              0x0004400a,
+       RPI_FIRMWARE_FRAMEBUFFER_TEST_PALETTE =               0x0004400b,
+       RPI_FIRMWARE_FRAMEBUFFER_SET_PHYSICAL_WIDTH_HEIGHT =  0x00048003,
+       RPI_FIRMWARE_FRAMEBUFFER_SET_VIRTUAL_WIDTH_HEIGHT =   0x00048004,
+       RPI_FIRMWARE_FRAMEBUFFER_SET_DEPTH =                  0x00048005,
+       RPI_FIRMWARE_FRAMEBUFFER_SET_PIXEL_ORDER =            0x00048006,
+       RPI_FIRMWARE_FRAMEBUFFER_SET_ALPHA_MODE =             0x00048007,
+       RPI_FIRMWARE_FRAMEBUFFER_SET_VIRTUAL_OFFSET =         0x00048009,
+       RPI_FIRMWARE_FRAMEBUFFER_SET_OVERSCAN =               0x0004800a,
+       RPI_FIRMWARE_FRAMEBUFFER_SET_PALETTE =                0x0004800b,
+
+       RPI_FIRMWARE_GET_COMMAND_LINE =                       0x00050001,
+       RPI_FIRMWARE_GET_DMA_CHANNELS =                       0x00060001,
+};
+
+int rpi_firmware_property(struct rpi_firmware *fw,
+                         u32 tag, void *data, size_t len);
+int rpi_firmware_property_list(struct rpi_firmware *fw,
+                              void *data, size_t tag_size);
+struct rpi_firmware *rpi_firmware_get(struct device_node *firmware_node);
+
+#endif /* __SOC_RASPBERRY_FIRMWARE_H__ */
diff --git a/include/soc/brcmstb/common.h b/include/soc/brcmstb/common.h
new file mode 100644 (file)
index 0000000..cfb5335
--- /dev/null
@@ -0,0 +1,15 @@
+/*
+ * Copyright Â© 2014 NVIDIA Corporation
+ * Copyright Â© 2015 Broadcom Corporation
+ *
+ * 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.
+ */
+
+#ifndef __SOC_BRCMSTB_COMMON_H__
+#define __SOC_BRCMSTB_COMMON_H__
+
+bool soc_is_brcmstb(void);
+
+#endif /* __SOC_BRCMSTB_COMMON_H__ */
index 3f311551795dad6a1b397bc8a858fb31613eac4d..2f05e66de01ed8817be123ef3b13e982c04c5da0 100644 (file)
@@ -66,7 +66,9 @@ struct i2c_rdwr_ioctl_data {
        __u32 nmsgs;                    /* number of i2c_msgs */
 };
 
-#define  I2C_RDRW_IOCTL_MAX_MSGS       42
+#define  I2C_RDWR_IOCTL_MAX_MSGS       42
+/* Originally defined with a typo, keep it for compatibility */
+#define  I2C_RDRW_IOCTL_MAX_MSGS       I2C_RDWR_IOCTL_MAX_MSGS
 
 
 #endif /* _UAPI_LINUX_I2C_DEV_H */
index 310d83e0a91b6bb000b462cdd130c2445b945268..3d7a0fc021a75a7b52c725c151dee15eb9fc5830 100644 (file)
 #define PSCI_0_2_FN64_MIGRATE                  PSCI_0_2_FN64(5)
 #define PSCI_0_2_FN64_MIGRATE_INFO_UP_CPU      PSCI_0_2_FN64(7)
 
+#define PSCI_1_0_FN_PSCI_FEATURES              PSCI_0_2_FN(10)
+#define PSCI_1_0_FN_SYSTEM_SUSPEND             PSCI_0_2_FN(14)
+
+#define PSCI_1_0_FN64_SYSTEM_SUSPEND           PSCI_0_2_FN64(14)
+
 /* PSCI v0.2 power state encoding for CPU_SUSPEND function */
 #define PSCI_0_2_POWER_STATE_ID_MASK           0xffff
 #define PSCI_0_2_POWER_STATE_ID_SHIFT          0
 #define PSCI_0_2_POWER_STATE_AFFL_MASK         \
                                (0x3 << PSCI_0_2_POWER_STATE_AFFL_SHIFT)
 
+/* PSCI extended power state encoding for CPU_SUSPEND function */
+#define PSCI_1_0_EXT_POWER_STATE_ID_MASK       0xfffffff
+#define PSCI_1_0_EXT_POWER_STATE_ID_SHIFT      0
+#define PSCI_1_0_EXT_POWER_STATE_TYPE_SHIFT    30
+#define PSCI_1_0_EXT_POWER_STATE_TYPE_MASK     \
+                               (0x1 << PSCI_1_0_EXT_POWER_STATE_TYPE_SHIFT)
+
 /* PSCI v0.2 affinity level state returned by AFFINITY_INFO */
 #define PSCI_0_2_AFFINITY_LEVEL_ON             0
 #define PSCI_0_2_AFFINITY_LEVEL_OFF            1
 #define PSCI_VERSION_MINOR(ver)                        \
                ((ver) & PSCI_VERSION_MINOR_MASK)
 
+/* PSCI features decoding (>=1.0) */
+#define PSCI_1_0_FEATURES_CPU_SUSPEND_PF_SHIFT 1
+#define PSCI_1_0_FEATURES_CPU_SUSPEND_PF_MASK  \
+                       (0x1 << PSCI_1_0_FEATURES_CPU_SUSPEND_PF_SHIFT)
+
 /* PSCI return values (inclusive of all PSCI versions) */
 #define PSCI_RET_SUCCESS                       0
 #define PSCI_RET_NOT_SUPPORTED                 -1
 #define PSCI_RET_INTERNAL_FAILURE              -6
 #define PSCI_RET_NOT_PRESENT                   -7
 #define PSCI_RET_DISABLED                      -8
+#define PSCI_RET_INVALID_ADDRESS               -9
 
 #endif /* _UAPI_LINUX_PSCI_H */
index 9d6b55587eaa59a25c38776e43aeff51ba682c40..7658d32c5c78aa6343ac8cd669070084d1cd3805 100644 (file)
@@ -124,9 +124,10 @@ void *devm_memremap(struct device *dev, resource_size_t offset,
 {
        void **ptr, *addr;
 
-       ptr = devres_alloc(devm_memremap_release, sizeof(*ptr), GFP_KERNEL);
+       ptr = devres_alloc_node(devm_memremap_release, sizeof(*ptr), GFP_KERNEL,
+                       dev_to_node(dev));
        if (!ptr)
-               return NULL;
+               return ERR_PTR(-ENOMEM);
 
        addr = memremap(offset, size, flags);
        if (addr) {
@@ -141,9 +142,8 @@ EXPORT_SYMBOL(devm_memremap);
 
 void devm_memunmap(struct device *dev, void *addr)
 {
-       WARN_ON(devres_destroy(dev, devm_memremap_release, devm_memremap_match,
-                              addr));
-       memunmap(addr);
+       WARN_ON(devres_release(dev, devm_memremap_release,
+                               devm_memremap_match, addr));
 }
 EXPORT_SYMBOL(devm_memunmap);
 
@@ -176,8 +176,8 @@ void *devm_memremap_pages(struct device *dev, struct resource *res)
        if (is_ram == REGION_INTERSECTS)
                return __va(res->start);
 
-       page_map = devres_alloc(devm_memremap_pages_release,
-                       sizeof(*page_map), GFP_KERNEL);
+       page_map = devres_alloc_node(devm_memremap_pages_release,
+                       sizeof(*page_map), GFP_KERNEL, dev_to_node(dev));
        if (!page_map)
                return ERR_PTR(-ENOMEM);
 
@@ -185,7 +185,7 @@ void *devm_memremap_pages(struct device *dev, struct resource *res)
 
        nid = dev_to_node(dev);
        if (nid < 0)
-               nid = 0;
+               nid = numa_mem_id();
 
        error = arch_add_memory(nid, res->start, resource_size(res), true);
        if (error) {
index 8d6363f42169c62c61e9a035d615a89966135b0f..e45db6b0d8784a762fb5d088fea8b731135c05ae 100644 (file)
@@ -434,7 +434,7 @@ config UPROBE_EVENT
 
 config BPF_EVENTS
        depends on BPF_SYSCALL
-       depends on KPROBE_EVENT || UPROBE_EVENT
+       depends on (KPROBE_EVENT || UPROBE_EVENT) && PERF_EVENTS
        bool
        default y
        help
index d1377390b3adda70bafe7464186e034d1fd7bd01..10cd1860e5b04aa339853ff893855941aba41600 100644 (file)
@@ -5055,6 +5055,36 @@ static struct bpf_test tests[] = {
                {},
                { {0x1, 0x0 } },
        },
+       {
+               "MOD default X",
+               .u.insns = {
+                       /*
+                        * A = 0x42
+                        * A = A mod X ; this halt the filter execution if X is 0
+                        * ret 0x42
+                        */
+                       BPF_STMT(BPF_LD | BPF_IMM, 0x42),
+                       BPF_STMT(BPF_ALU | BPF_MOD | BPF_X, 0),
+                       BPF_STMT(BPF_RET | BPF_K, 0x42),
+               },
+               CLASSIC | FLAG_NO_DATA,
+               {},
+               { {0x1, 0x0 } },
+       },
+       {
+               "MOD default A",
+               .u.insns = {
+                       /*
+                        * A = A mod 1
+                        * ret A
+                        */
+                       BPF_STMT(BPF_ALU | BPF_MOD | BPF_K, 0x1),
+                       BPF_STMT(BPF_RET | BPF_A, 0x0),
+               },
+               CLASSIC | FLAG_NO_DATA,
+               {},
+               { {0x1, 0x0 } },
+       },
        {
                "JMP EQ default A",
                .u.insns = {
index 208e4c7e771b33a1e1d3707be121e878535db209..17a3c66639a9cd6625f333b4f64ab012e2cb56c4 100644 (file)
@@ -5266,6 +5266,7 @@ static void __paginginit free_area_init_core(struct pglist_data *pgdat)
 
 static void __init_refok alloc_node_mem_map(struct pglist_data *pgdat)
 {
+       unsigned long __maybe_unused start = 0;
        unsigned long __maybe_unused offset = 0;
 
        /* Skip empty nodes */
@@ -5273,9 +5274,11 @@ static void __init_refok alloc_node_mem_map(struct pglist_data *pgdat)
                return;
 
 #ifdef CONFIG_FLAT_NODE_MEM_MAP
+       start = pgdat->node_start_pfn & ~(MAX_ORDER_NR_PAGES - 1);
+       offset = pgdat->node_start_pfn - start;
        /* ia64 gets its own node_mem_map, before this, without bootmem */
        if (!pgdat->node_mem_map) {
-               unsigned long size, start, end;
+               unsigned long size, end;
                struct page *map;
 
                /*
@@ -5283,8 +5286,6 @@ static void __init_refok alloc_node_mem_map(struct pglist_data *pgdat)
                 * aligned but the node_mem_map endpoints must be in order
                 * for the buddy allocator to function correctly.
                 */
-               start = pgdat->node_start_pfn & ~(MAX_ORDER_NR_PAGES - 1);
-               offset = pgdat->node_start_pfn - start;
                end = pgdat_end_pfn(pgdat);
                end = ALIGN(end, MAX_ORDER_NR_PAGES);
                size =  (end - start) * sizeof(struct page);
index 83a6aacfab31cb136745001a03fcb6368d7b259f..62edbf1b114e8371fe7167eb81d75c59ebe47908 100644 (file)
@@ -508,12 +508,6 @@ static void le_setup(struct hci_request *req)
        /* Read LE Supported States */
        hci_req_add(req, HCI_OP_LE_READ_SUPPORTED_STATES, 0, NULL);
 
-       /* Read LE White List Size */
-       hci_req_add(req, HCI_OP_LE_READ_WHITE_LIST_SIZE, 0, NULL);
-
-       /* Clear LE White List */
-       hci_req_add(req, HCI_OP_LE_CLEAR_WHITE_LIST, 0, NULL);
-
        /* LE-only controllers have LE implicitly enabled */
        if (!lmp_bredr_capable(hdev))
                hci_dev_set_flag(hdev, HCI_LE_ENABLED);
@@ -832,6 +826,17 @@ static void hci_init3_req(struct hci_request *req, unsigned long opt)
                        hci_req_add(req, HCI_OP_LE_READ_ADV_TX_POWER, 0, NULL);
                }
 
+               if (hdev->commands[26] & 0x40) {
+                       /* Read LE White List Size */
+                       hci_req_add(req, HCI_OP_LE_READ_WHITE_LIST_SIZE,
+                                   0, NULL);
+               }
+
+               if (hdev->commands[26] & 0x80) {
+                       /* Clear LE White List */
+                       hci_req_add(req, HCI_OP_LE_CLEAR_WHITE_LIST, 0, NULL);
+               }
+
                if (hdev->le_features[0] & HCI_LE_DATA_LEN_EXT) {
                        /* Read LE Maximum Data Length */
                        hci_req_add(req, HCI_OP_LE_READ_MAX_DATA_LEN, 0, NULL);
index 7c65ee200c29215c6b3f050cfbb881873be4946a..66e8b6ee19a525d8cc54032843934b0fedb11dc7 100644 (file)
@@ -239,7 +239,7 @@ static u16 l2cap_alloc_cid(struct l2cap_conn *conn)
        else
                dyn_end = L2CAP_CID_DYN_END;
 
-       for (cid = L2CAP_CID_DYN_START; cid < dyn_end; cid++) {
+       for (cid = L2CAP_CID_DYN_START; cid <= dyn_end; cid++) {
                if (!__l2cap_get_chan_by_scid(conn, cid))
                        return cid;
        }
@@ -5250,7 +5250,9 @@ static int l2cap_le_connect_rsp(struct l2cap_conn *conn,
        credits = __le16_to_cpu(rsp->credits);
        result  = __le16_to_cpu(rsp->result);
 
-       if (result == L2CAP_CR_SUCCESS && (mtu < 23 || mps < 23))
+       if (result == L2CAP_CR_SUCCESS && (mtu < 23 || mps < 23 ||
+                                          dcid < L2CAP_CID_DYN_START ||
+                                          dcid > L2CAP_CID_LE_DYN_END))
                return -EPROTO;
 
        BT_DBG("dcid 0x%4.4x mtu %u mps %u credits %u result 0x%2.2x",
@@ -5270,6 +5272,11 @@ static int l2cap_le_connect_rsp(struct l2cap_conn *conn,
 
        switch (result) {
        case L2CAP_CR_SUCCESS:
+               if (__l2cap_get_chan_by_dcid(conn, dcid)) {
+                       err = -EBADSLT;
+                       break;
+               }
+
                chan->ident = 0;
                chan->dcid = dcid;
                chan->omtu = mtu;
@@ -5437,9 +5444,16 @@ static int l2cap_le_connect_req(struct l2cap_conn *conn,
                goto response_unlock;
        }
 
+       /* Check for valid dynamic CID range */
+       if (scid < L2CAP_CID_DYN_START || scid > L2CAP_CID_LE_DYN_END) {
+               result = L2CAP_CR_INVALID_SCID;
+               chan = NULL;
+               goto response_unlock;
+       }
+
        /* Check if we already have channel with that dcid */
        if (__l2cap_get_chan_by_dcid(conn, scid)) {
-               result = L2CAP_CR_NO_MEM;
+               result = L2CAP_CR_SCID_IN_USE;
                chan = NULL;
                goto response_unlock;
        }
index 80c34d70218c0f9d2066016e3f5ba5fc56656490..f7e8dee64fc80ec04152788c945dea1b346b3dcd 100644 (file)
@@ -600,12 +600,17 @@ void __br_set_forward_delay(struct net_bridge *br, unsigned long t)
 int br_set_forward_delay(struct net_bridge *br, unsigned long val)
 {
        unsigned long t = clock_t_to_jiffies(val);
-
-       if (t < BR_MIN_FORWARD_DELAY || t > BR_MAX_FORWARD_DELAY)
-               return -ERANGE;
+       int err = -ERANGE;
 
        spin_lock_bh(&br->lock);
+       if (br->stp_enabled != BR_NO_STP &&
+           (t < BR_MIN_FORWARD_DELAY || t > BR_MAX_FORWARD_DELAY))
+               goto unlock;
+
        __br_set_forward_delay(br, t);
+       err = 0;
+
+unlock:
        spin_unlock_bh(&br->lock);
-       return 0;
+       return err;
 }
index 8ce3f74cd6b99d68445065a96772a388c927fb7d..ab9b8d0d115e4ce479fed2aa8304947be09f1f32 100644 (file)
@@ -6402,7 +6402,7 @@ int __netdev_update_features(struct net_device *dev)
        struct net_device *upper, *lower;
        netdev_features_t features;
        struct list_head *iter;
-       int err = 0;
+       int err = -1;
 
        ASSERT_RTNL();
 
@@ -6419,7 +6419,7 @@ int __netdev_update_features(struct net_device *dev)
                features = netdev_sync_upper_features(dev, upper, features);
 
        if (dev->features == features)
-               return 0;
+               goto sync_lower;
 
        netdev_dbg(dev, "Features changed: %pNF -> %pNF\n",
                &dev->features, &features);
@@ -6434,6 +6434,7 @@ int __netdev_update_features(struct net_device *dev)
                return -1;
        }
 
+sync_lower:
        /* some features must be disabled on lower devices when disabled
         * on an upper device (think: bonding master or bridge)
         */
@@ -6443,7 +6444,7 @@ int __netdev_update_features(struct net_device *dev)
        if (!err)
                dev->features = features;
 
-       return 1;
+       return err < 0 ? 0 : 1;
 }
 
 /**
index 2a1818065e126d4645076f391e4dd689051e9d43..e6dc77252fe9fa3e401529426079f094c9f6f999 100644 (file)
@@ -306,7 +306,7 @@ void dst_release(struct dst_entry *dst)
                if (unlikely(newrefcnt < 0))
                        net_warn_ratelimited("%s: dst:%p refcnt:%d\n",
                                             __func__, dst, newrefcnt);
-               if (unlikely(dst->flags & DST_NOCACHE) && !newrefcnt)
+               if (!newrefcnt && unlikely(dst->flags & DST_NOCACHE))
                        call_rcu(&dst->rcu_head, dst_destroy_rcu);
        }
 }
index 3e87447e65c777ff969d366136d2015e3cf9a8e2..d97268e8ff103bd229de4fb99bbb40f51e61082d 100644 (file)
@@ -923,14 +923,21 @@ static bool fib_valid_prefsrc(struct fib_config *cfg, __be32 fib_prefsrc)
        if (cfg->fc_type != RTN_LOCAL || !cfg->fc_dst ||
            fib_prefsrc != cfg->fc_dst) {
                u32 tb_id = cfg->fc_table;
+               int rc;
 
                if (tb_id == RT_TABLE_MAIN)
                        tb_id = RT_TABLE_LOCAL;
 
-               if (inet_addr_type_table(cfg->fc_nlinfo.nl_net,
-                                        fib_prefsrc, tb_id) != RTN_LOCAL) {
-                       return false;
+               rc = inet_addr_type_table(cfg->fc_nlinfo.nl_net,
+                                         fib_prefsrc, tb_id);
+
+               if (rc != RTN_LOCAL && tb_id != RT_TABLE_LOCAL) {
+                       rc = inet_addr_type_table(cfg->fc_nlinfo.nl_net,
+                                                 fib_prefsrc, RT_TABLE_LOCAL);
                }
+
+               if (rc != RTN_LOCAL)
+                       return false;
        }
        return true;
 }
index 64aaf3522a59f30672689f7309987606773ccb0c..6baf36e11808e5c93c2e092139bed60cdacc4c8a 100644 (file)
@@ -2392,11 +2392,11 @@ int ip_mc_msfget(struct sock *sk, struct ip_msfilter *msf,
        struct ip_sf_socklist *psl;
        struct net *net = sock_net(sk);
 
+       ASSERT_RTNL();
+
        if (!ipv4_is_multicast(addr))
                return -EINVAL;
 
-       rtnl_lock();
-
        imr.imr_multiaddr.s_addr = msf->imsf_multiaddr;
        imr.imr_address.s_addr = msf->imsf_interface;
        imr.imr_ifindex = 0;
@@ -2417,7 +2417,6 @@ int ip_mc_msfget(struct sock *sk, struct ip_msfilter *msf,
                goto done;
        msf->imsf_fmode = pmc->sfmode;
        psl = rtnl_dereference(pmc->sflist);
-       rtnl_unlock();
        if (!psl) {
                len = 0;
                count = 0;
@@ -2436,7 +2435,6 @@ int ip_mc_msfget(struct sock *sk, struct ip_msfilter *msf,
                return -EFAULT;
        return 0;
 done:
-       rtnl_unlock();
        return err;
 }
 
@@ -2450,6 +2448,8 @@ int ip_mc_gsfget(struct sock *sk, struct group_filter *gsf,
        struct inet_sock *inet = inet_sk(sk);
        struct ip_sf_socklist *psl;
 
+       ASSERT_RTNL();
+
        psin = (struct sockaddr_in *)&gsf->gf_group;
        if (psin->sin_family != AF_INET)
                return -EINVAL;
@@ -2457,8 +2457,6 @@ int ip_mc_gsfget(struct sock *sk, struct group_filter *gsf,
        if (!ipv4_is_multicast(addr))
                return -EINVAL;
 
-       rtnl_lock();
-
        err = -EADDRNOTAVAIL;
 
        for_each_pmc_rtnl(inet, pmc) {
@@ -2470,7 +2468,6 @@ int ip_mc_gsfget(struct sock *sk, struct group_filter *gsf,
                goto done;
        gsf->gf_fmode = pmc->sfmode;
        psl = rtnl_dereference(pmc->sflist);
-       rtnl_unlock();
        count = psl ? psl->sl_count : 0;
        copycount = count < gsf->gf_numsrc ? count : gsf->gf_numsrc;
        gsf->gf_numsrc = count;
@@ -2490,7 +2487,6 @@ int ip_mc_gsfget(struct sock *sk, struct group_filter *gsf,
        }
        return 0;
 done:
-       rtnl_unlock();
        return err;
 }
 
index c3c359ad66e3ddb8295b160de30130b405238072..5f73a7c03e27d334c771f144825c4a2f718d71ba 100644 (file)
@@ -1251,11 +1251,22 @@ EXPORT_SYMBOL(compat_ip_setsockopt);
  *     the _received_ ones. The set sets the _sent_ ones.
  */
 
+static bool getsockopt_needs_rtnl(int optname)
+{
+       switch (optname) {
+       case IP_MSFILTER:
+       case MCAST_MSFILTER:
+               return true;
+       }
+       return false;
+}
+
 static int do_ip_getsockopt(struct sock *sk, int level, int optname,
                            char __user *optval, int __user *optlen, unsigned int flags)
 {
        struct inet_sock *inet = inet_sk(sk);
-       int val;
+       bool needs_rtnl = getsockopt_needs_rtnl(optname);
+       int val, err = 0;
        int len;
 
        if (level != SOL_IP)
@@ -1269,6 +1280,8 @@ static int do_ip_getsockopt(struct sock *sk, int level, int optname,
        if (len < 0)
                return -EINVAL;
 
+       if (needs_rtnl)
+               rtnl_lock();
        lock_sock(sk);
 
        switch (optname) {
@@ -1386,39 +1399,35 @@ static int do_ip_getsockopt(struct sock *sk, int level, int optname,
        case IP_MSFILTER:
        {
                struct ip_msfilter msf;
-               int err;
 
                if (len < IP_MSFILTER_SIZE(0)) {
-                       release_sock(sk);
-                       return -EINVAL;
+                       err = -EINVAL;
+                       goto out;
                }
                if (copy_from_user(&msf, optval, IP_MSFILTER_SIZE(0))) {
-                       release_sock(sk);
-                       return -EFAULT;
+                       err = -EFAULT;
+                       goto out;
                }
                err = ip_mc_msfget(sk, &msf,
                                   (struct ip_msfilter __user *)optval, optlen);
-               release_sock(sk);
-               return err;
+               goto out;
        }
        case MCAST_MSFILTER:
        {
                struct group_filter gsf;
-               int err;
 
                if (len < GROUP_FILTER_SIZE(0)) {
-                       release_sock(sk);
-                       return -EINVAL;
+                       err = -EINVAL;
+                       goto out;
                }
                if (copy_from_user(&gsf, optval, GROUP_FILTER_SIZE(0))) {
-                       release_sock(sk);
-                       return -EFAULT;
+                       err = -EFAULT;
+                       goto out;
                }
                err = ip_mc_gsfget(sk, &gsf,
                                   (struct group_filter __user *)optval,
                                   optlen);
-               release_sock(sk);
-               return err;
+               goto out;
        }
        case IP_MULTICAST_ALL:
                val = inet->mc_all;
@@ -1485,6 +1494,12 @@ static int do_ip_getsockopt(struct sock *sk, int level, int optname,
                        return -EFAULT;
        }
        return 0;
+
+out:
+       release_sock(sk);
+       if (needs_rtnl)
+               rtnl_unlock();
+       return err;
 }
 
 int ip_getsockopt(struct sock *sk, int level,
index 0e5591c2ee9f6d66acb47ce2cbbf31403dc286f7..6fb869f646bf7a15b2f012cc1982c2a9f3d5935f 100644 (file)
@@ -67,10 +67,9 @@ static unsigned int ipv4_conntrack_defrag(void *priv,
                                          const struct nf_hook_state *state)
 {
        struct sock *sk = skb->sk;
-       struct inet_sock *inet = inet_sk(skb->sk);
 
-       if (sk && (sk->sk_family == PF_INET) &&
-           inet->nodefrag)
+       if (sk && sk_fullsock(sk) && (sk->sk_family == PF_INET) &&
+           inet_sk(sk)->nodefrag)
                return NF_ACCEPT;
 
 #if IS_ENABLED(CONFIG_NF_CONNTRACK)
index 25300c5e283bc3879fa4400628d4a29141d52e3e..a0bd7a55193e351c9ec75a469315c44e76195fd1 100644 (file)
@@ -48,14 +48,14 @@ static void set_local_port_range(struct net *net, int range[2])
 {
        bool same_parity = !((range[0] ^ range[1]) & 1);
 
-       write_seqlock(&net->ipv4.ip_local_ports.lock);
+       write_seqlock_bh(&net->ipv4.ip_local_ports.lock);
        if (same_parity && !net->ipv4.ip_local_ports.warned) {
                net->ipv4.ip_local_ports.warned = true;
                pr_err_ratelimited("ip_local_port_range: prefer different parity for start/end values.\n");
        }
        net->ipv4.ip_local_ports.range[0] = range[0];
        net->ipv4.ip_local_ports.range[1] = range[1];
-       write_sequnlock(&net->ipv4.ip_local_ports.lock);
+       write_sequnlock_bh(&net->ipv4.ip_local_ports.lock);
 }
 
 /* Validate changes from /proc interface. */
index 1c2648bbac4b22b55739dde4d92dd2ca0533f77a..950e28c0cdf25e23658926cdcf37335aed3fb193 100644 (file)
@@ -1326,6 +1326,8 @@ struct sock *tcp_v4_syn_recv_sock(const struct sock *sk, struct sk_buff *skb,
        if (__inet_inherit_port(sk, newsk) < 0)
                goto put_and_exit;
        *own_req = inet_ehash_nolisten(newsk, req_to_sk(req_unhash));
+       if (*own_req)
+               tcp_move_syn(newtp, req);
 
        return newsk;
 
index 3575dd1e5b6775ad8a35bb3ce0e951bc01e37e7c..ac6b1961ffeb32a40b662300aebee4ba182ce31a 100644 (file)
@@ -551,9 +551,6 @@ struct sock *tcp_create_openreq_child(const struct sock *sk,
                newtp->rack.mstamp.v64 = 0;
                newtp->rack.advanced = 0;
 
-               newtp->saved_syn = req->saved_syn;
-               req->saved_syn = NULL;
-
                TCP_INC_STATS_BH(sock_net(sk), TCP_MIB_PASSIVEOPENS);
        }
        return newsk;
index d72fa90d6feb0122d15d68d6d862e5299d331008..d84742f003a9fca65a3545abdb7a4d517989ed4c 100644 (file)
@@ -418,6 +418,7 @@ static struct inet6_dev *ipv6_add_dev(struct net_device *dev)
        if (err) {
                ipv6_mc_destroy_dev(ndev);
                del_timer(&ndev->regen_timer);
+               snmp6_unregister_dev(ndev);
                goto err_release;
        }
        /* protected by rtnl_lock */
index ea2f4d5440b58266f46525114e7bd9d025fb91d6..5baa8e754e412c454ca22c03822cc57c29df8c35 100644 (file)
@@ -1140,14 +1140,18 @@ static struct sock *tcp_v6_syn_recv_sock(const struct sock *sk, struct sk_buff *
                goto out;
        }
        *own_req = inet_ehash_nolisten(newsk, req_to_sk(req_unhash));
-       /* Clone pktoptions received with SYN, if we own the req */
-       if (*own_req && ireq->pktopts) {
-               newnp->pktoptions = skb_clone(ireq->pktopts,
-                                             sk_gfp_atomic(sk, GFP_ATOMIC));
-               consume_skb(ireq->pktopts);
-               ireq->pktopts = NULL;
-               if (newnp->pktoptions)
-                       skb_set_owner_r(newnp->pktoptions, newsk);
+       if (*own_req) {
+               tcp_move_syn(newtp, req);
+
+               /* Clone pktoptions received with SYN, if we own the req */
+               if (ireq->pktopts) {
+                       newnp->pktoptions = skb_clone(ireq->pktopts,
+                                                     sk_gfp_atomic(sk, GFP_ATOMIC));
+                       consume_skb(ireq->pktopts);
+                       ireq->pktopts = NULL;
+                       if (newnp->pktoptions)
+                               skb_set_owner_r(newnp->pktoptions, newsk);
+               }
        }
 
        return newsk;
index 97b75f9bfbcd6852bdff9ca2d2e218b3539a0f8b..d43869879fcfcea6ca23e3a579bd21f8aa855b10 100644 (file)
@@ -55,7 +55,7 @@ nf_nat_redirect_ipv4(struct sk_buff *skb,
 
                rcu_read_lock();
                indev = __in_dev_get_rcu(skb->dev);
-               if (indev != NULL) {
+               if (indev && indev->ifa_list) {
                        ifa = indev->ifa_list;
                        newdst = ifa->ifa_local;
                }
index f1d9e887f5b157b58578a5a7244d65be788bb13b..46453ab318db0bf2a4bc957dcad6742ccbcacc92 100644 (file)
@@ -492,7 +492,7 @@ static int nfnetlink_bind(struct net *net, int group)
        type = nfnl_group2type[group];
 
        rcu_read_lock();
-       ss = nfnetlink_get_subsys(type);
+       ss = nfnetlink_get_subsys(type << 8);
        rcu_read_unlock();
        if (!ss)
                request_module("nfnetlink-subsys-%d", type);
index e4ad2c24bc4122e6470966f75da7b92f8273ba51..9dfaf4d55ee0b1bd92d8d7d2e64eebc42e8e5b04 100644 (file)
@@ -31,6 +31,7 @@ void nft_meta_get_eval(const struct nft_expr *expr,
        const struct nft_meta *priv = nft_expr_priv(expr);
        const struct sk_buff *skb = pkt->skb;
        const struct net_device *in = pkt->in, *out = pkt->out;
+       struct sock *sk;
        u32 *dest = &regs->data[priv->dreg];
 
        switch (priv->key) {
@@ -86,33 +87,35 @@ void nft_meta_get_eval(const struct nft_expr *expr,
                *(u16 *)dest = out->type;
                break;
        case NFT_META_SKUID:
-               if (skb->sk == NULL || !sk_fullsock(skb->sk))
+               sk = skb_to_full_sk(skb);
+               if (!sk || !sk_fullsock(sk))
                        goto err;
 
-               read_lock_bh(&skb->sk->sk_callback_lock);
-               if (skb->sk->sk_socket == NULL ||
-                   skb->sk->sk_socket->file == NULL) {
-                       read_unlock_bh(&skb->sk->sk_callback_lock);
+               read_lock_bh(&sk->sk_callback_lock);
+               if (sk->sk_socket == NULL ||
+                   sk->sk_socket->file == NULL) {
+                       read_unlock_bh(&sk->sk_callback_lock);
                        goto err;
                }
 
                *dest = from_kuid_munged(&init_user_ns,
-                               skb->sk->sk_socket->file->f_cred->fsuid);
-               read_unlock_bh(&skb->sk->sk_callback_lock);
+                               sk->sk_socket->file->f_cred->fsuid);
+               read_unlock_bh(&sk->sk_callback_lock);
                break;
        case NFT_META_SKGID:
-               if (skb->sk == NULL || !sk_fullsock(skb->sk))
+               sk = skb_to_full_sk(skb);
+               if (!sk || !sk_fullsock(sk))
                        goto err;
 
-               read_lock_bh(&skb->sk->sk_callback_lock);
-               if (skb->sk->sk_socket == NULL ||
-                   skb->sk->sk_socket->file == NULL) {
-                       read_unlock_bh(&skb->sk->sk_callback_lock);
+               read_lock_bh(&sk->sk_callback_lock);
+               if (sk->sk_socket == NULL ||
+                   sk->sk_socket->file == NULL) {
+                       read_unlock_bh(&sk->sk_callback_lock);
                        goto err;
                }
                *dest = from_kgid_munged(&init_user_ns,
-                                skb->sk->sk_socket->file->f_cred->fsgid);
-               read_unlock_bh(&skb->sk->sk_callback_lock);
+                                sk->sk_socket->file->f_cred->fsgid);
+               read_unlock_bh(&sk->sk_callback_lock);
                break;
 #ifdef CONFIG_IP_ROUTE_CLASSID
        case NFT_META_RTCLASSID: {
@@ -168,9 +171,10 @@ void nft_meta_get_eval(const struct nft_expr *expr,
                break;
 #ifdef CONFIG_CGROUP_NET_CLASSID
        case NFT_META_CGROUP:
-               if (skb->sk == NULL || !sk_fullsock(skb->sk))
+               sk = skb_to_full_sk(skb);
+               if (!sk || !sk_fullsock(sk))
                        goto err;
-               *dest = skb->sk->sk_classid;
+               *dest = sk->sk_classid;
                break;
 #endif
        default:
index 899b06115fc53c87ea34eb1bf975666e1992ca98..3eff7b67cdf2f5277c2004cf48c2f4e37c218068 100644 (file)
@@ -31,8 +31,9 @@ static unsigned int
 tee_tg4(struct sk_buff *skb, const struct xt_action_param *par)
 {
        const struct xt_tee_tginfo *info = par->targinfo;
+       int oif = info->priv ? info->priv->oif : 0;
 
-       nf_dup_ipv4(par->net, skb, par->hooknum, &info->gw.in, info->priv->oif);
+       nf_dup_ipv4(par->net, skb, par->hooknum, &info->gw.in, oif);
 
        return XT_CONTINUE;
 }
@@ -42,8 +43,9 @@ static unsigned int
 tee_tg6(struct sk_buff *skb, const struct xt_action_param *par)
 {
        const struct xt_tee_tginfo *info = par->targinfo;
+       int oif = info->priv ? info->priv->oif : 0;
 
-       nf_dup_ipv6(par->net, skb, par->hooknum, &info->gw.in6, info->priv->oif);
+       nf_dup_ipv6(par->net, skb, par->hooknum, &info->gw.in6, oif);
 
        return XT_CONTINUE;
 }
index ca2e577ed8ac196caca1190d9ae65557bd5ab8ed..1302b475abcbe0c6c2f7c93d416635005ae9b91f 100644 (file)
@@ -14,6 +14,7 @@
 #include <linux/skbuff.h>
 #include <linux/file.h>
 #include <net/sock.h>
+#include <net/inet_sock.h>
 #include <linux/netfilter/x_tables.h>
 #include <linux/netfilter/xt_owner.h>
 
@@ -33,8 +34,9 @@ owner_mt(const struct sk_buff *skb, struct xt_action_param *par)
 {
        const struct xt_owner_match_info *info = par->matchinfo;
        const struct file *filp;
+       struct sock *sk = skb_to_full_sk(skb);
 
-       if (skb->sk == NULL || skb->sk->sk_socket == NULL)
+       if (sk == NULL || sk->sk_socket == NULL)
                return (info->match ^ info->invert) == 0;
        else if (info->match & info->invert & XT_OWNER_SOCKET)
                /*
@@ -43,7 +45,7 @@ owner_mt(const struct sk_buff *skb, struct xt_action_param *par)
                 */
                return false;
 
-       filp = skb->sk->sk_socket->file;
+       filp = sk->sk_socket->file;
        if (filp == NULL)
                return ((info->match ^ info->invert) &
                       (XT_OWNER_UID | XT_OWNER_GID)) == 0;
index 691660b9b7effdc59d10517ebf099ca8736efe14..af399cac5205402480300ae7b7d6fbb2094095fb 100644 (file)
@@ -2911,22 +2911,40 @@ static int packet_release(struct socket *sock)
  *     Attach a packet hook.
  */
 
-static int packet_do_bind(struct sock *sk, struct net_device *dev, __be16 proto)
+static int packet_do_bind(struct sock *sk, const char *name, int ifindex,
+                         __be16 proto)
 {
        struct packet_sock *po = pkt_sk(sk);
        struct net_device *dev_curr;
        __be16 proto_curr;
        bool need_rehook;
+       struct net_device *dev = NULL;
+       int ret = 0;
+       bool unlisted = false;
 
-       if (po->fanout) {
-               if (dev)
-                       dev_put(dev);
-
+       if (po->fanout)
                return -EINVAL;
-       }
 
        lock_sock(sk);
        spin_lock(&po->bind_lock);
+       rcu_read_lock();
+
+       if (name) {
+               dev = dev_get_by_name_rcu(sock_net(sk), name);
+               if (!dev) {
+                       ret = -ENODEV;
+                       goto out_unlock;
+               }
+       } else if (ifindex) {
+               dev = dev_get_by_index_rcu(sock_net(sk), ifindex);
+               if (!dev) {
+                       ret = -ENODEV;
+                       goto out_unlock;
+               }
+       }
+
+       if (dev)
+               dev_hold(dev);
 
        proto_curr = po->prot_hook.type;
        dev_curr = po->prot_hook.dev;
@@ -2934,14 +2952,29 @@ static int packet_do_bind(struct sock *sk, struct net_device *dev, __be16 proto)
        need_rehook = proto_curr != proto || dev_curr != dev;
 
        if (need_rehook) {
-               unregister_prot_hook(sk, true);
+               if (po->running) {
+                       rcu_read_unlock();
+                       __unregister_prot_hook(sk, true);
+                       rcu_read_lock();
+                       dev_curr = po->prot_hook.dev;
+                       if (dev)
+                               unlisted = !dev_get_by_index_rcu(sock_net(sk),
+                                                                dev->ifindex);
+               }
 
                po->num = proto;
                po->prot_hook.type = proto;
-               po->prot_hook.dev = dev;
 
-               po->ifindex = dev ? dev->ifindex : 0;
-               packet_cached_dev_assign(po, dev);
+               if (unlikely(unlisted)) {
+                       dev_put(dev);
+                       po->prot_hook.dev = NULL;
+                       po->ifindex = -1;
+                       packet_cached_dev_reset(po);
+               } else {
+                       po->prot_hook.dev = dev;
+                       po->ifindex = dev ? dev->ifindex : 0;
+                       packet_cached_dev_assign(po, dev);
+               }
        }
        if (dev_curr)
                dev_put(dev_curr);
@@ -2949,7 +2982,7 @@ static int packet_do_bind(struct sock *sk, struct net_device *dev, __be16 proto)
        if (proto == 0 || !need_rehook)
                goto out_unlock;
 
-       if (!dev || (dev->flags & IFF_UP)) {
+       if (!unlisted && (!dev || (dev->flags & IFF_UP))) {
                register_prot_hook(sk);
        } else {
                sk->sk_err = ENETDOWN;
@@ -2958,9 +2991,10 @@ static int packet_do_bind(struct sock *sk, struct net_device *dev, __be16 proto)
        }
 
 out_unlock:
+       rcu_read_unlock();
        spin_unlock(&po->bind_lock);
        release_sock(sk);
-       return 0;
+       return ret;
 }
 
 /*
@@ -2972,8 +3006,6 @@ static int packet_bind_spkt(struct socket *sock, struct sockaddr *uaddr,
 {
        struct sock *sk = sock->sk;
        char name[15];
-       struct net_device *dev;
-       int err = -ENODEV;
 
        /*
         *      Check legality
@@ -2983,19 +3015,13 @@ static int packet_bind_spkt(struct socket *sock, struct sockaddr *uaddr,
                return -EINVAL;
        strlcpy(name, uaddr->sa_data, sizeof(name));
 
-       dev = dev_get_by_name(sock_net(sk), name);
-       if (dev)
-               err = packet_do_bind(sk, dev, pkt_sk(sk)->num);
-       return err;
+       return packet_do_bind(sk, name, 0, pkt_sk(sk)->num);
 }
 
 static int packet_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
 {
        struct sockaddr_ll *sll = (struct sockaddr_ll *)uaddr;
        struct sock *sk = sock->sk;
-       struct net_device *dev = NULL;
-       int err;
-
 
        /*
         *      Check legality
@@ -3006,16 +3032,8 @@ static int packet_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len
        if (sll->sll_family != AF_PACKET)
                return -EINVAL;
 
-       if (sll->sll_ifindex) {
-               err = -ENODEV;
-               dev = dev_get_by_index(sock_net(sk), sll->sll_ifindex);
-               if (dev == NULL)
-                       goto out;
-       }
-       err = packet_do_bind(sk, dev, sll->sll_protocol ? : pkt_sk(sk)->num);
-
-out:
-       return err;
+       return packet_do_bind(sk, NULL, sll->sll_ifindex,
+                             sll->sll_protocol ? : pkt_sk(sk)->num);
 }
 
 static struct proto packet_proto = {
index 536838b657bfcfb8e33596b7a7d5aec76b72e4f4..fbfec6a188390007fd30cf0a351e74f5b2d77057 100644 (file)
@@ -22,6 +22,7 @@
 #include <linux/if_vlan.h>
 #include <linux/slab.h>
 #include <linux/module.h>
+#include <net/inet_sock.h>
 
 #include <net/pkt_cls.h>
 #include <net/ip.h>
@@ -197,8 +198,11 @@ static u32 flow_get_rtclassid(const struct sk_buff *skb)
 
 static u32 flow_get_skuid(const struct sk_buff *skb)
 {
-       if (skb->sk && skb->sk->sk_socket && skb->sk->sk_socket->file) {
-               kuid_t skuid = skb->sk->sk_socket->file->f_cred->fsuid;
+       struct sock *sk = skb_to_full_sk(skb);
+
+       if (sk && sk->sk_socket && sk->sk_socket->file) {
+               kuid_t skuid = sk->sk_socket->file->f_cred->fsuid;
+
                return from_kuid(&init_user_ns, skuid);
        }
        return 0;
@@ -206,8 +210,11 @@ static u32 flow_get_skuid(const struct sk_buff *skb)
 
 static u32 flow_get_skgid(const struct sk_buff *skb)
 {
-       if (skb->sk && skb->sk->sk_socket && skb->sk->sk_socket->file) {
-               kgid_t skgid = skb->sk->sk_socket->file->f_cred->fsgid;
+       struct sock *sk = skb_to_full_sk(skb);
+
+       if (sk && sk->sk_socket && sk->sk_socket->file) {
+               kgid_t skgid = sk->sk_socket->file->f_cred->fsgid;
+
                return from_kgid(&init_user_ns, skgid);
        }
        return 0;
index b5294ce20cd467063721cea69348cb35d7999921..f2aabc0089da203cd6b4d5b15eea40ad5299babe 100644 (file)
@@ -343,119 +343,145 @@ META_COLLECTOR(int_sk_refcnt)
 
 META_COLLECTOR(int_sk_rcvbuf)
 {
-       if (skip_nonlocal(skb)) {
+       const struct sock *sk = skb_to_full_sk(skb);
+
+       if (!sk) {
                *err = -1;
                return;
        }
-       dst->value = skb->sk->sk_rcvbuf;
+       dst->value = sk->sk_rcvbuf;
 }
 
 META_COLLECTOR(int_sk_shutdown)
 {
-       if (skip_nonlocal(skb)) {
+       const struct sock *sk = skb_to_full_sk(skb);
+
+       if (!sk) {
                *err = -1;
                return;
        }
-       dst->value = skb->sk->sk_shutdown;
+       dst->value = sk->sk_shutdown;
 }
 
 META_COLLECTOR(int_sk_proto)
 {
-       if (skip_nonlocal(skb)) {
+       const struct sock *sk = skb_to_full_sk(skb);
+
+       if (!sk) {
                *err = -1;
                return;
        }
-       dst->value = skb->sk->sk_protocol;
+       dst->value = sk->sk_protocol;
 }
 
 META_COLLECTOR(int_sk_type)
 {
-       if (skip_nonlocal(skb)) {
+       const struct sock *sk = skb_to_full_sk(skb);
+
+       if (!sk) {
                *err = -1;
                return;
        }
-       dst->value = skb->sk->sk_type;
+       dst->value = sk->sk_type;
 }
 
 META_COLLECTOR(int_sk_rmem_alloc)
 {
-       if (skip_nonlocal(skb)) {
+       const struct sock *sk = skb_to_full_sk(skb);
+
+       if (!sk) {
                *err = -1;
                return;
        }
-       dst->value = sk_rmem_alloc_get(skb->sk);
+       dst->value = sk_rmem_alloc_get(sk);
 }
 
 META_COLLECTOR(int_sk_wmem_alloc)
 {
-       if (skip_nonlocal(skb)) {
+       const struct sock *sk = skb_to_full_sk(skb);
+
+       if (!sk) {
                *err = -1;
                return;
        }
-       dst->value = sk_wmem_alloc_get(skb->sk);
+       dst->value = sk_wmem_alloc_get(sk);
 }
 
 META_COLLECTOR(int_sk_omem_alloc)
 {
-       if (skip_nonlocal(skb)) {
+       const struct sock *sk = skb_to_full_sk(skb);
+
+       if (!sk) {
                *err = -1;
                return;
        }
-       dst->value = atomic_read(&skb->sk->sk_omem_alloc);
+       dst->value = atomic_read(&sk->sk_omem_alloc);
 }
 
 META_COLLECTOR(int_sk_rcv_qlen)
 {
-       if (skip_nonlocal(skb)) {
+       const struct sock *sk = skb_to_full_sk(skb);
+
+       if (!sk) {
                *err = -1;
                return;
        }
-       dst->value = skb->sk->sk_receive_queue.qlen;
+       dst->value = sk->sk_receive_queue.qlen;
 }
 
 META_COLLECTOR(int_sk_snd_qlen)
 {
-       if (skip_nonlocal(skb)) {
+       const struct sock *sk = skb_to_full_sk(skb);
+
+       if (!sk) {
                *err = -1;
                return;
        }
-       dst->value = skb->sk->sk_write_queue.qlen;
+       dst->value = sk->sk_write_queue.qlen;
 }
 
 META_COLLECTOR(int_sk_wmem_queued)
 {
-       if (skip_nonlocal(skb)) {
+       const struct sock *sk = skb_to_full_sk(skb);
+
+       if (!sk) {
                *err = -1;
                return;
        }
-       dst->value = skb->sk->sk_wmem_queued;
+       dst->value = sk->sk_wmem_queued;
 }
 
 META_COLLECTOR(int_sk_fwd_alloc)
 {
-       if (skip_nonlocal(skb)) {
+       const struct sock *sk = skb_to_full_sk(skb);
+
+       if (!sk) {
                *err = -1;
                return;
        }
-       dst->value = skb->sk->sk_forward_alloc;
+       dst->value = sk->sk_forward_alloc;
 }
 
 META_COLLECTOR(int_sk_sndbuf)
 {
-       if (skip_nonlocal(skb)) {
+       const struct sock *sk = skb_to_full_sk(skb);
+
+       if (!sk) {
                *err = -1;
                return;
        }
-       dst->value = skb->sk->sk_sndbuf;
+       dst->value = sk->sk_sndbuf;
 }
 
 META_COLLECTOR(int_sk_alloc)
 {
-       if (skip_nonlocal(skb)) {
+       const struct sock *sk = skb_to_full_sk(skb);
+
+       if (!sk) {
                *err = -1;
                return;
        }
-       dst->value = (__force int) skb->sk->sk_allocation;
+       dst->value = (__force int) sk->sk_allocation;
 }
 
 META_COLLECTOR(int_sk_hash)
@@ -469,92 +495,112 @@ META_COLLECTOR(int_sk_hash)
 
 META_COLLECTOR(int_sk_lingertime)
 {
-       if (skip_nonlocal(skb)) {
+       const struct sock *sk = skb_to_full_sk(skb);
+
+       if (!sk) {
                *err = -1;
                return;
        }
-       dst->value = skb->sk->sk_lingertime / HZ;
+       dst->value = sk->sk_lingertime / HZ;
 }
 
 META_COLLECTOR(int_sk_err_qlen)
 {
-       if (skip_nonlocal(skb)) {
+       const struct sock *sk = skb_to_full_sk(skb);
+
+       if (!sk) {
                *err = -1;
                return;
        }
-       dst->value = skb->sk->sk_error_queue.qlen;
+       dst->value = sk->sk_error_queue.qlen;
 }
 
 META_COLLECTOR(int_sk_ack_bl)
 {
-       if (skip_nonlocal(skb)) {
+       const struct sock *sk = skb_to_full_sk(skb);
+
+       if (!sk) {
                *err = -1;
                return;
        }
-       dst->value = skb->sk->sk_ack_backlog;
+       dst->value = sk->sk_ack_backlog;
 }
 
 META_COLLECTOR(int_sk_max_ack_bl)
 {
-       if (skip_nonlocal(skb)) {
+       const struct sock *sk = skb_to_full_sk(skb);
+
+       if (!sk) {
                *err = -1;
                return;
        }
-       dst->value = skb->sk->sk_max_ack_backlog;
+       dst->value = sk->sk_max_ack_backlog;
 }
 
 META_COLLECTOR(int_sk_prio)
 {
-       if (skip_nonlocal(skb)) {
+       const struct sock *sk = skb_to_full_sk(skb);
+
+       if (!sk) {
                *err = -1;
                return;
        }
-       dst->value = skb->sk->sk_priority;
+       dst->value = sk->sk_priority;
 }
 
 META_COLLECTOR(int_sk_rcvlowat)
 {
-       if (skip_nonlocal(skb)) {
+       const struct sock *sk = skb_to_full_sk(skb);
+
+       if (!sk) {
                *err = -1;
                return;
        }
-       dst->value = skb->sk->sk_rcvlowat;
+       dst->value = sk->sk_rcvlowat;
 }
 
 META_COLLECTOR(int_sk_rcvtimeo)
 {
-       if (skip_nonlocal(skb)) {
+       const struct sock *sk = skb_to_full_sk(skb);
+
+       if (!sk) {
                *err = -1;
                return;
        }
-       dst->value = skb->sk->sk_rcvtimeo / HZ;
+       dst->value = sk->sk_rcvtimeo / HZ;
 }
 
 META_COLLECTOR(int_sk_sndtimeo)
 {
-       if (skip_nonlocal(skb)) {
+       const struct sock *sk = skb_to_full_sk(skb);
+
+       if (!sk) {
                *err = -1;
                return;
        }
-       dst->value = skb->sk->sk_sndtimeo / HZ;
+       dst->value = sk->sk_sndtimeo / HZ;
 }
 
 META_COLLECTOR(int_sk_sendmsg_off)
 {
-       if (skip_nonlocal(skb)) {
+       const struct sock *sk = skb_to_full_sk(skb);
+
+       if (!sk) {
                *err = -1;
                return;
        }
-       dst->value = skb->sk->sk_frag.offset;
+       dst->value = sk->sk_frag.offset;
 }
 
 META_COLLECTOR(int_sk_write_pend)
 {
-       if (skip_nonlocal(skb)) {
+       const struct sock *sk = skb_to_full_sk(skb);
+
+       if (!sk) {
                *err = -1;
                return;
        }
-       dst->value = skb->sk->sk_write_pending;
+       dst->value = sk->sk_write_pending;
 }
 
 /**************************************************************************
index 400d87294de3f72ca343814525fcec67564d0b47..0a369bb440e77e03262ae48a7e3519db35c87835 100644 (file)
@@ -1234,7 +1234,7 @@ vmci_transport_recv_connecting_server(struct sock *listener,
        /* Callers of accept() will be be waiting on the listening socket, not
         * the pending socket.
         */
-       listener->sk_state_change(listener);
+       listener->sk_data_ready(listener);
 
        return 0;
 
index bbf901afb606bcbd8c01e09a2b5063f4ae522e76..b2d758188f2f404b22c8c691b87d0e43a0404f5d 100755 (executable)
@@ -30,7 +30,7 @@ FLAGS="$SPFLAGS --very-quiet"
 # spatch only allows include directories with the syntax "-I include"
 # while gcc also allows "-Iinclude" and "-include include"
 COCCIINCLUDE=${LINUXINCLUDE//-I/-I }
-COCCIINCLUDE=${COCCIINCLUDE//-include/-I}
+COCCIINCLUDE=${COCCIINCLUDE// -include/ --include}
 
 if [ "$C" = "1" -o "$C" = "2" ]; then
     ONLINE=1
index a42d70bf88b3b5f834eb5654d5e52519982568d4..52bd235286fa60bb345172d58805e9ae9d04fe0d 100644 (file)
@@ -16,19 +16,21 @@ virtual context
 @r2 depends on patch@
 expression E;
 @@
-- if (E)
+- if (E != NULL)
 (
--      kfree(E);
-+ kfree(E);
+  kfree(E);
 |
--      debugfs_remove(E);
-+ debugfs_remove(E);
+  debugfs_remove(E);
 |
--      debugfs_remove_recursive(E);
-+ debugfs_remove_recursive(E);
+  debugfs_remove_recursive(E);
 |
--      usb_free_urb(E);
-+ usb_free_urb(E);
+  usb_free_urb(E);
+|
+  kmem_cache_destroy(E);
+|
+  mempool_destroy(E);
+|
+  dma_pool_destroy(E);
 )
 
 @r depends on context || report || org @
@@ -36,8 +38,10 @@ expression E;
 position p;
 @@
 
-* if (E)
-*      \(kfree@p\|debugfs_remove@p\|debugfs_remove_recursive@p\|usb_free_urb\)(E);
+* if (E != NULL)
+*      \(kfree@p\|debugfs_remove@p\|debugfs_remove_recursive@p\|
+*         usb_free_urb@p\|kmem_cache_destroy@p\|mempool_destroy@p\|
+*         dma_pool_destroy@p\)(E);
 
 @script:python depends on org@
 p << r.p;
diff --git a/scripts/coccinelle/iterators/device_node_continue.cocci b/scripts/coccinelle/iterators/device_node_continue.cocci
new file mode 100644 (file)
index 0000000..38ab744
--- /dev/null
@@ -0,0 +1,100 @@
+/// Device node iterators put the previous value of the index variable, so an
+/// explicit put causes a double put.
+///
+// Confidence: High
+// Copyright: (C) 2015 Julia Lawall, Inria. GPLv2.
+// URL: http://coccinelle.lip6.fr/
+// Options: --no-includes --include-headers
+// Keywords: for_each_child_of_node, etc.
+
+virtual patch
+virtual context
+virtual org
+virtual report
+
+@r exists@
+expression e1,e2;
+local idexpression n;
+iterator name for_each_node_by_name, for_each_node_by_type,
+for_each_compatible_node, for_each_matching_node,
+for_each_matching_node_and_match, for_each_child_of_node,
+for_each_available_child_of_node, for_each_node_with_property;
+iterator i;
+position p1,p2;
+statement S;
+@@
+
+(
+(
+for_each_node_by_name(n,e1) S
+|
+for_each_node_by_type(n,e1) S
+|
+for_each_compatible_node(n,e1,e2) S
+|
+for_each_matching_node(n,e1) S
+|
+for_each_matching_node_and_match(n,e1,e2) S
+|
+for_each_child_of_node(e1,n) S
+|
+for_each_available_child_of_node(e1,n) S
+|
+for_each_node_with_property(n,e1) S
+)
+&
+i@p1(...) {
+   ... when != of_node_get(n)
+       when any
+   of_node_put@p2(n);
+   ... when any
+}
+)
+
+@s exists@
+local idexpression r.n;
+statement S;
+position r.p1,r.p2;
+iterator i;
+@@
+
+ of_node_put@p2(n);
+ ... when any
+ i@p1(..., n, ...)
+ S
+
+@t depends on s && patch && !context && !org && !report@
+local idexpression n;
+position r.p2;
+@@
+
+- of_node_put@p2(n);
+
+// ----------------------------------------------------------------------------
+
+@t_context depends on s && !patch && (context || org || report)@
+local idexpression n;
+position r.p2;
+position j0;
+@@
+
+*  of_node_put@j0@p2(n);
+
+// ----------------------------------------------------------------------------
+
+@script:python t_org depends on org@
+j0 << t_context.j0;
+@@
+
+msg = "ERROR: probable double put."
+coccilib.org.print_todo(j0[0], msg)
+
+// ----------------------------------------------------------------------------
+
+@script:python t_report depends on report@
+j0 << t_context.j0;
+@@
+
+msg = "ERROR: probable double put."
+coccilib.report.print_report(j0[0], msg)
+
diff --git a/scripts/coccinelle/misc/compare_const_fl.cocci b/scripts/coccinelle/misc/compare_const_fl.cocci
new file mode 100644 (file)
index 0000000..b5d4bab
--- /dev/null
@@ -0,0 +1,171 @@
+/// Move constants to the right of binary operators.
+//# Depends on personal taste in some cases.
+///
+// Confidence: Moderate
+// Copyright: (C) 2015 Copyright: (C) 2015 Julia Lawall, Inria. GPLv2.
+// URL: http://coccinelle.lip6.fr/
+// Options: --no-includes --include-headers
+
+virtual patch
+virtual context
+virtual org
+virtual report
+
+@r1 depends on patch && !context && !org && !report
+ disable bitor_comm, neg_if_exp@
+constant c,c1;
+local idexpression i;
+expression e,e1,e2;
+binary operator b = {==,!=,&,|};
+type t;
+@@
+
+(
+c b (c1)
+|
+sizeof(t) b e1
+|
+sizeof e b e1
+|
+i b e1
+|
+c | e1 | e2 | ...
+|
+c | (e ? e1 : e2)
+|
+- c
++ e
+b
+- e
++ c
+)
+
+@r2 depends on patch && !context && !org && !report
+ disable gtr_lss, gtr_lss_eq, not_int2@
+constant c,c1;
+expression e,e1,e2;
+binary operator b;
+binary operator b1 = {<,<=},b2 = {<,<=};
+binary operator b3 = {>,>=},b4 = {>,>=};
+local idexpression i;
+type t;
+@@
+
+(
+c b c1
+|
+sizeof(t) b e1
+|
+sizeof e b e1
+|
+ (e1 b1 e) && (e b2 e2)
+|
+ (e1 b3 e) && (e b4 e2)
+|
+i b e
+|
+- c < e
++ e > c
+|
+- c <= e
++ e >= c
+|
+- c > e
++ e < c
+|
+- c >= e
++ e <= c
+)
+
+// ----------------------------------------------------------------------------
+
+@r1_context depends on !patch && (context || org || report)
+ disable bitor_comm, neg_if_exp exists@
+type t;
+binary operator b = {==,!=,&,|};
+constant c, c1;
+expression e, e1, e2;
+local idexpression i;
+position j0;
+@@
+
+(
+c b (c1)
+|
+sizeof(t) b e1
+|
+sizeof e b e1
+|
+i b e1
+|
+c | e1 | e2 | ...
+|
+c | (e ? e1 : e2)
+|
+* c@j0 b e
+)
+
+@r2_context depends on !patch && (context || org || report)
+ disable gtr_lss, gtr_lss_eq, not_int2 exists@
+type t;
+binary operator b, b1 = {<,<=}, b2 = {<,<=}, b3 = {>,>=}, b4 = {>,>=};
+constant c, c1;
+expression e, e1, e2;
+local idexpression i;
+position j0;
+@@
+
+(
+c b c1
+|
+sizeof(t) b e1
+|
+sizeof e b e1
+|
+ (e1 b1 e) && (e b2 e2)
+|
+ (e1 b3 e) && (e b4 e2)
+|
+i b e
+|
+* c@j0 < e
+|
+* c@j0 <= e
+|
+* c@j0 > e
+|
+* c@j0 >= e
+)
+
+// ----------------------------------------------------------------------------
+
+@script:python r1_org depends on org@
+j0 << r1_context.j0;
+@@
+
+msg = "Move constant to right."
+coccilib.org.print_todo(j0[0], msg)
+
+@script:python r2_org depends on org@
+j0 << r2_context.j0;
+@@
+
+msg = "Move constant to right."
+coccilib.org.print_todo(j0[0], msg)
+
+// ----------------------------------------------------------------------------
+
+@script:python r1_report depends on report@
+j0 << r1_context.j0;
+@@
+
+msg = "Move constant to right."
+coccilib.report.print_report(j0[0], msg)
+
+@script:python r2_report depends on report@
+j0 << r2_context.j0;
+@@
+
+msg = "Move constant to right."
+coccilib.report.print_report(j0[0], msg)
+
index 3c934046a06042afb3982b9e001280f36bb2340e..2294915a19bc42c70b1cc2c3d510a7412526036b 100644 (file)
@@ -1,6 +1,6 @@
-/// Make sure of_device_id tables are NULL terminated
+/// Make sure (of/i2c/platform)_device_id tables are NULL terminated
 //
-// Keywords: of_table
+// Keywords: of_table i2c_table platform_table
 // Confidence: Medium
 // Options: --include-headers
 
@@ -13,18 +13,26 @@ virtual report
 identifier var, arr;
 expression E;
 @@
-struct of_device_id arr[] = {
+(
+struct \(of_device_id \| i2c_device_id \| platform_device_id\) arr[] = {
        ...,
        {
        .var = E,
 *      }
 };
+|
+struct \(of_device_id \| i2c_device_id \| platform_device_id\) arr[] = {
+       ...,
+*      { ..., E, ... },
+};
+)
 
 @depends on patch@
 identifier var, arr;
 expression E;
 @@
-struct of_device_id arr[] = {
+(
+struct \(of_device_id \| i2c_device_id \| platform_device_id\) arr[] = {
        ...,
        {
        .var = E,
@@ -32,19 +40,34 @@ struct of_device_id arr[] = {
 +      },
 +      { }
 };
+|
+struct \(of_device_id \| i2c_device_id \| platform_device_id\) arr[] = {
+       ...,
+       { ..., E, ... },
++      { },
+};
+)
 
 @r depends on org || report@
 position p1;
 identifier var, arr;
 expression E;
 @@
-struct of_device_id arr[] = {
+(
+struct \(of_device_id \| i2c_device_id \| platform_device_id\) arr[] = {
        ...,
        {
        .var = E,
        }
        @p1
 };
+|
+struct \(of_device_id \| i2c_device_id \| platform_device_id\) arr[] = {
+       ...,
+       { ..., E, ... }
+       @p1
+};
+)
 
 @script:python depends on org@
 p1 << r.p1;
diff --git a/scripts/coccinelle/misc/simple_return.cocci b/scripts/coccinelle/misc/simple_return.cocci
deleted file mode 100644 (file)
index e8b6313..0000000
+++ /dev/null
@@ -1,180 +0,0 @@
-/// Simplify a trivial if-return sequence.  Possibly combine with a
-/// preceding function call.
-///
-// Confidence: High
-// Copyright: (C) 2014 Julia Lawall, INRIA/LIP6.  GPLv2.
-// Copyright: (C) 2014 Gilles Muller, INRIA/LiP6.  GPLv2.
-// URL: http://coccinelle.lip6.fr/
-// Comments:
-// Options: --no-includes --include-headers
-
-virtual patch
-virtual context
-virtual org
-virtual report
-
-@r depends on patch@
-local idexpression e;
-identifier i,f,fn;
-@@
-
-fn(...) { <...
-- e@i =
-+ return
-    f(...);
--if (i != 0) return i;
--return 0;
-...> }
-
-@depends on patch@
-identifier r.i;
-type t;
-@@
-
--t i;
- ... when != i
-
-@depends on patch@
-expression e;
-@@
-
--if (e != 0)
-   return e;
--return 0;
-
-// -----------------------------------------------------------------------
-
-@s1 depends on context || org || report@
-local idexpression e;
-identifier i,f,fn;
-position p,p1,p2;
-@@
-
-fn(...) { <...
-* e@i@p = f(...);
-  if (\(i@p1 != 0\|i@p2 < 0\))
-     return i;
-  return 0;
-...> }
-
-@s2 depends on context || org || report forall@
-identifier s1.i;
-type t;
-position q,s1.p;
-expression e,f;
-@@
-
-* t i@q;
-  ... when != i
-  e@p = f(...);
-
-@s3 depends on context || org || report@
-expression e;
-position p1!=s1.p1;
-position p2!=s1.p2;
-@@
-
-*if (\(e@p1 != 0\|e@p2 < 0\))
-   return e;
- return 0;
-
-// -----------------------------------------------------------------------
-
-@script:python depends on org@
-p << s1.p;
-p1 << s1.p1;
-q << s2.q;
-@@
-
-cocci.print_main("decl",q)
-cocci.print_secs("use",p)
-cocci.include_match(False)
-
-@script:python depends on org@
-p << s1.p;
-p2 << s1.p2;
-q << s2.q;
-@@
-
-cocci.print_main("decl",q)
-cocci.print_secs("use with questionable test",p)
-cocci.include_match(False)
-
-@script:python depends on org@
-p << s1.p;
-p1 << s1.p1;
-@@
-
-cocci.print_main("use",p)
-
-@script:python depends on org@
-p << s1.p;
-p2 << s1.p2;
-@@
-
-cocci.print_main("use with questionable test",p)
-
-@script:python depends on org@
-p << s3.p1;
-@@
-
-cocci.print_main("test",p)
-
-@script:python depends on org@
-p << s3.p2;
-@@
-
-cocci.print_main("questionable test",p)
-
-// -----------------------------------------------------------------------
-
-@script:python depends on report@
-p << s1.p;
-p1 << s1.p1;
-q << s2.q;
-@@
-
-msg = "WARNING: end returns can be simpified and declaration on line %s can be dropped" % (q[0].line)
-coccilib.report.print_report(p[0],msg)
-cocci.include_match(False)
-
-@script:python depends on report@
-p << s1.p;
-p1 << s1.p1;
-q << s2.q
-;
-@@
-
-msg = "WARNING: end returns may be simpified if negative or 0 value and declaration on line %s can be dropped" % (q[0].line)
-coccilib.report.print_report(p[0],msg)
-cocci.include_match(False)
-
-@script:python depends on report@
-p << s1.p;
-p1 << s1.p1;
-@@
-
-msg = "WARNING: end returns can be simpified"
-coccilib.report.print_report(p[0],msg)
-
-@script:python depends on report@
-p << s1.p;
-p2 << s1.p2;
-@@
-
-msg = "WARNING: end returns can be simpified if negative or 0 value"
-coccilib.report.print_report(p[0],msg)
-
-@script:python depends on report@
-p << s3.p1;
-@@
-
-msg = "WARNING: end returns can be simpified"
-coccilib.report.print_report(p[0],msg)
-
-@script:python depends on report@
-p << s3.p2;
-@@
-
-msg = "WARNING: end returns can be simpified if tested value is negative or 0"
-coccilib.report.print_report(p[0],msg)
index cdac6cfcce92cc8ab25304806fbff81991b51dad..f192d6035d023b0be83e88c4acb691546722a015 100644 (file)
@@ -1,6 +1,6 @@
 ///
-/// A variable is dereference under a NULL test.
-/// Even though it is know to be NULL.
+/// A variable is dereferenced under a NULL test.
+/// Even though it is known to be NULL.
 ///
 // Confidence: Moderate
 // Copyright: (C) 2010 Nicolas Palix, DIKU.  GPLv2.
index cfe0a35cf2dd219090d6186996fd3a5ca6b94fda..dfc6b40c29698417c32c9c50eb22ad1b5c81044d 100644 (file)
@@ -1,12 +1,11 @@
 /// PTR_ERR should access the value just tested by IS_ERR
-//# There can be false positives in the patch case, where it is the call
+//# There can be false positives in the patch case, where it is the call to
 //# IS_ERR that is wrong.
 ///
 // Confidence: High
-// Copyright: (C) 2012 Julia Lawall, INRIA.  GPLv2.
-// Copyright: (C) 2012 Gilles Muller, INRIA.  GPLv2.
+// Copyright: (C) 2012, 2015 Julia Lawall, INRIA.  GPLv2.
+// Copyright: (C) 2012, 2015 Gilles Muller, INRIA.  GPLv2.
 // URL: http://coccinelle.lip6.fr/
-// Comments:
 // Options: --no-includes --include-headers
 
 virtual patch
@@ -14,52 +13,105 @@ virtual context
 virtual org
 virtual report
 
-@depends on patch@
-expression e,e1;
+@ok1 exists@
+expression x,e;
+position p;
 @@
 
+if (IS_ERR(x=e) || ...) {
+  <...
+   PTR_ERR@p(x)
+  ...>
+}
+
+@ok2 exists@
+expression x,e1,e2;
+position p;
+@@
+
+if (IS_ERR(x) || ...) {
+  <...
 (
-if (IS_ERR(e)) { ... PTR_ERR(e) ... }
+   PTR_ERR@p(\(e1 ? e2 : x\|e1 ? x : e2\))
 |
-if (IS_ERR(e=e1)) { ... PTR_ERR(e) ... }
+   PTR_ERR@p(x)
+)
+  ...>
+}
+
+@r1 depends on patch && !context && !org && !report exists@
+expression x,y;
+position p != {ok1.p,ok2.p};
+@@
+
+if (IS_ERR(x) || ...) {
+  ... when any
+      when != IS_ERR(...)
+(
+  PTR_ERR(x)
 |
-if (IS_ERR(e))
- { ...
-  PTR_ERR(
--   e1
-+   e
+  PTR_ERR@p(
+-     y
++     x
   )
-   ... }
 )
+  ... when any
+}
+
+// ----------------------------------------------------------------------------
 
-@r depends on !patch@
-expression e,e1;
-position p1,p2;
+@r1_context depends on !patch && (context || org || report) exists@
+position p != {ok1.p,ok2.p};
+expression x, y;
+position j0, j1;
 @@
 
+if (IS_ERR@j0(x) || ...) {
+  ... when any
+      when != IS_ERR(...)
 (
-if (IS_ERR(e)) { ... PTR_ERR(e) ... }
+  PTR_ERR(x)
 |
-if (IS_ERR(e=e1)) { ... PTR_ERR(e) ... }
-|
-*if (IS_ERR@p1(e))
- { ...
-*  PTR_ERR@p2(e1)
-   ... }
+  PTR_ERR@j1@p(
+     y
+  )
 )
+  ... when any
+}
 
-@script:python depends on org@
-p1 << r.p1;
-p2 << r.p2;
+@r1_disj depends on !patch && (context || org || report) exists@
+position p != {ok1.p,ok2.p};
+expression x, y;
+position r1_context.j0, r1_context.j1;
 @@
 
-cocci.print_main("inconsistent IS_ERR and PTR_ERR",p1)
-cocci.print_secs("PTR_ERR",p2)
+* if (IS_ERR@j0(x) || ...) {
+  ... when any
+      when != IS_ERR(...)
+*   PTR_ERR@j1@p(
+     y
+  )
+  ... when any
+}
 
-@script:python depends on report@
-p1 << r.p1;
-p2 << r.p2;
+// ----------------------------------------------------------------------------
+
+@script:python r1_org depends on org@
+j0 << r1_context.j0;
+j1 << r1_context.j1;
 @@
 
-msg = "inconsistent IS_ERR and PTR_ERR, PTR_ERR on line %s" % (p2[0].line)
-coccilib.report.print_report(p1[0],msg)
+msg = "inconsistent IS_ERR and PTR_ERR"
+coccilib.org.print_todo(j0[0], msg)
+coccilib.org.print_link(j1[0], "")
+
+// ----------------------------------------------------------------------------
+
+@script:python r1_report depends on report@
+j0 << r1_context.j0;
+j1 << r1_context.j1;
+@@
+
+msg = "inconsistent IS_ERR and PTR_ERR on line %s." % (j1[0].line)
+coccilib.report.print_report(j0[0], msg)
+
index 3043d6b0b51d4e84802087f0526d30eb65422702..d79cba4ce3ebfb24a660da011076deb81a6ff4ad 100644 (file)
@@ -229,49 +229,21 @@ $(obj)/.tmp_qtcheck: $(src)/Makefile
 
 # Qt needs some extra effort...
 $(obj)/.tmp_qtcheck:
-       @set -e; $(kecho) "  CHECK   qt"; dir=""; pkg=""; \
-       if ! pkg-config --exists QtCore 2> /dev/null; then \
-           echo "* Unable to find the Qt4 tool qmake. Trying to use Qt3"; \
-           pkg-config --exists qt 2> /dev/null && pkg=qt; \
-           pkg-config --exists qt-mt 2> /dev/null && pkg=qt-mt; \
-           if [ -n "$$pkg" ]; then \
-             cflags="\$$(shell pkg-config $$pkg --cflags)"; \
-             libs="\$$(shell pkg-config $$pkg --libs)"; \
-             moc="\$$(shell pkg-config $$pkg --variable=prefix)/bin/moc"; \
-             dir="$$(pkg-config $$pkg --variable=prefix)"; \
-           else \
-             for d in $$QTDIR /usr/share/qt* /usr/lib/qt*; do \
-               if [ -f $$d/include/qconfig.h ]; then dir=$$d; break; fi; \
-             done; \
-             if [ -z "$$dir" ]; then \
-               echo >&2 "*"; \
-               echo >&2 "* Unable to find any Qt installation. Please make sure that"; \
-               echo >&2 "* the Qt4 or Qt3 development package is correctly installed and"; \
-               echo >&2 "* either qmake can be found or install pkg-config or set"; \
-               echo >&2 "* the QTDIR environment variable to the correct location."; \
-               echo >&2 "*"; \
-               false; \
-             fi; \
-             libpath=$$dir/lib; lib=qt; osdir=""; \
-             $(HOSTCXX) -print-multi-os-directory > /dev/null 2>&1 && \
-               osdir=x$$($(HOSTCXX) -print-multi-os-directory); \
-             test -d $$libpath/$$osdir && libpath=$$libpath/$$osdir; \
-             test -f $$libpath/libqt-mt.so && lib=qt-mt; \
-             cflags="-I$$dir/include"; \
-             libs="-L$$libpath -Wl,-rpath,$$libpath -l$$lib"; \
-             moc="$$dir/bin/moc"; \
-           fi; \
-           if [ ! -x $$dir/bin/moc -a -x /usr/bin/moc ]; then \
-             echo "*"; \
-             echo "* Unable to find $$dir/bin/moc, using /usr/bin/moc instead."; \
-             echo "*"; \
-             moc="/usr/bin/moc"; \
-           fi; \
+       @set -e; $(kecho) "  CHECK   qt"; \
+       if pkg-config --exists Qt5Core; then \
+           cflags="-std=c++11 -fPIC `pkg-config --cflags Qt5Core Qt5Gui Qt5Widgets`"; \
+           libs=`pkg-config --libs Qt5Core Qt5Gui Qt5Widgets`; \
+           moc=`pkg-config --variable=host_bins Qt5Core`/moc; \
+       elif pkg-config --exists QtCore; then \
+           cflags=`pkg-config --cflags QtCore QtGui`; \
+           libs=`pkg-config --libs QtCore QtGui`; \
+           moc=`pkg-config --variable=moc_location QtCore`; \
        else \
-         cflags="\$$(shell pkg-config QtCore QtGui Qt3Support --cflags)"; \
-         libs="\$$(shell pkg-config QtCore QtGui Qt3Support --libs)"; \
-         moc="\$$(shell pkg-config QtCore --variable=moc_location)"; \
-         [ -n "$$moc" ] || moc="\$$(shell pkg-config QtCore --variable=prefix)/bin/moc"; \
+           echo >&2 "*"; \
+           echo >&2 "* Could not find Qt via pkg-config."; \
+           echo >&2 "* Please install either Qt 4.8 or 5.x. and make sure it's in PKG_CONFIG_PATH"; \
+           echo >&2 "*"; \
+           exit 1; \
        fi; \
        echo "KC_QT_CFLAGS=$$cflags" > $@; \
        echo "KC_QT_LIBS=$$libs" >> $@; \
index 667d1aa237114453c28bafac618e9552405a19c4..cbf4996dd9c1045ecc7ffa66a9ec79edd99b1038 100644 (file)
@@ -1113,7 +1113,7 @@ void expr_print(struct expr *e, void (*fn)(void *, struct symbol *, const char *
                        fn(data, e->left.sym, e->left.sym->name);
                else
                        fn(data, NULL, "<choice>");
-               fn(data, NULL, e->type == E_LEQ ? ">=" : ">");
+               fn(data, NULL, e->type == E_GEQ ? ">=" : ">");
                fn(data, e->right.sym, e->right.sym->name);
                break;
        case E_UNEQUAL:
index 0d883b37882a145b588a45f53f3be373849e7410..67d1314476314590f285a63700c13e047dc17c80 100755 (executable)
@@ -32,7 +32,7 @@ usage() {
        echo "  -m    only merge the fragments, do not execute the make command"
        echo "  -n    use allnoconfig instead of alldefconfig"
        echo "  -r    list redundant entries when merging fragments"
-       echo "  -O    dir to put generated output files"
+       echo "  -O    dir to put generated output files.  Consider setting \$KCONFIG_CONFIG instead."
 }
 
 RUNMAKE=true
@@ -77,11 +77,19 @@ while true; do
        esac
 done
 
-if [ "$#" -lt 2 ] ; then
+if [ "$#" -lt 1 ] ; then
        usage
        exit
 fi
 
+if [ -z "$KCONFIG_CONFIG" ]; then
+       if [ "$OUTPUT" != . ]; then
+               KCONFIG_CONFIG=$(readlink -m -- "$OUTPUT/.config")
+       else
+               KCONFIG_CONFIG=.config
+       fi
+fi
+
 INITFILE=$1
 shift;
 
@@ -124,9 +132,9 @@ for MERGE_FILE in $MERGE_LIST ; do
 done
 
 if [ "$RUNMAKE" = "false" ]; then
-       cp $TMP_FILE $OUTPUT/.config
+       cp -T -- "$TMP_FILE" "$KCONFIG_CONFIG"
        echo "#"
-       echo "# merged configuration written to $OUTPUT/.config (needs make)"
+       echo "# merged configuration written to $KCONFIG_CONFIG (needs make)"
        echo "#"
        clean_up
        exit
@@ -150,7 +158,7 @@ make KCONFIG_ALLCONFIG=$TMP_FILE $OUTPUT_ARG $ALLTARGET
 for CFG in $(sed -n "$SED_CONFIG_EXP" $TMP_FILE); do
 
        REQUESTED_VAL=$(grep -w -e "$CFG" $TMP_FILE)
-       ACTUAL_VAL=$(grep -w -e "$CFG" $OUTPUT/.config)
+       ACTUAL_VAL=$(grep -w -e "$CFG" "$KCONFIG_CONFIG")
        if [ "x$REQUESTED_VAL" != "x$ACTUAL_VAL" ] ; then
                echo "Value requested for $CFG not in final .config"
                echo "Requested value:  $REQUESTED_VAL"
index c3bb7fe8dfa68322bff34481b3de72b9ad2b2b3f..91b7e6fbc364ae53846130eb2a82517c422eb5d4 100644 (file)
@@ -1,32 +1,17 @@
 /*
  * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>
+ * Copyright (C) 2015 Boris Barbulovski <bbarbulovski@gmail.com>
  * Released under the terms of the GNU GPL v2.0.
  */
 
 #include <qglobal.h>
 
-#if QT_VERSION < 0x040000
-#include <stddef.h>
-#include <qmainwindow.h>
-#include <qvbox.h>
-#include <qvaluelist.h>
+#include <QMainWindow>
+#include <QList>
 #include <qtextbrowser.h>
-#include <qaction.h>
-#include <qheader.h>
-#include <qfiledialog.h>
-#include <qdragobject.h>
-#include <qpopupmenu.h>
-#else
-#include <q3mainwindow.h>
-#include <q3vbox.h>
-#include <q3valuelist.h>
-#include <q3textbrowser.h>
-#include <q3action.h>
-#include <q3header.h>
-#include <q3filedialog.h>
-#include <q3dragobject.h>
-#include <q3popupmenu.h>
-#endif
+#include <QAction>
+#include <QFileDialog>
+#include <QMenu>
 
 #include <qapplication.h>
 #include <qdesktopwidget.h>
@@ -57,7 +42,7 @@
 static QApplication *configApp;
 static ConfigSettings *configSettings;
 
-Q3Action *ConfigMainWindow::saveAction;
+QAction *ConfigMainWindow::saveAction;
 
 static inline QString qgettext(const char* str)
 {
@@ -66,7 +51,7 @@ static inline QString qgettext(const char* str)
 
 static inline QString qgettext(const QString& str)
 {
-       return QString::fromLocal8Bit(gettext(str.latin1()));
+       return QString::fromLocal8Bit(gettext(str.toLatin1()));
 }
 
 ConfigSettings::ConfigSettings()
@@ -77,10 +62,10 @@ ConfigSettings::ConfigSettings()
 /**
  * Reads a list of integer values from the application settings.
  */
-Q3ValueList<int> ConfigSettings::readSizes(const QString& key, bool *ok)
+QList<int> ConfigSettings::readSizes(const QString& key, bool *ok)
 {
-       Q3ValueList<int> result;
-       QStringList entryList = readListEntry(key, ok);
+       QList<int> result;
+       QStringList entryList = value(key).toStringList();
        QStringList::Iterator it;
 
        for (it = entryList.begin(); it != entryList.end(); ++it)
@@ -92,14 +77,16 @@ Q3ValueList<int> ConfigSettings::readSizes(const QString& key, bool *ok)
 /**
  * Writes a list of integer values to the application settings.
  */
-bool ConfigSettings::writeSizes(const QString& key, const Q3ValueList<int>& value)
+bool ConfigSettings::writeSizes(const QString& key, const QList<int>& value)
 {
        QStringList stringList;
-       Q3ValueList<int>::ConstIterator it;
+       QList<int>::ConstIterator it;
 
        for (it = value.begin(); it != value.end(); ++it)
                stringList.push_back(QString::number(*it));
-       return writeEntry(key, stringList);
+       setValue(key, stringList);
+
+       return true;
 }
 
 
@@ -109,9 +96,6 @@ bool ConfigSettings::writeSizes(const QString& key, const Q3ValueList<int>& valu
  */
 void ConfigItem::okRename(int col)
 {
-       Parent::okRename(col);
-       sym_set_string_value(menu->sym, text(dataColIdx).latin1());
-       listView()->updateList(this);
 }
 
 /*
@@ -149,11 +133,11 @@ void ConfigItem::updateMenu(void)
                } else {
                        if (sym)
                                break;
-                       setPixmap(promptColIdx, 0);
+                       setPixmap(promptColIdx, QIcon());
                }
                goto set_prompt;
        case P_COMMENT:
-               setPixmap(promptColIdx, 0);
+               setPixmap(promptColIdx, QIcon());
                goto set_prompt;
        default:
                ;
@@ -170,7 +154,7 @@ void ConfigItem::updateMenu(void)
                char ch;
 
                if (!sym_is_changable(sym) && list->optMode == normalOpt) {
-                       setPixmap(promptColIdx, 0);
+                       setPixmap(promptColIdx, QIcon());
                        setText(noColIdx, QString::null);
                        setText(modColIdx, QString::null);
                        setText(yesColIdx, QString::null);
@@ -216,9 +200,6 @@ void ConfigItem::updateMenu(void)
 
                data = sym_get_string_value(sym);
 
-               int i = list->mapIdx(dataColIdx);
-               if (i >= 0)
-                       setRenameEnabled(i, TRUE);
                setText(dataColIdx, data);
                if (type == S_STRING)
                        prompt = QString("%1: %2").arg(prompt).arg(data);
@@ -250,18 +231,6 @@ void ConfigItem::testUpdateMenu(bool v)
                updateMenu();
 }
 
-void ConfigItem::paintCell(QPainter* p, const QColorGroup& cg, int column, int width, int align)
-{
-       ConfigList* list = listView();
-
-       if (visible) {
-               if (isSelected() && !list->hasFocus() && list->mode == menuMode)
-                       Parent::paintCell(p, list->inactivedColorGroup, column, width, align);
-               else
-                       Parent::paintCell(p, cg, column, width, align);
-       } else
-               Parent::paintCell(p, list->disabledColorGroup, column, width, align);
-}
 
 /*
  * construct a menu entry
@@ -274,7 +243,7 @@ void ConfigItem::init(void)
                menu->data = this;
 
                if (list->mode != fullMode)
-                       setOpen(TRUE);
+                       setExpanded(true);
                sym_calc_value(menu->sym);
        }
        updateMenu();
@@ -299,7 +268,7 @@ ConfigItem::~ConfigItem(void)
 ConfigLineEdit::ConfigLineEdit(ConfigView* parent)
        : Parent(parent)
 {
-       connect(this, SIGNAL(lostFocus()), SLOT(hide()));
+       connect(this, SIGNAL(editingFinished()), SLOT(hide()));
 }
 
 void ConfigLineEdit::show(ConfigItem* i)
@@ -320,7 +289,7 @@ void ConfigLineEdit::keyPressEvent(QKeyEvent* e)
                break;
        case Qt::Key_Return:
        case Qt::Key_Enter:
-               sym_set_string_value(item->menu->sym, text().latin1());
+               sym_set_string_value(item->menu->sym, text().toLatin1());
                parent()->updateList(item);
                break;
        default:
@@ -333,39 +302,39 @@ void ConfigLineEdit::keyPressEvent(QKeyEvent* e)
 }
 
 ConfigList::ConfigList(ConfigView* p, const char *name)
-       : Parent(p, name),
+       : Parent(p),
          updateAll(false),
          symbolYesPix(xpm_symbol_yes), symbolModPix(xpm_symbol_mod), symbolNoPix(xpm_symbol_no),
          choiceYesPix(xpm_choice_yes), choiceNoPix(xpm_choice_no),
          menuPix(xpm_menu), menuInvPix(xpm_menu_inv), menuBackPix(xpm_menuback), voidPix(xpm_void),
-         showName(false), showRange(false), showData(false), optMode(normalOpt),
+         showName(false), showRange(false), showData(false), mode(singleMode), optMode(normalOpt),
          rootEntry(0), headerPopup(0)
 {
        int i;
 
-       setSorting(-1);
-       setRootIsDecorated(TRUE);
-       disabledColorGroup = palette().active();
-       disabledColorGroup.setColor(QColorGroup::Text, palette().disabled().text());
-       inactivedColorGroup = palette().active();
-       inactivedColorGroup.setColor(QColorGroup::Highlight, palette().disabled().highlight());
+       setObjectName(name);
+       setSortingEnabled(false);
+       setRootIsDecorated(true);
+
+       setVerticalScrollMode(ScrollPerPixel);
+       setHorizontalScrollMode(ScrollPerPixel);
+
+       setHeaderLabels(QStringList() << _("Option") << _("Name") << "N" << "M" << "Y" << _("Value"));
 
-       connect(this, SIGNAL(selectionChanged(void)),
+       connect(this, SIGNAL(itemSelectionChanged(void)),
                SLOT(updateSelection(void)));
 
        if (name) {
                configSettings->beginGroup(name);
-               showName = configSettings->readBoolEntry("/showName", false);
-               showRange = configSettings->readBoolEntry("/showRange", false);
-               showData = configSettings->readBoolEntry("/showData", false);
-               optMode = (enum optionMode)configSettings->readNumEntry("/optionMode", false);
+               showName = configSettings->value("/showName", false).toBool();
+               showRange = configSettings->value("/showRange", false).toBool();
+               showData = configSettings->value("/showData", false).toBool();
+               optMode = (enum optionMode)configSettings->value("/optionMode", 0).toInt();
                configSettings->endGroup();
                connect(configApp, SIGNAL(aboutToQuit()), SLOT(saveSettings()));
        }
 
-       for (i = 0; i < colNr; i++)
-               colMap[i] = colRevMap[i] = -1;
-       addColumn(promptColIdx, _("Option"));
+       addColumn(promptColIdx);
 
        reinit();
 }
@@ -390,26 +359,26 @@ void ConfigList::reinit(void)
        removeColumn(nameColIdx);
 
        if (showName)
-               addColumn(nameColIdx, _("Name"));
+               addColumn(nameColIdx);
        if (showRange) {
-               addColumn(noColIdx, "N");
-               addColumn(modColIdx, "M");
-               addColumn(yesColIdx, "Y");
+               addColumn(noColIdx);
+               addColumn(modColIdx);
+               addColumn(yesColIdx);
        }
        if (showData)
-               addColumn(dataColIdx, _("Value"));
+               addColumn(dataColIdx);
 
        updateListAll();
 }
 
 void ConfigList::saveSettings(void)
 {
-       if (name()) {
-               configSettings->beginGroup(name());
-               configSettings->writeEntry("/showName", showName);
-               configSettings->writeEntry("/showRange", showRange);
-               configSettings->writeEntry("/showData", showData);
-               configSettings->writeEntry("/optionMode", (int)optMode);
+       if (!objectName().isEmpty()) {
+               configSettings->beginGroup(objectName());
+               configSettings->setValue("/showName", showName);
+               configSettings->setValue("/showRange", showRange);
+               configSettings->setValue("/showData", showData);
+               configSettings->setValue("/optionMode", (int)optMode);
                configSettings->endGroup();
        }
 }
@@ -431,7 +400,10 @@ void ConfigList::updateSelection(void)
        struct menu *menu;
        enum prop_type type;
 
-       ConfigItem* item = (ConfigItem*)selectedItem();
+       if (selectedItems().count() == 0)
+               return;
+
+       ConfigItem* item = (ConfigItem*)selectedItems().first();
        if (!item)
                return;
 
@@ -451,21 +423,23 @@ void ConfigList::updateList(ConfigItem* item)
        if (!rootEntry) {
                if (mode != listMode)
                        goto update;
-               Q3ListViewItemIterator it(this);
+               QTreeWidgetItemIterator it(this);
                ConfigItem* item;
 
-               for (; it.current(); ++it) {
-                       item = (ConfigItem*)it.current();
+               while (*it) {
+                       item = (ConfigItem*)(*it);
                        if (!item->menu)
                                continue;
                        item->testUpdateMenu(menu_is_visible(item->menu));
+
+                       ++it;
                }
                return;
        }
 
        if (rootEntry != &rootmenu && (mode == singleMode ||
            (mode == symbolMode && rootEntry->parent != &rootmenu))) {
-               item = firstChild();
+               item = (ConfigItem *)topLevelItem(0);
                if (!item)
                        item = new ConfigItem(this, 0, true);
                last = item;
@@ -479,12 +453,14 @@ void ConfigList::updateList(ConfigItem* item)
                        item->testUpdateMenu(true);
 
                updateMenuList(item, rootEntry);
-               triggerUpdate();
+               update();
+               resizeColumnToContents(0);
                return;
        }
 update:
        updateMenuList(this, rootEntry);
-       triggerUpdate();
+       update();
+       resizeColumnToContents(0);
 }
 
 void ConfigList::setValue(ConfigItem* item, tristate val)
@@ -506,7 +482,7 @@ void ConfigList::setValue(ConfigItem* item, tristate val)
                if (!sym_set_tristate_value(sym, val))
                        return;
                if (oldval == no && item->menu->list)
-                       item->setOpen(TRUE);
+                       item->setExpanded(true);
                parent()->updateList(item);
                break;
        }
@@ -524,7 +500,7 @@ void ConfigList::changeValue(ConfigItem* item)
        sym = menu->sym;
        if (!sym) {
                if (item->menu->list)
-                       item->setOpen(!item->isOpen());
+                       item->setExpanded(!item->isExpanded());
                return;
        }
 
@@ -536,9 +512,9 @@ void ConfigList::changeValue(ConfigItem* item)
                newexpr = sym_toggle_tristate_value(sym);
                if (item->menu->list) {
                        if (oldexpr == newexpr)
-                               item->setOpen(!item->isOpen());
+                               item->setExpanded(!item->isExpanded());
                        else if (oldexpr == no)
-                               item->setOpen(TRUE);
+                               item->setExpanded(true);
                }
                if (oldexpr != newexpr)
                        parent()->updateList(item);
@@ -546,10 +522,7 @@ void ConfigList::changeValue(ConfigItem* item)
        case S_INT:
        case S_HEX:
        case S_STRING:
-               if (colMap[dataColIdx] >= 0)
-                       item->startRename(colMap[dataColIdx]);
-               else
-                       parent()->lineEdit->show(item);
+               parent()->lineEdit->show(item);
                break;
        }
 }
@@ -566,8 +539,10 @@ void ConfigList::setRootMenu(struct menu *menu)
        updateMenuList(this, 0);
        rootEntry = menu;
        updateListAll();
-       setSelected(currentItem(), hasFocus());
-       ensureItemVisible(currentItem());
+       if (currentItem()) {
+               currentItem()->setSelected(hasFocus());
+               scrollToItem(currentItem());
+       }
 }
 
 void ConfigList::setParentMenu(void)
@@ -580,13 +555,16 @@ void ConfigList::setParentMenu(void)
                return;
        setRootMenu(menu_get_parent_menu(rootEntry->parent));
 
-       Q3ListViewItemIterator it(this);
-       for (; (item = (ConfigItem*)it.current()); it++) {
+       QTreeWidgetItemIterator it(this);
+       while (*it) {
+               item = (ConfigItem *)(*it);
                if (item->menu == oldroot) {
                        setCurrentItem(item);
-                       ensureItemVisible(item);
+                       scrollToItem(item);
                        break;
                }
+
+               ++it;
        }
 }
 
@@ -597,8 +575,7 @@ void ConfigList::setParentMenu(void)
  * parent: either the menu list widget or a menu entry widget
  * menu: entry to be updated
  */
-template <class P>
-void ConfigList::updateMenuList(P* parent, struct menu* menu)
+void ConfigList::updateMenuList(ConfigItem *parent, struct menu* menu)
 {
        struct menu* child;
        ConfigItem* item;
@@ -607,8 +584,11 @@ void ConfigList::updateMenuList(P* parent, struct menu* menu)
        enum prop_type type;
 
        if (!menu) {
-               while ((item = parent->firstChild()))
-                       delete item;
+               while (parent->childCount() > 0)
+               {
+                       delete parent->takeChild(0);
+               }
+
                return;
        }
 
@@ -660,9 +640,74 @@ void ConfigList::updateMenuList(P* parent, struct menu* menu)
        }
 }
 
+void ConfigList::updateMenuList(ConfigList *parent, struct menu* menu)
+{
+       struct menu* child;
+       ConfigItem* item;
+       ConfigItem* last;
+       bool visible;
+       enum prop_type type;
+
+       if (!menu) {
+               while (parent->topLevelItemCount() > 0)
+               {
+                       delete parent->takeTopLevelItem(0);
+               }
+
+               return;
+       }
+
+       last = (ConfigItem*)parent->topLevelItem(0);
+       if (last && !last->goParent)
+               last = 0;
+       for (child = menu->list; child; child = child->next) {
+               item = last ? last->nextSibling() : (ConfigItem*)parent->topLevelItem(0);
+               type = child->prompt ? child->prompt->type : P_UNKNOWN;
+
+               switch (mode) {
+               case menuMode:
+                       if (!(child->flags & MENU_ROOT))
+                               goto hide;
+                       break;
+               case symbolMode:
+                       if (child->flags & MENU_ROOT)
+                               goto hide;
+                       break;
+               default:
+                       break;
+               }
+
+               visible = menu_is_visible(child);
+               if (!menuSkip(child)) {
+                       if (!child->sym && !child->list && !child->prompt)
+                               continue;
+                       if (!item || item->menu != child)
+                               item = new ConfigItem(parent, last, child, visible);
+                       else
+                               item->testUpdateMenu(visible);
+
+                       if (mode == fullMode || mode == menuMode || type != P_MENU)
+                               updateMenuList(item, child);
+                       else
+                               updateMenuList(item, 0);
+                       last = item;
+                       continue;
+               }
+       hide:
+               if (item && item->menu == child) {
+                       last = (ConfigItem*)parent->topLevelItem(0);
+                       if (last == item)
+                               last = 0;
+                       else while (last->nextSibling() != item)
+                               last = last->nextSibling();
+                       delete item;
+               }
+       }
+}
+
 void ConfigList::keyPressEvent(QKeyEvent* ev)
 {
-       Q3ListViewItem* i = currentItem();
+       QTreeWidgetItem* i = currentItem();
        ConfigItem* item;
        struct menu *menu;
        enum prop_type type;
@@ -714,20 +759,20 @@ void ConfigList::keyPressEvent(QKeyEvent* ev)
        ev->accept();
 }
 
-void ConfigList::contentsMousePressEvent(QMouseEvent* e)
+void ConfigList::mousePressEvent(QMouseEvent* e)
 {
        //QPoint p(contentsToViewport(e->pos()));
        //printf("contentsMousePressEvent: %d,%d\n", p.x(), p.y());
-       Parent::contentsMousePressEvent(e);
+       Parent::mousePressEvent(e);
 }
 
-void ConfigList::contentsMouseReleaseEvent(QMouseEvent* e)
+void ConfigList::mouseReleaseEvent(QMouseEvent* e)
 {
-       QPoint p(contentsToViewport(e->pos()));
+       QPoint p = e->pos();
        ConfigItem* item = (ConfigItem*)itemAt(p);
        struct menu *menu;
        enum prop_type ptype;
-       const QPixmap* pm;
+       QIcon icon;
        int idx, x;
 
        if (!item)
@@ -735,14 +780,13 @@ void ConfigList::contentsMouseReleaseEvent(QMouseEvent* e)
 
        menu = item->menu;
        x = header()->offset() + p.x();
-       idx = colRevMap[header()->sectionAt(x)];
+       idx = header()->logicalIndexAt(x);
        switch (idx) {
        case promptColIdx:
-               pm = item->pixmap(promptColIdx);
-               if (pm) {
-                       int off = header()->sectionPos(0) + itemMargin() +
-                               treeStepSize() * (item->depth() + (rootIsDecorated() ? 1 : 0));
-                       if (x >= off && x < off + pm->width()) {
+               icon = item->pixmap(promptColIdx);
+               if (!icon.isNull()) {
+                       int off = header()->sectionPosition(0) + visualRect(indexAt(p)).x() + 4; // 4 is Hardcoded image offset. There might be a way to do it properly.
+                       if (x >= off && x < off + icon.availableSizes().first().width()) {
                                if (item->goParent) {
                                        emit parentSelected();
                                        break;
@@ -773,19 +817,19 @@ void ConfigList::contentsMouseReleaseEvent(QMouseEvent* e)
 
 skip:
        //printf("contentsMouseReleaseEvent: %d,%d\n", p.x(), p.y());
-       Parent::contentsMouseReleaseEvent(e);
+       Parent::mouseReleaseEvent(e);
 }
 
-void ConfigList::contentsMouseMoveEvent(QMouseEvent* e)
+void ConfigList::mouseMoveEvent(QMouseEvent* e)
 {
        //QPoint p(contentsToViewport(e->pos()));
        //printf("contentsMouseMoveEvent: %d,%d\n", p.x(), p.y());
-       Parent::contentsMouseMoveEvent(e);
+       Parent::mouseMoveEvent(e);
 }
 
-void ConfigList::contentsMouseDoubleClickEvent(QMouseEvent* e)
+void ConfigList::mouseDoubleClickEvent(QMouseEvent* e)
 {
-       QPoint p(contentsToViewport(e->pos()));
+       QPoint p = e->pos(); // TODO: Check if this works(was contentsToViewport).
        ConfigItem* item = (ConfigItem*)itemAt(p);
        struct menu *menu;
        enum prop_type ptype;
@@ -807,7 +851,7 @@ void ConfigList::contentsMouseDoubleClickEvent(QMouseEvent* e)
 
 skip:
        //printf("contentsMouseDoubleClickEvent: %d,%d\n", p.x(), p.y());
-       Parent::contentsMouseDoubleClickEvent(e);
+       Parent::mouseDoubleClickEvent(e);
 }
 
 void ConfigList::focusInEvent(QFocusEvent *e)
@@ -818,7 +862,7 @@ void ConfigList::focusInEvent(QFocusEvent *e)
 
        ConfigItem* item = (ConfigItem *)currentItem();
        if (item) {
-               setSelected(item, TRUE);
+               item->setSelected(true);
                menu = item->menu;
        }
        emit gotFocus(menu);
@@ -828,33 +872,33 @@ void ConfigList::contextMenuEvent(QContextMenuEvent *e)
 {
        if (e->y() <= header()->geometry().bottom()) {
                if (!headerPopup) {
-                       Q3Action *action;
+                       QAction *action;
 
-                       headerPopup = new Q3PopupMenu(this);
-                       action = new Q3Action(NULL, _("Show Name"), 0, this);
-                         action->setToggleAction(TRUE);
+                       headerPopup = new QMenu(this);
+                       action = new QAction(_("Show Name"), this);
+                         action->setCheckable(true);
                          connect(action, SIGNAL(toggled(bool)),
                                  parent(), SLOT(setShowName(bool)));
                          connect(parent(), SIGNAL(showNameChanged(bool)),
                                  action, SLOT(setOn(bool)));
-                         action->setOn(showName);
-                         action->addTo(headerPopup);
-                       action = new Q3Action(NULL, _("Show Range"), 0, this);
-                         action->setToggleAction(TRUE);
+                         action->setChecked(showName);
+                         headerPopup->addAction(action);
+                       action = new QAction(_("Show Range"), this);
+                         action->setCheckable(true);
                          connect(action, SIGNAL(toggled(bool)),
                                  parent(), SLOT(setShowRange(bool)));
                          connect(parent(), SIGNAL(showRangeChanged(bool)),
                                  action, SLOT(setOn(bool)));
-                         action->setOn(showRange);
-                         action->addTo(headerPopup);
-                       action = new Q3Action(NULL, _("Show Data"), 0, this);
-                         action->setToggleAction(TRUE);
+                         action->setChecked(showRange);
+                         headerPopup->addAction(action);
+                       action = new QAction(_("Show Data"), this);
+                         action->setCheckable(true);
                          connect(action, SIGNAL(toggled(bool)),
                                  parent(), SLOT(setShowData(bool)));
                          connect(parent(), SIGNAL(showDataChanged(bool)),
                                  action, SLOT(setOn(bool)));
-                         action->setOn(showData);
-                         action->addTo(headerPopup);
+                         action->setChecked(showData);
+                         headerPopup->addAction(action);
                }
                headerPopup->exec(e->globalPos());
                e->accept();
@@ -868,11 +912,17 @@ QAction *ConfigView::showAllAction;
 QAction *ConfigView::showPromptAction;
 
 ConfigView::ConfigView(QWidget* parent, const char *name)
-       : Parent(parent, name)
+       : Parent(parent)
 {
-       list = new ConfigList(this, name);
+       setObjectName(name);
+       QVBoxLayout *verticalLayout = new QVBoxLayout(this);
+       verticalLayout->setContentsMargins(0, 0, 0, 0);
+
+       list = new ConfigList(this);
+       verticalLayout->addWidget(list);
        lineEdit = new ConfigLineEdit(this);
        lineEdit->hide();
+       verticalLayout->addWidget(lineEdit);
 
        this->nextView = viewList;
        viewList = this;
@@ -931,10 +981,13 @@ void ConfigView::setShowData(bool b)
 
 void ConfigList::setAllOpen(bool open)
 {
-       Q3ListViewItemIterator it(this);
+       QTreeWidgetItemIterator it(this);
+
+       while (*it) {
+               (*it)->setExpanded(open);
 
-       for (; it.current(); it++)
-               it.current()->setOpen(open);
+               ++it;
+       }
 }
 
 void ConfigView::updateList(ConfigItem* item)
@@ -954,11 +1007,14 @@ void ConfigView::updateListAll(void)
 }
 
 ConfigInfoView::ConfigInfoView(QWidget* parent, const char *name)
-       : Parent(parent, name), sym(0), _menu(0)
+       : Parent(parent), sym(0), _menu(0)
 {
-       if (name) {
-               configSettings->beginGroup(name);
-               _showDebug = configSettings->readBoolEntry("/showDebug", false);
+       setObjectName(name);
+
+
+       if (!objectName().isEmpty()) {
+               configSettings->beginGroup(objectName());
+               _showDebug = configSettings->value("/showDebug", false).toBool();
                configSettings->endGroup();
                connect(configApp, SIGNAL(aboutToQuit()), SLOT(saveSettings()));
        }
@@ -966,9 +1022,9 @@ ConfigInfoView::ConfigInfoView(QWidget* parent, const char *name)
 
 void ConfigInfoView::saveSettings(void)
 {
-       if (name()) {
-               configSettings->beginGroup(name());
-               configSettings->writeEntry("/showDebug", showDebug());
+       if (!objectName().isEmpty()) {
+               configSettings->beginGroup(objectName());
+               configSettings->setValue("/showDebug", showDebug());
                configSettings->endGroup();
        }
 }
@@ -1127,8 +1183,8 @@ QString ConfigInfoView::print_filter(const QString &str)
 {
        QRegExp re("[<>&\"\\n]");
        QString res = str;
-       for (int i = 0; (i = res.find(re, i)) >= 0;) {
-               switch (res[i].latin1()) {
+       for (int i = 0; (i = res.indexOf(re, i)) >= 0;) {
+               switch (res[i].toLatin1()) {
                case '<':
                        res.replace(i, 1, "&lt;");
                        i += 4;
@@ -1167,37 +1223,42 @@ void ConfigInfoView::expr_print_help(void *data, struct symbol *sym, const char
                *text += str2;
 }
 
-Q3PopupMenu* ConfigInfoView::createPopupMenu(const QPoint& pos)
+QMenu* ConfigInfoView::createStandardContextMenu(const QPoint & pos)
 {
-       Q3PopupMenu* popup = Parent::createPopupMenu(pos);
-       Q3Action* action = new Q3Action(NULL, _("Show Debug Info"), 0, popup);
-         action->setToggleAction(TRUE);
+       QMenu* popup = Parent::createStandardContextMenu(pos);
+       QAction* action = new QAction(_("Show Debug Info"), popup);
+         action->setCheckable(true);
          connect(action, SIGNAL(toggled(bool)), SLOT(setShowDebug(bool)));
          connect(this, SIGNAL(showDebugChanged(bool)), action, SLOT(setOn(bool)));
-         action->setOn(showDebug());
-       popup->insertSeparator();
-       action->addTo(popup);
+         action->setChecked(showDebug());
+       popup->addSeparator();
+       popup->addAction(action);
        return popup;
 }
 
-void ConfigInfoView::contentsContextMenuEvent(QContextMenuEvent *e)
+void ConfigInfoView::contextMenuEvent(QContextMenuEvent *e)
 {
-       Parent::contentsContextMenuEvent(e);
+       Parent::contextMenuEvent(e);
 }
 
 ConfigSearchWindow::ConfigSearchWindow(ConfigMainWindow* parent, const char *name)
-       : Parent(parent, name), result(NULL)
+       : Parent(parent), result(NULL)
 {
-       setCaption("Search Config");
+       setObjectName(name);
+       setWindowTitle("Search Config");
 
-       QVBoxLayout* layout1 = new QVBoxLayout(this, 11, 6);
-       QHBoxLayout* layout2 = new QHBoxLayout(0, 0, 6);
+       QVBoxLayout* layout1 = new QVBoxLayout(this);
+       layout1->setContentsMargins(11, 11, 11, 11);
+       layout1->setSpacing(6);
+       QHBoxLayout* layout2 = new QHBoxLayout(0);
+       layout2->setContentsMargins(0, 0, 0, 0);
+       layout2->setSpacing(6);
        layout2->addWidget(new QLabel(_("Find:"), this));
        editField = new QLineEdit(this);
        connect(editField, SIGNAL(returnPressed()), SLOT(search()));
        layout2->addWidget(editField);
        searchButton = new QPushButton(_("Search"), this);
-       searchButton->setAutoDefault(FALSE);
+       searchButton->setAutoDefault(false);
        connect(searchButton, SIGNAL(clicked()), SLOT(search()));
        layout2->addWidget(searchButton);
        layout1->addLayout(layout2);
@@ -1215,19 +1276,19 @@ ConfigSearchWindow::ConfigSearchWindow(ConfigMainWindow* parent, const char *nam
        layout1->addWidget(split);
 
        if (name) {
-               int x, y, width, height;
+               QVariant x, y;
+               int width, height;
                bool ok;
 
                configSettings->beginGroup(name);
-               width = configSettings->readNumEntry("/window width", parent->width() / 2);
-               height = configSettings->readNumEntry("/window height", parent->height() / 2);
+               width = configSettings->value("/window width", parent->width() / 2).toInt();
+               height = configSettings->value("/window height", parent->height() / 2).toInt();
                resize(width, height);
-               x = configSettings->readNumEntry("/window x", 0, &ok);
-               if (ok)
-                       y = configSettings->readNumEntry("/window y", 0, &ok);
-               if (ok)
-                       move(x, y);
-               Q3ValueList<int> sizes = configSettings->readSizes("/split", &ok);
+               x = configSettings->value("/window x");
+               y = configSettings->value("/window y");
+               if ((x.isValid())&&(y.isValid()))
+                       move(x.toInt(), y.toInt());
+               QList<int> sizes = configSettings->readSizes("/split", &ok);
                if (ok)
                        split->setSizes(sizes);
                configSettings->endGroup();
@@ -1237,12 +1298,12 @@ ConfigSearchWindow::ConfigSearchWindow(ConfigMainWindow* parent, const char *nam
 
 void ConfigSearchWindow::saveSettings(void)
 {
-       if (name()) {
-               configSettings->beginGroup(name());
-               configSettings->writeEntry("/window x", pos().x());
-               configSettings->writeEntry("/window y", pos().y());
-               configSettings->writeEntry("/window width", size().width());
-               configSettings->writeEntry("/window height", size().height());
+       if (!objectName().isEmpty()) {
+               configSettings->beginGroup(objectName());
+               configSettings->setValue("/window x", pos().x());
+               configSettings->setValue("/window y", pos().y());
+               configSettings->setValue("/window width", size().width());
+               configSettings->setValue("/window height", size().height());
                configSettings->writeSizes("/split", split->sizes());
                configSettings->endGroup();
        }
@@ -1258,7 +1319,7 @@ void ConfigSearchWindow::search(void)
        list->list->clear();
        info->clear();
 
-       result = sym_re_search(editField->text().latin1());
+       result = sym_re_search(editField->text().toLatin1());
        if (!result)
                return;
        for (p = result; *p; p++) {
@@ -1275,29 +1336,25 @@ ConfigMainWindow::ConfigMainWindow(void)
        : searchWindow(0)
 {
        QMenuBar* menu;
-       bool ok;
-       int x, y, width, height;
+       bool ok = true;
+       QVariant x, y;
+       int width, height;
        char title[256];
 
        QDesktopWidget *d = configApp->desktop();
        snprintf(title, sizeof(title), "%s%s",
                rootmenu.prompt->text,
-#if QT_VERSION < 0x040000
-               " (Qt3)"
-#else
                ""
-#endif
                );
-       setCaption(title);
+       setWindowTitle(title);
 
-       width = configSettings->readNumEntry("/window width", d->width() - 64);
-       height = configSettings->readNumEntry("/window height", d->height() - 64);
+       width = configSettings->value("/window width", d->width() - 64).toInt();
+       height = configSettings->value("/window height", d->height() - 64).toInt();
        resize(width, height);
-       x = configSettings->readNumEntry("/window x", 0, &ok);
-       if (ok)
-               y = configSettings->readNumEntry("/window y", 0, &ok);
-       if (ok)
-               move(x, y);
+       x = configSettings->value("/window x");
+       y = configSettings->value("/window y");
+       if ((x.isValid())&&(y.isValid()))
+               move(x.toInt(), y.toInt());
 
        split1 = new QSplitter(this);
        split1->setOrientation(Qt::Horizontal);
@@ -1314,127 +1371,115 @@ ConfigMainWindow::ConfigMainWindow(void)
        configList = configView->list;
 
        helpText = new ConfigInfoView(split2, "help");
-       helpText->setTextFormat(Qt::RichText);
 
        setTabOrder(configList, helpText);
        configList->setFocus();
 
        menu = menuBar();
-       toolBar = new Q3ToolBar("Tools", this);
-
-       backAction = new Q3Action("Back", QPixmap(xpm_back), _("Back"), 0, this);
-         connect(backAction, SIGNAL(activated()), SLOT(goBack()));
-         backAction->setEnabled(FALSE);
-       Q3Action *quitAction = new Q3Action("Quit", _("&Quit"), Qt::CTRL + Qt::Key_Q, this);
-         connect(quitAction, SIGNAL(activated()), SLOT(close()));
-       Q3Action *loadAction = new Q3Action("Load", QPixmap(xpm_load), _("&Load"), Qt::CTRL + Qt::Key_L, this);
-         connect(loadAction, SIGNAL(activated()), SLOT(loadConfig()));
-       saveAction = new Q3Action("Save", QPixmap(xpm_save), _("&Save"), Qt::CTRL + Qt::Key_S, this);
-         connect(saveAction, SIGNAL(activated()), SLOT(saveConfig()));
+       toolBar = new QToolBar("Tools", this);
+       addToolBar(toolBar);
+
+       backAction = new QAction(QPixmap(xpm_back), _("Back"), this);
+         connect(backAction, SIGNAL(triggered(bool)), SLOT(goBack()));
+         backAction->setEnabled(false);
+       QAction *quitAction = new QAction(_("&Quit"), this);
+       quitAction->setShortcut(Qt::CTRL + Qt::Key_Q);
+         connect(quitAction, SIGNAL(triggered(bool)), SLOT(close()));
+       QAction *loadAction = new QAction(QPixmap(xpm_load), _("&Load"), this);
+       loadAction->setShortcut(Qt::CTRL + Qt::Key_L);
+         connect(loadAction, SIGNAL(triggered(bool)), SLOT(loadConfig()));
+       saveAction = new QAction(QPixmap(xpm_save), _("&Save"), this);
+       saveAction->setShortcut(Qt::CTRL + Qt::Key_S);
+         connect(saveAction, SIGNAL(triggered(bool)), SLOT(saveConfig()));
        conf_set_changed_callback(conf_changed);
        // Set saveAction's initial state
        conf_changed();
-       Q3Action *saveAsAction = new Q3Action("Save As...", _("Save &As..."), 0, this);
-         connect(saveAsAction, SIGNAL(activated()), SLOT(saveConfigAs()));
-       Q3Action *searchAction = new Q3Action("Find", _("&Find"), Qt::CTRL + Qt::Key_F, this);
-         connect(searchAction, SIGNAL(activated()), SLOT(searchConfig()));
-       Q3Action *singleViewAction = new Q3Action("Single View", QPixmap(xpm_single_view), _("Single View"), 0, this);
-         connect(singleViewAction, SIGNAL(activated()), SLOT(showSingleView()));
-       Q3Action *splitViewAction = new Q3Action("Split View", QPixmap(xpm_split_view), _("Split View"), 0, this);
-         connect(splitViewAction, SIGNAL(activated()), SLOT(showSplitView()));
-       Q3Action *fullViewAction = new Q3Action("Full View", QPixmap(xpm_tree_view), _("Full View"), 0, this);
-         connect(fullViewAction, SIGNAL(activated()), SLOT(showFullView()));
-
-       Q3Action *showNameAction = new Q3Action(NULL, _("Show Name"), 0, this);
-         showNameAction->setToggleAction(TRUE);
+       QAction *saveAsAction = new QAction(_("Save &As..."), this);
+         connect(saveAsAction, SIGNAL(triggered(bool)), SLOT(saveConfigAs()));
+       QAction *searchAction = new QAction(_("&Find"), this);
+       searchAction->setShortcut(Qt::CTRL + Qt::Key_F);
+         connect(searchAction, SIGNAL(triggered(bool)), SLOT(searchConfig()));
+       singleViewAction = new QAction(QPixmap(xpm_single_view), _("Single View"), this);
+       singleViewAction->setCheckable(true);
+         connect(singleViewAction, SIGNAL(triggered(bool)), SLOT(showSingleView()));
+       splitViewAction = new QAction(QPixmap(xpm_split_view), _("Split View"), this);
+       splitViewAction->setCheckable(true);
+         connect(splitViewAction, SIGNAL(triggered(bool)), SLOT(showSplitView()));
+       fullViewAction = new QAction(QPixmap(xpm_tree_view), _("Full View"), this);
+       fullViewAction->setCheckable(true);
+         connect(fullViewAction, SIGNAL(triggered(bool)), SLOT(showFullView()));
+
+       QAction *showNameAction = new QAction(_("Show Name"), this);
+         showNameAction->setCheckable(true);
          connect(showNameAction, SIGNAL(toggled(bool)), configView, SLOT(setShowName(bool)));
-         connect(configView, SIGNAL(showNameChanged(bool)), showNameAction, SLOT(setOn(bool)));
-         showNameAction->setOn(configView->showName());
-       Q3Action *showRangeAction = new Q3Action(NULL, _("Show Range"), 0, this);
-         showRangeAction->setToggleAction(TRUE);
+         showNameAction->setChecked(configView->showName());
+       QAction *showRangeAction = new QAction(_("Show Range"), this);
+         showRangeAction->setCheckable(true);
          connect(showRangeAction, SIGNAL(toggled(bool)), configView, SLOT(setShowRange(bool)));
-         connect(configView, SIGNAL(showRangeChanged(bool)), showRangeAction, SLOT(setOn(bool)));
-         showRangeAction->setOn(configList->showRange);
-       Q3Action *showDataAction = new Q3Action(NULL, _("Show Data"), 0, this);
-         showDataAction->setToggleAction(TRUE);
+       QAction *showDataAction = new QAction(_("Show Data"), this);
+         showDataAction->setCheckable(true);
          connect(showDataAction, SIGNAL(toggled(bool)), configView, SLOT(setShowData(bool)));
-         connect(configView, SIGNAL(showDataChanged(bool)), showDataAction, SLOT(setOn(bool)));
-         showDataAction->setOn(configList->showData);
 
        QActionGroup *optGroup = new QActionGroup(this);
-       optGroup->setExclusive(TRUE);
-       connect(optGroup, SIGNAL(selected(QAction *)), configView,
+       optGroup->setExclusive(true);
+       connect(optGroup, SIGNAL(triggered(QAction*)), configView,
                SLOT(setOptionMode(QAction *)));
-       connect(optGroup, SIGNAL(selected(QAction *)), menuView,
+       connect(optGroup, SIGNAL(triggered(QAction *)), menuView,
                SLOT(setOptionMode(QAction *)));
 
-#if QT_VERSION >= 0x040000
        configView->showNormalAction = new QAction(_("Show Normal Options"), optGroup);
        configView->showAllAction = new QAction(_("Show All Options"), optGroup);
        configView->showPromptAction = new QAction(_("Show Prompt Options"), optGroup);
-#else
-       configView->showNormalAction = new QAction(_("Show Normal Options"), 0, optGroup);
-       configView->showAllAction = new QAction(_("Show All Options"), 0, optGroup);
-       configView->showPromptAction = new QAction(_("Show Prompt Options"), 0, optGroup);
-#endif
-       configView->showNormalAction->setToggleAction(TRUE);
-       configView->showNormalAction->setOn(configList->optMode == normalOpt);
-       configView->showAllAction->setToggleAction(TRUE);
-       configView->showAllAction->setOn(configList->optMode == allOpt);
-       configView->showPromptAction->setToggleAction(TRUE);
-       configView->showPromptAction->setOn(configList->optMode == promptOpt);
-
-       Q3Action *showDebugAction = new Q3Action(NULL, _("Show Debug Info"), 0, this);
-         showDebugAction->setToggleAction(TRUE);
+       configView->showNormalAction->setCheckable(true);
+       configView->showAllAction->setCheckable(true);
+       configView->showPromptAction->setCheckable(true);
+
+       QAction *showDebugAction = new QAction( _("Show Debug Info"), this);
+         showDebugAction->setCheckable(true);
          connect(showDebugAction, SIGNAL(toggled(bool)), helpText, SLOT(setShowDebug(bool)));
-         connect(helpText, SIGNAL(showDebugChanged(bool)), showDebugAction, SLOT(setOn(bool)));
-         showDebugAction->setOn(helpText->showDebug());
+         showDebugAction->setChecked(helpText->showDebug());
 
-       Q3Action *showIntroAction = new Q3Action(NULL, _("Introduction"), 0, this);
-         connect(showIntroAction, SIGNAL(activated()), SLOT(showIntro()));
-       Q3Action *showAboutAction = new Q3Action(NULL, _("About"), 0, this);
-         connect(showAboutAction, SIGNAL(activated()), SLOT(showAbout()));
+       QAction *showIntroAction = new QAction( _("Introduction"), this);
+         connect(showIntroAction, SIGNAL(triggered(bool)), SLOT(showIntro()));
+       QAction *showAboutAction = new QAction( _("About"), this);
+         connect(showAboutAction, SIGNAL(triggered(bool)), SLOT(showAbout()));
 
        // init tool bar
-       backAction->addTo(toolBar);
+       toolBar->addAction(backAction);
        toolBar->addSeparator();
-       loadAction->addTo(toolBar);
-       saveAction->addTo(toolBar);
+       toolBar->addAction(loadAction);
+       toolBar->addAction(saveAction);
        toolBar->addSeparator();
-       singleViewAction->addTo(toolBar);
-       splitViewAction->addTo(toolBar);
-       fullViewAction->addTo(toolBar);
+       toolBar->addAction(singleViewAction);
+       toolBar->addAction(splitViewAction);
+       toolBar->addAction(fullViewAction);
 
        // create config menu
-       Q3PopupMenu* config = new Q3PopupMenu(this);
-       menu->insertItem(_("&File"), config);
-       loadAction->addTo(config);
-       saveAction->addTo(config);
-       saveAsAction->addTo(config);
-       config->insertSeparator();
-       quitAction->addTo(config);
+       QMenu* config = menu->addMenu(_("&File"));
+       config->addAction(loadAction);
+       config->addAction(saveAction);
+       config->addAction(saveAsAction);
+       config->addSeparator();
+       config->addAction(quitAction);
 
        // create edit menu
-       Q3PopupMenu* editMenu = new Q3PopupMenu(this);
-       menu->insertItem(_("&Edit"), editMenu);
-       searchAction->addTo(editMenu);
+       QMenu* editMenu = menu->addMenu(_("&Edit"));
+       editMenu->addAction(searchAction);
 
        // create options menu
-       Q3PopupMenu* optionMenu = new Q3PopupMenu(this);
-       menu->insertItem(_("&Option"), optionMenu);
-       showNameAction->addTo(optionMenu);
-       showRangeAction->addTo(optionMenu);
-       showDataAction->addTo(optionMenu);
-       optionMenu->insertSeparator();
-       optGroup->addTo(optionMenu);
-       optionMenu->insertSeparator();
+       QMenu* optionMenu = menu->addMenu(_("&Option"));
+       optionMenu->addAction(showNameAction);
+       optionMenu->addAction(showRangeAction);
+       optionMenu->addAction(showDataAction);
+       optionMenu->addSeparator();
+       optionMenu->addActions(optGroup->actions());
+       optionMenu->addSeparator();
 
        // create help menu
-       Q3PopupMenu* helpMenu = new Q3PopupMenu(this);
-       menu->insertSeparator();
-       menu->insertItem(_("&Help"), helpMenu);
-       showIntroAction->addTo(helpMenu);
-       showAboutAction->addTo(helpMenu);
+       menu->addSeparator();
+       QMenu* helpMenu = menu->addMenu(_("&Help"));
+       helpMenu->addAction(showIntroAction);
+       helpMenu->addAction(showAboutAction);
 
        connect(configList, SIGNAL(menuChanged(struct menu *)),
                helpText, SLOT(setInfo(struct menu *)));
@@ -1456,7 +1501,7 @@ ConfigMainWindow::ConfigMainWindow(void)
        connect(helpText, SIGNAL(menuSelected(struct menu *)),
                SLOT(setMenuLink(struct menu *)));
 
-       QString listMode = configSettings->readEntry("/listMode", "symbol");
+       QString listMode = configSettings->value("/listMode", "symbol").toString();
        if (listMode == "single")
                showSingleView();
        else if (listMode == "full")
@@ -1465,7 +1510,7 @@ ConfigMainWindow::ConfigMainWindow(void)
                showSplitView();
 
        // UI setup done, restore splitter positions
-       Q3ValueList<int> sizes = configSettings->readSizes("/split1", &ok);
+       QList<int> sizes = configSettings->readSizes("/split1", &ok);
        if (ok)
                split1->setSizes(sizes);
 
@@ -1476,7 +1521,7 @@ ConfigMainWindow::ConfigMainWindow(void)
 
 void ConfigMainWindow::loadConfig(void)
 {
-       QString s = Q3FileDialog::getOpenFileName(conf_get_configname(), NULL, this);
+       QString s = QFileDialog::getOpenFileName(this, "", conf_get_configname());
        if (s.isNull())
                return;
        if (conf_read(QFile::encodeName(s)))
@@ -1495,7 +1540,7 @@ bool ConfigMainWindow::saveConfig(void)
 
 void ConfigMainWindow::saveConfigAs(void)
 {
-       QString s = Q3FileDialog::getSaveFileName(conf_get_configname(), NULL, this);
+       QString s = QFileDialog::getSaveFileName(this, "", conf_get_configname());
        if (s.isNull())
                return;
        saveConfig();
@@ -1512,9 +1557,9 @@ void ConfigMainWindow::changeMenu(struct menu *menu)
 {
        configList->setRootMenu(menu);
        if (configList->rootEntry->parent == &rootmenu)
-               backAction->setEnabled(FALSE);
+               backAction->setEnabled(false);
        else
-               backAction->setEnabled(TRUE);
+               backAction->setEnabled(true);
 }
 
 void ConfigMainWindow::setMenuLink(struct menu *menu)
@@ -1546,8 +1591,8 @@ void ConfigMainWindow::setMenuLink(struct menu *menu)
                                return;
                        item = menuList->findConfigItem(parent);
                        if (item) {
-                               menuList->setSelected(item, TRUE);
-                               menuList->ensureItemVisible(item);
+                               item->setSelected(true);
+                               menuList->scrollToItem(item);
                        }
                        list->setRootMenu(parent);
                }
@@ -1562,8 +1607,8 @@ void ConfigMainWindow::setMenuLink(struct menu *menu)
        if (list) {
                item = list->findConfigItem(menu);
                if (item) {
-                       list->setSelected(item, TRUE);
-                       list->ensureItemVisible(item);
+                       item->setSelected(true);
+                       list->scrollToItem(item);
                        list->setFocus();
                }
        }
@@ -1577,15 +1622,21 @@ void ConfigMainWindow::listFocusChanged(void)
 
 void ConfigMainWindow::goBack(void)
 {
-       ConfigItem* item;
+       ConfigItem* item, *oldSelection;
 
        configList->setParentMenu();
        if (configList->rootEntry == &rootmenu)
-               backAction->setEnabled(FALSE);
-       item = (ConfigItem*)menuList->selectedItem();
+               backAction->setEnabled(false);
+
+       if (menuList->selectedItems().count() == 0)
+               return;
+
+       item = (ConfigItem*)menuList->selectedItems().first();
+       oldSelection = item;
        while (item) {
                if (item->menu == configList->rootEntry) {
-                       menuList->setSelected(item, TRUE);
+                       oldSelection->setSelected(false);
+                       item->setSelected(true);
                        break;
                }
                item = (ConfigItem*)item->parent();
@@ -1594,6 +1645,13 @@ void ConfigMainWindow::goBack(void)
 
 void ConfigMainWindow::showSingleView(void)
 {
+       singleViewAction->setEnabled(false);
+       singleViewAction->setChecked(true);
+       splitViewAction->setEnabled(true);
+       splitViewAction->setChecked(false);
+       fullViewAction->setEnabled(true);
+       fullViewAction->setChecked(false);
+
        menuView->hide();
        menuList->setRootMenu(0);
        configList->mode = singleMode;
@@ -1601,28 +1659,41 @@ void ConfigMainWindow::showSingleView(void)
                configList->updateListAll();
        else
                configList->setRootMenu(&rootmenu);
-       configList->setAllOpen(TRUE);
        configList->setFocus();
 }
 
 void ConfigMainWindow::showSplitView(void)
 {
+       singleViewAction->setEnabled(true);
+       singleViewAction->setChecked(false);
+       splitViewAction->setEnabled(false);
+       splitViewAction->setChecked(true);
+       fullViewAction->setEnabled(true);
+       fullViewAction->setChecked(false);
+
        configList->mode = symbolMode;
        if (configList->rootEntry == &rootmenu)
                configList->updateListAll();
        else
                configList->setRootMenu(&rootmenu);
-       configList->setAllOpen(TRUE);
+       configList->setAllOpen(true);
        configApp->processEvents();
        menuList->mode = menuMode;
        menuList->setRootMenu(&rootmenu);
-       menuList->setAllOpen(TRUE);
+       menuList->setAllOpen(true);
        menuView->show();
        menuList->setFocus();
 }
 
 void ConfigMainWindow::showFullView(void)
 {
+       singleViewAction->setEnabled(true);
+       singleViewAction->setChecked(false);
+       splitViewAction->setEnabled(true);
+       splitViewAction->setChecked(false);
+       fullViewAction->setEnabled(false);
+       fullViewAction->setChecked(true);
+
        menuView->hide();
        menuList->setRootMenu(0);
        configList->mode = fullMode;
@@ -1630,7 +1701,6 @@ void ConfigMainWindow::showFullView(void)
                configList->updateListAll();
        else
                configList->setRootMenu(&rootmenu);
-       configList->setAllOpen(FALSE);
        configList->setFocus();
 }
 
@@ -1684,7 +1754,8 @@ void ConfigMainWindow::showIntro(void)
 
 void ConfigMainWindow::showAbout(void)
 {
-       static const QString str = _("qconf is Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>.\n\n"
+       static const QString str = _("qconf is Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>.\n"
+               "Copyright (C) 2015 Boris Barbulovski <bbarbulovski@gmail.com>.\n\n"
                "Bug reports and feature request can also be entered at http://bugzilla.kernel.org/\n");
 
        QMessageBox::information(this, "qconf", str);
@@ -1692,10 +1763,10 @@ void ConfigMainWindow::showAbout(void)
 
 void ConfigMainWindow::saveSettings(void)
 {
-       configSettings->writeEntry("/window x", pos().x());
-       configSettings->writeEntry("/window y", pos().y());
-       configSettings->writeEntry("/window width", size().width());
-       configSettings->writeEntry("/window height", size().height());
+       configSettings->setValue("/window x", pos().x());
+       configSettings->setValue("/window y", pos().y());
+       configSettings->setValue("/window width", size().width());
+       configSettings->setValue("/window height", size().height());
 
        QString entry;
        switch(configList->mode) {
@@ -1714,7 +1785,7 @@ void ConfigMainWindow::saveSettings(void)
        default:
                break;
        }
-       configSettings->writeEntry("/listMode", entry);
+       configSettings->setValue("/listMode", entry);
 
        configSettings->writeSizes("/split1", split1->sizes());
        configSettings->writeSizes("/split2", split2->sizes());
@@ -1746,7 +1817,7 @@ static const char *progname;
 
 static void usage(void)
 {
-       printf(_("%s [-s] <config>\n"), progname);
+       printf(_("%s [-s] <config>\n").toLatin1().constData(), progname);
        exit(0);
 }
 
@@ -1785,7 +1856,6 @@ int main(int ac, char** av)
        v = new ConfigMainWindow();
 
        //zconfdump(stdout);
-       configApp->setMainWidget(v);
        configApp->connect(configApp, SIGNAL(lastWindowClosed()), SLOT(quit()));
        configApp->connect(configApp, SIGNAL(aboutToQuit()), v, SLOT(saveSettings()));
        v->show();
index bde0c6b6f9e87dbeff3004413123f6d2cef0d42f..a40036d1b059275153dad27f78b522212af97ca7 100644 (file)
@@ -3,26 +3,18 @@
  * Released under the terms of the GNU GPL v2.0.
  */
 
-#if QT_VERSION < 0x040000
-#include <qlistview.h>
-#else
-#include <q3listview.h>
-#endif
+#include <QTextBrowser>
+#include <QTreeWidget>
+#include <QMainWindow>
+#include <QHeaderView>
 #include <qsettings.h>
-
-#if QT_VERSION < 0x040000
-#define Q3ValueList             QValueList
-#define Q3PopupMenu             QPopupMenu
-#define Q3ListView              QListView
-#define Q3ListViewItem          QListViewItem
-#define Q3VBox                  QVBox
-#define Q3TextBrowser           QTextBrowser
-#define Q3MainWindow            QMainWindow
-#define Q3Action                QAction
-#define Q3ToolBar               QToolBar
-#define Q3ListViewItemIterator  QListViewItemIterator
-#define Q3FileDialog            QFileDialog
-#endif
+#include <QPushButton>
+#include <QSettings>
+#include <QLineEdit>
+#include <QSplitter>
+#include <QCheckBox>
+#include <QDialog>
+#include "expr.h"
 
 class ConfigView;
 class ConfigList;
@@ -33,8 +25,8 @@ class ConfigMainWindow;
 class ConfigSettings : public QSettings {
 public:
        ConfigSettings();
-       Q3ValueList<int> readSizes(const QString& key, bool *ok);
-       bool writeSizes(const QString& key, const Q3ValueList<int>& value);
+       QList<int> readSizes(const QString& key, bool *ok);
+       bool writeSizes(const QString& key, const QList<int>& value);
 };
 
 enum colIdx {
@@ -47,9 +39,9 @@ enum optionMode {
        normalOpt = 0, allOpt, promptOpt
 };
 
-class ConfigList : public Q3ListView {
+class ConfigList : public QTreeWidget {
        Q_OBJECT
-       typedef class Q3ListView Parent;
+       typedef class QTreeWidget Parent;
 public:
        ConfigList(ConfigView* p, const char *name = 0);
        void reinit(void);
@@ -61,10 +53,10 @@ public:
 
 protected:
        void keyPressEvent(QKeyEvent *e);
-       void contentsMousePressEvent(QMouseEvent *e);
-       void contentsMouseReleaseEvent(QMouseEvent *e);
-       void contentsMouseMoveEvent(QMouseEvent *e);
-       void contentsMouseDoubleClickEvent(QMouseEvent *e);
+       void mousePressEvent(QMouseEvent *e);
+       void mouseReleaseEvent(QMouseEvent *e);
+       void mouseMoveEvent(QMouseEvent *e);
+       void mouseDoubleClickEvent(QMouseEvent *e);
        void focusInEvent(QFocusEvent *e);
        void contextMenuEvent(QContextMenuEvent *e);
 
@@ -95,32 +87,23 @@ public:
        }
        ConfigItem* firstChild() const
        {
-               return (ConfigItem *)Parent::firstChild();
-       }
-       int mapIdx(colIdx idx)
-       {
-               return colMap[idx];
+               return (ConfigItem *)children().first();
        }
-       void addColumn(colIdx idx, const QString& label)
+       void addColumn(colIdx idx)
        {
-               colMap[idx] = Parent::addColumn(label);
-               colRevMap[colMap[idx]] = idx;
+               showColumn(idx);
        }
        void removeColumn(colIdx idx)
        {
-               int col = colMap[idx];
-               if (col >= 0) {
-                       Parent::removeColumn(col);
-                       colRevMap[col] = colMap[idx] = -1;
-               }
+               hideColumn(idx);
        }
        void setAllOpen(bool open);
        void setParentMenu(void);
 
        bool menuSkip(struct menu *);
 
-       template <class P>
-       void updateMenuList(P*, struct menu*);
+       void updateMenuList(ConfigItem *parent, struct menu*);
+       void updateMenuList(ConfigList *parent, struct menu*);
 
        bool updateAll;
 
@@ -132,30 +115,26 @@ public:
        enum listMode mode;
        enum optionMode optMode;
        struct menu *rootEntry;
-       QColorGroup disabledColorGroup;
-       QColorGroup inactivedColorGroup;
-       Q3PopupMenu* headerPopup;
-
-private:
-       int colMap[colNr];
-       int colRevMap[colNr];
+       QPalette disabledColorGroup;
+       QPalette inactivedColorGroup;
+       QMenu* headerPopup;
 };
 
-class ConfigItem : public Q3ListViewItem {
-       typedef class Q3ListViewItem Parent;
+class ConfigItem : public QTreeWidgetItem {
+       typedef class QTreeWidgetItem Parent;
 public:
-       ConfigItem(Q3ListView *parent, ConfigItem *after, struct menu *m, bool v)
-       : Parent(parent, after), menu(m), visible(v), goParent(false)
+       ConfigItem(ConfigList *parent, ConfigItem *after, struct menu *m, bool v)
+       : Parent(parent, after), nextItem(0), menu(m), visible(v), goParent(false)
        {
                init();
        }
        ConfigItem(ConfigItem *parent, ConfigItem *after, struct menu *m, bool v)
-       : Parent(parent, after), menu(m), visible(v), goParent(false)
+       : Parent(parent, after), nextItem(0), menu(m), visible(v), goParent(false)
        {
                init();
        }
-       ConfigItem(Q3ListView *parent, ConfigItem *after, bool v)
-       : Parent(parent, after), menu(0), visible(v), goParent(true)
+       ConfigItem(ConfigList *parent, ConfigItem *after, bool v)
+       : Parent(parent, after), nextItem(0), menu(0), visible(v), goParent(true)
        {
                init();
        }
@@ -166,33 +145,43 @@ public:
        void testUpdateMenu(bool v);
        ConfigList* listView() const
        {
-               return (ConfigList*)Parent::listView();
+               return (ConfigList*)Parent::treeWidget();
        }
        ConfigItem* firstChild() const
        {
-               return (ConfigItem *)Parent::firstChild();
+               return (ConfigItem *)Parent::child(0);
        }
-       ConfigItem* nextSibling() const
+       ConfigItem* nextSibling()
        {
-               return (ConfigItem *)Parent::nextSibling();
+               ConfigItem *ret = NULL;
+               ConfigItem *_parent = (ConfigItem *)parent();
+
+               if(_parent) {
+                       ret = (ConfigItem *)_parent->child(_parent->indexOfChild(this)+1);
+               } else {
+                       QTreeWidget *_treeWidget = treeWidget();
+                       ret = (ConfigItem *)_treeWidget->topLevelItem(_treeWidget->indexOfTopLevelItem(this)+1);
+               }
+
+               return ret;
        }
        void setText(colIdx idx, const QString& text)
        {
-               Parent::setText(listView()->mapIdx(idx), text);
+               Parent::setText(idx, text);
        }
        QString text(colIdx idx) const
        {
-               return Parent::text(listView()->mapIdx(idx));
+               return Parent::text(idx);
        }
-       void setPixmap(colIdx idx, const QPixmap& pm)
+       void setPixmap(colIdx idx, const QIcon &icon)
        {
-               Parent::setPixmap(listView()->mapIdx(idx), pm);
+               Parent::setIcon(idx, icon);
        }
-       const QPixmap* pixmap(colIdx idx) const
+       const QIcon pixmap(colIdx idx) const
        {
-               return Parent::pixmap(listView()->mapIdx(idx));
+               return icon(idx);
        }
-       void paintCell(QPainter* p, const QColorGroup& cg, int column, int width, int align);
+       // TODO: Implement paintCell
 
        ConfigItem* nextItem;
        struct menu *menu;
@@ -216,9 +205,9 @@ public:
        ConfigItem *item;
 };
 
-class ConfigView : public Q3VBox {
+class ConfigView : public QWidget {
        Q_OBJECT
-       typedef class Q3VBox Parent;
+       typedef class QWidget Parent;
 public:
        ConfigView(QWidget* parent, const char *name = 0);
        ~ConfigView(void);
@@ -249,9 +238,9 @@ public:
        static QAction *showPromptAction;
 };
 
-class ConfigInfoView : public Q3TextBrowser {
+class ConfigInfoView : public QTextBrowser {
        Q_OBJECT
-       typedef class Q3TextBrowser Parent;
+       typedef class QTextBrowser Parent;
 public:
        ConfigInfoView(QWidget* parent, const char *name = 0);
        bool showDebug(void) const { return _showDebug; }
@@ -271,8 +260,8 @@ protected:
        QString debug_info(struct symbol *sym);
        static QString print_filter(const QString &str);
        static void expr_print_help(void *data, struct symbol *sym, const char *str);
-       Q3PopupMenu* createPopupMenu(const QPoint& pos);
-       void contentsContextMenuEvent(QContextMenuEvent *e);
+       QMenu *createStandardContextMenu(const QPoint & pos);
+       void contextMenuEvent(QContextMenuEvent *e);
 
        struct symbol *sym;
        struct menu *_menu;
@@ -299,10 +288,10 @@ protected:
        struct symbol **result;
 };
 
-class ConfigMainWindow : public Q3MainWindow {
+class ConfigMainWindow : public QMainWindow {
        Q_OBJECT
 
-       static Q3Action *saveAction;
+       static QAction *saveAction;
        static void conf_changed(void);
 public:
        ConfigMainWindow(void);
@@ -331,8 +320,11 @@ protected:
        ConfigView *configView;
        ConfigList *configList;
        ConfigInfoView *helpText;
-       Q3ToolBar *toolBar;
-       Q3Action *backAction;
-       QSplitter* split1;
-       QSplitter* split2;
+       QToolBar *toolBar;
+       QAction *backAction;
+       QAction *singleViewAction;
+       QAction *splitViewAction;
+       QAction *fullViewAction;
+       QSplitter *split1;
+       QSplitter *split2;
 };
index 50878dc025a5746d51316c6f1bd4c1e1b8a41707..25cf0c2c0c795ac36658a2bfa061c9f3383630a1 100644 (file)
@@ -1116,6 +1116,8 @@ static void sym_check_print_recursive(struct symbol *last_sym)
                if (stack->sym == last_sym)
                        fprintf(stderr, "%s:%d:error: recursive dependency detected!\n",
                                prop->file->name, prop->lineno);
+                       fprintf(stderr, "For a resolution refer to Documentation/kbuild/kconfig-language.txt\n");
+                       fprintf(stderr, "subsection \"Kconfig recursive dependency limitations\"\n");
                if (stack->expr) {
                        fprintf(stderr, "%s:%d:\tsymbol %s %s value contains %s\n",
                                prop->file->name, prop->lineno,
index b967e4f9fed2e6cc78b9538c79517a473fc375b8..6c3b038ef40d2c761c415f3d060d3b92ee489d02 100755 (executable)
@@ -52,7 +52,16 @@ set_debarch() {
        arm64)
                debarch=arm64 ;;
        arm*)
-               debarch=arm$(grep -q CONFIG_AEABI=y $KCONFIG_CONFIG && echo el || true) ;;
+               if grep -q CONFIG_AEABI=y $KCONFIG_CONFIG; then
+                   if grep -q CONFIG_VFP=y $KCONFIG_CONFIG; then
+                       debarch=armhf
+                   else
+                       debarch=armel
+                   fi
+               else
+                   debarch=arm
+               fi
+               ;;
        *)
                debarch=$(dpkg --print-architecture)
                echo "" >&2
index 8e5aee6d9da2be1d3a4c255947d07663c14c29d3..262889046703ea02055fcec52cfc6b3e2ebf1dd0 100755 (executable)
@@ -198,6 +198,8 @@ exuberant()
        --regex-c++='/TASK_PFA_TEST\([^,]*,\s*([^)]*)\)/task_\1/'       \
        --regex-c++='/TASK_PFA_SET\([^,]*,\s*([^)]*)\)/task_set_\1/'    \
        --regex-c++='/TASK_PFA_CLEAR\([^,]*,\s*([^)]*)\)/task_clear_\1/'\
+       --regex-c++='/DEF_MMIO_(IN|OUT)_(X|D)\(([^,]*),\s*[^)]*\)/\3/'  \
+       --regex-c++='/DEBUGGER_BOILERPLATE\(([^,]*)\)/\1/'              \
        --regex-c='/PCI_OP_READ\((\w*).*[1-4]\)/pci_bus_read_config_\1/' \
        --regex-c='/PCI_OP_WRITE\((\w*).*[1-4]\)/pci_bus_write_config_\1/' \
        --regex-c='/DEFINE_(MUTEX|SEMAPHORE|SPINLOCK)\((\w*)/\2/v/'     \
index 9e591e5989bef8db6369d2afb4354b0a1e96efa4..d0cfaa9f19d08034a3c3600d8381ed166a369388 100644 (file)
@@ -4933,7 +4933,7 @@ static unsigned int selinux_ip_postroute_compat(struct sk_buff *skb,
                                                int ifindex,
                                                u16 family)
 {
-       struct sock *sk = skb->sk;
+       struct sock *sk = skb_to_full_sk(skb);
        struct sk_security_struct *sksec;
        struct common_audit_data ad;
        struct lsm_network_audit net = {0,};
@@ -4988,7 +4988,7 @@ static unsigned int selinux_ip_postroute(struct sk_buff *skb,
        if (!secmark_active && !peerlbl_active)
                return NF_ACCEPT;
 
-       sk = skb->sk;
+       sk = skb_to_full_sk(skb);
 
 #ifdef CONFIG_XFRM
        /* If skb->dst->xfrm is non-NULL then the packet is undergoing an IPsec
@@ -5033,8 +5033,6 @@ static unsigned int selinux_ip_postroute(struct sk_buff *skb,
                u32 skb_sid;
                struct sk_security_struct *sksec;
 
-               if (sk->sk_state == TCP_NEW_SYN_RECV)
-                       sk = inet_reqsk(sk)->rsk_listener;
                sksec = sk->sk_security;
                if (selinux_skb_peerlbl_sid(skb, family, &skb_sid))
                        return NF_DROP;
index 0364120d1ec8705da7e8c1636f645d0885731509..1f989a539fd4abe08e3797b5d49f7b26ded4fe41 100644 (file)
@@ -245,7 +245,7 @@ int selinux_netlbl_skbuff_setsid(struct sk_buff *skb,
 
        /* if this is a locally generated packet check to see if it is already
         * being labeled by it's parent socket, if it is just exit */
-       sk = skb->sk;
+       sk = skb_to_full_sk(skb);
        if (sk != NULL) {
                struct sk_security_struct *sksec = sk->sk_security;
                if (sksec->nlbl_state != NLBL_REQSKB)
index 6d1706c9777e64fc69ca305e6ef55a2d563bb29d..aa6bf1b22ec5b3ec3d8e64db683d7db92b2c4f1b 100644 (file)
@@ -17,6 +17,7 @@
 #include <linux/netfilter_ipv4.h>
 #include <linux/netfilter_ipv6.h>
 #include <linux/netdevice.h>
+#include <net/inet_sock.h>
 #include "smack.h"
 
 #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
@@ -25,11 +26,12 @@ static unsigned int smack_ipv6_output(void *priv,
                                        struct sk_buff *skb,
                                        const struct nf_hook_state *state)
 {
+       struct sock *sk = skb_to_full_sk(skb);
        struct socket_smack *ssp;
        struct smack_known *skp;
 
-       if (skb && skb->sk && skb->sk->sk_security) {
-               ssp = skb->sk->sk_security;
+       if (sk && sk->sk_security) {
+               ssp = sk->sk_security;
                skp = ssp->smk_out;
                skb->secmark = skp->smk_secid;
        }
@@ -42,11 +44,12 @@ static unsigned int smack_ipv4_output(void *priv,
                                        struct sk_buff *skb,
                                        const struct nf_hook_state *state)
 {
+       struct sock *sk = skb_to_full_sk(skb);
        struct socket_smack *ssp;
        struct smack_known *skp;
 
-       if (skb && skb->sk && skb->sk->sk_security) {
-               ssp = skb->sk->sk_security;
+       if (sk && sk->sk_security) {
+               ssp = sk->sk_security;
                skp = ssp->smk_out;
                skb->secmark = skp->smk_secid;
        }
index 021e6f97f33e7af2a7e570ba46cd29b72523b130..dce346aa94eabbd3544189af7e3de528da960cb6 100644 (file)
 #include <linux/vmalloc.h>
 #include <linux/device.h>
 #include <linux/module.h>
+#include <linux/mutex.h>
 #include <linux/ndctl.h>
 #include <linux/sizes.h>
+#include <linux/list.h>
 #include <linux/slab.h>
 #include <nfit.h>
 #include <nd.h>
  * +------+  |                 blk5.0             |  pm1.0  |    3      region5
  *           +-------------------------+----------+-+-------+
  *
+ * +--+---+
+ * | cpu1 |
+ * +--+---+                   (Hotplug DIMM)
+ *    |      +----------------------------------------------+
+ * +--+---+  |                 blk6.0/pm7.0                 |    4      region6/7
+ * | imc0 +--+----------------------------------------------+
+ * +------+
+ *
+ *
  * *) In this layout we have four dimms and two memory controllers in one
  *    socket.  Each unique interface (BLK or PMEM) to DPA space
  *    is identified by a region device with a dynamically assigned id.
@@ -85,8 +96,8 @@
  *    reference an NVDIMM.
  */
 enum {
-       NUM_PM  = 2,
-       NUM_DCR = 4,
+       NUM_PM  = 3,
+       NUM_DCR = 5,
        NUM_BDW = NUM_DCR,
        NUM_SPA = NUM_PM + NUM_DCR + NUM_BDW,
        NUM_MEM = NUM_DCR + NUM_BDW + 2 /* spa0 iset */ + 4 /* spa1 iset */,
@@ -115,6 +126,7 @@ static u32 handle[NUM_DCR] = {
        [1] = NFIT_DIMM_HANDLE(0, 0, 0, 0, 1),
        [2] = NFIT_DIMM_HANDLE(0, 0, 1, 0, 0),
        [3] = NFIT_DIMM_HANDLE(0, 0, 1, 0, 1),
+       [4] = NFIT_DIMM_HANDLE(0, 1, 0, 0, 0),
 };
 
 struct nfit_test {
@@ -138,6 +150,7 @@ struct nfit_test {
        dma_addr_t *dcr_dma;
        int (*alloc)(struct nfit_test *t);
        void (*setup)(struct nfit_test *t);
+       int setup_hotplug;
 };
 
 static struct nfit_test *to_nfit_test(struct device *dev)
@@ -428,6 +441,10 @@ static int nfit_test0_alloc(struct nfit_test *t)
        if (!t->spa_set[1])
                return -ENOMEM;
 
+       t->spa_set[2] = test_alloc_coherent(t, SPA0_SIZE, &t->spa_set_dma[2]);
+       if (!t->spa_set[2])
+               return -ENOMEM;
+
        for (i = 0; i < NUM_DCR; i++) {
                t->dimm[i] = test_alloc(t, DIMM_SIZE, &t->dimm_dma[i]);
                if (!t->dimm[i])
@@ -950,6 +967,126 @@ static void nfit_test0_setup(struct nfit_test *t)
        flush->hint_count = 1;
        flush->hint_address[0] = t->flush_dma[3];
 
+       if (t->setup_hotplug) {
+               offset = offset + sizeof(struct acpi_nfit_flush_address) * 4;
+               /* dcr-descriptor4 */
+               dcr = nfit_buf + offset;
+               dcr->header.type = ACPI_NFIT_TYPE_CONTROL_REGION;
+               dcr->header.length = sizeof(struct acpi_nfit_control_region);
+               dcr->region_index = 4+1;
+               dcr->vendor_id = 0xabcd;
+               dcr->device_id = 0;
+               dcr->revision_id = 1;
+               dcr->serial_number = ~handle[4];
+               dcr->windows = 1;
+               dcr->window_size = DCR_SIZE;
+               dcr->command_offset = 0;
+               dcr->command_size = 8;
+               dcr->status_offset = 8;
+               dcr->status_size = 4;
+
+               offset = offset + sizeof(struct acpi_nfit_control_region);
+               /* bdw4 (spa/dcr4, dimm4) */
+               bdw = nfit_buf + offset;
+               bdw->header.type = ACPI_NFIT_TYPE_DATA_REGION;
+               bdw->header.length = sizeof(struct acpi_nfit_data_region);
+               bdw->region_index = 4+1;
+               bdw->windows = 1;
+               bdw->offset = 0;
+               bdw->size = BDW_SIZE;
+               bdw->capacity = DIMM_SIZE;
+               bdw->start_address = 0;
+
+               offset = offset + sizeof(struct acpi_nfit_data_region);
+               /* spa10 (dcr4) dimm4 */
+               spa = nfit_buf + offset;
+               spa->header.type = ACPI_NFIT_TYPE_SYSTEM_ADDRESS;
+               spa->header.length = sizeof(*spa);
+               memcpy(spa->range_guid, to_nfit_uuid(NFIT_SPA_DCR), 16);
+               spa->range_index = 10+1;
+               spa->address = t->dcr_dma[4];
+               spa->length = DCR_SIZE;
+
+               /*
+                * spa11 (single-dimm interleave for hotplug, note storage
+                * does not actually alias the related block-data-window
+                * regions)
+                */
+               spa = nfit_buf + offset + sizeof(*spa);
+               spa->header.type = ACPI_NFIT_TYPE_SYSTEM_ADDRESS;
+               spa->header.length = sizeof(*spa);
+               memcpy(spa->range_guid, to_nfit_uuid(NFIT_SPA_PM), 16);
+               spa->range_index = 11+1;
+               spa->address = t->spa_set_dma[2];
+               spa->length = SPA0_SIZE;
+
+               /* spa12 (bdw for dcr4) dimm4 */
+               spa = nfit_buf + offset + sizeof(*spa) * 2;
+               spa->header.type = ACPI_NFIT_TYPE_SYSTEM_ADDRESS;
+               spa->header.length = sizeof(*spa);
+               memcpy(spa->range_guid, to_nfit_uuid(NFIT_SPA_BDW), 16);
+               spa->range_index = 12+1;
+               spa->address = t->dimm_dma[4];
+               spa->length = DIMM_SIZE;
+
+               offset = offset + sizeof(*spa) * 3;
+               /* mem-region14 (spa/dcr4, dimm4) */
+               memdev = nfit_buf + offset;
+               memdev->header.type = ACPI_NFIT_TYPE_MEMORY_MAP;
+               memdev->header.length = sizeof(*memdev);
+               memdev->device_handle = handle[4];
+               memdev->physical_id = 4;
+               memdev->region_id = 0;
+               memdev->range_index = 10+1;
+               memdev->region_index = 4+1;
+               memdev->region_size = 0;
+               memdev->region_offset = 0;
+               memdev->address = 0;
+               memdev->interleave_index = 0;
+               memdev->interleave_ways = 1;
+
+               /* mem-region15 (spa0, dimm4) */
+               memdev = nfit_buf + offset +
+                               sizeof(struct acpi_nfit_memory_map);
+               memdev->header.type = ACPI_NFIT_TYPE_MEMORY_MAP;
+               memdev->header.length = sizeof(*memdev);
+               memdev->device_handle = handle[4];
+               memdev->physical_id = 4;
+               memdev->region_id = 0;
+               memdev->range_index = 11+1;
+               memdev->region_index = 4+1;
+               memdev->region_size = SPA0_SIZE;
+               memdev->region_offset = t->spa_set_dma[2];
+               memdev->address = 0;
+               memdev->interleave_index = 0;
+               memdev->interleave_ways = 1;
+
+               /* mem-region16 (spa/dcr4, dimm4) */
+               memdev = nfit_buf + offset +
+                               sizeof(struct acpi_nfit_memory_map) * 2;
+               memdev->header.type = ACPI_NFIT_TYPE_MEMORY_MAP;
+               memdev->header.length = sizeof(*memdev);
+               memdev->device_handle = handle[4];
+               memdev->physical_id = 4;
+               memdev->region_id = 0;
+               memdev->range_index = 12+1;
+               memdev->region_index = 4+1;
+               memdev->region_size = 0;
+               memdev->region_offset = 0;
+               memdev->address = 0;
+               memdev->interleave_index = 0;
+               memdev->interleave_ways = 1;
+
+               offset = offset + sizeof(struct acpi_nfit_memory_map) * 3;
+               /* flush3 (dimm4) */
+               flush = nfit_buf + offset;
+               flush->header.type = ACPI_NFIT_TYPE_FLUSH_ADDRESS;
+               flush->header.length = sizeof(struct acpi_nfit_flush_address);
+               flush->device_handle = handle[4];
+               flush->hint_count = 1;
+               flush->hint_address[0] = t->flush_dma[4];
+       }
+
        acpi_desc = &t->acpi_desc;
        set_bit(ND_CMD_GET_CONFIG_SIZE, &acpi_desc->dimm_dsm_force_en);
        set_bit(ND_CMD_GET_CONFIG_DATA, &acpi_desc->dimm_dsm_force_en);
@@ -1108,6 +1245,29 @@ static int nfit_test_probe(struct platform_device *pdev)
        if (!acpi_desc->nvdimm_bus)
                return -ENXIO;
 
+       INIT_LIST_HEAD(&acpi_desc->spa_maps);
+       INIT_LIST_HEAD(&acpi_desc->spas);
+       INIT_LIST_HEAD(&acpi_desc->dcrs);
+       INIT_LIST_HEAD(&acpi_desc->bdws);
+       INIT_LIST_HEAD(&acpi_desc->idts);
+       INIT_LIST_HEAD(&acpi_desc->flushes);
+       INIT_LIST_HEAD(&acpi_desc->memdevs);
+       INIT_LIST_HEAD(&acpi_desc->dimms);
+       mutex_init(&acpi_desc->spa_map_mutex);
+       mutex_init(&acpi_desc->init_mutex);
+
+       rc = acpi_nfit_init(acpi_desc, nfit_test->nfit_size);
+       if (rc) {
+               nvdimm_bus_unregister(acpi_desc->nvdimm_bus);
+               return rc;
+       }
+
+       if (nfit_test->setup != nfit_test0_setup)
+               return 0;
+
+       nfit_test->setup_hotplug = 1;
+       nfit_test->setup(nfit_test);
+
        rc = acpi_nfit_init(acpi_desc, nfit_test->nfit_size);
        if (rc) {
                nvdimm_bus_unregister(acpi_desc->nvdimm_bus);
index 4b4957b8df4e879a0d19098fdacce49658fce24a..c8edff6803d1db0b9b36585746c3ecaf45b6681c 100644 (file)
@@ -14,6 +14,7 @@ TARGETS += mount
 TARGETS += mqueue
 TARGETS += net
 TARGETS += powerpc
+TARGETS += pstore
 TARGETS += ptrace
 TARGETS += seccomp
 TARGETS += size
@@ -66,6 +67,9 @@ clean_hotplug:
                make -C $$TARGET clean; \
        done;
 
+run_pstore_crash:
+       make -C pstore run_crash
+
 INSTALL_PATH ?= install
 INSTALL_PATH := $(abspath $(INSTALL_PATH))
 ALL_SCRIPT := $(INSTALL_PATH)/run_kselftest.sh
index d27108b4f2081fe2d250e4de8c45bf02f7c73d4f..c0d957015f524d7ad7f6ab2a46be1a8d484a8ef9 100644 (file)
@@ -6,7 +6,7 @@ ifeq ($(ARCH),x86)
 TEST_PROGS := breakpoint_test
 endif
 
-all:
+all: $(TEST_PROGS)
 
 include ../lib.mk
 
diff --git a/tools/testing/selftests/efivarfs/.gitignore b/tools/testing/selftests/efivarfs/.gitignore
new file mode 100644 (file)
index 0000000..3361849
--- /dev/null
@@ -0,0 +1,2 @@
+create-read
+open-unlink
index a5a426211129bd63cd7c6e0fadcf260998570735..c3843ed49bf6dfe268971e7d013b795ae30e7b4f 100644 (file)
@@ -5,7 +5,7 @@
 
 echo 0 > events/enable
 echo > kprobe_events
-echo p:myevent do_fork > kprobe_events
+echo p:myevent _do_fork > kprobe_events
 grep myevent kprobe_events
 test -d events/kprobes/myevent
 echo > kprobe_events
index d8c7bb6581fe9e51479ff02b92027fa07aef5c00..74507db8bbc89e1b3a4594ec948a81783584402b 100644 (file)
@@ -5,7 +5,7 @@
 
 echo 0 > events/enable
 echo > kprobe_events
-echo p:myevent do_fork > kprobe_events
+echo p:myevent _do_fork > kprobe_events
 test -d events/kprobes/myevent
 echo 1 > events/kprobes/myevent/enable
 echo > kprobe_events && exit 1 # this must fail
index c45ee2761354e716a8c6f3f926edcf23fef8a865..64949d4eda699af40f42c74f6408a14106893721 100644 (file)
@@ -5,7 +5,7 @@
 
 echo 0 > events/enable
 echo > kprobe_events
-echo 'p:testprobe do_fork $stack $stack0 +0($stack)' > kprobe_events
+echo 'p:testprobe _do_fork $stack $stack0 +0($stack)' > kprobe_events
 grep testprobe kprobe_events
 test -d events/kprobes/testprobe
 echo 1 > events/kprobes/testprobe/enable
index ab41d2b29841ceb149d59a51649467ec4136e3e1..d6f2f4965697a8a2e583087121283f5012d12ae4 100644 (file)
@@ -6,31 +6,31 @@ grep function available_tracers || exit_unsupported # this is configurable
 
 # prepare
 echo nop > current_tracer
-echo do_fork > set_ftrace_filter
+echo _do_fork > set_ftrace_filter
 echo 0 > events/enable
 echo > kprobe_events
-echo 'p:testprobe do_fork' > kprobe_events
+echo 'p:testprobe _do_fork' > kprobe_events
 
 # kprobe on / ftrace off
 echo 1 > events/kprobes/testprobe/enable
 echo > trace
 ( echo "forked")
 grep testprobe trace
-! grep 'do_fork <-' trace
+! grep '_do_fork <-' trace
 
 # kprobe on / ftrace on
 echo function > current_tracer
 echo > trace
 ( echo "forked")
 grep testprobe trace
-grep 'do_fork <-' trace
+grep '_do_fork <-' trace
 
 # kprobe off / ftrace on
 echo 0 > events/kprobes/testprobe/enable
 echo > trace
 ( echo "forked")
 ! grep testprobe trace
-grep 'do_fork <-' trace
+grep '_do_fork <-' trace
 
 # kprobe on / ftrace on
 echo 1 > events/kprobes/testprobe/enable
@@ -38,14 +38,14 @@ echo function > current_tracer
 echo > trace
 ( echo "forked")
 grep testprobe trace
-grep 'do_fork <-' trace
+grep '_do_fork <-' trace
 
 # kprobe on / ftrace off
 echo nop > current_tracer
 echo > trace
 ( echo "forked")
 grep testprobe trace
-! grep 'do_fork <-' trace
+! grep '_do_fork <-' trace
 
 # cleanup
 echo nop > current_tracer
index 31717985acc7f1fa972fea07b4fc149d4d456c18..0d09546258fde3b6c327bc6a4d8e67e14647de15 100644 (file)
@@ -5,7 +5,7 @@
 
 echo 0 > events/enable
 echo > kprobe_events
-echo 'r:testprobe2 do_fork $retval' > kprobe_events
+echo 'r:testprobe2 _do_fork $retval' > kprobe_events
 grep testprobe2 kprobe_events
 test -d events/kprobes/testprobe2
 echo 1 > events/kprobes/testprobe2/enable
index 3e7eb7972511c657af9ca54e6468542a42a5bd33..fd396ac811b6a73f086e605ef93e0d2c92401ad6 100644 (file)
@@ -4,16 +4,16 @@ CFLAGS += -I../../../../include/uapi/
 CFLAGS += -I../../../../include/
 CFLAGS += -I../../../../usr/include/
 
-all:
-       $(CC) $(CFLAGS) memfd_test.c -o memfd_test
-
 TEST_PROGS := memfd_test
 
+all: $(TEST_PROGS)
+
 include ../lib.mk
 
-build_fuse:
-       $(CC) $(CFLAGS) fuse_mnt.c `pkg-config fuse --cflags --libs` -o fuse_mnt
-       $(CC) $(CFLAGS) fuse_test.c -o fuse_test
+build_fuse: fuse_mnt fuse_test
+
+fuse_mnt.o: CFLAGS += $(shell pkg-config fuse --cflags)
+fuse_mnt: LDFLAGS += $(shell pkg-config fuse --libs)
 
 run_fuse: build_fuse
        @./run_fuse_test.sh || echo "fuse_test: [FAIL]"
index 0b9eafb7ab7bc1cc0282a4eec26bad50786a23fe..26546892cd545e954a559ade36cba823ac0bff18 100644 (file)
 #include <sys/mman.h>
 #include <sys/stat.h>
 #include <sys/syscall.h>
+#include <sys/wait.h>
 #include <unistd.h>
 
 #define MFD_DEF_SIZE 8192
-#define STACK_SIZE 65535
+#define STACK_SIZE 65536
 
 static int sys_memfd_create(const char *name,
                            unsigned int flags)
old mode 100644 (file)
new mode 100755 (executable)
index 9c1a5d359055f475b00cef6d053d14a2ab22c8aa..e0a74bd207a547c865f2e352f186a5b4cdf14da6 100644 (file)
@@ -31,6 +31,7 @@
 #include <sys/resource.h>
 #include <sys/stat.h>
 #include <mqueue.h>
+#include <error.h>
 
 static char *usage =
 "Usage:\n"
index 8519e9ee97e3d3e4a344e798cabf5b38edfff602..8188f72de93c2ae35884a0d2a3cebc9c7a3c1bf5 100644 (file)
@@ -37,6 +37,7 @@
 #include <sys/stat.h>
 #include <mqueue.h>
 #include <popt.h>
+#include <error.h>
 
 static char *usage =
 "Usage:\n"
diff --git a/tools/testing/selftests/pstore/Makefile b/tools/testing/selftests/pstore/Makefile
new file mode 100644 (file)
index 0000000..bd7abe2
--- /dev/null
@@ -0,0 +1,15 @@
+# Makefile for pstore selftests.
+# Expects pstore backend is registered.
+
+all:
+
+TEST_PROGS := pstore_tests pstore_post_reboot_tests
+TEST_FILES := common_tests pstore_crash_test
+
+include ../lib.mk
+
+run_crash:
+       @sh pstore_crash_test || { echo "pstore_crash_test: [FAIL]"; exit 1; }
+
+clean:
+       rm -rf logs/* *uuid
diff --git a/tools/testing/selftests/pstore/common_tests b/tools/testing/selftests/pstore/common_tests
new file mode 100755 (executable)
index 0000000..3ea64d7
--- /dev/null
@@ -0,0 +1,83 @@
+#!/bin/sh
+
+# common_tests - Shell script commonly used by pstore test scripts
+#
+# Copyright (C) Hitachi Ltd., 2015
+#  Written by Hiraku Toyooka <hiraku.toyooka.gu@hitachi.com>
+#
+# Released under the terms of the GPL v2.
+
+# Utilities
+errexit() { # message
+    echo "Error: $1" 1>&2
+    exit 1
+}
+
+absdir() { # file_path
+    (cd `dirname $1`; pwd)
+}
+
+show_result() { # result_value
+    if [ $1 -eq 0 ]; then
+       prlog "ok"
+    else
+       prlog "FAIL"
+       rc=1
+    fi
+}
+
+check_files_exist() { # type of pstorefs file
+    if [ -e ${1}-${backend}-0 ]; then
+       prlog "ok"
+       for f in `ls ${1}-${backend}-*`; do
+            prlog -e "\t${f}"
+       done
+    else
+       prlog "FAIL"
+       rc=1
+    fi
+}
+
+operate_files() { # tested value, files, operation
+    if [ $1 -eq 0 ]; then
+       prlog
+       for f in $2; do
+           prlog -ne "\t${f} ... "
+           # execute operation
+           $3 $f
+           show_result $?
+       done
+    else
+       prlog " ... FAIL"
+       rc=1
+    fi
+}
+
+# Parameters
+TEST_STRING_PATTERN="Testing pstore: uuid="
+UUID=`cat /proc/sys/kernel/random/uuid`
+TOP_DIR=`absdir $0`
+LOG_DIR=$TOP_DIR/logs/`date +%Y%m%d-%H%M%S`_${UUID}/
+REBOOT_FLAG=$TOP_DIR/reboot_flag
+
+# Preparing logs
+LOG_FILE=$LOG_DIR/`basename $0`.log
+mkdir -p $LOG_DIR || errexit "Failed to make a log directory: $LOG_DIR"
+date > $LOG_FILE
+prlog() { # messages
+    /bin/echo "$@" | tee -a $LOG_FILE
+}
+
+# Starting tests
+rc=0
+prlog "=== Pstore unit tests (`basename $0`) ==="
+prlog "UUID="$UUID
+
+prlog -n "Checking pstore backend is registered ... "
+backend=`cat /sys/module/pstore/parameters/backend`
+show_result $?
+prlog -e "\tbackend=${backend}"
+prlog -e "\tcmdline=`cat /proc/cmdline`"
+if [ $rc -ne 0 ]; then
+    exit 1
+fi
diff --git a/tools/testing/selftests/pstore/pstore_crash_test b/tools/testing/selftests/pstore/pstore_crash_test
new file mode 100755 (executable)
index 0000000..1a4afe5
--- /dev/null
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+# pstore_crash_test - Pstore test shell script which causes crash and reboot
+#
+# Copyright (C) Hitachi Ltd., 2015
+#  Written by Hiraku Toyooka <hiraku.toyooka.gu@hitachi.com>
+#
+# Released under the terms of the GPL v2.
+
+# exit if pstore backend is not registered
+. ./common_tests
+
+prlog "Causing kernel crash ..."
+
+# enable all functions triggered by sysrq
+echo 1 > /proc/sys/kernel/sysrq
+# setting to reboot in 3 seconds after panic
+echo 3 > /proc/sys/kernel/panic
+
+# save uuid file by different name because next test execution will replace it.
+mv $TOP_DIR/uuid $TOP_DIR/prev_uuid
+
+# create a file as reboot flag
+touch $REBOOT_FLAG
+sync
+
+# cause crash
+# Note: If you use kdump and want to see kmesg-* files after reboot, you should
+#       specify 'crash_kexec_post_notifiers' in 1st kernel's cmdline.
+echo c > /proc/sysrq-trigger
diff --git a/tools/testing/selftests/pstore/pstore_post_reboot_tests b/tools/testing/selftests/pstore/pstore_post_reboot_tests
new file mode 100755 (executable)
index 0000000..6ccb154
--- /dev/null
@@ -0,0 +1,77 @@
+#!/bin/sh
+
+# pstore_post_reboot_tests - Check pstore's behavior after crash/reboot
+#
+# Copyright (C) Hitachi Ltd., 2015
+#  Written by Hiraku Toyooka <hiraku.toyooka.gu@hitachi.com>
+#
+# Released under the terms of the GPL v2.
+
+. ./common_tests
+
+if [ -e $REBOOT_FLAG  ]; then
+    rm $REBOOT_FLAG
+else
+    prlog "pstore_crash_test has not been executed yet. we skip further tests."
+    exit 0
+fi
+
+prlog -n "Mounting pstore filesystem ... "
+mount_info=`grep pstore /proc/mounts`
+if [ $? -eq 0 ]; then
+    mount_point=`echo ${mount_info} | cut -d' ' -f2 | head -n1`
+    prlog "ok"
+else
+    mount none /sys/fs/pstore -t pstore
+    if [ $? -eq 0 ]; then
+       mount_point=`grep pstore /proc/mounts | cut -d' ' -f2 | head -n1`
+       prlog "ok"
+    else
+       prlog "FAIL"
+       exit 1
+    fi
+fi
+
+cd ${mount_point}
+
+prlog -n "Checking dmesg files exist in pstore filesystem ... "
+check_files_exist dmesg
+
+prlog -n "Checking console files exist in pstore filesystem ... "
+check_files_exist console
+
+prlog -n "Checking pmsg files exist in pstore filesystem ... "
+check_files_exist pmsg
+
+prlog -n "Checking dmesg files contain oops end marker"
+grep_end_trace() {
+    grep -q "\---\[ end trace" $1
+}
+files=`ls dmesg-${backend}-*`
+operate_files $? "$files" grep_end_trace
+
+prlog -n "Checking console file contains oops end marker ... "
+grep -q "\---\[ end trace" console-${backend}-0
+show_result $?
+
+prlog -n "Checking pmsg file properly keeps the content written before crash ... "
+prev_uuid=`cat $TOP_DIR/prev_uuid`
+if [ $? -eq 0 ]; then
+    nr_matched=`grep -c "$TEST_STRING_PATTERN" pmsg-${backend}-0`
+    if [ $nr_matched -eq 1 ]; then
+       grep -q "$TEST_STRING_PATTERN"$prev_uuid pmsg-${backend}-0
+       show_result $?
+    else
+       prlog "FAIL"
+       rc=1
+    fi
+else
+    prlog "FAIL"
+    rc=1
+fi
+
+prlog -n "Removing all files in pstore filesystem "
+files=`ls *-${backend}-*`
+operate_files $? "$files" rm
+
+exit $rc
diff --git a/tools/testing/selftests/pstore/pstore_tests b/tools/testing/selftests/pstore/pstore_tests
new file mode 100755 (executable)
index 0000000..f25d2a3
--- /dev/null
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+# pstore_tests - Check pstore's behavior before crash/reboot
+#
+# Copyright (C) Hitachi Ltd., 2015
+#  Written by Hiraku Toyooka <hiraku.toyooka.gu@hitachi.com>
+#
+# Released under the terms of the GPL v2.
+
+. ./common_tests
+
+prlog -n "Checking pstore console is registered ... "
+dmesg | grep -q "console \[pstore"
+show_result $?
+
+prlog -n "Checking /dev/pmsg0 exists ... "
+test -e /dev/pmsg0
+show_result $?
+
+prlog -n "Writing unique string to /dev/pmsg0 ... "
+if [ -e "/dev/pmsg0" ]; then
+    echo "${TEST_STRING_PATTERN}""$UUID" > /dev/pmsg0
+    show_result $?
+    echo "$UUID" > $TOP_DIR/uuid
+else
+    prlog "FAIL"
+    rc=1
+fi
+
+exit $rc
index 770f47adf2958b9970b993d2fee57c489a9cd1e2..e38cc54942dbf298dd1b880e3eabf5a9f2af29e6 100644 (file)
 #include <linux/prctl.h>
 #include <linux/ptrace.h>
 #include <linux/seccomp.h>
-#include <poll.h>
 #include <pthread.h>
 #include <semaphore.h>
 #include <signal.h>
 #include <stddef.h>
 #include <stdbool.h>
 #include <string.h>
+#include <time.h>
 #include <linux/elf.h>
 #include <sys/uio.h>
+#include <sys/utsname.h>
+#include <sys/fcntl.h>
+#include <sys/mman.h>
+#include <sys/times.h>
 
 #define _GNU_SOURCE
 #include <unistd.h>
@@ -428,14 +432,16 @@ TEST_SIGNAL(KILL_one, SIGSYS)
 
 TEST_SIGNAL(KILL_one_arg_one, SIGSYS)
 {
+       void *fatal_address;
        struct sock_filter filter[] = {
                BPF_STMT(BPF_LD|BPF_W|BPF_ABS,
                        offsetof(struct seccomp_data, nr)),
-               BPF_JUMP(BPF_JMP|BPF_JEQ|BPF_K, __NR_getpid, 1, 0),
+               BPF_JUMP(BPF_JMP|BPF_JEQ|BPF_K, __NR_times, 1, 0),
                BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_ALLOW),
                /* Only both with lower 32-bit for now. */
                BPF_STMT(BPF_LD|BPF_W|BPF_ABS, syscall_arg(0)),
-               BPF_JUMP(BPF_JMP|BPF_JEQ|BPF_K, 0x0C0FFEE, 0, 1),
+               BPF_JUMP(BPF_JMP|BPF_JEQ|BPF_K,
+                       (unsigned long)&fatal_address, 0, 1),
                BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_KILL),
                BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_ALLOW),
        };
@@ -445,7 +451,8 @@ TEST_SIGNAL(KILL_one_arg_one, SIGSYS)
        };
        long ret;
        pid_t parent = getppid();
-       pid_t pid = getpid();
+       struct tms timebuf;
+       clock_t clock = times(&timebuf);
 
        ret = prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0);
        ASSERT_EQ(0, ret);
@@ -454,17 +461,22 @@ TEST_SIGNAL(KILL_one_arg_one, SIGSYS)
        ASSERT_EQ(0, ret);
 
        EXPECT_EQ(parent, syscall(__NR_getppid));
-       EXPECT_EQ(pid, syscall(__NR_getpid));
-       /* getpid() should never return. */
-       EXPECT_EQ(0, syscall(__NR_getpid, 0x0C0FFEE));
+       EXPECT_LE(clock, syscall(__NR_times, &timebuf));
+       /* times() should never return. */
+       EXPECT_EQ(0, syscall(__NR_times, &fatal_address));
 }
 
 TEST_SIGNAL(KILL_one_arg_six, SIGSYS)
 {
+#ifndef __NR_mmap2
+       int sysno = __NR_mmap;
+#else
+       int sysno = __NR_mmap2;
+#endif
        struct sock_filter filter[] = {
                BPF_STMT(BPF_LD|BPF_W|BPF_ABS,
                        offsetof(struct seccomp_data, nr)),
-               BPF_JUMP(BPF_JMP|BPF_JEQ|BPF_K, __NR_getpid, 1, 0),
+               BPF_JUMP(BPF_JMP|BPF_JEQ|BPF_K, sysno, 1, 0),
                BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_ALLOW),
                /* Only both with lower 32-bit for now. */
                BPF_STMT(BPF_LD|BPF_W|BPF_ABS, syscall_arg(5)),
@@ -478,7 +490,8 @@ TEST_SIGNAL(KILL_one_arg_six, SIGSYS)
        };
        long ret;
        pid_t parent = getppid();
-       pid_t pid = getpid();
+       int fd;
+       void *map1, *map2;
 
        ret = prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0);
        ASSERT_EQ(0, ret);
@@ -486,10 +499,22 @@ TEST_SIGNAL(KILL_one_arg_six, SIGSYS)
        ret = prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, &prog);
        ASSERT_EQ(0, ret);
 
+       fd = open("/dev/zero", O_RDONLY);
+       ASSERT_NE(-1, fd);
+
        EXPECT_EQ(parent, syscall(__NR_getppid));
-       EXPECT_EQ(pid, syscall(__NR_getpid));
-       /* getpid() should never return. */
-       EXPECT_EQ(0, syscall(__NR_getpid, 1, 2, 3, 4, 5, 0x0C0FFEE));
+       map1 = (void *)syscall(sysno,
+               NULL, PAGE_SIZE, PROT_READ, MAP_PRIVATE, fd, PAGE_SIZE);
+       EXPECT_NE(MAP_FAILED, map1);
+       /* mmap2() should never return. */
+       map2 = (void *)syscall(sysno,
+                NULL, PAGE_SIZE, PROT_READ, MAP_PRIVATE, fd, 0x0C0FFEE);
+       EXPECT_EQ(MAP_FAILED, map2);
+
+       /* The test failed, so clean up the resources. */
+       munmap(map1, PAGE_SIZE);
+       munmap(map2, PAGE_SIZE);
+       close(fd);
 }
 
 /* TODO(wad) add 64-bit versus 32-bit arg tests. */
@@ -1247,8 +1272,8 @@ void change_syscall(struct __test_metadata *_metadata,
        ret = ptrace(PTRACE_GETREGSET, tracee, NT_PRSTATUS, &iov);
        EXPECT_EQ(0, ret);
 
-#if defined(__x86_64__) || defined(__i386__) || defined(__aarch64__) || \
-    defined(__powerpc__) || defined(__s390__)
+#if defined(__x86_64__) || defined(__i386__) || defined(__powerpc__) || \
+    defined(__s390__)
        {
                regs.SYSCALL_NUM = syscall;
        }
@@ -1262,6 +1287,18 @@ void change_syscall(struct __test_metadata *_metadata,
                EXPECT_EQ(0, ret);
        }
 
+#elif defined(__aarch64__)
+# ifndef NT_ARM_SYSTEM_CALL
+#  define NT_ARM_SYSTEM_CALL 0x404
+# endif
+       {
+               iov.iov_base = &syscall;
+               iov.iov_len = sizeof(syscall);
+               ret = ptrace(PTRACE_SETREGSET, tracee, NT_ARM_SYSTEM_CALL,
+                            &iov);
+               EXPECT_EQ(0, ret);
+       }
+
 #else
        ASSERT_EQ(1, 0) {
                TH_LOG("How is the syscall changed on this architecture?");
@@ -1272,6 +1309,8 @@ void change_syscall(struct __test_metadata *_metadata,
        if (syscall == -1)
                regs.SYSCALL_RET = 1;
 
+       iov.iov_base = &regs;
+       iov.iov_len = sizeof(regs);
        ret = ptrace(PTRACE_SETREGSET, tracee, NT_PRSTATUS, &iov);
        EXPECT_EQ(0, ret);
 }
@@ -2005,20 +2044,25 @@ TEST(syscall_restart)
                BPF_JUMP(BPF_JMP|BPF_JEQ|BPF_K, __NR_read, 5, 0),
                BPF_JUMP(BPF_JMP|BPF_JEQ|BPF_K, __NR_exit, 4, 0),
                BPF_JUMP(BPF_JMP|BPF_JEQ|BPF_K, __NR_rt_sigreturn, 3, 0),
-               BPF_JUMP(BPF_JMP|BPF_JEQ|BPF_K, __NR_poll, 4, 0),
+               BPF_JUMP(BPF_JMP|BPF_JEQ|BPF_K, __NR_nanosleep, 4, 0),
                BPF_JUMP(BPF_JMP|BPF_JEQ|BPF_K, __NR_restart_syscall, 4, 0),
 
                /* Allow __NR_write for easy logging. */
                BPF_JUMP(BPF_JMP|BPF_JEQ|BPF_K, __NR_write, 0, 1),
                BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_ALLOW),
                BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_KILL),
-               BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_TRACE|0x100), /* poll */
-               BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_TRACE|0x200), /* restart */
+               /* The nanosleep jump target. */
+               BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_TRACE|0x100),
+               /* The restart_syscall jump target. */
+               BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_TRACE|0x200),
        };
        struct sock_fprog prog = {
                .len = (unsigned short)ARRAY_SIZE(filter),
                .filter = filter,
        };
+#if defined(__arm__)
+       struct utsname utsbuf;
+#endif
 
        ASSERT_EQ(0, pipe(pipefd));
 
@@ -2027,10 +2071,7 @@ TEST(syscall_restart)
        if (child_pid == 0) {
                /* Child uses EXPECT not ASSERT to deliver status correctly. */
                char buf = ' ';
-               struct pollfd fds = {
-                       .fd = pipefd[0],
-                       .events = POLLIN,
-               };
+               struct timespec timeout = { };
 
                /* Attach parent as tracer and stop. */
                EXPECT_EQ(0, ptrace(PTRACE_TRACEME));
@@ -2054,10 +2095,11 @@ TEST(syscall_restart)
                        TH_LOG("Failed to get sync data from read()");
                }
 
-               /* Start poll to be interrupted. */
+               /* Start nanosleep to be interrupted. */
+               timeout.tv_sec = 1;
                errno = 0;
-               EXPECT_EQ(1, poll(&fds, 1, -1)) {
-                       TH_LOG("Call to poll() failed (errno %d)", errno);
+               EXPECT_EQ(0, nanosleep(&timeout, NULL)) {
+                       TH_LOG("Call to nanosleep() failed (errno %d)", errno);
                }
 
                /* Read final sync from parent. */
@@ -2082,14 +2124,14 @@ TEST(syscall_restart)
        ASSERT_EQ(0, ptrace(PTRACE_CONT, child_pid, NULL, 0));
        ASSERT_EQ(1, write(pipefd[1], ".", 1));
 
-       /* Wait for poll() to start. */
+       /* Wait for nanosleep() to start. */
        ASSERT_EQ(child_pid, waitpid(child_pid, &status, 0));
        ASSERT_EQ(true, WIFSTOPPED(status));
        ASSERT_EQ(SIGTRAP, WSTOPSIG(status));
        ASSERT_EQ(PTRACE_EVENT_SECCOMP, (status >> 16));
        ASSERT_EQ(0, ptrace(PTRACE_GETEVENTMSG, child_pid, NULL, &msg));
        ASSERT_EQ(0x100, msg);
-       EXPECT_EQ(__NR_poll, get_syscall(_metadata, child_pid));
+       EXPECT_EQ(__NR_nanosleep, get_syscall(_metadata, child_pid));
 
        /* Might as well check siginfo for sanity while we're here. */
        ASSERT_EQ(0, ptrace(PTRACE_GETSIGINFO, child_pid, NULL, &info));
@@ -2100,7 +2142,7 @@ TEST(syscall_restart)
        /* Verify signal delivery came from child (seccomp-triggered). */
        EXPECT_EQ(child_pid, info.si_pid);
 
-       /* Interrupt poll with SIGSTOP (which we'll need to handle). */
+       /* Interrupt nanosleep with SIGSTOP (which we'll need to handle). */
        ASSERT_EQ(0, kill(child_pid, SIGSTOP));
        ASSERT_EQ(0, ptrace(PTRACE_CONT, child_pid, NULL, 0));
        ASSERT_EQ(child_pid, waitpid(child_pid, &status, 0));
@@ -2110,7 +2152,7 @@ TEST(syscall_restart)
        ASSERT_EQ(0, ptrace(PTRACE_GETSIGINFO, child_pid, NULL, &info));
        EXPECT_EQ(getpid(), info.si_pid);
 
-       /* Restart poll with SIGCONT, which triggers restart_syscall. */
+       /* Restart nanosleep with SIGCONT, which triggers restart_syscall. */
        ASSERT_EQ(0, kill(child_pid, SIGCONT));
        ASSERT_EQ(0, ptrace(PTRACE_CONT, child_pid, NULL, 0));
        ASSERT_EQ(child_pid, waitpid(child_pid, &status, 0));
@@ -2124,16 +2166,25 @@ TEST(syscall_restart)
        ASSERT_EQ(SIGTRAP, WSTOPSIG(status));
        ASSERT_EQ(PTRACE_EVENT_SECCOMP, (status >> 16));
        ASSERT_EQ(0, ptrace(PTRACE_GETEVENTMSG, child_pid, NULL, &msg));
+
        ASSERT_EQ(0x200, msg);
        ret = get_syscall(_metadata, child_pid);
 #if defined(__arm__)
-       /* FIXME: ARM does not expose true syscall in registers. */
-       EXPECT_EQ(__NR_poll, ret);
-#else
-       EXPECT_EQ(__NR_restart_syscall, ret);
+       /*
+        * FIXME:
+        * - native ARM registers do NOT expose true syscall.
+        * - compat ARM registers on ARM64 DO expose true syscall.
+        */
+       ASSERT_EQ(0, uname(&utsbuf));
+       if (strncmp(utsbuf.machine, "arm", 3) == 0) {
+               EXPECT_EQ(__NR_nanosleep, ret);
+       } else
 #endif
+       {
+               EXPECT_EQ(__NR_restart_syscall, ret);
+       }
 
-       /* Write again to end poll. */
+       /* Write again to end test. */
        ASSERT_EQ(0, ptrace(PTRACE_CONT, child_pid, NULL, 0));
        ASSERT_EQ(1, write(pipefd[1], "!", 1));
        EXPECT_EQ(0, close(pipefd[1]));
index 8a3c29de7d49483a7a6aaa4e181b556a63a215a3..ff942ff7c9b367e8e306d6730c01fe92b1abd882 100644 (file)
@@ -19,6 +19,7 @@
  *   GNU General Public License for more details.
  */
 
+#include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <time.h>
index 2df21b3bb26dbc9a946b4f5ec5038aec6f562ca8..e11968b3677ee9e8e229a8cbb7b39878afbc9485 100755 (executable)
@@ -20,13 +20,26 @@ done < /proc/meminfo
 if [ -n "$freepgs" ] && [ -n "$pgsize" ]; then
        nr_hugepgs=`cat /proc/sys/vm/nr_hugepages`
        needpgs=`expr $needmem / $pgsize`
-       if [ $freepgs -lt $needpgs ]; then
+       tries=2
+       while [ $tries -gt 0 ] && [ $freepgs -lt $needpgs ]; do
                lackpgs=$(( $needpgs - $freepgs ))
+               echo 3 > /proc/sys/vm/drop_caches
                echo $(( $lackpgs + $nr_hugepgs )) > /proc/sys/vm/nr_hugepages
                if [ $? -ne 0 ]; then
                        echo "Please run this test as root"
                        exit 1
                fi
+               while read name size unit; do
+                       if [ "$name" = "HugePages_Free:" ]; then
+                               freepgs=$size
+                       fi
+               done < /proc/meminfo
+               tries=$((tries - 1))
+       done
+       if [ $freepgs -lt $needpgs ]; then
+               printf "Not enough huge pages available (%d < %d)\n" \
+                      $freepgs $needpgs
+               exit 1
        fi
 else
        echo "no hugetlbfs support in kernel?"