Merge tag 'omap-for-v4.2/wakeirq-drivers-v2' of git://git.kernel.org/pub/scm/linux...
authorKevin Hilman <khilman@linaro.org>
Wed, 1 Jul 2015 19:25:13 +0000 (12:25 -0700)
committerKevin Hilman <khilman@linaro.org>
Wed, 1 Jul 2015 19:25:13 +0000 (12:25 -0700)
Merge "omap generic wakeirq for v4.2 merge window" from Tony Lindgren:

Omap driver changes for v4.2 to switch drivers over to Linux generic
wake IRQ events for omap_hsmmc, 8250_omap and omap-serial
drivers.

The generic wake IRQs also fix issues that these drivers potentially
have with IRQ re-entrancy at least for serial-omap.

Note that because of dependencies and merge conflicts these are
based on Rafael's pm-wakeirq and Greg's tty-next branches.

* tag 'omap-for-v4.2/wakeirq-drivers-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: (148 commits)
  serial: 8250_omap: Move wake-up interrupt to generic wakeirq
  serial: omap: Switch wake-up interrupt to generic wakeirq
  tty: move linux/gsmmux.h to uapi
  doc: dt: add documentation for nxp,lpc1850-uart
  serial: 8250: add LPC18xx/43xx UART driver
  serial: 8250_uniphier: add UniPhier serial driver
  serial: 8250_dw: support ACPI platforms with integrated DMA engine
  serial: of_serial: check the return value of clk_prepare_enable()
  serial: of_serial: use devm_clk_get() instead of clk_get()
  serial: earlycon: Add support for big-endian MMIO accesses
  serial: sirf: use hrtimer for data rx
  serial: sirf: correct the fifo empty_bit
  serial: sirf: fix system hung on console log output
  serial: 8250: remove return statements from void function
  sc16is7xx: use kworker for RS-485 configuration
  sc16is7xx: use kworker to update ier bits
  sc16is7xx: use kworker for md_proc
  sc16is7xx: move RTS delay to workqueue
  sc16is7xx: use kthread_worker for tx_work and irq
  sc16is7xx: use LSR_TEMT_BIT in .tx_empty()
  ...

911 files changed:
Documentation/arm/CCN.txt
Documentation/arm/stm32/overview.txt [new file with mode: 0644]
Documentation/arm/stm32/stm32f429-overview.txt [new file with mode: 0644]
Documentation/devicetree/bindings/arm/altera/socfpga-sdram-controller.txt [new file with mode: 0644]
Documentation/devicetree/bindings/arm/arm-boards
Documentation/devicetree/bindings/arm/atmel-at91.txt
Documentation/devicetree/bindings/arm/bcm/brcm,bcm2835.txt
Documentation/devicetree/bindings/arm/bcm/brcm,bcm63138.txt
Documentation/devicetree/bindings/arm/cci.txt
Documentation/devicetree/bindings/arm/cpus.txt
Documentation/devicetree/bindings/arm/exynos/power_domain.txt
Documentation/devicetree/bindings/arm/fsl.txt
Documentation/devicetree/bindings/arm/hisilicon/hisilicon.txt
Documentation/devicetree/bindings/arm/marvell,berlin.txt
Documentation/devicetree/bindings/arm/scu.txt [new file with mode: 0644]
Documentation/devicetree/bindings/arm/ux500/boards.txt [new file with mode: 0644]
Documentation/devicetree/bindings/arm/zte.txt [new file with mode: 0644]
Documentation/devicetree/bindings/clock/at91-clock.txt
Documentation/devicetree/bindings/clock/hi6220-clock.txt [new file with mode: 0644]
Documentation/devicetree/bindings/clock/imx7d-clock.txt [new file with mode: 0644]
Documentation/devicetree/bindings/clock/marvell,berlin.txt [new file with mode: 0644]
Documentation/devicetree/bindings/clock/zx296702-clk.txt [new file with mode: 0644]
Documentation/devicetree/bindings/fuse/nvidia,tegra20-fuse.txt
Documentation/devicetree/bindings/input/touchscreen/tsc2005.txt
Documentation/devicetree/bindings/memory-controllers/nvidia,tegra-mc.txt
Documentation/devicetree/bindings/memory-controllers/tegra-emc.txt [new file with mode: 0644]
Documentation/devicetree/bindings/mfd/mfd.txt [new file with mode: 0644]
Documentation/devicetree/bindings/misc/nvidia,tegra20-apbmisc.txt
Documentation/devicetree/bindings/pci/xilinx-pcie.txt
Documentation/devicetree/bindings/pinctrl/berlin,pinctrl.txt [new file with mode: 0644]
Documentation/devicetree/bindings/pinctrl/fsl,imx7d-pinctrl.txt [new file with mode: 0644]
Documentation/devicetree/bindings/reset/berlin,reset.txt [new file with mode: 0644]
Documentation/devicetree/bindings/reset/brcm,bcm63138-pmb.txt [new file with mode: 0644]
Documentation/devicetree/bindings/rtc/s3c-rtc.txt
Documentation/devicetree/bindings/serial/pl011.txt
Documentation/devicetree/bindings/soc/sunxi/sram.txt [new file with mode: 0644]
Documentation/devicetree/bindings/spi/sh-msiof.txt
Documentation/devicetree/bindings/timer/cadence,ttc-timer.txt
Documentation/devicetree/bindings/usb/atmel-usb.txt
Documentation/devicetree/bindings/vendor-prefixes.txt
Documentation/i2c/slave-interface
Documentation/kernel-parameters.txt
Documentation/networking/udplite.txt
MAINTAINERS
Makefile
arch/arm/Kconfig
arch/arm/Kconfig.debug
arch/arm/Makefile
arch/arm/boot/dts/Makefile
arch/arm/boot/dts/am335x-baltos-ir5221.dts [new file with mode: 0644]
arch/arm/boot/dts/am335x-bone-common.dtsi
arch/arm/boot/dts/am335x-evm.dts
arch/arm/boot/dts/am335x-sl50.dts [new file with mode: 0644]
arch/arm/boot/dts/am3517.dtsi
arch/arm/boot/dts/am35xx-clocks.dtsi
arch/arm/boot/dts/am437x-gp-evm.dts
arch/arm/boot/dts/arm-realview-pb1176.dts
arch/arm/boot/dts/armada-370-db.dts
arch/arm/boot/dts/armada-370-dlink-dns327l.dts [new file with mode: 0644]
arch/arm/boot/dts/armada-370-synology-ds213j.dts
arch/arm/boot/dts/armada-370-xp.dtsi
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-caiman.dts [new file with mode: 0644]
arch/arm/boot/dts/armada-385-linksys-cobra.dts [new file with mode: 0644]
arch/arm/boot/dts/armada-385-linksys.dtsi [new file with mode: 0644]
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-398-db.dts
arch/arm/boot/dts/armada-39x.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-linksys-mamba.dts
arch/arm/boot/dts/armada-xp-synology-ds414.dts
arch/arm/boot/dts/armada-xp.dtsi
arch/arm/boot/dts/armv7-m.dtsi
arch/arm/boot/dts/at91-ariettag25.dts [new file with mode: 0644]
arch/arm/boot/dts/at91-kizbox.dts [new file with mode: 0644]
arch/arm/boot/dts/at91-kizbox2.dts [new file with mode: 0644]
arch/arm/boot/dts/at91-kizboxmini.dts [new file with mode: 0644]
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/at91rm9200ek.dts
arch/arm/boot/dts/at91sam9260.dtsi
arch/arm/boot/dts/at91sam9261.dtsi
arch/arm/boot/dts/at91sam9261ek.dts
arch/arm/boot/dts/at91sam9263.dtsi
arch/arm/boot/dts/at91sam9263ek.dts
arch/arm/boot/dts/at91sam9g20ek_common.dtsi
arch/arm/boot/dts/at91sam9g45.dtsi
arch/arm/boot/dts/at91sam9m10g45ek.dts
arch/arm/boot/dts/at91sam9n12.dtsi
arch/arm/boot/dts/at91sam9n12ek.dts
arch/arm/boot/dts/at91sam9rl.dtsi
arch/arm/boot/dts/at91sam9rlek.dts
arch/arm/boot/dts/at91sam9x5.dtsi
arch/arm/boot/dts/at91sam9x5ek.dtsi
arch/arm/boot/dts/axp209.dtsi
arch/arm/boot/dts/bcm-cygnus.dtsi
arch/arm/boot/dts/bcm2835-rpi-b-plus.dts
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-asus-rt-ac56u.dts [new file with mode: 0644]
arch/arm/boot/dts/bcm4708-asus-rt-ac68u.dts [new file with mode: 0644]
arch/arm/boot/dts/bcm4708-buffalo-wzr-1750dhp.dts
arch/arm/boot/dts/bcm4708-luxul-xwc-1000.dts
arch/arm/boot/dts/bcm4708-netgear-r6250.dts
arch/arm/boot/dts/bcm4708-netgear-r6300-v2.dts
arch/arm/boot/dts/bcm4708-smartrg-sr400ac.dts [new file with mode: 0644]
arch/arm/boot/dts/bcm47081-asus-rt-n18u.dts
arch/arm/boot/dts/bcm47081-buffalo-wzr-600dhp2.dts
arch/arm/boot/dts/bcm47081-buffalo-wzr-900dhp.dts
arch/arm/boot/dts/bcm4709-asus-rt-ac87u.dts [new file with mode: 0644]
arch/arm/boot/dts/bcm4709-buffalo-wxr-1900dhp.dts [new file with mode: 0644]
arch/arm/boot/dts/bcm4709-netgear-r8000.dts
arch/arm/boot/dts/bcm5301x-nand-cs0-bch8.dtsi [new file with mode: 0644]
arch/arm/boot/dts/bcm5301x.dtsi
arch/arm/boot/dts/bcm63138.dtsi
arch/arm/boot/dts/bcm7445-bcm97445svmb.dts
arch/arm/boot/dts/bcm7445.dtsi
arch/arm/boot/dts/bcm958300k.dts
arch/arm/boot/dts/bcm963138dvt.dts
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/dm816x.dtsi
arch/arm/boot/dts/dove-cm-a510.dts [deleted file]
arch/arm/boot/dts/dove-cm-a510.dtsi [new file with mode: 0644]
arch/arm/boot/dts/dove-sbc-a510.dts [new file with mode: 0644]
arch/arm/boot/dts/dove.dtsi
arch/arm/boot/dts/emev2-kzm9d.dts
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.dtsi
arch/arm/boot/dts/exynos4212.dtsi
arch/arm/boot/dts/exynos4412-odroid-common.dtsi
arch/arm/boot/dts/exynos4412-odroidx.dts
arch/arm/boot/dts/exynos4412-origen.dts
arch/arm/boot/dts/exynos4412-smdk4412.dts
arch/arm/boot/dts/exynos4412-tiny4412.dts
arch/arm/boot/dts/exynos4412-trats2.dts
arch/arm/boot/dts/exynos4412.dtsi
arch/arm/boot/dts/exynos4415.dtsi
arch/arm/boot/dts/exynos4x12-pinctrl.dtsi
arch/arm/boot/dts/exynos4x12.dtsi
arch/arm/boot/dts/exynos5.dtsi
arch/arm/boot/dts/exynos5250-smdk5250.dts
arch/arm/boot/dts/exynos5250-snow.dts
arch/arm/boot/dts/exynos5250.dtsi
arch/arm/boot/dts/exynos5260-xyref5260.dts
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/exynos5420.dtsi
arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi [new file with mode: 0644]
arch/arm/boot/dts/exynos5422-odroidxu3-lite.dts [new file with mode: 0644]
arch/arm/boot/dts/exynos5422-odroidxu3.dts
arch/arm/boot/dts/exynos5440-sd5v1.dts
arch/arm/boot/dts/exynos5440-ssdk5440.dts
arch/arm/boot/dts/exynos5440.dtsi
arch/arm/boot/dts/exynos5800-peach-pi.dts
arch/arm/boot/dts/imx23-olinuxino.dts
arch/arm/boot/dts/imx23.dtsi
arch/arm/boot/dts/imx28-cfa10036.dts
arch/arm/boot/dts/imx6dl-apf6dev.dts [new file with mode: 0644]
arch/arm/boot/dts/imx6dl-aristainetos2_4.dts [new file with mode: 0644]
arch/arm/boot/dts/imx6dl-aristainetos2_7.dts [new file with mode: 0644]
arch/arm/boot/dts/imx6dl-cubox-i.dts
arch/arm/boot/dts/imx6dl-gw551x.dts [new file with mode: 0644]
arch/arm/boot/dts/imx6dl-hummingboard.dts
arch/arm/boot/dts/imx6dl.dtsi
arch/arm/boot/dts/imx6q-apf6dev.dts [new file with mode: 0644]
arch/arm/boot/dts/imx6q-cubox-i.dts
arch/arm/boot/dts/imx6q-gw551x.dts [new file with mode: 0644]
arch/arm/boot/dts/imx6q-hummingboard.dts
arch/arm/boot/dts/imx6qdl-apf6.dtsi [new file with mode: 0644]
arch/arm/boot/dts/imx6qdl-apf6dev.dtsi [new file with mode: 0644]
arch/arm/boot/dts/imx6qdl-aristainetos2.dtsi [new file with mode: 0644]
arch/arm/boot/dts/imx6qdl-cubox-i.dtsi
arch/arm/boot/dts/imx6qdl-gw551x.dtsi [new file with mode: 0644]
arch/arm/boot/dts/imx6qdl-hummingboard.dtsi
arch/arm/boot/dts/imx6qdl-microsom-ar8035.dtsi
arch/arm/boot/dts/imx6qdl-microsom.dtsi
arch/arm/boot/dts/imx6qdl-nitrogen6x.dtsi
arch/arm/boot/dts/imx6qdl-sabrelite.dtsi
arch/arm/boot/dts/imx6qdl.dtsi
arch/arm/boot/dts/imx6sl-warp.dts
arch/arm/boot/dts/imx7d-pinfunc.h [new file with mode: 0644]
arch/arm/boot/dts/imx7d-sdb.dts [new file with mode: 0644]
arch/arm/boot/dts/imx7d.dtsi [new file with mode: 0644]
arch/arm/boot/dts/integrator.dtsi
arch/arm/boot/dts/k2e-evm.dts
arch/arm/boot/dts/k2e-netcp.dtsi [new file with mode: 0644]
arch/arm/boot/dts/k2e.dtsi
arch/arm/boot/dts/k2hk-evm.dts
arch/arm/boot/dts/k2hk-netcp.dtsi [new file with mode: 0644]
arch/arm/boot/dts/k2hk.dtsi
arch/arm/boot/dts/k2l-evm.dts
arch/arm/boot/dts/k2l-netcp.dtsi [new file with mode: 0644]
arch/arm/boot/dts/k2l.dtsi
arch/arm/boot/dts/kirkwood-b3.dts
arch/arm/boot/dts/kirkwood-cloudbox.dts
arch/arm/boot/dts/kirkwood-dir665.dts
arch/arm/boot/dts/kirkwood-dreamplug.dts
arch/arm/boot/dts/kirkwood-lsxl.dtsi
arch/arm/boot/dts/kirkwood-mv88f6281gtw-ge.dts
arch/arm/boot/dts/kirkwood-netxbig.dtsi
arch/arm/boot/dts/kirkwood-ns2-common.dtsi
arch/arm/boot/dts/kirkwood-rd88f6192.dts
arch/arm/boot/dts/kirkwood-synology.dtsi
arch/arm/boot/dts/kirkwood-t5325.dts
arch/arm/boot/dts/kirkwood-ts219.dtsi
arch/arm/boot/dts/kizbox.dts [deleted file]
arch/arm/boot/dts/logicpd-torpedo-37xx-devkit.dts [new file with mode: 0644]
arch/arm/boot/dts/logicpd-torpedo-som.dtsi [new file with mode: 0644]
arch/arm/boot/dts/lpc18xx.dtsi [new file with mode: 0644]
arch/arm/boot/dts/lpc4350-hitex-eval.dts [new file with mode: 0644]
arch/arm/boot/dts/lpc4350.dtsi [new file with mode: 0644]
arch/arm/boot/dts/lpc4357-ea4357-devkit.dts [new file with mode: 0644]
arch/arm/boot/dts/lpc4357.dtsi [new file with mode: 0644]
arch/arm/boot/dts/mt8127.dtsi
arch/arm/boot/dts/mt8135-pinfunc.h [new file with mode: 0644]
arch/arm/boot/dts/mt8135.dtsi
arch/arm/boot/dts/omap3-cm-t3517.dts
arch/arm/boot/dts/omap3-devkit8000.dts
arch/arm/boot/dts/omap3-evm-common.dtsi
arch/arm/boot/dts/omap3-gta04.dtsi
arch/arm/boot/dts/omap3-ldp.dts
arch/arm/boot/dts/omap3-n900.dts
arch/arm/boot/dts/omap5-uevm.dts
arch/arm/boot/dts/pxa27x.dtsi
arch/arm/boot/dts/pxa2xx.dtsi
arch/arm/boot/dts/pxa3xx.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-msm8660.dtsi
arch/arm/boot/dts/qcom-pm8841.dtsi
arch/arm/boot/dts/qcom-pm8941.dtsi
arch/arm/boot/dts/qcom-pma8084.dtsi
arch/arm/boot/dts/r8a73a4-ape6evm.dts
arch/arm/boot/dts/r8a73a4.dtsi
arch/arm/boot/dts/r8a7740-armadillo800eva.dts
arch/arm/boot/dts/r8a7740.dtsi
arch/arm/boot/dts/r8a7778-bockw-reference.dts
arch/arm/boot/dts/r8a7778-bockw.dts
arch/arm/boot/dts/r8a7778.dtsi
arch/arm/boot/dts/r8a7779-marzen.dts
arch/arm/boot/dts/r8a7779.dtsi
arch/arm/boot/dts/r8a7790-lager.dts
arch/arm/boot/dts/r8a7790.dtsi
arch/arm/boot/dts/r8a7791-henninger.dts
arch/arm/boot/dts/r8a7791-koelsch.dts
arch/arm/boot/dts/r8a7791.dtsi
arch/arm/boot/dts/r8a7794.dtsi
arch/arm/boot/dts/rk3066a-bqcurie2.dts
arch/arm/boot/dts/rk3066a.dtsi
arch/arm/boot/dts/rk3188-radxarock.dts
arch/arm/boot/dts/rk3188.dtsi
arch/arm/boot/dts/rk3288-evb-act8846.dts
arch/arm/boot/dts/rk3288-evb-rk808.dts
arch/arm/boot/dts/rk3288-evb.dtsi
arch/arm/boot/dts/rk3288-firefly.dtsi
arch/arm/boot/dts/rk3288-popmetal.dts
arch/arm/boot/dts/rk3288-thermal.dtsi
arch/arm/boot/dts/rk3288.dtsi
arch/arm/boot/dts/rk3xxx.dtsi
arch/arm/boot/dts/s3c2416-smdk2416.dts
arch/arm/boot/dts/s3c2416.dtsi
arch/arm/boot/dts/sama5d3.dtsi
arch/arm/boot/dts/sama5d3xcm.dtsi
arch/arm/boot/dts/sama5d4.dtsi
arch/arm/boot/dts/sh73a0-kzm9g.dts
arch/arm/boot/dts/sh73a0.dtsi
arch/arm/boot/dts/socfpga.dtsi
arch/arm/boot/dts/socfpga_arria10.dtsi
arch/arm/boot/dts/socfpga_arria10_socdk.dts [deleted file]
arch/arm/boot/dts/socfpga_arria10_socdk.dtsi [new file with mode: 0644]
arch/arm/boot/dts/socfpga_arria10_socdk_sdmmc.dts [new file with mode: 0644]
arch/arm/boot/dts/socfpga_cyclone5_sockit.dts
arch/arm/boot/dts/socfpga_cyclone5_socrates.dts
arch/arm/boot/dts/ste-dbx5x0.dtsi
arch/arm/boot/dts/ste-href-stuib.dtsi
arch/arm/boot/dts/ste-href-tvk1281618.dtsi
arch/arm/boot/dts/ste-nomadik-stn8815.dtsi
arch/arm/boot/dts/ste-snowball.dts
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/stih416-b2020e.dts
arch/arm/boot/dts/stih416-pinctrl.dtsi
arch/arm/boot/dts/stih416.dtsi
arch/arm/boot/dts/stih418-b2199.dts
arch/arm/boot/dts/stihxxx-b2120.dtsi
arch/arm/boot/dts/stm32f429-disco.dts [new file with mode: 0644]
arch/arm/boot/dts/stm32f429.dtsi [new file with mode: 0644]
arch/arm/boot/dts/sun4i-a10-a1000.dts
arch/arm/boot/dts/sun4i-a10-ba10-tvbox.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 [new file with mode: 0644]
arch/arm/boot/dts/sun4i-a10-hackberry.dts
arch/arm/boot/dts/sun4i-a10-hyundai-a7hd.dts
arch/arm/boot/dts/sun4i-a10-inet97fv2.dts
arch/arm/boot/dts/sun4i-a10-jesurun-q5.dts [new file with mode: 0644]
arch/arm/boot/dts/sun4i-a10-marsboard.dts
arch/arm/boot/dts/sun4i-a10-mini-xplus.dts
arch/arm/boot/dts/sun4i-a10-mk802.dts
arch/arm/boot/dts/sun4i-a10-mk802ii.dts
arch/arm/boot/dts/sun4i-a10-olinuxino-lime.dts
arch/arm/boot/dts/sun4i-a10-pcduino.dts
arch/arm/boot/dts/sun4i-a10.dtsi
arch/arm/boot/dts/sun5i-a10s-auxtek-t004.dts [new file with mode: 0644]
arch/arm/boot/dts/sun5i-a10s-mk802.dts
arch/arm/boot/dts/sun5i-a10s-olinuxino-micro.dts
arch/arm/boot/dts/sun5i-a10s-r7-tv-dongle.dts
arch/arm/boot/dts/sun5i-a10s.dtsi
arch/arm/boot/dts/sun5i-a13-hsg-h702.dts
arch/arm/boot/dts/sun5i-a13-olinuxino-micro.dts
arch/arm/boot/dts/sun5i-a13-olinuxino.dts
arch/arm/boot/dts/sun5i-a13-utoo-p66.dts [new file with mode: 0644]
arch/arm/boot/dts/sun5i-a13.dtsi
arch/arm/boot/dts/sun5i.dtsi [new file with mode: 0644]
arch/arm/boot/dts/sun6i-a31-app4-evb1.dts
arch/arm/boot/dts/sun6i-a31-colombus.dts
arch/arm/boot/dts/sun6i-a31-hummingbird.dts
arch/arm/boot/dts/sun6i-a31-i7.dts [new file with mode: 0644]
arch/arm/boot/dts/sun6i-a31-m9.dts
arch/arm/boot/dts/sun6i-a31-mele-a1000g-quad.dts [new file with mode: 0644]
arch/arm/boot/dts/sun6i-a31.dtsi
arch/arm/boot/dts/sun6i-a31s-cs908.dts
arch/arm/boot/dts/sun6i-a31s.dtsi
arch/arm/boot/dts/sun7i-a20-bananapi.dts
arch/arm/boot/dts/sun7i-a20-bananapro.dts
arch/arm/boot/dts/sun7i-a20-cubieboard2.dts
arch/arm/boot/dts/sun7i-a20-cubietruck.dts
arch/arm/boot/dts/sun7i-a20-hummingbird.dts
arch/arm/boot/dts/sun7i-a20-i12-tvbox.dts
arch/arm/boot/dts/sun7i-a20-m3.dts
arch/arm/boot/dts/sun7i-a20-mk808c.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 [new file with mode: 0644]
arch/arm/boot/dts/sun7i-a20-orangepi.dts [new file with mode: 0644]
arch/arm/boot/dts/sun7i-a20-pcduino3-nano.dts [new file with mode: 0644]
arch/arm/boot/dts/sun7i-a20-pcduino3.dts
arch/arm/boot/dts/sun7i-a20-wexler-tab7200.dts [new file with mode: 0644]
arch/arm/boot/dts/sun7i-a20.dtsi
arch/arm/boot/dts/sun8i-a23-a33.dtsi [new file with mode: 0644]
arch/arm/boot/dts/sun8i-a23-evb.dts [new file with mode: 0644]
arch/arm/boot/dts/sun8i-a23-ippo-q8h-v1.2.dts
arch/arm/boot/dts/sun8i-a23-ippo-q8h-v5.dts
arch/arm/boot/dts/sun8i-a23.dtsi
arch/arm/boot/dts/sun8i-a33-et-q8-v1.6.dts [new file with mode: 0644]
arch/arm/boot/dts/sun8i-a33-ga10h-v1.1.dts [new file with mode: 0644]
arch/arm/boot/dts/sun8i-a33-sinlinx-sina33.dts [new file with mode: 0644]
arch/arm/boot/dts/sun8i-a33.dtsi [new file with mode: 0644]
arch/arm/boot/dts/sun9i-a80-cubieboard4.dts [new file with mode: 0644]
arch/arm/boot/dts/sun9i-a80-optimus.dts
arch/arm/boot/dts/sun9i-a80.dtsi
arch/arm/boot/dts/sunxi-common-regulators.dtsi
arch/arm/boot/dts/tegra124-jetson-tk1.dts
arch/arm/boot/dts/tegra124-venice2.dts
arch/arm/boot/dts/tegra124.dtsi
arch/arm/boot/dts/tegra20-seaboard.dts
arch/arm/boot/dts/tegra20.dtsi
arch/arm/boot/dts/tegra30-cardhu.dtsi
arch/arm/boot/dts/tegra30.dtsi
arch/arm/boot/dts/uniphier-ph1-ld4-ref.dts [new file with mode: 0644]
arch/arm/boot/dts/uniphier-ph1-ld4.dtsi [new file with mode: 0644]
arch/arm/boot/dts/uniphier-ph1-pro4-ref.dts [new file with mode: 0644]
arch/arm/boot/dts/uniphier-ph1-pro4.dtsi [new file with mode: 0644]
arch/arm/boot/dts/uniphier-ph1-sld3-ref.dts [new file with mode: 0644]
arch/arm/boot/dts/uniphier-ph1-sld3.dtsi [new file with mode: 0644]
arch/arm/boot/dts/uniphier-ph1-sld8-ref.dts [new file with mode: 0644]
arch/arm/boot/dts/uniphier-ph1-sld8.dtsi [new file with mode: 0644]
arch/arm/boot/dts/uniphier-support-card.dtsi [new file with mode: 0644]
arch/arm/boot/dts/vf-colibri.dtsi
arch/arm/boot/dts/vf610-cosmic.dts
arch/arm/boot/dts/vf610-pinfunc.h
arch/arm/boot/dts/vf610-twr.dts
arch/arm/boot/dts/vf610m4-colibri.dts [new file with mode: 0644]
arch/arm/boot/dts/vf610m4.dtsi [new file with mode: 0644]
arch/arm/boot/dts/zx296702-ad1.dts [new file with mode: 0644]
arch/arm/boot/dts/zx296702.dtsi [new file with mode: 0644]
arch/arm/boot/dts/zynq-7000.dtsi
arch/arm/boot/dts/zynq-parallella.dts
arch/arm/boot/dts/zynq-zc702.dts
arch/arm/boot/dts/zynq-zc706.dts
arch/arm/boot/dts/zynq-zed.dts
arch/arm/boot/dts/zynq-zybo.dts
arch/arm/configs/at91_dt_defconfig
arch/arm/configs/efm32_defconfig
arch/arm/configs/exynos_defconfig
arch/arm/configs/hisi_defconfig
arch/arm/configs/imx_v6_v7_defconfig
arch/arm/configs/keystone_defconfig
arch/arm/configs/lpc18xx_defconfig [new file with mode: 0644]
arch/arm/configs/multi_v7_defconfig
arch/arm/configs/omap2plus_defconfig
arch/arm/configs/qcom_defconfig
arch/arm/configs/sama5_defconfig
arch/arm/configs/shmobile_defconfig
arch/arm/configs/stm32_defconfig [new file with mode: 0644]
arch/arm/configs/tegra_defconfig
arch/arm/configs/u8500_defconfig
arch/arm/configs/vf610m4_defconfig [new file with mode: 0644]
arch/arm/configs/zx_defconfig [new file with mode: 0644]
arch/arm/include/asm/firmware.h
arch/arm/include/asm/suspend.h
arch/arm/include/asm/vfp.h
arch/arm/include/debug/8250.S
arch/arm/include/debug/efm32.S
arch/arm/include/debug/imx-uart.h
arch/arm/include/debug/pl01x.S
arch/arm/kernel/debug.S
arch/arm/kernel/sleep.S
arch/arm/mach-at91/Makefile
arch/arm/mach-at91/Makefile.boot [deleted file]
arch/arm/mach-at91/include/mach/at91_ramc.h [deleted file]
arch/arm/mach-at91/include/mach/at91rm9200_mc.h [deleted file]
arch/arm/mach-at91/include/mach/at91sam9_smc.h [deleted file]
arch/arm/mach-at91/pm.c
arch/arm/mach-at91/pm.h
arch/arm/mach-at91/pm_suspend.S
arch/arm/mach-at91/sam9_smc.c [deleted file]
arch/arm/mach-at91/sam9_smc.h [deleted file]
arch/arm/mach-bcm/Kconfig
arch/arm/mach-bcm/Makefile
arch/arm/mach-bcm/bcm63xx_headsmp.S [new file with mode: 0644]
arch/arm/mach-bcm/bcm63xx_pmb.c [new file with mode: 0644]
arch/arm/mach-bcm/bcm63xx_smp.c [new file with mode: 0644]
arch/arm/mach-bcm/bcm63xx_smp.h [new file with mode: 0644]
arch/arm/mach-bcm/bcm_5301x.c
arch/arm/mach-bcm/board_bcm2835.c
arch/arm/mach-bcm/brcmstb.h [deleted file]
arch/arm/mach-bcm/headsmp-brcmstb.S [deleted file]
arch/arm/mach-bcm/platsmp-brcmstb.c
arch/arm/mach-berlin/Kconfig
arch/arm/mach-berlin/headsmp.S
arch/arm/mach-berlin/platsmp.c
arch/arm/mach-davinci/include/mach/da8xx.h
arch/arm/mach-ep93xx/simone.c
arch/arm/mach-exynos/common.h
arch/arm/mach-exynos/exynos.c
arch/arm/mach-exynos/firmware.c
arch/arm/mach-exynos/platsmp.c
arch/arm/mach-exynos/pm.c
arch/arm/mach-exynos/pm_domains.c
arch/arm/mach-exynos/pmu.c
arch/arm/mach-exynos/suspend.c
arch/arm/mach-hisi/Makefile
arch/arm/mach-hisi/core.h
arch/arm/mach-hisi/headsmp.S [deleted file]
arch/arm/mach-hisi/platsmp.c
arch/arm/mach-imx/Kconfig
arch/arm/mach-imx/Makefile
arch/arm/mach-imx/Makefile.boot [new file with mode: 0644]
arch/arm/mach-imx/anatop.c
arch/arm/mach-imx/clk-busy.c [deleted file]
arch/arm/mach-imx/clk-cpu.c [deleted file]
arch/arm/mach-imx/clk-fixup-div.c [deleted file]
arch/arm/mach-imx/clk-fixup-mux.c [deleted file]
arch/arm/mach-imx/clk-gate-exclusive.c [deleted file]
arch/arm/mach-imx/clk-gate2.c [deleted file]
arch/arm/mach-imx/clk-imx1.c [deleted file]
arch/arm/mach-imx/clk-imx21.c [deleted file]
arch/arm/mach-imx/clk-imx25.c [deleted file]
arch/arm/mach-imx/clk-imx27.c [deleted file]
arch/arm/mach-imx/clk-imx31.c [deleted file]
arch/arm/mach-imx/clk-imx35.c [deleted file]
arch/arm/mach-imx/clk-imx51-imx53.c [deleted file]
arch/arm/mach-imx/clk-imx6q.c [deleted file]
arch/arm/mach-imx/clk-imx6sl.c [deleted file]
arch/arm/mach-imx/clk-imx6sx.c [deleted file]
arch/arm/mach-imx/clk-pfd.c [deleted file]
arch/arm/mach-imx/clk-pllv1.c [deleted file]
arch/arm/mach-imx/clk-pllv2.c [deleted file]
arch/arm/mach-imx/clk-pllv3.c [deleted file]
arch/arm/mach-imx/clk-vf610.c [deleted file]
arch/arm/mach-imx/clk.c [deleted file]
arch/arm/mach-imx/clk.h [deleted file]
arch/arm/mach-imx/common.h
arch/arm/mach-imx/cpu.c
arch/arm/mach-imx/cpuidle-imx6q.c
arch/arm/mach-imx/cpuidle-imx6sl.c
arch/arm/mach-imx/cpuidle-imx6sx.c
arch/arm/mach-imx/eukrea_mbimxsd35-baseboard.c [deleted file]
arch/arm/mach-imx/gpc.c
arch/arm/mach-imx/hardware.h
arch/arm/mach-imx/headsmp.S
arch/arm/mach-imx/iomux-imx31.c
arch/arm/mach-imx/mach-cpuimx35.c [deleted file]
arch/arm/mach-imx/mach-imx6q.c
arch/arm/mach-imx/mach-imx6sl.c
arch/arm/mach-imx/mach-imx6sx.c
arch/arm/mach-imx/mach-imx7d.c [new file with mode: 0644]
arch/arm/mach-imx/mach-vf610.c
arch/arm/mach-imx/mmdc.c
arch/arm/mach-imx/mx27.h
arch/arm/mach-imx/mx3x.h
arch/arm/mach-imx/mxc.h
arch/arm/mach-imx/pm-imx5.c
arch/arm/mach-imx/pm-imx6.c
arch/arm/mach-imx/suspend-imx53.S [new file with mode: 0644]
arch/arm/mach-imx/time.c [deleted file]
arch/arm/mach-iop13xx/include/mach/time.h
arch/arm/mach-ixp4xx/include/mach/platform.h
arch/arm/mach-ks8695/include/mach/hardware.h
arch/arm/mach-lpc18xx/Makefile [new file with mode: 0644]
arch/arm/mach-lpc18xx/Makefile.boot [new file with mode: 0644]
arch/arm/mach-lpc18xx/board-dt.c [new file with mode: 0644]
arch/arm/mach-mvebu/headsmp-a9.S
arch/arm/mach-omap1/ams-delta-fiq-handler.S
arch/arm/mach-omap1/board-ams-delta.c
arch/arm/mach-omap1/board-fsample.c
arch/arm/mach-omap1/board-generic.c
arch/arm/mach-omap1/board-h2.c
arch/arm/mach-omap1/board-h3-mmc.c
arch/arm/mach-omap1/board-h3.c
arch/arm/mach-omap1/board-htcherald.c
arch/arm/mach-omap1/board-innovator.c
arch/arm/mach-omap1/board-nokia770.c
arch/arm/mach-omap1/board-osk.c
arch/arm/mach-omap1/board-palmte.c
arch/arm/mach-omap1/board-palmtt.c
arch/arm/mach-omap1/board-palmz71.c
arch/arm/mach-omap1/board-perseus2.c
arch/arm/mach-omap1/board-sx1.c
arch/arm/mach-omap1/board-voiceblue.c
arch/arm/mach-omap1/common.h
arch/arm/mach-omap1/dma.c
arch/arm/mach-omap1/gpio16xx.c
arch/arm/mach-omap1/gpio7xx.c
arch/arm/mach-omap1/i2c.c
arch/arm/mach-omap1/include/mach/entry-macro.S [deleted file]
arch/arm/mach-omap1/include/mach/irqs.h
arch/arm/mach-omap1/include/mach/memory.h
arch/arm/mach-omap1/include/mach/serial.h
arch/arm/mach-omap1/include/mach/soc.h
arch/arm/mach-omap1/irq.c
arch/arm/mach-omap1/mux.c
arch/arm/mach-omap1/pm.c
arch/arm/mach-omap1/serial.c
arch/arm/mach-omap1/timer.c
arch/arm/mach-omap2/Kconfig
arch/arm/mach-omap2/Makefile
arch/arm/mach-omap2/board-cm-t35.c [deleted file]
arch/arm/mach-omap2/board-omap3beagle.c [deleted file]
arch/arm/mach-omap2/board-overo.c [deleted file]
arch/arm/mach-omap2/control.c
arch/arm/mach-omap2/control.h
arch/arm/mach-omap2/devices.c
arch/arm/mach-omap2/fb.c
arch/arm/mach-omap2/gpmc-onenand.c
arch/arm/mach-omap2/hsmmc.c
arch/arm/mach-omap2/omap-wakeupgen.c
arch/arm/mach-omap2/omap_device.c
arch/arm/mach-omap2/omap_hwmod.c
arch/arm/mach-omap2/omap_hwmod.h
arch/arm/mach-omap2/omap_hwmod_2xxx_ipblock_data.c
arch/arm/mach-omap2/omap_hwmod_33xx_43xx_common_data.h
arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c
arch/arm/mach-omap2/omap_hwmod_33xx_data.c
arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
arch/arm/mach-omap2/omap_hwmod_43xx_data.c
arch/arm/mach-omap2/omap_hwmod_44xx_data.c
arch/arm/mach-omap2/omap_hwmod_7xx_data.c
arch/arm/mach-omap2/omap_hwmod_81xx_data.c
arch/arm/mach-omap2/opp2430_data.c
arch/arm/mach-omap2/pdata-quirks.c
arch/arm/mach-omap2/pmu.c
arch/arm/mach-omap2/prcm43xx.h
arch/arm/mach-omap2/sdrc2xxx.c
arch/arm/mach-omap2/serial.c
arch/arm/mach-omap2/sleep34xx.S
arch/arm/mach-omap2/sram242x.S
arch/arm/mach-omap2/sram243x.S
arch/arm/mach-prima2/headsmp.S
arch/arm/mach-pxa/Makefile
arch/arm/mach-pxa/clock-pxa2xx.c [deleted file]
arch/arm/mach-pxa/clock-pxa3xx.c [deleted file]
arch/arm/mach-pxa/clock.c [deleted file]
arch/arm/mach-pxa/clock.h [deleted file]
arch/arm/mach-pxa/eseries.c
arch/arm/mach-pxa/generic.c
arch/arm/mach-pxa/generic.h
arch/arm/mach-pxa/irq.c
arch/arm/mach-pxa/lubbock.c
arch/arm/mach-pxa/mp900.c
arch/arm/mach-pxa/pxa25x.c
arch/arm/mach-pxa/pxa27x.c
arch/arm/mach-pxa/pxa300.c
arch/arm/mach-pxa/pxa320.c
arch/arm/mach-pxa/pxa3xx.c
arch/arm/mach-pxa/raumfeld.c
arch/arm/mach-pxa/tosa.c
arch/arm/mach-rockchip/core.h
arch/arm/mach-rockchip/headsmp.S
arch/arm/mach-rockchip/platsmp.c
arch/arm/mach-shmobile/Kconfig
arch/arm/mach-shmobile/common.h
arch/arm/mach-shmobile/headsmp-scu.S
arch/arm/mach-shmobile/headsmp.S
arch/arm/mach-shmobile/platsmp-apmu.c
arch/arm/mach-socfpga/Kconfig
arch/arm/mach-socfpga/Makefile
arch/arm/mach-socfpga/core.h
arch/arm/mach-socfpga/headsmp.S
arch/arm/mach-socfpga/platsmp.c
arch/arm/mach-socfpga/pm.c [new file with mode: 0644]
arch/arm/mach-socfpga/self-refresh.S [new file with mode: 0644]
arch/arm/mach-socfpga/socfpga.c
arch/arm/mach-sti/Kconfig
arch/arm/mach-stm32/Makefile [new file with mode: 0644]
arch/arm/mach-stm32/Makefile.boot [new file with mode: 0644]
arch/arm/mach-stm32/board-dt.c [new file with mode: 0644]
arch/arm/mach-sunxi/platsmp.c
arch/arm/mach-tegra/Makefile
arch/arm/mach-tegra/cpuidle-tegra20.c
arch/arm/mach-tegra/headsmp.S [deleted file]
arch/arm/mach-tegra/reset-handler.S
arch/arm/mach-tegra/reset.c
arch/arm/mach-tegra/reset.h
arch/arm/mach-tegra/sleep-tegra20.S
arch/arm/mach-tegra/sleep-tegra30.S
arch/arm/mach-tegra/sleep.h
arch/arm/mach-tegra/tegra.c
arch/arm/mach-uniphier/Kconfig [new file with mode: 0644]
arch/arm/mach-uniphier/Makefile [new file with mode: 0644]
arch/arm/mach-uniphier/platsmp.c [new file with mode: 0644]
arch/arm/mach-uniphier/uniphier.c [new file with mode: 0644]
arch/arm/mach-ux500/cache-l2x0.c
arch/arm/mach-ux500/cpu-db8500.c
arch/arm/mach-ux500/cpu.c
arch/arm/mach-ux500/id.c
arch/arm/mach-ux500/platsmp.c
arch/arm/mach-ux500/pm.c
arch/arm/mach-ux500/setup.h
arch/arm/mach-zx/Kconfig [new file with mode: 0644]
arch/arm/mach-zx/Makefile [new file with mode: 0644]
arch/arm/mach-zx/core.h [new file with mode: 0644]
arch/arm/mach-zx/headsmp.S [new file with mode: 0644]
arch/arm/mach-zx/platsmp.c [new file with mode: 0644]
arch/arm/mach-zx/zx296702.c [new file with mode: 0644]
arch/arm/mach-zynq/common.c
arch/arm/mach-zynq/common.h
arch/arm/mach-zynq/headsmp.S
arch/arm/mach-zynq/platsmp.c
arch/arm/mach-zynq/slcr.c
arch/arm/mm/proc-v7.S
arch/arm/plat-omap/dma.c
arch/arm/plat-samsung/adc.c
arch/arm/vfp/vfpmodule.c
arch/arm64/Kconfig
arch/arm64/boot/dts/Makefile
arch/arm64/boot/dts/apm/apm-storm.dtsi
arch/arm64/boot/dts/arm/Makefile
arch/arm64/boot/dts/arm/juno-base.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/arm/juno-clocks.dtsi
arch/arm64/boot/dts/arm/juno-motherboard.dtsi
arch/arm64/boot/dts/arm/juno-r1.dts [new file with mode: 0644]
arch/arm64/boot/dts/arm/juno.dts
arch/arm64/boot/dts/hisilicon/Makefile [new file with mode: 0644]
arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts [new file with mode: 0644]
arch/arm64/boot/dts/hisilicon/hi6220.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/mediatek/mt8173-evb.dts
arch/arm64/boot/dts/mediatek/mt8173.dtsi
arch/arm64/boot/dts/qcom/apq8016-sbc-pmic-pins.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/qcom/apq8016-sbc-soc-pins.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi
arch/arm64/boot/dts/qcom/msm8916-mtp.dtsi
arch/arm64/boot/dts/qcom/msm8916.dtsi
arch/arm64/boot/dts/qcom/pm8916.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/skeleton.dtsi [deleted file]
arch/arm64/configs/defconfig
arch/blackfin/include/asm/io.h
arch/mips/cobalt/Makefile
arch/mips/include/asm/pgtable-bits.h
arch/mips/include/asm/switch_to.h
arch/mips/loongson/common/Makefile
arch/s390/net/bpf_jit.h
arch/s390/net/bpf_jit_comp.c
arch/score/lib/string.S
arch/x86/kernel/cpu/perf_event_intel_uncore.c
arch/x86/kernel/cpu/perf_event_intel_uncore.h
arch/x86/kernel/cpu/perf_event_intel_uncore_snbep.c
arch/x86/kvm/lapic.c
arch/x86/kvm/mmu.c
block/blk-mq.c
block/genhd.c
drivers/ata/Kconfig
drivers/ata/ahci_mvebu.c
drivers/ata/pata_at91.c
drivers/ata/pata_octeon_cf.c
drivers/block/Kconfig
drivers/block/zram/zram_drv.c
drivers/bus/Kconfig
drivers/bus/arm-cci.c
drivers/bus/arm-ccn.c
drivers/bus/brcmstb_gisb.c
drivers/bus/mvebu-mbus.c
drivers/clk/Makefile
drivers/clk/at91/clk-peripheral.c
drivers/clk/at91/clk-pll.c
drivers/clk/at91/pmc.h
drivers/clk/berlin/bg2.c
drivers/clk/berlin/bg2q.c
drivers/clk/imx/Makefile [new file with mode: 0644]
drivers/clk/imx/clk-busy.c [new file with mode: 0644]
drivers/clk/imx/clk-cpu.c [new file with mode: 0644]
drivers/clk/imx/clk-fixup-div.c [new file with mode: 0644]
drivers/clk/imx/clk-fixup-mux.c [new file with mode: 0644]
drivers/clk/imx/clk-gate-exclusive.c [new file with mode: 0644]
drivers/clk/imx/clk-gate2.c [new file with mode: 0644]
drivers/clk/imx/clk-imx1.c [new file with mode: 0644]
drivers/clk/imx/clk-imx21.c [new file with mode: 0644]
drivers/clk/imx/clk-imx25.c [new file with mode: 0644]
drivers/clk/imx/clk-imx27.c [new file with mode: 0644]
drivers/clk/imx/clk-imx31.c [new file with mode: 0644]
drivers/clk/imx/clk-imx35.c [new file with mode: 0644]
drivers/clk/imx/clk-imx51-imx53.c [new file with mode: 0644]
drivers/clk/imx/clk-imx6q.c [new file with mode: 0644]
drivers/clk/imx/clk-imx6sl.c [new file with mode: 0644]
drivers/clk/imx/clk-imx6sx.c [new file with mode: 0644]
drivers/clk/imx/clk-imx7d.c [new file with mode: 0644]
drivers/clk/imx/clk-pfd.c [new file with mode: 0644]
drivers/clk/imx/clk-pllv1.c [new file with mode: 0644]
drivers/clk/imx/clk-pllv2.c [new file with mode: 0644]
drivers/clk/imx/clk-pllv3.c [new file with mode: 0644]
drivers/clk/imx/clk-vf610.c [new file with mode: 0644]
drivers/clk/imx/clk.c [new file with mode: 0644]
drivers/clk/imx/clk.h [new file with mode: 0644]
drivers/clk/pxa/clk-pxa27x.c
drivers/clk/zte/Makefile [new file with mode: 0644]
drivers/clk/zte/clk-pll.c [new file with mode: 0644]
drivers/clk/zte/clk-zx296702.c [new file with mode: 0644]
drivers/clk/zte/clk.h [new file with mode: 0644]
drivers/clocksource/Kconfig
drivers/clocksource/Makefile
drivers/clocksource/timer-imx-gpt.c [new file with mode: 0644]
drivers/crypto/caam/caamhash.c
drivers/crypto/caam/caamrng.c
drivers/dma/at_xdmac.c
drivers/dma/dmaengine.c
drivers/firmware/Makefile
drivers/firmware/qcom_scm-32.c [new file with mode: 0644]
drivers/firmware/qcom_scm.c
drivers/firmware/qcom_scm.h [new file with mode: 0644]
drivers/gpu/drm/i915/i915_gem.c
drivers/gpu/drm/i915/intel_i2c.c
drivers/gpu/drm/i915/intel_sdvo.c
drivers/gpu/drm/mgag200/mgag200_mode.c
drivers/gpu/drm/radeon/atombios_crtc.c
drivers/gpu/drm/radeon/radeon_device.c
drivers/gpu/drm/radeon/radeon_dp_mst.c
drivers/gpu/drm/radeon/radeon_kms.c
drivers/gpu/drm/radeon/radeon_vm.c
drivers/infiniband/ulp/isert/ib_isert.c
drivers/input/mouse/synaptics.c
drivers/iommu/Kconfig
drivers/iommu/intel-iommu.c
drivers/iommu/tegra-smmu.c
drivers/irqchip/Kconfig
drivers/irqchip/irq-mips-gic.c
drivers/irqchip/irq-nvic.c
drivers/irqchip/irq-sunxi-nmi.c
drivers/irqchip/irq-vf610-mscm-ir.c
drivers/leds/leds-syscon.c
drivers/md/md.c
drivers/md/raid10.c
drivers/md/raid5.c
drivers/media/Kconfig
drivers/memory/Kconfig
drivers/memory/omap-gpmc.c
drivers/memory/tegra/Kconfig
drivers/memory/tegra/Makefile
drivers/memory/tegra/mc.c
drivers/memory/tegra/mc.h
drivers/memory/tegra/tegra114.c
drivers/memory/tegra/tegra124-emc.c [new file with mode: 0644]
drivers/memory/tegra/tegra124.c
drivers/memory/tegra/tegra30.c
drivers/net/ethernet/amd/xgbe/xgbe-drv.c
drivers/net/ethernet/broadcom/b44.c
drivers/net/ethernet/broadcom/genet/bcmmii.c
drivers/net/ethernet/cisco/enic/enic_ethtool.c
drivers/net/ethernet/cisco/enic/enic_main.c
drivers/net/ethernet/cisco/enic/vnic_rq.c
drivers/net/ethernet/emulex/benet/be_cmds.c
drivers/net/ethernet/emulex/benet/be_ethtool.c
drivers/net/ethernet/emulex/benet/be_main.c
drivers/net/ethernet/intel/i40e/i40e.h
drivers/net/ethernet/intel/i40e/i40e_debugfs.c
drivers/net/ethernet/intel/i40e/i40e_main.c
drivers/net/ethernet/intel/i40e/i40e_txrx.c
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
drivers/net/ethernet/intel/i40evf/i40e_txrx.c
drivers/net/ethernet/intel/igb/igb_ptp.c
drivers/ntb/ntb_hw.c
drivers/of/platform.c
drivers/pcmcia/Kconfig
drivers/pcmcia/at91_cf.c
drivers/pinctrl/berlin/berlin-bg2.c
drivers/pinctrl/berlin/berlin-bg2cd.c
drivers/pinctrl/berlin/berlin-bg2q.c
drivers/pinctrl/berlin/berlin.c
drivers/reset/reset-berlin.c
drivers/soc/Kconfig
drivers/soc/Makefile
drivers/soc/mediatek/Kconfig
drivers/soc/mediatek/mtk-pmic-wrap.c
drivers/soc/qcom/Kconfig
drivers/soc/qcom/Makefile
drivers/soc/qcom/spm.c [new file with mode: 0644]
drivers/soc/sunxi/Kconfig [new file with mode: 0644]
drivers/soc/sunxi/Makefile [new file with mode: 0644]
drivers/soc/sunxi/sunxi_sram.c [new file with mode: 0644]
drivers/soc/tegra/fuse/fuse-tegra20.c
drivers/soc/tegra/fuse/tegra-apbmisc.c
drivers/soc/tegra/pmc.c
drivers/ssb/driver_chipcommon_pmu.c
drivers/virtio/virtio_pci_common.c
drivers/watchdog/bcm2835_wdt.c
include/dt-bindings/clock/imx7d-clock.h [new file with mode: 0644]
include/dt-bindings/clock/r8a73a4-clock.h
include/dt-bindings/clock/r8a7790-clock.h
include/dt-bindings/clock/r8a7791-clock.h
include/dt-bindings/clock/r8a7794-clock.h
include/dt-bindings/clock/samsung,s2mps11.h [new file with mode: 0644]
include/dt-bindings/clock/vf610-clock.h
include/dt-bindings/clock/zx296702-clock.h [new file with mode: 0644]
include/dt-bindings/mfd/st-lpc.h [new file with mode: 0644]
include/dt-bindings/pinctrl/am43xx.h
include/dt-bindings/pinctrl/bcm2835.h [new file with mode: 0644]
include/linux/intel-iommu.h
include/linux/irq.h
include/linux/irqdomain.h
include/linux/mbus.h
include/linux/mfd/syscon/atmel-mc.h [new file with mode: 0644]
include/linux/qcom_scm.h
include/linux/reset/bcm63xx_pmb.h [new file with mode: 0644]
include/linux/soc/sunxi/sunxi_sram.h [new file with mode: 0644]
include/soc/at91/at91rm9200_sdramc.h [deleted file]
include/soc/imx/revision.h [new file with mode: 0644]
include/soc/imx/timer.h [new file with mode: 0644]
include/soc/tegra/emc.h [new file with mode: 0644]
include/soc/tegra/fuse.h
include/soc/tegra/mc.h
include/soc/tegra/pmc.h
include/sound/hda_regmap.h
include/uapi/drm/radeon_drm.h
include/uapi/linux/serial_reg.h
kernel/irq/chip.c
kernel/irq/generic-chip.c
kernel/irq/irqdomain.c
kernel/locking/lockdep.c
kernel/locking/lockdep_proc.c
kernel/sched/fair.c
kernel/trace/ring_buffer_benchmark.c
kernel/trace/trace_events_filter.c
lib/cpumask.c
lib/mpi/longlong.h
lib/rhashtable.c
mm/memcontrol.c
mm/memory_hotplug.c
mm/shmem.c
mm/zsmalloc.c
net/bridge/br_fdb.c
net/bridge/br_multicast.c
net/core/dev.c
net/core/skbuff.c
net/core/sock.c
net/ipv4/udp.c
net/ipv6/addrconf_core.c
net/mpls/af_mpls.c
net/mpls/internal.h
net/openvswitch/vport-netdev.c
net/sctp/auth.c
net/tipc/socket.c
net/wireless/wext-compat.c
scripts/checkpatch.pl
sound/hda/hdac_regmap.c
sound/mips/Kconfig
sound/pci/hda/hda_codec.c
sound/pci/hda/hda_intel.c
sound/pci/hda/hda_local.h
sound/pci/hda/patch_realtek.c
sound/pci/hda/patch_sigmatel.c
sound/usb/quirks.c

index 0632b3aad83e7068f663964c77870b9e54cf6826..ffca443a19b4265993493141328b2bd58fdd91ae 100644 (file)
@@ -33,20 +33,23 @@ directory, with first 8 configurable by user and additional
 Cycle counter is described by a "type" value 0xff and does
 not require any other settings.
 
+The driver also provides a "cpumask" sysfs attribute, which contains
+a single CPU ID, of the processor which will be used to handle all
+the CCN PMU events. It is recommended that the user space tools
+request the events on this processor (if not, the perf_event->cpu value
+will be overwritten anyway). In case of this processor being offlined,
+the events are migrated to another one and the attribute is updated.
+
 Example of perf tool use:
 
 / # perf list | grep ccn
   ccn/cycles/                                        [Kernel PMU event]
 <...>
-  ccn/xp_valid_flit/                                 [Kernel PMU event]
+  ccn/xp_valid_flit,xp=?,port=?,vc=?,dir=?/          [Kernel PMU event]
 <...>
 
-/ # perf stat -C 0 -e ccn/cycles/,ccn/xp_valid_flit,xp=1,port=0,vc=1,dir=1/ \
+/ # perf stat -a -e ccn/cycles/,ccn/xp_valid_flit,xp=1,port=0,vc=1,dir=1/ \
                                                                        sleep 1
 
 The driver does not support sampling, therefore "perf record" will
-not work. Also notice that only single cpu is being selected
-("-C 0") - this is because perf framework does not support
-"non-CPU related" counters (yet?) so system-wide session ("-a")
-would try (and in most cases fail) to set up the same event
-per each CPU.
+not work. Per-task (without "-a") perf sessions are not supported.
diff --git a/Documentation/arm/stm32/overview.txt b/Documentation/arm/stm32/overview.txt
new file mode 100644 (file)
index 0000000..09aed55
--- /dev/null
@@ -0,0 +1,32 @@
+                       STM32 ARM Linux Overview
+                       ========================
+
+Introduction
+------------
+
+  The STMicroelectronics family of Cortex-M based MCUs are supported by the
+  'STM32' platform of ARM Linux. Currently only the STM32F429 is supported.
+
+
+Configuration
+-------------
+
+  A generic configuration is provided for STM32 family, and can be used as the
+  default by
+       make stm32_defconfig
+
+Layout
+------
+
+  All the files for multiple machine families are located in the platform code
+  contained in arch/arm/mach-stm32
+
+  There is a generic board board-dt.c in the mach folder which support
+  Flattened Device Tree, which means, it works with any compatible board with
+  Device Trees.
+
+
+Document Author
+---------------
+
+  Maxime Coquelin <mcoquelin.stm32@gmail.com>
diff --git a/Documentation/arm/stm32/stm32f429-overview.txt b/Documentation/arm/stm32/stm32f429-overview.txt
new file mode 100644 (file)
index 0000000..5206822
--- /dev/null
@@ -0,0 +1,22 @@
+                       STM32F429 Overview
+                       ==================
+
+  Introduction
+  ------------
+       The STM32F429 is a Cortex-M4 MCU aimed at various applications.
+       It features:
+       - ARM Cortex-M4 up to 180MHz with FPU
+       - 2MB internal Flash Memory
+       - External memory support through FMC controller (PSRAM, SDRAM, NOR, NAND)
+       - I2C, SPI, SAI, CAN, USB OTG, Ethernet controllers
+       - LCD controller & Camera interface
+       - Cryptographic processor
+
+  Resources
+  ---------
+       Datasheet and reference manual are publicly available on ST website:
+       - http://www.st.com/web/en/catalog/mmc/FM141/SC1169/SS1577/LN1806?ecmp=stm32f429-439_pron_pr-ces2014_nov2013
+
+  Document Author
+  ---------------
+       Maxime Coquelin <mcoquelin.stm32@gmail.com>
diff --git a/Documentation/devicetree/bindings/arm/altera/socfpga-sdram-controller.txt b/Documentation/devicetree/bindings/arm/altera/socfpga-sdram-controller.txt
new file mode 100644 (file)
index 0000000..77ca635
--- /dev/null
@@ -0,0 +1,12 @@
+Altera SOCFPGA SDRAM Controller
+
+Required properties:
+- compatible : Should contain "altr,sdr-ctl" and "syscon".
+  syscon is required by the Altera SOCFPGA SDRAM EDAC.
+- reg : Should contain 1 register range (address and length)
+
+Example:
+       sdr: sdr@ffc25000 {
+               compatible = "altr,sdr-ctl", "syscon";
+               reg = <0xffc25000 0x1000>;
+       };
index b78564b2b2019e06a4fea1863191d2cab6303ee2..1a709970e7f7826aba3de7847fcf964389e237e3 100644 (file)
@@ -157,3 +157,69 @@ Example:
 
        };
 };
+
+ARM Versatile Express Boards
+-----------------------------
+For details on the device tree bindings for ARM Versatile Express boards
+please consult the vexpress.txt file in the same directory as this file.
+
+ARM Juno Boards
+----------------
+The Juno boards are targeting development for AArch64 systems. The first
+iteration, Juno r0, is a vehicle for evaluating big.LITTLE on AArch64,
+with the second iteration, Juno r1, mainly aimed at development of PCIe
+based systems. Juno r1 also has support for AXI masters placed on the TLX
+connectors to join the coherency domain.
+
+Juno boards are described in a similar way to ARM Versatile Express boards,
+with the motherboard part of the hardware being described in a separate file
+to highlight the fact that is part of the support infrastructure for the SoC.
+Juno device tree bindings also share the Versatile Express bindings as
+described under the RS1 memory mapping.
+
+Required properties (in root node):
+       compatible = "arm,juno";        /* For Juno r0 board */
+       compatible = "arm,juno-r1";     /* For Juno r1 board */
+
+Required nodes:
+The description for the board must include:
+   - a "psci" node describing the boot method used for the secondary CPUs.
+     A detailed description of the bindings used for "psci" nodes is present
+     in the psci.txt file.
+   - a "cpus" node describing the available cores and their associated
+     "enable-method"s. For more details see cpus.txt file.
+
+Example:
+
+/dts-v1/;
+/ {
+       model = "ARM Juno development board (r0)";
+       compatible = "arm,juno", "arm,vexpress";
+       interrupt-parent = <&gic>;
+       #address-cells = <2>;
+       #size-cells = <2>;
+
+       cpus {
+               #address-cells = <2>;
+               #size-cells = <0>;
+
+               A57_0: cpu@0 {
+                       compatible = "arm,cortex-a57","arm,armv8";
+                       reg = <0x0 0x0>;
+                       device_type = "cpu";
+                       enable-method = "psci";
+               };
+
+               .....
+
+               A53_0: cpu@100 {
+                       compatible = "arm,cortex-a53","arm,armv8";
+                       reg = <0x0 0x100>;
+                       device_type = "cpu";
+                       enable-method = "psci";
+               };
+
+               .....
+       };
+
+};
index 2e99b5b57350d06a43f4fbed97cde970116b595f..424ac8cbfa08283712309e8cfca1fc822c98d3a0 100644 (file)
@@ -98,7 +98,7 @@ Example:
        };
 
 RAMC SDRAM/DDR Controller required properties:
-- compatible: Should be "atmel,at91rm9200-sdramc",
+- compatible: Should be "atmel,at91rm9200-sdramc", "syscon"
                        "atmel,at91sam9260-sdramc",
                        "atmel,at91sam9g45-ddramc",
                        "atmel,sama5d3-ddramc",
index ac683480c48676153fd631d621a6527f649f652f..c78576bb772935db3a05a9c828294341a4ccd3d7 100644 (file)
@@ -1,8 +1,35 @@
 Broadcom BCM2835 device tree bindings
 -------------------------------------------
 
-Boards with the BCM2835 SoC shall have the following properties:
+Raspberry Pi Model A
+Required root node properties:
+compatible = "raspberrypi,model-a", "brcm,bcm2835";
 
-Required root node property:
+Raspberry Pi Model A+
+Required root node properties:
+compatible = "raspberrypi,model-a-plus", "brcm,bcm2835";
 
+Raspberry Pi Model B
+Required root node properties:
+compatible = "raspberrypi,model-b", "brcm,bcm2835";
+
+Raspberry Pi Model B (no P5)
+early model B with I2C0 rather than I2C1 routed to the expansion header
+Required root node properties:
+compatible = "raspberrypi,model-b-i2c0", "brcm,bcm2835";
+
+Raspberry Pi Model B rev2
+Required root node properties:
+compatible = "raspberrypi,model-b-rev2", "brcm,bcm2835";
+
+Raspberry Pi Model B+
+Required root node properties:
+compatible = "raspberrypi,model-b-plus", "brcm,bcm2835";
+
+Raspberry Pi Compute Module
+Required root node properties:
+compatible = "raspberrypi,compute-module", "brcm,bcm2835";
+
+Generic BCM2835 board
+Required root node properties:
 compatible = "brcm,bcm2835";
index bd49987a8812a77a9be37790667bb61d60acfcd3..b82b6a0ae6f725cee5f6138657e05bdb92e138f7 100644 (file)
@@ -7,3 +7,79 @@ following properties:
 Required root node property:
 
 compatible: should be "brcm,bcm63138"
+
+An optional Boot lookup table Device Tree node is required for secondary CPU
+initialization as well as a 'resets' phandle to the correct PMB controller as
+defined in reset/brcm,bcm63138-pmb.txt for this secondary CPU, and an
+'enable-method' property.
+
+Required properties for the Boot lookup table node:
+- compatible: should be "brcm,bcm63138-bootlut"
+- reg: register base address and length for the Boot Lookup table
+
+Optional properties for the primary CPU node:
+- enable-method: should be "brcm,bcm63138"
+
+Optional properties for the secondary CPU node:
+- enable-method: should be "brcm,bcm63138"
+- resets: phandle to the relevant PMB controller, one integer indicating the internal
+  bus number, and a second integer indicating the address of the CPU in the PMB
+  internal bus number.
+
+Example:
+
+       cpus {
+               cpu@0 {
+                       compatible = "arm,cotex-a9";
+                       reg = <0>;
+                       ...
+                       enable-method = "brcm,bcm63138";
+               };
+
+               cpu@1 {
+                       compatible = "arm,cortex-a9";
+                       reg = <1>;
+                       ...
+                       enable-method = "brcm,bcm63138";
+                       resets = <&pmb0 4 1>;
+               };
+       };
+
+       bootlut: bootlut@8000 {
+               compatible = "brcm,bcm63138-bootlut";
+               reg = <0x8000 0x50>;
+       };
+
+=======
+reboot
+------
+Two nodes are required for software reboot: a timer node and a syscon-reboot node.
+
+Timer node:
+
+- compatible: Must be "brcm,bcm6328-timer", "syscon"
+- reg: Register base address and length
+
+Syscon reboot node:
+
+See Documentation/devicetree/bindings/power/reset/syscon-reboot.txt for the
+detailed list of properties, the two values defined below are specific to the
+BCM6328-style timer:
+
+- offset: Should be 0x34 to denote the offset of the TIMER_WD_TIMER_RESET register
+  from the beginning of the TIMER block
+- mask: Should be 1 for the SoftRst bit.
+
+Example:
+
+       timer: timer@80 {
+               compatible = "brcm,bcm6328-timer", "syscon";
+               reg = <0x80 0x3c>;
+       };
+
+       reboot {
+               compatible = "syscon-reboot";
+               regmap = <&timer>;
+               offset = <0x34>;
+               mask = <0x1>;
+       };
index 3c5c631328d3b6cbb4d7c9edefddf936347a545e..aef1d200a9b28f4d3643812312b3dd9aa3b86209 100644 (file)
@@ -31,8 +31,9 @@ specific to ARM.
        - compatible
                Usage: required
                Value type: <string>
-               Definition: must be set to
+               Definition: must contain one of the following:
                            "arm,cci-400"
+                           "arm,cci-500"
 
        - reg
                Usage: required
@@ -99,6 +100,7 @@ specific to ARM.
                                 "arm,cci-400-pmu,r1"
                                 "arm,cci-400-pmu"  - DEPRECATED, permitted only where OS has
                                                      secure acces to CCI registers
+                                "arm,cci-500-pmu,r0"
                - reg:
                        Usage: required
                        Value type: Integer cells. A register entry, expressed
index 6aa331d11c5e3e042ff2e0ec495d39e26fe0681c..d6b794cef0b8b9907ab5a055a6502180b4350148 100644 (file)
@@ -188,6 +188,7 @@ nodes to be present and contain the properties described below.
                        # On ARM 32-bit systems this property is optional and
                          can be one of:
                            "allwinner,sun6i-a31"
+                           "allwinner,sun8i-a23"
                            "arm,psci"
                            "brcm,brahma-b15"
                            "marvell,armada-375-smp"
index 5da38c5ed476ee2248432314c0bf886305f6cc13..e151057d92f0804fd577a471d937df688e61f6c9 100644 (file)
@@ -19,9 +19,10 @@ Optional Properties:
        domains.
 - clock-names: The following clocks can be specified:
        - oscclk: Oscillator clock.
-       - pclkN, clkN: Pairs of parent of input clock and input clock to the
-               devices in this power domain. Maximum of 4 pairs (N = 0 to 3)
-               are supported currently.
+       - 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.
index a5462b6b3c30d8bea1a63f9368379ce5c268b0eb..2a3ba73f0c5cc3da965315c1aa0f49acb1a7541a 100644 (file)
@@ -81,12 +81,15 @@ Freescale Vybrid Platform Device Tree Bindings
 For the Vybrid SoC familiy all variants with DDR controller are supported,
 which is the VF5xx and VF6xx series. Out of historical reasons, in most
 places the kernel uses vf610 to refer to the whole familiy.
+The compatible string "fsl,vf610m4" is used for the secondary Cortex-M4
+core support.
 
 Required root node compatible property (one of them):
     - compatible = "fsl,vf500";
     - compatible = "fsl,vf510";
     - compatible = "fsl,vf600";
     - compatible = "fsl,vf610";
+    - compatible = "fsl,vf610m4";
 
 Freescale LS1021A Platform Device Tree Bindings
 ------------------------------------------------
index 35b1bd49cfa1374358b14e7126ba480e602cf9ca..c431c67524d610bed3103dcce5434aff78b78e91 100644 (file)
@@ -1,5 +1,8 @@
 Hisilicon Platforms Device Tree Bindings
 ----------------------------------------------------
+Hi6220 SoC
+Required root node properties:
+       - compatible = "hisilicon,hi6220";
 
 Hi4511 Board
 Required root node properties:
@@ -13,6 +16,9 @@ HiP01 ca9x2 Board
 Required root node properties:
        - compatible = "hisilicon,hip01-ca9x2";
 
+HiKey Board
+Required root node properties:
+       - compatible = "hisilicon,hi6220-hikey", "hisilicon,hi6220";
 
 Hisilicon system controller
 
@@ -40,6 +46,87 @@ Example:
                reboot-offset = <0x4>;
        };
 
+-----------------------------------------------------------------------
+Hisilicon Hi6220 system controller
+
+Required properties:
+- compatible : "hisilicon,hi6220-sysctrl"
+- reg : Register address and size
+- #clock-cells: should be set to 1, many clock registers are defined
+  under this controller and this property must be present.
+
+Hisilicon designs this controller as one of the system controllers,
+its main functions are the same as Hisilicon system controller, but
+the register offset of some core modules are different.
+
+Example:
+       /*for Hi6220*/
+       sys_ctrl: sys_ctrl@f7030000 {
+               compatible = "hisilicon,hi6220-sysctrl", "syscon";
+               reg = <0x0 0xf7030000 0x0 0x2000>;
+               #clock-cells = <1>;
+       };
+
+
+Hisilicon Hi6220 Power Always ON domain controller
+
+Required properties:
+- compatible : "hisilicon,hi6220-aoctrl"
+- reg : Register address and size
+- #clock-cells: should be set to 1, many clock registers are defined
+  under this controller and this property must be present.
+
+Hisilicon designs this system controller to control the power always
+on domain for mobile platform.
+
+Example:
+       /*for Hi6220*/
+       ao_ctrl: ao_ctrl@f7800000 {
+               compatible = "hisilicon,hi6220-aoctrl", "syscon";
+               reg = <0x0 0xf7800000 0x0 0x2000>;
+               #clock-cells = <1>;
+       };
+
+
+Hisilicon Hi6220 Media domain controller
+
+Required properties:
+- compatible : "hisilicon,hi6220-mediactrl"
+- reg : Register address and size
+- #clock-cells: should be set to 1, many clock registers are defined
+  under this controller and this property must be present.
+
+Hisilicon designs this system controller to control the multimedia
+domain(e.g. codec, G3D ...) for mobile platform.
+
+Example:
+       /*for Hi6220*/
+       media_ctrl: media_ctrl@f4410000 {
+               compatible = "hisilicon,hi6220-mediactrl", "syscon";
+               reg = <0x0 0xf4410000 0x0 0x1000>;
+               #clock-cells = <1>;
+       };
+
+
+Hisilicon Hi6220 Power Management domain controller
+
+Required properties:
+- compatible : "hisilicon,hi6220-pmctrl"
+- reg : Register address and size
+- #clock-cells: should be set to 1, some clock registers are define
+  under this controller and this property must be present.
+
+Hisilicon designs this system controller to control the power management
+domain for mobile platform.
+
+Example:
+       /*for Hi6220*/
+       pm_ctrl: pm_ctrl@f7032000 {
+               compatible = "hisilicon,hi6220-pmctrl", "syscon";
+               reg = <0x0 0xf7032000 0x0 0x1000>;
+               #clock-cells = <1>;
+       };
+
 -----------------------------------------------------------------------
 Hisilicon HiP01 system controller
 
index a99eb9eb14c0713809c388c43a863c2c37f41784..3bab18409b7acabfdfda8bba05b9da53436773b9 100644 (file)
@@ -1,6 +1,18 @@
 Marvell Berlin SoC Family Device Tree Bindings
 ---------------------------------------------------------------
 
+Work in progress statement:
+
+Device tree files and bindings applying to Marvell Berlin SoCs and boards are
+considered "unstable". Any Marvell Berlin device tree binding may change at any
+time. Be sure to use a device tree binary and a kernel image generated from the
+same source tree.
+
+Please refer to Documentation/devicetree/bindings/ABI.txt for a definition of a
+stable binding/ABI.
+
+---------------------------------------------------------------
+
 Boards with a SoC of the Marvell Berlin family, e.g. Armada 1500
 shall have the following properties:
 
@@ -49,10 +61,9 @@ chip control registers, so there should be a single DT node only providing the
 different functions which are described below.
 
 Required properties:
-- compatible: shall be one of
-       "marvell,berlin2-chip-ctrl" for BG2
-       "marvell,berlin2cd-chip-ctrl" for BG2CD
-       "marvell,berlin2q-chip-ctrl" for BG2Q
+- compatible:
+       * the first and second values must be:
+               "simple-mfd", "syscon"
 - reg: address and length of following register sets for
   BG2/BG2CD: chip control register set
   BG2Q: chip control register set and cpu pll registers
@@ -63,90 +74,23 @@ Marvell Berlin SoCs have a system control register set providing several
 individual registers dealing with pinmux, padmux, and reset.
 
 Required properties:
-- compatible: should be one of
-       "marvell,berlin2-system-ctrl" for BG2
-       "marvell,berlin2cd-system-ctrl" for BG2CD
-       "marvell,berlin2q-system-ctrl" for BG2Q
+- compatible:
+       * the first and second values must be:
+               "simple-mfd", "syscon"
 - reg: address and length of the system control register set
 
-* Clock provider binding
-
-As clock related registers are spread among the chip control registers, the
-chip control node also provides the clocks. Marvell Berlin2 (BG2, BG2CD, BG2Q)
-SoCs share the same IP for PLLs and clocks, with some minor differences in
-features and register layout.
-
-Required properties:
-- #clock-cells: shall be set to 1
-- clocks: clock specifiers referencing the core clock input clocks
-- clock-names: array of strings describing the input clock specifiers above.
-    Allowed clock-names for the reference clocks are
-      "refclk" for the SoCs osciallator input on all SoCs,
-    and SoC-specific input clocks for
-      BG2/BG2CD: "video_ext0" for the external video clock input
-
-Clocks provided by core clocks shall be referenced by a clock specifier
-indexing one of the provided clocks. Refer to dt-bindings/clock/berlin<soc>.h
-for the corresponding index mapping.
-
-* Pin controller binding
-
-Pin control registers are part of both register sets, chip control and system
-control. The pins controlled are organized in groups, so no actual pin
-information is needed.
-
-A pin-controller node should contain subnodes representing the pin group
-configurations, one per function. Each subnode has the group name and the muxing
-function used.
-
-Be aware the Marvell Berlin datasheets use the keyword 'mode' for what is called
-a 'function' in the pin-controller subsystem.
-
-Required subnode-properties:
-- groups: a list of strings describing the group names.
-- function: a string describing the function used to mux the groups.
-
-* Reset controller binding
-
-A reset controller is part of the chip control registers set. The chip control
-node also provides the reset. The register set is not at the same offset between
-Berlin SoCs.
-
-Required property:
-- #reset-cells: must be set to 2
-
 Example:
 
 chip: chip-control@ea0000 {
-       compatible = "marvell,berlin2-chip-ctrl";
-       #clock-cells = <1>;
-       #reset-cells = <2>;
+       compatible = "simple-mfd", "syscon";
        reg = <0xea0000 0x400>;
-       clocks = <&refclk>, <&externaldev 0>;
-       clock-names = "refclk", "video_ext0";
 
-       spi1_pmux: spi1-pmux {
-               groups = "G0";
-               function = "spi1";
-       };
+       /* sub-device nodes */
 };
 
 sysctrl: system-controller@d000 {
-       compatible = "marvell,berlin2-system-ctrl";
+       compatible = "simple-mfd", "syscon";
        reg = <0xd000 0x100>;
 
-       uart0_pmux: uart0-pmux {
-               groups = "GSM4";
-               function = "uart0";
-       };
-
-       uart1_pmux: uart1-pmux {
-               groups = "GSM5";
-               function = "uart1";
-       };
-
-       uart2_pmux: uart2-pmux {
-               groups = "GSM3";
-               function = "uart2";
-       };
+       /* sub-device nodes */
 };
diff --git a/Documentation/devicetree/bindings/arm/scu.txt b/Documentation/devicetree/bindings/arm/scu.txt
new file mode 100644 (file)
index 0000000..c447680
--- /dev/null
@@ -0,0 +1,25 @@
+* ARM Snoop Control Unit (SCU)
+
+As part of the MPCore complex, Cortex-A5 and Cortex-A9 are provided
+with a Snoop Control Unit. The register range is usually 256 (0x100)
+bytes.
+
+References:
+
+- Cortex-A9: see DDI0407E Cortex-A9 MPCore Technical Reference Manual
+  Revision r2p0
+- Cortex-A5: see DDI0434B Cortex-A5 MPCore Technical Reference Manual
+  Revision r0p1
+
+- compatible : Should be:
+       "arm,cortex-a9-scu"
+       "arm,cortex-a5-scu"
+
+- reg : Specify the base address and the size of the SCU register window.
+
+Example:
+
+scu@a04100000 {
+       compatible = "arm,cortex-a9-scu";
+       reg = <0xa0410000 0x100>;
+};
diff --git a/Documentation/devicetree/bindings/arm/ux500/boards.txt b/Documentation/devicetree/bindings/arm/ux500/boards.txt
new file mode 100644 (file)
index 0000000..b8737a8
--- /dev/null
@@ -0,0 +1,83 @@
+ST-Ericsson Ux500 boards
+------------------------
+
+Required properties (in root node) one of these:
+       compatible = "st-ericsson,mop500" (legacy)
+       compatible = "st-ericsson,u8500"
+
+Required node (under root node):
+
+soc: represents the system-on-chip and contains the chip
+peripherals
+
+Required property of soc node, one of these:
+       compatible = "stericsson,db8500"
+
+Required subnodes under soc node:
+
+backupram: (used for CPU spin tables and for storing data
+during retention, system won't boot without this):
+       compatible = "ste,dbx500-backupram"
+
+scu:
+       see binding for arm/scu.txt
+
+interrupt-controller:
+       see binding for arm/gic.txt
+
+timer:
+       see binding for arm/twd.txt
+
+clocks:
+       see binding for clocks/ux500.txt
+
+Example:
+
+/dts-v1/;
+
+/ {
+        model = "ST-Ericsson HREF (pre-v60) and ST UIB";
+        compatible = "st-ericsson,mop500", "st-ericsson,u8500";
+
+        soc {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "stericsson,db8500";
+               interrupt-parent = <&intc>;
+               ranges;
+
+               backupram@80150000 {
+                       compatible = "ste,dbx500-backupram";
+                       reg = <0x80150000 0x2000>;
+               };
+
+               intc: interrupt-controller@a0411000 {
+                       compatible = "arm,cortex-a9-gic";
+                       #interrupt-cells = <3>;
+                       #address-cells = <1>;
+                       interrupt-controller;
+                       reg = <0xa0411000 0x1000>,
+                             <0xa0410100 0x100>;
+               };
+
+               scu@a04100000 {
+                       compatible = "arm,cortex-a9-scu";
+                       reg = <0xa0410000 0x100>;
+               };
+
+               timer@a0410600 {
+                       compatible = "arm,cortex-a9-twd-timer";
+                       reg = <0xa0410600 0x20>;
+                       interrupts = <1 13 0x304>; /* IRQ level high per-CPU */
+                       clocks = <&smp_twd_clk>;
+               };
+
+               clocks {
+                       compatible = "stericsson,u8500-clks";
+
+                       smp_twd_clk: smp-twd-clock {
+                               #clock-cells = <0>;
+                       };
+               };
+        };
+};
diff --git a/Documentation/devicetree/bindings/arm/zte.txt b/Documentation/devicetree/bindings/arm/zte.txt
new file mode 100644 (file)
index 0000000..3ff5c9e
--- /dev/null
@@ -0,0 +1,15 @@
+ZTE platforms device tree bindings
+---------------------------------------
+
+-  ZX296702 board:
+    Required root node properties:
+      - compatible = "zte,zx296702-ad1", "zte,zx296702"
+
+System management required properties:
+      - compatible = "zte,sysctrl"
+
+Low power management required properties:
+      - compatible = "zte,zx296702-pcu"
+
+Bus matrix required properties:
+      - compatible = "zte,zx-bus-matrix"
index 7a4d4926f44e47b9a80077192ae9dacbd1089e7e..5ba6450693b9816dfc1dacef96570e14c22a111b 100644 (file)
@@ -248,7 +248,7 @@ Required properties for peripheral clocks:
 - #address-cells : shall be 1 (reg is used to encode clk id).
 - clocks : shall be the master clock phandle.
        e.g. clocks = <&mck>;
-- name: device tree node describing a specific system clock.
+- name: device tree node describing a specific peripheral clock.
        * #clock-cells : from common clock binding; shall be set to 0.
        * reg: peripheral id. See Atmel's datasheets to get a full
          list of peripheral ids.
diff --git a/Documentation/devicetree/bindings/clock/hi6220-clock.txt b/Documentation/devicetree/bindings/clock/hi6220-clock.txt
new file mode 100644 (file)
index 0000000..259e30a
--- /dev/null
@@ -0,0 +1,34 @@
+* Hisilicon Hi6220 Clock Controller
+
+Clock control registers reside in different Hi6220 system controllers,
+please refer the following document to know more about the binding rules
+for these system controllers:
+
+Documentation/devicetree/bindings/arm/hisilicon/hisilicon.txt
+
+Required Properties:
+
+- compatible: the compatible should be one of the following strings to
+       indicate the clock controller functionality.
+
+       - "hisilicon,hi6220-aoctrl"
+       - "hisilicon,hi6220-sysctrl"
+       - "hisilicon,hi6220-mediactrl"
+       - "hisilicon,hi6220-pmctrl"
+
+- reg: physical base address of the controller and length of memory mapped
+  region.
+
+- #clock-cells: should be 1.
+
+For example:
+       sys_ctrl: sys_ctrl@f7030000 {
+               compatible = "hisilicon,hi6220-sysctrl", "syscon";
+               reg = <0x0 0xf7030000 0x0 0x2000>;
+               #clock-cells = <1>;
+       };
+
+Each clock is assigned an identifier and client nodes use this identifier
+to specify the clock which they consume.
+
+All these identifier could be found in <dt-bindings/clock/hi6220-clock.h>.
diff --git a/Documentation/devicetree/bindings/clock/imx7d-clock.txt b/Documentation/devicetree/bindings/clock/imx7d-clock.txt
new file mode 100644 (file)
index 0000000..9d3026d
--- /dev/null
@@ -0,0 +1,13 @@
+* Clock bindings for Freescale i.MX7 Dual
+
+Required properties:
+- compatible: Should be "fsl,imx7d-ccm"
+- reg: Address and length of the register set
+- #clock-cells: Should be <1>
+- clocks: list of clock specifiers, must contain an entry for each required
+  entry in clock-names
+- clock-names: should include entries "ckil", "osc"
+
+The clock consumer should specify the desired clock by having the clock
+ID in its "clocks" phandle cell.  See include/dt-bindings/clock/imx7d-clock.h
+for the full list of i.MX7 Dual clock IDs.
diff --git a/Documentation/devicetree/bindings/clock/marvell,berlin.txt b/Documentation/devicetree/bindings/clock/marvell,berlin.txt
new file mode 100644 (file)
index 0000000..c611c49
--- /dev/null
@@ -0,0 +1,31 @@
+Device Tree Clock bindings for Marvell Berlin
+
+This binding uses the common clock binding[1].
+
+[1] Documentation/devicetree/bindings/clock/clock-bindings.txt
+
+Clock related registers are spread among the chip control registers. Berlin
+clock node should be a sub-node of the chip controller node. Marvell Berlin2
+(BG2, BG2CD, BG2Q) SoCs share the same IP for PLLs and clocks, with some
+minor differences in features and register layout.
+
+Required properties:
+- compatible: must be "marvell,berlin2-clk" or "marvell,berlin2q-clk"
+- #clock-cells: must be 1
+- clocks: must be the input parent clock phandle
+- clock-names: name of the input parent clock
+       Allowed clock-names for the reference clocks are
+       "refclk" for the SoCs oscillator input on all SoCs,
+       and SoC-specific input clocks for
+       BG2/BG2CD: "video_ext0" for the external video clock input
+
+
+Example:
+
+chip_clk: clock {
+       compatible = "marvell,berlin2q-clk";
+
+       #clock-cells = <1>;
+       clocks = <&refclk>;
+       clock-names = "refclk";
+};
diff --git a/Documentation/devicetree/bindings/clock/zx296702-clk.txt b/Documentation/devicetree/bindings/clock/zx296702-clk.txt
new file mode 100644 (file)
index 0000000..750442b
--- /dev/null
@@ -0,0 +1,35 @@
+Device Tree Clock bindings for ZTE zx296702
+
+This binding uses the common clock binding[1].
+
+[1] Documentation/devicetree/bindings/clock/clock-bindings.txt
+
+Required properties:
+- compatible : shall be one of the following:
+       "zte,zx296702-topcrm-clk":
+               zx296702 top clock selection, divider and gating
+
+       "zte,zx296702-lsp0crpm-clk" and
+       "zte,zx296702-lsp1crpm-clk":
+               zx296702 device level clock selection and gating
+
+- reg: Address and length of the register set
+
+The clock consumer should specify the desired clock by having the clock
+ID in its "clocks" phandle cell. See include/dt-bindings/clock/zx296702-clock.h
+for the full list of zx296702 clock IDs.
+
+
+topclk: topcrm@0x09800000 {
+        compatible = "zte,zx296702-topcrm-clk";
+        reg = <0x09800000 0x1000>;
+        #clock-cells = <1>;
+};
+
+uart0: serial@0x09405000 {
+        compatible = "zte,zx296702-uart";
+        reg = <0x09405000 0x1000>;
+        interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>;
+        clocks = <&lsp1clk ZX296702_UART0_PCLK>;
+        status = "disabled";
+};
index 23e1d3194174abe27f5dcf12a784ecaee1146df1..41372d441131aa66071a13357413d752d1025138 100644 (file)
@@ -29,7 +29,7 @@ Example:
 
        fuse@7000f800 {
                compatible = "nvidia,tegra20-efuse";
-               reg = <0x7000F800 0x400>,
+               reg = <0x7000f800 0x400>,
                      <0x70000000 0x400>;
                clocks = <&tegra_car TEGRA20_CLK_FUSE>;
                clock-names = "fuse";
index 4b641c7bf1c252a3465aa7e028e18042cb7ad61b..09089a6d69ed8d1c9b29115e6abce75a6d1a2fcd 100644 (file)
@@ -32,8 +32,8 @@ Example:
                touchscreen-fuzz-x = <4>;
                touchscreen-fuzz-y = <7>;
                touchscreen-fuzz-pressure = <2>;
-               touchscreen-max-x = <4096>;
-               touchscreen-max-y = <4096>;
+               touchscreen-size-x = <4096>;
+               touchscreen-size-y = <4096>;
                touchscreen-max-pressure = <2048>;
 
                ti,x-plate-ohms = <280>;
index f3db93c85eea56f5654b787e66febe43a46348a3..3338a2834ad7acf9fceb49c0dff590e85ce30418 100644 (file)
@@ -1,6 +1,9 @@
 NVIDIA Tegra Memory Controller device tree bindings
 ===================================================
 
+memory-controller node
+----------------------
+
 Required properties:
 - compatible: Should be "nvidia,tegra<chip>-mc"
 - reg: Physical base address and length of the controller's registers.
@@ -15,9 +18,49 @@ Required properties:
 This device implements an IOMMU that complies with the generic IOMMU binding.
 See ../iommu/iommu.txt for details.
 
-Example:
---------
+emc-timings subnode
+-------------------
+
+The node should contain a "emc-timings" subnode for each supported RAM type (see field RAM_CODE in
+register PMC_STRAPPING_OPT_A).
+
+Required properties for "emc-timings" nodes :
+- nvidia,ram-code : Should contain the value of RAM_CODE this timing set is used for.
+
+timing subnode
+--------------
+
+Each "emc-timings" node should contain a subnode for every supported EMC clock rate.
+
+Required properties for timing nodes :
+- clock-frequency : Should contain the memory clock rate in Hz.
+- nvidia,emem-configuration : Values to be written to the EMEM register block. For the Tegra124 SoC
+(see section "15.6.1 MC Registers" in the TRM), these are the registers whose values need to be
+specified, according to the board documentation:
+
+       MC_EMEM_ARB_CFG
+       MC_EMEM_ARB_OUTSTANDING_REQ
+       MC_EMEM_ARB_TIMING_RCD
+       MC_EMEM_ARB_TIMING_RP
+       MC_EMEM_ARB_TIMING_RC
+       MC_EMEM_ARB_TIMING_RAS
+       MC_EMEM_ARB_TIMING_FAW
+       MC_EMEM_ARB_TIMING_RRD
+       MC_EMEM_ARB_TIMING_RAP2PRE
+       MC_EMEM_ARB_TIMING_WAP2PRE
+       MC_EMEM_ARB_TIMING_R2R
+       MC_EMEM_ARB_TIMING_W2W
+       MC_EMEM_ARB_TIMING_R2W
+       MC_EMEM_ARB_TIMING_W2R
+       MC_EMEM_ARB_DA_TURNS
+       MC_EMEM_ARB_DA_COVERS
+       MC_EMEM_ARB_MISC0
+       MC_EMEM_ARB_MISC1
+       MC_EMEM_ARB_RING1_THROTTLE
 
+Example SoC include file:
+
+/ {
        mc: memory-controller@0,70019000 {
                compatible = "nvidia,tegra124-mc";
                reg = <0x0 0x70019000 0x0 0x1000>;
@@ -34,3 +77,40 @@ Example:
                ...
                iommus = <&mc TEGRA_SWGROUP_SDMMC1A>;
        };
+};
+
+Example board file:
+
+/ {
+       memory-controller@0,70019000 {
+               emc-timings-3 {
+                       nvidia,ram-code = <3>;
+
+                       timing-12750000 {
+                               clock-frequency = <12750000>;
+
+                               nvidia,emem-configuration = <
+                                       0x40040001 /* MC_EMEM_ARB_CFG */
+                                       0x8000000a /* MC_EMEM_ARB_OUTSTANDING_REQ */
+                                       0x00000001 /* MC_EMEM_ARB_TIMING_RCD */
+                                       0x00000001 /* MC_EMEM_ARB_TIMING_RP */
+                                       0x00000002 /* MC_EMEM_ARB_TIMING_RC */
+                                       0x00000000 /* MC_EMEM_ARB_TIMING_RAS */
+                                       0x00000002 /* MC_EMEM_ARB_TIMING_FAW */
+                                       0x00000001 /* MC_EMEM_ARB_TIMING_RRD */
+                                       0x00000002 /* MC_EMEM_ARB_TIMING_RAP2PRE */
+                                       0x00000008 /* MC_EMEM_ARB_TIMING_WAP2PRE */
+                                       0x00000003 /* MC_EMEM_ARB_TIMING_R2R */
+                                       0x00000002 /* MC_EMEM_ARB_TIMING_W2W */
+                                       0x00000003 /* MC_EMEM_ARB_TIMING_R2W */
+                                       0x00000006 /* MC_EMEM_ARB_TIMING_W2R */
+                                       0x06030203 /* MC_EMEM_ARB_DA_TURNS */
+                                       0x000a0402 /* MC_EMEM_ARB_DA_COVERS */
+                                       0x77e30303 /* MC_EMEM_ARB_MISC0 */
+                                       0x70000f03 /* MC_EMEM_ARB_MISC1 */
+                                       0x001f0000 /* MC_EMEM_ARB_RING1_THROTTLE */
+                               >;
+                       };
+               };
+       };
+};
diff --git a/Documentation/devicetree/bindings/memory-controllers/tegra-emc.txt b/Documentation/devicetree/bindings/memory-controllers/tegra-emc.txt
new file mode 100644 (file)
index 0000000..b59c625
--- /dev/null
@@ -0,0 +1,374 @@
+NVIDIA Tegra124 SoC EMC (external memory controller)
+====================================================
+
+Required properties :
+- compatible : Should be "nvidia,tegra124-emc".
+- reg : physical base address and length of the controller's registers.
+- nvidia,memory-controller : phandle of the MC driver.
+
+The node should contain a "emc-timings" subnode for each supported RAM type
+(see field RAM_CODE in register PMC_STRAPPING_OPT_A), with its unit address
+being its RAM_CODE.
+
+Required properties for "emc-timings" nodes :
+- nvidia,ram-code : Should contain the value of RAM_CODE this timing set is
+used for.
+
+Each "emc-timings" node should contain a "timing" subnode for every supported
+EMC clock rate. The "timing" subnodes should have the clock rate in Hz as
+their unit address.
+
+Required properties for "timing" nodes :
+- clock-frequency : Should contain the memory clock rate in Hz.
+- The following properties contain EMC timing characterization values
+(specified in the board documentation) :
+  - nvidia,emc-auto-cal-config : EMC_AUTO_CAL_CONFIG
+  - nvidia,emc-auto-cal-config2 : EMC_AUTO_CAL_CONFIG2
+  - nvidia,emc-auto-cal-config3 : EMC_AUTO_CAL_CONFIG3
+  - nvidia,emc-auto-cal-interval : EMC_AUTO_CAL_INTERVAL
+  - nvidia,emc-bgbias-ctl0 : EMC_BGBIAS_CTL0
+  - nvidia,emc-cfg : EMC_CFG
+  - nvidia,emc-cfg-2 : EMC_CFG_2
+  - nvidia,emc-ctt-term-ctrl : EMC_CTT_TERM_CTRL
+  - nvidia,emc-mode-1 : Mode Register 1
+  - nvidia,emc-mode-2 : Mode Register 2
+  - nvidia,emc-mode-4 : Mode Register 4
+  - nvidia,emc-mode-reset : Mode Register 0
+  - nvidia,emc-mrs-wait-cnt : EMC_MRS_WAIT_CNT
+  - nvidia,emc-sel-dpd-ctrl : EMC_SEL_DPD_CTRL
+  - nvidia,emc-xm2dqspadctrl2 : EMC_XM2DQSPADCTRL2
+  - nvidia,emc-zcal-cnt-long : EMC_ZCAL_WAIT_CNT after clock change
+  - nvidia,emc-zcal-interval : EMC_ZCAL_INTERVAL
+- nvidia,emc-configuration : EMC timing characterization data. These are the
+registers (see section "15.6.2 EMC Registers" in the TRM) whose values need to
+be specified, according to the board documentation:
+
+       EMC_RC
+       EMC_RFC
+       EMC_RFC_SLR
+       EMC_RAS
+       EMC_RP
+       EMC_R2W
+       EMC_W2R
+       EMC_R2P
+       EMC_W2P
+       EMC_RD_RCD
+       EMC_WR_RCD
+       EMC_RRD
+       EMC_REXT
+       EMC_WEXT
+       EMC_WDV
+       EMC_WDV_MASK
+       EMC_QUSE
+       EMC_QUSE_WIDTH
+       EMC_IBDLY
+       EMC_EINPUT
+       EMC_EINPUT_DURATION
+       EMC_PUTERM_EXTRA
+       EMC_PUTERM_WIDTH
+       EMC_PUTERM_ADJ
+       EMC_CDB_CNTL_1
+       EMC_CDB_CNTL_2
+       EMC_CDB_CNTL_3
+       EMC_QRST
+       EMC_QSAFE
+       EMC_RDV
+       EMC_RDV_MASK
+       EMC_REFRESH
+       EMC_BURST_REFRESH_NUM
+       EMC_PRE_REFRESH_REQ_CNT
+       EMC_PDEX2WR
+       EMC_PDEX2RD
+       EMC_PCHG2PDEN
+       EMC_ACT2PDEN
+       EMC_AR2PDEN
+       EMC_RW2PDEN
+       EMC_TXSR
+       EMC_TXSRDLL
+       EMC_TCKE
+       EMC_TCKESR
+       EMC_TPD
+       EMC_TFAW
+       EMC_TRPAB
+       EMC_TCLKSTABLE
+       EMC_TCLKSTOP
+       EMC_TREFBW
+       EMC_FBIO_CFG6
+       EMC_ODT_WRITE
+       EMC_ODT_READ
+       EMC_FBIO_CFG5
+       EMC_CFG_DIG_DLL
+       EMC_CFG_DIG_DLL_PERIOD
+       EMC_DLL_XFORM_DQS0
+       EMC_DLL_XFORM_DQS1
+       EMC_DLL_XFORM_DQS2
+       EMC_DLL_XFORM_DQS3
+       EMC_DLL_XFORM_DQS4
+       EMC_DLL_XFORM_DQS5
+       EMC_DLL_XFORM_DQS6
+       EMC_DLL_XFORM_DQS7
+       EMC_DLL_XFORM_DQS8
+       EMC_DLL_XFORM_DQS9
+       EMC_DLL_XFORM_DQS10
+       EMC_DLL_XFORM_DQS11
+       EMC_DLL_XFORM_DQS12
+       EMC_DLL_XFORM_DQS13
+       EMC_DLL_XFORM_DQS14
+       EMC_DLL_XFORM_DQS15
+       EMC_DLL_XFORM_QUSE0
+       EMC_DLL_XFORM_QUSE1
+       EMC_DLL_XFORM_QUSE2
+       EMC_DLL_XFORM_QUSE3
+       EMC_DLL_XFORM_QUSE4
+       EMC_DLL_XFORM_QUSE5
+       EMC_DLL_XFORM_QUSE6
+       EMC_DLL_XFORM_QUSE7
+       EMC_DLL_XFORM_ADDR0
+       EMC_DLL_XFORM_ADDR1
+       EMC_DLL_XFORM_ADDR2
+       EMC_DLL_XFORM_ADDR3
+       EMC_DLL_XFORM_ADDR4
+       EMC_DLL_XFORM_ADDR5
+       EMC_DLL_XFORM_QUSE8
+       EMC_DLL_XFORM_QUSE9
+       EMC_DLL_XFORM_QUSE10
+       EMC_DLL_XFORM_QUSE11
+       EMC_DLL_XFORM_QUSE12
+       EMC_DLL_XFORM_QUSE13
+       EMC_DLL_XFORM_QUSE14
+       EMC_DLL_XFORM_QUSE15
+       EMC_DLI_TRIM_TXDQS0
+       EMC_DLI_TRIM_TXDQS1
+       EMC_DLI_TRIM_TXDQS2
+       EMC_DLI_TRIM_TXDQS3
+       EMC_DLI_TRIM_TXDQS4
+       EMC_DLI_TRIM_TXDQS5
+       EMC_DLI_TRIM_TXDQS6
+       EMC_DLI_TRIM_TXDQS7
+       EMC_DLI_TRIM_TXDQS8
+       EMC_DLI_TRIM_TXDQS9
+       EMC_DLI_TRIM_TXDQS10
+       EMC_DLI_TRIM_TXDQS11
+       EMC_DLI_TRIM_TXDQS12
+       EMC_DLI_TRIM_TXDQS13
+       EMC_DLI_TRIM_TXDQS14
+       EMC_DLI_TRIM_TXDQS15
+       EMC_DLL_XFORM_DQ0
+       EMC_DLL_XFORM_DQ1
+       EMC_DLL_XFORM_DQ2
+       EMC_DLL_XFORM_DQ3
+       EMC_DLL_XFORM_DQ4
+       EMC_DLL_XFORM_DQ5
+       EMC_DLL_XFORM_DQ6
+       EMC_DLL_XFORM_DQ7
+       EMC_XM2CMDPADCTRL
+       EMC_XM2CMDPADCTRL4
+       EMC_XM2CMDPADCTRL5
+       EMC_XM2DQPADCTRL2
+       EMC_XM2DQPADCTRL3
+       EMC_XM2CLKPADCTRL
+       EMC_XM2CLKPADCTRL2
+       EMC_XM2COMPPADCTRL
+       EMC_XM2VTTGENPADCTRL
+       EMC_XM2VTTGENPADCTRL2
+       EMC_XM2VTTGENPADCTRL3
+       EMC_XM2DQSPADCTRL3
+       EMC_XM2DQSPADCTRL4
+       EMC_XM2DQSPADCTRL5
+       EMC_XM2DQSPADCTRL6
+       EMC_DSR_VTTGEN_DRV
+       EMC_TXDSRVTTGEN
+       EMC_FBIO_SPARE
+       EMC_ZCAL_WAIT_CNT
+       EMC_MRS_WAIT_CNT2
+       EMC_CTT
+       EMC_CTT_DURATION
+       EMC_CFG_PIPE
+       EMC_DYN_SELF_REF_CONTROL
+       EMC_QPOP
+
+Example SoC include file:
+
+/ {
+       emc@0,7001b000 {
+               compatible = "nvidia,tegra124-emc";
+               reg = <0x0 0x7001b000 0x0 0x1000>;
+
+               nvidia,memory-controller = <&mc>;
+       };
+};
+
+Example board file:
+
+/ {
+       emc@0,7001b000 {
+               emc-timings-3 {
+                       nvidia,ram-code = <3>;
+
+                       timing-12750000 {
+                               clock-frequency = <12750000>;
+
+                               nvidia,emc-zcal-cnt-long = <0x00000042>;
+                               nvidia,emc-auto-cal-interval = <0x001fffff>;
+                               nvidia,emc-ctt-term-ctrl = <0x00000802>;
+                               nvidia,emc-cfg = <0x73240000>;
+                               nvidia,emc-cfg-2 = <0x000008c5>;
+                               nvidia,emc-sel-dpd-ctrl = <0x00040128>;
+                               nvidia,emc-bgbias-ctl0 = <0x00000008>;
+                               nvidia,emc-auto-cal-config = <0xa1430000>;
+                               nvidia,emc-auto-cal-config2 = <0x00000000>;
+                               nvidia,emc-auto-cal-config3 = <0x00000000>;
+                               nvidia,emc-mode-reset = <0x80001221>;
+                               nvidia,emc-mode-1 = <0x80100003>;
+                               nvidia,emc-mode-2 = <0x80200008>;
+                               nvidia,emc-mode-4 = <0x00000000>;
+
+                               nvidia,emc-configuration = <
+                                       0x00000000 /* EMC_RC */
+                                       0x00000003 /* EMC_RFC */
+                                       0x00000000 /* EMC_RFC_SLR */
+                                       0x00000000 /* EMC_RAS */
+                                       0x00000000 /* EMC_RP */
+                                       0x00000004 /* EMC_R2W */
+                                       0x0000000a /* EMC_W2R */
+                                       0x00000003 /* EMC_R2P */
+                                       0x0000000b /* EMC_W2P */
+                                       0x00000000 /* EMC_RD_RCD */
+                                       0x00000000 /* EMC_WR_RCD */
+                                       0x00000003 /* EMC_RRD */
+                                       0x00000003 /* EMC_REXT */
+                                       0x00000000 /* EMC_WEXT */
+                                       0x00000006 /* EMC_WDV */
+                                       0x00000006 /* EMC_WDV_MASK */
+                                       0x00000006 /* EMC_QUSE */
+                                       0x00000002 /* EMC_QUSE_WIDTH */
+                                       0x00000000 /* EMC_IBDLY */
+                                       0x00000005 /* EMC_EINPUT */
+                                       0x00000005 /* EMC_EINPUT_DURATION */
+                                       0x00010000 /* EMC_PUTERM_EXTRA */
+                                       0x00000003 /* EMC_PUTERM_WIDTH */
+                                       0x00000000 /* EMC_PUTERM_ADJ */
+                                       0x00000000 /* EMC_CDB_CNTL_1 */
+                                       0x00000000 /* EMC_CDB_CNTL_2 */
+                                       0x00000000 /* EMC_CDB_CNTL_3 */
+                                       0x00000004 /* EMC_QRST */
+                                       0x0000000c /* EMC_QSAFE */
+                                       0x0000000d /* EMC_RDV */
+                                       0x0000000f /* EMC_RDV_MASK */
+                                       0x00000060 /* EMC_REFRESH */
+                                       0x00000000 /* EMC_BURST_REFRESH_NUM */
+                                       0x00000018 /* EMC_PRE_REFRESH_REQ_CNT */
+                                       0x00000002 /* EMC_PDEX2WR */
+                                       0x00000002 /* EMC_PDEX2RD */
+                                       0x00000001 /* EMC_PCHG2PDEN */
+                                       0x00000000 /* EMC_ACT2PDEN */
+                                       0x00000007 /* EMC_AR2PDEN */
+                                       0x0000000f /* EMC_RW2PDEN */
+                                       0x00000005 /* EMC_TXSR */
+                                       0x00000005 /* EMC_TXSRDLL */
+                                       0x00000004 /* EMC_TCKE */
+                                       0x00000005 /* EMC_TCKESR */
+                                       0x00000004 /* EMC_TPD */
+                                       0x00000000 /* EMC_TFAW */
+                                       0x00000000 /* EMC_TRPAB */
+                                       0x00000005 /* EMC_TCLKSTABLE */
+                                       0x00000005 /* EMC_TCLKSTOP */
+                                       0x00000064 /* EMC_TREFBW */
+                                       0x00000000 /* EMC_FBIO_CFG6 */
+                                       0x00000000 /* EMC_ODT_WRITE */
+                                       0x00000000 /* EMC_ODT_READ */
+                                       0x106aa298 /* EMC_FBIO_CFG5 */
+                                       0x002c00a0 /* EMC_CFG_DIG_DLL */
+                                       0x00008000 /* EMC_CFG_DIG_DLL_PERIOD */
+                                       0x00064000 /* EMC_DLL_XFORM_DQS0 */
+                                       0x00064000 /* EMC_DLL_XFORM_DQS1 */
+                                       0x00064000 /* EMC_DLL_XFORM_DQS2 */
+                                       0x00064000 /* EMC_DLL_XFORM_DQS3 */
+                                       0x00064000 /* EMC_DLL_XFORM_DQS4 */
+                                       0x00064000 /* EMC_DLL_XFORM_DQS5 */
+                                       0x00064000 /* EMC_DLL_XFORM_DQS6 */
+                                       0x00064000 /* EMC_DLL_XFORM_DQS7 */
+                                       0x00064000 /* EMC_DLL_XFORM_DQS8 */
+                                       0x00064000 /* EMC_DLL_XFORM_DQS9 */
+                                       0x00064000 /* EMC_DLL_XFORM_DQS10 */
+                                       0x00064000 /* EMC_DLL_XFORM_DQS11 */
+                                       0x00064000 /* EMC_DLL_XFORM_DQS12 */
+                                       0x00064000 /* EMC_DLL_XFORM_DQS13 */
+                                       0x00064000 /* EMC_DLL_XFORM_DQS14 */
+                                       0x00064000 /* EMC_DLL_XFORM_DQS15 */
+                                       0x00000000 /* EMC_DLL_XFORM_QUSE0 */
+                                       0x00000000 /* EMC_DLL_XFORM_QUSE1 */
+                                       0x00000000 /* EMC_DLL_XFORM_QUSE2 */
+                                       0x00000000 /* EMC_DLL_XFORM_QUSE3 */
+                                       0x00000000 /* EMC_DLL_XFORM_QUSE4 */
+                                       0x00000000 /* EMC_DLL_XFORM_QUSE5 */
+                                       0x00000000 /* EMC_DLL_XFORM_QUSE6 */
+                                       0x00000000 /* EMC_DLL_XFORM_QUSE7 */
+                                       0x00000000 /* EMC_DLL_XFORM_ADDR0 */
+                                       0x00000000 /* EMC_DLL_XFORM_ADDR1 */
+                                       0x00000000 /* EMC_DLL_XFORM_ADDR2 */
+                                       0x00000000 /* EMC_DLL_XFORM_ADDR3 */
+                                       0x00000000 /* EMC_DLL_XFORM_ADDR4 */
+                                       0x00000000 /* EMC_DLL_XFORM_ADDR5 */
+                                       0x00000000 /* EMC_DLL_XFORM_QUSE8 */
+                                       0x00000000 /* EMC_DLL_XFORM_QUSE9 */
+                                       0x00000000 /* EMC_DLL_XFORM_QUSE10 */
+                                       0x00000000 /* EMC_DLL_XFORM_QUSE11 */
+                                       0x00000000 /* EMC_DLL_XFORM_QUSE12 */
+                                       0x00000000 /* EMC_DLL_XFORM_QUSE13 */
+                                       0x00000000 /* EMC_DLL_XFORM_QUSE14 */
+                                       0x00000000 /* EMC_DLL_XFORM_QUSE15 */
+                                       0x00000000 /* EMC_DLI_TRIM_TXDQS0 */
+                                       0x00000000 /* EMC_DLI_TRIM_TXDQS1 */
+                                       0x00000000 /* EMC_DLI_TRIM_TXDQS2 */
+                                       0x00000000 /* EMC_DLI_TRIM_TXDQS3 */
+                                       0x00000000 /* EMC_DLI_TRIM_TXDQS4 */
+                                       0x00000000 /* EMC_DLI_TRIM_TXDQS5 */
+                                       0x00000000 /* EMC_DLI_TRIM_TXDQS6 */
+                                       0x00000000 /* EMC_DLI_TRIM_TXDQS7 */
+                                       0x00000000 /* EMC_DLI_TRIM_TXDQS8 */
+                                       0x00000000 /* EMC_DLI_TRIM_TXDQS9 */
+                                       0x00000000 /* EMC_DLI_TRIM_TXDQS10 */
+                                       0x00000000 /* EMC_DLI_TRIM_TXDQS11 */
+                                       0x00000000 /* EMC_DLI_TRIM_TXDQS12 */
+                                       0x00000000 /* EMC_DLI_TRIM_TXDQS13 */
+                                       0x00000000 /* EMC_DLI_TRIM_TXDQS14 */
+                                       0x00000000 /* EMC_DLI_TRIM_TXDQS15 */
+                                       0x000fc000 /* EMC_DLL_XFORM_DQ0 */
+                                       0x000fc000 /* EMC_DLL_XFORM_DQ1 */
+                                       0x000fc000 /* EMC_DLL_XFORM_DQ2 */
+                                       0x000fc000 /* EMC_DLL_XFORM_DQ3 */
+                                       0x0000fc00 /* EMC_DLL_XFORM_DQ4 */
+                                       0x0000fc00 /* EMC_DLL_XFORM_DQ5 */
+                                       0x0000fc00 /* EMC_DLL_XFORM_DQ6 */
+                                       0x0000fc00 /* EMC_DLL_XFORM_DQ7 */
+                                       0x10000280 /* EMC_XM2CMDPADCTRL */
+                                       0x00000000 /* EMC_XM2CMDPADCTRL4 */
+                                       0x00111111 /* EMC_XM2CMDPADCTRL5 */
+                                       0x00000000 /* EMC_XM2DQPADCTRL2 */
+                                       0x00000000 /* EMC_XM2DQPADCTRL3 */
+                                       0x77ffc081 /* EMC_XM2CLKPADCTRL */
+                                       0x00000e0e /* EMC_XM2CLKPADCTRL2 */
+                                       0x81f1f108 /* EMC_XM2COMPPADCTRL */
+                                       0x07070004 /* EMC_XM2VTTGENPADCTRL */
+                                       0x0000003f /* EMC_XM2VTTGENPADCTRL2 */
+                                       0x016eeeee /* EMC_XM2VTTGENPADCTRL3 */
+                                       0x51451400 /* EMC_XM2DQSPADCTRL3 */
+                                       0x00514514 /* EMC_XM2DQSPADCTRL4 */
+                                       0x00514514 /* EMC_XM2DQSPADCTRL5 */
+                                       0x51451400 /* EMC_XM2DQSPADCTRL6 */
+                                       0x0000003f /* EMC_DSR_VTTGEN_DRV */
+                                       0x00000007 /* EMC_TXDSRVTTGEN */
+                                       0x00000000 /* EMC_FBIO_SPARE */
+                                       0x00000042 /* EMC_ZCAL_WAIT_CNT */
+                                       0x000e000e /* EMC_MRS_WAIT_CNT2 */
+                                       0x00000000 /* EMC_CTT */
+                                       0x00000003 /* EMC_CTT_DURATION */
+                                       0x0000f2f3 /* EMC_CFG_PIPE */
+                                       0x800001c5 /* EMC_DYN_SELF_REF_CONTROL */
+                                       0x0000000a /* EMC_QPOP */
+                               >;
+                       };
+               };
+       };
+};
diff --git a/Documentation/devicetree/bindings/mfd/mfd.txt b/Documentation/devicetree/bindings/mfd/mfd.txt
new file mode 100644 (file)
index 0000000..af9d693
--- /dev/null
@@ -0,0 +1,41 @@
+Multi-Function Devices (MFD)
+
+These devices comprise a nexus for heterogeneous hardware blocks containing
+more than one non-unique yet varying hardware functionality.
+
+A typical MFD can be:
+
+- A mixed signal ASIC on an external bus, sometimes a PMIC (Power Management
+  Integrated Circuit) that is manufactured in a lower technology node (rough
+  silicon) that handles analog drivers for things like audio amplifiers, LED
+  drivers, level shifters, PHY (physical interfaces to things like USB or
+  ethernet), regulators etc.
+
+- A range of memory registers containing "miscellaneous system registers" also
+  known as a system controller "syscon" or any other memory range containing a
+  mix of unrelated hardware devices.
+
+Optional properties:
+
+- compatible : "simple-mfd" - this signifies that the operating system should
+  consider all subnodes of the MFD device as separate devices akin to how
+  "simple-bus" inidicates when to see subnodes as children for a simple
+  memory-mapped bus. For more complex devices, when the nexus driver has to
+  probe registers to figure out what child devices exist etc, this should not
+  be used. In the latter case the child devices will be determined by the
+  operating system.
+
+Example:
+
+foo@1000 {
+       compatible = "syscon", "simple-mfd";
+       reg = <0x01000 0x1000>;
+
+       led@08.0 {
+               compatible = "register-bit-led";
+               offset = <0x08>;
+               mask = <0x01>;
+               label = "myled";
+               default-state = "on";
+       };
+};
index 47b205cc9cc7acee20c44d9be6faf691e4cdad2c..4556359c58763bbd3cc60e36b0cea160b8e823fb 100644 (file)
@@ -10,3 +10,5 @@ Required properties:
        The second entry gives the physical address and length of the
        registers indicating the strapping options.
 
+Optional properties:
+- nvidia,long-ram-code: If present, the RAM code is long (4 bit). If not, short (2 bit).
index 3e2c88d97ad41f23d85f16bae8469be3db5cfa2a..02f979a48aeb2a40f3942f6669b464508c4faafe 100644 (file)
@@ -58,5 +58,5 @@ Example:
                        interrupt-controller;
                        #address-cells = <0>;
                        #interrupt-cells = <1>;
-               }
+               };
        };
diff --git a/Documentation/devicetree/bindings/pinctrl/berlin,pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/berlin,pinctrl.txt
new file mode 100644 (file)
index 0000000..a8bb5e2
--- /dev/null
@@ -0,0 +1,43 @@
+* Pin-controller driver for the Marvell Berlin SoCs
+
+Pin control registers are part of both chip controller and system
+controller register sets. Pin controller nodes should be a sub-node of
+either the chip controller or system controller node. The pins
+controlled are organized in groups, so no actual pin information is
+needed.
+
+A pin-controller node should contain subnodes representing the pin group
+configurations, one per function. Each subnode has the group name and
+the muxing function used.
+
+Be aware the Marvell Berlin datasheets use the keyword 'mode' for what
+is called a 'function' in the pin-controller subsystem.
+
+Required properties:
+- compatible: should be one of:
+       "marvell,berlin2-soc-pinctrl",
+       "marvell,berlin2-system-pinctrl",
+       "marvell,berlin2cd-soc-pinctrl",
+       "marvell,berlin2cd-system-pinctrl",
+       "marvell,berlin2q-soc-pinctrl",
+       "marvell,berlin2q-system-pinctrl"
+
+Required subnode-properties:
+- groups: a list of strings describing the group names.
+- function: a string describing the function used to mux the groups.
+
+Example:
+
+sys_pinctrl: pin-controller {
+       compatible = "marvell,berlin2q-system-pinctrl";
+
+       uart0_pmux: uart0-pmux {
+               groups = "GSM12";
+               function = "uart0";
+       };
+};
+
+&uart0 {
+       pinctrl-0 = <&uart0_pmux>;
+       pinctrl-names = "default";
+};
diff --git a/Documentation/devicetree/bindings/pinctrl/fsl,imx7d-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/fsl,imx7d-pinctrl.txt
new file mode 100644 (file)
index 0000000..8bbf25d
--- /dev/null
@@ -0,0 +1,27 @@
+* Freescale i.MX7 Dual IOMUX Controller
+
+Please refer to fsl,imx-pinctrl.txt in this directory for common binding part
+and usage.
+
+Required properties:
+- compatible: "fsl,imx7d-iomuxc"
+- fsl,pins: each entry consists of 6 integers and represents the mux and config
+  setting for one pin.  The first 5 integers <mux_reg conf_reg input_reg mux_val
+  input_val> are specified using a PIN_FUNC_ID macro, which can be found in
+  imx7d-pinfunc.h under device tree source folder.  The last integer CONFIG is
+  the pad setting value like pull-up on this pin.  Please refer to i.MX7 Dual
+  Reference Manual for detailed CONFIG settings.
+
+CONFIG bits definition:
+PAD_CTL_PUS_100K_DOWN           (0 << 5)
+PAD_CTL_PUS_5K_UP               (1 << 5)
+PAD_CTL_PUS_47K_UP              (2 << 5)
+PAD_CTL_PUS_100K_UP             (3 << 5)
+PAD_CTL_PUE                     (1 << 4)
+PAD_CTL_HYS                     (1 << 3)
+PAD_CTL_SRE_SLOW                (1 << 2)
+PAD_CTL_SRE_FAST                (0 << 2)
+PAD_CTL_DSE_X1                  (0 << 0)
+PAD_CTL_DSE_X2                  (1 << 0)
+PAD_CTL_DSE_X3                  (2 << 0)
+PAD_CTL_DSE_X4                  (3 << 0)
diff --git a/Documentation/devicetree/bindings/reset/berlin,reset.txt b/Documentation/devicetree/bindings/reset/berlin,reset.txt
new file mode 100644 (file)
index 0000000..514fee0
--- /dev/null
@@ -0,0 +1,23 @@
+Marvell Berlin reset controller
+===============================
+
+Please also refer to reset.txt in this directory for common reset
+controller binding usage.
+
+The reset controller node must be a sub-node of the chip controller
+node on Berlin SoCs.
+
+Required properties:
+- compatible: should be "marvell,berlin2-reset"
+- #reset-cells: must be set to 2
+
+Example:
+
+chip_rst: reset {
+       compatible = "marvell,berlin2-reset";
+       #reset-cells = <2>;
+};
+
+&usb_phy0 {
+       resets = <&chip_rst 0x104 12>;
+};
diff --git a/Documentation/devicetree/bindings/reset/brcm,bcm63138-pmb.txt b/Documentation/devicetree/bindings/reset/brcm,bcm63138-pmb.txt
new file mode 100644 (file)
index 0000000..a98872d
--- /dev/null
@@ -0,0 +1,19 @@
+Broadcom BCM63138 Processor Monitor Bus binding
+===============================================
+
+Please also refer to reset.txt in this directory for common reset
+controller binding usage.
+
+Require properties:
+
+- compatible: must be "brcm,bcm63138-pmb"
+- reg: base register address and size for this bus controller
+- #reset-cells: must be 2 first cell is the address within the bus instance designated
+  by the phandle, and the second is the number of zones for this peripheral
+
+Example:
+       pmb0: reset-controller@4800c0 {
+               compatible = "brcm,bcm63138-pmb";
+               reg = <0x4800c0 0x10>;
+               #reset-cells = <2>;
+       };
index ab757b84daa7edab473d2ec907cb0da3386d0b0a..ac2fcd6ff4b8cde39bf8446c406571fefa7684a9 100644 (file)
@@ -6,7 +6,8 @@ Required properties:
     * "samsung,s3c2416-rtc" - for controllers compatible with s3c2416 rtc.
     * "samsung,s3c2443-rtc" - for controllers compatible with s3c2443 rtc.
     * "samsung,s3c6410-rtc" - for controllers compatible with s3c6410 rtc.
-    * "samsung,exynos3250-rtc" - for controllers compatible with exynos3250 rtc.
+    * "samsung,exynos3250-rtc" - (deprecated) for controllers compatible with
+                                 exynos3250 rtc (use "samsung,s3c6410-rtc").
 - reg: physical base address of the controller and length of memory mapped
   region.
 - interrupts: Two interrupt numbers to the cpu should be specified. First
index ba3ecb8cb5a1855465d69e42ea812fc7e28518fb..cbae3d9a0278076873e5274f47b4881a92b51c0b 100644 (file)
@@ -1,7 +1,7 @@
 * ARM AMBA Primecell PL011 serial UART
 
 Required properties:
-- compatible: must be "arm,primecell", "arm,pl011"
+- compatible: must be "arm,primecell", "arm,pl011", "zte,zx296702-uart"
 - reg: exactly one register range with length 0x1000
 - interrupts: exactly one interrupt specifier
 
diff --git a/Documentation/devicetree/bindings/soc/sunxi/sram.txt b/Documentation/devicetree/bindings/soc/sunxi/sram.txt
new file mode 100644 (file)
index 0000000..0676981
--- /dev/null
@@ -0,0 +1,72 @@
+Allwinnner SoC SRAM controllers
+-----------------------------------------------------
+
+The SRAM controller found on most Allwinner devices is represented by
+a regular node for the SRAM controller itself, with sub-nodes
+reprensenting the SRAM handled by the SRAM controller.
+
+Controller Node
+---------------
+
+Required properties:
+- compatible : "allwinner,sun4i-a10-sram-controller"
+- reg : sram controller register offset + length
+
+SRAM nodes
+----------
+
+Each SRAM is described using the mmio-sram bindings documented in
+Documentation/devicetree/bindings/misc/sram.txt
+
+Each SRAM will have SRAM sections that are going to be handled by the
+SRAM controller as subnodes. These sections are represented following
+once again the representation described in the mmio-sram binding.
+
+The valid sections compatible are:
+    - allwinner,sun4i-a10-sram-a3-a4
+    - allwinner,sun4i-a10-sram-d
+
+Devices using SRAM sections
+---------------------------
+
+Some devices need to request to the SRAM controller to map an SRAM for
+their exclusive use.
+
+The relationship between such a device and an SRAM section is
+expressed through the allwinner,sram property, that will take a
+phandle and an argument.
+
+This valid values for this argument are:
+  - 0: CPU
+  - 1: Device
+
+Example
+-------
+sram-controller@01c00000 {
+       compatible = "allwinner,sun4i-a10-sram-controller";
+       reg = <0x01c00000 0x30>;
+       #address-cells = <1>;
+       #size-cells = <1>;
+       ranges;
+
+       sram_a: sram@00000000 {
+               compatible = "mmio-sram";
+               reg = <0x00000000 0xc000>;
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges = <0 0x00000000 0xc000>;
+
+               emac_sram: sram-section@8000 {
+                       compatible = "allwinner,sun4i-a10-sram-a3-a4";
+                       reg = <0x8000 0x4000>;
+                       status = "disabled";
+               };
+       };
+};
+
+emac: ethernet@01c0b000 {
+       compatible = "allwinner,sun4i-a10-emac";
+       ...
+
+       allwinner,sram = <&emac_sram 1>;
+};
index 4c388bb2f0a224b5247bb03b9c52172b4a48de8c..8f771441be60556ace93f2b29d87df856882c344 100644 (file)
@@ -60,7 +60,7 @@ Example:
 
        msiof0: spi@e6e20000 {
                compatible = "renesas,msiof-r8a7791";
-               reg = <0 0xe6e20000 0 0x0064>, <0 0xe7e20000 0 0x0064>;
+               reg = <0 0xe6e20000 0 0x0064>;
                interrupts = <0 156 IRQ_TYPE_LEVEL_HIGH>;
                clocks = <&mstp0_clks R8A7791_CLK_MSIOF0>;
                dmas = <&dmac0 0x51>, <&dmac0 0x52>;
index 993695c659e18ae1b5ca165b46e032e246be1cb7..eeee6cd51e5ce94985653015c08691cc24e5ed07 100644 (file)
@@ -6,6 +6,9 @@ Required properties:
 - interrupts : A list of 3 interrupts; one per timer channel.
 - clocks: phandle to the source clock
 
+Optional properties:
+- timer-width: Bit width of the timer, necessary if not 16.
+
 Example:
 
 ttc0: ttc0@f8001000 {
@@ -14,4 +17,5 @@ ttc0: ttc0@f8001000 {
        compatible = "cdns,ttc";
        reg = <0xF8001000 0x1000>;
        clocks = <&cpu_clk 3>;
+       timer-width = <32>;
 };
index e180d56c75dbed57994ed9f600446ed228d33dca..1be8d7a26c15fff480c9d9644914eeee0bec03e9 100644 (file)
@@ -5,6 +5,13 @@ OHCI
 Required properties:
  - compatible: Should be "atmel,at91rm9200-ohci" for USB controllers
    used in host mode.
+ - reg: Address and length of the register set for the device
+ - interrupts: Should contain ehci interrupt
+ - clocks: Should reference the peripheral, host and system clocks
+ - clock-names: Should contains two strings
+               "ohci_clk" for the peripheral clock
+               "hclk" for the host clock
+               "uhpck" for the system clock
  - num-ports: Number of ports.
  - atmel,vbus-gpio: If present, specifies a gpio that needs to be
    activated for the bus to be powered.
@@ -14,6 +21,8 @@ Required properties:
 usb0: ohci@00500000 {
        compatible = "atmel,at91rm9200-ohci", "usb-ohci";
        reg = <0x00500000 0x100000>;
+       clocks = <&uhphs_clk>, <&uhphs_clk>, <&uhpck>;
+       clock-names = "ohci_clk", "hclk", "uhpck";
        interrupts = <20 4>;
        num-ports = <2>;
 };
@@ -23,11 +32,19 @@ EHCI
 Required properties:
  - compatible: Should be "atmel,at91sam9g45-ehci" for USB controllers
    used in host mode.
+ - reg: Address and length of the register set for the device
+ - interrupts: Should contain ehci interrupt
+ - clocks: Should reference the peripheral and the UTMI clocks
+ - clock-names: Should contains two strings
+               "ehci_clk" for the peripheral clock
+               "usb_clk" for the UTMI clock
 
 usb1: ehci@00800000 {
        compatible = "atmel,at91sam9g45-ehci", "usb-ehci";
        reg = <0x00800000 0x100000>;
        interrupts = <22 4>;
+       clocks = <&utmi>, <&uhphs_clk>;
+       clock-names = "usb_clk", "ehci_clk";
 };
 
 AT91 USB device controller
@@ -53,6 +70,8 @@ usb1: gadget@fffa4000 {
        compatible = "atmel,at91rm9200-udc";
        reg = <0xfffa4000 0x4000>;
        interrupts = <10 4>;
+       clocks = <&udc_clk>, <&udpck>;
+       clock-names = "pclk", "hclk";
        atmel,vbus-gpio = <&pioC 5 0>;
 };
 
@@ -65,6 +84,10 @@ Required properties:
               "sama5d3-udc"
  - reg: Address and length of the register set for the device
  - interrupts: Should contain usba interrupt
+ - clocks: Should reference the peripheral and host clocks
+ - clock-names: Should contains two strings
+               "pclk" for the peripheral clock
+               "hclk" for the host clock
  - ep childnode: To specify the number of endpoints and their properties.
 
 Optional properties:
@@ -86,6 +109,8 @@ usb2: gadget@fff78000 {
        reg = <0x00600000 0x80000
               0xfff78000 0x400>;
        interrupts = <27 4 0>;
+       clocks = <&utmi>, <&udphs_clk>;
+       clock-names = "hclk", "pclk";
        atmel,vbus-gpio = <&pioB 19 0>;
 
        ep0 {
index 80339192c93e2626f81eed30fe97ff147c86d746..49cecc9e9d4d5af5be3fc905e41d3ddb2a9eacdb 100644 (file)
@@ -40,6 +40,7 @@ calxeda       Calxeda
 capella        Capella Microsystems, Inc
 cavium Cavium, Inc.
 cdns   Cadence Design Systems Inc.
+ceva   Ceva, Inc.
 chipidea       Chipidea, Inc
 chipone                ChipOne
 chipspark      ChipSPARK
@@ -52,6 +53,7 @@ cnxt  Conexant Systems, Inc.
 cortina        Cortina Systems, Inc.
 cosmic Cosmic Circuits
 crystalfontz   Crystalfontz America, Inc.
+cubietech      Cubietech, Ltd.
 dallas Maxim Integrated Products (formerly Dallas Semiconductor)
 davicom        DAVICOM Semiconductor, Inc.
 denx   Denx Software Engineering
@@ -60,6 +62,7 @@ digilent      Diglent, Inc.
 dlg    Dialog Semiconductor
 dlink  D-Link Corporation
 dmo    Data Modul AG
+ea     Embedded Artists AB
 ebv    EBV Elektronik
 edt    Emerging Display Technologies
 elan   Elan Microelectronic Corp.
@@ -90,9 +93,11 @@ gumstix      Gumstix, Inc.
 gw     Gateworks Corporation
 hannstar       HannStar Display Corporation
 haoyu  Haoyu Microelectronic Co. Ltd.
+hardkernel     Hardkernel Co., Ltd
 himax  Himax Technologies, Inc.
 hisilicon      Hisilicon Limited.
 hit    Hitachi Ltd.
+hitex  Hitex Development Tools
 honeywell      Honeywell
 hp     Hewlett Packard
 i2se   I2SE GmbH
@@ -159,6 +164,7 @@ radxa       Radxa
 raidsonic      RaidSonic Technology GmbH
 ralink Mediatek/Ralink Technology Corp.
 ramtron        Ramtron International
+raspberrypi    Raspberry Pi Foundation
 realtek Realtek Semiconductor Corp.
 renesas        Renesas Electronics Corporation
 ricoh  Ricoh Co. Ltd.
@@ -189,6 +195,7 @@ ste ST-Ericsson
 stericsson     ST-Ericsson
 synology       Synology, Inc.
 tbs    TBS Technologies
+tcl    Toby Churchill Ltd.
 thine  THine Electronics, Inc.
 ti     Texas Instruments
 tlm    Trusted Logic Mobility
@@ -202,6 +209,7 @@ variscite   Variscite Ltd.
 via    VIA Technologies, Inc.
 virtio Virtual I/O Device Specification, developed by the OASIS consortium
 voipac Voipac Technologies s.r.o.
+wexler Wexler
 winbond Winbond Electronics corp.
 wlf    Wolfson Microelectronics
 wm     Wondermedia Technologies, Inc.
@@ -211,3 +219,4 @@ xillybus    Xillybus Ltd.
 xlnx   Xilinx
 zyxel  ZyXEL Communications Corp.
 zarlink        Zarlink Semiconductor
+zte    ZTE Corp.
index 389bb5d618549e5db99ed5ea8cb1b23f38ca48f4..b228ca54bcf4863cdad2a12e4d2533e4fe689a71 100644 (file)
@@ -31,10 +31,10 @@ User manual
 ===========
 
 I2C slave backends behave like standard I2C clients. So, you can instantiate
-them like described in the document 'instantiating-devices'. A quick example
-for instantiating the slave-eeprom driver from userspace:
+them as described in the document 'instantiating-devices'. A quick example for
+instantiating the slave-eeprom driver from userspace at address 0x64 on bus 1:
 
-  # echo 0-0064 > /sys/bus/i2c/drivers/i2c-slave-eeprom/bind
+  # echo slave-24c02 0x64 > /sys/bus/i2c/devices/i2c-1/new_device
 
 Each backend should come with separate documentation to describe its specific
 behaviour and setup.
index 55bb093a08a303ea376b38d20b4a8c5dcce287cd..59ecd3d558c8ab83b401241ed03836eadfb3cf9c 100644 (file)
@@ -1482,6 +1482,12 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
                        By default, super page will be supported if Intel IOMMU
                        has the capability. With this option, super page will
                        not be supported.
+               ecs_off [Default Off]
+                       By default, extended context tables will be supported if
+                       the hardware advertises that it has support both for the
+                       extended tables themselves, and also PASID support. With
+                       this option set, extended tables will not be used even
+                       on hardware which claims to support them.
 
        intel_idle.max_cstate=  [KNL,HW,ACPI,X86]
                        0       disables intel_idle and fall back on acpi_idle.
index d727a38291005f962848ed40a1ab11db4c167899..53a726855e49bfa4c313e46e15df1eec7cb610ae 100644 (file)
@@ -20,7 +20,7 @@
        files/UDP-Lite-HOWTO.txt
 
    o The Wireshark UDP-Lite WiKi (with capture files):
-       http://wiki.wireshark.org/Lightweight_User_Datagram_Protocol
+       https://wiki.wireshark.org/Lightweight_User_Datagram_Protocol
 
    o The Protocol Spec, RFC 3828, http://www.ietf.org/rfc/rfc3828.txt
 
index d8afd29536786b0907c795afeb8cd5aa3ff2d3b6..beed9810569509741c74158da9bcea50ccb7c4c6 100644 (file)
@@ -1035,7 +1035,7 @@ F:        arch/arm/include/asm/hardware/dec21285.h
 F:     arch/arm/mach-footbridge/
 
 ARM/FREESCALE IMX / MXC ARM ARCHITECTURE
-M:     Shawn Guo <shawn.guo@linaro.org>
+M:     Shawn Guo <shawnguo@kernel.org>
 M:     Sascha Hauer <kernel@pengutronix.de>
 L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 S:     Maintained
@@ -1044,9 +1044,11 @@ F:       arch/arm/mach-imx/
 F:     arch/arm/mach-mxs/
 F:     arch/arm/boot/dts/imx*
 F:     arch/arm/configs/imx*_defconfig
+F:     drivers/clk/imx/
+F:     include/soc/imx/
 
 ARM/FREESCALE VYBRID ARM ARCHITECTURE
-M:     Shawn Guo <shawn.guo@linaro.org>
+M:     Shawn Guo <shawnguo@kernel.org>
 M:     Sascha Hauer <kernel@pengutronix.de>
 R:     Stefan Agner <stefan@agner.ch>
 L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
@@ -1189,6 +1191,12 @@ M:       Lennert Buytenhek <kernel@wantstofly.org>
 L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 S:     Maintained
 
+ARM/LPC18XX ARCHITECTURE
+M:     Joachim Eastwood <manabian@gmail.com>
+L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
+S:     Maintained
+N:     lpc18xx
+
 ARM/MAGICIAN MACHINE SUPPORT
 M:     Philipp Zabel <philipp.zabel@gmail.com>
 S:     Maintained
@@ -1385,6 +1393,7 @@ L:        linux-samsung-soc@vger.kernel.org (moderated for non-subscribers)
 S:     Maintained
 F:     arch/arm/boot/dts/s3c*
 F:     arch/arm/boot/dts/exynos*
+F:     arch/arm64/boot/dts/exynos/
 F:     arch/arm/plat-samsung/
 F:     arch/arm/mach-s3c24*/
 F:     arch/arm/mach-s3c64xx/
@@ -1494,6 +1503,14 @@ F:       drivers/usb/host/ehci-st.c
 F:     drivers/usb/host/ohci-st.c
 F:     drivers/ata/ahci_st.c
 
+ARM/STM32 ARCHITECTURE
+M:     Maxime Coquelin <mcoquelin.stm32@gmail.com>
+L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
+S:     Maintained
+T:     git git://git.kernel.org/pub/scm/linux/kernel/git/mcoquelin/stm32.git
+N:     stm32
+F:     drivers/clocksource/armv7m_systick.c
+
 ARM/TECHNOLOGIC SYSTEMS TS7250 MACHINE SUPPORT
 M:     Lennert Buytenhek <kernel@wantstofly.org>
 L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
@@ -1540,6 +1557,13 @@ F:       drivers/rtc/rtc-ab3100.c
 F:     drivers/rtc/rtc-coh901331.c
 T:     git git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-stericsson.git
 
+ARM/UNIPHIER ARCHITECTURE
+M:     Masahiro Yamada <yamada.masahiro@socionext.com>
+L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
+S:     Maintained
+F:     arch/arm/mach-uniphier/
+N:     uniphier
+
 ARM/Ux500 ARM ARCHITECTURE
 M:     Linus Walleij <linus.walleij@linaro.org>
 L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
@@ -1617,6 +1641,15 @@ S:       Maintained
 F:     arch/arm/mach-pxa/z2.c
 F:     arch/arm/mach-pxa/include/mach/z2.h
 
+ARM/ZTE ARCHITECTURE
+M:     Jun Nie <jun.nie@linaro.org>
+L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
+S:     Maintained
+F:     arch/arm/mach-zx/
+F:     drivers/clk/zte/
+F:     Documentation/devicetree/bindings/arm/zte.txt
+F:     Documentation/devicetree/bindings/clock/zx296702-clk.txt
+
 ARM/ZYNQ ARCHITECTURE
 M:     Michal Simek <michal.simek@xilinx.com>
 R:     Sören Brinkmann <soren.brinkmann@xilinx.com>
@@ -2193,6 +2226,7 @@ S:        Maintained
 F:     arch/arm/mach-bcm/*brcmstb*
 F:     arch/arm/boot/dts/bcm7*.dts*
 F:     drivers/bus/brcmstb_gisb.c
+N:     brcmstb
 
 BROADCOM BMIPS MIPS ARCHITECTURE
 M:     Kevin Cernekee <cernekee@gmail.com>
index 40a8b068ac2699428f5419603bd4464e3c0b47cc..f5c8983aeeb7fc0af300d1af05da2500f556cae8 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 VERSION = 4
 PATCHLEVEL = 1
 SUBLEVEL = 0
-EXTRAVERSION = -rc7
+EXTRAVERSION =
 NAME = Hurr durr I'ma sheep
 
 # *DOCUMENTATION*
index 45df48ba0b128dd408e2275687b1757c87e0ca74..72c4273de0039bc9cd3753be6dec323f6bf34581 100644 (file)
@@ -329,6 +329,20 @@ config ARCH_MULTIPLATFORM
        select SPARSE_IRQ
        select USE_OF
 
+config ARM_SINGLE_ARMV7M
+       bool "ARMv7-M based platforms (Cortex-M0/M3/M4)"
+       depends on !MMU
+       select ARCH_WANT_OPTIONAL_GPIOLIB
+       select ARM_NVIC
+       select AUTO_ZRELADDR
+       select CLKSRC_OF
+       select COMMON_CLK
+       select CPU_V7M
+       select GENERIC_CLOCKEVENTS
+       select NO_IOPORT_MAP
+       select SPARSE_IRQ
+       select USE_OF
+
 config ARCH_REALVIEW
        bool "ARM Ltd. RealView family"
        select ARCH_WANT_OPTIONAL_GPIOLIB
@@ -398,24 +412,6 @@ config ARCH_EBSA110
          Ethernet interface, two PCMCIA sockets, two serial ports and a
          parallel port.
 
-config ARCH_EFM32
-       bool "Energy Micro efm32"
-       depends on !MMU
-       select ARCH_REQUIRE_GPIOLIB
-       select ARM_NVIC
-       select AUTO_ZRELADDR
-       select CLKSRC_OF
-       select COMMON_CLK
-       select CPU_V7M
-       select GENERIC_CLOCKEVENTS
-       select NO_DMA
-       select NO_IOPORT_MAP
-       select SPARSE_IRQ
-       select USE_OF
-       help
-         Support for Energy Micro's (now Silicon Labs) efm32 Giant Gecko
-         processors.
-
 config ARCH_EP93XX
        bool "EP93xx-based"
        select ARCH_HAS_HOLES_MEMORYMODEL
@@ -606,6 +602,7 @@ config ARCH_PXA
        select ARCH_REQUIRE_GPIOLIB
        select ARM_CPU_SUSPEND if PM
        select AUTO_ZRELADDR
+       select COMMON_CLK
        select CLKDEV_LOOKUP
        select CLKSRC_MMIO
        select CLKSRC_OF
@@ -752,8 +749,10 @@ config ARCH_OMAP1
        select GENERIC_IRQ_CHIP
        select HAVE_IDE
        select IRQ_DOMAIN
+       select MULTI_IRQ_HANDLER
        select NEED_MACH_IO_H if PCCARD
        select NEED_MACH_MEMORY_H
+       select SPARSE_IRQ
        help
          Support for older TI OMAP1 (omap7xx, omap15xx or omap16xx)
 
@@ -937,6 +936,8 @@ source "arch/arm/mach-tegra/Kconfig"
 
 source "arch/arm/mach-u300/Kconfig"
 
+source "arch/arm/mach-uniphier/Kconfig"
+
 source "arch/arm/mach-ux500/Kconfig"
 
 source "arch/arm/mach-versatile/Kconfig"
@@ -948,8 +949,40 @@ source "arch/arm/mach-vt8500/Kconfig"
 
 source "arch/arm/mach-w90x900/Kconfig"
 
+source "arch/arm/mach-zx/Kconfig"
+
 source "arch/arm/mach-zynq/Kconfig"
 
+# ARMv7-M architecture
+config ARCH_EFM32
+       bool "Energy Micro efm32"
+       depends on ARM_SINGLE_ARMV7M
+       select ARCH_REQUIRE_GPIOLIB
+       help
+         Support for Energy Micro's (now Silicon Labs) efm32 Giant Gecko
+         processors.
+
+config ARCH_LPC18XX
+       bool "NXP LPC18xx/LPC43xx"
+       depends on ARM_SINGLE_ARMV7M
+       select ARCH_HAS_RESET_CONTROLLER
+       select ARM_AMBA
+       select CLKSRC_LPC32XX
+       select PINCTRL
+       help
+         Support for NXP's LPC18xx Cortex-M3 and LPC43xx Cortex-M4
+         high performance microcontrollers.
+
+config ARCH_STM32
+       bool "STMicrolectronics STM32"
+       depends on ARM_SINGLE_ARMV7M
+       select ARCH_HAS_RESET_CONTROLLER
+       select ARMV7M_SYSTICK
+       select CLKSRC_STM32
+       select RESET_CONTROLLER
+       help
+         Support for STMicroelectronics STM32 processors.
+
 # Definitions to make life easier
 config ARCH_ACORN
        bool
@@ -1477,7 +1510,8 @@ config ARM_PSCI
 # selected platforms.
 config ARCH_NR_GPIO
        int
-       default 1024 if ARCH_SHMOBILE || ARCH_TEGRA || ARCH_ZYNQ
+       default 1024 if ARCH_BRCMSTB || ARCH_SHMOBILE || ARCH_TEGRA || \
+               ARCH_ZYNQ
        default 512 if ARCH_EXYNOS || ARCH_KEYSTONE || SOC_OMAP5 || \
                SOC_DRA7XX || ARCH_S3C24XX || ARCH_S3C64XX || ARCH_S5PV210
        default 416 if ARCH_SUNXI
index 0c12ffb155a23c604c9bbb9b849a913d359e34ae..a6b5d0e35968e66793a95814dfca0e4415084958 100644 (file)
@@ -410,6 +410,13 @@ choice
                  Say Y here if you want kernel low-level debugging support
                  on i.MX6SX.
 
+       config DEBUG_IMX7D_UART
+               bool "i.MX7D Debug UART"
+               depends on SOC_IMX7D
+               help
+                 Say Y here if you want kernel low-level debugging support
+                 on i.MX7D.
+
        config DEBUG_KEYSTONE_UART0
                bool "Kernel low-level debugging on KEYSTONE2 using UART0"
                depends on ARCH_KEYSTONE
@@ -433,6 +440,14 @@ choice
                  Say Y here if you want kernel low-level debugging support
                  on KS8695.
 
+       config DEBUG_LPC18XX_UART0
+               bool "Kernel low-level debugging via LPC18xx/43xx UART0"
+               depends on ARCH_LPC18XX
+               select DEBUG_UART_8250
+               help
+                 Say Y here if you want kernel low-level debugging support
+                 on NXP LPC18xx/43xx UART0.
+
        config DEBUG_MESON_UARTAO
                bool "Kernel low-level debugging via Meson6 UARTAO"
                depends on ARCH_MESON
@@ -908,13 +923,22 @@ choice
                  on SA-11x0 UART ports. The kernel will check for the first
                  enabled UART in a sequence 3-1-2.
 
-       config DEBUG_SOCFPGA_UART
+       config DEBUG_SOCFPGA_UART0
+               depends on ARCH_SOCFPGA
+               bool "Use SOCFPGA UART0 for low-level debug"
+               select DEBUG_UART_8250
+               help
+                 Say Y here if you want kernel low-level debugging support
+                 on SOCFPGA(Cyclone 5 and Arria 5) based platforms.
+
+       config DEBUG_SOCFPGA_UART1
                depends on ARCH_SOCFPGA
-               bool "Use SOCFPGA UART for low-level debug"
+               bool "Use SOCFPGA UART1 for low-level debug"
                select DEBUG_UART_8250
                help
                  Say Y here if you want kernel low-level debugging support
-                 on SOCFPGA based platforms.
+                 on SOCFPGA(Arria 10) based platforms.
+
 
        config DEBUG_SUN9I_UART0
                bool "Kernel low-level debugging messages via sun9i UART0"
@@ -1157,6 +1181,18 @@ choice
                  For more details about semihosting, please see
                  chapter 8 of DUI0203I_rvct_developer_guide.pdf from ARM Ltd.
 
+       config DEBUG_ZTE_ZX
+               bool "Use ZTE ZX UART"
+               select DEBUG_UART_PL01X
+               depends on ARCH_ZX
+               help
+                 Say Y here if you are enabling ZTE ZX296702 SOC and need
+                 debug uart support.
+
+                 This option is preferred over the platform specific
+                 options; the platform specific options are deprecated
+                 and will be soon removed.
+
        config DEBUG_LL_UART_8250
                bool "Kernel low-level debugging via 8250 UART"
                help
@@ -1231,7 +1267,8 @@ config DEBUG_IMX_UART_PORT
                                                DEBUG_IMX53_UART || \
                                                DEBUG_IMX6Q_UART || \
                                                DEBUG_IMX6SL_UART || \
-                                               DEBUG_IMX6SX_UART
+                                               DEBUG_IMX6SX_UART || \
+                                               DEBUG_IMX7D_UART
        default 1
        depends on ARCH_MXC
        help
@@ -1281,7 +1318,8 @@ config DEBUG_LL_INCLUDE
                                 DEBUG_IMX53_UART ||\
                                 DEBUG_IMX6Q_UART || \
                                 DEBUG_IMX6SL_UART || \
-                                DEBUG_IMX6SX_UART
+                                DEBUG_IMX6SX_UART || \
+                                DEBUG_IMX7D_UART
        default "debug/ks8695.S" if DEBUG_KS8695_UART
        default "debug/msm.S" if DEBUG_QCOM_UARTDM
        default "debug/netx.S" if DEBUG_NETX_UART
@@ -1337,6 +1375,7 @@ config DEBUG_UART_PHYS
        default 0x02531000 if DEBUG_KEYSTONE_UART1
        default 0x03010fe0 if ARCH_RPC
        default 0x07000000 if DEBUG_SUN9I_UART0
+       default 0x09405000 if DEBUG_ZTE_ZX
        default 0x10009000 if DEBUG_REALVIEW_STD_PORT || \
                                DEBUG_VEXPRESS_UART0_CA9
        default 0x1010c000 if DEBUG_REALVIEW_PB1176_PORT
@@ -1359,6 +1398,7 @@ config DEBUG_UART_PHYS
        default 0x20201000 if DEBUG_BCM2835
        default 0x3e000000 if DEBUG_BCM_KONA_UART
        default 0x4000e400 if DEBUG_LL_UART_EFM32
+       default 0x40081000 if DEBUG_LPC18XX_UART0
        default 0x40090000 if ARCH_LPC32XX
        default 0x40100000 if DEBUG_PXA_UART1
        default 0x42000000 if ARCH_GEMINI
@@ -1407,7 +1447,8 @@ config DEBUG_UART_PHYS
        default 0xfd883000 if DEBUG_ALPINE_UART0
        default 0xfe800000 if ARCH_IOP32X
        default 0xff690000 if DEBUG_RK32_UART2
-       default 0xffc02000 if DEBUG_SOCFPGA_UART
+       default 0xffc02000 if DEBUG_SOCFPGA_UART0
+       default 0xffc02100 if DEBUG_SOCFPGA_UART1
        default 0xffd82340 if ARCH_IOP13XX
        default 0xffe40000 if DEBUG_RCAR_GEN1_SCIF0
        default 0xffe42000 if DEBUG_RCAR_GEN1_SCIF2
@@ -1466,6 +1507,7 @@ config DEBUG_UART_VIRT
        default 0xfb009000 if DEBUG_REALVIEW_STD_PORT
        default 0xfb10c000 if DEBUG_REALVIEW_PB1176_PORT
        default 0xfc40ab00 if DEBUG_BRCMSTB_UART
+       default 0xfc705000 if DEBUG_ZTE_ZX
        default 0xfcfe8600 if DEBUG_UART_BCM63XX
        default 0xfd000000 if ARCH_SPEAR3XX || ARCH_SPEAR6XX
        default 0xfd000000 if ARCH_SPEAR13XX
@@ -1485,7 +1527,8 @@ config DEBUG_UART_VIRT
        default 0xfeb26000 if DEBUG_RK3X_UART1
        default 0xfeb30c00 if DEBUG_KEYSTONE_UART0
        default 0xfeb31000 if DEBUG_KEYSTONE_UART1
-       default 0xfec02000 if DEBUG_SOCFPGA_UART
+       default 0xfec02000 if DEBUG_SOCFPGA_UART0
+       default 0xfec02100 if DEBUG_SOCFPGA_UART1
        default 0xfec12000 if DEBUG_MVEBU_UART0 || DEBUG_MVEBU_UART0_ALTERNATE
        default 0xfec12100 if DEBUG_MVEBU_UART1_ALTERNATE
        default 0xfec10000 if DEBUG_SIRFATLAS7_UART0
@@ -1530,8 +1573,9 @@ config DEBUG_UART_8250_WORD
        bool "Use 32-bit accesses for 8250 UART"
        depends on DEBUG_LL_UART_8250 || DEBUG_UART_8250
        depends on DEBUG_UART_8250_SHIFT >= 2
-       default y if DEBUG_PICOXCELL_UART || DEBUG_SOCFPGA_UART || \
-               ARCH_KEYSTONE || DEBUG_ALPINE_UART0 || \
+       default y if DEBUG_PICOXCELL_UART || DEBUG_SOCFPGA_UART0 || \
+               DEBUG_SOCFPGA_UART1 || ARCH_KEYSTONE || \
+               DEBUG_ALPINE_UART0 || \
                DEBUG_DAVINCI_DMx_UART0 || DEBUG_DAVINCI_DA8XX_UART1 || \
                DEBUG_DAVINCI_DA8XX_UART2 || \
                DEBUG_BCM_KONA_UART || DEBUG_RK32_UART2 || \
@@ -1544,7 +1588,7 @@ config DEBUG_UART_8250_FLOW_CONTROL
 
 config DEBUG_UNCOMPRESS
        bool
-       depends on ARCH_MULTIPLATFORM || PLAT_SAMSUNG
+       depends on ARCH_MULTIPLATFORM || PLAT_SAMSUNG || ARM_SINGLE_ARMV7M
        default y if DEBUG_LL && !DEBUG_OMAP2PLUS_UART && \
                     (!DEBUG_TEGRA_UART || !ZBOOT_ROM)
        help
@@ -1561,7 +1605,7 @@ config DEBUG_UNCOMPRESS
 config UNCOMPRESS_INCLUDE
        string
        default "debug/uncompress.h" if ARCH_MULTIPLATFORM || ARCH_MSM || \
-                                       PLAT_SAMSUNG || ARCH_EFM32 || \
+                                       PLAT_SAMSUNG || ARM_SINGLE_ARMV7M || \
                                        ARCH_SHMOBILE_LEGACY
        default "mach/uncompress.h"
 
index 985227cbbd1bd797546c36099dcd7cc17c0efc4f..2a4fae7e9c44b4d647fa0c2222673edbdecded13 100644 (file)
@@ -167,6 +167,7 @@ machine-$(CONFIG_ARCH_IOP33X)               += iop33x
 machine-$(CONFIG_ARCH_IXP4XX)          += ixp4xx
 machine-$(CONFIG_ARCH_KEYSTONE)                += keystone
 machine-$(CONFIG_ARCH_KS8695)          += ks8695
+machine-$(CONFIG_ARCH_LPC18XX)         += lpc18xx
 machine-$(CONFIG_ARCH_LPC32XX)         += lpc32xx
 machine-$(CONFIG_ARCH_MESON)           += meson
 machine-$(CONFIG_ARCH_MMP)             += mmp
@@ -196,14 +197,17 @@ machine-$(CONFIG_ARCH_SHMOBILE)   += shmobile
 machine-$(CONFIG_ARCH_SIRF)            += prima2
 machine-$(CONFIG_ARCH_SOCFPGA)         += socfpga
 machine-$(CONFIG_ARCH_STI)             += sti
+machine-$(CONFIG_ARCH_STM32)           += stm32
 machine-$(CONFIG_ARCH_SUNXI)           += sunxi
 machine-$(CONFIG_ARCH_TEGRA)           += tegra
 machine-$(CONFIG_ARCH_U300)            += u300
 machine-$(CONFIG_ARCH_U8500)           += ux500
+machine-$(CONFIG_ARCH_UNIPHIER)                += uniphier
 machine-$(CONFIG_ARCH_VERSATILE)       += versatile
 machine-$(CONFIG_ARCH_VEXPRESS)                += vexpress
 machine-$(CONFIG_ARCH_VT8500)          += vt8500
 machine-$(CONFIG_ARCH_W90X900)         += w90x900
+machine-$(CONFIG_ARCH_ZX)              += zx
 machine-$(CONFIG_ARCH_ZYNQ)            += zynq
 machine-$(CONFIG_PLAT_SPEAR)           += spear
 
index 992736b5229ba7bd06497feb35ecff5fc36ab232..246473a244f64736234a9973f754b8d488945908 100644 (file)
@@ -20,9 +20,9 @@ dtb-$(CONFIG_SOC_SAM_V4_V5) += \
        tny_a9263.dtb \
        usb_a9263.dtb \
        at91-foxg20.dtb \
+       at91-kizbox.dtb \
        at91sam9g20ek.dtb \
        at91sam9g20ek_2mmc.dtb \
-       kizbox.dtb \
        tny_a9g20.dtb \
        usb_a9g20.dtb \
        usb_a9g20_lpw.dtb \
@@ -31,13 +31,16 @@ dtb-$(CONFIG_SOC_SAM_V4_V5) += \
        at91sam9n12ek.dtb \
        at91sam9rlek.dtb \
        at91-ariag25.dtb \
+       at91-ariettag25.dtb \
        at91-cosino_mega2560.dtb \
+       at91-kizboxmini.dtb \
        at91sam9g15ek.dtb \
        at91sam9g25ek.dtb \
        at91sam9g35ek.dtb \
        at91sam9x25ek.dtb \
        at91sam9x35ek.dtb
 dtb-$(CONFIG_SOC_SAM_V7) += \
+       at91-kizbox2.dtb \
        at91-sama5d3_xplained.dtb \
        sama5d31ek.dtb \
        sama5d33ek.dtb \
@@ -56,13 +59,18 @@ dtb-$(CONFIG_ARCH_BCM2835) += \
        bcm2835-rpi-b.dtb \
        bcm2835-rpi-b-plus.dtb
 dtb-$(CONFIG_ARCH_BCM_5301X) += \
+       bcm4708-asus-rt-ac56u.dtb \
+       bcm4708-asus-rt-ac68u.dtb \
        bcm4708-buffalo-wzr-1750dhp.dtb \
        bcm4708-luxul-xwc-1000.dtb \
        bcm4708-netgear-r6250.dtb \
        bcm4708-netgear-r6300-v2.dtb \
+       bcm4708-smartrg-sr400ac.dtb \
        bcm47081-asus-rt-n18u.dtb \
        bcm47081-buffalo-wzr-600dhp2.dtb \
        bcm47081-buffalo-wzr-900dhp.dtb \
+       bcm4709-asus-rt-ac87u.dtb \
+       bcm4709-buffalo-wxr-1900dhp.dtb \
        bcm4709-netgear-r8000.dtb
 dtb-$(CONFIG_ARCH_BCM_63XX) += \
        bcm963138dvt.dtb
@@ -113,6 +121,7 @@ dtb-$(CONFIG_ARCH_EXYNOS5) += \
        exynos5420-peach-pit.dtb \
        exynos5420-smdk5420.dtb \
        exynos5422-odroidxu3.dtb \
+       exynos5422-odroidxu3-lite.dtb \
        exynos5440-sd5v1.dtb \
        exynos5440-ssdk5440.dtb \
        exynos5800-peach-pi.dtb
@@ -201,6 +210,9 @@ dtb-$(CONFIG_MACH_KIRKWOOD) += \
        kirkwood-ts219-6282.dtb \
        kirkwood-ts419-6281.dtb \
        kirkwood-ts419-6282.dtb
+dtb-$(CONFIG_ARCH_LPC18XX) += \
+       lpc4350-hitex-eval.dtb \
+       lpc4357-ea4357-devkit.dtb
 dtb-$(CONFIG_ARCH_LPC32XX) += \
        ea3250.dtb phy3250.dtb
 dtb-$(CONFIG_MACH_MESON6) += \
@@ -254,14 +266,18 @@ dtb-$(CONFIG_SOC_IMX53) += \
        imx53-tx53-x13x.dtb \
        imx53-voipac-bsb.dtb
 dtb-$(CONFIG_SOC_IMX6Q) += \
+       imx6dl-apf6dev.dtb \
        imx6dl-aristainetos_4.dtb \
        imx6dl-aristainetos_7.dtb \
+       imx6dl-aristainetos2_4.dtb \
+       imx6dl-aristainetos2_7.dtb \
        imx6dl-cubox-i.dtb \
        imx6dl-dfi-fs700-m60.dtb \
        imx6dl-gw51xx.dtb \
        imx6dl-gw52xx.dtb \
        imx6dl-gw53xx.dtb \
        imx6dl-gw54xx.dtb \
+       imx6dl-gw551x.dtb \
        imx6dl-gw552x.dtb \
        imx6dl-hummingboard.dtb \
        imx6dl-nitrogen6x.dtb \
@@ -277,6 +293,7 @@ dtb-$(CONFIG_SOC_IMX6Q) += \
        imx6dl-udoo.dtb \
        imx6dl-wandboard.dtb \
        imx6dl-wandboard-revb1.dtb \
+       imx6q-apf6dev.dtb \
        imx6q-arm2.dtb \
        imx6q-cm-fx6.dtb \
        imx6q-cubox-i.dtb \
@@ -288,6 +305,7 @@ dtb-$(CONFIG_SOC_IMX6Q) += \
        imx6q-gw53xx.dtb \
        imx6q-gw5400-a.dtb \
        imx6q-gw54xx.dtb \
+       imx6q-gw551x.dtb \
        imx6q-gw552x.dtb \
        imx6q-hummingboard.dtb \
        imx6q-nitrogen6x.dtb \
@@ -313,12 +331,15 @@ dtb-$(CONFIG_SOC_IMX6SX) += \
        imx6sx-sabreauto.dtb \
        imx6sx-sdb-reva.dtb \
        imx6sx-sdb.dtb
+dtb-$(CONFIG_SOC_IMX7D) += \
+       imx7d-sdb.dtb
 dtb-$(CONFIG_SOC_LS1021A) += \
        ls1021a-qds.dtb \
        ls1021a-twr.dtb
 dtb-$(CONFIG_SOC_VF610) += \
        vf500-colibri-eval-v3.dtb \
        vf610-colibri-eval-v3.dtb \
+       vf610m4-colibri.dtb \
        vf610-cosmic.dtb \
        vf610-twr.dtb
 dtb-$(CONFIG_ARCH_MXS) += \
@@ -360,6 +381,7 @@ dtb-$(CONFIG_ARCH_OMAP3) += \
        am3517-craneboard.dtb \
        am3517-evm.dtb \
        am3517_mt_ventoux.dtb \
+       logicpd-torpedo-37xx-devkit.dtb \
        omap3430-sdp.dtb \
        omap3-beagle.dtb \
        omap3-beagle-xm.dtb \
@@ -406,9 +428,11 @@ dtb-$(CONFIG_ARCH_OMAP3) += \
 dtb-$(CONFIG_SOC_TI81XX) += \
        dm8168-evm.dtb
 dtb-$(CONFIG_SOC_AM33XX) += \
+       am335x-baltos-ir5221.dtb \
        am335x-base0033.dtb \
        am335x-bone.dtb \
        am335x-boneblack.dtb \
+       am335x-sl50.dtb \
        am335x-evm.dtb \
        am335x-evmsk.dtb \
        am335x-nano.dtb \
@@ -496,7 +520,7 @@ dtb-$(CONFIG_ARCH_SHMOBILE_MULTI) += \
        sh73a0-kzm9g.dtb
 dtb-$(CONFIG_ARCH_SOCFPGA) += \
        socfpga_arria5_socdk.dtb \
-       socfpga_arria10_socdk.dtb \
+       socfpga_arria10_socdk_sdmmc.dtb \
        socfpga_cyclone5_socdk.dtb \
        socfpga_cyclone5_sockit.dtb \
        socfpga_cyclone5_socrates.dtb \
@@ -520,32 +544,39 @@ dtb-$(CONFIG_ARCH_STI) += \
        stih416-b2020.dtb \
        stih416-b2020e.dtb \
        stih418-b2199.dtb
+dtb-$(CONFIG_ARCH_STM32)+= stm32f429-disco.dtb
 dtb-$(CONFIG_MACH_SUN4I) += \
        sun4i-a10-a1000.dtb \
        sun4i-a10-ba10-tvbox.dtb \
        sun4i-a10-chuwi-v7-cw0825.dtb \
        sun4i-a10-cubieboard.dtb \
+       sun4i-a10-gemei-g9.dtb \
+       sun4i-a10-hackberry.dtb \
+       sun4i-a10-hyundai-a7hd.dtb \
+       sun4i-a10-inet97fv2.dtb \
+       sun4i-a10-jesurun-q5.dtb \
        sun4i-a10-marsboard.dtb \
        sun4i-a10-mini-xplus.dtb \
        sun4i-a10-mk802.dtb \
        sun4i-a10-mk802ii.dtb \
-       sun4i-a10-hackberry.dtb \
-       sun4i-a10-hyundai-a7hd.dtb \
-       sun4i-a10-inet97fv2.dtb \
        sun4i-a10-olinuxino-lime.dtb \
        sun4i-a10-pcduino.dtb
 dtb-$(CONFIG_MACH_SUN5I) += \
+       sun5i-a10s-auxtek-t004.dtb \
        sun5i-a10s-mk802.dtb \
        sun5i-a10s-olinuxino-micro.dtb \
        sun5i-a10s-r7-tv-dongle.dtb \
        sun5i-a13-hsg-h702.dtb \
        sun5i-a13-olinuxino.dtb \
-       sun5i-a13-olinuxino-micro.dtb
+       sun5i-a13-olinuxino-micro.dtb \
+       sun5i-a13-utoo-p66.dtb
 dtb-$(CONFIG_MACH_SUN6I) += \
        sun6i-a31-app4-evb1.dtb \
        sun6i-a31-colombus.dtb \
        sun6i-a31-hummingbird.dtb \
+       sun6i-a31-i7.dtb \
        sun6i-a31-m9.dtb \
+       sun6i-a31-mele-a1000g-quad.dtb \
        sun6i-a31s-cs908.dtb
 dtb-$(CONFIG_MACH_SUN7I) += \
        sun7i-a20-bananapi.dtb \
@@ -555,15 +586,25 @@ dtb-$(CONFIG_MACH_SUN7I) += \
        sun7i-a20-hummingbird.dtb \
        sun7i-a20-i12-tvbox.dtb \
        sun7i-a20-m3.dtb \
+       sun7i-a20-mk808c.dtb \
        sun7i-a20-olinuxino-lime.dtb \
        sun7i-a20-olinuxino-lime2.dtb \
        sun7i-a20-olinuxino-micro.dtb \
-       sun7i-a20-pcduino3.dtb
+       sun7i-a20-orangepi.dtb \
+       sun7i-a20-orangepi-mini.dtb \
+       sun7i-a20-pcduino3.dtb \
+       sun7i-a20-pcduino3-nano.dtb \
+       sun7i-a20-wexler-tab7200.dtb
 dtb-$(CONFIG_MACH_SUN8I) += \
+       sun8i-a23-evb.dtb \
        sun8i-a23-ippo-q8h-v5.dtb \
-       sun8i-a23-ippo-q8h-v1.2.dtb
+       sun8i-a23-ippo-q8h-v1.2.dtb \
+       sun8i-a33-et-q8-v1.6.dtb \
+       sun8i-a33-ga10h-v1.1.dtb \
+       sun8i-a33-sinlinx-sina33.dtb
 dtb-$(CONFIG_MACH_SUN9I) += \
-       sun9i-a80-optimus.dtb
+       sun9i-a80-optimus.dtb \
+       sun9i-a80-cubieboard4.dtb
 dtb-$(CONFIG_ARCH_TEGRA_2x_SOC) += \
        tegra20-harmony.dtb \
        tegra20-iris-512.dtb \
@@ -600,6 +641,11 @@ dtb-$(CONFIG_ARCH_U8500) += \
        ste-hrefv60plus-tvk.dtb \
        ste-ccu8540.dtb \
        ste-ccu9540.dtb
+dtb-$(CONFIG_ARCH_UNIPHIER) += \
+       uniphier-ph1-sld3-ref.dtb \
+       uniphier-ph1-ld4-ref.dtb \
+       uniphier-ph1-pro4-ref.dtb \
+       uniphier-ph1-sld8-ref.dtb
 dtb-$(CONFIG_ARCH_VERSATILE) += \
        versatile-ab.dtb \
        versatile-pb.dtb
@@ -624,6 +670,7 @@ dtb-$(CONFIG_ARCH_ZYNQ) += \
        zynq-zybo.dtb
 dtb-$(CONFIG_MACH_ARMADA_370) += \
        armada-370-db.dtb \
+       armada-370-dlink-dns327l.dtb \
        armada-370-mirabox.dtb \
        armada-370-netgear-rn102.dtb \
        armada-370-netgear-rn104.dtb \
@@ -633,6 +680,8 @@ dtb-$(CONFIG_MACH_ARMADA_375) += \
        armada-375-db.dtb
 dtb-$(CONFIG_MACH_ARMADA_38X) += \
        armada-385-db-ap.dtb \
+       armada-385-linksys-caiman.dtb \
+       armada-385-linksys-cobra.dtb \
        armada-388-db.dtb \
        armada-388-gp.dtb \
        armada-388-rd.dtb
@@ -649,17 +698,18 @@ dtb-$(CONFIG_MACH_ARMADA_XP) += \
        armada-xp-openblocks-ax3-4.dtb \
        armada-xp-synology-ds414.dtb
 dtb-$(CONFIG_MACH_DOVE) += \
-       dove-cm-a510.dtb \
        dove-cubox.dtb \
        dove-cubox-es.dtb \
        dove-d2plug.dtb \
        dove-d3plug.dtb \
-       dove-dove-db.dtb
+       dove-dove-db.dtb \
+       dove-sbc-a510.dtb
 dtb-$(CONFIG_ARCH_MEDIATEK) += \
        mt6589-aquaris5.dtb \
        mt6592-evb.dtb \
        mt8127-moose.dtb \
        mt8135-evbp1.dtb
+dtb-$(CONFIG_ARCH_ZX) += zx296702-ad1.dtb
 endif
 
 always         := $(dtb-y)
diff --git a/arch/arm/boot/dts/am335x-baltos-ir5221.dts b/arch/arm/boot/dts/am335x-baltos-ir5221.dts
new file mode 100644 (file)
index 0000000..7d36601
--- /dev/null
@@ -0,0 +1,532 @@
+/*
+ * 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.
+ */
+
+/*
+ * VScom OnRISC
+ * http://www.vscom.de
+ */
+
+/dts-v1/;
+
+#include "am33xx.dtsi"
+#include <dt-bindings/pwm/pwm.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+
+/ {
+       model = "OnRISC Baltos iR 5221";
+       compatible = "vscom,onrisc", "ti,am33xx";
+
+       cpus {
+               cpu@0 {
+                       cpu0-supply = <&vdd1_reg>;
+               };
+       };
+
+       memory {
+               device_type = "memory";
+               reg = <0x80000000 0x10000000>; /* 256 MB */
+       };
+
+       vbat: fixedregulator@0 {
+               compatible = "regulator-fixed";
+               regulator-name = "vbat";
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;
+               regulator-boot-on;
+       };
+
+       wl12xx_vmmc: fixedregulator@2 {
+               pinctrl-names = "default";
+               pinctrl-0 = <&wl12xx_gpio>;
+               compatible = "regulator-fixed";
+               regulator-name = "vwl1271";
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+               gpio = <&gpio3 8 0>;
+               startup-delay-us = <70000>;
+               enable-active-high;
+       };
+};
+
+&am33xx_pinmux {
+       mmc2_pins: pinmux_mmc2_pins {
+               pinctrl-single,pins = <
+                       0x020 (PIN_INPUT_PULLUP | MUX_MODE2)      /* gpmc_ad8.mmc1_dat0_mux0 */
+                       0x024 (PIN_INPUT_PULLUP | MUX_MODE2)      /* gpmc_ad9.mmc1_dat1_mux0 */
+                       0x028 (PIN_INPUT_PULLUP | MUX_MODE2)      /* gpmc_ad10.mmc1_dat2_mux0 */
+                       0x02c (PIN_INPUT_PULLUP | MUX_MODE2)      /* gpmc_ad11.mmc1_dat3_mux0 */
+                       0x080 (PIN_INPUT_PULLUP | MUX_MODE2)      /* gpmc_csn1.mmc1_clk_mux0 */
+                       0x084 (PIN_INPUT_PULLUP | MUX_MODE2)      /* gpmc_csn2.mmc1_cmd_mux0 */
+                       0x1e4 (PIN_INPUT_PULLUP | MUX_MODE7)      /* emu0.gpio3[7] */
+               >;
+       };
+
+       wl12xx_gpio: pinmux_wl12xx_gpio {
+               pinctrl-single,pins = <
+                       0x1e8 (PIN_OUTPUT_PULLUP | MUX_MODE7)      /* emu1.gpio3[8] */
+               >;
+       };
+
+       tps65910_pins: pinmux_tps65910_pins {
+               pinctrl-single,pins = <
+                       0x078 (PIN_INPUT_PULLUP | MUX_MODE7)      /* gpmc_ben1.gpio1[28] */
+               >;
+       };
+
+       tca6416_pins: pinmux_tca6416_pins {
+               pinctrl-single,pins = <
+                       0x1b4 (PIN_INPUT_PULLUP | MUX_MODE7)      /* xdma_event_intr1.gpio0[20] tca6416 stuff */
+               >;
+       };
+
+       i2c1_pins: pinmux_i2c1_pins {
+               pinctrl-single,pins = <
+                       0x158 0x2a      /* spi0_d1.i2c1_sda_mux3, INPUT | MODE2 */
+                       0x15c 0x2a      /* spi0_cs0.i2c1_scl_mux3, INPUT | MODE2 */
+               >;
+       };
+
+       dcan1_pins: pinmux_dcan1_pins {
+               pinctrl-single,pins = <
+                       0x168 0x0a      /* uart0_ctsn.dcan1_tx_mux0, OUTPUT | MODE2 */
+                       0x16c 0x2a      /* uart0_rtsn.dcan1_rx_mux0, INPUT | MODE2 */
+               >;
+       };
+
+       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 */
+               >;
+       };
+
+       uart1_pins: pinmux_uart1_pins {
+               pinctrl-single,pins = <
+                       0x180 0x28      /* uart1_rxd, INPUT | MODE0 */
+                       0x184 0x28      /* uart1_txd, INPUT | MODE0 */
+                       /*0x178 0x28*/      /* uart1_ctsn, INPUT | MODE0 */
+                       /*0x17c 0x08*/      /* uart1_rtsn, OUTPUT | MODE0 */
+                       0x178 (PIN_INPUT_PULLDOWN | MUX_MODE7)      /* uart1_ctsn, INPUT | MODE0 */
+                       0x17c (PIN_OUTPUT_PULLDOWN | MUX_MODE7)      /* uart1_rtsn, OUTPUT | MODE0 */
+                       0x0e0 (PIN_OUTPUT_PULLDOWN | MUX_MODE7)      /* lcd_vsync.gpio2[22] DTR */
+                       0x0e4 (PIN_INPUT_PULLDOWN | MUX_MODE7)      /* lcd_hsync.gpio2[23] DSR */
+                       0x0e8 (PIN_INPUT_PULLDOWN | MUX_MODE7)      /* lcd_pclk.gpio2[24] DCD */
+                       0x0ec (PIN_INPUT_PULLDOWN | MUX_MODE7)      /* lcd_ac_bias_en.gpio2[25] RI */
+               >;
+       };
+
+       uart2_pins: pinmux_uart2_pins {
+               pinctrl-single,pins = <
+                       0x150 0x29      /* spi0_sclk.uart2_rxd_mux3, INPUT | MODE1 */
+                       0x154 0x09      /* spi0_d0.uart2_txd_mux3, OUTPUT | MODE1 */
+                       /*0x188 0x2a*/      /* i2c0_sda.uart2_ctsn_mux0, INPUT | MODE2 */
+                       /*0x18c 0x2a*/      /* i2c0_scl.uart2_rtsn_mux0, INPUT | MODE2 */
+                       0x188 (PIN_INPUT_PULLDOWN | MUX_MODE7)      /* i2c0_sda.uart2_ctsn_mux0 */
+                       0x18c (PIN_OUTPUT_PULLDOWN | MUX_MODE7)      /* i2c0_scl.uart2_rtsn_mux0 */
+                       0x030 (PIN_OUTPUT_PULLDOWN | MUX_MODE7)      /* gpmc_ad12.gpio1[12] DTR */
+                       0x034 (PIN_INPUT_PULLDOWN | MUX_MODE7)      /* gpmc_ad13.gpio1[13] DSR */
+                       0x038 (PIN_INPUT_PULLDOWN | MUX_MODE7)      /* gpmc_ad14.gpio1[14] DCD */
+                       0x03c (PIN_INPUT_PULLDOWN | MUX_MODE7)     /* gpmc_ad15.gpio1[15] RI */
+
+                       0x1a0 (PIN_INPUT_PULLUP | MUX_MODE7)      /* mcasp0_aclkr.gpio3[18], INPUT_PULLDOWN | MODE7 */
+               >;
+       };
+
+       cpsw_default: cpsw_default {
+               pinctrl-single,pins = <
+                       /* Slave 1 */
+                       0x10c (PIN_INPUT_PULLDOWN | MUX_MODE1)       /* mii1_crs.rmii1_crs_dv */
+                       0x114 (PIN_OUTPUT_PULLDOWN | MUX_MODE1)      /* mii1_tx_en.rmii1_txen */
+                       0x124 (PIN_OUTPUT_PULLDOWN | MUX_MODE1)      /* mii1_txd1.rmii1_txd1 */
+                       0x128 (PIN_OUTPUT_PULLDOWN | MUX_MODE1)      /* mii1_txd0.rmii1_txd0 */
+                       0x13c (PIN_INPUT_PULLDOWN | MUX_MODE1)      /* mii1_rxd1.rmii1_rxd1 */
+                       0x140 (PIN_INPUT_PULLDOWN | MUX_MODE1)      /* mii1_rxd0.rmii1_rxd0 */
+                       0x144 (PIN_INPUT_PULLDOWN | MUX_MODE0)      /* rmii1_ref_clk.rmii1_refclk */
+
+
+                       /* Slave 2 */
+                       0x40 (PIN_OUTPUT_PULLDOWN | MUX_MODE2)  /* gpmc_a0.rgmii2_tctl */
+                       0x44 (PIN_INPUT_PULLDOWN | MUX_MODE2)   /* gpmc_a1.rgmii2_rctl */
+                       0x48 (PIN_OUTPUT_PULLDOWN | MUX_MODE2)  /* gpmc_a2.rgmii2_td3 */
+                       0x4c (PIN_OUTPUT_PULLDOWN | MUX_MODE2)  /* gpmc_a3.rgmii2_td2 */
+                       0x50 (PIN_OUTPUT_PULLDOWN | MUX_MODE2)  /* gpmc_a4.rgmii2_td1 */
+                       0x54 (PIN_OUTPUT_PULLDOWN | MUX_MODE2)  /* gpmc_a5.rgmii2_td0 */
+                       0x58 (PIN_OUTPUT_PULLDOWN | MUX_MODE2)  /* gpmc_a6.rgmii2_tclk */
+                       0x5c (PIN_INPUT_PULLDOWN | MUX_MODE2)   /* gpmc_a7.rgmii2_rclk */
+                       0x60 (PIN_INPUT_PULLDOWN | MUX_MODE2)   /* gpmc_a8.rgmii2_rd3 */
+                       0x64 (PIN_INPUT_PULLDOWN | MUX_MODE2)   /* gpmc_a9.rgmii2_rd2 */
+                       0x68 (PIN_INPUT_PULLDOWN | MUX_MODE2)   /* gpmc_a10.rgmii2_rd1 */
+                       0x6c (PIN_INPUT_PULLDOWN | MUX_MODE2)   /* gpmc_a11.rgmii2_rd0 */
+               >;
+       };
+
+       cpsw_sleep: cpsw_sleep {
+               pinctrl-single,pins = <
+                       /* Slave 1 reset value */
+                       0x10c (PIN_INPUT_PULLDOWN | MUX_MODE7)
+                       0x114 (PIN_INPUT_PULLDOWN | MUX_MODE7)
+                       0x124 (PIN_INPUT_PULLDOWN | MUX_MODE7)
+                       0x128 (PIN_INPUT_PULLDOWN | MUX_MODE7)
+                       0x13c (PIN_INPUT_PULLDOWN | MUX_MODE7)
+                       0x140 (PIN_INPUT_PULLDOWN | MUX_MODE7)
+                       0x144 (PIN_INPUT_PULLDOWN | MUX_MODE7)
+
+                       /* Slave 2 reset value*/
+                       0x40 (PIN_INPUT_PULLDOWN | MUX_MODE7)
+                       0x44 (PIN_INPUT_PULLDOWN | MUX_MODE7)
+                       0x48 (PIN_INPUT_PULLDOWN | MUX_MODE7)
+                       0x4c (PIN_INPUT_PULLDOWN | MUX_MODE7)
+                       0x50 (PIN_INPUT_PULLDOWN | MUX_MODE7)
+                       0x54 (PIN_INPUT_PULLDOWN | MUX_MODE7)
+                       0x58 (PIN_INPUT_PULLDOWN | MUX_MODE7)
+                       0x5c (PIN_INPUT_PULLDOWN | MUX_MODE7)
+                       0x60 (PIN_INPUT_PULLDOWN | MUX_MODE7)
+                       0x64 (PIN_INPUT_PULLDOWN | MUX_MODE7)
+                       0x68 (PIN_INPUT_PULLDOWN | MUX_MODE7)
+                       0x6c (PIN_INPUT_PULLDOWN | MUX_MODE7)
+               >;
+       };
+
+       davinci_mdio_default: davinci_mdio_default {
+               pinctrl-single,pins = <
+                       /* MDIO */
+                       0x148 (PIN_INPUT_PULLUP | SLEWCTRL_FAST | MUX_MODE0)    /* mdio_data.mdio_data */
+                       0x14c (PIN_OUTPUT_PULLUP | MUX_MODE0)                   /* mdio_clk.mdio_clk */
+               >;
+       };
+
+       davinci_mdio_sleep: davinci_mdio_sleep {
+               pinctrl-single,pins = <
+                       /* MDIO reset value */
+                       0x148 (PIN_INPUT_PULLDOWN | MUX_MODE7)
+                       0x14c (PIN_INPUT_PULLDOWN | MUX_MODE7)
+               >;
+       };
+
+       nandflash_pins_s0: nandflash_pins_s0 {
+               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 */
+               >;
+       };
+};
+
+&elm {
+       status = "okay";
+};
+
+&gpmc {
+       pinctrl-names = "default";
+       pinctrl-0 = <&nandflash_pins_s0>;
+       ranges = <0 0 0x08000000 0x10000000>;   /* CS0: NAND */
+       status = "okay";
+
+       nand@0,0 {
+               reg = <0 0 0>; /* CS0, offset 0 */
+               nand-bus-width = <8>;
+               ti,nand-ecc-opt = "bch8";
+               ti,nand-xfer-type = "polled";
+
+               gpmc,device-nand = "true";
+               gpmc,device-width = <1>;
+               gpmc,sync-clk-ps = <0>;
+               gpmc,cs-on-ns = <0>;
+               gpmc,cs-rd-off-ns = <44>;
+               gpmc,cs-wr-off-ns = <44>;
+               gpmc,adv-on-ns = <6>;
+               gpmc,adv-rd-off-ns = <34>;
+               gpmc,adv-wr-off-ns = <44>;
+               gpmc,we-on-ns = <0>;
+               gpmc,we-off-ns = <40>;
+               gpmc,oe-on-ns = <0>;
+               gpmc,oe-off-ns = <54>;
+               gpmc,access-ns = <64>;
+               gpmc,rd-cycle-ns = <82>;
+               gpmc,wr-cycle-ns = <82>;
+               gpmc,wait-on-read = "true";
+               gpmc,wait-on-write = "true";
+               gpmc,bus-turnaround-ns = <0>;
+               gpmc,cycle2cycle-delay-ns = <0>;
+               gpmc,clk-activation-ns = <0>;
+               gpmc,wait-monitoring-ns = <0>;
+               gpmc,wr-access-ns = <40>;
+               gpmc,wr-data-mux-bus-ns = <0>;
+
+               #address-cells = <1>;
+               #size-cells = <1>;
+               elm_id = <&elm>;
+       };
+};
+
+&uart0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart0_pins>;
+
+       status = "okay";
+};
+
+&uart1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart1_pins>;
+       dtr-gpios = <&gpio2 22 GPIO_ACTIVE_LOW>;
+       dsr-gpios = <&gpio2 23 GPIO_ACTIVE_LOW>;
+       dcd-gpios = <&gpio2 24 GPIO_ACTIVE_LOW>;
+       rng-gpios = <&gpio2 25 GPIO_ACTIVE_LOW>;
+       cts-gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;
+       rts-gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
+
+       status = "okay";
+};
+
+&uart2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart2_pins>;
+       dtr-gpios = <&gpio1 12 GPIO_ACTIVE_LOW>;
+       dsr-gpios = <&gpio1 13 GPIO_ACTIVE_LOW>;
+       dcd-gpios = <&gpio1 14 GPIO_ACTIVE_LOW>;
+       rng-gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
+       cts-gpios = <&gpio3 5 GPIO_ACTIVE_LOW>;
+       rts-gpios = <&gpio3 6 GPIO_ACTIVE_LOW>;
+
+       status = "okay";
+};
+
+&i2c1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c1_pins>;
+
+       status = "okay";
+       clock-frequency = <400000>;
+
+       tps: tps@2d {
+               reg = <0x2d>;
+               gpio-controller;
+               #gpio-cells = <2>;
+               interrupt-parent = <&gpio1>;
+               interrupts = <28 GPIO_ACTIVE_LOW>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&tps65910_pins>;
+       };
+
+       at24@50 {
+               compatible = "at24,24c02";
+               pagesize = <8>;
+               reg = <0x50>;
+       };
+
+       tca6416: gpio@20 {
+               compatible = "ti,tca6416";
+               reg = <0x20>;
+               gpio-controller;
+               #gpio-cells = <2>;
+               interrupt-parent = <&gpio0>;
+               interrupts = <20 GPIO_ACTIVE_LOW>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&tca6416_pins>;
+       };
+};
+
+&usb {
+       status = "okay";
+};
+
+&usb_ctrl_mod {
+       status = "okay";
+};
+
+&usb0_phy {
+       status = "okay";
+};
+
+&usb1_phy {
+       status = "okay";
+};
+
+&usb0 {
+       status = "okay";
+       dr_mode = "host";
+};
+
+&usb1 {
+       status = "okay";
+       dr_mode = "otg";
+};
+
+&cppi41dma  {
+       status = "okay";
+};
+
+#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>;
+
+       ti,en-ck32k-xtal = <1>;
+
+       regulators {
+               vrtc_reg: regulator@0 {
+                       regulator-always-on;
+               };
+
+               vio_reg: regulator@1 {
+                       regulator-always-on;
+               };
+
+               vdd1_reg: regulator@2 {
+                       /* VDD_MPU voltage limits 0.95V - 1.26V with +/-4% tolerance */
+                       regulator-name = "vdd_mpu";
+                       regulator-min-microvolt = <912500>;
+                       regulator-max-microvolt = <1312500>;
+                       regulator-boot-on;
+                       regulator-always-on;
+               };
+
+               vdd2_reg: regulator@3 {
+                       /* VDD_CORE voltage limits 0.95V - 1.1V with +/-4% tolerance */
+                       regulator-name = "vdd_core";
+                       regulator-min-microvolt = <912500>;
+                       regulator-max-microvolt = <1150000>;
+                       regulator-boot-on;
+                       regulator-always-on;
+               };
+
+               vdd3_reg: regulator@4 {
+                       regulator-always-on;
+               };
+
+               vdig1_reg: regulator@5 {
+                       regulator-always-on;
+               };
+
+               vdig2_reg: regulator@6 {
+                       regulator-always-on;
+               };
+
+               vpll_reg: regulator@7 {
+                       regulator-always-on;
+               };
+
+               vdac_reg: regulator@8 {
+                       regulator-always-on;
+               };
+
+               vaux1_reg: regulator@9 {
+                       regulator-always-on;
+               };
+
+               vaux2_reg: regulator@10 {
+                       regulator-always-on;
+               };
+
+               vaux33_reg: regulator@11 {
+                       regulator-always-on;
+               };
+
+               vmmc_reg: regulator@12 {
+                       regulator-min-microvolt = <1800000>;
+                       regulator-max-microvolt = <3300000>;
+                       regulator-always-on;
+               };
+       };
+};
+
+&mac {
+       pinctrl-names = "default", "sleep";
+       pinctrl-0 = <&cpsw_default>;
+       pinctrl-1 = <&cpsw_sleep>;
+       dual_emac = <1>;
+
+       status = "okay";
+};
+
+&davinci_mdio {
+       pinctrl-names = "default", "sleep";
+       pinctrl-0 = <&davinci_mdio_default>;
+       pinctrl-1 = <&davinci_mdio_sleep>;
+
+       status = "okay";
+};
+
+&cpsw_emac0 {
+       phy_id = <&davinci_mdio>, <0>;
+       phy-mode = "rmii";
+       dual_emac_res_vlan = <1>;
+};
+
+&cpsw_emac1 {
+       phy_id = <&davinci_mdio>, <7>;
+       phy-mode = "rgmii-txid";
+       dual_emac_res_vlan = <2>;
+};
+
+&phy_sel {
+       rmii-clock-ext = <1>;
+};
+
+&mmc1 {
+       vmmc-supply = <&vmmc_reg>;
+       status = "okay";
+};
+
+&mmc2 {
+       status = "okay";
+       vmmc-supply = <&wl12xx_vmmc>;
+       ti,non-removable;
+       bus-width = <4>;
+       cap-power-off-card;
+       pinctrl-names = "default";
+       pinctrl-0 = <&mmc2_pins>;
+
+       #address-cells = <1>;
+       #size-cells = <0>;
+       wlcore: wlcore@2 {
+               compatible = "ti,wl1835";
+               reg = <2>;
+               interrupt-parent = <&gpio3>;
+               interrupts = <7 IRQ_TYPE_LEVEL_HIGH>;
+       };
+};
+
+&sham {
+       status = "okay";
+};
+
+&aes {
+       status = "okay";
+};
+
+&gpio0 {
+       ti,no-reset-on-init;
+};
+
+&dcan1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&dcan1_pins>;
+
+       status = "okay";
+};
index c3255e0c90aa829fc792f02d1265d413f3c6e624..fec78349c1f3c895fbd1dcf36782d16b9c891d93 100644 (file)
                >;
        };
 
+       i2c2_pins: pinmux_i2c2_pins {
+               pinctrl-single,pins = <
+                       0x178 (PIN_INPUT_PULLUP | MUX_MODE3)    /* uart1_ctsn.i2c2_sda */
+                       0x17c (PIN_INPUT_PULLUP | MUX_MODE3)    /* uart1_rtsn.i2c2_scl */
+               >;
+       };
+
        uart0_pins: pinmux_uart0_pins {
                pinctrl-single,pins = <
                        0x170 (PIN_INPUT_PULLUP | MUX_MODE0)    /* uart0_rxd.uart0_rxd */
                reg = <0x24>;
        };
 
+       baseboard_eeprom: baseboard_eeprom@50 {
+               compatible = "at,24c256";
+               reg = <0x50>;
+
+               #address-cells = <1>;
+               #size-cells = <1>;
+               baseboard_data: baseboard_data@0 {
+                       reg = <0 0x100>;
+               };
+       };
 };
 
+&i2c2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c2_pins>;
+
+       status = "okay";
+       clock-frequency = <100000>;
+
+       cape_eeprom0: cape_eeprom0@54 {
+               compatible = "at,24c256";
+               reg = <0x54>;
+               #address-cells = <1>;
+               #size-cells = <1>;
+               cape0_data: cape_data@0 {
+                       reg = <0 0x100>;
+               };
+       };
+
+       cape_eeprom1: cape_eeprom1@55 {
+               compatible = "at,24c256";
+               reg = <0x55>;
+               #address-cells = <1>;
+               #size-cells = <1>;
+               cape1_data: cape_data@0 {
+                       reg = <0 0x100>;
+               };
+       };
+
+       cape_eeprom2: cape_eeprom2@56 {
+               compatible = "at,24c256";
+               reg = <0x56>;
+               #address-cells = <1>;
+               #size-cells = <1>;
+               cape2_data: cape_data@0 {
+                       reg = <0 0x100>;
+               };
+       };
+
+       cape_eeprom3: cape_eeprom3@57 {
+               compatible = "at,24c256";
+               reg = <0x57>;
+               #address-cells = <1>;
+               #size-cells = <1>;
+               cape3_data: cape_data@0 {
+                       reg = <0 0x100>;
+               };
+       };
+};
+
+
 /include/ "tps65217.dtsi"
 
 &tps {
+       /*
+        * Configure pmic to enter OFF-state instead of SLEEP-state ("RTC-only
+        * mode") at poweroff.  Most BeagleBone versions do not support RTC-only
+        * mode and risk hardware damage if this mode is entered.
+        *
+        * For details, see linux-omap mailing list May 2015 thread
+        *      [PATCH] ARM: dts: am335x-bone* enable pmic-shutdown-controller
+        * In particular, messages:
+        *      http://www.spinics.net/lists/linux-omap/msg118585.html
+        *      http://www.spinics.net/lists/linux-omap/msg118615.html
+        *
+        * You can override this later with
+        *      &tps {  /delete-property/ ti,pmic-shutdown-controller;  }
+        * if you want to use RTC-only mode and made sure you are not affected
+        * by the hardware problems. (Tip: double-check by performing a current
+        * measurement after shutdown: it should be less than 1 mA.)
+        */
+       ti,pmic-shutdown-controller;
+
        regulators {
                dcdc1_reg: regulator@0 {
                        regulator-name = "vdds_dpr";
index 66342515df203b7b99afd5f38f30cd6946f0c514..765be2766eb0d1d22402c5f0cec2f74cc971c1ab 100644 (file)
@@ -8,6 +8,7 @@
 /dts-v1/;
 
 #include "am33xx.dtsi"
+#include <dt-bindings/interrupt-controller/irq.h>
 
 / {
        model = "TI AM335x EVM";
                regulator-boot-on;
        };
 
+       wlan_en_reg: fixedregulator@2 {
+               compatible = "regulator-fixed";
+               regulator-name = "wlan-en-regulator";
+               regulator-min-microvolt = <1800000>;
+               regulator-max-microvolt = <1800000>;
+
+               /* WLAN_EN GPIO for this board - Bank1, pin16 */
+               gpio = <&gpio1 16 0>;
+
+               /* WLAN card specific delay */
+               startup-delay-us = <70000>;
+               enable-active-high;
+       };
+
        matrix_keypad: matrix_keypad@0 {
                compatible = "gpio-matrix-keypad";
                debounce-delay-ms = <5>;
                >;
        };
 
+       uart1_pins: pinmux_uart1_pins {
+               pinctrl-single,pins = <
+                       0x178 (PIN_INPUT | MUX_MODE0)           /* uart1_ctsn.uart1_ctsn */
+                       0x17C (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* uart1_rtsn.uart1_rtsn */
+                       0x180 (PIN_INPUT_PULLUP | MUX_MODE0)    /* uart1_rxd.uart1_rxd */
+                       0x184 (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* uart1_txd.uart1_txd */
+               >;
+       };
+
        clkout2_pin: pinmux_clkout2_pin {
                pinctrl-single,pins = <
                        0x1b4 (PIN_OUTPUT_PULLDOWN | MUX_MODE3) /* xdma_event_intr1.clkout2 */
                >;
        };
 
+       mmc3_pins: pinmux_mmc3_pins {
+               pinctrl-single,pins = <
+                       0x44 (PIN_INPUT_PULLUP | MUX_MODE3)     /* gpmc_a1.mmc2_dat0, INPUT_PULLUP | MODE3 */
+                       0x48 (PIN_INPUT_PULLUP | MUX_MODE3)     /* gpmc_a2.mmc2_dat1, INPUT_PULLUP | MODE3 */
+                       0x4C (PIN_INPUT_PULLUP | MUX_MODE3)     /* gpmc_a3.mmc2_dat2, INPUT_PULLUP | MODE3 */
+                       0x78 (PIN_INPUT_PULLUP | MUX_MODE3)     /* gpmc_ben1.mmc2_dat3, INPUT_PULLUP | MODE3 */
+                       0x88 (PIN_INPUT_PULLUP | MUX_MODE3)     /* gpmc_csn3.mmc2_cmd, INPUT_PULLUP | MODE3 */
+                       0x8C (PIN_INPUT_PULLUP | MUX_MODE3)     /* gpmc_clk.mmc2_clk, INPUT_PULLUP | MODE3 */
+               >;
+       };
+
+       wlan_pins: pinmux_wlan_pins {
+               pinctrl-single,pins = <
+                       0x40 (PIN_OUTPUT_PULLDOWN | MUX_MODE7)  /* gpmc_a0.gpio1_16 */
+                       0x19C (PIN_INPUT | MUX_MODE7)           /* mcasp0_ahclkr.gpio3_17 */
+                       0x1AC (PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* mcasp0_ahclkx.gpio3_21 */
+               >;
+       };
+
        lcd_pins_s0: lcd_pins_s0 {
                pinctrl-single,pins = <
                        0x20 (PIN_OUTPUT | MUX_MODE1)           /* gpmc_ad8.lcd_data23 */
        status = "okay";
 };
 
+&uart1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart1_pins>;
+
+       status = "okay";
+};
+
 &i2c0 {
        pinctrl-names = "default";
        pinctrl-0 = <&i2c0_pins>;
        cd-gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>;
 };
 
+&mmc3 {
+       /* these are on the crossbar and are outlined in the
+          xbar-event-map element */
+       dmas = <&edma 12
+               &edma 13>;
+       dma-names = "tx", "rx";
+       status = "okay";
+       vmmc-supply = <&wlan_en_reg>;
+       bus-width = <4>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&mmc3_pins &wlan_pins>;
+       ti,non-removable;
+       ti,needs-special-hs-handling;
+       cap-power-off-card;
+       keep-power-in-suspend;
+
+       #address-cells = <1>;
+       #size-cells = <0>;
+       wlcore: wlcore@0 {
+               compatible = "ti,wl1835";
+               reg = <2>;
+               interrupt-parent = <&gpio3>;
+               interrupts = <17 IRQ_TYPE_LEVEL_HIGH>;
+       };
+};
+
+&edma {
+       ti,edma-xbar-event-map = /bits/ 16 <1 12
+                                           2 13>;
+};
+
 &sham {
        status = "okay";
 };
diff --git a/arch/arm/boot/dts/am335x-sl50.dts b/arch/arm/boot/dts/am335x-sl50.dts
new file mode 100644 (file)
index 0000000..3303c28
--- /dev/null
@@ -0,0 +1,482 @@
+/*
+ * Copyright (C) 2015 Toby Churchill - http://www.toby-churchill.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"
+
+/ {
+       model = "Toby Churchill SL50 Series";
+       compatible = "tcl,am335x-sl50", "ti,am33xx";
+
+       cpus {
+               cpu@0 {
+                       cpu0-supply = <&dcdc2_reg>;
+               };
+       };
+
+       leds {
+               compatible = "gpio-leds";
+               pinctrl-names = "default";
+               pinctrl-0 = <&led_pins>;
+
+               led@0 {
+                       label = "sl50:green:usr0";
+                       gpios = <&gpio1 21 GPIO_ACTIVE_LOW>;
+                       default-state = "off";
+               };
+
+               led@1 {
+                       label = "sl50:red:usr1";
+                       gpios = <&gpio1 22 GPIO_ACTIVE_LOW>;
+                       default-state = "off";
+               };
+
+               led@2 {
+                       label = "sl50:green:usr2";
+                       gpios = <&gpio1 23 GPIO_ACTIVE_LOW>;
+                       default-state = "off";
+               };
+
+               led@3 {
+                       label = "sl50:red:usr3";
+                       gpios = <&gpio1 24 GPIO_ACTIVE_LOW>;
+                       default-state = "off";
+               };
+       };
+
+       backlight0: disp0 {
+               compatible = "pwm-backlight";
+               pwms = <&ehrpwm1 0 500000 0>;
+               brightness-levels = <0 10 20 30 40 50 60 70 80 90 99>;
+               default-brightness-level = <6>;
+       };
+
+       backlight1: disp1 {
+               compatible = "pwm-backlight";
+               pwms = <&ehrpwm1 1 500000 0>;
+               brightness-levels = <0 10 20 30 40 50 60 70 80 90 99>;
+               default-brightness-level = <6>;
+       };
+
+       sound {
+               compatible = "ti,da830-evm-audio";
+               ti,model = "AM335x-SL50";
+               ti,audio-codec = <&audio_codec>;
+               ti,mcasp-controller = <&mcasp0>;
+               ti,codec-clock-rate = <12000000>;
+               ti,audio-routing =
+                       "Headphone Jack",       "HPLOUT",
+                       "Headphone Jack",       "HPROUT",
+                       "LINE1R",               "Line In",
+                       "LINE1L",               "Line In";
+       };
+
+       emmc_pwrseq: pwrseq@0 {
+               compatible = "mmc-pwrseq-emmc";
+               pinctrl-names = "default";
+               pinctrl-0 = <&emmc_pwrseq_pins>;
+               reset-gpios = <&gpio1 20 GPIO_ACTIVE_LOW>;
+       };
+
+       vmmcsd_fixed: fixedregulator@0 {
+               compatible = "regulator-fixed";
+               regulator-name = "vmmcsd_fixed";
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+       };
+};
+
+&am33xx_pinmux {
+       pinctrl-names = "default";
+       pinctrl-0 = <&lwb_pins>;
+
+       led_pins: pinmux_led_pins {
+               pinctrl-single,pins = <
+                       AM33XX_IOPAD(0x854, PIN_OUTPUT | MUX_MODE7)     /* gpmc_a5.gpio1_21 */
+                       AM33XX_IOPAD(0x858, PIN_OUTPUT | MUX_MODE7)     /* gpmc_a6.gpio1_22 */
+                       AM33XX_IOPAD(0x85c, PIN_OUTPUT | MUX_MODE7)     /* gpmc_a7.gpio1_23 */
+                       AM33XX_IOPAD(0x860, PIN_OUTPUT | MUX_MODE7)     /* gpmc_a8.gpio1_24 */
+               >;
+       };
+
+       uart0_pins: pinmux_uart0_pins {
+               pinctrl-single,pins = <
+                       AM33XX_IOPAD(0x970, PIN_INPUT_PULLUP | MUX_MODE0)       /* uart0_rxd.uart0_rxd */
+                       AM33XX_IOPAD(0x974, PIN_OUTPUT_PULLDOWN | MUX_MODE0)    /* uart0_txd.uart0_txd */
+               >;
+       };
+
+       uart4_pins: pinmux_uart4_pins {
+               pinctrl-single,pins = <
+                       AM33XX_IOPAD(0x870, PIN_INPUT_PULLUP | MUX_MODE6)       /* gpmc_wait0.uart4_rxd */
+                       AM33XX_IOPAD(0x874, PIN_OUTPUT_PULLDOWN | MUX_MODE6)    /* gpmc_wpn.uart4_txd */
+               >;
+       };
+
+       i2c0_pins: pinmux_i2c0_pins {
+               pinctrl-single,pins = <
+                       AM33XX_IOPAD(0x988, PIN_INPUT_PULLUP | MUX_MODE0)       /* i2c0_sda.i2c0_sda */
+                       AM33XX_IOPAD(0x98c, PIN_INPUT_PULLUP | MUX_MODE0)       /* i2c0_scl.i2c0_scl */
+               >;
+       };
+
+       i2c1_pins: pinmux_i2c1_pins {
+               pinctrl-single,pins = <
+                       AM33XX_IOPAD(0x980, PIN_INPUT_PULLUP | MUX_MODE3)       /* uart1_rxd.i2c1_sda */
+                       AM33XX_IOPAD(0x984, PIN_INPUT_PULLUP | MUX_MODE3)       /* uart1_txdi2c1_scl */
+               >;
+       };
+
+       i2c2_pins: pinmux_i2c2_pins {
+               pinctrl-single,pins = <
+                       AM33XX_IOPAD(0x978, PIN_INPUT_PULLUP | MUX_MODE3)       /* uart1_ctsn.i2c2_sda */
+                       AM33XX_IOPAD(0x97c, PIN_INPUT_PULLUP | MUX_MODE3)       /* uart1_rtsn.i2c2_scl */
+               >;
+       };
+
+       cpsw_default: cpsw_default {
+               pinctrl-single,pins = <
+                       /* Slave 1 */
+                       AM33XX_IOPAD(0x910, PIN_INPUT_PULLUP | MUX_MODE0)       /* mii1_rxerr.mii1_rxerr */
+                       AM33XX_IOPAD(0x914, PIN_OUTPUT_PULLDOWN | MUX_MODE0)    /* mii1_txen.mii1_txen */
+                       AM33XX_IOPAD(0x918, PIN_INPUT_PULLUP | MUX_MODE0)       /* mii1_rxdv.mii1_rxdv */
+                       AM33XX_IOPAD(0x91c, PIN_OUTPUT_PULLDOWN | MUX_MODE0)    /* mii1_txd3.mii1_txd3 */
+                       AM33XX_IOPAD(0x920, PIN_OUTPUT_PULLDOWN | MUX_MODE0)    /* mii1_txd2.mii1_txd2 */
+                       AM33XX_IOPAD(0x924, PIN_OUTPUT_PULLDOWN | MUX_MODE0)    /* mii1_txd1.mii1_txd1 */
+                       AM33XX_IOPAD(0x928, PIN_OUTPUT_PULLDOWN | MUX_MODE0)    /* mii1_txd0.mii1_txd0 */
+                       AM33XX_IOPAD(0x92c, PIN_INPUT_PULLUP | MUX_MODE0)       /* mii1_txclk.mii1_txclk */
+                       AM33XX_IOPAD(0x930, PIN_INPUT_PULLUP | MUX_MODE0)       /* mii1_rxclk.mii1_rxclk */
+                       AM33XX_IOPAD(0x934, PIN_INPUT_PULLUP | MUX_MODE0)       /* mii1_rxd3.mii1_rxd3 */
+                       AM33XX_IOPAD(0x938, PIN_INPUT_PULLUP | MUX_MODE0)       /* mii1_rxd2.mii1_rxd2 */
+                       AM33XX_IOPAD(0x93c, PIN_INPUT_PULLUP | MUX_MODE0)       /* mii1_rxd1.mii1_rxd1 */
+                       AM33XX_IOPAD(0x940, PIN_INPUT_PULLUP | MUX_MODE0)       /* mii1_rxd0.mii1_rxd0 */
+               >;
+       };
+
+       cpsw_sleep: cpsw_sleep {
+               pinctrl-single,pins = <
+                       /* Slave 1 reset value */
+                       AM33XX_IOPAD(0x910, PIN_INPUT_PULLDOWN | MUX_MODE7)
+                       AM33XX_IOPAD(0x914, PIN_INPUT_PULLDOWN | MUX_MODE7)
+                       AM33XX_IOPAD(0x918, PIN_INPUT_PULLDOWN | MUX_MODE7)
+                       AM33XX_IOPAD(0x91c, PIN_INPUT_PULLDOWN | MUX_MODE7)
+                       AM33XX_IOPAD(0x920, PIN_INPUT_PULLDOWN | MUX_MODE7)
+                       AM33XX_IOPAD(0x924, PIN_INPUT_PULLDOWN | MUX_MODE7)
+                       AM33XX_IOPAD(0x928, PIN_INPUT_PULLDOWN | MUX_MODE7)
+                       AM33XX_IOPAD(0x92c, PIN_INPUT_PULLDOWN | MUX_MODE7)
+                       AM33XX_IOPAD(0x930, PIN_INPUT_PULLDOWN | MUX_MODE7)
+                       AM33XX_IOPAD(0x934, PIN_INPUT_PULLDOWN | MUX_MODE7)
+                       AM33XX_IOPAD(0x938, PIN_INPUT_PULLDOWN | MUX_MODE7)
+                       AM33XX_IOPAD(0x93c, PIN_INPUT_PULLDOWN | MUX_MODE7)
+                       AM33XX_IOPAD(0x940, PIN_INPUT_PULLDOWN | MUX_MODE7)
+               >;
+       };
+
+       davinci_mdio_default: davinci_mdio_default {
+               pinctrl-single,pins = <
+                       /* MDIO */
+                       AM33XX_IOPAD(0x948, PIN_INPUT_PULLUP | SLEWCTRL_FAST | MUX_MODE0)       /* mdio_data.mdio_data */
+                       AM33XX_IOPAD(0x94c, PIN_OUTPUT_PULLUP | MUX_MODE0)                      /* mdio_clk.mdio_clk */
+               >;
+       };
+
+       davinci_mdio_sleep: davinci_mdio_sleep {
+               pinctrl-single,pins = <
+                       /* MDIO reset value */
+                       AM33XX_IOPAD(0x948, PIN_INPUT_PULLDOWN | MUX_MODE7)
+                       AM33XX_IOPAD(0x94c, PIN_INPUT_PULLDOWN | MUX_MODE7)
+               >;
+       };
+
+       mmc1_pins: pinmux_mmc1_pins {
+               pinctrl-single,pins = <
+                       AM33XX_IOPAD(0x960, PIN_INPUT | MUX_MODE7)              /* spi0_cs1.gpio0_6 */
+               >;
+       };
+
+       emmc_pwrseq_pins: pinmux_emmc_pwrseq_pins {
+               pinctrl-single,pins = <
+                       AM33XX_IOPAD(0x850, PIN_OUTPUT_PULLUP | MUX_MODE7)      /* gpmc_a4.gpio1_20 */
+               >;
+       };
+
+       emmc_pins: pinmux_emmc_pins {
+               pinctrl-single,pins = <
+                       AM33XX_IOPAD(0x880, PIN_INPUT_PULLUP | MUX_MODE2)       /* gpmc_csn1.mmc1_clk */
+                       AM33XX_IOPAD(0x884, PIN_INPUT_PULLUP | MUX_MODE2)       /* gpmc_csn2.mmc1_cmd */
+                       AM33XX_IOPAD(0x800, PIN_INPUT_PULLUP | MUX_MODE1)       /* gpmc_ad0.mmc1_dat0 */
+                       AM33XX_IOPAD(0x804, PIN_INPUT_PULLUP | MUX_MODE1)       /* gpmc_ad1.mmc1_dat1 */
+                       AM33XX_IOPAD(0x808, PIN_INPUT_PULLUP | MUX_MODE1)       /* gpmc_ad2.mmc1_dat2 */
+                       AM33XX_IOPAD(0x80c, PIN_INPUT_PULLUP | MUX_MODE1)       /* gpmc_ad3.mmc1_dat3 */
+                       AM33XX_IOPAD(0x810, PIN_INPUT_PULLUP | MUX_MODE1)       /* gpmc_ad4.mmc1_dat4 */
+                       AM33XX_IOPAD(0x814, PIN_INPUT_PULLUP | MUX_MODE1)       /* gpmc_ad5.mmc1_dat5 */
+                       AM33XX_IOPAD(0x818, PIN_INPUT_PULLUP | MUX_MODE1)       /* gpmc_ad6.mmc1_dat6 */
+                       AM33XX_IOPAD(0x81c, PIN_INPUT_PULLUP | MUX_MODE1)       /* gpmc_ad7.mmc1_dat7 */
+               >;
+       };
+
+       audio_pins: pinmux_audio_pins {
+               pinctrl-single,pins = <
+                       AM33XX_IOPAD(0x9ac, PIN_INPUT_PULLDOWN | MUX_MODE0)     /* mcasp0_ahcklx.mcasp0_ahclkx */
+                       AM33XX_IOPAD(0x994, PIN_INPUT_PULLDOWN | MUX_MODE0)     /* mcasp0_fsx.mcasp0_fsx */
+                       AM33XX_IOPAD(0x990, PIN_INPUT_PULLDOWN | MUX_MODE0)     /* mcasp0_aclkx.mcasp0_aclkx */
+                       AM33XX_IOPAD(0x998, PIN_INPUT_PULLDOWN | MUX_MODE0)     /* mcasp0_axr0.mcasp0_axr0 */
+                       AM33XX_IOPAD(0x99c, PIN_INPUT_PULLDOWN | MUX_MODE2)     /* mcasp0_ahclkr.mcasp0_axr2*/
+               >;
+       };
+
+       ehrpwm1_pins: pinmux_ehrpwm1a_pins {
+               pinctrl-single,pins = <
+                       AM33XX_IOPAD(0x848, PIN_OUTPUT | MUX_MODE6)     /* gpmc_a2.ehrpwm1a */
+                       AM33XX_IOPAD(0x84c, PIN_OUTPUT | MUX_MODE6)     /* gpmc_a3.ehrpwm1b */
+               >;
+       };
+
+       lwb_pins: pinmux_lwb_pins {
+               pinctrl-single,pins = <
+                       AM33XX_IOPAD(0x9a4, PIN_OUTPUT | MUX_MODE7)     /* SoundPA_en - mcasp0_fsr.gpio3_19 */
+                       AM33XX_IOPAD(0x828, PIN_OUTPUT | MUX_MODE7)     /* nKbdOnC - gpmc_ad10.gpio0_26 */
+                       AM33XX_IOPAD(0x830, PIN_INPUT_PULLUP | MUX_MODE7)       /* nKbdInt - gpmc_ad12.gpio1_12 */
+                       AM33XX_IOPAD(0x834, PIN_INPUT_PULLUP | MUX_MODE7)       /* nKbdReset - gpmc_ad13.gpio1_13 */
+                       AM33XX_IOPAD(0x838, PIN_INPUT_PULLUP | MUX_MODE7)       /* nDispReset - gpmc_ad14.gpio1_14 */
+                       AM33XX_IOPAD(0x844, PIN_INPUT_PULLUP | MUX_MODE7)       /* USB1_enPower - gpmc_a1.gpio1_17 */
+                       /* AVR Programming - SPI Bus (bit bang) - Screen and Keyboard */
+                       AM33XX_IOPAD(0x954, PIN_INPUT_PULLUP | MUX_MODE7)       /* Kbd/Disp/BattMOSI spi0_d0.gpio0_3 */
+                       AM33XX_IOPAD(0x958, PIN_INPUT_PULLUP | MUX_MODE7)       /* Kbd/Disp/BattMISO spi0_d1.gpio0_4 */
+                       AM33XX_IOPAD(0x950, PIN_INPUT_PULLUP | MUX_MODE7)       /* Kbd/Disp/BattSCLK spi0_clk.gpio0_2 */
+                       /* PDI Bus - Battery system */
+                       AM33XX_IOPAD(0x840, PIN_INPUT_PULLUP | MUX_MODE7)       /* nBattReset  gpmc_a0.gpio1_16 */
+                       AM33XX_IOPAD(0x83c, PIN_INPUT_PULLUP | MUX_MODE7)       /* BattPDIData gpmc_ad15.gpio1_15 */
+               >;
+       };
+};
+
+&i2c0 {
+       status = "okay";
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c0_pins>;
+
+       clock-frequency = <400000>;
+
+       tps: tps@24 {
+               reg = <0x24>;
+       };
+
+       eeprom: eeprom@50 {
+               compatible = "at,24c256";
+               reg = <0x50>;
+       };
+};
+
+&i2c1 {
+       status = "okay";
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c1_pins>;
+};
+
+&i2c2 {
+       status = "okay";
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c2_pins>;
+
+       clock-frequency = <400000>;
+
+       audio_codec: tlv320aic3106@1b {
+               status = "okay";
+               compatible = "ti,tlv320aic3106";
+               reg = <0x1b>;
+
+               AVDD-supply = <&ldo4_reg>;
+               IOVDD-supply = <&ldo4_reg>;
+               DRVDD-supply = <&ldo4_reg>;
+               DVDD-supply = <&ldo3_reg>;
+       };
+};
+
+&usb {
+       status = "okay";
+};
+
+&usb_ctrl_mod {
+       status = "okay";
+};
+
+&usb0_phy {
+       status = "okay";
+};
+
+&usb1_phy {
+       status = "okay";
+};
+
+&usb0 {
+       status = "okay";
+       dr_mode = "peripheral";
+};
+
+&usb1 {
+       status = "okay";
+       dr_mode = "host";
+};
+
+&cppi41dma  {
+       status = "okay";
+};
+
+&mmc1 {
+       status = "okay";
+       pinctrl-names = "default";
+       pinctrl-0 = <&mmc1_pins>;
+       bus-width = <4>;
+       cd-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
+       vmmc-supply = <&vmmcsd_fixed>;
+};
+
+&mmc2 {
+       status = "okay";
+       pinctrl-names = "default";
+       pinctrl-0 = <&emmc_pins>;
+       bus-width = <8>;
+       vmmc-supply = <&vmmcsd_fixed>;
+       mmc-pwrseq = <&emmc_pwrseq>;
+};
+
+&mcasp0 {
+       status = "okay";
+       pinctrl-names = "default";
+       pinctrl-0 = <&audio_pins>;
+
+       op-mode = <0>;  /* MCASP_ISS_MODE */
+       tdm-slots = <2>;
+       serial-dir = <
+               2 0 1 0
+               0 0 0 0
+               0 0 0 0
+               0 0 0 0
+       >;
+       tx-num-evt = <1>;
+       rx-num-evt = <1>;
+};
+
+&uart0 {
+       status = "okay";
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart0_pins>;
+};
+
+&uart4 {
+       status = "okay";
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart4_pins>;
+};
+
+#include "tps65217.dtsi"
+
+&tps {
+       ti,pmic-shutdown-controller;
+
+       interrupt-parent = <&intc>;
+       interrupts = <7>;       /* NNMI */
+
+       regulators {
+               dcdc1_reg: regulator@0 {
+                       /* VDDS_DDR */
+                       regulator-min-microvolt = <1500000>;
+                       regulator-max-microvolt = <1500000>;
+                       regulator-always-on;
+               };
+
+               dcdc2_reg: regulator@1 {
+                       /* VDD_MPU voltage limits 0.95V - 1.26V with +/-4% tolerance */
+                       regulator-name = "vdd_mpu";
+                       regulator-min-microvolt = <925000>;
+                       regulator-max-microvolt = <1325000>;
+                       regulator-boot-on;
+                       regulator-always-on;
+               };
+
+               dcdc3_reg: regulator@2 {
+                       /* VDD_CORE voltage limits 0.95V - 1.1V with +/-4% tolerance */
+                       regulator-name = "vdd_core";
+                       regulator-min-microvolt = <925000>;
+                       regulator-max-microvolt = <1150000>;
+                       regulator-boot-on;
+                       regulator-always-on;
+               };
+
+               ldo1_reg: regulator@3 {
+                       /* VRTC / VIO / VDDS*/
+                       regulator-always-on;
+                       regulator-min-microvolt = <1800000>;
+                       regulator-max-microvolt = <1800000>;
+               };
+
+               ldo2_reg: regulator@4 {
+                       /* VDD_3V3AUX */
+                       regulator-always-on;
+                       regulator-min-microvolt = <3300000>;
+                       regulator-max-microvolt = <3300000>;
+               };
+
+               ldo3_reg: regulator@5 {
+                       /* VDD_1V8 */
+                       regulator-min-microvolt = <1800000>;
+                       regulator-max-microvolt = <1800000>;
+                       regulator-always-on;
+               };
+
+               ldo4_reg: regulator@6 {
+                       /* VDD_3V3A */
+                       regulator-min-microvolt = <3300000>;
+                       regulator-max-microvolt = <3300000>;
+                       regulator-always-on;
+               };
+       };
+};
+
+&cpsw_emac0 {
+       phy_id = <&davinci_mdio>, <0>;
+       phy-mode = "mii";
+};
+
+&cpsw_emac1 {
+       phy_id = <&davinci_mdio>, <1>;
+       phy-mode = "mii";
+};
+
+&mac {
+       status = "okay";
+       pinctrl-names = "default", "sleep";
+       pinctrl-0 = <&cpsw_default>;
+       pinctrl-1 = <&cpsw_sleep>;
+};
+
+&davinci_mdio {
+       status = "okay";
+       pinctrl-names = "default", "sleep";
+       pinctrl-0 = <&davinci_mdio_default>;
+       pinctrl-1 = <&davinci_mdio_sleep>;
+};
+
+&sham {
+       status = "okay";
+};
+
+&aes {
+       status = "okay";
+};
+
+&epwmss1 {
+       status = "okay";
+};
+
+&ehrpwm1 {
+       status = "okay";
+       pinctrl-names = "default";
+       pinctrl-0 = <&ehrpwm1_pins>;
+};
index f164dce08755cc5866b79133050db9f808cafce9..5e3f5e86ffcfeff43f611032b9381390bbffdc9f 100644 (file)
                        dma-names = "tx", "rx";
                        clock-frequency = <48000000>;
                };
+
+               omap3_pmx_core2: pinmux@480025d8 {
+                       compatible = "ti,omap3-padconf", "pinctrl-single";
+                       reg = <0x480025d8 0x24>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       #interrupt-cells = <1>;
+                       interrupt-controller;
+                       pinctrl-single,register-width = <16>;
+                       pinctrl-single,function-mask = <0xff1f>;
+               };
        };
 };
 
index 518b8fde88b0c87005fe68e413cfee769befac07..18cc826e9db534714a1b4d8a3cfc497e43ffcc85 100644 (file)
@@ -12,7 +12,7 @@
                #clock-cells = <0>;
                compatible = "ti,am35xx-gate-clock";
                clocks = <&ipss_ick>;
-               reg = <0x059c>;
+               reg = <0x032c>;
                ti,bit-shift = <1>;
        };
 
@@ -20,7 +20,7 @@
                #clock-cells = <0>;
                compatible = "ti,gate-clock";
                clocks = <&rmii_ck>;
-               reg = <0x059c>;
+               reg = <0x032c>;
                ti,bit-shift = <9>;
        };
 
@@ -28,7 +28,7 @@
                #clock-cells = <0>;
                compatible = "ti,am35xx-gate-clock";
                clocks = <&ipss_ick>;
-               reg = <0x059c>;
+               reg = <0x032c>;
                ti,bit-shift = <2>;
        };
 
@@ -36,7 +36,7 @@
                #clock-cells = <0>;
                compatible = "ti,gate-clock";
                clocks = <&pclk_ck>;
-               reg = <0x059c>;
+               reg = <0x032c>;
                ti,bit-shift = <10>;
        };
 
@@ -44,7 +44,7 @@
                #clock-cells = <0>;
                compatible = "ti,am35xx-gate-clock";
                clocks = <&ipss_ick>;
-               reg = <0x059c>;
+               reg = <0x032c>;
                ti,bit-shift = <0>;
        };
 
@@ -52,7 +52,7 @@
                #clock-cells = <0>;
                compatible = "ti,gate-clock";
                clocks = <&sys_ck>;
-               reg = <0x059c>;
+               reg = <0x032c>;
                ti,bit-shift = <8>;
        };
 
@@ -60,7 +60,7 @@
                #clock-cells = <0>;
                compatible = "ti,am35xx-gate-clock";
                clocks = <&sys_ck>;
-               reg = <0x059c>;
+               reg = <0x032c>;
                ti,bit-shift = <3>;
        };
 };
index 26956cb50835d660d4a853e52e913eca9190e4e5..84aa30c3235af1a14fcbeebe0622a54be6c6d3d9 100644 (file)
@@ -21,6 +21,7 @@
 
        aliases {
                display0 = &lcd0;
+               serial3 = &uart3;
        };
 
        vmmcsd_fixed: fixedregulator-sd {
                gpio = <&gpio5 7 GPIO_ACTIVE_HIGH>;
        };
 
+       vmmcwl_fixed: fixedregulator-mmcwl {
+               compatible = "regulator-fixed";
+               regulator-name = "vmmcwl_fixed";
+               regulator-min-microvolt = <1800000>;
+               regulator-max-microvolt = <1800000>;
+               gpio = <&gpio1 20 GPIO_ACTIVE_HIGH>;
+               enable-active-high;
+       };
+
        backlight {
                compatible = "pwm-backlight";
                pwms = <&ecap0 0 50000 PWM_POLARITY_INVERTED>;
                        };
                };
        };
+
+       /* fixed 12MHz oscillator */
+       refclk: oscillator {
+               #clock-cells = <0>;
+               compatible = "fixed-clock";
+               clock-frequency = <12000000>;
+       };
+
 };
 
 &am43xx_pinmux {
+       pinctrl-names = "default", "sleep";
+       pinctrl-0 = <&wlan_pins_default>;
+       pinctrl-1 = <&wlan_pins_sleep>;
+
        i2c0_pins: i2c0_pins {
                pinctrl-single,pins = <
                        0x188 (PIN_INPUT_PULLUP | SLEWCTRL_FAST | MUX_MODE0)  /* i2c0_sda.i2c0_sda */
                        0x204 (DS0_PULL_UP_DOWN_EN | INPUT_EN | MUX_MODE7)  /* cam1_data7 mode 0*/
                >;
        };
+
+       mmc3_pins_default: pinmux_mmc3_pins_default {
+               pinctrl-single,pins = <
+                       0x8c (PIN_INPUT_PULLUP | MUX_MODE3)      /* gpmc_clk.mmc2_clk */
+                       0x88 (PIN_INPUT_PULLUP | MUX_MODE3)      /* gpmc_csn3.mmc2_cmd */
+                       0x44 (PIN_INPUT_PULLUP | MUX_MODE3)      /* gpmc_a1.mmc2_dat0 */
+                       0x48 (PIN_INPUT_PULLUP | MUX_MODE3)      /* gpmc_a2.mmc2_dat1 */
+                       0x4c (PIN_INPUT_PULLUP | MUX_MODE3)      /* gpmc_a3.mmc2_dat2 */
+                       0x78 (PIN_INPUT_PULLUP | MUX_MODE3)      /* gpmc_be1n.mmc2_dat3 */
+               >;
+       };
+
+       mmc3_pins_sleep: pinmux_mmc3_pins_sleep {
+               pinctrl-single,pins = <
+                       0x8c (PIN_INPUT_PULLDOWN | MUX_MODE7)   /* gpmc_clk.mmc2_clk */
+                       0x88 (PIN_INPUT_PULLDOWN | MUX_MODE7)   /* gpmc_csn3.mmc2_cmd */
+                       0x44 (PIN_INPUT_PULLDOWN | MUX_MODE7)   /* gpmc_a1.mmc2_dat0 */
+                       0x48 (PIN_INPUT_PULLDOWN | MUX_MODE7)   /* gpmc_a2.mmc2_dat1 */
+                       0x4c (PIN_INPUT_PULLDOWN | MUX_MODE7)   /* gpmc_a3.mmc2_dat2 */
+                       0x78 (PIN_INPUT_PULLDOWN | MUX_MODE7)   /* gpmc_be1n.mmc2_dat3 */
+               >;
+       };
+
+       wlan_pins_default: pinmux_wlan_pins_default {
+               pinctrl-single,pins = <
+                       0x50 (PIN_OUTPUT_PULLDOWN | MUX_MODE7)          /* gpmc_a4.gpio1_20 WL_EN */
+                       0x5c (PIN_INPUT | WAKEUP_ENABLE | MUX_MODE7)    /* gpmc_a7.gpio1_23 WL_IRQ*/
+                       0x40 (PIN_OUTPUT_PULLDOWN | MUX_MODE7)          /* gpmc_a0.gpio1_16 BT_EN*/
+               >;
+       };
+
+       wlan_pins_sleep: pinmux_wlan_pins_sleep {
+               pinctrl-single,pins = <
+                       0x50 (PIN_OUTPUT_PULLDOWN | MUX_MODE7)          /* gpmc_a4.gpio1_20 WL_EN */
+                       0x5c (PIN_INPUT | WAKEUP_ENABLE | MUX_MODE7)    /* gpmc_a7.gpio1_23 WL_IRQ*/
+                       0x40 (PIN_OUTPUT_PULLUP | MUX_MODE7)            /* gpmc_a0.gpio1_16 BT_EN*/
+               >;
+       };
+
+       uart3_pins: uart3_pins {
+               pinctrl-single,pins = <
+                       0x228 (PIN_INPUT | MUX_MODE0)           /* uart3_rxd.uart3_rxd */
+                       0x22c (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* uart3_txd.uart3_txd */
+                       0x230 (PIN_INPUT_PULLUP | MUX_MODE0)    /* uart3_ctsn.uart3_ctsn */
+                       0x234 (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* uart3_rtsn.uart3_rtsn */
+               >;
+       };
 };
 
 &i2c0 {
                        regulator-always-on;
                };
        };
+
+       ov2659@30 {
+               compatible = "ovti,ov2659";
+               reg = <0x30>;
+
+               clocks = <&refclk 0>;
+               clock-names = "xvclk";
+
+               port {
+                       ov2659_0: endpoint {
+                               remote-endpoint = <&vpfe1_ep>;
+                               link-frequencies = /bits/ 64 <70000000>;
+                       };
+               };
+       };
 };
 
 &i2c1 {
                touchscreen-size-x = <1024>;
                touchscreen-size-y = <600>;
        };
+
+       ov2659@30 {
+               compatible = "ovti,ov2659";
+               reg = <0x30>;
+
+               clocks = <&refclk 0>;
+               clock-names = "xvclk";
+
+               port {
+                       ov2659_1: endpoint {
+                               remote-endpoint = <&vpfe0_ep>;
+                               link-frequencies = /bits/ 64 <70000000>;
+                       };
+               };
+       };
 };
 
 &epwmss0 {
        status = "okay";
 };
 
+&gpio1 {
+       status = "okay";
+};
+
 &gpio3 {
        status = "okay";
 };
        cd-gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>;
 };
 
+&mmc3 {
+       status = "okay";
+       /* these are on the crossbar and are outlined in the
+          xbar-event-map element */
+       dmas = <&edma 30
+               &edma 31>;
+       dma-names = "tx", "rx";
+       vmmc-supply = <&vmmcwl_fixed>;
+       bus-width = <4>;
+       pinctrl-names = "default", "sleep";
+       pinctrl-0 = <&mmc3_pins_default>;
+       pinctrl-1 = <&mmc3_pins_sleep>;
+       cap-power-off-card;
+       keep-power-in-suspend;
+       ti,non-removable;
+
+       #address-cells = <1>;
+       #size-cells = <0>;
+       wlcore: wlcore@0 {
+               compatible = "ti,wl1835";
+               reg = <2>;
+               interrupt-parent = <&gpio1>;
+               interrupts = <23 IRQ_TYPE_LEVEL_HIGH>;
+       };
+};
+
+&edma {
+       ti,edma-xbar-event-map = /bits/ 16 <1 30
+                                           2 31>;
+};
+
+&uart3 {
+       status = "okay";
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart3_pins>;
+};
+
 &usb2_phy1 {
        status = "okay";
 };
 
        port {
                vpfe0_ep: endpoint {
-                       /* remote-endpoint = <&sensor>; add once we have it */
+                       remote-endpoint = <&ov2659_1>;
                        ti,am437x-vpfe-interface = <0>;
                        bus-width = <8>;
                        hsync-active = <0>;
 
        port {
                vpfe1_ep: endpoint {
-                       /* remote-endpoint = <&sensor>; add once we have it */
+                       remote-endpoint = <&ov2659_0>;
                        ti,am437x-vpfe-interface = <0>;
                        bus-width = <8>;
                        hsync-active = <0>;
index ff26c7ed8c41d408b7724ec576355b0b8c513d02..1bc64cda819e0b70530575ed1ec6d5c57e19b075 100644 (file)
                ranges;
 
                syscon: syscon@10000000 {
-                       compatible = "arm,realview-pb1176-syscon", "syscon";
+                       compatible = "arm,realview-pb1176-syscon", "syscon", "simple-mfd";
                        reg = <0x10000000 0x1000>;
 
                        led@08.0 {
index 19f3bf271915fc1dd843a7d10d50df353b4b52d2..03542f7b5b94a8f464754887e46ab03a6747c939 100644 (file)
                                spi-flash@0 {
                                        #address-cells = <1>;
                                        #size-cells = <1>;
-                                       compatible = "mx25l25635e";
+                                       compatible = "mx25l25635e", "jedec,spi-nor";
                                        reg = <0>; /* Chip select 0 */
                                        spi-max-frequency = <50000000>;
                                };
diff --git a/arch/arm/boot/dts/armada-370-dlink-dns327l.dts b/arch/arm/boot/dts/armada-370-dlink-dns327l.dts
new file mode 100644 (file)
index 0000000..af4dc54
--- /dev/null
@@ -0,0 +1,357 @@
+/*
+ * Device Tree file for D-Link DNS-327L
+ *
+ * Copyright (C) 2015, Andrew Andrianov <andrew@ncrmnt.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 , 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.
+ */
+
+/* Remaining unsolved:
+ * There's still some unknown device on i2c address 0x13
+ */
+
+/dts-v1/;
+
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/gpio/gpio.h>
+#include "armada-370.dtsi"
+
+/ {
+       model = "D-Link DNS-327L";
+       compatible = "dlink,dns327l",
+               "marvell,armada370",
+               "marvell,armada-370-xp";
+
+       chosen {
+               stdout-path = &uart0;
+       };
+
+       memory {
+               device_type = "memory";
+               reg = <0x00000000 0x20000000>; /* 512 MiB */
+       };
+
+       soc {
+               ranges = <MBUS_ID(0xf0, 0x01) 0 0xd0000000 0x100000
+                       MBUS_ID(0x01, 0xe0) 0 0xfff00000 0x100000>;
+
+               pcie-controller {
+                       status = "okay";
+
+                       pcie@1,0 {
+                               /* Port 0, Lane 0 */
+                               status = "okay";
+                       };
+
+                       pcie@2,0 {
+                               /* Port 1, Lane 0 */
+                               status = "okay";
+                       };
+               };
+
+               internal-regs {
+                       sata@a0000 {
+                               nr-ports = <2>;
+                               status = "okay";
+                       };
+
+                       usb@50000 {
+                               status = "okay";
+                       };
+
+                       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";
+                                       /* 1.0 MiB */
+                                       reg = <0x0000000 0x100000>;
+                                       read-only;
+                               };
+
+                               partition@100000 {
+                                       label = "u-boot-env";
+                                       /* 128 KiB */
+                                       reg = <0x100000 0x20000>;
+                                       read-only;
+                               };
+
+                               partition@120000 {
+                                       label = "uImage";
+                                       /* 7 MiB */
+                                       reg = <0x120000 0x700000>;
+                               };
+
+                               partition@820000 {
+                                       label = "ubifs";
+                                       /* ~ 84 MiB */
+                                       reg = <0x820000 0x54e0000>;
+                               };
+
+                               /* Hardcoded into stock bootloader */
+                               partition@5d00000 {
+                                       label = "failsafe-uImage";
+                                       /* 5 MiB */
+                                       reg = <0x5d00000 0x500000>;
+                               };
+
+                               partition@6200000 {
+                                       label = "failsafe-fs";
+                                       /* 29 MiB */
+                                       reg = <0x6200000 0x1d00000>;
+                               };
+
+                               partition@7f00000 {
+                                       label = "bbt";
+                                       /* 1 MiB for BBT */
+                                       reg = <0x7f00000 0x100000>;
+                               };
+                       };
+               };
+       };
+
+       gpio-keys {
+               compatible = "gpio-keys";
+               pinctrl-0 = <
+                       &backup_button_pin
+                       &power_button_pin
+                       &reset_button_pin>;
+               pinctrl-names = "default";
+
+               power-button {
+                       label = "Power Button";
+                       linux,code = <KEY_POWER>;
+                       gpios = <&gpio2 1 GPIO_ACTIVE_LOW>;
+               };
+
+               backup-button {
+                       label = "Backup Button";
+                       linux,code = <KEY_COPY>;
+                       gpios = <&gpio1 31 GPIO_ACTIVE_LOW>;
+               };
+
+               reset-button {
+                       label = "Reset Button";
+                       linux,code = <KEY_RESTART>;
+                       gpios = <&gpio2 0 GPIO_ACTIVE_LOW>;
+               };
+       };
+
+       gpio-leds {
+               compatible = "gpio-leds";
+               pinctrl-0 = <
+                       &sata_l_amber_pin
+                       &sata_r_amber_pin
+                       &backup_led_pin
+                       /* Ensure these are managed by hardware */
+                       &sata_l_white_pin
+                       &sata_r_white_pin>;
+
+               pinctrl-names = "default";
+
+               sata-r-amber-pin {
+                       label = "dns327l:amber:sata-r";
+                       gpios = <&gpio1 20 GPIO_ACTIVE_HIGH>;
+                       default-state = "keep";
+               };
+
+               sata-l-amber-pin {
+                       label = "dns327l:amber:sata-l";
+                       gpios = <&gpio1 21 GPIO_ACTIVE_HIGH>;
+                       default-state = "keep";
+               };
+
+               backup-led-pin {
+                       label = "dns327l:white:usb";
+                       gpios = <&gpio1 29 GPIO_ACTIVE_HIGH>;
+                       default-state = "keep";
+               };
+       };
+
+       regulators {
+               compatible = "simple-bus";
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               usb_power: regulator@1 {
+                       compatible = "regulator-fixed";
+                       reg = <1>;
+                       pinctrl-0 = <&xhci_pwr_pin>;
+                       pinctrl-names = "default";
+                       regulator-name = "USB3.0 Port Power";
+                       regulator-min-microvolt = <5000000>;
+                       regulator-max-microvolt = <5000000>;
+                       enable-active-high;
+                       regulator-boot-on;
+                       regulator-always-on;
+                       gpio = <&gpio0 13 GPIO_ACTIVE_HIGH>;
+               };
+
+               sata_r_power: regulator@2 {
+                       compatible = "regulator-fixed";
+                       reg = <2>;
+                       pinctrl-0 = <&sata_r_pwr_pin>;
+                       pinctrl-names = "default";
+                       regulator-name = "SATA-R Power";
+                       regulator-min-microvolt = <5000000>;
+                       regulator-max-microvolt = <5000000>;
+                       startup-delay-us = <2000000>;
+                       enable-active-high;
+                       regulator-always-on;
+                       regulator-boot-on;
+                       gpio = <&gpio1 22 GPIO_ACTIVE_HIGH>;
+               };
+
+               sata_l_power: regulator@3 {
+                       compatible = "regulator-fixed";
+                       reg = <3>;
+                       pinctrl-0 = <&sata_l_pwr_pin>;
+                       pinctrl-names = "default";
+                       regulator-name = "SATA-L Power";
+                       regulator-min-microvolt = <5000000>;
+                       regulator-max-microvolt = <5000000>;
+                       startup-delay-us = <4000000>;
+                       enable-active-high;
+                       regulator-always-on;
+                       regulator-boot-on;
+                       gpio = <&gpio1 24 GPIO_ACTIVE_HIGH>;
+               };
+       };
+};
+
+&pinctrl {
+       sata_l_white_pin: sata-l-white-pin {
+               marvell,pins = "mpp57";
+               marvell,function = "sata0";
+       };
+
+       sata_r_white_pin: sata-r-white-pin {
+               marvell,pins = "mpp55";
+               marvell,function = "sata1";
+       };
+
+       sata_r_amber_pin: sata-r-amber-pin {
+               marvell,pins = "mpp52";
+               marvell,function = "gpio";
+       };
+
+       sata_l_amber_pin: sata-l-amber-pin {
+               marvell,pins = "mpp53";
+               marvell,function = "gpio";
+       };
+
+       backup_led_pin: backup-led-pin {
+               marvell,pins = "mpp61";
+               marvell,function = "gpo";
+       };
+
+       xhci_pwr_pin: xhci-pwr-pin {
+               marvell,pins = "mpp13";
+               marvell,function = "gpio";
+       };
+
+       sata_r_pwr_pin: sata-r-pwr-pin {
+               marvell,pins = "mpp54";
+               marvell,function = "gpio";
+       };
+
+       sata_l_pwr_pin: sata-l-pwr-pin {
+               marvell,pins = "mpp56";
+               marvell,function = "gpio";
+       };
+
+       uart1_pins: uart1-pins {
+               marvell,pins = "mpp60", "mpp61";
+               marvell,function = "uart1";
+       };
+
+       power_button_pin: power-button-pin {
+               marvell,pins = "mpp65";
+               marvell,function = "gpio";
+       };
+
+       backup_button_pin: backup-button-pin {
+               marvell,pins = "mpp63";
+               marvell,function = "gpio";
+       };
+
+       reset_button_pin: reset-button-pin {
+               marvell,pins = "mpp64";
+               marvell,function = "gpio";
+       };
+};
+
+/* Serial console */
+&uart0 {
+       status = "okay";
+};
+
+/* Connected to Weltrend MCU */
+&uart1 {
+       pinctrl-0 = <&uart1_pins>;
+       pinctrl-names = "default";
+       status = "okay";
+};
+
+&mdio {
+       phy0: ethernet-phy@0 { /* Marvell 88E1318 */
+               reg = <0>;
+               marvell,reg-init = <0x0 0x16 0x0 0x0002>,
+                               <0x0 0x19 0x0 0x0077>,
+                               <0x0 0x18 0x0 0x5747>;
+       };
+};
+
+&eth1 {
+       phy = <&phy0>;
+       phy-mode = "rgmii-id";
+       status = "okay";
+};
+
+&i2c0 {
+       compatible = "marvell,mv64xxx-i2c";
+       clock-frequency = <100000>;
+       status = "okay";
+};
index b42b767763aaa41c5a96420e4415efc7683adb16..4f4924362bf0efc441dca115b23a606cb442d493 100644 (file)
@@ -92,7 +92,7 @@
                                spi-flash@0 {
                                        #address-cells = <1>;
                                        #size-cells = <1>;
-                                       compatible = "micron,n25q064";
+                                       compatible = "micron,n25q064", "jedec,spi-nor";
                                        reg = <0>; /* Chip select 0 */
                                        spi-max-frequency = <20000000>;
 
index ec96f0b3634653a5976739688eca9fd791eaba0b..7f0252c580e4bd0b32a2e2eb5de440bacbfd3b98 100644 (file)
                        };
 
                        spi0: spi@10600 {
-                               compatible = "marvell,armada-370-spi", "marvell,orion-spi";
                                reg = <0x10600 0x28>;
                                #address-cells = <1>;
                                #size-cells = <0>;
                        };
 
                        spi1: spi@10680 {
-                               compatible = "marvell,armada-370-spi", "marvell,orion-spi";
                                reg = <0x10680 0x28>;
                                #address-cells = <1>;
                                #size-cells = <0>;
index 00b50db57c9c0f7ab4111bbdba06d3fd0bdc93ad..3f036bd635f4207ac2ffe87e809155a51debaa64 100644 (file)
                         * board level if a different configuration is used.
                         */
                        spi0: spi@10600 {
+                               compatible = "marvell,armada-370-spi",
+                                               "marvell,orion-spi";
                                pinctrl-0 = <&spi0_pins1>;
                                pinctrl-names = "default";
                        };
 
                        spi1: spi@10680 {
+                               compatible = "marvell,armada-370-spi",
+                                               "marvell,orion-spi";
                                pinctrl-0 = <&spi1_pins>;
                                pinctrl-names = "default";
                        };
index 4eabc9c21f8dc1e84f399edb6e56a2bdf992a7ed..5711b97e876c1ceaa9e3a16da42709ebcf6b654a 100644 (file)
@@ -81,7 +81,7 @@
                                spi-flash@0 {
                                        #address-cells = <1>;
                                        #size-cells = <1>;
-                                       compatible = "n25q128a13";
+                                       compatible = "n25q128a13", "jedec,spi-nor";
                                        reg = <0>; /* Chip select 0 */
                                        spi-max-frequency = <108000000>;
                                };
index f076ff856d8b8223466f3ec8536caaa1974186ca..67a0ab0f71e029bfa36ffcccbd34ded49c80b164 100644 (file)
                        };
 
                        spi0: spi@10600 {
-                               compatible = "marvell,orion-spi";
+                               compatible = "marvell,armada-375-spi",
+                                               "marvell,orion-spi";
                                reg = <0x10600 0x50>;
                                #address-cells = <1>;
                                #size-cells = <0>;
                        };
 
                        spi1: spi@10680 {
-                               compatible = "marvell,orion-spi";
+                               compatible = "marvell,armada-375-spi",
+                                               "marvell,orion-spi";
                                reg = <0x10680 0x50>;
                                #address-cells = <1>;
                                #size-cells = <0>;
index 7219ac3a3d900743114fd7d9001748118695515e..89f5a95954ed9020c070491cae36cc7b2556eccf 100644 (file)
@@ -70,7 +70,7 @@
                                spi-flash@0 {
                                        #address-cells = <1>;
                                        #size-cells = <1>;
-                                       compatible = "st,m25p128";
+                                       compatible = "st,m25p128", "jedec,spi-nor";
                                        reg = <0>; /* Chip select 0 */
                                        spi-max-frequency = <54000000>;
                                };
diff --git a/arch/arm/boot/dts/armada-385-linksys-caiman.dts b/arch/arm/boot/dts/armada-385-linksys-caiman.dts
new file mode 100644 (file)
index 0000000..f3cee91
--- /dev/null
@@ -0,0 +1,114 @@
+/*
+ * Device Tree include for the Linksys WRT1200AC (Caiman)
+ *
+ * Copyright (C) 2015 Imre Kaloz <kaloz@openwrt.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 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.
+ *
+ * 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 "armada-385-linksys.dtsi"
+
+/ {
+       model = "Linksys WRT1200AC";
+       compatible = "linksys,caiman", "linksys,armada385", "marvell,armada385",
+                    "marvell,armada380";
+
+       soc {
+               internal-regs{
+                       i2c@11000 {
+
+                               pca9635@68 {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                                       wan_amber@0 {
+                                               label = "caiman:amber:wan";
+                                               reg = <0x0>;
+                                       };
+
+                                       wan_white@1 {
+                                               label = "caiman:white:wan";
+                                               reg = <0x1>;
+                                       };
+
+                                       wlan_2g@2 {
+                                               label = "caiman:white:wlan_2g";
+                                               reg = <0x2>;
+                                       };
+
+                                       wlan_5g@3 {
+                                               label = "caiman:white:wlan_5g";
+                                               reg = <0x3>;
+                                       };
+
+                                       usb2@5 {
+                                               label = "caiman:white:usb2";
+                                               reg = <0x5>;
+                                       };
+
+                                       usb3_1@6 {
+                                               label = "caiman:white:usb3_1";
+                                               reg = <0x6>;
+                                       };
+
+                                       usb3_2@7 {
+                                               label = "caiman:white:usb3_2";
+                                               reg = <0x7>;
+                                       };
+
+                                       wps_white@8 {
+                                               label = "caiman:white:wps";
+                                               reg = <0x8>;
+                                       };
+
+                                       wps_amber@9 {
+                                               label = "caiman:amber:wps";
+                                               reg = <0x9>;
+                                       };
+                               };
+                       };
+               };
+       };
+
+       gpio-leds {
+               power {
+                       label = "caiman:white:power";
+               };
+
+               sata {
+                       label = "caiman:white:sata";
+               };
+       };
+};
diff --git a/arch/arm/boot/dts/armada-385-linksys-cobra.dts b/arch/arm/boot/dts/armada-385-linksys-cobra.dts
new file mode 100644 (file)
index 0000000..1110718
--- /dev/null
@@ -0,0 +1,114 @@
+/*
+ * Device Tree file for the Linksys WRT1900ACv2 (Cobra)
+ *
+ * Copyright (C) 2015 Imre Kaloz <kaloz@openwrt.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 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.
+ *
+ * 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 "armada-385-linksys.dtsi"
+
+/ {
+       model = "Linksys WRT1900ACv2";
+       compatible = "linksys,cobra", "linksys,armada385", "marvell,armada385",
+                    "marvell,armada380";
+
+       soc {
+               internal-regs{
+                       i2c@11000 {
+
+                               pca9635@68 {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                                       wan_amber@0 {
+                                               label = "cobra:amber:wan";
+                                               reg = <0x0>;
+                                       };
+
+                                       wan_white@1 {
+                                               label = "cobra:white:wan";
+                                               reg = <0x1>;
+                                       };
+
+                                       wlan_2g@2 {
+                                               label = "cobra:white:wlan_2g";
+                                               reg = <0x2>;
+                                       };
+
+                                       wlan_5g@3 {
+                                               label = "cobra:white:wlan_5g";
+                                               reg = <0x3>;
+                                       };
+
+                                       usb2@5 {
+                                               label = "cobra:white:usb2";
+                                               reg = <0x5>;
+                                       };
+
+                                       usb3_1@6 {
+                                               label = "cobra:white:usb3_1";
+                                               reg = <0x6>;
+                                       };
+
+                                       usb3_2@7 {
+                                               label = "cobra:white:usb3_2";
+                                               reg = <0x7>;
+                                       };
+
+                                       wps_white@8 {
+                                               label = "cobra:white:wps";
+                                               reg = <0x8>;
+                                       };
+
+                                       wps_amber@9 {
+                                               label = "cobra:amber:wps";
+                                               reg = <0x9>;
+                                       };
+                               };
+                       };
+               };
+       };
+
+       gpio-leds {
+               power {
+                       label = "cobra:white:power";
+               };
+
+               sata {
+                       label = "cobra:white:sata";
+               };
+       };
+};
diff --git a/arch/arm/boot/dts/armada-385-linksys.dtsi b/arch/arm/boot/dts/armada-385-linksys.dtsi
new file mode 100644 (file)
index 0000000..74a9c6b
--- /dev/null
@@ -0,0 +1,332 @@
+/*
+ * Device Tree include file for Armada 385 based Linksys boards
+ *
+ * Copyright (C) 2015 Imre Kaloz <kaloz@openwrt.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 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.
+ *
+ * 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 "armada-385.dtsi"
+
+/ {
+       model = "Linksys boards based on Armada 385";
+       compatible = "linksys,armada385", "marvell,armada385",
+                    "marvell,armada380";
+
+       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, 0x1d) 0 0xfff00000 0x100000>;
+
+               internal-regs {
+
+                       spi@10600 {
+                               status = "disabled";
+                       };
+
+                       i2c@11000 {
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&i2c0_pins>;
+                               status = "okay";
+
+                               tmp421@4c {
+                                       compatible = "ti,tmp421";
+                                       reg = <0x4c>;
+                               };
+
+                               pca9635@68 {
+                                       #address-cells = <1>;
+                                       #size-cells = <0>;
+                                       compatible = "nxp,pca9635";
+                                       reg = <0x68>;
+                               };
+                       };
+
+                       /* J10: VCC, NC, RX, NC, TX, GND  */
+                       serial@12000 {
+                               status = "okay";
+                       };
+
+                       ethernet@70000 {
+                               status = "okay";
+                               phy-mode = "rgmii-id";
+                               fixed-link {
+                                       speed = <1000>;
+                                       full-duplex;
+                               };
+                       };
+
+                       ethernet@34000 {
+                               status = "okay";
+                               phy-mode = "sgmii";
+                               fixed-link {
+                                       speed = <1000>;
+                                       full-duplex;
+                               };
+                       };
+
+                       mdio {
+                               status = "okay";
+                       };
+
+                       sata@a8000 {
+                               status = "okay";
+                       };
+
+                       /* USB part of the eSATA/USB 2.0 port */
+                       usb@50000 {
+                               status = "okay";
+                       };
+
+                       usb3@f8000 {
+                               status = "okay";
+                               usb-phy = <&usb3_phy>;
+                       };
+
+                       flash@d0000 {
+                               status = "okay";
+                               num-cs = <1>;
+                               marvell,nand-keep-config;
+                               marvell,nand-enable-arbiter;
+                               nand-on-flash-bbt;
+
+                               partition@0 {
+                                       label = "u-boot";
+                                       reg = <0x0000000 0x200000>;  /* 2MB */
+                                       read-only;
+                               };
+
+                               partition@100000 {
+                                       label = "u_env";
+                                       reg = <0x200000 0x40000>;    /* 256KB */
+                               };
+
+                               partition@140000 {
+                                       label = "s_env";
+                                       reg = <0x240000 0x40000>;    /* 256KB */
+                               };
+
+                               partition@900000 {
+                                       label = "devinfo";
+                                       reg = <0x900000 0x100000>;   /* 1MB */
+                                       read-only;
+                               };
+
+                               /* kernel1 overlaps with rootfs1 by design */
+                               partition@a00000 {
+                                       label = "kernel1";
+                                       reg = <0xa00000 0x2800000>;  /* 40MB */
+                               };
+
+                               partition@1000000 {
+                                       label = "rootfs1";
+                                       reg = <0x1000000 0x2200000>;  /* 34MB */
+                               };
+
+                               /* kernel2 overlaps with rootfs2 by design */
+                               partition@3200000 {
+                                       label = "kernel2";
+                                       reg = <0x3200000 0x2800000>; /* 40MB */
+                               };
+
+                               partition@3800000 {
+                                       label = "rootfs2";
+                                       reg = <0x3800000 0x2200000>; /* 34MB */
+                               };
+
+                               /*
+                                * 38MB, last MB is for the BBT, not writable
+                                */
+                               partition@5a00000 {
+                                       label = "syscfg";
+                                       reg = <0x5a00000 0x2600000>;
+                               };
+
+                               /*
+                                * Unused area between "s_env" and "devinfo".
+                                * Moved here because otherwise the renumbered
+                                * partitions would break the bootloader
+                                * supplied bootargs
+                                */
+                               partition@180000 {
+                                       label = "unused_area";
+                                       reg = <0x280000 0x680000>;   /* 6.5MB */
+                               };
+                       };
+               };
+
+               pcie-controller {
+                       status = "okay";
+
+                       pcie@1,0 {
+                               /* Marvell 88W8864, 5GHz-only */
+                               status = "okay";
+                       };
+
+                       pcie@2,0 {
+                               /* Marvell 88W8864, 2GHz-only */
+                               status = "okay";
+                       };
+               };
+       };
+
+       usb3_phy: usb3_phy {
+               compatible = "usb-nop-xceiv";
+               vcc-supply = <&reg_xhci0_vbus>;
+       };
+
+       reg_xhci0_vbus: xhci0-vbus {
+               compatible = "regulator-fixed";
+               pinctrl-names = "default";
+               pinctrl-0 = <&xhci0_vbus_pins>;
+               regulator-name = "xhci0-vbus";
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;
+               enable-active-high;
+               gpio = <&gpio1 18 GPIO_ACTIVE_HIGH>;
+       };
+
+       gpio_keys {
+               compatible = "gpio-keys";
+               #address-cells = <1>;
+               #size-cells = <0>;
+               pinctrl-0 = <&keys_pin>;
+               pinctrl-names = "default";
+
+               button@1 {
+                       label = "WPS";
+                       linux,code = <KEY_WPS_BUTTON>;
+                       gpios = <&gpio0 24 GPIO_ACTIVE_LOW>;
+               };
+
+               button@2 {
+                       label = "Factory Reset Button";
+                       linux,code = <KEY_RESTART>;
+                       gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
+               };
+       };
+
+       gpio-leds {
+               compatible = "gpio-leds";
+               pinctrl-0 = <&power_led_pin &sata_led_pin>;
+               pinctrl-names = "default";
+
+               power {
+                       gpios = <&gpio1 23 GPIO_ACTIVE_HIGH>;
+                       default-state = "on";
+               };
+
+               sata {
+                       gpios = <&gpio1 22 GPIO_ACTIVE_HIGH>;
+                       default-state = "off";
+               };
+       };
+
+       dsa@0 {
+               compatible = "marvell,dsa";
+               #address-cells = <2>;
+               #size-cells = <0>;
+
+               dsa,ethernet = <&eth2>;
+               dsa,mii-bus = <&mdio>;
+
+               switch@0 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <0x0 0>;  /* MDIO address 0, switch 0 in tree */
+
+                       port@0 {
+                               reg = <0>;
+                               label = "lan4";
+                       };
+
+                       port@1 {
+                               reg = <1>;
+                               label = "lan3";
+                       };
+
+                       port@2 {
+                               reg = <2>;
+                               label = "lan2";
+                       };
+
+                       port@3 {
+                               reg = <3>;
+                               label = "lan1";
+                       };
+
+                       port@4 {
+                               reg = <4>;
+                               label = "wan";
+                       };
+
+                       port@5 {
+                               reg = <5>;
+                               label = "cpu";
+                       };
+               };
+       };
+};
+
+&pinctrl {
+       keys_pin: keys-pin {
+               marvell,pins = "mpp24", "mpp47";
+               marvell,function = "gpio";
+       };
+
+       power_led_pin: power-led-pin {
+               marvell,pins = "mpp55";
+               marvell,function = "gpio";
+       };
+
+       sata_led_pin: sata-led-pin {
+               marvell,pins = "mpp54";
+               marvell,function = "gpio";
+       };
+
+       xhci0_vbus_pins: xhci0-vbus-pins {
+               marvell,pins = "mpp50";
+               marvell,function = "gpio";
+       };
+};
index 51d1623de53e6967750b6c602ccaeef40359a535..91ac8c118f37de9732495d3201d10dd1d63f7a2a 100644 (file)
@@ -73,7 +73,7 @@
                                spi-flash@0 {
                                        #address-cells = <1>;
                                        #size-cells = <1>;
-                                       compatible = "w25q32";
+                                       compatible = "w25q32", "jedec,spi-nor";
                                        reg = <0>; /* Chip select 0 */
                                        spi-max-frequency = <108000000>;
                                };
index 78514ab0b47ace058f49b0da052d131374a8f5d2..fd4f6fd8a2e8a30277db97ab71bbd5b2a5dfd05d 100644 (file)
@@ -69,7 +69,7 @@
                                spi-flash@0 {
                                        #address-cells = <1>;
                                        #size-cells = <1>;
-                                       compatible = "st,m25p128";
+                                       compatible = "st,m25p128", "jedec,spi-nor";
                                        reg = <0>; /* Chip select 0 */
                                        spi-max-frequency = <50000000>;
                                        m25p,fast-read;
index 1dc6e2341cc2853829abb077441b27f2cfe4456e..b657b1687e5f95fe3f35214a5eec0bd288192213 100644 (file)
@@ -74,7 +74,7 @@
                                spi-flash@0 {
                                        #address-cells = <1>;
                                        #size-cells = <1>;
-                                       compatible = "st,m25p128";
+                                       compatible = "st,m25p128", "jedec,spi-nor";
                                        reg = <0>; /* Chip select 0 */
                                        spi-max-frequency = <108000000>;
                                };
index 218a2acd36e509b0de8e22dc207e06253b1163fe..04ecfe6e2bc6e3c47210a9f5af18516b2e0b61d4 100644 (file)
                        };
 
                        spi0: spi@10600 {
-                               compatible = "marvell,orion-spi";
+                               compatible = "marvell,armada-380-spi",
+                                               "marvell,orion-spi";
                                reg = <0x10600 0x50>;
                                #address-cells = <1>;
                                #size-cells = <0>;
                        };
 
                        spi1: spi@10680 {
-                               compatible = "marvell,orion-spi";
+                               compatible = "marvell,armada-380-spi",
+                                               "marvell,orion-spi";
                                reg = <0x10680 0x50>;
                                #address-cells = <1>;
                                #size-cells = <0>;
                                status = "disabled";
                        };
 
-                       mdio@72004 {
+                       mdio: mdio@72004 {
                                #address-cells = <1>;
                                #size-cells = <0>;
                                compatible = "marvell,orion-mdio";
index bbf83756c43c3b8fe9358de92ba6019221096f8c..788c3badb681ca99c3942ee6e8a4d47162e8601d 100644 (file)
@@ -73,7 +73,7 @@
                                spi-flash@0 {
                                        #address-cells = <1>;
                                        #size-cells = <0>;
-                                       compatible = "n25q128a13";
+                                       compatible = "n25q128a13", "jedec,spi-nor";
                                        reg = <0>;
                                        spi-max-frequency = <108000000>;
 
index ecd1318109bac8fb5d1e29c96f7c30779d217fda..fc9864f85fc2b2f598bcd6edfcc52340f7ccc31c 100644 (file)
                        };
 
                        spi0: spi@10600 {
-                               compatible = "marvell,orion-spi";
+                               compatible = "marvell,armada-390-spi",
+                                               "marvell,orion-spi";
                                reg = <0x10600 0x50>;
                                #address-cells = <1>;
                                #size-cells = <0>;
                        };
 
                        spi1: spi@10680 {
-                               compatible = "marvell,orion-spi";
+                               compatible = "marvell,armada-390-spi",
+                                               "marvell,orion-spi";
                                reg = <0x10680 0x50>;
                                #address-cells = <1>;
                                #size-cells = <0>;
index dfd782b44e506b6fd34a8efbade76b9f94c001c6..60bbfe32bb802d89f016635134f1dfd2b108e902 100644 (file)
                                spi-flash@0 {
                                        #address-cells = <1>;
                                        #size-cells = <1>;
-                                       compatible = "n25q128a13";
+                                       compatible = "n25q128a13", "jedec,spi-nor";
                                        reg = <0>; /* Chip select 0 */
                                        spi-max-frequency = <108000000>;
                                };
index 1037824076189db621c58809ba539693be09e3e0..7dd900f158be6f9be4a5d4074f5bbc880a19bbba 100644 (file)
                                spi-flash@0 {
                                        #address-cells = <1>;
                                        #size-cells = <1>;
-                                       compatible = "m25p64";
+                                       compatible = "m25p64", "jedec,spi-nor";
                                        reg = <0>; /* Chip select 0 */
                                        spi-max-frequency = <20000000>;
                                };
index 565227eacf06092d518d87cc2255a6e65093abaf..bf724ca96a331fa7410e36b7c08169bf360efe92 100644 (file)
                                spi-flash@0 {
                                        #address-cells = <1>;
                                        #size-cells = <1>;
-                                       compatible = "n25q128a13";
+                                       compatible = "n25q128a13", "jedec,spi-nor";
                                        reg = <0>; /* Chip select 0 */
                                        spi-max-frequency = <108000000>;
                                };
index a2cf2154dcdb68d8374c2bea4b136fccaccb7aa2..fdd187c55aa5f78b5ab61d15dc12c1ad001990d2 100644 (file)
 
                internal-regs {
 
+                       rtc@10300 {
+                               /* No crystal connected to the internal RTC */
+                               status = "disabled";
+                       };
+
                        /* J10: VCC, NC, RX, NC, TX, GND  */
                        serial@12000 {
                                status = "okay";
index 6063428fa6a0a8ca378d1a9f00b5689544947758..20267ad2f61eb3679227e4e3afd527b80da87de4 100644 (file)
                                spi-flash@0 {
                                        #address-cells = <1>;
                                        #size-cells = <1>;
-                                       compatible = "micron,n25q064";
+                                       compatible = "micron,n25q064", "jedec,spi-nor";
                                        reg = <0>; /* Chip select 0 */
                                        spi-max-frequency = <20000000>;
 
index 013d63f69e361e60bbe96466bec1883388155889..e78ce4ab6b75b03d4fd0785388b1d4d47c4ef1cd 100644 (file)
                        };
 
                        spi0: spi@10600 {
+                               compatible = "marvell,armada-xp-spi",
+                                               "marvell,orion-spi";
                                pinctrl-0 = <&spi0_pins>;
                                pinctrl-names = "default";
                        };
 
+                       spi1: spi@10680 {
+                               compatible = "marvell,armada-xp-spi",
+                                               "marvell,orion-spi";
+                       };
+
+
                        i2c0: i2c@11000 {
                                compatible = "marvell,mv78230-i2c", "marvell,mv64xxx-i2c";
                                reg = <0x11000 0x100>;
index 5a660d0faf42eac14ccae480f55b60093f238648..b1ad7cf6ac0278aaa5c61845fb3136886e29658b 100644 (file)
@@ -8,6 +8,12 @@
                reg = <0xe000e100 0xc00>;
        };
 
+       systick: timer@e000e010 {
+               compatible = "arm,armv7m-systick";
+               reg = <0xe000e010 0x10>;
+               status = "disabled";
+       };
+
        soc {
                #address-cells = <1>;
                #size-cells = <1>;
diff --git a/arch/arm/boot/dts/at91-ariettag25.dts b/arch/arm/boot/dts/at91-ariettag25.dts
new file mode 100644 (file)
index 0000000..c514502
--- /dev/null
@@ -0,0 +1,79 @@
+/*
+ * Device Tree file for Arietta G25
+ * This device tree is minimal, to activate more peripherals, see:
+ * http://dts.acmesystems.it/arietta/
+ */
+/dts-v1/;
+#include "at91sam9g25.dtsi"
+/ {
+       model = "Acme Systems Arietta G25";
+       compatible = "acme,ariettag25", "atmel,at91sam9x5", "atmel,at91sam9";
+
+       aliases {
+               serial0 = &dbgu;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       memory {
+               reg = <0x20000000 0x8000000>;
+       };
+
+       clocks {
+               slow_xtal {
+                       clock-frequency = <32768>;
+               };
+
+               main_xtal {
+                       clock-frequency = <12000000>;
+               };
+       };
+
+       ahb {
+               apb {
+                       mmc0: mmc@f0008000 {
+                               pinctrl-0 = <
+                                 &pinctrl_mmc0_slot0_clk_cmd_dat0
+                                 &pinctrl_mmc0_slot0_dat1_3>;
+                               status = "okay";
+
+                               slot@0 {
+                                       reg = <0>;
+                                       bus-width = <4>;
+                               };
+                       };
+
+                       usb2: gadget@f803c000 {
+                               status = "okay";
+                       };
+
+                       dbgu: serial@fffff200 {
+                               status = "okay";
+                       };
+
+                       rtc@fffffeb0 {
+                               status = "okay";
+                       };
+               };
+
+               usb0: ohci@00600000 {
+                       status = "okay";
+                       num-ports = <3>;
+               };
+
+               usb1: ehci@00700000 {
+                       status = "okay";
+               };
+       };
+
+       leds {
+               compatible = "gpio-leds";
+               arietta_led {
+                       label = "arietta_led";
+                       gpios = <&pioB 8 GPIO_ACTIVE_HIGH>; /* PB8 */
+                       linux,default-trigger = "heartbeat";
+               };
+       };
+};
diff --git a/arch/arm/boot/dts/at91-kizbox.dts b/arch/arm/boot/dts/at91-kizbox.dts
new file mode 100644 (file)
index 0000000..bf18ece
--- /dev/null
@@ -0,0 +1,159 @@
+/*
+ * at91-kizbox.dts - Device Tree file for Overkiz Kizbox board
+ *
+ * Copyright (C) 2012-2014 Boris BREZILLON <b.brezillon@overkiz.com>
+ *               2014-2015 Gaël PORTAY <g.portay@overkiz.com>
+ *
+ * Licensed under GPLv2 or later.
+ */
+/dts-v1/;
+#include "at91sam9g20.dtsi"
+#include <dt-bindings/pwm/pwm.h>
+
+/ {
+       model = "Overkiz Kizbox";
+       compatible = "overkiz,kizbox", "atmel,at91sam9g20", "atmel,at91sam9";
+
+       chosen {
+               bootargs = "ubi.mtd=ubi";
+               stdout-path = &dbgu;
+       };
+
+       memory {
+               reg = <0x20000000 0x2000000>;
+       };
+
+       clocks {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges;
+
+               main_clock: clock@0 {
+                       compatible = "atmel,osc", "fixed-clock";
+                       clock-frequency = <18432000>;
+               };
+
+               main_xtal {
+                       clock-frequency = <18432000>;
+               };
+       };
+
+       ahb {
+               apb {
+                       macb0: ethernet@fffc4000 {
+                               phy-mode = "mii";
+                               pinctrl-0 = <&pinctrl_macb_rmii
+                                            &pinctrl_macb_rmii_mii_alt>;
+                               status = "okay";
+                       };
+
+                       usart3: serial@fffd0000 {
+                               status = "okay";
+                       };
+
+                       dbgu: serial@fffff200 {
+                               status = "okay";
+                       };
+
+                       watchdog@fffffd40 {
+                               timeout-sec = <15>;
+                               atmel,max-heartbeat-sec = <16>;
+                               atmel,min-heartbeat-sec = <0>;
+                               status = "okay";
+                       };
+               };
+
+               usb0: ohci@00500000 {
+                       num-ports = <1>;
+                       status = "okay";
+               };
+
+               nand0: nand@40000000 {
+                       nand-bus-width = <8>;
+                       nand-ecc-mode = "soft";
+                       status = "okay";
+
+                       bootstrap@0 {
+                               label = "bootstrap";
+                               reg = <0x0 0x20000>;
+                       };
+
+                       ubi@20000 {
+                               label = "ubi";
+                               reg = <0x20000 0x7fe0000>;
+                       };
+               };
+       };
+
+       gpio_keys {
+               compatible = "gpio-keys";
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               reset {
+                       label = "PB_RST";
+                       gpios = <&pioB 30 GPIO_ACTIVE_HIGH>;
+                       linux,code = <0x100>;
+                       gpio-key,wakeup;
+               };
+
+               user {
+                       label = "PB_USER";
+                       gpios = <&pioB 31 GPIO_ACTIVE_HIGH>;
+                       linux,code = <0x101>;
+                       gpio-key,wakeup;
+               };
+       };
+
+       i2c@0 {
+               status = "okay";
+
+               rtc: pcf8563@51 {
+                       compatible = "nxp,pcf8563";
+                       reg = <0x51>;
+               };
+       };
+
+       pwm_leds {
+               compatible = "pwm-leds";
+
+               network_green {
+                       label = "pwm:green:network";
+                       pwms = <&tcb_pwm 2 10000000 PWM_POLARITY_INVERTED>;
+                       max-brightness = <255>;
+                       linux,default-trigger = "default-on";
+               };
+
+               network_red {
+                       label = "pwm:red:network";
+                       pwms = <&tcb_pwm 4 10000000 PWM_POLARITY_INVERTED>;
+                       max-brightness = <255>;
+                       linux,default-trigger = "default-on";
+               };
+
+               user_green {
+                       label = "pwm:green:user";
+                       pwms = <&tcb_pwm 0 10000000 PWM_POLARITY_INVERTED>;
+                       max-brightness = <255>;
+                       linux,default-trigger = "default-on";
+               };
+
+               user_red {
+                       label = "pwm:red:user";
+                       pwms = <&tcb_pwm 1 10000000 PWM_POLARITY_INVERTED>;
+                       max-brightness = <255>;
+                       linux,default-trigger = "default-on";
+               };
+       };
+
+       tcb_pwm: pwm {
+               compatible = "atmel,tcb-pwm";
+               #pwm-cells = <3>;
+               tc-block = <1>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_tcb1_tioa0
+                            &pinctrl_tcb1_tioa1
+                            &pinctrl_tcb1_tioa2
+                            &pinctrl_tcb1_tiob0>;
+       };
+};
diff --git a/arch/arm/boot/dts/at91-kizbox2.dts b/arch/arm/boot/dts/at91-kizbox2.dts
new file mode 100644 (file)
index 0000000..f0b1563
--- /dev/null
@@ -0,0 +1,216 @@
+/*
+ * at91-kizbox2.dts - Device Tree file for Overkiz Kizbox 2 board
+ *
+ * Copyright (C) 2014 Gaël PORTAY <g.portay@overkiz.com>
+ *
+ * Licensed under GPLv2 or later.
+ */
+/dts-v1/;
+#include "sama5d31.dtsi"
+#include <dt-bindings/pwm/pwm.h>
+
+/ {
+       model = "Overkiz Kizbox 2";
+       compatible = "overkiz,kizbox2", "atmel,sama5d31", "atmel,sama5d3", "atmel,sama5";
+
+       chosen {
+               bootargs = "ubi.mtd=ubi";
+               stdout-path = &dbgu;
+       };
+
+       memory {
+               reg = <0x20000000 0x10000000>;
+       };
+
+       clocks {
+               slow_xtal {
+                       clock-frequency = <32768>;
+               };
+
+               main_xtal {
+                       clock-frequency = <12000000>;
+               };
+       };
+
+       ahb {
+               apb {
+                       i2c1: i2c@f0018000 {
+                               status = "okay";
+
+                               pmic: act8865@5b {
+                                       compatible = "active-semi,act8865";
+                                       reg = <0x5b>;
+                                       status = "okay";
+
+                                       regulators {
+                                               vcc_1v8_reg: DCDC_REG1 {
+                                                       regulator-name = "VCC_1V8";
+                                                       regulator-min-microvolt = <1800000>;
+                                                       regulator-max-microvolt = <1800000>;
+                                                       regulator-always-on;
+                                               };
+
+                                               vcc_1v2_reg: DCDC_REG2 {
+                                                       regulator-name = "VCC_1V2";
+                                                       regulator-min-microvolt = <1200000>;
+                                                       regulator-max-microvolt = <1200000>;
+                                                       regulator-always-on;
+                                               };
+
+                                               vcc_3v3_reg: DCDC_REG3 {
+                                                       regulator-name = "VCC_3V3";
+                                                       regulator-min-microvolt = <3300000>;
+                                                       regulator-max-microvolt = <3300000>;
+                                                       regulator-always-on;
+                                               };
+
+                                               vddfuse_reg: LDO_REG1 {
+                                                       regulator-name = "FUSE_2V5";
+                                                       regulator-min-microvolt = <2500000>;
+                                                       regulator-max-microvolt = <2500000>;
+                                               };
+
+                                               vddana_reg: LDO_REG2 {
+                                                       regulator-name = "VDDANA";
+                                                       regulator-min-microvolt = <3300000>;
+                                                       regulator-max-microvolt = <3300000>;
+                                                       regulator-always-on;
+                                               };
+
+                                               vled_reg: LDO_REG3 {
+                                                       regulator-name = "VLED";
+                                                       regulator-min-microvolt = <3300000>;
+                                                       regulator-max-microvolt = <3300000>;
+                                                       regulator-always-on;
+                                               };
+
+                                               v3v8_rf_reg: LDO_REG4 {
+                                                       regulator-name = "V3V8_RF";
+                                                       regulator-min-microvolt = <3800000>;
+                                                       regulator-max-microvolt = <3800000>;
+                                                       regulator-always-on;
+                                               };
+                                       };
+                               };
+                       };
+
+                       usart0: serial@f001c000 {
+                               status = "okay";
+                       };
+
+                       usart1: serial@f0020000 {
+                               status = "okay";
+                       };
+
+                       pwm0: pwm@f002c000 {
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&pinctrl_pwm0_pwmh0_1
+                                            &pinctrl_pwm0_pwmh1_1
+                                            &pinctrl_pwm0_pwmh2_0>;
+                               status = "okay";
+                       };
+
+                       adc0: adc@f8018000 {
+                               atmel,adc-vref = <3333>;
+                               status = "okay";
+                       };
+
+                       usart2: serial@f8020000 {
+                               status = "okay";
+                       };
+
+                       macb1: ethernet@f802c000 {
+                               phy-mode = "rmii";
+                               status = "okay";
+                       };
+
+                       dbgu: serial@ffffee00 {
+                               status = "okay";
+                       };
+
+                       watchdog@fffffe40 {
+                               status = "okay";
+                       };
+               };
+
+               usb1: ohci@00600000 {
+                       status = "okay";
+               };
+
+               usb2: ehci@00700000 {
+                       status = "okay";
+               };
+
+               nand0: nand@60000000 {
+                       nand-bus-width = <8>;
+                       nand-ecc-mode = "hw";
+                       atmel,has-pmecc;
+                       atmel,pmecc-cap = <4>;
+                       atmel,pmecc-sector-size = <512>;
+                       nand-on-flash-bbt;
+                       status = "okay";
+
+                       bootstrap@0 {
+                               label = "bootstrap";
+                               reg = <0x0 0x20000>;
+                       };
+
+                       ubi@20000 {
+                               label = "ubi";
+                               reg = <0x20000 0x7fe0000>;
+                       };
+               };
+       };
+
+       gpio_keys {
+               compatible = "gpio-keys";
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               prog {
+                       label = "PB_PROG";
+                       gpios = <&pioE 27 GPIO_ACTIVE_LOW>;
+                       linux,code = <0x102>;
+                       gpio-key,wakeup;
+               };
+
+               reset {
+                       label = "PB_RST";
+                       gpios = <&pioE 29 GPIO_ACTIVE_LOW>;
+                       linux,code = <0x100>;
+                       gpio-key,wakeup;
+               };
+
+               user {
+                       label = "PB_USER";
+                       gpios = <&pioE 31 GPIO_ACTIVE_HIGH>;
+                       linux,code = <0x101>;
+                       gpio-key,wakeup;
+               };
+       };
+
+       pwm_leds {
+               compatible = "pwm-leds";
+
+               blue {
+                       label = "pwm:blue:user";
+                       pwms = <&pwm0 2 10000000 0>;
+                       max-brightness = <255>;
+                       linux,default-trigger = "default-on";
+               };
+
+               green {
+                       label = "pwm:green:user";
+                       pwms = <&pwm0 1 10000000 0>;
+                       max-brightness = <255>;
+                       linux,default-trigger = "default-on";
+               };
+
+               red {
+                       label = "pwm:red:user";
+                       pwms = <&pwm0 0 10000000 0>;
+                       max-brightness = <255>;
+                       linux,default-trigger = "default-on";
+               };
+       };
+};
diff --git a/arch/arm/boot/dts/at91-kizboxmini.dts b/arch/arm/boot/dts/at91-kizboxmini.dts
new file mode 100644 (file)
index 0000000..9f72b49
--- /dev/null
@@ -0,0 +1,129 @@
+/*
+ * at91-kizboxmini.dts - Device Tree file for Overkiz Kizbox mini board
+ *
+ * Copyright (C) 2014 Gaël PORTAY <g.portay@overkiz.com>
+ *
+ * Licensed under GPLv2 or later.
+ */
+/dts-v1/;
+#include "at91sam9g25.dtsi"
+#include <dt-bindings/pwm/pwm.h>
+
+/ {
+       model = "Overkiz Kizbox mini";
+       compatible = "overkiz,kizboxmini", "atmel,at91sam9g25", "atmel,at91sam9x5", "atmel,at91sam9";
+
+       chosen {
+               bootargs = "ubi.mtd=ubi";
+               stdout-path = &dbgu;
+       };
+
+       memory {
+               reg = <0x20000000 0x8000000>;
+       };
+
+       clocks {
+               slow_xtal {
+                       clock-frequency = <32768>;
+               };
+
+               main_xtal {
+                       clock-frequency = <12000000>;
+               };
+       };
+
+       ahb {
+               apb {
+                       usart0: serial@f801c000 {
+                               status = "okay";
+                       };
+
+                       macb0: ethernet@f802c000 {
+                               phy-mode = "rmii";
+                               status = "okay";
+                       };
+
+                       pwm0: pwm@f8034000 {
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&pinctrl_pwm0_pwm0_1
+                                            &pinctrl_pwm0_pwm1_1>;
+                               status = "okay";
+                       };
+
+                       dbgu: serial@fffff200 {
+                               status = "okay";
+                       };
+
+                       watchdog@fffffe40 {
+                               status = "okay";
+                       };
+               };
+
+               usb0: ohci@00600000 {
+                       num-ports = <1>;
+                       status = "okay";
+               };
+
+               usb1: ehci@00700000 {
+                       status = "okay";
+               };
+
+               nand0: nand@40000000 {
+                       nand-bus-width = <8>;
+                       nand-ecc-mode = "hw";
+                       atmel,has-pmecc;
+                       atmel,pmecc-cap = <4>;
+                       atmel,pmecc-sector-size = <512>;
+                       nand-on-flash-bbt;
+                       status = "okay";
+
+                       bootstrap@0 {
+                               label = "bootstrap";
+                               reg = <0x0 0x20000>;
+                       };
+
+                       ubi@20000 {
+                               label = "ubi";
+                               reg = <0x20000 0x7fe0000>;
+                       };
+               };
+       };
+
+       gpio_keys {
+               compatible = "gpio-keys";
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               prog {
+                       label = "PB_PROG";
+                       gpios = <&pioC 17 GPIO_ACTIVE_LOW>;
+                       linux,code = <0x102>;
+                       gpio-key,wakeup;
+               };
+
+               reset {
+                       label = "PB_RST";
+                       gpios = <&pioC 16 GPIO_ACTIVE_LOW>;
+                       linux,code = <0x100>;
+                       gpio-key,wakeup;
+               };
+       };
+
+       pwm_leds {
+               compatible = "pwm-leds";
+
+               green {
+                       label = "pwm:green:user";
+                       pwms = <&pwm0 0 10000000 0>;
+                       max-brightness = <255>;
+                       linux,default-trigger = "default-on";
+               };
+
+               red {
+                       label = "pwm:red:user";
+                       pwms = <&pwm0 1 10000000 0>;
+                       max-brightness = <255>;
+                       linux,default-trigger = "default-on";
+               };
+       };
+};
index 9991240b7438663d184b6fa31eb04efb36fc3bdc..d81474e0bcd6007eee98ac1a57525dd7cc08d1ac 100644 (file)
@@ -14,7 +14,7 @@
        compatible = "atmel,sama5d3-xplained", "atmel,sama5d3", "atmel,sama5";
 
        chosen {
-               bootargs = "console=ttyS0,115200";
+               stdout-path = "serial0:115200n8";
        };
 
        memory {
@@ -35,6 +35,8 @@
                apb {
                        mmc0: mmc@f0000000 {
                                pinctrl-0 = <&pinctrl_mmc0_clk_cmd_dat0 &pinctrl_mmc0_dat1_3 &pinctrl_mmc0_dat4_7 &pinctrl_mmc0_cd>;
+                               vmmc-supply = <&vcc_mmc0_reg>;
+                               vqmmc-supply = <&vcc_3v3_reg>;
                                status = "okay";
                                slot@0 {
                                        reg = <0>;
                                };
                        };
 
+                       mmc1: mmc@f8000000 {
+                               vmmc-supply = <&vcc_3v3_reg>;
+                               vqmmc-supply = <&vcc_3v3_reg>;
+                               status = "disabled";
+                               slot@0 {
+                                       reg = <0>;
+                                       bus-width = <4>;
+                                       cd-gpios = <&pioE 1 GPIO_ACTIVE_LOW>;
+                               };
+                       };
+
                        spi0: spi@f0004000 {
                                cs-gpios = <&pioD 13 0>, <0>, <0>, <&pioD 16 0>;
                                status = "okay";
 
                        macb0: ethernet@f0028000 {
                                phy-mode = "rgmii";
+                               #address-cells = <1>;
+                               #size-cells = <0>;
                                status = "okay";
+
+                               ethernet-phy@7 {
+                                       reg = <0x7>;
+                               };
                        };
 
                        pwm0: pwm@f002c000 {
                                        };
                                };
                        };
-
-                       pmc: pmc@fffffc00 {
-                               main: mainck {
-                                       clock-frequency = <12000000>;
-                               };
-                       };
                };
 
                nand0: nand@60000000 {
                };
        };
 
+       vcc_mmc0_reg: fixedregulator@0 {
+               compatible = "regulator-fixed";
+               gpio = <&pioE 2 GPIO_ACTIVE_LOW>;
+               regulator-name = "mmc0-card-supply";
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+       };
+
        gpio_keys {
                compatible = "gpio-keys";
 
index c740e1a2a3a5cac2c4d5bbe284815f2a705c8e17..22ad7c95910363ba1beef5a0615497314924ce6c 100644 (file)
@@ -50,7 +50,8 @@
        compatible = "atmel,sama5d4-xplained", "atmel,sama5d4", "atmel,sama5";
 
        chosen {
-               bootargs = "console=ttyS0,115200 ignore_loglevel earlyprintk";
+               bootargs = "ignore_loglevel earlyprintk";
+               stdout-path = "serial0:115200n8";
        };
 
        memory {
                        mmc1: mmc@fc000000 {
                                pinctrl-names = "default";
                                pinctrl-0 = <&pinctrl_mmc1_clk_cmd_dat0 &pinctrl_mmc1_dat1_3 &pinctrl_mmc1_cd>;
+                               vmmc-supply = <&vcc_mmc1_reg>;
+                               vqmmc-supply = <&vcc_3v3_reg>;
                                status = "okay";
                                slot@0 {
                                        reg = <0>;
                                status = "okay";
                        };
 
+                       spi1: spi@fc018000 {
+                               cs-gpios = <&pioB 21 0>;
+                               status = "okay";
+                       };
+
                        adc0: adc@fc034000 {
                                atmel,adc-vref = <3300>;
                                status = "okay";
                        linux,default-trigger = "heartbeat";
                };
        };
+
+       vcc_3v3_reg: fixedregulator@0 {
+               compatible = "regulator-fixed";
+               regulator-name = "VCC 3V3";
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+               regulator-boot-on;
+               regulator-always-on;
+       };
+
+       vcc_mmc1_reg: fixedregulator@1 {
+               compatible = "regulator-fixed";
+               gpio = <&pioE 4 GPIO_ACTIVE_LOW>;
+               regulator-name = "VDD MCI1";
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+               vin-supply = <&vcc_3v3_reg>;
+       };
 };
index 89ef4a540db583015c2825d453e867afd9195852..d782f2926b73928a350bf8ecc0a01dbb24ea0735 100644 (file)
@@ -50,7 +50,8 @@
        compatible = "atmel,sama5d4ek", "atmel,sama5d4", "atmel,sama5";
 
        chosen {
-               bootargs = "console=ttyS0,115200 ignore_loglevel earlyprintk";
+               bootargs = "ignore_loglevel earlyprintk";
+               stdout-path = "serial0:115200n8";
        };
 
        memory {
                        mmc0: mmc@f8000000 {
                                pinctrl-names = "default";
                                pinctrl-0 = <&pinctrl_mmc0_clk_cmd_dat0 &pinctrl_mmc0_dat1_3 &pinctrl_mmc0_cd>;
-                               slot@1 {
-                                       reg = <1>;
+                               slot@0 {
+                                       reg = <0>;
                                        bus-width = <4>;
                                        cd-gpios = <&pioE 5 0>;
                                };
index 4fb333bd1f85f10dcce81e953cf232f1ab14c74f..e3cfb9972f54529ae8fe8c0874dbdc37df05426a 100644 (file)
@@ -92,7 +92,7 @@
                        };
 
                        ramc0: ramc@ffffff00 {
-                               compatible = "atmel,at91rm9200-sdramc";
+                               compatible = "atmel,at91rm9200-sdramc", "syscon";
                                reg = <0xffffff00 0x100>;
                        };
 
                        compatible = "atmel,at91rm9200-ohci", "usb-ohci";
                        reg = <0x00300000 0x100000>;
                        interrupts = <23 IRQ_TYPE_LEVEL_HIGH 2>;
-                       clocks = <&usb>, <&ohci_clk>, <&ohci_clk>, <&uhpck>;
-                       clock-names = "usb_clk", "ohci_clk", "hclk", "uhpck";
+                       clocks = <&ohci_clk>, <&ohci_clk>, <&uhpck>;
+                       clock-names = "ohci_clk", "hclk", "uhpck";
                        status = "disabled";
                };
        };
index 2a5d21247d7ea38a40440e75c009e6f92ee252f2..8dab4b75ca97cfed9beae29bf49224dc71a06bb9 100644 (file)
        model = "Atmel AT91RM9200 evaluation kit";
        compatible = "atmel,at91rm9200ek", "atmel,at91rm9200";
 
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
        memory {
                reg = <0x20000000 0x4000000>;
        };
index d88fe62a2b2e12e41aaeb8058d028b7fa89cd788..4bc34754910280fd1c0dd2a6db06a93b560ed9ba 100644 (file)
                        compatible = "atmel,at91rm9200-ohci", "usb-ohci";
                        reg = <0x00500000 0x100000>;
                        interrupts = <20 IRQ_TYPE_LEVEL_HIGH 2>;
-                       clocks = <&usb>, <&ohci_clk>, <&ohci_clk>, <&uhpck>;
-                       clock-names = "usb_clk", "ohci_clk", "hclk", "uhpck";
+                       clocks = <&ohci_clk>, <&ohci_clk>, <&uhpck>;
+                       clock-names = "ohci_clk", "hclk", "uhpck";
                        status = "disabled";
                };
        };
index bf8d1856a55a55a3668bd69879df1ef2c8d1dd26..b2c44a07a3d0eee7618da3390315f15c0a8daa9a 100644 (file)
@@ -75,8 +75,8 @@
                        compatible = "atmel,at91rm9200-ohci", "usb-ohci";
                        reg = <0x00500000 0x100000>;
                        interrupts = <20 IRQ_TYPE_LEVEL_HIGH 2>;
-                       clocks = <&usb>, <&ohci_clk>, <&hclk0>, <&uhpck>;
-                       clock-names = "usb_clk", "ohci_clk", "hclk", "uhpck";
+                       clocks = <&ohci_clk>, <&hclk0>, <&uhpck>;
+                       clock-names = "ohci_clk", "hclk", "uhpck";
                        status = "disabled";
                };
 
index f4a765729c7aad3e36a82feb7229fa77e2461781..2e92ac020f2383ef58c25a1836b22954834211be 100644 (file)
@@ -13,7 +13,8 @@
        compatible = "atmel,at91sam9261ek", "atmel,at91sam9261", "atmel,at91sam9";
 
        chosen {
-               bootargs = "console=ttyS0,115200 rootfstype=ubifs ubi.mtd=5 root=ubi0:rootfs rw";
+               bootargs = "rootfstype=ubifs ubi.mtd=5 root=ubi0:rootfs rw";
+               stdout-path = "serial0:115200n8";
        };
 
        memory {
index 111889b556cf1e2f52ce002995c20a0e00db8914..e36d966ef5e8868c5d24746c0d4281e8de11e3b1 100644 (file)
                        compatible = "atmel,at91rm9200-ohci", "usb-ohci";
                        reg = <0x00a00000 0x100000>;
                        interrupts = <29 IRQ_TYPE_LEVEL_HIGH 2>;
-                       clocks = <&usb>, <&ohci_clk>, <&ohci_clk>, <&uhpck>;
-                       clock-names = "usb_clk", "ohci_clk", "hclk", "uhpck";
+                       clocks = <&ohci_clk>, <&ohci_clk>, <&uhpck>;
+                       clock-names = "ohci_clk", "hclk", "uhpck";
                        status = "disabled";
                };
        };
index 5cf93eecd8f1a7623b5ccefca6ed5a5fd940a5b2..23381276ffb8016b0dafc1237eb990bad1e775b1 100644 (file)
@@ -13,7 +13,8 @@
        compatible = "atmel,at91sam9263ek", "atmel,at91sam9263", "atmel,at91sam9";
 
        chosen {
-               bootargs = "mem=64M console=ttyS0,115200 root=/dev/mtdblock5 rw rootfstype=ubifs";
+               bootargs = "mem=64M root=/dev/mtdblock5 rw rootfstype=ubifs";
+               stdout-path = "serial0:115200n8";
        };
 
        memory {
index dfaacb113f2ed5b0d01b664b141dcd79c2461c94..57548a2c5a1eb80b0701129f612bf3a785b65928 100644 (file)
@@ -10,7 +10,8 @@
 / {
 
        chosen {
-               bootargs = "mem=64M console=ttyS0,115200 root=/dev/mtdblock5 rw rootfstype=ubifs";
+               bootargs = "mem=64M root=/dev/mtdblock5 rw rootfstype=ubifs";
+               stdout-path = "serial0:115200n8";
        };
 
        memory {
index 70e59c5ceb2f7a56c5bd7e35d0cc9b34cf6a06a4..d260ba779ae53ce671db09142e99c573a23c22dd 100644 (file)
                        compatible = "atmel,at91rm9200-ohci", "usb-ohci";
                        reg = <0x00700000 0x100000>;
                        interrupts = <22 IRQ_TYPE_LEVEL_HIGH 2>;
-                       clocks = <&usb>, <&uhphs_clk>, <&uhphs_clk>, <&uhpck>;
-                       clock-names = "usb_clk", "ohci_clk", "hclk", "uhpck";
+                       clocks = <&uhphs_clk>, <&uhphs_clk>, <&uhpck>;
+                       clock-names = "ohci_clk", "hclk", "uhpck";
                        status = "disabled";
                };
 
                        compatible = "atmel,at91sam9g45-ehci", "usb-ehci";
                        reg = <0x00800000 0x100000>;
                        interrupts = <22 IRQ_TYPE_LEVEL_HIGH 2>;
-                       clocks = <&utmi>, <&uhphs_clk>, <&uhphs_clk>, <&uhpck>;
-                       clock-names = "usb_clk", "ehci_clk", "hclk", "uhpck";
+                       clocks = <&utmi>, <&uhphs_clk>;
+                       clock-names = "usb_clk", "ehci_clk";
                        status = "disabled";
                };
        };
index 33ce7ca2c404d25c263e95b16544d0f33ea2f7a2..1375d33626031d03829b53213502f530e9034f66 100644 (file)
@@ -15,7 +15,8 @@
        compatible = "atmel,at91sam9m10g45ek", "atmel,at91sam9g45", "atmel,at91sam9";
 
        chosen {
-               bootargs = "mem=64M console=ttyS0,115200 root=/dev/mtdblock1 rw rootfstype=jffs2";
+               bootargs = "mem=64M root=/dev/mtdblock1 rw rootfstype=jffs2";
+               stdout-path = "serial0:115200n8";
        };
 
        memory {
index a9e35dfc12d9d5a763e4484f8a331806da13ad63..5c2a8c8c8bd4853ebd49196fb5c8cb6a28bce6b8 100644 (file)
                        compatible = "atmel,at91rm9200-ohci", "usb-ohci";
                        reg = <0x00500000 0x00100000>;
                        interrupts = <22 IRQ_TYPE_LEVEL_HIGH 2>;
-                       clocks = <&usb>, <&uhphs_clk>, <&uhphs_clk>,
-                                <&uhpck>;
-                       clock-names = "usb_clk", "ohci_clk", "hclk", "uhpck";
+                       clocks = <&uhphs_clk>, <&uhphs_clk>, <&uhpck>;
+                       clock-names = "ohci_clk", "hclk", "uhpck";
                        status = "disabled";
                };
        };
index 6e067c8a350252de0d2cd66fd580d94aba0bda59..eab17fcace6d9bb275c9cabc5cd7d14f702c5fb6 100644 (file)
@@ -14,7 +14,8 @@
        compatible = "atmel,at91sam9n12ek", "atmel,at91sam9n12", "atmel,at91sam9";
 
        chosen {
-               bootargs = "console=ttyS0,115200 root=/dev/mtdblock1 rw rootfstype=jffs2";
+               bootargs = "root=/dev/mtdblock1 rw rootfstype=jffs2";
+               stdout-path = "serial0:115200n8";
        };
 
        memory {
index ebfd5ce9cb3867d52c821ca075906b57be86abe8..c9920c64791cf6c1a636dd3c795a03bf89beef9a 100644 (file)
                                };
                        };
 
-                       rtc@fffffeb0 {
-                               compatible = "atmel,at91rm9200-rtc";
-                               reg = <0xfffffeb0 0x40>;
-                               interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
-                               status = "disabled";
-                       };
-
                        rtc@fffffd20 {
                                compatible = "atmel,at91sam9260-rtt";
                                reg = <0xfffffd20 0x10>;
                                reg = <0xfffffd60 0x10>;
                                status = "disabled";
                        };
+
+                       rtc@fffffe00 {
+                               compatible = "atmel,at91rm9200-rtc";
+                               reg = <0xfffffe00 0x40>;
+                               interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
+                               status = "disabled";
+                       };
+
                };
        };
 
index 9be5b540eebf5a6d8f70d377931082a649a2605b..558c9f220bedef3c61ac0b78e3dad2eb76017573 100644 (file)
@@ -13,7 +13,8 @@
        compatible = "atmel,at91sam9rlek", "atmel,at91sam9rl", "atmel,at91sam9";
 
        chosen {
-               bootargs = "console=ttyS0,115200 rootfstype=ubifs root=ubi0:rootfs ubi.mtd=5 rw";
+               bootargs = "rootfstype=ubifs root=ubi0:rootfs ubi.mtd=5 rw";
+               stdout-path = "serial0:115200n8";
        };
 
        memory {
                                };
                        };
 
-                       pmc: pmc@fffffc00 {
-                               main: mainck {
-                                       clock-frequency = <12000000>;
-                               };
+                       watchdog@fffffd40 {
+                               status = "okay";
                        };
 
-                       watchdog@fffffd40 {
+                       rtc@fffffe00 {
                                status = "okay";
                        };
                };
index 3aa56ae3410a5f96692df4d0f9f04238e2c06469..7521bdf17ef25ab133e61f7c7a71fd0a189004d2 100644 (file)
 
                                        pinctrl_usart1_sck: usart1_sck-0 {
                                                atmel,pins =
-                                                       <AT91_PIOC 28 AT91_PERIPH_C AT91_PINCTRL_NONE>; /* PC29 periph C */
+                                                       <AT91_PIOC 29 AT91_PERIPH_C AT91_PINCTRL_NONE>; /* PC29 periph C */
                                        };
                                };
 
                                        };
                                };
 
+                               pwm0 {
+                                       pinctrl_pwm0_pwm0_0: pwm0_pwm0-0 {
+                                               atmel,pins =
+                                                       <AT91_PIOB 11 AT91_PERIPH_B AT91_PINCTRL_NONE>;
+                                       };
+                                       pinctrl_pwm0_pwm0_1: pwm0_pwm0-1 {
+                                               atmel,pins =
+                                                       <AT91_PIOC 10 AT91_PERIPH_C AT91_PINCTRL_NONE>;
+                                       };
+                                       pinctrl_pwm0_pwm0_2: pwm0_pwm0-2 {
+                                               atmel,pins =
+                                                       <AT91_PIOC 18 AT91_PERIPH_C AT91_PINCTRL_NONE>;
+                                       };
+
+                                       pinctrl_pwm0_pwm1_0: pwm0_pwm1-0 {
+                                               atmel,pins =
+                                                       <AT91_PIOB 12 AT91_PERIPH_B AT91_PINCTRL_NONE>;
+                                       };
+                                       pinctrl_pwm0_pwm1_1: pwm0_pwm1-1 {
+                                               atmel,pins =
+                                                       <AT91_PIOC 11 AT91_PERIPH_C AT91_PINCTRL_NONE>;
+                                       };
+                                       pinctrl_pwm0_pwm1_2: pwm0_pwm1-2 {
+                                               atmel,pins =
+                                                       <AT91_PIOC 19 AT91_PERIPH_C AT91_PINCTRL_NONE>;
+                                       };
+
+                                       pinctrl_pwm0_pwm2_0: pwm0_pwm2-0 {
+                                               atmel,pins =
+                                                       <AT91_PIOB 13 AT91_PERIPH_B AT91_PINCTRL_NONE>;
+                                       };
+                                       pinctrl_pwm0_pwm2_1: pwm0_pwm2-1 {
+                                               atmel,pins =
+                                                       <AT91_PIOC 20 AT91_PERIPH_C AT91_PINCTRL_NONE>;
+                                       };
+
+                                       pinctrl_pwm0_pwm3_0: pwm0_pwm3-0 {
+                                               atmel,pins =
+                                                       <AT91_PIOB 14 AT91_PERIPH_B AT91_PINCTRL_NONE>;
+                                       };
+                                       pinctrl_pwm0_pwm3_1: pwm0_pwm3-1 {
+                                               atmel,pins =
+                                                       <AT91_PIOC 21 AT91_PERIPH_C AT91_PINCTRL_NONE>;
+                                       };
+                               };
+
                                tcb0 {
                                        pinctrl_tcb0_tclk0: tcb0_tclk0-0 {
                                                atmel,pins = <AT91_PIOA 24 AT91_PERIPH_A AT91_PINCTRL_NONE>;
                        compatible = "atmel,at91rm9200-ohci", "usb-ohci";
                        reg = <0x00600000 0x100000>;
                        interrupts = <22 IRQ_TYPE_LEVEL_HIGH 2>;
-                       clocks = <&usb>, <&uhphs_clk>, <&uhphs_clk>, <&uhpck>;
-                       clock-names = "usb_clk", "ohci_clk", "hclk", "uhpck";
+                       clocks = <&uhphs_clk>, <&uhphs_clk>, <&uhpck>;
+                       clock-names = "ohci_clk", "hclk", "uhpck";
                        status = "disabled";
                };
 
                        compatible = "atmel,at91sam9g45-ehci", "usb-ehci";
                        reg = <0x00700000 0x100000>;
                        interrupts = <22 IRQ_TYPE_LEVEL_HIGH 2>;
-                       clocks = <&utmi>, <&uhphs_clk>, <&uhpck>;
-                       clock-names = "usb_clk", "ehci_clk", "uhpck";
+                       clocks = <&utmi>, <&uhphs_clk>;
+                       clock-names = "usb_clk", "ehci_clk";
                        status = "disabled";
                };
        };
index cc83a37a7311ba55e2e717ad789d040f65fe98f1..d237c462dfc6b19ac7fc8089ec772aa9fa939631 100644 (file)
@@ -13,7 +13,8 @@
        compatible = "atmel,at91sam9x5ek", "atmel,at91sam9x5", "atmel,at91sam9";
 
        chosen {
-               bootargs = "console=ttyS0,115200 root=/dev/mtdblock1 rw rootfstype=ubifs ubi.mtd=1 root=ubi0:rootfs";
+               bootargs = "root=/dev/mtdblock1 rw rootfstype=ubifs ubi.mtd=1 root=ubi0:rootfs";
+               stdout-path = "serial0:115200n8";
        };
 
        ahb {
index c20cf537f5a534dcbbbacdf3f9192410a757a14d..24c935c72e5e611f3f945744404eae6bd135175f 100644 (file)
  *     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 file; 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
index 7b52c33ea69aedefa667a9a96460a6d5cb4fefc4..e1ac07a16f926e964c61888a2984d2ed037414f6 100644 (file)
                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>;
+
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               brcm,nand-has-wp;
+       };
+
        gic: interrupt-controller@19021000 {
                compatible = "arm,cortex-a9-gic";
                #interrupt-cells = <3>;
index e479515099c3353f92c1257cd08c3c6dcbfcc169..668442b1bda581a49c9f757d0eb2d7019aff1971 100644 (file)
@@ -1,5 +1,5 @@
 /dts-v1/;
-/include/ "bcm2835-rpi.dtsi"
+#include "bcm2835-rpi.dtsi"
 
 / {
        compatible = "raspberrypi,model-b-plus", "brcm,bcm2835";
@@ -25,6 +25,6 @@
        /* I2S interface */
        i2s_alt0: i2s_alt0 {
                brcm,pins = <18 19 20 21>;
-               brcm,function = <4>; /* alt0 */
+               brcm,function = <BCM2835_FSEL_ALT0>;
        };
 };
index bafa46fc226a60d0c77ba6a90c2755a75c060348..ee89b79426cf4d8bdf17b37065e435cf5b1bd632 100644 (file)
@@ -1,5 +1,5 @@
 /dts-v1/;
-/include/ "bcm2835-rpi.dtsi"
+#include "bcm2835-rpi.dtsi"
 
 / {
        compatible = "raspberrypi,model-b", "brcm,bcm2835";
@@ -18,6 +18,6 @@
        /* I2S interface */
        i2s_alt2: i2s_alt2 {
                brcm,pins = <28 29 30 31>;
-               brcm,function = <6>; /* alt2 */
+               brcm,function = <BCM2835_FSEL_ALT2>;
        };
 };
index c7064487017d7e950b058665640a0d73bb4b76e8..46780bb48bbf9cd1d7d0f938a9455a0ce50803f7 100644 (file)
@@ -1,4 +1,4 @@
-/include/ "bcm2835.dtsi"
+#include "bcm2835.dtsi"
 
 / {
        memory {
 
        gpioout: gpioout {
                brcm,pins = <6>;
-               brcm,function = <1>; /* GPIO out */
+               brcm,function = <BCM2835_FSEL_GPIO_OUT>;
        };
 
        alt0: alt0 {
                brcm,pins = <0 1 2 3 4 5 7 8 9 10 11 14 15 40 45>;
-               brcm,function = <4>; /* alt0 */
+               brcm,function = <BCM2835_FSEL_ALT0>;
        };
 
        alt3: alt3 {
                brcm,pins = <48 49 50 51 52 53>;
-               brcm,function = <7>; /* alt3 */
+               brcm,function = <BCM2835_FSEL_ALT3>;
        };
 };
 
index 3342cb1407bc927be59f42ece4410c4b38b4e472..301c73f4ca333d9d1e74d95442cdfdc7165b4719 100644 (file)
@@ -1,4 +1,5 @@
-/include/ "skeleton.dtsi"
+#include <dt-bindings/pinctrl/bcm2835.h>
+#include "skeleton.dtsi"
 
 / {
        compatible = "brcm,bcm2835";
@@ -14,6 +15,7 @@
                #address-cells = <1>;
                #size-cells = <1>;
                ranges = <0x7e000000 0x20000000 0x02000000>;
+               dma-ranges = <0x40000000 0x00000000 0x20000000>;
 
                timer@7e003000 {
                        compatible = "brcm,bcm2835-system-timer";
                        reg = <0x7e104000 0x10>;
                };
 
+               mailbox: mailbox@7e00b800 {
+                       compatible = "brcm,bcm2835-mbox";
+                       reg = <0x7e00b880 0x40>;
+                       interrupts = <0 1>;
+                       #mbox-cells = <0>;
+               };
+
                gpio: gpio@7e200000 {
                        compatible = "brcm,bcm2835-gpio";
                        reg = <0x7e200000 0xb4>;
                        status = "disabled";
                };
 
-               i2c0: i2c@20205000 {
+               i2c0: i2c@7e205000 {
                        compatible = "brcm,bcm2835-i2c";
                        reg = <0x7e205000 0x1000>;
                        interrupts = <2 21>;
diff --git a/arch/arm/boot/dts/bcm4708-asus-rt-ac56u.dts b/arch/arm/boot/dts/bcm4708-asus-rt-ac56u.dts
new file mode 100644 (file)
index 0000000..112a5a8
--- /dev/null
@@ -0,0 +1,97 @@
+/*
+ * Broadcom BCM470X / BCM5301X ARM platform code.
+ * DTS for Asus RT-AC56U
+ *
+ * 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 = "asus,rt-ac56u", "brcm,bcm4708";
+       model = "Asus RT-AC56U (BCM4708)";
+
+       chosen {
+               bootargs = "console=ttyS0,115200";
+       };
+
+       memory {
+               reg = <0x00000000 0x08000000>;
+       };
+
+       leds {
+               compatible = "gpio-leds";
+
+               usb3 {
+                       label = "bcm53xx:blue:usb3";
+                       gpios = <&chipcommon 0 GPIO_ACTIVE_LOW>;
+                       linux,default-trigger = "default-off";
+               };
+
+               wan {
+                       label = "bcm53xx:blue:wan";
+                       gpios = <&chipcommon 1 GPIO_ACTIVE_LOW>;
+                       linux,default-trigger = "default-off";
+               };
+
+               lan {
+                       label = "bcm53xx:blue:lan";
+                       gpios = <&chipcommon 2 GPIO_ACTIVE_LOW>;
+                       linux,default-trigger = "default-off";
+               };
+
+               power {
+                       label = "bcm53xx:blue:power";
+                       gpios = <&chipcommon 3 GPIO_ACTIVE_LOW>;
+                       linux,default-trigger = "default-on";
+               };
+
+               all {
+                       label = "bcm53xx:blue:all";
+                       gpios = <&chipcommon 4 GPIO_ACTIVE_LOW>;
+                       linux,default-trigger = "default-on";
+               };
+
+               2ghz {
+                       label = "bcm53xx:blue:2ghz";
+                       gpios = <&chipcommon 6 GPIO_ACTIVE_LOW>;
+                       linux,default-trigger = "default-off";
+               };
+
+
+               usb2 {
+                       label = "bcm53xx:blue:usb2";
+                       gpios = <&chipcommon 14 GPIO_ACTIVE_LOW>;
+                       linux,default-trigger = "default-off";
+               };
+       };
+
+       gpio-keys {
+               compatible = "gpio-keys";
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               rfkill {
+                       label = "WiFi";
+                       linux,code = <KEY_RFKILL>;
+                       gpios = <&chipcommon 7 GPIO_ACTIVE_LOW>;
+               };
+
+               restart {
+                       label = "Reset";
+                       linux,code = <KEY_RESTART>;
+                       gpios = <&chipcommon 11 GPIO_ACTIVE_LOW>;
+               };
+
+               wps {
+                       label = "WPS";
+                       linux,code = <KEY_WPS_BUTTON>;
+                       gpios = <&chipcommon 15 GPIO_ACTIVE_LOW>;
+               };
+       };
+};
diff --git a/arch/arm/boot/dts/bcm4708-asus-rt-ac68u.dts b/arch/arm/boot/dts/bcm4708-asus-rt-ac68u.dts
new file mode 100644 (file)
index 0000000..3600f56
--- /dev/null
@@ -0,0 +1,84 @@
+/*
+ * Broadcom BCM470X / BCM5301X ARM platform code.
+ * DTS for Asus RT-AC68U
+ *
+ * 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 = "asus,rt-ac68u", "brcm,bcm4708";
+       model = "Asus RT-AC68U (BCM4708)";
+
+       chosen {
+               bootargs = "console=ttyS0,115200";
+       };
+
+       memory {
+               reg = <0x00000000 0x08000000>;
+       };
+
+       leds {
+               compatible = "gpio-leds";
+
+               usb2 {
+                       label = "bcm53xx:blue:usb2";
+                       gpios = <&chipcommon 0 GPIO_ACTIVE_LOW>;
+                       linux,default-trigger = "default-off";
+               };
+
+               power {
+                       label = "bcm53xx:blue:power";
+                       gpios = <&chipcommon 3 GPIO_ACTIVE_LOW>;
+                       linux,default-trigger = "default-on";
+               };
+
+               logo {
+                       label = "bcm53xx:white:logo";
+                       gpios = <&chipcommon 4 GPIO_ACTIVE_LOW>;
+                       linux,default-trigger = "default-on";
+               };
+
+               usb3 {
+                       label = "bcm53xx:blue:usb3";
+                       gpios = <&chipcommon 14 GPIO_ACTIVE_LOW>;
+                       linux,default-trigger = "default-off";
+               };
+       };
+
+       gpio-keys {
+               compatible = "gpio-keys";
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               brightness {
+                       label = "Backlight";
+                       linux,code = <KEY_BRIGHTNESS_ZERO>;
+                       gpios = <&chipcommon 5 GPIO_ACTIVE_LOW>;
+               };
+
+               wps {
+                       label = "WPS";
+                       linux,code = <KEY_WPS_BUTTON>;
+                       gpios = <&chipcommon 7 GPIO_ACTIVE_LOW>;
+               };
+
+               restart {
+                       label = "Reset";
+                       linux,code = <KEY_RESTART>;
+                       gpios = <&chipcommon 11 GPIO_ACTIVE_LOW>;
+               };
+
+               rfkill {
+                       label = "WiFi";
+                       linux,code = <KEY_RFKILL>;
+                       gpios = <&chipcommon 15 GPIO_ACTIVE_LOW>;
+               };
+       };
+};
index b359c1e6178e394177745afa2cd202c8e844edaf..24f0ab59bf1b365b54ce6c1965b1b5a471d78150 100644 (file)
@@ -10,6 +10,7 @@
 /dts-v1/;
 
 #include "bcm4708.dtsi"
+#include "bcm5301x-nand-cs0-bch8.dtsi"
 
 / {
        compatible = "buffalo,wzr-1750dhp", "brcm,bcm4708";
        leds {
                compatible = "gpio-leds";
 
+               usb {
+                       label = "bcm53xx:blue:usb";
+                       gpios = <&hc595 0 GPIO_ACTIVE_HIGH>;
+                       linux,default-trigger = "default-off";
+               };
+
                power0 {
                        label = "bcm53xx:red:power";
                        gpios = <&hc595 1 GPIO_ACTIVE_HIGH>;
index 946c728c4eb7611593fe4e44b815c1f79350e3b4..f039393117178556e4849f2b960a8111ea41b88f 100644 (file)
@@ -10,6 +10,7 @@
 /dts-v1/;
 
 #include "bcm4708.dtsi"
+#include "bcm5301x-nand-cs0-bch8.dtsi"
 
 / {
        compatible = "luxul,xwc-1000", "brcm,bcm4708";
                reg = <0x00000000 0x08000000>;
        };
 
-       axi@18000000 {
-               nand@28000 {
-                       reg = <0x00028000 0x1000>;
-                       #address-cells = <1>;
-                       #size-cells = <1>;
-
+       nand: nand@18028000 {
+               nandcs@0 {
                        partition@0 {
                                label = "ubi";
                                reg = <0x00000000 0x08000000>;
index 2ed9e5794785fb9a8f3e08228fb999e245c4d8de..326ce8f4e49cc13e1495b9d66ac84946740482db 100644 (file)
@@ -10,6 +10,7 @@
 /dts-v1/;
 
 #include "bcm4708.dtsi"
+#include "bcm5301x-nand-cs0-bch8.dtsi"
 
 / {
        compatible = "netgear,r6250v1", "brcm,bcm4708";
index 39910428246a3e3bfdeddc94c7f4a5671bc0651b..3a94606d042b97fdab529833500860d3e70f2076 100644 (file)
@@ -10,6 +10,7 @@
 /dts-v1/;
 
 #include "bcm4708.dtsi"
+#include "bcm5301x-nand-cs0-bch8.dtsi"
 
 / {
        compatible = "netgear,r6300v2", "brcm,bcm4708";
diff --git a/arch/arm/boot/dts/bcm4708-smartrg-sr400ac.dts b/arch/arm/boot/dts/bcm4708-smartrg-sr400ac.dts
new file mode 100644 (file)
index 0000000..d6a033b
--- /dev/null
@@ -0,0 +1,120 @@
+/*
+ * Broadcom BCM470X / BCM5301X arm platform code.
+ * DTS for SmartRG SR400ac
+ *
+ * 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 = "smartrg,sr400ac", "brcm,bcm4708";
+       model = "SmartRG SR400ac";
+
+       chosen {
+               bootargs = "console=ttyS0,115200";
+       };
+
+       memory {
+               reg = <0x00000000 0x08000000>;
+       };
+
+       leds {
+               compatible = "gpio-leds";
+
+               power-white {
+                       label = "bcm53xx:white:power";
+                       gpios = <&chipcommon 1 GPIO_ACTIVE_HIGH>;
+                       linux,default-trigger = "default-on";
+               };
+
+               power-amber {
+                       label = "bcm53xx:amber:power";
+                       gpios = <&chipcommon 2 GPIO_ACTIVE_HIGH>;
+                       linux,default-trigger = "default-off";
+               };
+
+               usb2 {
+                       label = "bcm53xx:white:usb2";
+                       gpios = <&chipcommon 3 GPIO_ACTIVE_HIGH>;
+                       linux,default-trigger = "default-off";
+               };
+
+               usb3-white {
+                       label = "bcm53xx:white:usb3";
+                       gpios = <&chipcommon 4 GPIO_ACTIVE_HIGH>;
+                       linux,default-trigger = "default-off";
+               };
+
+               usb3-green {
+                       label = "bcm53xx:green:usb3";
+                       gpios = <&chipcommon 5 GPIO_ACTIVE_HIGH>;
+                       linux,default-trigger = "default-off";
+               };
+
+               wps {
+                       label = "bcm53xx:white:wps";
+                       gpios = <&chipcommon 6 GPIO_ACTIVE_HIGH>;
+                       linux,default-trigger = "default-off";
+               };
+
+               status-red {
+                       label = "bcm53xx:red:status";
+                       gpios = <&chipcommon 8 GPIO_ACTIVE_HIGH>;
+                       linux,default-trigger = "default-off";
+               };
+
+               status-green {
+                       label = "bcm53xx:green:status";
+                       gpios = <&chipcommon 9 GPIO_ACTIVE_HIGH>;
+                       linux,default-trigger = "default-off";
+               };
+
+               status-blue {
+                       label = "bcm53xx:blue:status";
+                       gpios = <&chipcommon 10 GPIO_ACTIVE_HIGH>;
+                       linux,default-trigger = "default-off";
+               };
+
+               wan-white {
+                       label = "bcm53xx:white:wan";
+                       gpios = <&chipcommon 12 GPIO_ACTIVE_HIGH>;
+                       linux,default-trigger = "default-off";
+               };
+
+               wan-red {
+                       label = "bcm53xx:red:wan";
+                       gpios = <&chipcommon 13 GPIO_ACTIVE_HIGH>;
+                       linux,default-trigger = "default-off";
+               };
+       };
+
+       gpio-keys {
+               compatible = "gpio-keys";
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               rfkill {
+                       label = "WiFi";
+                       linux,code = <KEY_RFKILL>;
+                       gpios = <&chipcommon 0 GPIO_ACTIVE_LOW>;
+               };
+
+               wps {
+                       label = "WPS";
+                       linux,code = <KEY_WPS_BUTTON>;
+                       gpios = <&chipcommon 7 GPIO_ACTIVE_LOW>;
+               };
+
+               restart {
+                       label = "Reset";
+                       linux,code = <KEY_RESTART>;
+                       gpios = <&chipcommon 11 GPIO_ACTIVE_LOW>;
+               };
+       };
+};
index 0ee85ea10bb2b1b5b218833d86b1611f272b2f60..71b98cfaf94427c62fd8ce967c22f2cb508079bf 100644 (file)
@@ -10,6 +10,7 @@
 /dts-v1/;
 
 #include "bcm47081.dtsi"
+#include "bcm5301x-nand-cs0-bch8.dtsi"
 
 / {
        compatible = "asus,rt-n18u", "brcm,bcm47081", "brcm,bcm4708";
index db9131e0326861cd66575c6dffccd30bbfcba833..bb0cb0bfafaf22d07f516d6e36c11aa21547c42a 100644 (file)
@@ -10,6 +10,7 @@
 /dts-v1/;
 
 #include "bcm47081.dtsi"
+#include "bcm5301x-nand-cs0-bch8.dtsi"
 
 / {
        compatible = "buffalo,wzr-600dhp2", "brcm,bcm47081", "brcm,bcm4708";
index 7d6868acb1c63f410ffeb96d1089517c5ce42c38..184fd9214110c6d39a58f32467e4a8b82aaaae24 100644 (file)
@@ -10,6 +10,7 @@
 /dts-v1/;
 
 #include "bcm47081.dtsi"
+#include "bcm5301x-nand-cs0-bch8.dtsi"
 
 / {
        compatible = "buffalo,wzr-900dhp", "brcm,bcm47081", "brcm,bcm4708";
diff --git a/arch/arm/boot/dts/bcm4709-asus-rt-ac87u.dts b/arch/arm/boot/dts/bcm4709-asus-rt-ac87u.dts
new file mode 100644 (file)
index 0000000..aedf3c4
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ * Broadcom BCM470X / BCM5301X ARM platform code.
+ * DTS for Asus RT-AC87U
+ *
+ * Copyright (C) 2015 RafaÅ‚ MiÅ‚ecki <zajec5@gmail.com>
+ *
+ * Licensed under the GNU/GPL. See COPYING for details.
+ */
+
+/dts-v1/;
+
+#include "bcm4708.dtsi"
+
+/ {
+       compatible = "asus,rt-ac87u", "brcm,bcm4709", "brcm,bcm4708";
+       model = "Asus RT-AC87U";
+
+       chosen {
+               bootargs = "console=ttyS0,115200";
+       };
+
+       memory {
+               reg = <0x00000000 0x08000000>;
+       };
+
+       leds {
+               compatible = "gpio-leds";
+
+               wps {
+                       label = "bcm53xx:blue:wps";
+                       gpios = <&chipcommon 1 GPIO_ACTIVE_LOW>;
+                       linux,default-trigger = "default-off";
+               };
+
+               power {
+                       label = "bcm53xx:blue:power";
+                       gpios = <&chipcommon 3 GPIO_ACTIVE_LOW>;
+                       linux,default-trigger = "default-on";
+               };
+
+               wan {
+                       label = "bcm53xx:red:wan";
+                       gpios = <&chipcommon 5 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 2 GPIO_ACTIVE_LOW>;
+               };
+
+               restart {
+                       label = "Reset";
+                       linux,code = <KEY_RESTART>;
+                       gpios = <&chipcommon 11 GPIO_ACTIVE_LOW>;
+               };
+       };
+};
diff --git a/arch/arm/boot/dts/bcm4709-buffalo-wxr-1900dhp.dts b/arch/arm/boot/dts/bcm4709-buffalo-wxr-1900dhp.dts
new file mode 100644 (file)
index 0000000..2a92e8d
--- /dev/null
@@ -0,0 +1,128 @@
+/*
+ * Broadcom BCM470X / BCM5301X ARM platform code.
+ * DTS for Buffalo WXR-1900DHP
+ *
+ * Copyright (C) 2015 Felix Fietkau <nbd@openwrt.org>
+ *
+ * Licensed under the GNU/GPL. See COPYING for details.
+ */
+
+/dts-v1/;
+
+#include "bcm4708.dtsi"
+#include "bcm5301x-nand-cs0-bch8.dtsi"
+
+/ {
+       compatible = "buffalo,wxr-1900dhp", "brcm,bcm4709", "brcm,bcm4708";
+       model = "Buffalo WXR-1900DHP";
+
+       chosen {
+               bootargs = "console=ttyS0,115200";
+       };
+
+       memory {
+               reg = <0x00000000 0x08000000>;
+       };
+
+       leds {
+               compatible = "gpio-leds";
+
+               usb {
+                       label = "bcm53xx:green:usb";
+                       gpios = <&chipcommon 4 GPIO_ACTIVE_HIGH>;
+                       linux,default-trigger = "default-off";
+               };
+
+               power-amber {
+                       label = "bcm53xx:amber:power";
+                       gpios = <&chipcommon 5 GPIO_ACTIVE_HIGH>;
+                       linux,default-trigger = "default-off";
+               };
+
+               power-white {
+                       label = "bcm53xx:white:power";
+                       gpios = <&chipcommon 6 GPIO_ACTIVE_HIGH>;
+                       linux,default-trigger = "default-on";
+               };
+
+               router-amber {
+                       label = "bcm53xx:amber:router";
+                       gpios = <&chipcommon 7 GPIO_ACTIVE_HIGH>;
+                       linux,default-trigger = "default-off";
+               };
+
+               router-white {
+                       label = "bcm53xx:white:router";
+                       gpios = <&chipcommon 8 GPIO_ACTIVE_HIGH>;
+                       linux,default-trigger = "default-off";
+               };
+
+               wan-amber {
+                       label = "bcm53xx:amber:wan";
+                       gpios = <&chipcommon 9 GPIO_ACTIVE_HIGH>;
+                       linux,default-trigger = "default-off";
+               };
+
+               wan-white {
+                       label = "bcm53xx:white:wan";
+                       gpios = <&chipcommon 10 GPIO_ACTIVE_HIGH>;
+                       linux,default-trigger = "default-off";
+               };
+
+               wireless-amber {
+                       label = "bcm53xx:amber:wireless";
+                       gpios = <&chipcommon 11 GPIO_ACTIVE_HIGH>;
+                       linux,default-trigger = "default-off";
+               };
+
+               wireless-white {
+                       label = "bcm53xx:white:wireless";
+                       gpios = <&chipcommon 12 GPIO_ACTIVE_HIGH>;
+                       linux,default-trigger = "default-off";
+               };
+       };
+
+       gpio-keys {
+               compatible = "gpio-keys";
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               power {
+                       label = "Power";
+                       linux,code = <KEY_POWER>;
+                       gpios = <&chipcommon 1 GPIO_ACTIVE_LOW>;
+               };
+
+               restart {
+                       label = "Reset";
+                       linux,code = <KEY_RESTART>;
+                       gpios = <&chipcommon 15 GPIO_ACTIVE_LOW>;
+               };
+
+               aoss {
+                       label = "AOSS";
+                       linux,code = <KEY_WPS_BUTTON>;
+                       gpios = <&chipcommon 16 GPIO_ACTIVE_LOW>;
+               };
+
+               /* Commit mode set by switch? */
+               mode {
+                       label = "Mode";
+                       linux,code = <KEY_SETUP>;
+                       gpios = <&chipcommon 17 GPIO_ACTIVE_LOW>;
+               };
+
+               /* Switch: AP mode */
+               sw_ap {
+                       label = "AP";
+                       linux,code = <BTN_0>;
+                       gpios = <&chipcommon 18 GPIO_ACTIVE_LOW>;
+               };
+
+               eject {
+                       label = "USB eject";
+                       linux,code = <KEY_EJECTCD>;
+                       gpios = <&chipcommon 20 GPIO_ACTIVE_LOW>;
+               };
+       };
+};
index ea26dd3ec03a099a7a62d7b1659550da2df88e3a..446c586cd473e8bc8f18c4a07adec3b01fb75be7 100644 (file)
@@ -10,6 +10,7 @@
 /dts-v1/;
 
 #include "bcm4708.dtsi"
+#include "bcm5301x-nand-cs0-bch8.dtsi"
 
 / {
        compatible = "netgear,r8000", "brcm,bcm4709", "brcm,bcm4708";
diff --git a/arch/arm/boot/dts/bcm5301x-nand-cs0-bch8.dtsi b/arch/arm/boot/dts/bcm5301x-nand-cs0-bch8.dtsi
new file mode 100644 (file)
index 0000000..d10781e
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ * Broadcom BCM470X / BCM5301X Nand chip defaults.
+ *
+ * This should be included if the NAND controller is on chip select 0
+ * and uses 8 bit ECC.
+ *
+ * Copyright (C) 2015 Hauke Mehrtens <hauke@hauke-m.de>
+ *
+ * Licensed under the GNU/GPL. See COPYING for details.
+ */
+
+/ {
+       nand@18028000 {
+               nandcs@0 {
+                       compatible = "brcm,nandcs";
+                       reg = <0>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+
+                       nand-ecc-strength = <8>;
+                       nand-ecc-step-size = <512>;
+               };
+       };
+};
index 78aec6270c2f5f93687f59bf47e9f6c493ea0c31..21fefd4cdc2535a2ce5857c4e3523063c0196808 100644 (file)
                        /* ChipCommon */
                        <0x00000000 0 &gic GIC_SPI 85 IRQ_TYPE_LEVEL_HIGH>,
 
+                       /* PCIe Controller 0 */
+                       <0x00012000 0 &gic GIC_SPI 126 IRQ_TYPE_LEVEL_HIGH>,
+                       <0x00012000 1 &gic GIC_SPI 127 IRQ_TYPE_LEVEL_HIGH>,
+                       <0x00012000 2 &gic GIC_SPI 128 IRQ_TYPE_LEVEL_HIGH>,
+                       <0x00012000 3 &gic GIC_SPI 129 IRQ_TYPE_LEVEL_HIGH>,
+                       <0x00012000 4 &gic GIC_SPI 130 IRQ_TYPE_LEVEL_HIGH>,
+                       <0x00012000 5 &gic GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>,
+
+                       /* PCIe Controller 1 */
+                       <0x00013000 0 &gic GIC_SPI 132 IRQ_TYPE_LEVEL_HIGH>,
+                       <0x00013000 1 &gic GIC_SPI 133 IRQ_TYPE_LEVEL_HIGH>,
+                       <0x00013000 2 &gic GIC_SPI 134 IRQ_TYPE_LEVEL_HIGH>,
+                       <0x00013000 3 &gic GIC_SPI 135 IRQ_TYPE_LEVEL_HIGH>,
+                       <0x00013000 4 &gic GIC_SPI 136 IRQ_TYPE_LEVEL_HIGH>,
+                       <0x00013000 5 &gic GIC_SPI 137 IRQ_TYPE_LEVEL_HIGH>,
+
+                       /* PCIe Controller 2 */
+                       <0x00014000 0 &gic GIC_SPI 138 IRQ_TYPE_LEVEL_HIGH>,
+                       <0x00014000 1 &gic GIC_SPI 138 IRQ_TYPE_LEVEL_HIGH>,
+                       <0x00014000 2 &gic GIC_SPI 140 IRQ_TYPE_LEVEL_HIGH>,
+                       <0x00014000 3 &gic GIC_SPI 141 IRQ_TYPE_LEVEL_HIGH>,
+                       <0x00014000 4 &gic GIC_SPI 142 IRQ_TYPE_LEVEL_HIGH>,
+                       <0x00014000 5 &gic GIC_SPI 143 IRQ_TYPE_LEVEL_HIGH>,
+
                        /* USB 2.0 Controller */
                        <0x00021000 0 &gic GIC_SPI 79 IRQ_TYPE_LEVEL_HIGH>,
 
                        #gpio-cells = <2>;
                };
        };
+
+       nand: nand@18028000 {
+               compatible = "brcm,nand-iproc", "brcm,brcmnand-v6.1", "brcm,brcmnand";
+               reg = <0x18028000 0x600>, <0x1811a408 0x600>, <0x18028f00 0x20>;
+               reg-names = "nand", "iproc-idm", "iproc-ext";
+               interrupts = <GIC_SPI 68 IRQ_TYPE_LEVEL_HIGH>;
+
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               brcm,nand-has-wp;
+       };
 };
index f46329c8ad75c00c068e269565bdb1b931083f47..34cd6405125096e4cd9d830d30487d11c9ff7765 100644 (file)
@@ -26,6 +26,7 @@
                        compatible = "arm,cortex-a9";
                        next-level-cache = <&L2>;
                        reg = <0>;
+                       enable-method = "brcm,bcm63138";
                };
 
                cpu@1 {
@@ -33,6 +34,8 @@
                        compatible = "arm,cortex-a9";
                        next-level-cache = <&L2>;
                        reg = <1>;
+                       enable-method = "brcm,bcm63138";
+                       resets = <&pmb0 4 1>;
                };
        };
 
                        reg = <0x1e620 0x20>;
                        interrupts = <GIC_PPI 14 IRQ_TYPE_LEVEL_HIGH>;
                };
+
+               pmb0: reset-controller@4800c0 {
+                       compatible = "brcm,bcm63138-pmb";
+                       reg = <0x4800c0 0x10>;
+                       #reset-cells = <2>;
+               };
+
+               pmb1: reset-controller@4800e0 {
+                       compatible = "brcm,bcm63138-pmb";
+                       reg = <0x4800e0 0x10>;
+                       #reset-cells = <2>;
+               };
        };
 
        /* Legacy UBUS base */
                #size-cells = <1>;
                ranges = <0 0xfffe8000 0x8100>;
 
+               timer: timer@80 {
+                       compatible = "brcm,bcm6328-timer", "syscon";
+                       reg = <0x80 0x3c>;
+               };
+
                serial0: serial@600 {
                        compatible = "brcm,bcm6345-uart";
                        reg = <0x600 0x1b>;
                        clock-names = "periph";
                        status = "disabled";
                };
+
+               nand: nand@2000 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "brcm,nand-bcm63138", "brcm,brcmnand-v7.0", "brcm,brcmnand";
+                       reg = <0x2000 0x600>, <0xf0 0x10>;
+                       reg-names = "nand", "nand-int-base";
+                       status = "disabled";
+                       interrupts = <GIC_SPI 38 0>;
+                       interrupt-names = "nand";
+               };
+
+               bootlut: bootlut@8000 {
+                       compatible = "brcm,bcm63138-bootlut";
+                       reg = <0x8000 0x50>;
+               };
+
+               reboot {
+                       compatible = "syscon-reboot";
+                       regmap = <&timer>;
+                       offset = <0x34>;
+                       mask = <1>;
+               };
        };
 };
index 9eec2ac1112fdef5cfc1a8cadfc2e2a756f91435..0bb8d17e4c2d037439ecd9165bba6d1b9730febc 100644 (file)
                      <0x00 0x80000000 0x00 0x40000000>;
        };
 };
+
+&nand {
+       status = "okay";
+
+       nandcs@1 {
+               compatible = "brcm,nandcs";
+               reg = <1>;
+               nand-ecc-step-size = <512>;
+               nand-ecc-strength = <8>;
+               nand-on-flash-bbt;
+
+               #size-cells = <2>;
+               #address-cells = <2>;
+
+               flash1.rootfs0@0 {
+                       reg = <0x0 0x0 0x0 0x80000000>;
+               };
+
+               flash1.rootfs1@80000000 {
+                       reg = <0x0 0x80000000 0x0 0x80000000>;
+               };
+       };
+};
index 39ac7840d7eebfafd5be58dc2b3fa5c5b9d6c63b..58dcd666257c001bf33bdded1bcd93f6287332ea 100644 (file)
                        brcm,int-map-mask = <0x25c>, <0x7000000>;
                        brcm,int-fwd-mask = <0x70000>;
                };
+
+               hif_intr2_intc: interrupt-controller@3e1000 {
+                       compatible = "brcm,l2-intc";
+                       reg = <0x3e1000 0x30>;
+                       interrupt-controller;
+                       #interrupt-cells = <1>;
+                       interrupts = <GIC_SPI 0x20 0x0>;
+                       interrupt-parent = <&gic>;
+                       interrupt-names = "hif";
+               };
+
+               nand: nand@3e2800 {
+                       status = "disabled";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "brcm,brcmnand-v7.1", "brcm,brcmnand";
+                       reg-names = "nand", "flash-dma";
+                       reg = <0x3e2800 0x600>, <0x3e3000 0x2c>;
+                       interrupt-parent = <&hif_intr2_intc>;
+                       interrupts = <24>, <4>;
+                       interrupt-names = "nand_ctlrdy", "flash_dma_done";
+               };
+
+               sata@45a000 {
+                       compatible = "brcm,bcm7445-ahci", "brcm,sata3-ahci";
+                       reg-names = "ahci", "top-ctrl";
+                       reg = <0x45a000 0xa9c>, <0x458040 0x24>;
+                       interrupts = <GIC_SPI 30 0>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       sata0: sata-port@0 {
+                               reg = <0>;
+                               phys = <&sata_phy0>;
+                       };
+
+                       sata1: sata-port@1 {
+                               reg = <1>;
+                               phys = <&sata_phy1>;
+                       };
+               };
+
+               sata_phy: sata-phy@458100 {
+                       compatible = "brcm,bcm7445-sata-phy", "brcm,phy-sata3";
+                       reg = <0x458100 0x1f00>;
+                       reg-names = "phy";
+                       #address-cells = <0x1>;
+                       #size-cells = <0x0>;
+
+                       sata_phy0: sata-phy@0 {
+                               reg = <0>;
+                               #phy-cells = <0>;
+                       };
+
+                       sata_phy1: sata-phy@1 {
+                               reg = <1>;
+                               #phy-cells = <0>;
+                       };
+               };
        };
 
        smpboot {
index c9eb8565eac5be2b3d0299218919b4a8a918bd94..2f63052f9d483d8bd5823387beac17c3c1515d13 100644 (file)
        uart3: serial@18023000 {
                status = "okay";
        };
+
+       nand: nand@18046000 {
+               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 69c93395ecd241acd90052d8145f56d0ae8a4896..370aa2cfddf207293a0642e4dce9c9880e7a4e25 100644 (file)
 &serial1 {
        status = "okay";
 };
+
+&nand {
+       status = "okay";
+
+       nandcs@0 {
+               compatible = "brcm,nandcs";
+               reg = <0>;
+               nand-ecc-strength = <4>;
+               nand-ecc-step-size = <512>;
+               brcm,nand-oob-sectors-size = <16>;
+       };
+};
index 86d85d8896a30f8d17895e3545138175eae9e272..5c99fb3a4d1058f172140714b3fad51af71148d3 100644 (file)
@@ -3,9 +3,37 @@
  *
  * Sebastian Hesselbarth <sebastian.hesselbarth@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.
+ * 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 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.
+ *
+ * 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/;
index 63d00a63cfa68003351fe6f1eeed28d4e4873f3e..ef811de0990812e08822e1912673fbaf08b55230 100644 (file)
@@ -6,9 +6,37 @@
  * based on GPL'ed 2.6 kernel sources
  *  (c) Marvell International Ltd.
  *
- * 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.
+ * 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 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.
+ *
+ * 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 "skeleton.dtsi"
@@ -56,7 +84,7 @@
                sdhci0: sdhci@ab0000 {
                        compatible = "mrvl,pxav3-mmc";
                        reg = <0xab0000 0x200>;
-                       clocks = <&chip CLKID_SDIO0XIN>, <&chip CLKID_SDIO0>;
+                       clocks = <&chip_clk CLKID_SDIO0XIN>, <&chip_clk CLKID_SDIO0>;
                        clock-names = "io", "core";
                        interrupts = <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>;
                        status = "disabled";
@@ -65,7 +93,7 @@
                sdhci1: sdhci@ab0800 {
                        compatible = "mrvl,pxav3-mmc";
                        reg = <0xab0800 0x200>;
-                       clocks = <&chip CLKID_SDIO1XIN>, <&chip CLKID_SDIO1>;
+                       clocks = <&chip_clk CLKID_SDIO1XIN>, <&chip_clk CLKID_SDIO1>;
                        clock-names = "io", "core";
                        interrupts = <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>;
                        status = "disabled";
                        compatible = "mrvl,pxav3-mmc";
                        reg = <0xab1000 0x200>;
                        interrupts = <GIC_SPI 28 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&chip CLKID_NFC_ECC>, <&chip CLKID_NFC>;
+                       clocks = <&chip_clk CLKID_NFC_ECC>, <&chip_clk CLKID_NFC>;
                        clock-names = "io", "core";
                        pinctrl-0 = <&emmc_pmux>;
                        pinctrl-names = "default";
                        compatible = "arm,cortex-a9-twd-timer";
                        reg = <0xad0600 0x20>;
                        interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_HIGH)>;
-                       clocks = <&chip CLKID_TWD>;
+                       clocks = <&chip_clk CLKID_TWD>;
                };
 
                eth1: ethernet@b90000 {
                        compatible = "marvell,pxa168-eth";
                        reg = <0xb90000 0x10000>;
-                       clocks = <&chip CLKID_GETH1>;
+                       clocks = <&chip_clk CLKID_GETH1>;
                        interrupts = <GIC_SPI 24 IRQ_TYPE_LEVEL_HIGH>;
                        /* set by bootloader */
                        local-mac-address = [00 00 00 00 00 00];
                eth0: ethernet@e50000 {
                        compatible = "marvell,pxa168-eth";
                        reg = <0xe50000 0x10000>;
-                       clocks = <&chip CLKID_GETH0>;
+                       clocks = <&chip_clk CLKID_GETH0>;
                        interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>;
                        /* set by bootloader */
                        local-mac-address = [00 00 00 00 00 00];
                                compatible = "snps,dw-apb-timer";
                                reg = <0x2c00 0x14>;
                                interrupts = <8>;
-                               clocks = <&chip CLKID_CFG>;
+                               clocks = <&chip_clk CLKID_CFG>;
                                clock-names = "timer";
                                status = "okay";
                        };
                                compatible = "snps,dw-apb-timer";
                                reg = <0x2c14 0x14>;
                                interrupts = <9>;
-                               clocks = <&chip CLKID_CFG>;
+                               clocks = <&chip_clk CLKID_CFG>;
                                clock-names = "timer";
                                status = "okay";
                        };
                                compatible = "snps,dw-apb-timer";
                                reg = <0x2c28 0x14>;
                                interrupts = <10>;
-                               clocks = <&chip CLKID_CFG>;
+                               clocks = <&chip_clk CLKID_CFG>;
                                clock-names = "timer";
                                status = "disabled";
                        };
                                compatible = "snps,dw-apb-timer";
                                reg = <0x2c3c 0x14>;
                                interrupts = <11>;
-                               clocks = <&chip CLKID_CFG>;
+                               clocks = <&chip_clk CLKID_CFG>;
                                clock-names = "timer";
                                status = "disabled";
                        };
                                compatible = "snps,dw-apb-timer";
                                reg = <0x2c50 0x14>;
                                interrupts = <12>;
-                               clocks = <&chip CLKID_CFG>;
+                               clocks = <&chip_clk CLKID_CFG>;
                                clock-names = "timer";
                                status = "disabled";
                        };
                                compatible = "snps,dw-apb-timer";
                                reg = <0x2c64 0x14>;
                                interrupts = <13>;
-                               clocks = <&chip CLKID_CFG>;
+                               clocks = <&chip_clk CLKID_CFG>;
                                clock-names = "timer";
                                status = "disabled";
                        };
                                compatible = "snps,dw-apb-timer";
                                reg = <0x2c78 0x14>;
                                interrupts = <14>;
-                               clocks = <&chip CLKID_CFG>;
+                               clocks = <&chip_clk CLKID_CFG>;
                                clock-names = "timer";
                                status = "disabled";
                        };
                                compatible = "snps,dw-apb-timer";
                                reg = <0x2c8c 0x14>;
                                interrupts = <15>;
-                               clocks = <&chip CLKID_CFG>;
+                               clocks = <&chip_clk CLKID_CFG>;
                                clock-names = "timer";
                                status = "disabled";
                        };
                        compatible = "marvell,berlin2-ahci", "generic-ahci";
                        reg = <0xe90000 0x1000>;
                        interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&chip CLKID_SATA>;
+                       clocks = <&chip_clk CLKID_SATA>;
                        #address-cells = <1>;
                        #size-cells = <0>;
 
                sata_phy: phy@e900a0 {
                        compatible = "marvell,berlin2-sata-phy";
                        reg = <0xe900a0 0x200>;
-                       clocks = <&chip CLKID_SATA>;
+                       clocks = <&chip_clk CLKID_SATA>;
                        #address-cells = <1>;
                        #size-cells = <0>;
                        #phy-cells = <1>;
                };
 
                chip: chip-control@ea0000 {
-                       compatible = "marvell,berlin2-chip-ctrl";
-                       #clock-cells = <1>;
-                       #reset-cells = <2>;
+                       compatible = "simple-mfd", "syscon";
                        reg = <0xea0000 0x400>;
-                       clocks = <&refclk>;
-                       clock-names = "refclk";
 
-                       emmc_pmux: emmc-pmux {
-                               groups = "G26";
-                               function = "emmc";
+                       chip_clk: clock {
+                               compatible = "marvell,berlin2-clk";
+                               #clock-cells = <1>;
+                               clocks = <&refclk>;
+                               clock-names = "refclk";
+                       };
+
+                       soc_pinctrl: pin-controller {
+                               compatible = "marvell,berlin2-soc-pinctrl";
+
+                               emmc_pmux: emmc-pmux {
+                                       groups = "G26";
+                                       function = "emmc";
+                               };
+                       };
+
+                       chip_rst: reset {
+                               compatible = "marvell,berlin2-reset";
+                               #reset-cells = <2>;
                        };
                };
 
                        };
 
                        sysctrl: system-controller@d000 {
-                               compatible = "marvell,berlin2-system-ctrl";
+                               compatible = "simple-mfd", "syscon";
                                reg = <0xd000 0x100>;
 
-                               uart0_pmux: uart0-pmux {
-                                       groups = "GSM4";
-                                       function = "uart0";
-                               };
-
-                               uart1_pmux: uart1-pmux {
-                                       groups = "GSM5";
-                                       function = "uart1";
-                               };
-
-                               uart2_pmux: uart2-pmux {
-                                       groups = "GSM3";
-                                       function = "uart2";
+                               sys_pinctrl: pin-controller {
+                                       compatible = "marvell,berlin2-system-pinctrl";
+                                       uart0_pmux: uart0-pmux {
+                                               groups = "GSM4";
+                                               function = "uart0";
+                                       };
+
+                                       uart1_pmux: uart1-pmux {
+                                               groups = "GSM5";
+                                               function = "uart1";
+                                       };
+                                       uart2_pmux: uart2-pmux {
+                                               groups = "GSM3";
+                                               function = "uart2";
+                                       };
                                };
                        };
 
index 30270be4d0c94704c7c78d64044ac8886af99b0f..772165ad0a5266c24a8cc4ead194cf818aafb85a 100644 (file)
@@ -3,9 +3,37 @@
  *
  * Sebastian Hesselbarth <sebastian.hesselbarth@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.
+ * 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 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.
+ *
+ * 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/;
index 81b670ac494ae5e7d147ba9530b00ccfaa8acd68..900213d78a329aac9fd7f5404ce6c495d184a9c7 100644 (file)
@@ -6,9 +6,37 @@
  * based on GPL'ed 2.6 kernel sources
  *  (c) Marvell International Ltd.
  *
- * 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.
+ * 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 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.
+ *
+ * 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 "skeleton.dtsi"
@@ -53,7 +81,7 @@
                sdhci0: sdhci@ab0000 {
                        compatible = "mrvl,pxav3-mmc";
                        reg = <0xab0000 0x200>;
-                       clocks = <&chip CLKID_SDIO0XIN>, <&chip CLKID_SDIO0>;
+                       clocks = <&chip_clk CLKID_SDIO0XIN>, <&chip_clk CLKID_SDIO0>;
                        clock-names = "io", "core";
                        interrupts = <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>;
                        status = "disabled";
                        compatible = "arm,cortex-a9-twd-timer";
                        reg = <0xad0600 0x20>;
                        interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(1) | IRQ_TYPE_LEVEL_HIGH)>;
-                       clocks = <&chip CLKID_TWD>;
+                       clocks = <&chip_clk CLKID_TWD>;
                };
 
                usb_phy0: usb-phy@b74000 {
                        compatible = "marvell,berlin2cd-usb-phy";
                        reg = <0xb74000 0x128>;
                        #phy-cells = <0>;
-                       resets = <&chip 0x178 23>;
+                       resets = <&chip_rst 0x178 23>;
                        status = "disabled";
                };
 
                        compatible = "marvell,berlin2cd-usb-phy";
                        reg = <0xb78000 0x128>;
                        #phy-cells = <0>;
-                       resets = <&chip 0x178 24>;
+                       resets = <&chip_rst 0x178 24>;
                        status = "disabled";
                };
 
                eth1: ethernet@b90000 {
                        compatible = "marvell,pxa168-eth";
                        reg = <0xb90000 0x10000>;
-                       clocks = <&chip CLKID_GETH1>;
+                       clocks = <&chip_clk CLKID_GETH1>;
                        interrupts = <GIC_SPI 24 IRQ_TYPE_LEVEL_HIGH>;
                        /* set by bootloader */
                        local-mac-address = [00 00 00 00 00 00];
                eth0: ethernet@e50000 {
                        compatible = "marvell,pxa168-eth";
                        reg = <0xe50000 0x10000>;
-                       clocks = <&chip CLKID_GETH0>;
+                       clocks = <&chip_clk CLKID_GETH0>;
                        interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>;
                        /* set by bootloader */
                        local-mac-address = [00 00 00 00 00 00];
                                compatible = "snps,dw-apb-timer";
                                reg = <0x2c00 0x14>;
                                interrupts = <8>;
-                               clocks = <&chip CLKID_CFG>;
+                               clocks = <&chip_clk CLKID_CFG>;
                                clock-names = "timer";
                                status = "okay";
                        };
                                compatible = "snps,dw-apb-timer";
                                reg = <0x2c14 0x14>;
                                interrupts = <9>;
-                               clocks = <&chip CLKID_CFG>;
+                               clocks = <&chip_clk CLKID_CFG>;
                                clock-names = "timer";
                                status = "okay";
                        };
                                compatible = "snps,dw-apb-timer";
                                reg = <0x2c28 0x14>;
                                interrupts = <10>;
-                               clocks = <&chip CLKID_CFG>;
+                               clocks = <&chip_clk CLKID_CFG>;
                                clock-names = "timer";
                                status = "disabled";
                        };
                                compatible = "snps,dw-apb-timer";
                                reg = <0x2c3c 0x14>;
                                interrupts = <11>;
-                               clocks = <&chip CLKID_CFG>;
+                               clocks = <&chip_clk CLKID_CFG>;
                                clock-names = "timer";
                                status = "disabled";
                        };
                                compatible = "snps,dw-apb-timer";
                                reg = <0x2c50 0x14>;
                                interrupts = <12>;
-                               clocks = <&chip CLKID_CFG>;
+                               clocks = <&chip_clk CLKID_CFG>;
                                clock-names = "timer";
                                status = "disabled";
                        };
                                compatible = "snps,dw-apb-timer";
                                reg = <0x2c64 0x14>;
                                interrupts = <13>;
-                               clocks = <&chip CLKID_CFG>;
+                               clocks = <&chip_clk CLKID_CFG>;
                                clock-names = "timer";
                                status = "disabled";
                        };
                                compatible = "snps,dw-apb-timer";
                                reg = <0x2c78 0x14>;
                                interrupts = <14>;
-                               clocks = <&chip CLKID_CFG>;
+                               clocks = <&chip_clk CLKID_CFG>;
                                clock-names = "timer";
                                status = "disabled";
                        };
                                compatible = "snps,dw-apb-timer";
                                reg = <0x2c8c 0x14>;
                                interrupts = <15>;
-                               clocks = <&chip CLKID_CFG>;
+                               clocks = <&chip_clk CLKID_CFG>;
                                clock-names = "timer";
                                status = "disabled";
                        };
                };
 
                chip: chip-control@ea0000 {
-                       compatible = "marvell,berlin2cd-chip-ctrl";
-                       #clock-cells = <1>;
-                       #reset-cells = <2>;
+                       compatible = "simple-mfd", "syscon";
                        reg = <0xea0000 0x400>;
-                       clocks = <&refclk>;
-                       clock-names = "refclk";
 
-                       uart0_pmux: uart0-pmux {
-                               groups = "G6";
-                               function = "uart0";
+                       chip_clk: clock {
+                               compatible = "marvell,berlin2-clk";
+                               #clock-cells = <1>;
+                               clocks = <&refclk>;
+                               clock-names = "refclk";
+                       };
+
+                       soc_pinctrl: pin-controller {
+                               compatible = "marvell,berlin2cd-soc-pinctrl";
+
+                               uart0_pmux: uart0-pmux {
+                                       groups = "G6";
+                                       function = "uart0";
+                               };
+                       };
+
+                       chip_rst: reset {
+                               compatible = "marvell,berlin2-reset";
+                               #reset-cells = <2>;
                        };
                };
 
                        compatible = "chipidea,usb2";
                        reg = <0xed0000 0x200>;
                        interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&chip CLKID_USB0>;
+                       clocks = <&chip_clk CLKID_USB0>;
                        phys = <&usb_phy0>;
                        phy-names = "usb-phy";
                        status = "disabled";
                        compatible = "chipidea,usb2";
                        reg = <0xee0000 0x200>;
                        interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&chip CLKID_USB1>;
+                       clocks = <&chip_clk CLKID_USB1>;
                        phys = <&usb_phy1>;
                        phy-names = "usb-phy";
                        status = "disabled";
                        };
 
                        sysctrl: system-controller@d000 {
-                               compatible = "marvell,berlin2cd-system-ctrl";
+                               compatible = "simple-mfd", "syscon";
                                reg = <0xd000 0x100>;
+
+                               sys_pinctrl: pin-controller {
+                                       compatible = "marvell,berlin2cd-system-pinctrl";
+                               };
                        };
 
                        sic: interrupt-controller@e000 {
index a98ac1bd8f65124fe69d43aa8e8b467a2a7c911c..4a749e5b3b44be637c89e512c34ab9f62903d369 100644 (file)
@@ -1,9 +1,37 @@
 /*
  * Copyright (C) 2014 Antoine Ténart <antoine.tenart@free-electrons.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.
+ * 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 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.
+ *
+ * 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/;
index be5397288d24f355ed2a2ce7f63bc5772d5ccdf9..63a48490e2f9653ff83f7f6202fd993d101b6ec9 100644 (file)
@@ -1,9 +1,37 @@
 /*
  * Copyright (C) 2014 Antoine Ténart <antoine.tenart@free-electrons.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.
+ * 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 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.
+ *
+ * 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/berlin2q.h>
                sdhci0: sdhci@ab0000 {
                        compatible = "mrvl,pxav3-mmc";
                        reg = <0xab0000 0x200>;
-                       clocks = <&chip CLKID_SDIO1XIN>;
+                       clocks = <&chip_clk CLKID_SDIO1XIN>;
                        interrupts = <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>;
                        status = "disabled";
                };
                sdhci1: sdhci@ab0800 {
                        compatible = "mrvl,pxav3-mmc";
                        reg = <0xab0800 0x200>;
-                       clocks = <&chip CLKID_SDIO1XIN>;
+                       clocks = <&chip_clk CLKID_SDIO1XIN>;
                        interrupts = <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>;
                        status = "disabled";
                };
                        compatible = "mrvl,pxav3-mmc";
                        reg = <0xab1000 0x200>;
                        interrupts = <GIC_SPI 28 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&chip CLKID_NFC_ECC>, <&chip CLKID_NFC>;
+                       clocks = <&chip_clk CLKID_NFC_ECC>, <&chip_clk CLKID_NFC>;
                        clock-names = "io", "core";
                        status = "disabled";
                };
                local-timer@ad0600 {
                        compatible = "arm,cortex-a9-twd-timer";
                        reg = <0xad0600 0x20>;
-                       clocks = <&chip CLKID_TWD>;
+                       clocks = <&chip_clk CLKID_TWD>;
                        interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>;
                };
 
                        compatible = "marvell,berlin2-usb-phy";
                        reg = <0xa2f400 0x128>;
                        #phy-cells = <0>;
-                       resets = <&chip 0x104 14>;
+                       resets = <&chip_rst 0x104 14>;
                        status = "disabled";
                };
 
                        compatible = "chipidea,usb2";
                        reg = <0xa30000 0x10000>;
                        interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&chip CLKID_USB2>;
+                       clocks = <&chip_clk CLKID_USB2>;
                        phys = <&usb_phy2>;
                        phy-names = "usb-phy";
                        status = "disabled";
                        compatible = "marvell,berlin2-usb-phy";
                        reg = <0xb74000 0x128>;
                        #phy-cells = <0>;
-                       resets = <&chip 0x104 12>;
+                       resets = <&chip_rst 0x104 12>;
                        status = "disabled";
                };
 
                        compatible = "marvell,berlin2-usb-phy";
                        reg = <0xb78000 0x128>;
                        #phy-cells = <0>;
-                       resets = <&chip 0x104 13>;
+                       resets = <&chip_rst 0x104 13>;
                        status = "disabled";
                };
 
                eth0: ethernet@b90000 {
                        compatible = "marvell,pxa168-eth";
                        reg = <0xb90000 0x10000>;
-                       clocks = <&chip CLKID_GETH0>;
+                       clocks = <&chip_clk CLKID_GETH0>;
                        interrupts = <GIC_SPI 24 IRQ_TYPE_LEVEL_HIGH>;
                        /* set by bootloader */
                        local-mac-address = [00 00 00 00 00 00];
                                reg = <0x1400 0x100>;
                                interrupt-parent = <&aic>;
                                interrupts = <4>;
-                               clocks = <&chip CLKID_CFG>;
+                               clocks = <&chip_clk CLKID_CFG>;
                                pinctrl-0 = <&twsi0_pmux>;
                                pinctrl-names = "default";
                                status = "disabled";
                                reg = <0x1800 0x100>;
                                interrupt-parent = <&aic>;
                                interrupts = <5>;
-                               clocks = <&chip CLKID_CFG>;
+                               clocks = <&chip_clk CLKID_CFG>;
                                pinctrl-0 = <&twsi1_pmux>;
                                pinctrl-names = "default";
                                status = "disabled";
                        timer0: timer@2c00 {
                                compatible = "snps,dw-apb-timer";
                                reg = <0x2c00 0x14>;
-                               clocks = <&chip CLKID_CFG>;
+                               clocks = <&chip_clk CLKID_CFG>;
                                clock-names = "timer";
                                interrupts = <8>;
                        };
                        timer1: timer@2c14 {
                                compatible = "snps,dw-apb-timer";
                                reg = <0x2c14 0x14>;
-                               clocks = <&chip CLKID_CFG>;
+                               clocks = <&chip_clk CLKID_CFG>;
                                clock-names = "timer";
                        };
 
                        timer2: timer@2c28 {
                                compatible = "snps,dw-apb-timer";
                                reg = <0x2c28 0x14>;
-                               clocks = <&chip CLKID_CFG>;
+                               clocks = <&chip_clk CLKID_CFG>;
                                clock-names = "timer";
                                status = "disabled";
                        };
                        timer3: timer@2c3c {
                                compatible = "snps,dw-apb-timer";
                                reg = <0x2c3c 0x14>;
-                               clocks = <&chip CLKID_CFG>;
+                               clocks = <&chip_clk CLKID_CFG>;
                                clock-names = "timer";
                                status = "disabled";
                        };
                        timer4: timer@2c50 {
                                compatible = "snps,dw-apb-timer";
                                reg = <0x2c50 0x14>;
-                               clocks = <&chip CLKID_CFG>;
+                               clocks = <&chip_clk CLKID_CFG>;
                                clock-names = "timer";
                                status = "disabled";
                        };
                        timer5: timer@2c64 {
                                compatible = "snps,dw-apb-timer";
                                reg = <0x2c64 0x14>;
-                               clocks = <&chip CLKID_CFG>;
+                               clocks = <&chip_clk CLKID_CFG>;
                                clock-names = "timer";
                                status = "disabled";
                        };
                        timer6: timer@2c78 {
                                compatible = "snps,dw-apb-timer";
                                reg = <0x2c78 0x14>;
-                               clocks = <&chip CLKID_CFG>;
+                               clocks = <&chip_clk CLKID_CFG>;
                                clock-names = "timer";
                                status = "disabled";
                        };
                        timer7: timer@2c8c {
                                compatible = "snps,dw-apb-timer";
                                reg = <0x2c8c 0x14>;
-                               clocks = <&chip CLKID_CFG>;
+                               clocks = <&chip_clk CLKID_CFG>;
                                clock-names = "timer";
                                status = "disabled";
                        };
                };
 
                chip: chip-control@ea0000 {
-                       compatible = "marvell,berlin2q-chip-ctrl";
-                       #clock-cells = <1>;
-                       #reset-cells = <2>;
+                       compatible = "simple-mfd", "syscon";
                        reg = <0xea0000 0x400>, <0xdd0170 0x10>;
-                       clocks = <&refclk>;
-                       clock-names = "refclk";
 
-                       twsi0_pmux: twsi0-pmux {
-                               groups = "G6";
-                               function = "twsi0";
+                       chip_clk: clock {
+                               compatible = "marvell,berlin2q-clk";
+                               #clock-cells = <1>;
+                               clocks = <&refclk>;
+                               clock-names = "refclk";
+                       };
+
+                       soc_pinctrl: pin-controller {
+                               compatible = "marvell,berlin2q-soc-pinctrl";
+
+                               twsi0_pmux: twsi0-pmux {
+                                       groups = "G6";
+                                       function = "twsi0";
+                               };
+
+                               twsi1_pmux: twsi1-pmux {
+                                       groups = "G7";
+                                       function = "twsi1";
+                               };
                        };
 
-                       twsi1_pmux: twsi1-pmux {
-                               groups = "G7";
-                               function = "twsi1";
+                       chip_rst: reset {
+                               compatible = "marvell,berlin2-reset";
+                               #reset-cells = <2>;
                        };
                };
 
                        compatible = "marvell,berlin2q-ahci", "generic-ahci";
                        reg = <0xe90000 0x1000>;
                        interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&chip CLKID_SATA>;
+                       clocks = <&chip_clk CLKID_SATA>;
                        #address-cells = <1>;
                        #size-cells = <0>;
 
                sata_phy: phy@e900a0 {
                        compatible = "marvell,berlin2q-sata-phy";
                        reg = <0xe900a0 0x200>;
-                       clocks = <&chip CLKID_SATA>;
+                       clocks = <&chip_clk CLKID_SATA>;
                        #address-cells = <1>;
                        #size-cells = <0>;
                        #phy-cells = <1>;
                        compatible = "chipidea,usb2";
                        reg = <0xed0000 0x10000>;
                        interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&chip CLKID_USB0>;
+                       clocks = <&chip_clk CLKID_USB0>;
                        phys = <&usb_phy0>;
                        phy-names = "usb-phy";
                        status = "disabled";
                        compatible = "chipidea,usb2";
                        reg = <0xee0000 0x10000>;
                        interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&chip CLKID_USB1>;
+                       clocks = <&chip_clk CLKID_USB1>;
                        phys = <&usb_phy1>;
                        phy-names = "usb-phy";
                        status = "disabled";
                        };
 
                        sysctrl: pin-controller@d000 {
-                               compatible = "marvell,berlin2q-system-ctrl";
+                               compatible = "simple-mfd", "syscon";
                                reg = <0xd000 0x100>;
 
-                               uart0_pmux: uart0-pmux {
-                                       groups = "GSM12";
-                                       function = "uart0";
-                               };
+                               sys_pinctrl: pin-controller {
+                                       compatible = "marvell,berlin2q-system-pinctrl";
 
-                               uart1_pmux: uart1-pmux {
-                                       groups = "GSM14";
-                                       function = "uart1";
-                               };
+                                       uart0_pmux: uart0-pmux {
+                                               groups = "GSM12";
+                                               function = "uart0";
+                                       };
+
+                                       uart1_pmux: uart1-pmux {
+                                               groups = "GSM14";
+                                               function = "uart1";
+                                       };
+
+                                       twsi2_pmux: twsi2-pmux {
+                                               groups = "GSM13";
+                                               function = "twsi2";
+                                       };
 
-                               twsi2_pmux: twsi2-pmux {
-                                       groups = "GSM13";
-                                       function = "twsi2";
+                                       twsi3_pmux: twsi3-pmux {
+                                               groups = "GSM14";
+                                               function = "twsi3";
+                                       };
                                };
 
-                               twsi3_pmux: twsi3-pmux {
-                                       groups = "GSM14";
-                                       function = "twsi3";
+                               adc: adc {
+                                       compatible = "marvell,berlin2-adc";
+                                       interrupts = <12>, <14>;
+                                       interrupt-names = "adc", "tsen";
                                };
                        };
 
index 490c08075e67a7ca745bd5deb575151c4d1e8c18..af333261d0463eeb7326f7e9537c027527de38a3 100644 (file)
                clocks = <&main_clk>;
        };
 
+       rtc@f0000c30 {
+               compatible = "cnxt,cx92755-rtc";
+               reg = <0xf0000c30 0x18>;
+               interrupts = <25>;
+       };
+
        uc_regs: syscon@f00003a0 {
                compatible = "cnxt,cx92755-uc", "syscon";
                reg = <0xf00003a0 0x10>;
                interrupts = <46>;
                status = "disabled";
        };
+
+       i2c: i2c@f0000120 {
+               compatible = "cnxt,cx92755-i2c";
+               reg = <0xf0000120 0x10>;
+               interrupts = <28>;
+               clocks = <&main_clk>;
+               clock-frequency = <100000>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+               status = "disabled";
+       };
 };
index f33bf5635d47f6d1fddbc942afa8659b2af74409..90d52cc416dcc2202bcac5cf6fc648ddbcf4feab 100644 (file)
@@ -72,3 +72,7 @@
 &uart0 {
        status = "okay";
 };
+
+&i2c {
+       status = "okay";
+};
index de8427be830a32e24a01ace97f11303435528b7b..289806adb343806aefce22e63b6caa1d558741fb 100644 (file)
                        ti,hwmods = "usb_otg_hs";
 
                        usb0: usb@47401000 {
-                               compatible = "ti,musb-am33xx";
+                               compatible = "ti,musb-dm816";
                                reg = <0x47401400 0x400
                                       0x47401000 0x200>;
                                reg-names = "mc", "control";
                        };
 
                        usb1: usb@47401800 {
-                               compatible = "ti,musb-am33xx";
+                               compatible = "ti,musb-dm816";
                                reg = <0x47401c00 0x400
                                       0x47401800 0x200>;
                                reg-names = "mc", "control";
diff --git a/arch/arm/boot/dts/dove-cm-a510.dts b/arch/arm/boot/dts/dove-cm-a510.dts
deleted file mode 100644 (file)
index 50c0d69..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/dts-v1/;
-
-#include "dove.dtsi"
-
-/ {
-       model = "Compulab CM-A510";
-       compatible = "compulab,cm-a510", "marvell,dove";
-
-       memory {
-               device_type = "memory";
-               reg = <0x00000000 0x40000000>;
-       };
-
-       chosen {
-               bootargs = "console=ttyS0,115200n8 earlyprintk";
-       };
-};
-
-&uart0 { status = "okay"; };
-&uart1 { status = "okay"; };
-&sdio0 { status = "okay"; };
-&sdio1 { status = "okay"; };
-&sata0 { status = "okay"; };
-
-&spi0 {
-       status = "okay";
-
-       /* spi0.0: 4M Flash Winbond W25Q32BV */
-       spi-flash@0 {
-               compatible = "st,w25q32";
-               spi-max-frequency = <20000000>;
-               reg = <0>;
-       };
-};
-
-&i2c0 {
-         status = "okay";
-};
diff --git a/arch/arm/boot/dts/dove-cm-a510.dtsi b/arch/arm/boot/dts/dove-cm-a510.dtsi
new file mode 100644 (file)
index 0000000..59b4056
--- /dev/null
@@ -0,0 +1,195 @@
+/*
+ * Device Tree include for Compulab CM-A510 System-on-Module
+ *
+ * Copyright (C) 2015, Sebastian Hesselbarth <sebastian.hesselbarth@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; version 2 of the
+ *     License.
+ *
+ *     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.
+ */
+
+/*
+ * The CM-A510 comes with several optional components:
+ *
+ * Memory options:
+ *  D512: 512M
+ *  D1024: 1G
+ *
+ * NAND options:
+ *  N512: 512M NAND
+ *
+ * Ethernet options:
+ *  E1: PHY RTL8211D on internal GbE (SMI address 0x03)
+ *  E2: Additional ethernet NIC RTL8111D on PCIe1
+ *
+ * Audio options:
+ *  A: TI TLV320AIC23b audio codec (I2C address 0x1a)
+ *
+ * Touchscreen options:
+ *  I: TI TSC2046 touchscreen controller (on SPI1)
+ *
+ * USB options:
+ *  U2: 2 dual-role USB2.0 ports
+ *  U4: 2 additional USB2.0 host ports (via USB1)
+ *
+ * WiFi options:
+ *  W: Broadcom BCM4319 802.11b/g/n (USI WM-N-BM-01 on SDIO1)
+ *
+ * GPIOs used on CM-A510:
+ *   1 GbE PHY reset (active low)
+ *   3 WakeUp
+ *   8 PowerOff (active low)
+ *  13 Touchscreen pen irq (active low)
+ *  65 System LED (active high)
+ *  69 USB Hub reset (active low)
+ *  70 WLAN reset (active low)
+ *  71 WLAN regulator (active high)
+ */
+
+#include "dove.dtsi"
+
+/ {
+       model = "Compulab CM-A510";
+       compatible = "compulab,cm-a510", "marvell,dove";
+
+       /*
+        * Set the minimum memory size here and let the
+        * bootloader set the real size.
+        */
+       memory {
+               device_type = "memory";
+               reg = <0x00000000 0x20000000>;
+       };
+
+       leds {
+               compatible = "gpio-leds";
+               /* Set upper NAND data bit to GPO */
+               pinctrl-0 = <&pmx_nand_gpo>;
+               pinctrl-names = "default";
+
+               system {
+                       label = "cm-a510:system:green";
+                       gpios = <&gpio2 1 GPIO_ACTIVE_HIGH>;
+                       default-state = "keep";
+               };
+       };
+
+       regulators {
+               compatible = "simple-bus";
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               wifi_power: regulator@1 {
+                       compatible = "regulator-fixed";
+                       regulator-name = "WiFi Power";
+                       regulator-min-microvolt = <3300000>;
+                       regulator-max-microvolt = <3300000>;
+                       gpio = <&gpio2 7 GPIO_ACTIVE_HIGH>;
+               };
+       };
+};
+
+/* Optional RTL8211D GbE PHY on SMI address 0x03 */
+&ethphy {
+       reg = <3>;
+       status = "disabled";
+};
+
+&i2c0 {
+       /* Optional TI TLV320AIC23b audio codec */
+       opt_audio: audio@1a {
+               compatible = "ti,tlv320aic23";
+               reg = <0x1a>;
+               status = "disabled";
+       };
+};
+
+/* Optional RTL8111D GbE NIC on PCIe1 */
+&pcie { status = "disabled"; };
+
+&pcie1 {
+       pinctrl-0 = <&pmx_pcie1_clkreq>;
+       pinctrl-names = "default";
+       status = "disabled";
+};
+
+&pinctrl {
+       pmx_uart2: pmx-uart2 {
+               marvell,pins = "mpp14", "mpp15";
+               marvell,function = "uart2";
+       };
+};
+
+/* Optional Broadcom BCM4319 802.11b/g/n WiFi module */
+&sdio1 {
+       non-removable;
+       vmmc-supply = <&wifi_power>;
+       reset-gpio = <&gpio2 6 GPIO_ACTIVE_LOW>;
+       status = "disabled";
+};
+
+&spi0 {
+       status = "okay";
+
+       /* 1M Flash Winbond W25Q80BL */
+       flash@0 {
+               compatible = "winbond,w25q80";
+               spi-max-frequency = <80000000>;
+               reg = <0>;
+       };
+};
+
+&spi1 {
+       pinctrl-0 = <&pmx_spi1_20_23>;
+       pinctrl-names = "default";
+       status = "disabled";
+
+       /* Optional TI TSC2046 touchscreen controller */
+       opt_touch: touchscreen@0 {
+               compatible = "ti,tsc2046";
+               spi-max-frequency = <2500000>;
+               reg = <0>;
+               pinctrl-0 = <&pmx_gpio_13>;
+               pinctrl-names = "default";
+               interrupts-extended = <&gpio0 13 IRQ_TYPE_EDGE_FALLING>;
+       };
+};
+
+&uart2 {
+       pinctrl-0 = <&pmx_uart2>;
+       pinctrl-names = "default";
+};
diff --git a/arch/arm/boot/dts/dove-sbc-a510.dts b/arch/arm/boot/dts/dove-sbc-a510.dts
new file mode 100644 (file)
index 0000000..288e707
--- /dev/null
@@ -0,0 +1,182 @@
+/*
+ * Device Tree file for Compulab SBC-A510 Single Board Computer
+ *
+ * Copyright (C) 2015, Sebastian Hesselbarth <sebastian.hesselbarth@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; version 2 of the
+ *     License.
+ *
+ *     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.
+ */
+
+/*
+ * SBC-A510 comprises a PCA9555 I2C GPIO expander its GPIO lines connected to
+ *
+ * 0.0 USB0 VBUS_EN (active high)
+ * 0.1 USB0 VBUS_GOOD
+ * 0.2 DVI transmitter TI TFP410 MSEN
+ * 0.3 DVI transmitter TI TFP410 PD# (active low power down)
+ * 0.4 LVDS transmitter DS90C365 PD# (active low power down)
+ * 0.5 LCD nRST (active low reset)
+ * 0.6 PCIe0 nRST (active low reset)
+ * 0.7 mini-PCIe slot W_DISABLE#
+ *
+ * 1.0 MMC WP
+ * 1.1 Camera Input FPC FLASH_STB and P21.5
+ * 1.2 Camera Input FPC WE        and P21.22
+ * 1.3 MMC VCC_EN (active high)   and P21.7
+ * 1.4 Camera Input FPC AFTR_RST  and P21.17
+ * 1.5 Camera Input FPC OE        and P21.19
+ * 1.6 Camera Input FPC SNPSHT    and P21.6
+ * 1.7 Camera Input FPC SHTR      and P21.10
+ */
+
+/dts-v1/;
+
+#include "dove-cm-a510.dtsi"
+
+/ {
+       model = "Compulab SBC-A510";
+       compatible = "compulab,sbc-a510", "compulab,cm-a510", "marvell,dove";
+
+       chosen {
+               stdout-path = &uart0;
+       };
+
+       regulators {
+               usb0_power: regulator@2 {
+                       compatible = "regulator-fixed";
+                       regulator-name = "USB Power";
+                       regulator-min-microvolt = <5000000>;
+                       regulator-max-microvolt = <5000000>;
+                       gpio = <&gpio_ext 0 GPIO_ACTIVE_HIGH>;
+               };
+
+               mmc_power: regulator@3 {
+                       compatible = "regulator-fixed";
+                       regulator-name = "MMC Power";
+                       regulator-min-microvolt = <3300000>;
+                       regulator-max-microvolt = <3300000>;
+                       gpio = <&gpio_ext 13 GPIO_ACTIVE_HIGH>;
+               };
+       };
+};
+
+/* Ethernet0 depends on CM-A510 option E1 */
+&mdio { status = "disabled"; };
+&eth { status = "disabled"; };
+&ethphy { status = "disabled"; };
+
+/*
+ * USB port 0 can be powered and monitored by I2C GPIO expander:
+ *  VBUS_ENABLE on GPIO0, VBUS_GOOD on GPIO1
+ */
+&ehci0 {
+       status = "okay";
+       vbus-supply = <&usb0_power>;
+};
+
+/* USB port 1 (and ports 2, 3 if CM-A510 has U4 option) */
+&ehci1 { status = "okay"; };
+
+/*
+ * I2C bus layout:
+ * i2c0:
+ *  - Audio Codec, 0x1a (option from CM-A510)
+ *  - DVI transmitter TI TFP410, 0x39
+ *  - HDMI/DVI DDC channel
+ * i2c1:
+ *  - GPIO expander, NXP PCA9555, 0x20
+ *  - VGA DDC channel
+ */
+&i2c {
+       pinctrl-0 = <&pmx_i2c1>;
+       pinctrl-names = "default";
+};
+
+&i2c0 {
+       /* TI TFP410 DVI transmitter */
+       dvi: video@39 {
+               compatible = "ti,tfp410";
+               reg = <0x39>;
+               powerdown-gpio = <&gpio_ext 3 GPIO_ACTIVE_LOW>;
+       };
+};
+
+&i2c1 {
+       status = "okay";
+
+       /* NXP PCA9555 GPIO expander */
+       gpio_ext: gpio@20 {
+               compatible = "nxp,pca9555";
+               reg = <0x20>;
+               #gpio-cells = <2>;
+       };
+};
+
+&pcie { status = "okay"; };
+
+/*
+ * PCIe0 can be configured by Jumper E1 to be either connected to
+ * a mini-PCIe slot or a Pericom PI7C9X111 PCIe-to-PCI bridge.
+ */
+&pcie0 {
+       status = "okay";
+       pinctrl-0 = <&pmx_pcie0_clkreq>;
+       pinctrl-names = "default";
+       reset-gpios = <&gpio_ext 6 GPIO_ACTIVE_LOW>;
+};
+
+/* Ethernet1 depends on CM-A510 option E2 */
+&pcie1 { status = "disabled"; };
+
+/* SATA connector */
+&sata0 { status = "okay"; };
+
+/*
+ * SDIO0 is connected to a MMC/SD/SDIO socket, I2C GPIO expander has
+ *  VCC_MMC_ENABLE on GPIO13, MMC_WP on GPIO10
+ */
+&sdio0 {
+       vmmc-supply = <&mmc_power>;
+       wp-gpios = <&gpio_ext 10 GPIO_ACTIVE_LOW>;
+       status = "okay";
+};
+
+/* UART0 on RS232 mini-connector */
+&uart0 { status = "okay"; };
+/* UART2 on pin headers */
+&uart2 { status = "okay"; };
index 9ad829523a1350d59bcc795286459d8dfc6c133e..38b1f7e6004e529555fec1f9c9429ba7d243ac93 100644 (file)
                marvell,tauros2-cache-features = <0>;
        };
 
+       i2c-mux {
+               compatible = "i2c-mux-pinctrl";
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               i2c-parent = <&i2c>;
+
+               pinctrl-names = "i2c0", "i2c1", "i2c2";
+               pinctrl-0 = <&pmx_i2cmux_0>;
+               pinctrl-1 = <&pmx_i2cmux_1>;
+               pinctrl-2 = <&pmx_i2cmux_2>;
+
+               i2c0: i2c@0 {
+                       reg = <0>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       status = "okay";
+               };
+
+               i2c1: i2c@1 {
+                       reg = <1>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       /* Requires pmx_i2c1 on i2c controller node */
+                       status = "disabled";
+               };
+
+               i2c2: i2c@2 {
+                       reg = <2>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       /* Requires pmx_i2c2 on i2c controller node */
+                       status = "disabled";
+               };
+       };
+
        mbus {
                compatible = "marvell,dove-mbus", "marvell,mbus", "simple-bus";
                #address-cells = <2>;
                                status = "disabled";
                        };
 
-                       i2c0: i2c-ctrl@11000 {
+                       i2c: i2c-ctrl@11000 {
                                compatible = "marvell,mv64xxx-i2c";
                                reg = <0x11000 0x20>;
                                #address-cells = <1>;
                                clock-frequency = <400000>;
                                timeout-ms = <1000>;
                                clocks = <&core_clk 0>;
-                               status = "disabled";
+                               status = "okay";
                        };
 
                        uart0: serial@12000 {
index 19446273e4a7f83242bf8ead39735462d2b649e7..1dee0aa4f40cc3513f4865bd07ed3fa2ce856cf1 100644 (file)
@@ -81,7 +81,7 @@
                regulator-boot-on;
        };
 
-       lan9220@20000000 {
+       ethernet@20000000 {
                compatible = "smsc,lan9220", "smsc,lan9115";
                reg = <0x20000000 0x10000>;
                phy-mode = "mii";
@@ -96,7 +96,7 @@
 };
 
 &pfc {
-       uart1_pins: uart@e1030000 {
+       uart1_pins: serial@e1030000 {
                renesas,groups = "uart1_ctrl", "uart1_data";
                renesas,function = "uart1";
        };
index 1d483c1c8b48dcd978effc490af4f99a1bfb3fef..a5863acc5fff36aa28e1be183a85fc37883cd186 100644 (file)
@@ -16,6 +16,7 @@
 #include "exynos3250.dtsi"
 #include <dt-bindings/input/input.h>
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/clock/samsung,s2mps11.h>
 
 / {
        model = "Samsung Monk board";
 };
 
 &rtc {
-       clocks = <&cmu CLK_RTC>, <&s2mps14_osc 0>;
+       clocks = <&cmu CLK_RTC>, <&s2mps14_osc S2MPS11_CLK_AP>;
        clock-names = "rtc", "rtc_src";
        status = "okay";
 };
index 0b9906880c0c76546a5704d289a6dafda7a30b43..031853b75528c1043451d9c3fc02adc107f5e325 100644 (file)
@@ -16,6 +16,7 @@
 #include "exynos3250.dtsi"
 #include <dt-bindings/input/input.h>
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/clock/samsung,s2mps11.h>
 
 / {
        model = "Samsung Rinato board";
        status = "okay";
 };
 
+&jpeg {
+       status = "okay";
+};
+
 &mshc_0 {
        #address-cells = <1>;
        #size-cells = <0>;
 };
 
 &rtc {
-       clocks = <&cmu CLK_RTC>, <&s2mps14_osc 0>;
+       clocks = <&cmu CLK_RTC>, <&s2mps14_osc S2MPS11_CLK_AP>;
        clock-names = "rtc", "rtc_src";
        status = "okay";
 };
index e3bfb11c6ef82c3194c22f449e5d1c31ac642631..d7201333e3bcd181d0a0281b3d214a6b5e92265a 100644 (file)
                };
 
                rtc: rtc@10070000 {
-                       compatible = "samsung,exynos3250-rtc";
+                       compatible = "samsung,s3c6410-rtc";
                        reg = <0x10070000 0x100>;
                        interrupts = <0 73 0>, <0 74 0>;
                        interrupt-parent = <&pmu_system_controller>;
                        interrupts = <0 240 0>;
                };
 
+               jpeg: codec@11830000 {
+                       compatible = "samsung,exynos3250-jpeg";
+                       reg = <0x11830000 0x1000>;
+                       interrupts = <0 171 0>;
+                       clocks = <&cmu CLK_JPEG>, <&cmu CLK_SCLK_JPEG>;
+                       clock-names = "jpeg", "sclk";
+                       power-domains = <&pd_cam>;
+                       assigned-clocks = <&cmu CLK_MOUT_CAM_BLK>, <&cmu CLK_SCLK_JPEG>;
+                       assigned-clock-rates = <0>, <150000000>;
+                       assigned-clock-parents = <&cmu CLK_DIV_MPLL_PRE>;
+                       iommus = <&sysmmu_jpeg>;
+                       status = "disabled";
+               };
+
+               sysmmu_jpeg: sysmmu@11A60000 {
+                       compatible = "samsung,exynos-sysmmu";
+                       reg = <0x11a60000 0x1000>;
+                       interrupts = <0 156 0>, <0 161 0>;
+                       clock-names = "sysmmu", "master";
+                       clocks = <&cmu CLK_SMMUJPEG>, <&cmu CLK_JPEG>;
+                       power-domains = <&pd_cam>;
+                       #iommu-cells = <0>;
+               };
+
                fimd: fimd@11c00000 {
                        compatible = "samsung,exynos3250-fimd";
                        reg = <0x11c00000 0x30000>;
                        clocks = <&cmu CLK_SCLK_FIMD0>, <&cmu CLK_FIMD0>;
                        clock-names = "sclk_fimd", "fimd";
                        power-domains = <&pd_lcd0>;
+                       iommus = <&sysmmu_fimd0>;
                        samsung,sysreg = <&sys_reg>;
                        status = "disabled";
                };
                        status = "disabled";
                };
 
+               sysmmu_fimd0: sysmmu@11E20000 {
+                       compatible = "samsung,exynos-sysmmu";
+                       reg = <0x11e20000 0x1000>;
+                       interrupts = <0 80 0>, <0 81 0>;
+                       clock-names = "sysmmu", "master";
+                       clocks = <&cmu CLK_SMMUFIMD0>, <&cmu CLK_FIMD0>;
+                       power-domains = <&pd_lcd0>;
+                       #iommu-cells = <0>;
+               };
+
                hsotg: hsotg@12480000 {
                        compatible = "snps,dwc2";
                        reg = <0x12480000 0x20000>;
                        clock-names = "mfc", "sclk_mfc";
                        clocks = <&cmu CLK_MFC>, <&cmu CLK_SCLK_MFC>;
                        power-domains = <&pd_mfc>;
+                       iommus = <&sysmmu_mfc>;
                        status = "disabled";
                };
 
+               sysmmu_mfc: sysmmu@13620000 {
+                       compatible = "samsung,exynos-sysmmu";
+                       reg = <0x13620000 0x1000>;
+                       interrupts = <0 96 0>, <0 98 0>;
+                       clock-names = "sysmmu", "master";
+                       clocks = <&cmu CLK_SMMUMFC_L>, <&cmu CLK_MFC>;
+                       power-domains = <&pd_mfc>;
+                       #iommu-cells = <0>;
+               };
+
                serial_0: serial@13800000 {
                        compatible = "samsung,exynos4210-uart";
                        reg = <0x13800000 0x100>;
index e20cdc24c3bbd5f71d5f21db7187d0a101324609..f716e2b7d0b9abc596f31fba5a420ec6f7ea5dc8 100644 (file)
@@ -78,7 +78,6 @@
 
        mipi_phy: video-phy@10020710 {
                compatible = "samsung,s5pv210-mipi-video-phy";
-               reg = <0x10020710 8>;
                #phy-cells = <1>;
                syscon = <&pmu_system_controller>;
        };
                        clock-names = "fimc", "sclk_fimc";
                        power-domains = <&pd_cam>;
                        samsung,sysreg = <&sys_reg>;
+                       iommus = <&sysmmu_fimc0>;
                        status = "disabled";
                };
 
                        clock-names = "fimc", "sclk_fimc";
                        power-domains = <&pd_cam>;
                        samsung,sysreg = <&sys_reg>;
+                       iommus = <&sysmmu_fimc1>;
                        status = "disabled";
                };
 
                        clock-names = "fimc", "sclk_fimc";
                        power-domains = <&pd_cam>;
                        samsung,sysreg = <&sys_reg>;
+                       iommus = <&sysmmu_fimc2>;
                        status = "disabled";
                };
 
                        clock-names = "fimc", "sclk_fimc";
                        power-domains = <&pd_cam>;
                        samsung,sysreg = <&sys_reg>;
+                       iommus = <&sysmmu_fimc3>;
                        status = "disabled";
                };
 
                };
        };
 
-       watchdog@10060000 {
+       watchdog: watchdog@10060000 {
                compatible = "samsung,s3c2410-wdt";
                reg = <0x10060000 0x100>;
                interrupts = <0 43 0>;
                status = "disabled";
        };
 
-       rtc@10070000 {
+       rtc: rtc@10070000 {
                compatible = "samsung,s3c6410-rtc";
                reg = <0x10070000 0x100>;
                interrupt-parent = <&pmu_system_controller>;
                status = "disabled";
        };
 
-       keypad@100A0000 {
+       keypad: keypad@100A0000 {
                compatible = "samsung,s5pv210-keypad";
                reg = <0x100A0000 0x100>;
                interrupts = <0 109 0>;
                status = "disabled";
        };
 
-       sdhci@12510000 {
+       sdhci_0: sdhci@12510000 {
                compatible = "samsung,exynos4210-sdhci";
                reg = <0x12510000 0x100>;
                interrupts = <0 73 0>;
                status = "disabled";
        };
 
-       sdhci@12520000 {
+       sdhci_1: sdhci@12520000 {
                compatible = "samsung,exynos4210-sdhci";
                reg = <0x12520000 0x100>;
                interrupts = <0 74 0>;
                status = "disabled";
        };
 
-       sdhci@12530000 {
+       sdhci_2: sdhci@12530000 {
                compatible = "samsung,exynos4210-sdhci";
                reg = <0x12530000 0x100>;
                interrupts = <0 75 0>;
                status = "disabled";
        };
 
-       sdhci@12540000 {
+       sdhci_3: sdhci@12540000 {
                compatible = "samsung,exynos4210-sdhci";
                reg = <0x12540000 0x100>;
                interrupts = <0 76 0>;
                status = "disabled";
        };
 
-       hsotg@12480000 {
+       hsotg: hsotg@12480000 {
                compatible = "samsung,s3c6400-hsotg";
                reg = <0x12480000 0x20000>;
                interrupts = <0 71 0>;
                status = "disabled";
        };
 
-       ehci@12580000 {
+       ehci: ehci@12580000 {
                compatible = "samsung,exynos4210-ehci";
                reg = <0x12580000 0x100>;
                interrupts = <0 70 0>;
                };
        };
 
-       ohci@12590000 {
+       ohci: ohci@12590000 {
                compatible = "samsung,exynos4210-ohci";
                reg = <0x12590000 0x100>;
                interrupts = <0 70 0>;
                power-domains = <&pd_mfc>;
                clocks = <&clock CLK_MFC>, <&clock CLK_SCLK_MFC>;
                clock-names = "mfc", "sclk_mfc";
+               iommus = <&sysmmu_mfc_l>, <&sysmmu_mfc_r>;
+               iommu-names = "left", "right";
                status = "disabled";
        };
 
                status = "disabled";
        };
 
-       pwm@139D0000 {
+       pwm: pwm@139D0000 {
                compatible = "samsung,exynos4210-pwm";
                reg = <0x139D0000 0x1000>;
                interrupts = <0 37 0>, <0 38 0>, <0 39 0>, <0 40 0>, <0 41 0>;
                clocks = <&clock CLK_SCLK_FIMD0>, <&clock CLK_FIMD0>;
                clock-names = "sclk_fimd", "fimd";
                power-domains = <&pd_lcd0>;
+               iommus = <&sysmmu_fimd0>;
                samsung,sysreg = <&sys_reg>;
                status = "disabled";
        };
                #include "exynos4412-tmu-sensor-conf.dtsi"
        };
 
+       jpeg_codec: jpeg-codec@11840000 {
+               compatible = "samsung,exynos4210-jpeg";
+               reg = <0x11840000 0x1000>;
+               interrupts = <0 88 0>;
+               clocks = <&clock CLK_JPEG>;
+               clock-names = "jpeg";
+               power-domains = <&pd_cam>;
+       };
+
        hdmi: hdmi@12D00000 {
                compatible = "samsung,exynos4210-hdmi";
                reg = <0x12D00000 0x70000>;
                interrupts = <0 91 0>;
                reg = <0x12C10000 0x2100>, <0x12c00000 0x300>;
                power-domains = <&pd_tv>;
+               iommus = <&sysmmu_tv>;
                status = "disabled";
        };
 
                clock-names = "ppmu";
                status = "disabled";
        };
+
+       sysmmu_mfc_l: sysmmu@13620000 {
+               compatible = "samsung,exynos-sysmmu";
+               reg = <0x13620000 0x1000>;
+               interrupt-parent = <&combiner>;
+               interrupts = <5 5>;
+               clock-names = "sysmmu", "master";
+               clocks = <&clock CLK_SMMU_MFCL>, <&clock CLK_MFC>;
+               power-domains = <&pd_mfc>;
+               #iommu-cells = <0>;
+       };
+
+       sysmmu_mfc_r: sysmmu@13630000 {
+               compatible = "samsung,exynos-sysmmu";
+               reg = <0x13630000 0x1000>;
+               interrupt-parent = <&combiner>;
+               interrupts = <5 6>;
+               clock-names = "sysmmu", "master";
+               clocks = <&clock CLK_SMMU_MFCR>, <&clock CLK_MFC>;
+               power-domains = <&pd_mfc>;
+               #iommu-cells = <0>;
+       };
+
+       sysmmu_tv: sysmmu@12E20000 {
+               compatible = "samsung,exynos-sysmmu";
+               reg = <0x12E20000 0x1000>;
+               interrupt-parent = <&combiner>;
+               interrupts = <5 4>;
+               clock-names = "sysmmu", "master";
+               clocks = <&clock CLK_SMMU_TV>, <&clock CLK_MIXER>;
+               power-domains = <&pd_tv>;
+               #iommu-cells = <0>;
+       };
+
+       sysmmu_fimc0: sysmmu@11A20000 {
+               compatible = "samsung,exynos-sysmmu";
+               reg = <0x11A20000 0x1000>;
+               interrupt-parent = <&combiner>;
+               interrupts = <4 2>;
+               clock-names = "sysmmu", "master";
+               clocks = <&clock CLK_SMMU_FIMC0>, <&clock CLK_FIMC0>;
+               power-domains = <&pd_cam>;
+               #iommu-cells = <0>;
+       };
+
+       sysmmu_fimc1: sysmmu@11A30000 {
+               compatible = "samsung,exynos-sysmmu";
+               reg = <0x11A30000 0x1000>;
+               interrupt-parent = <&combiner>;
+               interrupts = <4 3>;
+               clock-names = "sysmmu", "master";
+               clocks = <&clock CLK_SMMU_FIMC1>, <&clock CLK_FIMC1>;
+               power-domains = <&pd_cam>;
+               #iommu-cells = <0>;
+       };
+
+       sysmmu_fimc2: sysmmu@11A40000 {
+               compatible = "samsung,exynos-sysmmu";
+               reg = <0x11A40000 0x1000>;
+               interrupt-parent = <&combiner>;
+               interrupts = <4 4>;
+               clock-names = "sysmmu", "master";
+               clocks = <&clock CLK_SMMU_FIMC2>, <&clock CLK_FIMC2>;
+               power-domains = <&pd_cam>;
+               #iommu-cells = <0>;
+       };
+
+       sysmmu_fimc3: sysmmu@11A50000 {
+               compatible = "samsung,exynos-sysmmu";
+               reg = <0x11A50000 0x1000>;
+               interrupt-parent = <&combiner>;
+               interrupts = <4 5>;
+               clock-names = "sysmmu", "master";
+               clocks = <&clock CLK_SMMU_FIMC3>, <&clock CLK_FIMC3>;
+               power-domains = <&pd_cam>;
+               #iommu-cells = <0>;
+       };
+
+       sysmmu_jpeg: sysmmu@11A60000 {
+               compatible = "samsung,exynos-sysmmu";
+               reg = <0x11A60000 0x1000>;
+               interrupt-parent = <&combiner>;
+               interrupts = <4 6>;
+               clock-names = "sysmmu", "master";
+               clocks = <&clock CLK_SMMU_JPEG>, <&clock CLK_JPEG>;
+               power-domains = <&pd_cam>;
+               #iommu-cells = <0>;
+       };
+
+       sysmmu_rotator: sysmmu@12A30000 {
+               compatible = "samsung,exynos-sysmmu";
+               reg = <0x12A30000 0x1000>;
+               interrupt-parent = <&combiner>;
+               interrupts = <5 0>;
+               clock-names = "sysmmu", "master";
+               clocks = <&clock CLK_SMMU_ROTATOR>, <&clock CLK_ROTATOR>;
+               power-domains = <&pd_lcd0>;
+               #iommu-cells = <0>;
+       };
+
+       sysmmu_fimd0: sysmmu@11E20000 {
+               compatible = "samsung,exynos-sysmmu";
+               reg = <0x11E20000 0x1000>;
+               interrupt-parent = <&combiner>;
+               interrupts = <5 2>;
+               clock-names = "sysmmu", "master";
+               clocks = <&clock CLK_SMMU_FIMD0>, <&clock CLK_FIMD0>;
+               power-domains = <&pd_lcd0>;
+               #iommu-cells = <0>;
+       };
 };
index b811461414023fa293c75130d30d840fa4e5d3af..e0abfc3324d11eaed33838be9c04b7f1a167f5fb 100644 (file)
                };
        };
 
-       watchdog@10060000 {
-               status = "okay";
-       };
-
-       rtc@10070000 {
-               status = "okay";
-       };
-
-       tmu@100C0000 {
-               status = "okay";
-       };
-
-       sdhci@12530000 {
-               bus-width = <4>;
-               pinctrl-0 = <&sd2_clk &sd2_cmd &sd2_bus4 &sd2_cd>;
-               pinctrl-names = "default";
-               vmmc-supply = <&mmc_reg>;
-               status = "okay";
-       };
-
-       sdhci@12510000 {
-               bus-width = <4>;
-               pinctrl-0 = <&sd0_clk &sd0_cmd &sd0_bus4 &sd0_cd>;
-               pinctrl-names = "default";
-               vmmc-supply = <&mmc_reg>;
-               status = "okay";
-       };
-
-       g2d@12800000 {
-               status = "okay";
-       };
-
-       codec@13400000 {
-               samsung,mfc-r = <0x43000000 0x800000>;
-               samsung,mfc-l = <0x51000000 0x800000>;
-               status = "okay";
-       };
-
-       serial@13800000 {
-               status = "okay";
-       };
-
-       serial@13810000 {
-               status = "okay";
-       };
-
-       serial@13820000 {
-               status = "okay";
-       };
-
-       serial@13830000 {
-               status = "okay";
-       };
-
-       i2c@13860000 {
-               status = "okay";
-               samsung,i2c-sda-delay = <100>;
-               samsung,i2c-max-bus-freq = <20000>;
-               pinctrl-0 = <&i2c0_bus>;
-               pinctrl-names = "default";
-
-               max8997_pmic@66 {
-                       compatible = "maxim,max8997-pmic";
-                       reg = <0x66>;
-                       interrupt-parent = <&gpx0>;
-                       interrupts = <4 0>, <3 0>;
-
-                       max8997,pmic-buck1-dvs-voltage = <1350000>;
-                       max8997,pmic-buck2-dvs-voltage = <1100000>;
-                       max8997,pmic-buck5-dvs-voltage = <1200000>;
-
-                       regulators {
-                               ldo1_reg: LDO1 {
-                                       regulator-name = "VDD_ABB_3.3V";
-                                       regulator-min-microvolt = <3300000>;
-                                       regulator-max-microvolt = <3300000>;
-                               };
-
-                               ldo2_reg: LDO2 {
-                                       regulator-name = "VDD_ALIVE_1.1V";
-                                       regulator-min-microvolt = <1100000>;
-                                       regulator-max-microvolt = <1100000>;
-                                       regulator-always-on;
-                               };
-
-                               ldo3_reg: LDO3 {
-                                       regulator-name = "VMIPI_1.1V";
-                                       regulator-min-microvolt = <1100000>;
-                                       regulator-max-microvolt = <1100000>;
-                               };
-
-                               ldo4_reg: LDO4 {
-                                       regulator-name = "VDD_RTC_1.8V";
-                                       regulator-min-microvolt = <1800000>;
-                                       regulator-max-microvolt = <1800000>;
-                                       regulator-always-on;
-                               };
-
-                               ldo6_reg: LDO6 {
-                                       regulator-name = "VMIPI_1.8V";
-                                       regulator-min-microvolt = <1800000>;
-                                       regulator-max-microvolt = <1800000>;
-                                       regulator-always-on;
-                               };
-
-                               ldo7_reg: LDO7 {
-                                       regulator-name = "VDD_AUD_1.8V";
-                                       regulator-min-microvolt = <1800000>;
-                                       regulator-max-microvolt = <1800000>;
-                               };
-
-                               ldo8_reg: LDO8 {
-                                       regulator-name = "VADC_3.3V";
-                                       regulator-min-microvolt = <3300000>;
-                                       regulator-max-microvolt = <3300000>;
-                               };
-
-                               ldo9_reg: LDO9 {
-                                       regulator-name = "DVDD_SWB_2.8V";
-                                       regulator-min-microvolt = <2800000>;
-                                       regulator-max-microvolt = <2800000>;
-                                       regulator-always-on;
-                               };
-
-                               ldo10_reg: LDO10 {
-                                       regulator-name = "VDD_PLL_1.1V";
-                                       regulator-min-microvolt = <1100000>;
-                                       regulator-max-microvolt = <1100000>;
-                                       regulator-always-on;
-                               };
-
-                               ldo11_reg: LDO11 {
-                                       regulator-name = "VDD_AUD_3V";
-                                       regulator-min-microvolt = <3000000>;
-                                       regulator-max-microvolt = <3000000>;
-                               };
-
-                               ldo14_reg: LDO14 {
-                                       regulator-name = "AVDD18_SWB_1.8V";
-                                       regulator-min-microvolt = <1800000>;
-                                       regulator-max-microvolt = <1800000>;
-                                       regulator-always-on;
-                               };
-
-                               ldo17_reg: LDO17 {
-                                       regulator-name = "VDD_SWB_3.3V";
-                                       regulator-min-microvolt = <3300000>;
-                                       regulator-max-microvolt = <3300000>;
-                                       regulator-always-on;
-                               };
-
-                               ldo21_reg: LDO21 {
-                                       regulator-name = "VDD_MIF_1.2V";
-                                       regulator-min-microvolt = <1200000>;
-                                       regulator-max-microvolt = <1200000>;
-                                       regulator-always-on;
-                               };
-
-                               buck1_reg: BUCK1 {
-                                       /*
-                                       * HACK: The real name is VDD_ARM_1.2V,
-                                       * but exynos-cpufreq does not support
-                                       * DT-based regulator lookup yet.
-                                       */
-                                       regulator-name = "vdd_arm";
-                                       regulator-min-microvolt = <950000>;
-                                       regulator-max-microvolt = <1350000>;
-                                       regulator-always-on;
-                                       regulator-boot-on;
-                               };
-
-                               buck2_reg: BUCK2 {
-                                       regulator-name = "VDD_INT_1.1V";
-                                       regulator-min-microvolt = <900000>;
-                                       regulator-max-microvolt = <1100000>;
-                                       regulator-always-on;
-                                       regulator-boot-on;
-                               };
-
-                               buck3_reg: BUCK3 {
-                                       regulator-name = "VDD_G3D_1.1V";
-                                       regulator-min-microvolt = <900000>;
-                                       regulator-max-microvolt = <1100000>;
-                               };
-
-                               buck5_reg: BUCK5 {
-                                       regulator-name = "VDDQ_M1M2_1.2V";
-                                       regulator-min-microvolt = <1200000>;
-                                       regulator-max-microvolt = <1200000>;
-                                       regulator-always-on;
-                               };
-
-                               buck7_reg: BUCK7 {
-                                       regulator-name = "VDD_LCD_3.3V";
-                                       regulator-min-microvolt = <3300000>;
-                                       regulator-max-microvolt = <3300000>;
-                                       regulator-boot-on;
-                                       regulator-always-on;
-                               };
-                       };
-               };
-       };
-
        gpio_keys {
                compatible = "gpio-keys";
                #address-cells = <1>;
                };
        };
 
-       fimd@11c00000 {
-               pinctrl-0 = <&lcd_en &lcd_clk &lcd_data24 &pwm0_out>;
-               pinctrl-names = "default";
-               status = "okay";
-       };
-
        display-timings {
                native-mode = <&timing0>;
                timing0: timing {
                };
        };
 };
+
+&fimd {
+       pinctrl-0 = <&lcd_en &lcd_clk &lcd_data24 &pwm0_out>;
+       pinctrl-names = "default";
+       status = "okay";
+};
+
+&g2d {
+       status = "okay";
+};
+
+&i2c_0 {
+       status = "okay";
+       samsung,i2c-sda-delay = <100>;
+       samsung,i2c-max-bus-freq = <20000>;
+       pinctrl-0 = <&i2c0_bus>;
+       pinctrl-names = "default";
+
+       max8997_pmic@66 {
+               compatible = "maxim,max8997-pmic";
+               reg = <0x66>;
+               interrupt-parent = <&gpx0>;
+               interrupts = <4 0>, <3 0>;
+
+               max8997,pmic-buck1-dvs-voltage = <1350000>;
+               max8997,pmic-buck2-dvs-voltage = <1100000>;
+               max8997,pmic-buck5-dvs-voltage = <1200000>;
+
+               regulators {
+                       ldo1_reg: LDO1 {
+                               regulator-name = "VDD_ABB_3.3V";
+                               regulator-min-microvolt = <3300000>;
+                               regulator-max-microvolt = <3300000>;
+                       };
+
+                       ldo2_reg: LDO2 {
+                               regulator-name = "VDD_ALIVE_1.1V";
+                               regulator-min-microvolt = <1100000>;
+                               regulator-max-microvolt = <1100000>;
+                               regulator-always-on;
+                       };
+
+                       ldo3_reg: LDO3 {
+                               regulator-name = "VMIPI_1.1V";
+                               regulator-min-microvolt = <1100000>;
+                               regulator-max-microvolt = <1100000>;
+                       };
+
+                       ldo4_reg: LDO4 {
+                               regulator-name = "VDD_RTC_1.8V";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-always-on;
+                       };
+
+                       ldo6_reg: LDO6 {
+                               regulator-name = "VMIPI_1.8V";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-always-on;
+                       };
+
+                       ldo7_reg: LDO7 {
+                               regulator-name = "VDD_AUD_1.8V";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                       };
+
+                       ldo8_reg: LDO8 {
+                               regulator-name = "VADC_3.3V";
+                               regulator-min-microvolt = <3300000>;
+                               regulator-max-microvolt = <3300000>;
+                       };
+
+                       ldo9_reg: LDO9 {
+                               regulator-name = "DVDD_SWB_2.8V";
+                               regulator-min-microvolt = <2800000>;
+                               regulator-max-microvolt = <2800000>;
+                               regulator-always-on;
+                       };
+
+                       ldo10_reg: LDO10 {
+                               regulator-name = "VDD_PLL_1.1V";
+                               regulator-min-microvolt = <1100000>;
+                               regulator-max-microvolt = <1100000>;
+                               regulator-always-on;
+                       };
+
+                       ldo11_reg: LDO11 {
+                               regulator-name = "VDD_AUD_3V";
+                               regulator-min-microvolt = <3000000>;
+                               regulator-max-microvolt = <3000000>;
+                       };
+
+                       ldo14_reg: LDO14 {
+                               regulator-name = "AVDD18_SWB_1.8V";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-always-on;
+                       };
+
+                       ldo17_reg: LDO17 {
+                               regulator-name = "VDD_SWB_3.3V";
+                               regulator-min-microvolt = <3300000>;
+                               regulator-max-microvolt = <3300000>;
+                               regulator-always-on;
+                       };
+
+                       ldo21_reg: LDO21 {
+                               regulator-name = "VDD_MIF_1.2V";
+                               regulator-min-microvolt = <1200000>;
+                               regulator-max-microvolt = <1200000>;
+                               regulator-always-on;
+                       };
+
+                       buck1_reg: BUCK1 {
+                               /*
+                               * HACK: The real name is VDD_ARM_1.2V,
+                               * but exynos-cpufreq does not support
+                               * DT-based regulator lookup yet.
+                               */
+                               regulator-name = "vdd_arm";
+                               regulator-min-microvolt = <950000>;
+                               regulator-max-microvolt = <1350000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                       };
+
+                       buck2_reg: BUCK2 {
+                               regulator-name = "VDD_INT_1.1V";
+                               regulator-min-microvolt = <900000>;
+                               regulator-max-microvolt = <1100000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                       };
+
+                       buck3_reg: BUCK3 {
+                               regulator-name = "VDD_G3D_1.1V";
+                               regulator-min-microvolt = <900000>;
+                               regulator-max-microvolt = <1100000>;
+                       };
+
+                       buck5_reg: BUCK5 {
+                               regulator-name = "VDDQ_M1M2_1.2V";
+                               regulator-min-microvolt = <1200000>;
+                               regulator-max-microvolt = <1200000>;
+                               regulator-always-on;
+                       };
+
+                       buck7_reg: BUCK7 {
+                               regulator-name = "VDD_LCD_3.3V";
+                               regulator-min-microvolt = <3300000>;
+                               regulator-max-microvolt = <3300000>;
+                               regulator-boot-on;
+                               regulator-always-on;
+                       };
+               };
+       };
+};
+
+&mfc {
+       samsung,mfc-r = <0x43000000 0x800000>;
+       samsung,mfc-l = <0x51000000 0x800000>;
+       status = "okay";
+};
+
+&sdhci_0 {
+       bus-width = <4>;
+       pinctrl-0 = <&sd0_clk &sd0_cmd &sd0_bus4 &sd0_cd>;
+       pinctrl-names = "default";
+       vmmc-supply = <&mmc_reg>;
+       status = "okay";
+};
+
+&sdhci_2 {
+       bus-width = <4>;
+       pinctrl-0 = <&sd2_clk &sd2_cmd &sd2_bus4 &sd2_cd>;
+       pinctrl-names = "default";
+       vmmc-supply = <&mmc_reg>;
+       status = "okay";
+};
+
+&serial_0 {
+       status = "okay";
+};
+
+&serial_1 {
+       status = "okay";
+};
+
+&serial_2 {
+       status = "okay";
+};
+
+&serial_3 {
+       status = "okay";
+};
+
+&rtc {
+       status = "okay";
+};
+
+&tmu {
+       status = "okay";
+};
+
+&watchdog {
+       status = "okay";
+};
index 86216fff1b4f42db7b4e7fb2cfc5beed60b30d39..043b03caff8f19489d8d0f287ef13612f49c41c5 100644 (file)
                stdout-path = &serial_1;
        };
 
-       sdhci@12530000 {
-               bus-width = <4>;
-               pinctrl-names = "default";
-               pinctrl-0 = <&sd2_clk &sd2_cmd &sd2_cd &sd2_bus4>;
-               status = "okay";
-       };
+       fixed-rate-clocks {
+               xxti {
+                       compatible = "samsung,clock-xxti";
+                       clock-frequency = <12000000>;
+               };
 
-       g2d@12800000 {
-               status = "okay";
+               xusbxti {
+                       compatible = "samsung,clock-xusbxti";
+                       clock-frequency = <24000000>;
+               };
        };
+};
 
-       codec@13400000 {
-               samsung,mfc-r = <0x43000000 0x800000>;
-               samsung,mfc-l = <0x51000000 0x800000>;
-               status = "okay";
-       };
+&g2d {
+       status = "okay";
+};
 
-       serial@13800000 {
-               status = "okay";
-       };
+&i2c_0 {
+       #address-cells = <1>;
+       #size-cells = <0>;
+       samsung,i2c-sda-delay = <100>;
+       samsung,i2c-max-bus-freq = <100000>;
+       status = "okay";
 
-       serial@13810000 {
-               status = "okay";
+       eeprom@50 {
+               compatible = "samsung,24ad0xd1";
+               reg = <0x50>;
        };
 
-       serial@13820000 {
-               status = "okay";
+       eeprom@52 {
+               compatible = "samsung,24ad0xd1";
+               reg = <0x52>;
        };
+};
 
-       serial@13830000 {
-               status = "okay";
+&keypad {
+       samsung,keypad-num-rows = <2>;
+       samsung,keypad-num-columns = <8>;
+       linux,keypad-no-autorepeat;
+       linux,keypad-wakeup;
+       pinctrl-names = "default";
+       pinctrl-0 = <&keypad_rows &keypad_cols>;
+       status = "okay";
+
+       key_1 {
+               keypad,row = <0>;
+               keypad,column = <3>;
+               linux,code = <2>;
        };
 
-       pinctrl@11000000 {
-               keypad_rows: keypad-rows {
-                       samsung,pins = "gpx2-0", "gpx2-1";
-                       samsung,pin-function = <3>;
-                       samsung,pin-pud = <3>;
-                       samsung,pin-drv = <0>;
-               };
-
-               keypad_cols: keypad-cols {
-                       samsung,pins = "gpx1-0", "gpx1-1", "gpx1-2", "gpx1-3",
-                                      "gpx1-4", "gpx1-5", "gpx1-6", "gpx1-7";
-                       samsung,pin-function = <3>;
-                       samsung,pin-pud = <0>;
-                       samsung,pin-drv = <0>;
-               };
+       key_2 {
+               keypad,row = <0>;
+               keypad,column = <4>;
+               linux,code = <3>;
        };
 
-       keypad@100A0000 {
-               samsung,keypad-num-rows = <2>;
-               samsung,keypad-num-columns = <8>;
-               linux,keypad-no-autorepeat;
-               linux,keypad-wakeup;
-               pinctrl-names = "default";
-               pinctrl-0 = <&keypad_rows &keypad_cols>;
-               status = "okay";
+       key_3 {
+               keypad,row = <0>;
+               keypad,column = <5>;
+               linux,code = <4>;
+       };
 
-               key_1 {
-                       keypad,row = <0>;
-                       keypad,column = <3>;
-                       linux,code = <2>;
-               };
+       key_4 {
+               keypad,row = <0>;
+               keypad,column = <6>;
+               linux,code = <5>;
+       };
 
-               key_2 {
-                       keypad,row = <0>;
-                       keypad,column = <4>;
-                       linux,code = <3>;
-               };
+       key_5 {
+               keypad,row = <0>;
+               keypad,column = <7>;
+               linux,code = <6>;
+       };
 
-               key_3 {
-                       keypad,row = <0>;
-                       keypad,column = <5>;
-                       linux,code = <4>;
-               };
+       key_a {
+               keypad,row = <1>;
+               keypad,column = <3>;
+               linux,code = <30>;
+       };
 
-               key_4 {
-                       keypad,row = <0>;
-                       keypad,column = <6>;
-                       linux,code = <5>;
-               };
+       key_b {
+               keypad,row = <1>;
+               keypad,column = <4>;
+               linux,code = <48>;
+       };
 
-               key_5 {
-                       keypad,row = <0>;
-                       keypad,column = <7>;
-                       linux,code = <6>;
-               };
+       key_c {
+               keypad,row = <1>;
+               keypad,column = <5>;
+               linux,code = <46>;
+       };
 
-               key_a {
-                       keypad,row = <1>;
-                       keypad,column = <3>;
-                       linux,code = <30>;
-               };
+       key_d {
+               keypad,row = <1>;
+               keypad,column = <6>;
+               linux,code = <32>;
+       };
 
-               key_b {
-                       keypad,row = <1>;
-                       keypad,column = <4>;
-                       linux,code = <48>;
-               };
+       key_e {
+               keypad,row = <1>;
+               keypad,column = <7>;
+               linux,code = <18>;
+       };
+};
 
-               key_c {
-                       keypad,row = <1>;
-                       keypad,column = <5>;
-                       linux,code = <46>;
-               };
+&mfc {
+       samsung,mfc-r = <0x43000000 0x800000>;
+       samsung,mfc-l = <0x51000000 0x800000>;
+       status = "okay";
+};
 
-               key_d {
-                       keypad,row = <1>;
-                       keypad,column = <6>;
-                       linux,code = <32>;
-               };
+&pinctrl_1 {
+       keypad_rows: keypad-rows {
+               samsung,pins = "gpx2-0", "gpx2-1";
+               samsung,pin-function = <3>;
+               samsung,pin-pud = <3>;
+               samsung,pin-drv = <0>;
+       };
 
-               key_e {
-                       keypad,row = <1>;
-                       keypad,column = <7>;
-                       linux,code = <18>;
-               };
+       keypad_cols: keypad-cols {
+               samsung,pins = "gpx1-0", "gpx1-1", "gpx1-2", "gpx1-3",
+                              "gpx1-4", "gpx1-5", "gpx1-6", "gpx1-7";
+               samsung,pin-function = <3>;
+               samsung,pin-pud = <0>;
+               samsung,pin-drv = <0>;
        };
+};
 
-       i2c@13860000 {
-               #address-cells = <1>;
-               #size-cells = <0>;
-               samsung,i2c-sda-delay = <100>;
-               samsung,i2c-max-bus-freq = <100000>;
-               status = "okay";
-
-               eeprom@50 {
-                       compatible = "samsung,24ad0xd1";
-                       reg = <0x50>;
-               };
+&sdhci_2 {
+       bus-width = <4>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&sd2_clk &sd2_cmd &sd2_cd &sd2_bus4>;
+       status = "okay";
+};
 
-               eeprom@52 {
-                       compatible = "samsung,24ad0xd1";
-                       reg = <0x52>;
-               };
-       };
+&serial_0 {
+       status = "okay";
+};
 
-       spi_2: spi@13940000 {
-               cs-gpios = <&gpc1 2 0>;
-               status = "okay";
+&serial_1 {
+       status = "okay";
+};
 
-               w25x80@0 {
-                       #address-cells = <1>;
-                       #size-cells = <1>;
-                       compatible = "w25x80";
-                       reg = <0>;
-                       spi-max-frequency = <1000000>;
+&serial_2 {
+       status = "okay";
+};
 
-                       controller-data {
-                               samsung,spi-feedback-delay = <0>;
-                       };
+&serial_3 {
+       status = "okay";
+};
 
-                       partition@0 {
-                               label = "U-Boot";
-                               reg = <0x0 0x40000>;
-                               read-only;
-                       };
+&spi_2 {
+       cs-gpios = <&gpc1 2 0>;
+       status = "okay";
 
-                       partition@40000 {
-                               label = "Kernel";
-                               reg = <0x40000 0xc0000>;
-                       };
+       w25x80@0 {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "w25x80";
+               reg = <0>;
+               spi-max-frequency = <1000000>;
+
+               controller-data {
+                       samsung,spi-feedback-delay = <0>;
                };
-       };
 
-       fixed-rate-clocks {
-               xxti {
-                       compatible = "samsung,clock-xxti";
-                       clock-frequency = <12000000>;
+               partition@0 {
+                       label = "U-Boot";
+                       reg = <0x0 0x40000>;
+                       read-only;
                };
 
-               xusbxti {
-                       compatible = "samsung,clock-xusbxti";
-                       clock-frequency = <24000000>;
+               partition@40000 {
+                       label = "Kernel";
+                       reg = <0x40000 0xc0000>;
                };
        };
 };
index 32c5fd8f6269d9c5932de0d715e7763f99541057..98f3ce65cb9a387a55ee588069bf42b51103317c 100644 (file)
                };
        };
 
-       hsotg@12480000 {
-               vusb_d-supply = <&vusb_reg>;
-               vusb_a-supply = <&vusbdac_reg>;
-               dr_mode = "peripheral";
-               status = "okay";
-       };
-
-       sdhci_emmc: sdhci@12510000 {
-               bus-width = <8>;
-               non-removable;
-               pinctrl-0 = <&sd0_clk &sd0_cmd &sd0_bus8>;
-               pinctrl-names = "default";
-               vmmc-supply = <&vemmc_reg>;
-               status = "okay";
-       };
-
-       exynos-usbphy@125B0000 {
-               status = "okay";
-       };
-
-       serial@13800000 {
-               status = "okay";
-       };
-
-       serial@13810000 {
-               status = "okay";
-       };
-
-       serial@13820000 {
-               status = "okay";
-       };
-
-       serial@13830000 {
-               status = "okay";
-       };
-
        gpio-keys {
                compatible = "gpio-keys";
 
                };
        };
 
-       i2c@13890000 {
-               samsung,i2c-sda-delay = <100>;
-               samsung,i2c-slave-addr = <0x10>;
-               samsung,i2c-max-bus-freq = <400000>;
-               pinctrl-0 = <&i2c3_bus>;
-               pinctrl-names = "default";
-               status = "okay";
-
-               mms114-touchscreen@48 {
-                       compatible = "melfas,mms114";
-                       reg = <0x48>;
-                       interrupt-parent = <&gpx0>;
-                       interrupts = <4 2>;
-                       x-size = <720>;
-                       y-size = <1280>;
-                       avdd-supply = <&tsp_reg>;
-                       vdd-supply = <&tsp_reg>;
-               };
-       };
-
-       i2c@138B0000 {
-               samsung,i2c-sda-delay = <100>;
-               samsung,i2c-slave-addr = <0x10>;
-               samsung,i2c-max-bus-freq = <100000>;
-               pinctrl-0 = <&i2c5_bus>;
-               pinctrl-names = "default";
-               status = "okay";
-
-               max8997_pmic@66 {
-                       compatible = "maxim,max8997-pmic";
-
-                       reg = <0x66>;
-
-                       max8997,pmic-buck1-uses-gpio-dvs;
-                       max8997,pmic-buck2-uses-gpio-dvs;
-                       max8997,pmic-buck5-uses-gpio-dvs;
-
-                       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-buck1-dvs-voltage = <1350000>, <1300000>,
-                                                        <1250000>, <1200000>,
-                                                        <1150000>, <1100000>,
-                                                        <1000000>, <950000>;
-
-                       max8997,pmic-buck2-dvs-voltage = <1100000>, <1000000>,
-                                                        <950000>,  <900000>,
-                                                        <1100000>, <1000000>,
-                                                        <950000>,  <900000>;
-
-                       max8997,pmic-buck5-dvs-voltage = <1200000>, <1200000>,
-                                                        <1200000>, <1200000>,
-                                                        <1200000>, <1200000>,
-                                                        <1200000>, <1200000>;
-
-                       regulators {
-                               valive_reg: LDO2 {
-                                    regulator-name = "VALIVE_1.1V_C210";
-                                    regulator-min-microvolt = <1100000>;
-                                    regulator-max-microvolt = <1100000>;
-                                    regulator-always-on;
-                               };
-
-                               vusb_reg: LDO3 {
-                                    regulator-name = "VUSB_1.1V_C210";
-                                    regulator-min-microvolt = <1100000>;
-                                    regulator-max-microvolt = <1100000>;
-                               };
-
-                               vmipi_reg: LDO4 {
-                                    regulator-name = "VMIPI_1.8V";
-                                    regulator-min-microvolt = <1800000>;
-                                    regulator-max-microvolt = <1800000>;
-                               };
-
-                               vpda_reg: LDO6 {
-                                    regulator-name = "VCC_1.8V_PDA";
-                                    regulator-min-microvolt = <1800000>;
-                                    regulator-max-microvolt = <1800000>;
-                                    regulator-always-on;
-                               };
-
-                               vcam_reg: LDO7 {
-                                    regulator-name = "CAM_ISP_1.8V";
-                                    regulator-min-microvolt = <1800000>;
-                                    regulator-max-microvolt = <1800000>;
-                               };
-
-                               vusbdac_reg: LDO8 {
-                                    regulator-name = "VUSB/VDAC_3.3V_C210";
-                                    regulator-min-microvolt = <3300000>;
-                                    regulator-max-microvolt = <3300000>;
-                               };
-
-                               vccpda_reg: LDO9 {
-                                    regulator-name = "VCC_2.8V_PDA";
-                                    regulator-min-microvolt = <2800000>;
-                                    regulator-max-microvolt = <2800000>;
-                                    regulator-always-on;
-                               };
-
-                               vpll_reg: LDO10 {
-                                    regulator-name = "VPLL_1.1V_C210";
-                                    regulator-min-microvolt = <1100000>;
-                                    regulator-max-microvolt = <1100000>;
-                                    regulator-always-on;
-                               };
-
-                               vtcam_reg: LDO12 {
-                                    regulator-name = "VT_CAM_1.8V";
-                                    regulator-min-microvolt = <1800000>;
-                                    regulator-max-microvolt = <1800000>;
-                               };
-
-                               vcclcd_reg: LDO13 {
-                                    regulator-name = "VCC_3.3V_LCD";
-                                    regulator-min-microvolt = <3300000>;
-                                    regulator-max-microvolt = <3300000>;
-                               };
-
-                               vlcd_reg: LDO15 {
-                                    regulator-name = "VLCD_2.2V";
-                                    regulator-min-microvolt = <2200000>;
-                                    regulator-max-microvolt = <2200000>;
-                               };
-
-                               camsensor_reg: LDO16 {
-                                    regulator-name = "CAM_SENSOR_IO_1.8V";
-                                    regulator-min-microvolt = <1800000>;
-                                    regulator-max-microvolt = <1800000>;
-                               };
-
-                               vddq_reg: LDO21 {
-                                    regulator-name = "VDDQ_M1M2_1.2V";
-                                    regulator-min-microvolt = <1200000>;
-                                    regulator-max-microvolt = <1200000>;
-                                    regulator-always-on;
-                               };
-
-                               varm_breg: BUCK1 {
-                                    /*
-                                     * HACK: The real name is VARM_1.2V_C210,
-                                     * but exynos-cpufreq does not support
-                                     * DT-based regulator lookup yet.
-                                     */
-                                    regulator-name = "vdd_arm";
-                                    regulator-min-microvolt = <900000>;
-                                    regulator-max-microvolt = <1350000>;
-                                    regulator-always-on;
-                               };
-
-                               vint_breg: BUCK2 {
-                                    regulator-name = "VINT_1.1V_C210";
-                                    regulator-min-microvolt = <900000>;
-                                    regulator-max-microvolt = <1100000>;
-                                    regulator-always-on;
-                               };
-
-                               camisp_breg: BUCK4 {
-                                    regulator-name = "CAM_ISP_CORE_1.2V";
-                                    regulator-min-microvolt = <1200000>;
-                                    regulator-max-microvolt = <1200000>;
-                               };
-
-                               vmem_breg: BUCK5 {
-                                    regulator-name = "VMEM_1.2V_C210";
-                                    regulator-min-microvolt = <1200000>;
-                                    regulator-max-microvolt = <1200000>;
-                                    regulator-always-on;
-                               };
-
-                               vccsub_breg: BUCK7 {
-                                    regulator-name = "VCC_SUB_2.0V";
-                                    regulator-min-microvolt = <2000000>;
-                                    regulator-max-microvolt = <2000000>;
-                                    regulator-always-on;
-                               };
-
-                               safe1_sreg: ESAFEOUT1 {
-                                    regulator-name = "SAFEOUT1";
-                                    regulator-always-on;
-                               };
-
-                               safe2_sreg: ESAFEOUT2 {
-                                    regulator-name = "SAFEOUT2";
-                                    regulator-boot-on;
-                               };
-                       };
-               };
-       };
-
        fixed-rate-clocks {
                xxti {
                        compatible = "samsung,clock-xxti";
                };
        };
 
-       dsi_0: dsi@11C80000 {
-               vddcore-supply = <&vusb_reg>;
-               vddio-supply = <&vmipi_reg>;
-               samsung,pll-clock-frequency = <24000000>;
-               status = "okay";
-
-               ports {
-                       #address-cells = <1>;
-                       #size-cells = <0>;
-
-                       port@1 {
-                               reg = <1>;
-
-                               dsi_out: endpoint {
-                                       remote-endpoint = <&dsi_in>;
-                                       samsung,burst-clock-frequency = <500000000>;
-                                       samsung,esc-clock-frequency = <20000000>;
-                               };
-                       };
-               };
-
-               panel@0 {
-                       reg = <0>;
-                       compatible = "samsung,s6e8aa0";
-                       vdd3-supply = <&vcclcd_reg>;
-                       vci-supply = <&vlcd_reg>;
-                       reset-gpios = <&gpy4 5 0>;
-                       power-on-delay= <50>;
-                       reset-delay = <100>;
-                       init-delay = <100>;
-                       flip-horizontal;
-                       flip-vertical;
-                       panel-width-mm = <58>;
-                       panel-height-mm = <103>;
-
-                       display-timings {
-                               timing-0 {
-                                       clock-frequency = <57153600>;
-                                       hactive = <720>;
-                                       vactive = <1280>;
-                                       hfront-porch = <5>;
-                                       hback-porch = <5>;
-                                       hsync-len = <5>;
-                                       vfront-porch = <13>;
-                                       vback-porch = <1>;
-                                       vsync-len = <2>;
-                               };
-                       };
-
-                       port {
-                               dsi_in: endpoint {
-                                       remote-endpoint = <&dsi_out>;
-                               };
-                       };
-               };
-       };
-
-       fimd@11c00000 {
-               status = "okay";
-       };
-
-       tmu@100C0000 {
-               status = "okay";
-       };
-
        thermal-zones {
                cpu_thermal: cpu-thermal {
                        cooling-maps {
                };
        };
 };
+
+&dsi_0 {
+       vddcore-supply = <&vusb_reg>;
+       vddio-supply = <&vmipi_reg>;
+       samsung,pll-clock-frequency = <24000000>;
+       status = "okay";
+
+       ports {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               port@1 {
+                       reg = <1>;
+
+                       dsi_out: endpoint {
+                               remote-endpoint = <&dsi_in>;
+                               samsung,burst-clock-frequency = <500000000>;
+                               samsung,esc-clock-frequency = <20000000>;
+                       };
+               };
+       };
+
+       panel@0 {
+               reg = <0>;
+               compatible = "samsung,s6e8aa0";
+               vdd3-supply = <&vcclcd_reg>;
+               vci-supply = <&vlcd_reg>;
+               reset-gpios = <&gpy4 5 0>;
+               power-on-delay= <50>;
+               reset-delay = <100>;
+               init-delay = <100>;
+               flip-horizontal;
+               flip-vertical;
+               panel-width-mm = <58>;
+               panel-height-mm = <103>;
+
+               display-timings {
+                       timing-0 {
+                               clock-frequency = <57153600>;
+                               hactive = <720>;
+                               vactive = <1280>;
+                               hfront-porch = <5>;
+                               hback-porch = <5>;
+                               hsync-len = <5>;
+                               vfront-porch = <13>;
+                               vback-porch = <1>;
+                               vsync-len = <2>;
+                       };
+               };
+
+               port {
+                       dsi_in: endpoint {
+                               remote-endpoint = <&dsi_out>;
+                       };
+               };
+       };
+};
+
+&exynos_usbphy {
+       status = "okay";
+};
+
+&fimd {
+       status = "okay";
+};
+
+&hsotg {
+       vusb_d-supply = <&vusb_reg>;
+       vusb_a-supply = <&vusbdac_reg>;
+       dr_mode = "peripheral";
+       status = "okay";
+};
+
+&i2c_3 {
+       samsung,i2c-sda-delay = <100>;
+       samsung,i2c-slave-addr = <0x10>;
+       samsung,i2c-max-bus-freq = <400000>;
+       pinctrl-0 = <&i2c3_bus>;
+       pinctrl-names = "default";
+       status = "okay";
+
+       mms114-touchscreen@48 {
+               compatible = "melfas,mms114";
+               reg = <0x48>;
+               interrupt-parent = <&gpx0>;
+               interrupts = <4 2>;
+               x-size = <720>;
+               y-size = <1280>;
+               avdd-supply = <&tsp_reg>;
+               vdd-supply = <&tsp_reg>;
+       };
+};
+
+&i2c_5 {
+       samsung,i2c-sda-delay = <100>;
+       samsung,i2c-slave-addr = <0x10>;
+       samsung,i2c-max-bus-freq = <100000>;
+       pinctrl-0 = <&i2c5_bus>;
+       pinctrl-names = "default";
+       status = "okay";
+
+       max8997_pmic@66 {
+               compatible = "maxim,max8997-pmic";
+
+               reg = <0x66>;
+
+               max8997,pmic-buck1-uses-gpio-dvs;
+               max8997,pmic-buck2-uses-gpio-dvs;
+               max8997,pmic-buck5-uses-gpio-dvs;
+
+               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-buck1-dvs-voltage = <1350000>, <1300000>,
+                                                <1250000>, <1200000>,
+                                                <1150000>, <1100000>,
+                                                <1000000>, <950000>;
+
+               max8997,pmic-buck2-dvs-voltage = <1100000>, <1000000>,
+                                                <950000>,  <900000>,
+                                                <1100000>, <1000000>,
+                                                <950000>,  <900000>;
+
+               max8997,pmic-buck5-dvs-voltage = <1200000>, <1200000>,
+                                                <1200000>, <1200000>,
+                                                <1200000>, <1200000>,
+                                                <1200000>, <1200000>;
+
+               regulators {
+                       valive_reg: LDO2 {
+                            regulator-name = "VALIVE_1.1V_C210";
+                            regulator-min-microvolt = <1100000>;
+                            regulator-max-microvolt = <1100000>;
+                            regulator-always-on;
+                       };
+
+                       vusb_reg: LDO3 {
+                            regulator-name = "VUSB_1.1V_C210";
+                            regulator-min-microvolt = <1100000>;
+                            regulator-max-microvolt = <1100000>;
+                       };
+
+                       vmipi_reg: LDO4 {
+                            regulator-name = "VMIPI_1.8V";
+                            regulator-min-microvolt = <1800000>;
+                            regulator-max-microvolt = <1800000>;
+                       };
+
+                       vpda_reg: LDO6 {
+                            regulator-name = "VCC_1.8V_PDA";
+                            regulator-min-microvolt = <1800000>;
+                            regulator-max-microvolt = <1800000>;
+                            regulator-always-on;
+                       };
+
+                       vcam_reg: LDO7 {
+                            regulator-name = "CAM_ISP_1.8V";
+                            regulator-min-microvolt = <1800000>;
+                            regulator-max-microvolt = <1800000>;
+                       };
+
+                       vusbdac_reg: LDO8 {
+                            regulator-name = "VUSB/VDAC_3.3V_C210";
+                            regulator-min-microvolt = <3300000>;
+                            regulator-max-microvolt = <3300000>;
+                       };
+
+                       vccpda_reg: LDO9 {
+                            regulator-name = "VCC_2.8V_PDA";
+                            regulator-min-microvolt = <2800000>;
+                            regulator-max-microvolt = <2800000>;
+                            regulator-always-on;
+                       };
+
+                       vpll_reg: LDO10 {
+                            regulator-name = "VPLL_1.1V_C210";
+                            regulator-min-microvolt = <1100000>;
+                            regulator-max-microvolt = <1100000>;
+                            regulator-always-on;
+                       };
+
+                       vtcam_reg: LDO12 {
+                            regulator-name = "VT_CAM_1.8V";
+                            regulator-min-microvolt = <1800000>;
+                            regulator-max-microvolt = <1800000>;
+                       };
+
+                       vcclcd_reg: LDO13 {
+                            regulator-name = "VCC_3.3V_LCD";
+                            regulator-min-microvolt = <3300000>;
+                            regulator-max-microvolt = <3300000>;
+                       };
+
+                       vlcd_reg: LDO15 {
+                            regulator-name = "VLCD_2.2V";
+                            regulator-min-microvolt = <2200000>;
+                            regulator-max-microvolt = <2200000>;
+                       };
+
+                       camsensor_reg: LDO16 {
+                            regulator-name = "CAM_SENSOR_IO_1.8V";
+                            regulator-min-microvolt = <1800000>;
+                            regulator-max-microvolt = <1800000>;
+                       };
+
+                       vddq_reg: LDO21 {
+                            regulator-name = "VDDQ_M1M2_1.2V";
+                            regulator-min-microvolt = <1200000>;
+                            regulator-max-microvolt = <1200000>;
+                            regulator-always-on;
+                       };
+
+                       varm_breg: BUCK1 {
+                            /*
+                             * HACK: The real name is VARM_1.2V_C210,
+                             * but exynos-cpufreq does not support
+                             * DT-based regulator lookup yet.
+                             */
+                            regulator-name = "vdd_arm";
+                            regulator-min-microvolt = <900000>;
+                            regulator-max-microvolt = <1350000>;
+                            regulator-always-on;
+                       };
+
+                       vint_breg: BUCK2 {
+                            regulator-name = "VINT_1.1V_C210";
+                            regulator-min-microvolt = <900000>;
+                            regulator-max-microvolt = <1100000>;
+                            regulator-always-on;
+                       };
+
+                       camisp_breg: BUCK4 {
+                            regulator-name = "CAM_ISP_CORE_1.2V";
+                            regulator-min-microvolt = <1200000>;
+                            regulator-max-microvolt = <1200000>;
+                       };
+
+                       vmem_breg: BUCK5 {
+                            regulator-name = "VMEM_1.2V_C210";
+                            regulator-min-microvolt = <1200000>;
+                            regulator-max-microvolt = <1200000>;
+                            regulator-always-on;
+                       };
+
+                       vccsub_breg: BUCK7 {
+                            regulator-name = "VCC_SUB_2.0V";
+                            regulator-min-microvolt = <2000000>;
+                            regulator-max-microvolt = <2000000>;
+                            regulator-always-on;
+                       };
+
+                       safe1_sreg: ESAFEOUT1 {
+                            regulator-name = "SAFEOUT1";
+                            regulator-always-on;
+                       };
+
+                       safe2_sreg: ESAFEOUT2 {
+                            regulator-name = "SAFEOUT2";
+                            regulator-boot-on;
+                       };
+               };
+       };
+};
+
+&sdhci_0 {
+       bus-width = <8>;
+       non-removable;
+       pinctrl-0 = <&sd0_clk &sd0_cmd &sd0_bus8>;
+       pinctrl-names = "default";
+       vmmc-supply = <&vemmc_reg>;
+       status = "okay";
+};
+
+&serial_0 {
+       status = "okay";
+};
+
+&serial_1 {
+       status = "okay";
+};
+
+&serial_2 {
+       status = "okay";
+};
+
+&serial_3 {
+       status = "okay";
+};
+
+&tmu {
+       status = "okay";
+};
index be89f83f70e7750577441c7400567a57c89ec9cb..10d3c173396e4cb67a2443f2d3e641c264bec168 100644 (file)
                };
        };
 
-       pmu_system_controller: system-controller@10020000 {
-               clock-names = "clkout0", "clkout1", "clkout2", "clkout3",
-                               "clkout4", "clkout8", "clkout9";
-               clocks = <&clock CLK_OUT_DMC>, <&clock CLK_OUT_TOP>,
-                       <&clock CLK_OUT_LEFTBUS>, <&clock CLK_OUT_RIGHTBUS>,
-                       <&clock CLK_OUT_CPU>, <&clock CLK_XXTI>,
-                       <&clock CLK_XUSBXTI>;
-               #clock-cells = <1>;
-       };
-
-       sysram@02020000 {
+       sysram: sysram@02020000 {
                compatible = "mmio-sram";
                reg = <0x02020000 0x20000>;
                #address-cells = <1>;
                arm,data-latency = <2 2 1>;
        };
 
-       gic: interrupt-controller@10490000 {
-               cpu-offset = <0x8000>;
-       };
-
-       combiner: interrupt-controller@10440000 {
-               samsung,combiner-nr = <16>;
-               interrupts = <0 0 0>, <0 1 0>, <0 2 0>, <0 3 0>,
-                            <0 4 0>, <0 5 0>, <0 6 0>, <0 7 0>,
-                            <0 8 0>, <0 9 0>, <0 10 0>, <0 11 0>,
-                            <0 12 0>, <0 13 0>, <0 14 0>, <0 15 0>;
-       };
-
-       mct@10050000 {
+       mct: mct@10050000 {
                compatible = "samsung,exynos4210-mct";
                reg = <0x10050000 0x800>;
                interrupt-parent = <&mct_map>;
                };
        };
 
-       g2d@12800000 {
+       g2d: g2d@12800000 {
                compatible = "samsung,s5pv210-g2d";
                reg = <0x12800000 0x1000>;
                interrupts = <0 89 0>;
                clocks = <&clock CLK_SCLK_FIMG2D>, <&clock CLK_G2D>;
                clock-names = "sclk_fimg2d", "fimg2d";
+               iommus = <&sysmmu_g2d>;
                status = "disabled";
        };
 
                clock-names = "ppmu";
                status = "disabled";
        };
+
+       sysmmu_g2d: sysmmu@12A20000 {
+               compatible = "samsung,exynos-sysmmu";
+               reg = <0x12A20000 0x1000>;
+               interrupt-parent = <&combiner>;
+               interrupts = <4 7>;
+               clock-names = "sysmmu", "master";
+               clocks = <&clock CLK_SMMU_G2D>, <&clock CLK_G2D>;
+               power-domains = <&pd_lcd0>;
+               #iommu-cells = <0>;
+       };
+
+       sysmmu_fimd1: sysmmu@12220000 {
+               compatible = "samsung,exynos-sysmmu";
+               interrupt-parent = <&combiner>;
+               reg = <0x12220000 0x1000>;
+               interrupts = <5 3>;
+               clock-names = "sysmmu", "master";
+               clocks = <&clock CLK_SMMU_FIMD1>, <&clock CLK_FIMD1>;
+               power-domains = <&pd_lcd1>;
+               #iommu-cells = <0>;
+       };
+};
+
+&gic {
+       cpu-offset = <0x8000>;
+};
+
+&combiner {
+       samsung,combiner-nr = <16>;
+       interrupts = <0 0 0>, <0 1 0>, <0 2 0>, <0 3 0>,
+                    <0 4 0>, <0 5 0>, <0 6 0>, <0 7 0>,
+                    <0 8 0>, <0 9 0>, <0 10 0>, <0 11 0>,
+                    <0 12 0>, <0 13 0>, <0 14 0>, <0 15 0>;
+};
+
+&pmu_system_controller {
+       clock-names = "clkout0", "clkout1", "clkout2", "clkout3",
+                       "clkout4", "clkout8", "clkout9";
+       clocks = <&clock CLK_OUT_DMC>, <&clock CLK_OUT_TOP>,
+               <&clock CLK_OUT_LEFTBUS>, <&clock CLK_OUT_RIGHTBUS>,
+               <&clock CLK_OUT_CPU>, <&clock CLK_XXTI>, <&clock CLK_XUSBXTI>;
+       #clock-cells = <1>;
 };
index 5be03288f1ee6157cf35849c256743c9ff86b70d..d9c8efeef208d8d6cf5b39f34506083020d7b0fe 100644 (file)
                        reg = <0xA01>;
                };
        };
+};
 
-       combiner: interrupt-controller@10440000 {
-               samsung,combiner-nr = <18>;
-       };
+&combiner {
+       samsung,combiner-nr = <18>;
+};
 
-       gic: interrupt-controller@10490000 {
-               cpu-offset = <0x8000>;
-       };
+&gic {
+       cpu-offset = <0x8000>;
 };
index d6b49e5b32e9f35ed2a1378e1f7933997c5d4e85..ca7d168d1dd62004aa45db808741b3458ae1da61 100644 (file)
                };
        };
 
-       i2s0: i2s@03830000 {
-               pinctrl-0 = <&i2s0_bus>;
-               pinctrl-names = "default";
-               status = "okay";
-               clocks = <&clock_audss EXYNOS_I2S_BUS>,
-                        <&clock_audss EXYNOS_DOUT_AUD_BUS>,
-                        <&clock_audss EXYNOS_SCLK_I2S>;
-               clock-names = "iis", "i2s_opclk0", "i2s_opclk1";
-       };
-
        sound: sound {
                compatible = "simple-audio-card";
                assigned-clocks = <&clock_audss EXYNOS_MOUT_AUDSS>,
                reset-gpios = <&gpk1 2 1>;
        };
 
-       mmc@12550000 {
-               pinctrl-0 = <&sd4_clk &sd4_cmd &sd4_bus4 &sd4_bus8>;
-               pinctrl-names = "default";
-               vmmc-supply = <&ldo20_reg &buck8_reg>;
-               mmc-pwrseq = <&emmc_pwrseq>;
-               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>;
-               bus-width = <8>;
-               cap-mmc-highspeed;
-       };
-
-       watchdog@10060000 {
-               status = "okay";
-       };
-
-       rtc@10070000 {
-               status = "okay";
-               clocks = <&clock CLK_RTC>, <&max77686 MAX77686_CLK_AP>;
-               clock-names = "rtc", "rtc_src";
-       };
-
-       g2d@10800000 {
-               status = "okay";
-       };
-
        camera {
                status = "okay";
                pinctrl-names = "default";
                pinctrl-0 = <>;
+       };
 
-               fimc_0: fimc@11800000 {
-                       status = "okay";
-                       assigned-clocks = <&clock CLK_MOUT_FIMC0>,
-                                       <&clock CLK_SCLK_FIMC0>;
-                       assigned-clock-parents = <&clock CLK_MOUT_MPLL_USER_T>;
-                       assigned-clock-rates = <0>, <176000000>;
-               };
-
-               fimc_1: fimc@11810000 {
-                       status = "okay";
-                       assigned-clocks = <&clock CLK_MOUT_FIMC1>,
-                                       <&clock CLK_SCLK_FIMC1>;
-                       assigned-clock-parents = <&clock CLK_MOUT_MPLL_USER_T>;
-                       assigned-clock-rates = <0>, <176000000>;
+       fixed-rate-clocks {
+               xxti {
+                       compatible = "samsung,clock-xxti";
+                       clock-frequency = <0>;
                };
 
-               fimc_2: fimc@11820000 {
-                       status = "okay";
-                       assigned-clocks = <&clock CLK_MOUT_FIMC2>,
-                                       <&clock CLK_SCLK_FIMC2>;
-                       assigned-clock-parents = <&clock CLK_MOUT_MPLL_USER_T>;
-                       assigned-clock-rates = <0>, <176000000>;
+               xusbxti {
+                       compatible = "samsung,clock-xusbxti";
+                       clock-frequency = <24000000>;
                };
+       };
 
-               fimc_3: fimc@11830000 {
-                       status = "okay";
-                       assigned-clocks = <&clock CLK_MOUT_FIMC3>,
-                                       <&clock CLK_SCLK_FIMC3>;
-                       assigned-clock-parents = <&clock CLK_MOUT_MPLL_USER_T>;
-                       assigned-clock-rates = <0>, <176000000>;
+       thermal-zones {
+               cpu_thermal: cpu-thermal {
+                       cooling-maps {
+                               map0 {
+                                    /* Corresponds to 800MHz at freq_table */
+                                    cooling-device = <&cpu0 7 7>;
+                               };
+                               map1 {
+                                    /* Corresponds to 200MHz at freq_table */
+                                    cooling-device = <&cpu0 13 13>;
+                              };
+                      };
                };
        };
+};
 
-       sdhci@12530000 {
-               bus-width = <4>;
-               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-inverted;
-               status = "okay";
-       };
+/* RSTN signal for eMMC */
+&sd1_cd {
+       samsung,pin-pud = <0>;
+       samsung,pin-drv = <0>;
+};
 
-       serial@13800000 {
-               status = "okay";
+&pinctrl_1 {
+       gpio_power_key: power_key {
+               samsung,pins = "gpx1-3";
+               samsung,pin-pud = <0>;
        };
 
-       serial@13810000 {
-               status = "okay";
+       max77686_irq: max77686-irq {
+               samsung,pins = "gpx3-2";
+               samsung,pin-function = <0>;
+               samsung,pin-pud = <0>;
+               samsung,pin-drv = <0>;
        };
 
-       fixed-rate-clocks {
-               xxti {
-                       compatible = "samsung,clock-xxti";
-                       clock-frequency = <0>;
-               };
-
-               xusbxti {
-                       compatible = "samsung,clock-xusbxti";
-                       clock-frequency = <24000000>;
-               };
+       hdmi_hpd: hdmi-hpd {
+               samsung,pins = "gpx3-7";
+               samsung,pin-pud = <1>;
        };
+};
 
-       i2c@13860000 {
-               pinctrl-0 = <&i2c0_bus>;
-               pinctrl-names = "default";
-               samsung,i2c-sda-delay = <100>;
-               samsung,i2c-max-bus-freq = <400000>;
-               status = "okay";
+&ehci {
+       status = "okay";
+};
 
-               usb3503: usb3503@08 {
-                       compatible = "smsc,usb3503";
-                       reg = <0x08>;
+&exynos_usbphy {
+       status = "okay";
+};
 
-                       intn-gpios = <&gpx3 0 0>;
-                       connect-gpios = <&gpx3 4 0>;
-                       reset-gpios = <&gpx3 5 0>;
-                       initial-mode = <1>;
-               };
+&fimc_0 {
+       status = "okay";
+       assigned-clocks = <&clock CLK_MOUT_FIMC0>,
+                       <&clock CLK_SCLK_FIMC0>;
+       assigned-clock-parents = <&clock CLK_MOUT_MPLL_USER_T>;
+       assigned-clock-rates = <0>, <176000000>;
+};
 
-               max77686: pmic@09 {
-                       compatible = "maxim,max77686";
-                       interrupt-parent = <&gpx3>;
-                       interrupts = <2 0>;
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&max77686_irq>;
-                       reg = <0x09>;
-                       #clock-cells = <1>;
-
-                       voltage-regulators {
-                               ldo1_reg: LDO1 {
-                                       regulator-name = "VDD_ALIVE_1.0V";
-                                       regulator-min-microvolt = <1000000>;
-                                       regulator-max-microvolt = <1000000>;
-                                       regulator-always-on;
-                               };
+&fimc_1 {
+       status = "okay";
+       assigned-clocks = <&clock CLK_MOUT_FIMC1>,
+                       <&clock CLK_SCLK_FIMC1>;
+       assigned-clock-parents = <&clock CLK_MOUT_MPLL_USER_T>;
+       assigned-clock-rates = <0>, <176000000>;
+};
 
-                               ldo2_reg: LDO2 {
-                                       regulator-name = "VDDQ_M1_2_1.8V";
-                                       regulator-min-microvolt = <1800000>;
-                                       regulator-max-microvolt = <1800000>;
-                                       regulator-always-on;
-                               };
+&fimc_2 {
+       status = "okay";
+       assigned-clocks = <&clock CLK_MOUT_FIMC2>,
+                       <&clock CLK_SCLK_FIMC2>;
+       assigned-clock-parents = <&clock CLK_MOUT_MPLL_USER_T>;
+       assigned-clock-rates = <0>, <176000000>;
+};
 
-                               ldo3_reg: LDO3 {
-                                       regulator-name = "VDDQ_EXT_1.8V";
-                                       regulator-min-microvolt = <1800000>;
-                                       regulator-max-microvolt = <1800000>;
-                                       regulator-always-on;
-                               };
+&fimc_3 {
+       status = "okay";
+       assigned-clocks = <&clock CLK_MOUT_FIMC3>,
+                       <&clock CLK_SCLK_FIMC3>;
+       assigned-clock-parents = <&clock CLK_MOUT_MPLL_USER_T>;
+       assigned-clock-rates = <0>, <176000000>;
+};
 
-                               ldo4_reg: LDO4 {
-                                       regulator-name = "VDDQ_MMC2_2.8V";
-                                       regulator-min-microvolt = <2800000>;
-                                       regulator-max-microvolt = <2800000>;
-                                       regulator-always-on;
-                                       regulator-boot-on;
-                               };
+&g2d {
+       status = "okay";
+};
 
-                               ldo5_reg: LDO5 {
-                                       regulator-name = "VDDQ_MMC1_3_1.8V";
-                                       regulator-min-microvolt = <1800000>;
-                                       regulator-max-microvolt = <1800000>;
-                                       regulator-always-on;
-                                       regulator-boot-on;
-                               };
+&hdmi {
+       hpd-gpio = <&gpx3 7 0>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&hdmi_hpd>;
+       vdd-supply = <&ldo8_reg>;
+       vdd_osc-supply = <&ldo10_reg>;
+       vdd_pll-supply = <&ldo8_reg>;
+       ddc = <&i2c_2>;
+       status = "okay";
+};
 
-                               ldo6_reg: LDO6 {
-                                       regulator-name = "VDD10_MPLL_1.0V";
-                                       regulator-min-microvolt = <1000000>;
-                                       regulator-max-microvolt = <1000000>;
-                                       regulator-always-on;
-                               };
+&hsotg {
+       dr_mode = "peripheral";
+       status = "okay";
+       vusb_d-supply = <&ldo15_reg>;
+       vusb_a-supply = <&ldo12_reg>;
+};
 
-                               ldo7_reg: LDO7 {
-                                       regulator-name = "VDD10_XPLL_1.0V";
-                                       regulator-min-microvolt = <1000000>;
-                                       regulator-max-microvolt = <1000000>;
-                                       regulator-always-on;
-                               };
+&i2c_0 {
+       pinctrl-0 = <&i2c0_bus>;
+       pinctrl-names = "default";
+       samsung,i2c-sda-delay = <100>;
+       samsung,i2c-max-bus-freq = <400000>;
+       status = "okay";
+
+       usb3503: usb3503@08 {
+               compatible = "smsc,usb3503";
+               reg = <0x08>;
+
+               intn-gpios = <&gpx3 0 0>;
+               connect-gpios = <&gpx3 4 0>;
+               reset-gpios = <&gpx3 5 0>;
+               initial-mode = <1>;
+       };
 
-                               ldo8_reg: ldo@8 {
-                                       regulator-compatible = "LDO8";
-                                       regulator-name = "VDD10_HDMI_1.0V";
-                                       regulator-min-microvolt = <1000000>;
-                                       regulator-max-microvolt = <1000000>;
-                               };
+       max77686: pmic@09 {
+               compatible = "maxim,max77686";
+               interrupt-parent = <&gpx3>;
+               interrupts = <2 0>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&max77686_irq>;
+               reg = <0x09>;
+               #clock-cells = <1>;
+
+               voltage-regulators {
+                       ldo1_reg: LDO1 {
+                               regulator-name = "VDD_ALIVE_1.0V";
+                               regulator-min-microvolt = <1000000>;
+                               regulator-max-microvolt = <1000000>;
+                               regulator-always-on;
+                       };
 
-                               ldo10_reg: ldo@10 {
-                                       regulator-compatible = "LDO10";
-                                       regulator-name = "VDDQ_MIPIHSI_1.8V";
-                                       regulator-min-microvolt = <1800000>;
-                                       regulator-max-microvolt = <1800000>;
-                               };
+                       ldo2_reg: LDO2 {
+                               regulator-name = "VDDQ_M1_2_1.8V";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-always-on;
+                       };
 
-                               ldo11_reg: LDO11 {
-                                       regulator-name = "VDD18_ABB1_1.8V";
-                                       regulator-min-microvolt = <1800000>;
-                                       regulator-max-microvolt = <1800000>;
-                                       regulator-always-on;
-                               };
+                       ldo3_reg: LDO3 {
+                               regulator-name = "VDDQ_EXT_1.8V";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-always-on;
+                       };
 
-                               ldo12_reg: LDO12 {
-                                       regulator-name = "VDD33_USB_3.3V";
-                                       regulator-min-microvolt = <3300000>;
-                                       regulator-max-microvolt = <3300000>;
-                                       regulator-always-on;
-                                       regulator-boot-on;
-                               };
+                       ldo4_reg: LDO4 {
+                               regulator-name = "VDDQ_MMC2_2.8V";
+                               regulator-min-microvolt = <2800000>;
+                               regulator-max-microvolt = <2800000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                       };
 
-                               ldo13_reg: LDO13 {
-                                       regulator-name = "VDDQ_C2C_W_1.8V";
-                                       regulator-min-microvolt = <1800000>;
-                                       regulator-max-microvolt = <1800000>;
-                                       regulator-always-on;
-                                       regulator-boot-on;
-                               };
+                       ldo5_reg: LDO5 {
+                               regulator-name = "VDDQ_MMC1_3_1.8V";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                       };
 
-                               ldo14_reg: LDO14 {
-                                       regulator-name = "VDD18_ABB0_2_1.8V";
-                                       regulator-min-microvolt = <1800000>;
-                                       regulator-max-microvolt = <1800000>;
-                                       regulator-always-on;
-                                       regulator-boot-on;
-                               };
+                       ldo6_reg: LDO6 {
+                               regulator-name = "VDD10_MPLL_1.0V";
+                               regulator-min-microvolt = <1000000>;
+                               regulator-max-microvolt = <1000000>;
+                               regulator-always-on;
+                       };
 
-                               ldo15_reg: LDO15 {
-                                       regulator-name = "VDD10_HSIC_1.0V";
-                                       regulator-min-microvolt = <1000000>;
-                                       regulator-max-microvolt = <1000000>;
-                                       regulator-always-on;
-                                       regulator-boot-on;
-                               };
+                       ldo7_reg: LDO7 {
+                               regulator-name = "VDD10_XPLL_1.0V";
+                               regulator-min-microvolt = <1000000>;
+                               regulator-max-microvolt = <1000000>;
+                               regulator-always-on;
+                       };
 
-                               ldo16_reg: LDO16 {
-                                       regulator-name = "VDD18_HSIC_1.8V";
-                                       regulator-min-microvolt = <1800000>;
-                                       regulator-max-microvolt = <1800000>;
-                                       regulator-always-on;
-                                       regulator-boot-on;
-                               };
+                       ldo8_reg: ldo@8 {
+                               regulator-compatible = "LDO8";
+                               regulator-name = "VDD10_HDMI_1.0V";
+                               regulator-min-microvolt = <1000000>;
+                               regulator-max-microvolt = <1000000>;
+                       };
 
-                               ldo20_reg: LDO20 {
-                                       regulator-name = "LDO20_1.8V";
-                                       regulator-min-microvolt = <1800000>;
-                                       regulator-max-microvolt = <1800000>;
-                                       regulator-boot-on;
-                               };
+                       ldo10_reg: ldo@10 {
+                               regulator-compatible = "LDO10";
+                               regulator-name = "VDDQ_MIPIHSI_1.8V";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                       };
 
-                               ldo21_reg: LDO21 {
-                                       regulator-name = "LDO21_3.3V";
-                                       regulator-min-microvolt = <3300000>;
-                                       regulator-max-microvolt = <3300000>;
-                                       regulator-always-on;
-                                       regulator-boot-on;
-                               };
+                       ldo11_reg: LDO11 {
+                               regulator-name = "VDD18_ABB1_1.8V";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-always-on;
+                       };
 
-                               ldo25_reg: LDO25 {
-                                       regulator-name = "VDDQ_LCD_1.8V";
-                                       regulator-min-microvolt = <1800000>;
-                                       regulator-max-microvolt = <1800000>;
-                                       regulator-always-on;
-                                       regulator-boot-on;
-                               };
+                       ldo12_reg: LDO12 {
+                               regulator-name = "VDD33_USB_3.3V";
+                               regulator-min-microvolt = <3300000>;
+                               regulator-max-microvolt = <3300000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                       };
 
-                               buck1_reg: BUCK1 {
-                                       regulator-name = "vdd_mif";
-                                       regulator-min-microvolt = <1000000>;
-                                       regulator-max-microvolt = <1000000>;
-                                       regulator-always-on;
-                                       regulator-boot-on;
-                               };
+                       ldo13_reg: LDO13 {
+                               regulator-name = "VDDQ_C2C_W_1.8V";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                       };
 
-                               buck2_reg: BUCK2 {
-                                       regulator-name = "vdd_arm";
-                                       regulator-min-microvolt = <900000>;
-                                       regulator-max-microvolt = <1350000>;
-                                       regulator-always-on;
-                                       regulator-boot-on;
-                               };
+                       ldo14_reg: LDO14 {
+                               regulator-name = "VDD18_ABB0_2_1.8V";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                       };
 
-                               buck3_reg: BUCK3 {
-                                       regulator-name = "vdd_int";
-                                       regulator-min-microvolt = <1000000>;
-                                       regulator-max-microvolt = <1000000>;
-                                       regulator-always-on;
-                                       regulator-boot-on;
-                               };
+                       ldo15_reg: LDO15 {
+                               regulator-name = "VDD10_HSIC_1.0V";
+                               regulator-min-microvolt = <1000000>;
+                               regulator-max-microvolt = <1000000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                       };
 
-                               buck4_reg: BUCK4 {
-                                       regulator-name = "vdd_g3d";
-                                       regulator-min-microvolt = <900000>;
-                                       regulator-max-microvolt = <1100000>;
-                                       regulator-microvolt-offset = <50000>;
-                               };
+                       ldo16_reg: LDO16 {
+                               regulator-name = "VDD18_HSIC_1.8V";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                       };
 
-                               buck5_reg: BUCK5 {
-                                       regulator-name = "VDDQ_CKEM1_2_1.2V";
-                                       regulator-min-microvolt = <1200000>;
-                                       regulator-max-microvolt = <1200000>;
-                                       regulator-always-on;
-                                       regulator-boot-on;
-                               };
+                       ldo20_reg: LDO20 {
+                               regulator-name = "LDO20_1.8V";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-boot-on;
+                       };
 
-                               buck6_reg: BUCK6 {
-                                       regulator-name = "BUCK6_1.35V";
-                                       regulator-min-microvolt = <1350000>;
-                                       regulator-max-microvolt = <1350000>;
-                                       regulator-always-on;
-                                       regulator-boot-on;
-                               };
+                       ldo21_reg: LDO21 {
+                               regulator-name = "LDO21_3.3V";
+                               regulator-min-microvolt = <3300000>;
+                               regulator-max-microvolt = <3300000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                       };
 
-                               buck7_reg: BUCK7 {
-                                       regulator-name = "BUCK7_2.0V";
-                                       regulator-min-microvolt = <2000000>;
-                                       regulator-max-microvolt = <2000000>;
-                                       regulator-always-on;
-                               };
+                       ldo25_reg: LDO25 {
+                               regulator-name = "VDDQ_LCD_1.8V";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                       };
 
-                               buck8_reg: BUCK8 {
-                                       regulator-name = "BUCK8_2.8V";
-                                       regulator-min-microvolt = <2800000>;
-                                       regulator-max-microvolt = <2800000>;
-                               };
+                       buck1_reg: BUCK1 {
+                               regulator-name = "vdd_mif";
+                               regulator-min-microvolt = <1000000>;
+                               regulator-max-microvolt = <1000000>;
+                               regulator-always-on;
+                               regulator-boot-on;
                        };
-               };
-       };
 
-       i2c@13870000 {
-               pinctrl-names = "default";
-               pinctrl-0 = <&i2c1_bus>;
-               status = "okay";
-               max98090: max98090@10 {
-                       compatible = "maxim,max98090";
-                       reg = <0x10>;
-                       interrupt-parent = <&gpx0>;
-                       interrupts = <0 0>;
-                       clocks = <&i2s0 CLK_I2S_CDCLK>;
-                       clock-names = "mclk";
-                       #sound-dai-cells = <0>;
-               };
-       };
+                       buck2_reg: BUCK2 {
+                               regulator-name = "vdd_arm";
+                               regulator-min-microvolt = <900000>;
+                               regulator-max-microvolt = <1350000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                       };
 
-       exynos-usbphy@125B0000 {
-               status = "okay";
-       };
+                       buck3_reg: BUCK3 {
+                               regulator-name = "vdd_int";
+                               regulator-min-microvolt = <1000000>;
+                               regulator-max-microvolt = <1000000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                       };
 
-       hsotg@12480000 {
-               dr_mode = "peripheral";
-               status = "okay";
-               vusb_d-supply = <&ldo15_reg>;
-               vusb_a-supply = <&ldo12_reg>;
-       };
+                       buck4_reg: BUCK4 {
+                               regulator-name = "vdd_g3d";
+                               regulator-min-microvolt = <900000>;
+                               regulator-max-microvolt = <1100000>;
+                               regulator-microvolt-offset = <50000>;
+                       };
 
-       ehci: ehci@12580000 {
-               status = "okay";
-       };
+                       buck5_reg: BUCK5 {
+                               regulator-name = "VDDQ_CKEM1_2_1.2V";
+                               regulator-min-microvolt = <1200000>;
+                               regulator-max-microvolt = <1200000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                       };
 
-       tmu@100C0000 {
-               vtmu-supply = <&ldo10_reg>;
-               status = "okay";
-       };
+                       buck6_reg: BUCK6 {
+                               regulator-name = "BUCK6_1.35V";
+                               regulator-min-microvolt = <1350000>;
+                               regulator-max-microvolt = <1350000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                       };
 
-       thermal-zones {
-               cpu_thermal: cpu-thermal {
-                       cooling-maps {
-                               map0 {
-                                    /* Corresponds to 800MHz at freq_table */
-                                    cooling-device = <&cpu0 7 7>;
-                               };
-                               map1 {
-                                    /* Corresponds to 200MHz at freq_table */
-                                    cooling-device = <&cpu0 13 13>;
-                              };
-                      };
+                       buck7_reg: BUCK7 {
+                               regulator-name = "BUCK7_2.0V";
+                               regulator-min-microvolt = <2000000>;
+                               regulator-max-microvolt = <2000000>;
+                               regulator-always-on;
+                       };
+
+                       buck8_reg: BUCK8 {
+                               regulator-name = "BUCK8_2.8V";
+                               regulator-min-microvolt = <2800000>;
+                               regulator-max-microvolt = <2800000>;
+                       };
                };
        };
+};
 
-       mixer: mixer@12C10000 {
-               status = "okay";
+&i2c_1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c1_bus>;
+       status = "okay";
+       max98090: max98090@10 {
+               compatible = "maxim,max98090";
+               reg = <0x10>;
+               interrupt-parent = <&gpx0>;
+               interrupts = <0 0>;
+               clocks = <&i2s0 CLK_I2S_CDCLK>;
+               clock-names = "mclk";
+               #sound-dai-cells = <0>;
        };
+};
 
-       hdmi@12D00000 {
-               hpd-gpio = <&gpx3 7 0>;
-               pinctrl-names = "default";
-               pinctrl-0 = <&hdmi_hpd>;
-               vdd-supply = <&ldo8_reg>;
-               vdd_osc-supply = <&ldo10_reg>;
-               vdd_pll-supply = <&ldo8_reg>;
-               ddc = <&hdmi_ddc>;
-               status = "okay";
-       };
+&i2c_2 {
+       status = "okay";
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c2_bus>;
+};
 
-       hdmi_ddc: i2c@13880000 {
-               status = "okay";
-               pinctrl-names = "default";
-               pinctrl-0 = <&i2c2_bus>;
-       };
+&i2c_8 {
+       status = "okay";
+};
 
-       i2c@138E0000 {
-               status = "okay";
-       };
+&i2s0 {
+       pinctrl-0 = <&i2s0_bus>;
+       pinctrl-names = "default";
+       status = "okay";
+       clocks = <&clock_audss EXYNOS_I2S_BUS>,
+                <&clock_audss EXYNOS_DOUT_AUD_BUS>,
+                <&clock_audss EXYNOS_SCLK_I2S>;
+       clock-names = "iis", "i2s_opclk0", "i2s_opclk1";
 };
 
-/* RSTN signal for eMMC */
-&sd1_cd {
-       samsung,pin-pud = <0>;
-       samsung,pin-drv = <0>;
+&mixer {
+       status = "okay";
 };
 
-&pinctrl_1 {
-       gpio_power_key: power_key {
-               samsung,pins = "gpx1-3";
-               samsung,pin-pud = <0>;
-       };
+&mshc_0 {
+       pinctrl-0 = <&sd4_clk &sd4_cmd &sd4_bus4 &sd4_bus8>;
+       pinctrl-names = "default";
+       vmmc-supply = <&ldo20_reg &buck8_reg>;
+       mmc-pwrseq = <&emmc_pwrseq>;
+       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>;
+       bus-width = <8>;
+       cap-mmc-highspeed;
+};
 
-       max77686_irq: max77686-irq {
-               samsung,pins = "gpx3-2";
-               samsung,pin-function = <0>;
-               samsung,pin-pud = <0>;
-               samsung,pin-drv = <0>;
-       };
+&rtc {
+       status = "okay";
+       clocks = <&clock CLK_RTC>, <&max77686 MAX77686_CLK_AP>;
+       clock-names = "rtc", "rtc_src";
+};
 
-       hdmi_hpd: hdmi-hpd {
-               samsung,pins = "gpx3-7";
-               samsung,pin-pud = <1>;
-       };
+&sdhci_2 {
+       bus-width = <4>;
+       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-inverted;
+       status = "okay";
+};
+
+&serial_0 {
+       status = "okay";
+};
+
+&serial_1 {
+       status = "okay";
+};
+
+&tmu {
+       vtmu-supply = <&ldo10_reg>;
+       status = "okay";
+};
+
+&watchdog {
+       status = "okay";
 };
index cb1cfe7239c44373a764cf14a739738807325961..679ac103ebf6126b0a1e58a376188de8b39bb2df 100644 (file)
                };
        };
 
-       serial@13820000 {
-               status = "okay";
-       };
-
-       serial@13830000 {
-               status = "okay";
-       };
-
        gpio_keys {
                pinctrl-0 = <&gpio_power_key &gpio_home_key>;
 
                samsung,pin-pud = <0>;
        };
 };
+
+&serial_2 {
+       status = "okay";
+};
+
+&serial_3 {
+       status = "okay";
+};
index bd8b73077d41faed72e4465280dc3f58c50b7385..84c76310b31288d8542c2a8d1a0965b9a705bca7 100644 (file)
                };
        };
 
-       watchdog@10060000 {
-               status = "okay";
-       };
-
-       rtc@10070000 {
-               status = "okay";
+       display-timings {
+               native-mode = <&timing0>;
+               timing0: timing {
+                       clock-frequency = <47500000>;
+                       hactive = <1024>;
+                       vactive = <600>;
+                       hfront-porch = <64>;
+                       hback-porch = <16>;
+                       hsync-len = <48>;
+                       vback-porch = <64>;
+                       vfront-porch = <16>;
+                       vsync-len = <3>;
+               };
        };
 
-       pinctrl@11000000 {
-               keypad_rows: keypad-rows {
-                       samsung,pins = "gpx2-0", "gpx2-1", "gpx2-2";
-                       samsung,pin-function = <3>;
-                       samsung,pin-pud = <3>;
-                       samsung,pin-drv = <0>;
+       fixed-rate-clocks {
+               xxti {
+                       compatible = "samsung,clock-xxti";
+                       clock-frequency = <0>;
                };
 
-               keypad_cols: keypad-cols {
-                       samsung,pins = "gpx1-0", "gpx1-1";
-                       samsung,pin-function = <3>;
-                       samsung,pin-pud = <0>;
-                       samsung,pin-drv = <0>;
+               xusbxti {
+                       compatible = "samsung,clock-xusbxti";
+                       clock-frequency = <24000000>;
                };
        };
+};
 
-       keypad@100A0000 {
-               samsung,keypad-num-rows = <3>;
-               samsung,keypad-num-columns = <2>;
-               linux,keypad-no-autorepeat;
-               linux,keypad-wakeup;
-               pinctrl-0 = <&keypad_rows &keypad_cols>;
-               pinctrl-names = "default";
-               status = "okay";
-
-               key_home {
-                       keypad,row = <0>;
-                       keypad,column = <0>;
-                       linux,code = <KEY_HOME>;
-               };
+&fimd {
+       pinctrl-0 = <&lcd_clk &lcd_data24 &pwm1_out>;
+       pinctrl-names = "default";
+       status = "okay";
+};
 
-               key_down {
-                       keypad,row = <0>;
-                       keypad,column = <1>;
-                       linux,code = <KEY_DOWN>;
-               };
+&g2d {
+       status = "okay";
+};
 
-               key_up {
-                       keypad,row = <1>;
-                       keypad,column = <0>;
-                       linux,code = <KEY_UP>;
-               };
+&i2c_0 {
+       #address-cells = <1>;
+       #size-cells = <0>;
+       samsung,i2c-sda-delay = <100>;
+       samsung,i2c-max-bus-freq = <20000>;
+       pinctrl-0 = <&i2c0_bus>;
+       pinctrl-names = "default";
+       status = "okay";
+
+       s5m8767_pmic@66 {
+               compatible = "samsung,s5m8767-pmic";
+               reg = <0x66>;
+
+               s5m8767,pmic-buck-default-dvs-idx = <3>;
+
+               s5m8767,pmic-buck-dvs-gpios = <&gpx2 3 0>,
+                                                <&gpx2 4 0>,
+                                                <&gpx2 5 0>;
+
+               s5m8767,pmic-buck-ds-gpios = <&gpm3 5 0>,
+                                               <&gpm3 6 0>,
+                                               <&gpm3 7 0>;
+
+               s5m8767,pmic-buck2-dvs-voltage = <1250000>, <1200000>,
+                                                <1200000>, <1200000>,
+                                                <1200000>, <1200000>,
+                                                <1200000>, <1200000>;
+
+               s5m8767,pmic-buck3-dvs-voltage = <1100000>, <1100000>,
+                                                <1100000>, <1100000>,
+                                                <1100000>, <1100000>,
+                                                <1100000>, <1100000>;
+
+               s5m8767,pmic-buck4-dvs-voltage = <1200000>, <1200000>,
+                                                <1200000>, <1200000>,
+                                                <1200000>, <1200000>,
+                                                <1200000>, <1200000>;
+
+               regulators {
+                       ldo1_reg: LDO1 {
+                               regulator-name = "VDD_ALIVE";
+                               regulator-min-microvolt = <1100000>;
+                               regulator-max-microvolt = <1100000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                               op_mode = <1>; /* Normal Mode */
+                       };
 
-               key_menu {
-                       keypad,row = <1>;
-                       keypad,column = <1>;
-                       linux,code = <KEY_MENU>;
-               };
+                       ldo2_reg: LDO2 {
+                               regulator-name = "VDDQ_M12";
+                               regulator-min-microvolt = <1200000>;
+                               regulator-max-microvolt = <1200000>;
+                               regulator-always-on;
+                               op_mode = <1>; /* Normal Mode */
+                       };
 
-               key_back {
-                       keypad,row = <2>;
-                       keypad,column = <0>;
-                       linux,code = <KEY_BACK>;
-               };
+                       ldo3_reg: LDO3 {
+                               regulator-name = "VDDIOAP_18";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-always-on;
+                               op_mode = <1>; /* Normal Mode */
+                       };
+
+                       ldo4_reg: LDO4 {
+                               regulator-name = "VDDQ_PRE";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-always-on;
+                               op_mode = <1>; /* Normal Mode */
+                       };
+
+                       ldo5_reg: LDO5 {
+                               regulator-name = "VDD18_2M";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-always-on;
+                               op_mode = <1>; /* Normal Mode */
+                       };
+
+                       ldo6_reg: LDO6 {
+                               regulator-name = "VDD10_MPLL";
+                               regulator-min-microvolt = <1000000>;
+                               regulator-max-microvolt = <1000000>;
+                               regulator-always-on;
+                               op_mode = <1>; /* Normal Mode */
+                       };
+
+                       ldo7_reg: LDO7 {
+                               regulator-name = "VDD10_XPLL";
+                               regulator-min-microvolt = <1000000>;
+                               regulator-max-microvolt = <1000000>;
+                               regulator-always-on;
+                               op_mode = <1>; /* Normal Mode */
+                       };
+
+                       ldo8_reg: LDO8 {
+                               regulator-name = "VDD10_MIPI";
+                               regulator-min-microvolt = <1000000>;
+                               regulator-max-microvolt = <1000000>;
+                               regulator-always-on;
+                               op_mode = <1>; /* Normal Mode */
+                       };
+
+                       ldo9_reg: LDO9 {
+                               regulator-name = "VDD33_LCD";
+                               regulator-min-microvolt = <3300000>;
+                               regulator-max-microvolt = <3300000>;
+                               regulator-always-on;
+                               op_mode = <1>; /* Normal Mode */
+                       };
+
+                       ldo10_reg: LDO10 {
+                               regulator-name = "VDD18_MIPI";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-always-on;
+                               op_mode = <1>; /* Normal Mode */
+                       };
+
+                       ldo11_reg: LDO11 {
+                               regulator-name = "VDD18_ABB1";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-always-on;
+                               op_mode = <1>; /* Normal Mode */
+                       };
+
+                       ldo12_reg: LDO12 {
+                               regulator-name = "VDD33_UOTG";
+                               regulator-min-microvolt = <3300000>;
+                               regulator-max-microvolt = <3300000>;
+                               regulator-always-on;
+                               op_mode = <1>; /* Normal Mode */
+                       };
+
+                       ldo13_reg: LDO13 {
+                               regulator-name = "VDDIOPERI_18";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-always-on;
+                               op_mode = <1>; /* Normal Mode */
+                       };
+
+                       ldo14_reg: LDO14 {
+                               regulator-name = "VDD18_ABB02";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-always-on;
+                               op_mode = <1>; /* Normal Mode */
+                       };
+
+                       ldo15_reg: LDO15 {
+                               regulator-name = "VDD10_USH";
+                               regulator-min-microvolt = <1000000>;
+                               regulator-max-microvolt = <1000000>;
+                               regulator-always-on;
+                               op_mode = <1>; /* Normal Mode */
+                       };
+
+                       ldo16_reg: LDO16 {
+                               regulator-name = "VDD18_HSIC";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-always-on;
+                               op_mode = <1>; /* Normal Mode */
+                       };
+
+                       ldo17_reg: LDO17 {
+                               regulator-name = "VDDIOAP_MMC012_28";
+                               regulator-min-microvolt = <2800000>;
+                               regulator-max-microvolt = <2800000>;
+                               regulator-always-on;
+                               op_mode = <1>; /* Normal Mode */
+                       };
+
+                       ldo18_reg: LDO18 {
+                               regulator-name = "VDDIOPERI_28";
+                               regulator-min-microvolt = <2800000>;
+                               regulator-max-microvolt = <2800000>;
+                               regulator-always-on;
+                               op_mode = <1>; /* Normal Mode */
+                       };
+
+                       ldo19_reg: LDO19 {
+                               regulator-name = "DVDD25";
+                               regulator-min-microvolt = <2500000>;
+                               regulator-max-microvolt = <2500000>;
+                               regulator-always-on;
+                               op_mode = <1>; /* Normal Mode */
+                       };
+
+                       ldo20_reg: LDO20 {
+                               regulator-name = "VDD28_CAM";
+                               regulator-min-microvolt = <2800000>;
+                               regulator-max-microvolt = <2800000>;
+                               regulator-always-on;
+                               op_mode = <1>; /* Normal Mode */
+                       };
+
+                       ldo21_reg: LDO21 {
+                               regulator-name = "VDD28_AF";
+                               regulator-min-microvolt = <2800000>;
+                               regulator-max-microvolt = <2800000>;
+                               regulator-always-on;
+                               op_mode = <1>; /* Normal Mode */
+                       };
+
+                       ldo22_reg: LDO22 {
+                               regulator-name = "VDDA28_2M";
+                               regulator-min-microvolt = <2800000>;
+                               regulator-max-microvolt = <2800000>;
+                               regulator-always-on;
+                               op_mode = <1>; /* Normal Mode */
+                       };
 
-               key_enter {
-                       keypad,row = <2>;
-                       keypad,column = <1>;
-                       linux,code = <KEY_ENTER>;
+                       ldo23_reg: LDO23 {
+                               regulator-name = "VDD28_TF";
+                               regulator-min-microvolt = <2800000>;
+                               regulator-max-microvolt = <2800000>;
+                               regulator-always-on;
+                               op_mode = <1>; /* Normal Mode */
+                       };
+
+                       ldo24_reg: LDO24 {
+                               regulator-name = "VDD33_A31";
+                               regulator-min-microvolt = <3300000>;
+                               regulator-max-microvolt = <3300000>;
+                               regulator-always-on;
+                               op_mode = <1>; /* Normal Mode */
+                       };
+
+                       ldo25_reg: LDO25 {
+                               regulator-name = "VDD18_CAM";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-always-on;
+                               op_mode = <1>; /* Normal Mode */
+                       };
+
+                       ldo26_reg: LDO26 {
+                               regulator-name = "VDD18_A31";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-always-on;
+                               op_mode = <1>; /* Normal Mode */
+                       };
+
+                       ldo27_reg: LDO27 {
+                               regulator-name = "GPS_1V8";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-always-on;
+                               op_mode = <1>; /* Normal Mode */
+                       };
+
+                       ldo28_reg: LDO28 {
+                               regulator-name = "DVDD12";
+                               regulator-min-microvolt = <1200000>;
+                               regulator-max-microvolt = <1200000>;
+                               regulator-always-on;
+                               op_mode = <1>; /* Normal Mode */
+                       };
+
+                       buck1_reg: BUCK1 {
+                               regulator-name = "vdd_mif";
+                               regulator-min-microvolt = <950000>;
+                               regulator-max-microvolt = <1100000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                               op_mode = <1>; /* Normal Mode */
+                       };
+
+                       buck2_reg: BUCK2 {
+                               regulator-name = "vdd_arm";
+                               regulator-min-microvolt = <900000>;
+                               regulator-max-microvolt = <1350000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                               op_mode = <1>; /* Normal Mode */
+                       };
+
+                       buck3_reg: BUCK3 {
+                               regulator-name = "vdd_int";
+                               regulator-min-microvolt = <900000>;
+                               regulator-max-microvolt = <1200000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                               op_mode = <1>; /* Normal Mode */
+                       };
+
+                       buck4_reg: BUCK4 {
+                               regulator-name = "vdd_g3d";
+                               regulator-min-microvolt = <750000>;
+                               regulator-max-microvolt = <1500000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                               op_mode = <1>; /* Normal Mode */
+                       };
+
+                       buck5_reg: BUCK5 {
+                               regulator-name = "vdd_m12";
+                               regulator-min-microvolt = <750000>;
+                               regulator-max-microvolt = <1500000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                               op_mode = <1>; /* Normal Mode */
+                       };
+
+                       buck6_reg: BUCK6 {
+                               regulator-name = "vdd12_5m";
+                               regulator-min-microvolt = <750000>;
+                               regulator-max-microvolt = <1500000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                               op_mode = <1>; /* Normal Mode */
+                       };
+
+                       buck9_reg: BUCK9 {
+                               regulator-name = "vddf28_emmc";
+                               regulator-min-microvolt = <750000>;
+                               regulator-max-microvolt = <3000000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                               op_mode = <1>; /* Normal Mode */
+                       };
                };
        };
+};
 
-       g2d@10800000 {
-               status = "okay";
+&keypad {
+       samsung,keypad-num-rows = <3>;
+       samsung,keypad-num-columns = <2>;
+       linux,keypad-no-autorepeat;
+       linux,keypad-wakeup;
+       pinctrl-0 = <&keypad_rows &keypad_cols>;
+       pinctrl-names = "default";
+       status = "okay";
+
+       key_home {
+               keypad,row = <0>;
+               keypad,column = <0>;
+               linux,code = <KEY_HOME>;
        };
 
-       sdhci@12530000 {
-               bus-width = <4>;
-               pinctrl-0 = <&sd2_clk &sd2_cmd &sd2_bus4 &sd2_cd>;
-               pinctrl-names = "default";
-               vmmc-supply = <&mmc_reg>;
-               status = "okay";
+       key_down {
+               keypad,row = <0>;
+               keypad,column = <1>;
+               linux,code = <KEY_DOWN>;
        };
 
-       mmc@12550000 {
-               pinctrl-0 = <&sd4_clk &sd4_cmd &sd4_bus4 &sd4_bus8>;
-               pinctrl-names = "default";
-               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>;
-               bus-width = <8>;
-               cap-mmc-highspeed;
+       key_up {
+               keypad,row = <1>;
+               keypad,column = <0>;
+               linux,code = <KEY_UP>;
        };
 
-       codec@13400000 {
-               samsung,mfc-r = <0x43000000 0x800000>;
-               samsung,mfc-l = <0x51000000 0x800000>;
-               status = "okay";
+       key_menu {
+               keypad,row = <1>;
+               keypad,column = <1>;
+               linux,code = <KEY_MENU>;
        };
 
-       fimd@11c00000 {
-               pinctrl-0 = <&lcd_clk &lcd_data24 &pwm1_out>;
-               pinctrl-names = "default";
-               status = "okay";
+       key_back {
+               keypad,row = <2>;
+               keypad,column = <0>;
+               linux,code = <KEY_BACK>;
        };
 
-       display-timings {
-               native-mode = <&timing0>;
-               timing0: timing {
-                       clock-frequency = <47500000>;
-                       hactive = <1024>;
-                       vactive = <600>;
-                       hfront-porch = <64>;
-                       hback-porch = <16>;
-                       hsync-len = <48>;
-                       vback-porch = <64>;
-                       vfront-porch = <16>;
-                       vsync-len = <3>;
-               };
+       key_enter {
+               keypad,row = <2>;
+               keypad,column = <1>;
+               linux,code = <KEY_ENTER>;
        };
+};
 
-       serial@13800000 {
-               status = "okay";
-       };
+&mfc {
+       samsung,mfc-r = <0x43000000 0x800000>;
+       samsung,mfc-l = <0x51000000 0x800000>;
+       status = "okay";
+};
 
-       serial@13810000 {
-               status = "okay";
-       };
+&mshc_0 {
+       pinctrl-0 = <&sd4_clk &sd4_cmd &sd4_bus4 &sd4_bus8>;
+       pinctrl-names = "default";
+       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>;
+       bus-width = <8>;
+       cap-mmc-highspeed;
+};
 
-       serial@13820000 {
-               status = "okay";
+&pinctrl_1 {
+       keypad_rows: keypad-rows {
+               samsung,pins = "gpx2-0", "gpx2-1", "gpx2-2";
+               samsung,pin-function = <3>;
+               samsung,pin-pud = <3>;
+               samsung,pin-drv = <0>;
        };
 
-       serial@13830000 {
-               status = "okay";
+       keypad_cols: keypad-cols {
+               samsung,pins = "gpx1-0", "gpx1-1";
+               samsung,pin-function = <3>;
+               samsung,pin-pud = <0>;
+               samsung,pin-drv = <0>;
        };
+};
 
-       i2c@13860000 {
-               #address-cells = <1>;
-               #size-cells = <0>;
-               samsung,i2c-sda-delay = <100>;
-               samsung,i2c-max-bus-freq = <20000>;
-               pinctrl-0 = <&i2c0_bus>;
-               pinctrl-names = "default";
-               status = "okay";
-
-               s5m8767_pmic@66 {
-                       compatible = "samsung,s5m8767-pmic";
-                       reg = <0x66>;
-
-                       s5m8767,pmic-buck-default-dvs-idx = <3>;
-
-                       s5m8767,pmic-buck-dvs-gpios = <&gpx2 3 0>,
-                                                        <&gpx2 4 0>,
-                                                        <&gpx2 5 0>;
-
-                       s5m8767,pmic-buck-ds-gpios = <&gpm3 5 0>,
-                                                       <&gpm3 6 0>,
-                                                       <&gpm3 7 0>;
-
-                       s5m8767,pmic-buck2-dvs-voltage = <1250000>, <1200000>,
-                                                        <1200000>, <1200000>,
-                                                        <1200000>, <1200000>,
-                                                        <1200000>, <1200000>;
-
-                       s5m8767,pmic-buck3-dvs-voltage = <1100000>, <1100000>,
-                                                        <1100000>, <1100000>,
-                                                        <1100000>, <1100000>,
-                                                        <1100000>, <1100000>;
-
-                       s5m8767,pmic-buck4-dvs-voltage = <1200000>, <1200000>,
-                                                        <1200000>, <1200000>,
-                                                        <1200000>, <1200000>,
-                                                        <1200000>, <1200000>;
-
-                       regulators {
-                               ldo1_reg: LDO1 {
-                                       regulator-name = "VDD_ALIVE";
-                                       regulator-min-microvolt = <1100000>;
-                                       regulator-max-microvolt = <1100000>;
-                                       regulator-always-on;
-                                       regulator-boot-on;
-                                       op_mode = <1>; /* Normal Mode */
-                               };
-
-                               ldo2_reg: LDO2 {
-                                       regulator-name = "VDDQ_M12";
-                                       regulator-min-microvolt = <1200000>;
-                                       regulator-max-microvolt = <1200000>;
-                                       regulator-always-on;
-                                       op_mode = <1>; /* Normal Mode */
-                               };
-
-                               ldo3_reg: LDO3 {
-                                       regulator-name = "VDDIOAP_18";
-                                       regulator-min-microvolt = <1800000>;
-                                       regulator-max-microvolt = <1800000>;
-                                       regulator-always-on;
-                                       op_mode = <1>; /* Normal Mode */
-                               };
-
-                               ldo4_reg: LDO4 {
-                                       regulator-name = "VDDQ_PRE";
-                                       regulator-min-microvolt = <1800000>;
-                                       regulator-max-microvolt = <1800000>;
-                                       regulator-always-on;
-                                       op_mode = <1>; /* Normal Mode */
-                               };
-
-                               ldo5_reg: LDO5 {
-                                       regulator-name = "VDD18_2M";
-                                       regulator-min-microvolt = <1800000>;
-                                       regulator-max-microvolt = <1800000>;
-                                       regulator-always-on;
-                                       op_mode = <1>; /* Normal Mode */
-                               };
-
-                               ldo6_reg: LDO6 {
-                                       regulator-name = "VDD10_MPLL";
-                                       regulator-min-microvolt = <1000000>;
-                                       regulator-max-microvolt = <1000000>;
-                                       regulator-always-on;
-                                       op_mode = <1>; /* Normal Mode */
-                               };
-
-                               ldo7_reg: LDO7 {
-                                       regulator-name = "VDD10_XPLL";
-                                       regulator-min-microvolt = <1000000>;
-                                       regulator-max-microvolt = <1000000>;
-                                       regulator-always-on;
-                                       op_mode = <1>; /* Normal Mode */
-                               };
-
-                               ldo8_reg: LDO8 {
-                                       regulator-name = "VDD10_MIPI";
-                                       regulator-min-microvolt = <1000000>;
-                                       regulator-max-microvolt = <1000000>;
-                                       regulator-always-on;
-                                       op_mode = <1>; /* Normal Mode */
-                               };
-
-                               ldo9_reg: LDO9 {
-                                       regulator-name = "VDD33_LCD";
-                                       regulator-min-microvolt = <3300000>;
-                                       regulator-max-microvolt = <3300000>;
-                                       regulator-always-on;
-                                       op_mode = <1>; /* Normal Mode */
-                               };
-
-                               ldo10_reg: LDO10 {
-                                       regulator-name = "VDD18_MIPI";
-                                       regulator-min-microvolt = <1800000>;
-                                       regulator-max-microvolt = <1800000>;
-                                       regulator-always-on;
-                                       op_mode = <1>; /* Normal Mode */
-                               };
-
-                               ldo11_reg: LDO11 {
-                                       regulator-name = "VDD18_ABB1";
-                                       regulator-min-microvolt = <1800000>;
-                                       regulator-max-microvolt = <1800000>;
-                                       regulator-always-on;
-                                       op_mode = <1>; /* Normal Mode */
-                               };
-
-                               ldo12_reg: LDO12 {
-                                       regulator-name = "VDD33_UOTG";
-                                       regulator-min-microvolt = <3300000>;
-                                       regulator-max-microvolt = <3300000>;
-                                       regulator-always-on;
-                                       op_mode = <1>; /* Normal Mode */
-                               };
-
-                               ldo13_reg: LDO13 {
-                                       regulator-name = "VDDIOPERI_18";
-                                       regulator-min-microvolt = <1800000>;
-                                       regulator-max-microvolt = <1800000>;
-                                       regulator-always-on;
-                                       op_mode = <1>; /* Normal Mode */
-                               };
-
-                               ldo14_reg: LDO14 {
-                                       regulator-name = "VDD18_ABB02";
-                                       regulator-min-microvolt = <1800000>;
-                                       regulator-max-microvolt = <1800000>;
-                                       regulator-always-on;
-                                       op_mode = <1>; /* Normal Mode */
-                               };
-
-                               ldo15_reg: LDO15 {
-                                       regulator-name = "VDD10_USH";
-                                       regulator-min-microvolt = <1000000>;
-                                       regulator-max-microvolt = <1000000>;
-                                       regulator-always-on;
-                                       op_mode = <1>; /* Normal Mode */
-                               };
-
-                               ldo16_reg: LDO16 {
-                                       regulator-name = "VDD18_HSIC";
-                                       regulator-min-microvolt = <1800000>;
-                                       regulator-max-microvolt = <1800000>;
-                                       regulator-always-on;
-                                       op_mode = <1>; /* Normal Mode */
-                               };
-
-                               ldo17_reg: LDO17 {
-                                       regulator-name = "VDDIOAP_MMC012_28";
-                                       regulator-min-microvolt = <2800000>;
-                                       regulator-max-microvolt = <2800000>;
-                                       regulator-always-on;
-                                       op_mode = <1>; /* Normal Mode */
-                               };
-
-                               ldo18_reg: LDO18 {
-                                       regulator-name = "VDDIOPERI_28";
-                                       regulator-min-microvolt = <2800000>;
-                                       regulator-max-microvolt = <2800000>;
-                                       regulator-always-on;
-                                       op_mode = <1>; /* Normal Mode */
-                               };
-
-                               ldo19_reg: LDO19 {
-                                       regulator-name = "DVDD25";
-                                       regulator-min-microvolt = <2500000>;
-                                       regulator-max-microvolt = <2500000>;
-                                       regulator-always-on;
-                                       op_mode = <1>; /* Normal Mode */
-                               };
-
-                               ldo20_reg: LDO20 {
-                                       regulator-name = "VDD28_CAM";
-                                       regulator-min-microvolt = <2800000>;
-                                       regulator-max-microvolt = <2800000>;
-                                       regulator-always-on;
-                                       op_mode = <1>; /* Normal Mode */
-                               };
-
-                               ldo21_reg: LDO21 {
-                                       regulator-name = "VDD28_AF";
-                                       regulator-min-microvolt = <2800000>;
-                                       regulator-max-microvolt = <2800000>;
-                                       regulator-always-on;
-                                       op_mode = <1>; /* Normal Mode */
-                               };
-
-                               ldo22_reg: LDO22 {
-                                       regulator-name = "VDDA28_2M";
-                                       regulator-min-microvolt = <2800000>;
-                                       regulator-max-microvolt = <2800000>;
-                                       regulator-always-on;
-                                       op_mode = <1>; /* Normal Mode */
-                               };
-
-                               ldo23_reg: LDO23 {
-                                       regulator-name = "VDD28_TF";
-                                       regulator-min-microvolt = <2800000>;
-                                       regulator-max-microvolt = <2800000>;
-                                       regulator-always-on;
-                                       op_mode = <1>; /* Normal Mode */
-                               };
-
-                               ldo24_reg: LDO24 {
-                                       regulator-name = "VDD33_A31";
-                                       regulator-min-microvolt = <3300000>;
-                                       regulator-max-microvolt = <3300000>;
-                                       regulator-always-on;
-                                       op_mode = <1>; /* Normal Mode */
-                               };
-
-                               ldo25_reg: LDO25 {
-                                       regulator-name = "VDD18_CAM";
-                                       regulator-min-microvolt = <1800000>;
-                                       regulator-max-microvolt = <1800000>;
-                                       regulator-always-on;
-                                       op_mode = <1>; /* Normal Mode */
-                               };
-
-                               ldo26_reg: LDO26 {
-                                       regulator-name = "VDD18_A31";
-                                       regulator-min-microvolt = <1800000>;
-                                       regulator-max-microvolt = <1800000>;
-                                       regulator-always-on;
-                                       op_mode = <1>; /* Normal Mode */
-                               };
-
-                               ldo27_reg: LDO27 {
-                                       regulator-name = "GPS_1V8";
-                                       regulator-min-microvolt = <1800000>;
-                                       regulator-max-microvolt = <1800000>;
-                                       regulator-always-on;
-                                       op_mode = <1>; /* Normal Mode */
-                               };
-
-                               ldo28_reg: LDO28 {
-                                       regulator-name = "DVDD12";
-                                       regulator-min-microvolt = <1200000>;
-                                       regulator-max-microvolt = <1200000>;
-                                       regulator-always-on;
-                                       op_mode = <1>; /* Normal Mode */
-                               };
-
-                               buck1_reg: BUCK1 {
-                                       regulator-name = "vdd_mif";
-                                       regulator-min-microvolt = <950000>;
-                                       regulator-max-microvolt = <1100000>;
-                                       regulator-always-on;
-                                       regulator-boot-on;
-                                       op_mode = <1>; /* Normal Mode */
-                               };
-
-                               buck2_reg: BUCK2 {
-                                       regulator-name = "vdd_arm";
-                                       regulator-min-microvolt = <900000>;
-                                       regulator-max-microvolt = <1350000>;
-                                       regulator-always-on;
-                                       regulator-boot-on;
-                                       op_mode = <1>; /* Normal Mode */
-                               };
-
-                               buck3_reg: BUCK3 {
-                                       regulator-name = "vdd_int";
-                                       regulator-min-microvolt = <900000>;
-                                       regulator-max-microvolt = <1200000>;
-                                       regulator-always-on;
-                                       regulator-boot-on;
-                                       op_mode = <1>; /* Normal Mode */
-                               };
-
-                               buck4_reg: BUCK4 {
-                                       regulator-name = "vdd_g3d";
-                                       regulator-min-microvolt = <750000>;
-                                       regulator-max-microvolt = <1500000>;
-                                       regulator-always-on;
-                                       regulator-boot-on;
-                                       op_mode = <1>; /* Normal Mode */
-                               };
-
-                               buck5_reg: BUCK5 {
-                                       regulator-name = "vdd_m12";
-                                       regulator-min-microvolt = <750000>;
-                                       regulator-max-microvolt = <1500000>;
-                                       regulator-always-on;
-                                       regulator-boot-on;
-                                       op_mode = <1>; /* Normal Mode */
-                               };
-
-                               buck6_reg: BUCK6 {
-                                       regulator-name = "vdd12_5m";
-                                       regulator-min-microvolt = <750000>;
-                                       regulator-max-microvolt = <1500000>;
-                                       regulator-always-on;
-                                       regulator-boot-on;
-                                       op_mode = <1>; /* Normal Mode */
-                               };
-
-                               buck9_reg: BUCK9 {
-                                       regulator-name = "vddf28_emmc";
-                                       regulator-min-microvolt = <750000>;
-                                       regulator-max-microvolt = <3000000>;
-                                       regulator-always-on;
-                                       regulator-boot-on;
-                                       op_mode = <1>; /* Normal Mode */
-                               };
-                       };
-               };
-       };
+&rtc {
+       status = "okay";
+};
 
-       fixed-rate-clocks {
-               xxti {
-                       compatible = "samsung,clock-xxti";
-                       clock-frequency = <0>;
-               };
+&sdhci_2 {
+       bus-width = <4>;
+       pinctrl-0 = <&sd2_clk &sd2_cmd &sd2_bus4 &sd2_cd>;
+       pinctrl-names = "default";
+       vmmc-supply = <&mmc_reg>;
+       status = "okay";
+};
 
-               xusbxti {
-                       compatible = "samsung,clock-xusbxti";
-                       clock-frequency = <24000000>;
-               };
-       };
+&serial_0 {
+       status = "okay";
+};
+
+&serial_1 {
+       status = "okay";
+};
+
+&serial_2 {
+       status = "okay";
+};
+
+&serial_3 {
+       status = "okay";
+};
+
+&watchdog {
+       status = "okay";
 };
index b9256afbcc683ecdc3df2daf3d7276eee7fc1a2e..c2421df1fa436a188c3ba0a0085eb79691189ed9 100644 (file)
                stdout-path = &serial_1;
        };
 
-       g2d@10800000 {
-               status = "okay";
-       };
-
-       pinctrl@11000000 {
-               keypad_rows: keypad-rows {
-                       samsung,pins = "gpx2-0", "gpx2-1", "gpx2-2";
-                       samsung,pin-function = <3>;
-                       samsung,pin-pud = <3>;
-                       samsung,pin-drv = <0>;
+       fixed-rate-clocks {
+               xxti {
+                       compatible = "samsung,clock-xxti";
+                       clock-frequency = <0>;
                };
 
-               keypad_cols: keypad-cols {
-                       samsung,pins = "gpx1-0", "gpx1-1", "gpx1-2", "gpx1-3",
-                                      "gpx1-4", "gpx1-5", "gpx1-6", "gpx1-7";
-                       samsung,pin-function = <3>;
-                       samsung,pin-pud = <0>;
-                       samsung,pin-drv = <0>;
+               xusbxti {
+                       compatible = "samsung,clock-xusbxti";
+                       clock-frequency = <24000000>;
                };
        };
+};
 
-       keypad@100A0000 {
-               samsung,keypad-num-rows = <3>;
-               samsung,keypad-num-columns = <8>;
-               linux,keypad-no-autorepeat;
-               linux,keypad-wakeup;
-               pinctrl-0 = <&keypad_rows &keypad_cols>;
-               pinctrl-names = "default";
-               status = "okay";
-
-               key_1 {
-                       keypad,row = <1>;
-                       keypad,column = <3>;
-                       linux,code = <2>;
-               };
-
-               key_2 {
-                       keypad,row = <1>;
-                       keypad,column = <4>;
-                       linux,code = <3>;
-               };
-
-               key_3 {
-                       keypad,row = <1>;
-                       keypad,column = <5>;
-                       linux,code = <4>;
-               };
-
-               key_4 {
-                       keypad,row = <1>;
-                       keypad,column = <6>;
-                       linux,code = <5>;
-               };
+&g2d {
+       status = "okay";
+};
 
-               key_5 {
-                       keypad,row = <1>;
-                       keypad,column = <7>;
-                       linux,code = <6>;
-               };
+&keypad {
+       samsung,keypad-num-rows = <3>;
+       samsung,keypad-num-columns = <8>;
+       linux,keypad-no-autorepeat;
+       linux,keypad-wakeup;
+       pinctrl-0 = <&keypad_rows &keypad_cols>;
+       pinctrl-names = "default";
+       status = "okay";
+
+       key_1 {
+               keypad,row = <1>;
+               keypad,column = <3>;
+               linux,code = <2>;
+       };
 
-               key_A {
-                       keypad,row = <2>;
-                       keypad,column = <6>;
-                       linux,code = <30>;
-               };
+       key_2 {
+               keypad,row = <1>;
+               keypad,column = <4>;
+               linux,code = <3>;
+       };
 
-               key_B {
-                       keypad,row = <2>;
-                       keypad,column = <7>;
-                       linux,code = <48>;
-               };
+       key_3 {
+               keypad,row = <1>;
+               keypad,column = <5>;
+               linux,code = <4>;
+       };
 
-               key_C {
-                       keypad,row = <0>;
-                       keypad,column = <5>;
-                       linux,code = <46>;
-               };
+       key_4 {
+               keypad,row = <1>;
+               keypad,column = <6>;
+               linux,code = <5>;
+       };
 
-               key_D {
-                       keypad,row = <2>;
-                       keypad,column = <5>;
-                       linux,code = <32>;
-               };
+       key_5 {
+               keypad,row = <1>;
+               keypad,column = <7>;
+               linux,code = <6>;
+       };
 
-               key_E {
-                       keypad,row = <0>;
-                       keypad,column = <7>;
-                       linux,code = <18>;
-               };
+       key_A {
+               keypad,row = <2>;
+               keypad,column = <6>;
+               linux,code = <30>;
        };
 
-       sdhci@12530000 {
-               bus-width = <4>;
-               pinctrl-0 = <&sd2_clk &sd2_cmd &sd2_bus4 &sd2_cd>;
-               pinctrl-names = "default";
-               status = "okay";
+       key_B {
+               keypad,row = <2>;
+               keypad,column = <7>;
+               linux,code = <48>;
        };
 
-       codec@13400000 {
-               samsung,mfc-r = <0x43000000 0x800000>;
-               samsung,mfc-l = <0x51000000 0x800000>;
-               status = "okay";
+       key_C {
+               keypad,row = <0>;
+               keypad,column = <5>;
+               linux,code = <46>;
        };
 
-       serial@13800000 {
-               status = "okay";
+       key_D {
+               keypad,row = <2>;
+               keypad,column = <5>;
+               linux,code = <32>;
        };
 
-       serial@13810000 {
-               status = "okay";
+       key_E {
+               keypad,row = <0>;
+               keypad,column = <7>;
+               linux,code = <18>;
        };
+};
+
+&mfc {
+       samsung,mfc-r = <0x43000000 0x800000>;
+       samsung,mfc-l = <0x51000000 0x800000>;
+       status = "okay";
+};
 
-       serial@13820000 {
-               status = "okay";
+&pinctrl_1 {
+       keypad_rows: keypad-rows {
+               samsung,pins = "gpx2-0", "gpx2-1", "gpx2-2";
+               samsung,pin-function = <3>;
+               samsung,pin-pud = <3>;
+               samsung,pin-drv = <0>;
        };
 
-       serial@13830000 {
-               status = "okay";
+       keypad_cols: keypad-cols {
+               samsung,pins = "gpx1-0", "gpx1-1", "gpx1-2", "gpx1-3",
+                              "gpx1-4", "gpx1-5", "gpx1-6", "gpx1-7";
+               samsung,pin-function = <3>;
+               samsung,pin-pud = <0>;
+               samsung,pin-drv = <0>;
        };
+};
 
-       fixed-rate-clocks {
-               xxti {
-                       compatible = "samsung,clock-xxti";
-                       clock-frequency = <0>;
-               };
+&sdhci_2 {
+       bus-width = <4>;
+       pinctrl-0 = <&sd2_clk &sd2_cmd &sd2_bus4 &sd2_cd>;
+       pinctrl-names = "default";
+       status = "okay";
+};
 
-               xusbxti {
-                       compatible = "samsung,clock-xusbxti";
-                       clock-frequency = <24000000>;
-               };
-       };
+&serial_0 {
+       status = "okay";
+};
+
+&serial_1 {
+       status = "okay";
+};
+
+&serial_2 {
+       status = "okay";
+};
+
+&serial_3 {
+       status = "okay";
 };
index d46fd4c2aeaa5a04bc4ba143150fe50626d0473b..525684ca8dc0ddfab9063c7bb5f69bb4b1c95ebc 100644 (file)
                };
        };
 
-       rtc@10070000 {
-               status = "okay";
-       };
-
-       sdhci@12530000 {
-               bus-width = <4>;
-               pinctrl-0 = <&sd2_clk &sd2_cmd &sd2_cd &sd2_bus4>;
-               pinctrl-names = "default";
-               status = "okay";
-       };
-
-       serial@13800000 {
-               status = "okay";
-       };
-
-       serial@13810000 {
-               status = "okay";
-       };
-
-       serial@13820000 {
-               status = "okay";
-       };
-
-       serial@13830000 {
-               status = "okay";
-       };
-
        fixed-rate-clocks {
                xxti {
                        compatible = "samsung,clock-xxti";
                };
        };
 };
+
+&rtc {
+       status = "okay";
+};
+
+&sdhci_2 {
+       bus-width = <4>;
+       pinctrl-0 = <&sd2_clk &sd2_cmd &sd2_cd &sd2_bus4>;
+       pinctrl-names = "default";
+       status = "okay";
+};
+
+&serial_0 {
+       status = "okay";
+};
+
+&serial_1 {
+       status = "okay";
+};
+
+&serial_2 {
+       status = "okay";
+};
+
+&serial_3 {
+       status = "okay";
+};
index 792394dd0f2ab3ebf347af1e3f08d7ad330ee997..afc199d78cb9b3ed1d3cbdb5c433fd1617a4844e 100644 (file)
@@ -16,6 +16,7 @@
 #include "exynos4412.dtsi"
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/interrupt-controller/irq.h>
+#include <dt-bindings/clock/maxim,max77686.h>
 
 / {
        model = "Samsung Trats 2 based on Exynos4412";
                };
        };
 
-       adc: adc@126C0000 {
-               vdd-supply = <&ldo3_reg>;
-               status = "okay";
-       };
-
-       i2c@13890000 {
-               samsung,i2c-sda-delay = <100>;
-               samsung,i2c-slave-addr = <0x10>;
-               samsung,i2c-max-bus-freq = <400000>;
-               pinctrl-0 = <&i2c3_bus>;
-               pinctrl-names = "default";
-               status = "okay";
-
-               mms114-touchscreen@48 {
-                       compatible = "melfas,mms114";
-                       reg = <0x48>;
-                       interrupt-parent = <&gpm2>;
-                       interrupts = <3 2>;
-                       x-size = <720>;
-                       y-size = <1280>;
-                       avdd-supply = <&ldo23_reg>;
-                       vdd-supply = <&ldo24_reg>;
-               };
-       };
-
-       i2c_0: i2c@13860000 {
-               samsung,i2c-sda-delay = <100>;
-               samsung,i2c-slave-addr = <0x10>;
-               samsung,i2c-max-bus-freq = <400000>;
-               pinctrl-0 = <&i2c0_bus>;
-               pinctrl-names = "default";
-               status = "okay";
-
-               s5c73m3@3c {
-                       compatible = "samsung,s5c73m3";
-                       reg = <0x3c>;
-                       standby-gpios = <&gpm0 1 1>;   /* ISP_STANDBY */
-                       xshutdown-gpios = <&gpf1 3 1>; /* ISP_RESET */
-                       vdd-int-supply = <&buck9_reg>;
-                       vddio-cis-supply = <&ldo9_reg>;
-                       vdda-supply = <&ldo17_reg>;
-                       vddio-host-supply = <&ldo18_reg>;
-                       vdd-af-supply = <&cam_af_reg>;
-                       vdd-reg-supply = <&cam_io_reg>;
-                       clock-frequency = <24000000>;
-                       /* CAM_A_CLKOUT */
-                       clocks = <&camera 0>;
-                       clock-names = "cis_extclk";
-                       port {
-                               s5c73m3_ep: endpoint {
-                                       remote-endpoint = <&csis0_ep>;
-                                       data-lanes = <1 2 3 4>;
-                               };
-                       };
-               };
-       };
-
-       i2c@138A0000 {
-               samsung,i2c-sda-delay = <100>;
-               samsung,i2c-slave-addr = <0x10>;
-               samsung,i2c-max-bus-freq = <100000>;
-               pinctrl-0 = <&i2c4_bus>;
-               pinctrl-names = "default";
-               status = "okay";
-
-               wm1811: wm1811@1a {
-                       compatible = "wlf,wm1811";
-                       reg = <0x1a>;
-                       clocks = <&pmu_system_controller 0>;
-                       clock-names = "MCLK1";
-                       DCVDD-supply = <&ldo3_reg>;
-                       DBVDD1-supply = <&ldo3_reg>;
-                       wlf,ldo1ena = <&gpj0 4 0>;
-               };
-       };
-
-       i2c@138D0000 {
-               samsung,i2c-sda-delay = <100>;
-               samsung,i2c-slave-addr = <0x10>;
-               samsung,i2c-max-bus-freq = <100000>;
-               pinctrl-0 = <&i2c7_bus>;
-               pinctrl-names = "default";
-               status = "okay";
-
-               max77686_pmic@09 {
-                       compatible = "maxim,max77686";
-                       interrupt-parent = <&gpx0>;
-                       interrupts = <7 0>;
-                       reg = <0x09>;
-                       #clock-cells = <1>;
-
-                       voltage-regulators {
-                               ldo1_reg: ldo1 {
-                                       regulator-compatible = "LDO1";
-                                       regulator-name = "VALIVE_1.0V_AP";
-                                       regulator-min-microvolt = <1000000>;
-                                       regulator-max-microvolt = <1000000>;
-                                       regulator-always-on;
-                               };
-
-                               ldo2_reg: ldo2 {
-                                       regulator-compatible = "LDO2";
-                                       regulator-name = "VM1M2_1.2V_AP";
-                                       regulator-min-microvolt = <1200000>;
-                                       regulator-max-microvolt = <1200000>;
-                                       regulator-always-on;
-                                       regulator-state-mem {
-                                               regulator-on-in-suspend;
-                                       };
-                               };
-
-                               ldo3_reg: ldo3 {
-                                       regulator-compatible = "LDO3";
-                                       regulator-name = "VCC_1.8V_AP";
-                                       regulator-min-microvolt = <1800000>;
-                                       regulator-max-microvolt = <1800000>;
-                                       regulator-always-on;
-                               };
-
-                               ldo4_reg: ldo4 {
-                                       regulator-compatible = "LDO4";
-                                       regulator-name = "VCC_2.8V_AP";
-                                       regulator-min-microvolt = <2800000>;
-                                       regulator-max-microvolt = <2800000>;
-                                       regulator-always-on;
-                               };
-
-                               ldo5_reg: ldo5 {
-                                       regulator-compatible = "LDO5";
-                                       regulator-name = "VCC_1.8V_IO";
-                                       regulator-min-microvolt = <1800000>;
-                                       regulator-max-microvolt = <1800000>;
-                                       regulator-always-on;
-                               };
-
-                               ldo6_reg: ldo6 {
-                                       regulator-compatible = "LDO6";
-                                       regulator-name = "VMPLL_1.0V_AP";
-                                       regulator-min-microvolt = <1000000>;
-                                       regulator-max-microvolt = <1000000>;
-                                       regulator-always-on;
-                                       regulator-state-mem {
-                                               regulator-on-in-suspend;
-                                       };
-                               };
-
-                               ldo7_reg: ldo7 {
-                                       regulator-compatible = "LDO7";
-                                       regulator-name = "VPLL_1.0V_AP";
-                                       regulator-min-microvolt = <1000000>;
-                                       regulator-max-microvolt = <1000000>;
-                                       regulator-always-on;
-                                       regulator-state-mem {
-                                               regulator-on-in-suspend;
-                                       };
-                               };
-
-                               ldo8_reg: ldo8 {
-                                       regulator-compatible = "LDO8";
-                                       regulator-name = "VMIPI_1.0V";
-                                       regulator-min-microvolt = <1000000>;
-                                       regulator-max-microvolt = <1000000>;
-                                       regulator-state-mem {
-                                               regulator-off-in-suspend;
-                                       };
-                               };
-
-                               ldo9_reg: ldo9 {
-                                       regulator-compatible = "LDO9";
-                                       regulator-name = "CAM_ISP_MIPI_1.2V";
-                                       regulator-min-microvolt = <1200000>;
-                                       regulator-max-microvolt = <1200000>;
-                               };
-
-                               ldo10_reg: ldo10 {
-                                       regulator-compatible = "LDO10";
-                                       regulator-name = "VMIPI_1.8V";
-                                       regulator-min-microvolt = <1800000>;
-                                       regulator-max-microvolt = <1800000>;
-                                       regulator-state-mem {
-                                               regulator-off-in-suspend;
-                                       };
-                               };
-
-                               ldo11_reg: ldo11 {
-                                       regulator-compatible = "LDO11";
-                                       regulator-name = "VABB1_1.95V";
-                                       regulator-min-microvolt = <1950000>;
-                                       regulator-max-microvolt = <1950000>;
-                                       regulator-always-on;
-                                       regulator-state-mem {
-                                               regulator-off-in-suspend;
-                                       };
-                               };
-
-                               ldo12_reg: ldo12 {
-                                       regulator-compatible = "LDO12";
-                                       regulator-name = "VUOTG_3.0V";
-                                       regulator-min-microvolt = <3000000>;
-                                       regulator-max-microvolt = <3000000>;
-                                       regulator-state-mem {
-                                               regulator-off-in-suspend;
-                                       };
-                               };
-
-                               ldo13_reg: ldo13 {
-                                       regulator-compatible = "LDO13";
-                                       regulator-name = "NFC_AVDD_1.8V";
-                                       regulator-min-microvolt = <1800000>;
-                                       regulator-max-microvolt = <1800000>;
-                               };
-
-                               ldo14_reg: ldo14 {
-                                       regulator-compatible = "LDO14";
-                                       regulator-name = "VABB2_1.95V";
-                                       regulator-min-microvolt = <1950000>;
-                                       regulator-max-microvolt = <1950000>;
-                                       regulator-always-on;
-                                       regulator-state-mem {
-                                               regulator-off-in-suspend;
-                                       };
-                               };
-
-                               ldo15_reg: ldo15 {
-                                       regulator-compatible = "LDO15";
-                                       regulator-name = "VHSIC_1.0V";
-                                       regulator-min-microvolt = <1000000>;
-                                       regulator-max-microvolt = <1000000>;
-                                       regulator-state-mem {
-                                               regulator-on-in-suspend;
-                                       };
-                               };
-
-                               ldo16_reg: ldo16 {
-                                       regulator-compatible = "LDO16";
-                                       regulator-name = "VHSIC_1.8V";
-                                       regulator-min-microvolt = <1800000>;
-                                       regulator-max-microvolt = <1800000>;
-                                       regulator-state-mem {
-                                               regulator-on-in-suspend;
-                                       };
-                               };
-
-                               ldo17_reg: ldo17 {
-                                       regulator-compatible = "LDO17";
-                                       regulator-name = "CAM_SENSOR_CORE_1.2V";
-                                       regulator-min-microvolt = <1200000>;
-                                       regulator-max-microvolt = <1200000>;
-                               };
-
-                               ldo18_reg: ldo18 {
-                                       regulator-compatible = "LDO18";
-                                       regulator-name = "CAM_ISP_SEN_IO_1.8V";
-                                       regulator-min-microvolt = <1800000>;
-                                       regulator-max-microvolt = <1800000>;
-                               };
-
-                               ldo19_reg: ldo19 {
-                                       regulator-compatible = "LDO19";
-                                       regulator-name = "VT_CAM_1.8V";
-                                       regulator-min-microvolt = <1800000>;
-                                       regulator-max-microvolt = <1800000>;
-                               };
-
-                               ldo20_reg: ldo20 {
-                                       regulator-compatible = "LDO20";
-                                       regulator-name = "VDDQ_PRE_1.8V";
-                                       regulator-min-microvolt = <1800000>;
-                                       regulator-max-microvolt = <1800000>;
-                               };
-
-                               ldo21_reg: ldo21 {
-                                       regulator-compatible = "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";
-                                       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";
-                                       regulator-name = "TSP_AVDD_3.3V";
-                                       regulator-min-microvolt = <3300000>;
-                                       regulator-max-microvolt = <3300000>;
-                               };
-
-                               ldo24_reg: ldo24 {
-                                       regulator-compatible = "LDO24";
-                                       regulator-name = "TSP_VDD_1.8V";
-                                       regulator-min-microvolt = <1800000>;
-                                       regulator-max-microvolt = <1800000>;
-                               };
-
-                               ldo25_reg: ldo25 {
-                                       regulator-compatible = "LDO25";
-                                       regulator-name = "LCD_VCC_3.3V";
-                                       regulator-min-microvolt = <2800000>;
-                                       regulator-max-microvolt = <2800000>;
-                               };
-
-                               ldo26_reg: ldo26 {
-                                       regulator-compatible = "LDO26";
-                                       regulator-name = "MOTOR_VCC_3.0V";
-                                       regulator-min-microvolt = <3000000>;
-                                       regulator-max-microvolt = <3000000>;
-                               };
-
-                               buck1_reg: buck1 {
-                                       regulator-compatible = "BUCK1";
-                                       regulator-name = "vdd_mif";
-                                       regulator-min-microvolt = <850000>;
-                                       regulator-max-microvolt = <1100000>;
-                                       regulator-always-on;
-                                       regulator-boot-on;
-                                       regulator-state-mem {
-                                               regulator-off-in-suspend;
-                                       };
-                               };
-
-                               buck2_reg: buck2 {
-                                       regulator-compatible = "BUCK2";
-                                       regulator-name = "vdd_arm";
-                                       regulator-min-microvolt = <850000>;
-                                       regulator-max-microvolt = <1500000>;
-                                       regulator-always-on;
-                                       regulator-boot-on;
-                                       regulator-state-mem {
-                                               regulator-on-in-suspend;
-                                       };
-                               };
-
-                               buck3_reg: buck3 {
-                                       regulator-compatible = "BUCK3";
-                                       regulator-name = "vdd_int";
-                                       regulator-min-microvolt = <850000>;
-                                       regulator-max-microvolt = <1150000>;
-                                       regulator-always-on;
-                                       regulator-boot-on;
-                                       regulator-state-mem {
-                                               regulator-off-in-suspend;
-                                       };
-                               };
-
-                               buck4_reg: buck4 {
-                                       regulator-compatible = "BUCK4";
-                                       regulator-name = "vdd_g3d";
-                                       regulator-min-microvolt = <850000>;
-                                       regulator-max-microvolt = <1150000>;
-                                       regulator-boot-on;
-                                       regulator-state-mem {
-                                               regulator-off-in-suspend;
-                                       };
-                               };
-
-                               buck5_reg: buck5 {
-                                       regulator-compatible = "BUCK5";
-                                       regulator-name = "VMEM_1.2V_AP";
-                                       regulator-min-microvolt = <1200000>;
-                                       regulator-max-microvolt = <1200000>;
-                                       regulator-always-on;
-                               };
-
-                               buck6_reg: buck6 {
-                                       regulator-compatible = "BUCK6";
-                                       regulator-name = "VCC_SUB_1.35V";
-                                       regulator-min-microvolt = <1350000>;
-                                       regulator-max-microvolt = <1350000>;
-                                       regulator-always-on;
-                               };
-
-                               buck7_reg: buck7 {
-                                       regulator-compatible = "BUCK7";
-                                       regulator-name = "VCC_SUB_2.0V";
-                                       regulator-min-microvolt = <2000000>;
-                                       regulator-max-microvolt = <2000000>;
-                                       regulator-always-on;
-                               };
-
-                               buck8_reg: buck8 {
-                                       regulator-compatible = "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";
-                                       regulator-name = "CAM_ISP_CORE_1.2V";
-                                       regulator-min-microvolt = <1000000>;
-                                       regulator-max-microvolt = <1200000>;
-                                       maxim,ena-gpios = <&gpm0 3 GPIO_ACTIVE_HIGH>;
-                               };
-                       };
-               };
-       };
-
        i2c_max77693: i2c-gpio-1 {
                compatible = "i2c-gpio";
                gpios = <&gpm2 0 GPIO_ACTIVE_HIGH>, <&gpm2 1 GPIO_ACTIVE_HIGH>;
                };
        };
 
-       mmc@12550000 {
-               num-slots = <1>;
-               broken-cd;
-               non-removable;
-               card-detect-delay = <200>;
-               vmmc-supply = <&ldo22_reg>;
-               clock-frequency = <400000000>;
-               samsung,dw-mshc-ciu-div = <0>;
-               samsung,dw-mshc-sdr-timing = <2 3>;
-               samsung,dw-mshc-ddr-timing = <1 2>;
-               pinctrl-0 = <&sd4_clk &sd4_cmd &sd4_bus4 &sd4_bus8>;
-               pinctrl-names = "default";
-               status = "okay";
-               bus-width = <8>;
-               cap-mmc-highspeed;
-       };
-
-       sdhci@12530000 {
-               bus-width = <4>;
-               cd-gpios = <&gpx3 4 0>;
-               cd-inverted;
-               pinctrl-0 = <&sd2_clk &sd2_cmd &sd2_bus4>;
-               pinctrl-names = "default";
-               vmmc-supply = <&ldo21_reg>;
-               status = "okay";
-       };
-
-       serial@13800000 {
-               status = "okay";
-       };
-
-       serial@13810000 {
-               status = "okay";
-       };
-
-       serial@13820000 {
-               status = "okay";
-       };
-
-       serial@13830000 {
-               status = "okay";
-       };
-
-       tmu@100C0000 {
-               vtmu-supply = <&ldo10_reg>;
-               status = "okay";
-       };
-
        i2c_ak8975: i2c-gpio-0 {
                compatible = "i2c-gpio";
                gpios = <&gpy2 4 0>, <&gpy2 5 0>;
                };
        };
 
-       spi_1: spi@13930000 {
-               pinctrl-names = "default";
-               pinctrl-0 = <&spi1_bus>;
-               cs-gpios = <&gpb 5 0>;
-               status = "okay";
-
-               s5c73m3_spi: s5c73m3 {
-                       compatible = "samsung,s5c73m3";
-                       spi-max-frequency = <50000000>;
-                       reg = <0>;
-                       controller-data {
-                               samsung,spi-feedback-delay = <2>;
-                       };
-               };
-       };
-
-       pwm: pwm@139D0000 {
-               pinctrl-0 = <&pwm0_out>;
-               pinctrl-names = "default";
-               samsung,pwm-outputs = <0>;
-               status = "okay";
-       };
-
-       dsi_0: dsi@11C80000 {
-               vddcore-supply = <&ldo8_reg>;
-               vddio-supply = <&ldo10_reg>;
-               samsung,pll-clock-frequency = <24000000>;
-               status = "okay";
-
-               ports {
-                       #address-cells = <1>;
-                       #size-cells = <0>;
-
-                       port@1 {
-                               reg = <1>;
-
-                               dsi_out: endpoint {
-                                       remote-endpoint = <&dsi_in>;
-                                       samsung,burst-clock-frequency = <500000000>;
-                                       samsung,esc-clock-frequency = <20000000>;
-                               };
-                       };
-               };
-
-               panel@0 {
-                       compatible = "samsung,s6e8aa0";
-                       reg = <0>;
-                       vdd3-supply = <&lcd_vdd3_reg>;
-                       vci-supply = <&ldo25_reg>;
-                       reset-gpios = <&gpy4 5 0>;
-                       power-on-delay= <50>;
-                       reset-delay = <100>;
-                       init-delay = <100>;
-                       flip-horizontal;
-                       flip-vertical;
-                       panel-width-mm = <58>;
-                       panel-height-mm = <103>;
-
-                       display-timings {
-                               timing-0 {
-                                       clock-frequency = <57153600>;
-                                       hactive = <720>;
-                                       vactive = <1280>;
-                                       hfront-porch = <5>;
-                                       hback-porch = <5>;
-                                       hsync-len = <5>;
-                                       vfront-porch = <13>;
-                                       vback-porch = <1>;
-                                       vsync-len = <2>;
-                               };
-                       };
-
-                       port {
-                               dsi_in: endpoint {
-                                       remote-endpoint = <&dsi_out>;
-                               };
-                       };
-               };
-       };
-
-       fimd@11c00000 {
-               status = "okay";
-       };
-
        camera: camera {
                pinctrl-0 = <&cam_port_a_clk_active &cam_port_b_clk_active>;
                pinctrl-names = "default";
                assigned-clock-parents = <&clock CLK_XUSBXTI>,
                                         <&clock CLK_XUSBXTI>;
 
-               fimc_0: fimc@11800000 {
-                       status = "okay";
-                       assigned-clocks = <&clock CLK_MOUT_FIMC0>,
-                                       <&clock CLK_SCLK_FIMC0>;
-                       assigned-clock-parents = <&clock CLK_MOUT_MPLL_USER_T>;
-                       assigned-clock-rates = <0>, <176000000>;
-               };
-
-               fimc_1: fimc@11810000 {
-                       status = "okay";
-                       assigned-clocks = <&clock CLK_MOUT_FIMC1>,
-                                       <&clock CLK_SCLK_FIMC1>;
-                       assigned-clock-parents = <&clock CLK_MOUT_MPLL_USER_T>;
-                       assigned-clock-rates = <0>, <176000000>;
-               };
-
-               fimc_2: fimc@11820000 {
-                       status = "okay";
-                       assigned-clocks = <&clock CLK_MOUT_FIMC2>,
-                                       <&clock CLK_SCLK_FIMC2>;
-                       assigned-clock-parents = <&clock CLK_MOUT_MPLL_USER_T>;
-                       assigned-clock-rates = <0>, <176000000>;
-               };
-
-               fimc_3: fimc@11830000 {
-                       status = "okay";
-                       assigned-clocks = <&clock CLK_MOUT_FIMC3>,
-                                       <&clock CLK_SCLK_FIMC3>;
-                       assigned-clock-parents = <&clock CLK_MOUT_MPLL_USER_T>;
-                       assigned-clock-rates = <0>, <176000000>;
-               };
-
-               csis_0: csis@11880000 {
-                       status = "okay";
-                       vddcore-supply = <&ldo8_reg>;
-                       vddio-supply = <&ldo10_reg>;
-                       assigned-clocks = <&clock CLK_MOUT_CSIS0>,
-                                       <&clock CLK_SCLK_CSIS0>;
-                       assigned-clock-parents = <&clock CLK_MOUT_MPLL_USER_T>;
-                       assigned-clock-rates = <0>, <176000000>;
-
-                       /* Camera C (3) MIPI CSI-2 (CSIS0) */
-                       port@3 {
-                               reg = <3>;
-                               csis0_ep: endpoint {
-                                       remote-endpoint = <&s5c73m3_ep>;
-                                       data-lanes = <1 2 3 4>;
-                                       samsung,csis-hs-settle = <12>;
-                               };
-                       };
-               };
-
-               csis_1: csis@11890000 {
-                       status = "okay";
-                       vddcore-supply = <&ldo8_reg>;
-                       vddio-supply = <&ldo10_reg>;
-                       assigned-clocks = <&clock CLK_MOUT_CSIS1>,
-                                       <&clock CLK_SCLK_CSIS1>;
-                       assigned-clock-parents = <&clock CLK_MOUT_MPLL_USER_T>;
-                       assigned-clock-rates = <0>, <176000000>;
-
-                       /* Camera D (4) MIPI CSI-2 (CSIS1) */
-                       port@4 {
-                               reg = <4>;
-                               csis1_ep: endpoint {
-                                       remote-endpoint = <&is_s5k6a3_ep>;
-                                       data-lanes = <1>;
-                                       samsung,csis-hs-settle = <18>;
-                                       samsung,csis-wclk;
-                               };
-                       };
-               };
-
-               fimc_lite_0: fimc-lite@12390000 {
-                       status = "okay";
-               };
-
-               fimc_lite_1: fimc-lite@123A0000 {
-                       status = "okay";
-               };
 
-               fimc-is@12000000 {
-                       pinctrl-0 = <&fimc_is_uart>;
-                       pinctrl-names = "default";
-                       status = "okay";
-
-                       i2c1_isp: i2c-isp@12140000 {
-                               pinctrl-0 = <&fimc_is_i2c1>;
-                               pinctrl-names = "default";
-
-                               s5k6a3@10 {
-                                       compatible = "samsung,s5k6a3";
-                                       reg = <0x10>;
-                                       svdda-supply = <&cam_io_reg>;
-                                       svddio-supply = <&ldo19_reg>;
-                                       afvdd-supply = <&ldo19_reg>;
-                                       clock-frequency = <24000000>;
-                                       /* CAM_B_CLKOUT */
-                                       clocks = <&camera 1>;
-                                       clock-names = "extclk";
-                                       samsung,camclk-out = <1>;
-                                       gpios = <&gpm1 6 0>;
-
-                                       port {
-                                               is_s5k6a3_ep: endpoint {
-                                                       remote-endpoint = <&csis1_ep>;
-                                                       data-lanes = <1>;
-                                               };
-                                       };
-                               };
-                       };
-               };
-       };
-
-       i2s0: i2s@03830000 {
-               pinctrl-0 = <&i2s0_bus>;
-               pinctrl-names = "default";
-               status = "okay";
        };
 
        sound {
                        "SPK", "SPKOUTRP";
        };
 
-       exynos-usbphy@125B0000 {
-               status = "okay";
-       };
-
-       hsotg@12480000 {
-               vusb_d-supply = <&ldo15_reg>;
-               vusb_a-supply = <&ldo12_reg>;
-               dr_mode = "peripheral";
-               status = "okay";
-       };
-
        thermistor-ap@0 {
                compatible = "ntc,ncp15wb473";
                pullup-uv = <1800000>;   /* VCC_1.8V_AP */
        };
 };
 
+&adc {
+       vdd-supply = <&ldo3_reg>;
+       status = "okay";
+};
+
+&csis_0 {
+       status = "okay";
+       vddcore-supply = <&ldo8_reg>;
+       vddio-supply = <&ldo10_reg>;
+       assigned-clocks = <&clock CLK_MOUT_CSIS0>,
+                       <&clock CLK_SCLK_CSIS0>;
+       assigned-clock-parents = <&clock CLK_MOUT_MPLL_USER_T>;
+       assigned-clock-rates = <0>, <176000000>;
+
+       /* Camera C (3) MIPI CSI-2 (CSIS0) */
+       port@3 {
+               reg = <3>;
+               csis0_ep: endpoint {
+                       remote-endpoint = <&s5c73m3_ep>;
+                       data-lanes = <1 2 3 4>;
+                       samsung,csis-hs-settle = <12>;
+               };
+       };
+};
+
+&csis_1 {
+       status = "okay";
+       vddcore-supply = <&ldo8_reg>;
+       vddio-supply = <&ldo10_reg>;
+       assigned-clocks = <&clock CLK_MOUT_CSIS1>,
+                       <&clock CLK_SCLK_CSIS1>;
+       assigned-clock-parents = <&clock CLK_MOUT_MPLL_USER_T>;
+       assigned-clock-rates = <0>, <176000000>;
+
+       /* Camera D (4) MIPI CSI-2 (CSIS1) */
+       port@4 {
+               reg = <4>;
+               csis1_ep: endpoint {
+                       remote-endpoint = <&is_s5k6a3_ep>;
+                       data-lanes = <1>;
+                       samsung,csis-hs-settle = <18>;
+                       samsung,csis-wclk;
+               };
+       };
+};
+
+&dsi_0 {
+       vddcore-supply = <&ldo8_reg>;
+       vddio-supply = <&ldo10_reg>;
+       samsung,pll-clock-frequency = <24000000>;
+       status = "okay";
+
+       ports {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               port@1 {
+                       reg = <1>;
+
+                       dsi_out: endpoint {
+                               remote-endpoint = <&dsi_in>;
+                               samsung,burst-clock-frequency = <500000000>;
+                               samsung,esc-clock-frequency = <20000000>;
+                       };
+               };
+       };
+
+       panel@0 {
+               compatible = "samsung,s6e8aa0";
+               reg = <0>;
+               vdd3-supply = <&lcd_vdd3_reg>;
+               vci-supply = <&ldo25_reg>;
+               reset-gpios = <&gpy4 5 0>;
+               power-on-delay= <50>;
+               reset-delay = <100>;
+               init-delay = <100>;
+               flip-horizontal;
+               flip-vertical;
+               panel-width-mm = <58>;
+               panel-height-mm = <103>;
+
+               display-timings {
+                       timing-0 {
+                               clock-frequency = <57153600>;
+                               hactive = <720>;
+                               vactive = <1280>;
+                               hfront-porch = <5>;
+                               hback-porch = <5>;
+                               hsync-len = <5>;
+                               vfront-porch = <13>;
+                               vback-porch = <1>;
+                               vsync-len = <2>;
+                       };
+               };
+
+               port {
+                       dsi_in: endpoint {
+                               remote-endpoint = <&dsi_out>;
+                       };
+               };
+       };
+};
+
+&exynos_usbphy {
+       status = "okay";
+};
+
+&fimc_0 {
+       status = "okay";
+       assigned-clocks = <&clock CLK_MOUT_FIMC0>,
+                       <&clock CLK_SCLK_FIMC0>;
+       assigned-clock-parents = <&clock CLK_MOUT_MPLL_USER_T>;
+       assigned-clock-rates = <0>, <176000000>;
+};
+
+&fimc_1 {
+       status = "okay";
+       assigned-clocks = <&clock CLK_MOUT_FIMC1>,
+                       <&clock CLK_SCLK_FIMC1>;
+       assigned-clock-parents = <&clock CLK_MOUT_MPLL_USER_T>;
+       assigned-clock-rates = <0>, <176000000>;
+};
+
+&fimc_2 {
+       status = "okay";
+       assigned-clocks = <&clock CLK_MOUT_FIMC2>,
+                       <&clock CLK_SCLK_FIMC2>;
+       assigned-clock-parents = <&clock CLK_MOUT_MPLL_USER_T>;
+       assigned-clock-rates = <0>, <176000000>;
+};
+
+&fimc_3 {
+       status = "okay";
+       assigned-clocks = <&clock CLK_MOUT_FIMC3>,
+                       <&clock CLK_SCLK_FIMC3>;
+       assigned-clock-parents = <&clock CLK_MOUT_MPLL_USER_T>;
+       assigned-clock-rates = <0>, <176000000>;
+};
+
+&fimc_is {
+       pinctrl-0 = <&fimc_is_uart>;
+       pinctrl-names = "default";
+       status = "okay";
+
+       i2c1_isp: i2c-isp@12140000 {
+               pinctrl-0 = <&fimc_is_i2c1>;
+               pinctrl-names = "default";
+
+               s5k6a3@10 {
+                       compatible = "samsung,s5k6a3";
+                       reg = <0x10>;
+                       svdda-supply = <&cam_io_reg>;
+                       svddio-supply = <&ldo19_reg>;
+                       afvdd-supply = <&ldo19_reg>;
+                       clock-frequency = <24000000>;
+                       /* CAM_B_CLKOUT */
+                       clocks = <&camera 1>;
+                       clock-names = "extclk";
+                       samsung,camclk-out = <1>;
+                       gpios = <&gpm1 6 0>;
+
+                       port {
+                               is_s5k6a3_ep: endpoint {
+                                       remote-endpoint = <&csis1_ep>;
+                                       data-lanes = <1>;
+                               };
+                       };
+               };
+       };
+};
+
+&fimc_lite_0 {
+       status = "okay";
+};
+
+&fimc_lite_1 {
+       status = "okay";
+};
+
+&fimd {
+       status = "okay";
+};
+
+&hsotg {
+       vusb_d-supply = <&ldo15_reg>;
+       vusb_a-supply = <&ldo12_reg>;
+       dr_mode = "peripheral";
+       status = "okay";
+};
+
+&i2c_0 {
+       samsung,i2c-sda-delay = <100>;
+       samsung,i2c-slave-addr = <0x10>;
+       samsung,i2c-max-bus-freq = <400000>;
+       pinctrl-0 = <&i2c0_bus>;
+       pinctrl-names = "default";
+       status = "okay";
+
+       s5c73m3@3c {
+               compatible = "samsung,s5c73m3";
+               reg = <0x3c>;
+               standby-gpios = <&gpm0 1 1>;   /* ISP_STANDBY */
+               xshutdown-gpios = <&gpf1 3 1>; /* ISP_RESET */
+               vdd-int-supply = <&buck9_reg>;
+               vddio-cis-supply = <&ldo9_reg>;
+               vdda-supply = <&ldo17_reg>;
+               vddio-host-supply = <&ldo18_reg>;
+               vdd-af-supply = <&cam_af_reg>;
+               vdd-reg-supply = <&cam_io_reg>;
+               clock-frequency = <24000000>;
+               /* CAM_A_CLKOUT */
+               clocks = <&camera 0>;
+               clock-names = "cis_extclk";
+               port {
+                       s5c73m3_ep: endpoint {
+                               remote-endpoint = <&csis0_ep>;
+                               data-lanes = <1 2 3 4>;
+                       };
+               };
+       };
+};
+
+&i2c_3 {
+       samsung,i2c-sda-delay = <100>;
+       samsung,i2c-slave-addr = <0x10>;
+       samsung,i2c-max-bus-freq = <400000>;
+       pinctrl-0 = <&i2c3_bus>;
+       pinctrl-names = "default";
+       status = "okay";
+
+       mms114-touchscreen@48 {
+               compatible = "melfas,mms114";
+               reg = <0x48>;
+               interrupt-parent = <&gpm2>;
+               interrupts = <3 2>;
+               x-size = <720>;
+               y-size = <1280>;
+               avdd-supply = <&ldo23_reg>;
+               vdd-supply = <&ldo24_reg>;
+       };
+};
+
+&i2c_4 {
+       samsung,i2c-sda-delay = <100>;
+       samsung,i2c-slave-addr = <0x10>;
+       samsung,i2c-max-bus-freq = <100000>;
+       pinctrl-0 = <&i2c4_bus>;
+       pinctrl-names = "default";
+       status = "okay";
+
+       wm1811: wm1811@1a {
+               compatible = "wlf,wm1811";
+               reg = <0x1a>;
+               clocks = <&pmu_system_controller 0>;
+               clock-names = "MCLK1";
+               DCVDD-supply = <&ldo3_reg>;
+               DBVDD1-supply = <&ldo3_reg>;
+               wlf,ldo1ena = <&gpj0 4 0>;
+       };
+};
+
+&i2c_7 {
+       samsung,i2c-sda-delay = <100>;
+       samsung,i2c-slave-addr = <0x10>;
+       samsung,i2c-max-bus-freq = <100000>;
+       pinctrl-0 = <&i2c7_bus>;
+       pinctrl-names = "default";
+       status = "okay";
+
+       max77686: max77686_pmic@09 {
+               compatible = "maxim,max77686";
+               interrupt-parent = <&gpx0>;
+               interrupts = <7 0>;
+               reg = <0x09>;
+               #clock-cells = <1>;
+
+               voltage-regulators {
+                       ldo1_reg: ldo1 {
+                               regulator-compatible = "LDO1";
+                               regulator-name = "VALIVE_1.0V_AP";
+                               regulator-min-microvolt = <1000000>;
+                               regulator-max-microvolt = <1000000>;
+                               regulator-always-on;
+                       };
+
+                       ldo2_reg: ldo2 {
+                               regulator-compatible = "LDO2";
+                               regulator-name = "VM1M2_1.2V_AP";
+                               regulator-min-microvolt = <1200000>;
+                               regulator-max-microvolt = <1200000>;
+                               regulator-always-on;
+                               regulator-state-mem {
+                                       regulator-on-in-suspend;
+                               };
+                       };
+
+                       ldo3_reg: ldo3 {
+                               regulator-compatible = "LDO3";
+                               regulator-name = "VCC_1.8V_AP";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-always-on;
+                       };
+
+                       ldo4_reg: ldo4 {
+                               regulator-compatible = "LDO4";
+                               regulator-name = "VCC_2.8V_AP";
+                               regulator-min-microvolt = <2800000>;
+                               regulator-max-microvolt = <2800000>;
+                               regulator-always-on;
+                       };
+
+                       ldo5_reg: ldo5 {
+                               regulator-compatible = "LDO5";
+                               regulator-name = "VCC_1.8V_IO";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-always-on;
+                       };
+
+                       ldo6_reg: ldo6 {
+                               regulator-compatible = "LDO6";
+                               regulator-name = "VMPLL_1.0V_AP";
+                               regulator-min-microvolt = <1000000>;
+                               regulator-max-microvolt = <1000000>;
+                               regulator-always-on;
+                               regulator-state-mem {
+                                       regulator-on-in-suspend;
+                               };
+                       };
+
+                       ldo7_reg: ldo7 {
+                               regulator-compatible = "LDO7";
+                               regulator-name = "VPLL_1.0V_AP";
+                               regulator-min-microvolt = <1000000>;
+                               regulator-max-microvolt = <1000000>;
+                               regulator-always-on;
+                               regulator-state-mem {
+                                       regulator-on-in-suspend;
+                               };
+                       };
+
+                       ldo8_reg: ldo8 {
+                               regulator-compatible = "LDO8";
+                               regulator-name = "VMIPI_1.0V";
+                               regulator-min-microvolt = <1000000>;
+                               regulator-max-microvolt = <1000000>;
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+
+                       ldo9_reg: ldo9 {
+                               regulator-compatible = "LDO9";
+                               regulator-name = "CAM_ISP_MIPI_1.2V";
+                               regulator-min-microvolt = <1200000>;
+                               regulator-max-microvolt = <1200000>;
+                       };
+
+                       ldo10_reg: ldo10 {
+                               regulator-compatible = "LDO10";
+                               regulator-name = "VMIPI_1.8V";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+
+                       ldo11_reg: ldo11 {
+                               regulator-compatible = "LDO11";
+                               regulator-name = "VABB1_1.95V";
+                               regulator-min-microvolt = <1950000>;
+                               regulator-max-microvolt = <1950000>;
+                               regulator-always-on;
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+
+                       ldo12_reg: ldo12 {
+                               regulator-compatible = "LDO12";
+                               regulator-name = "VUOTG_3.0V";
+                               regulator-min-microvolt = <3000000>;
+                               regulator-max-microvolt = <3000000>;
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+
+                       ldo13_reg: ldo13 {
+                               regulator-compatible = "LDO13";
+                               regulator-name = "NFC_AVDD_1.8V";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                       };
+
+                       ldo14_reg: ldo14 {
+                               regulator-compatible = "LDO14";
+                               regulator-name = "VABB2_1.95V";
+                               regulator-min-microvolt = <1950000>;
+                               regulator-max-microvolt = <1950000>;
+                               regulator-always-on;
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+
+                       ldo15_reg: ldo15 {
+                               regulator-compatible = "LDO15";
+                               regulator-name = "VHSIC_1.0V";
+                               regulator-min-microvolt = <1000000>;
+                               regulator-max-microvolt = <1000000>;
+                               regulator-state-mem {
+                                       regulator-on-in-suspend;
+                               };
+                       };
+
+                       ldo16_reg: ldo16 {
+                               regulator-compatible = "LDO16";
+                               regulator-name = "VHSIC_1.8V";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-state-mem {
+                                       regulator-on-in-suspend;
+                               };
+                       };
+
+                       ldo17_reg: ldo17 {
+                               regulator-compatible = "LDO17";
+                               regulator-name = "CAM_SENSOR_CORE_1.2V";
+                               regulator-min-microvolt = <1200000>;
+                               regulator-max-microvolt = <1200000>;
+                       };
+
+                       ldo18_reg: ldo18 {
+                               regulator-compatible = "LDO18";
+                               regulator-name = "CAM_ISP_SEN_IO_1.8V";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                       };
+
+                       ldo19_reg: ldo19 {
+                               regulator-compatible = "LDO19";
+                               regulator-name = "VT_CAM_1.8V";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                       };
+
+                       ldo20_reg: ldo20 {
+                               regulator-compatible = "LDO20";
+                               regulator-name = "VDDQ_PRE_1.8V";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                       };
+
+                       ldo21_reg: ldo21 {
+                               regulator-compatible = "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";
+                               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";
+                               regulator-name = "TSP_AVDD_3.3V";
+                               regulator-min-microvolt = <3300000>;
+                               regulator-max-microvolt = <3300000>;
+                       };
+
+                       ldo24_reg: ldo24 {
+                               regulator-compatible = "LDO24";
+                               regulator-name = "TSP_VDD_1.8V";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                       };
+
+                       ldo25_reg: ldo25 {
+                               regulator-compatible = "LDO25";
+                               regulator-name = "LCD_VCC_3.3V";
+                               regulator-min-microvolt = <2800000>;
+                               regulator-max-microvolt = <2800000>;
+                       };
+
+                       ldo26_reg: ldo26 {
+                               regulator-compatible = "LDO26";
+                               regulator-name = "MOTOR_VCC_3.0V";
+                               regulator-min-microvolt = <3000000>;
+                               regulator-max-microvolt = <3000000>;
+                       };
+
+                       buck1_reg: buck1 {
+                               regulator-compatible = "BUCK1";
+                               regulator-name = "vdd_mif";
+                               regulator-min-microvolt = <850000>;
+                               regulator-max-microvolt = <1100000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+
+                       buck2_reg: buck2 {
+                               regulator-compatible = "BUCK2";
+                               regulator-name = "vdd_arm";
+                               regulator-min-microvolt = <850000>;
+                               regulator-max-microvolt = <1500000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-state-mem {
+                                       regulator-on-in-suspend;
+                               };
+                       };
+
+                       buck3_reg: buck3 {
+                               regulator-compatible = "BUCK3";
+                               regulator-name = "vdd_int";
+                               regulator-min-microvolt = <850000>;
+                               regulator-max-microvolt = <1150000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+
+                       buck4_reg: buck4 {
+                               regulator-compatible = "BUCK4";
+                               regulator-name = "vdd_g3d";
+                               regulator-min-microvolt = <850000>;
+                               regulator-max-microvolt = <1150000>;
+                               regulator-boot-on;
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+
+                       buck5_reg: buck5 {
+                               regulator-compatible = "BUCK5";
+                               regulator-name = "VMEM_1.2V_AP";
+                               regulator-min-microvolt = <1200000>;
+                               regulator-max-microvolt = <1200000>;
+                               regulator-always-on;
+                       };
+
+                       buck6_reg: buck6 {
+                               regulator-compatible = "BUCK6";
+                               regulator-name = "VCC_SUB_1.35V";
+                               regulator-min-microvolt = <1350000>;
+                               regulator-max-microvolt = <1350000>;
+                               regulator-always-on;
+                       };
+
+                       buck7_reg: buck7 {
+                               regulator-compatible = "BUCK7";
+                               regulator-name = "VCC_SUB_2.0V";
+                               regulator-min-microvolt = <2000000>;
+                               regulator-max-microvolt = <2000000>;
+                               regulator-always-on;
+                       };
+
+                       buck8_reg: buck8 {
+                               regulator-compatible = "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";
+                               regulator-name = "CAM_ISP_CORE_1.2V";
+                               regulator-min-microvolt = <1000000>;
+                               regulator-max-microvolt = <1200000>;
+                               maxim,ena-gpios = <&gpm0 3 GPIO_ACTIVE_HIGH>;
+                       };
+               };
+       };
+};
+
+&i2s0 {
+       pinctrl-0 = <&i2s0_bus>;
+       pinctrl-names = "default";
+       status = "okay";
+};
+
+&mshc_0 {
+       num-slots = <1>;
+       broken-cd;
+       non-removable;
+       card-detect-delay = <200>;
+       vmmc-supply = <&ldo22_reg>;
+       clock-frequency = <400000000>;
+       samsung,dw-mshc-ciu-div = <0>;
+       samsung,dw-mshc-sdr-timing = <2 3>;
+       samsung,dw-mshc-ddr-timing = <1 2>;
+       pinctrl-0 = <&sd4_clk &sd4_cmd &sd4_bus4 &sd4_bus8>;
+       pinctrl-names = "default";
+       status = "okay";
+       bus-width = <8>;
+       cap-mmc-highspeed;
+};
+
 &pmu_system_controller {
        assigned-clocks = <&pmu_system_controller 0>;
        assigned-clock-parents =  <&clock CLK_XUSBXTI>;
                PIN_SLP(gpv4-0, INPUT, DOWN);
        };
 };
+
+&pwm {
+       pinctrl-0 = <&pwm0_out>;
+       pinctrl-names = "default";
+       samsung,pwm-outputs = <0>;
+       status = "okay";
+};
+
+&rtc {
+       status = "okay";
+       clocks = <&clock CLK_RTC>, <&max77686 MAX77686_CLK_AP>;
+       clock-names = "rtc", "rtc_src";
+};
+
+&sdhci_2 {
+       bus-width = <4>;
+       cd-gpios = <&gpx3 4 0>;
+       cd-inverted;
+       pinctrl-0 = <&sd2_clk &sd2_cmd &sd2_bus4>;
+       pinctrl-names = "default";
+       vmmc-supply = <&ldo21_reg>;
+       status = "okay";
+};
+
+&serial_0 {
+       status = "okay";
+};
+
+&serial_1 {
+       status = "okay";
+};
+
+&serial_2 {
+       status = "okay";
+};
+
+&serial_3 {
+       status = "okay";
+};
+
+&spi_1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&spi1_bus>;
+       cs-gpios = <&gpb 5 0>;
+       status = "okay";
+
+       s5c73m3_spi: s5c73m3 {
+               compatible = "samsung,s5c73m3";
+               spi-max-frequency = <50000000>;
+               reg = <0>;
+               controller-data {
+                       samsung,spi-feedback-delay = <2>;
+               };
+       };
+};
+
+&tmu {
+       vtmu-supply = <&ldo10_reg>;
+       status = "okay";
+};
index 68ad43b391ae6122c3783b443cf23b5ccb7a2d04..b78ada70bd051d6ff3cc2bdd5cbb26859fd644eb 100644 (file)
                };
        };
 
-       combiner: interrupt-controller@10440000 {
-               samsung,combiner-nr = <20>;
-       };
-
        pmu {
                interrupts = <2 2>, <3 2>, <18 2>, <19 2>;
        };
+};
 
-       gic: interrupt-controller@10490000 {
-               cpu-offset = <0x4000>;
-       };
+&pmu_system_controller {
+       compatible = "samsung,exynos4412-pmu", "syscon";
+};
 
-       pmu_system_controller: system-controller@10020000 {
-               compatible = "samsung,exynos4412-pmu", "syscon";
-       };
+&combiner {
+       samsung,combiner-nr = <20>;
+};
+
+&gic {
+       cpu-offset = <0x4000>;
 };
index 5caea996e090371d862ee374633ace34184379ba..ad764842fff526e8bd4160ec855d46fde9e1ea9a 100644 (file)
 
                mipi_phy: video-phy@10020710 {
                        compatible = "samsung,s5pv210-mipi-video-phy";
-                       reg = <0x10020710 8>;
                        #phy-cells = <1>;
+                       syscon = <&pmu_system_controller>;
                };
 
                pd_cam: cam-power-domain@10024000 {
                };
 
                rtc: rtc@10070000 {
-                       compatible = "samsung,exynos3250-rtc";
+                       compatible = "samsung,s3c6410-rtc";
                        reg = <0x10070000 0x100>;
                        interrupts = <0 73 0>, <0 74 0>;
                        status = "disabled";
                        clocks = <&cmu CLK_SCLK_FIMD0>, <&cmu CLK_FIMD0>;
                        clock-names = "sclk_fimd", "fimd";
                        samsung,power-domain = <&pd_lcd0>;
+                       iommus = <&sysmmu_fimd0>;
                        samsung,sysreg = <&sysreg_system_controller>;
                        status = "disabled";
                };
                        status = "disabled";
                };
 
+               sysmmu_fimd0: sysmmu@11E20000 {
+                       compatible = "samsung,exynos-sysmmu";
+                       reg = <0x11e20000 0x1000>;
+                       interrupts = <0 80 0>, <0 81 0>;
+                       clock-names = "sysmmu", "master";
+                       clocks = <&cmu CLK_SMMUFIMD0>, <&cmu CLK_FIMD0>;
+                       power-domains = <&pd_lcd0>;
+                       #iommu-cells = <0>;
+               };
+
                hsotg: hsotg@12480000 {
                        compatible = "samsung,s3c6400-hsotg";
                        reg = <0x12480000 0x20000>;
index c141931378e78aa17a3f45da0293d218713587a0..bac25c672789ac723b1c7fa569711f725238501b 100644 (file)
@@ -29,7 +29,7 @@
        }
 
 / {
-       pinctrl@11400000 {
+       pinctrl_0: pinctrl@11400000 {
                gpa0: gpa0 {
                        gpio-controller;
                        #gpio-cells = <2>;
                };
        };
 
-       pinctrl@11000000 {
+       pinctrl_1: pinctrl@11000000 {
                gpk0: gpk0 {
                        gpio-controller;
                        #gpio-cells = <2>;
                };
        };
 
-       pinctrl@03860000 {
+       pinctrl_2: pinctrl@03860000 {
                gpz: gpz {
                        gpio-controller;
                        #gpio-cells = <2>;
                };
        };
 
-       pinctrl@106E0000 {
+       pinctrl_3: pinctrl@106E0000 {
                gpv0: gpv0 {
                        gpio-controller;
                        #gpio-cells = <2>;
index 6a6abe14fd9b59eed66e033ef43b970c6d4ce256..b77dac61ffb5463d18d25801c50979d1fbba173c 100644 (file)
                };
        };
 
-       combiner: interrupt-controller@10440000 {
-               interrupts = <0 0 0>, <0 1 0>, <0 2 0>, <0 3 0>,
-                            <0 4 0>, <0 5 0>, <0 6 0>, <0 7 0>,
-                            <0 8 0>, <0 9 0>, <0 10 0>, <0 11 0>,
-                            <0 12 0>, <0 13 0>, <0 14 0>, <0 15 0>,
-                            <0 107 0>, <0 108 0>, <0 48 0>, <0 42 0>;
-       };
-
-       pinctrl_0: pinctrl@11400000 {
-               compatible = "samsung,exynos4x12-pinctrl";
-               reg = <0x11400000 0x1000>;
-               interrupts = <0 47 0>;
-       };
-
-       pinctrl_1: pinctrl@11000000 {
-               compatible = "samsung,exynos4x12-pinctrl";
-               reg = <0x11000000 0x1000>;
-               interrupts = <0 46 0>;
-
-               wakup_eint: wakeup-interrupt-controller {
-                       compatible = "samsung,exynos4210-wakeup-eint";
-                       interrupt-parent = <&gic>;
-                       interrupts = <0 32 0>;
-               };
-       };
-
        adc: adc@126C0000 {
                compatible = "samsung,exynos-adc-v1";
                reg = <0x126C0000 0x100>;
                status = "disabled";
        };
 
-       pinctrl_2: pinctrl@03860000 {
-               compatible = "samsung,exynos4x12-pinctrl";
-               reg = <0x03860000 0x1000>;
-               interrupt-parent = <&combiner>;
-               interrupts = <10 0>;
-       };
-
-       pinctrl_3: pinctrl@106E0000 {
-               compatible = "samsung,exynos4x12-pinctrl";
-               reg = <0x106E0000 0x1000>;
-               interrupts = <0 72 0>;
-       };
-
-       pmu_system_controller: system-controller@10020000 {
-               compatible = "samsung,exynos4212-pmu", "syscon";
-               clock-names = "clkout0", "clkout1", "clkout2", "clkout3",
-                               "clkout4", "clkout8", "clkout9";
-               clocks = <&clock CLK_OUT_DMC>, <&clock CLK_OUT_TOP>,
-                       <&clock CLK_OUT_LEFTBUS>, <&clock CLK_OUT_RIGHTBUS>,
-                       <&clock CLK_OUT_CPU>, <&clock CLK_XXTI>,
-                       <&clock CLK_XUSBXTI>;
-               #clock-cells = <1>;
-       };
-
-       g2d@10800000 {
+       g2d: g2d@10800000 {
                compatible = "samsung,exynos4212-g2d";
                reg = <0x10800000 0x1000>;
                interrupts = <0 89 0>;
                clocks = <&clock CLK_SCLK_FIMG2D>, <&clock CLK_G2D>;
                clock-names = "sclk_fimg2d", "fimg2d";
+               iommus = <&sysmmu_g2d>;
                status = "disabled";
        };
 
                         <&clock CLK_PIXELASYNCM0>, <&clock CLK_PIXELASYNCM1>;
                clock-names = "sclk_cam0", "sclk_cam1", "pxl_async0", "pxl_async1";
 
-               fimc_0: fimc@11800000 {
-                       compatible = "samsung,exynos4212-fimc";
-                       samsung,pix-limits = <4224 8192 1920 4224>;
-                       samsung,mainscaler-ext;
-                       samsung,isp-wb;
-                       samsung,cam-if;
-               };
-
-               fimc_1: fimc@11810000 {
-                       compatible = "samsung,exynos4212-fimc";
-                       samsung,pix-limits = <4224 8192 1920 4224>;
-                       samsung,mainscaler-ext;
-                       samsung,isp-wb;
-                       samsung,cam-if;
-               };
-
-               fimc_2: fimc@11820000 {
-                       compatible = "samsung,exynos4212-fimc";
-                       samsung,pix-limits = <4224 8192 1920 4224>;
-                       samsung,mainscaler-ext;
-                       samsung,isp-wb;
-                       samsung,lcd-wb;
-                       samsung,cam-if;
-               };
-
-               fimc_3: fimc@11830000 {
-                       compatible = "samsung,exynos4212-fimc";
-                       samsung,pix-limits = <1920 8192 1366 1920>;
-                       samsung,rotators = <0>;
-                       samsung,mainscaler-ext;
-                       samsung,isp-wb;
-                       samsung,lcd-wb;
-               };
-
+               /* fimc_[0-3] are configured outside, under phandles */
                fimc_lite_0: fimc-lite@12390000 {
                        compatible = "samsung,exynos4212-fimc-lite";
                        reg = <0x12390000 0x1000>;
                        power-domains = <&pd_isp>;
                        clocks = <&clock CLK_FIMC_LITE0>;
                        clock-names = "flite";
+                       iommus = <&sysmmu_fimc_lite0>;
                        status = "disabled";
                };
 
                        power-domains = <&pd_isp>;
                        clocks = <&clock CLK_FIMC_LITE1>;
                        clock-names = "flite";
+                       iommus = <&sysmmu_fimc_lite1>;
                        status = "disabled";
                };
 
                                      "mcuispdiv1", "uart", "aclk200",
                                      "div_aclk200", "aclk400mcuisp",
                                      "div_aclk400mcuisp";
+                       iommus = <&sysmmu_fimc_isp>, <&sysmmu_fimc_drc>,
+                                <&sysmmu_fimc_fd>, <&sysmmu_fimc_mcuctl>;
+                       iommu-names = "isp", "drc", "fd", "mcuctl";
                        #address-cells = <1>;
                        #size-cells = <1>;
                        ranges;
                status = "disabled";
        };
 
-       exynos-usbphy@125B0000 {
-               compatible = "samsung,exynos4x12-usb2-phy";
-               samsung,sysreg-phandle = <&sys_reg>;
+       sysmmu_g2d: sysmmu@10A40000{
+               compatible = "samsung,exynos-sysmmu";
+               reg = <0x10A40000 0x1000>;
+               interrupt-parent = <&combiner>;
+               interrupts = <4 7>;
+               clock-names = "sysmmu", "master";
+               clocks = <&clock CLK_SMMU_G2D>, <&clock CLK_G2D>;
+               #iommu-cells = <0>;
        };
 
-       tmu@100C0000 {
-               compatible = "samsung,exynos4412-tmu";
+       sysmmu_fimc_isp: sysmmu@12260000 {
+               compatible = "samsung,exynos-sysmmu";
+               reg = <0x12260000 0x1000>;
                interrupt-parent = <&combiner>;
-               interrupts = <2 4>;
-               reg = <0x100C0000 0x100>;
-               clocks = <&clock 383>;
-               clock-names = "tmu_apbif";
-               status = "disabled";
+               interrupts = <16 2>;
+               power-domains = <&pd_isp>;
+               clock-names = "sysmmu";
+               clocks = <&clock CLK_SMMU_ISP>;
+               #iommu-cells = <0>;
        };
 
-       hdmi: hdmi@12D00000 {
-               compatible = "samsung,exynos4212-hdmi";
+       sysmmu_fimc_drc: sysmmu@12270000 {
+               compatible = "samsung,exynos-sysmmu";
+               reg = <0x12270000 0x1000>;
+               interrupt-parent = <&combiner>;
+               interrupts = <16 3>;
+               power-domains = <&pd_isp>;
+               clock-names = "sysmmu";
+               clocks = <&clock CLK_SMMU_DRC>;
+               #iommu-cells = <0>;
        };
 
-       mixer: mixer@12C10000 {
-               compatible = "samsung,exynos4212-mixer";
-               clock-names = "mixer", "hdmi", "sclk_hdmi", "vp";
-               clocks = <&clock CLK_MIXER>, <&clock CLK_HDMI>,
-                        <&clock CLK_SCLK_HDMI>, <&clock CLK_VP>;
+       sysmmu_fimc_fd: sysmmu@122A0000 {
+               compatible = "samsung,exynos-sysmmu";
+               reg = <0x122A0000 0x1000>;
+               interrupt-parent = <&combiner>;
+               interrupts = <16 4>;
+               power-domains = <&pd_isp>;
+               clock-names = "sysmmu";
+               clocks = <&clock CLK_SMMU_FD>;
+               #iommu-cells = <0>;
+       };
+
+       sysmmu_fimc_mcuctl: sysmmu@122B0000 {
+               compatible = "samsung,exynos-sysmmu";
+               reg = <0x122B0000 0x1000>;
+               interrupt-parent = <&combiner>;
+               interrupts = <16 5>;
+               power-domains = <&pd_isp>;
+               clock-names = "sysmmu";
+               clocks = <&clock CLK_SMMU_ISPCX>;
+               #iommu-cells = <0>;
        };
+
+       sysmmu_fimc_lite0: sysmmu@123B0000 {
+               compatible = "samsung,exynos-sysmmu";
+               reg = <0x123B0000 0x1000>;
+               interrupt-parent = <&combiner>;
+               interrupts = <16 0>;
+               power-domains = <&pd_isp>;
+               clock-names = "sysmmu", "master";
+               clocks = <&clock CLK_SMMU_LITE0>, <&clock CLK_FIMC_LITE0>;
+               #iommu-cells = <0>;
+       };
+
+       sysmmu_fimc_lite1: sysmmu@123C0000 {
+               compatible = "samsung,exynos-sysmmu";
+               reg = <0x123C0000 0x1000>;
+               interrupt-parent = <&combiner>;
+               interrupts = <16 1>;
+               power-domains = <&pd_isp>;
+               clock-names = "sysmmu", "master";
+               clocks = <&clock CLK_SMMU_LITE1>, <&clock CLK_FIMC_LITE1>;
+               #iommu-cells = <0>;
+       };
+};
+
+&combiner {
+       interrupts = <0 0 0>, <0 1 0>, <0 2 0>, <0 3 0>,
+                    <0 4 0>, <0 5 0>, <0 6 0>, <0 7 0>,
+                    <0 8 0>, <0 9 0>, <0 10 0>, <0 11 0>,
+                    <0 12 0>, <0 13 0>, <0 14 0>, <0 15 0>,
+                    <0 107 0>, <0 108 0>, <0 48 0>, <0 42 0>;
+};
+
+&exynos_usbphy {
+       compatible = "samsung,exynos4x12-usb2-phy";
+       samsung,sysreg-phandle = <&sys_reg>;
+};
+
+&fimc_0 {
+       compatible = "samsung,exynos4212-fimc";
+       samsung,pix-limits = <4224 8192 1920 4224>;
+       samsung,mainscaler-ext;
+       samsung,isp-wb;
+       samsung,cam-if;
+};
+
+&fimc_1 {
+       compatible = "samsung,exynos4212-fimc";
+       samsung,pix-limits = <4224 8192 1920 4224>;
+       samsung,mainscaler-ext;
+       samsung,isp-wb;
+       samsung,cam-if;
+};
+
+&fimc_2 {
+       compatible = "samsung,exynos4212-fimc";
+       samsung,pix-limits = <4224 8192 1920 4224>;
+       samsung,mainscaler-ext;
+       samsung,isp-wb;
+       samsung,lcd-wb;
+       samsung,cam-if;
+};
+
+&fimc_3 {
+       compatible = "samsung,exynos4212-fimc";
+       samsung,pix-limits = <1920 8192 1366 1920>;
+       samsung,rotators = <0>;
+       samsung,mainscaler-ext;
+       samsung,isp-wb;
+       samsung,lcd-wb;
+};
+
+&hdmi {
+       compatible = "samsung,exynos4212-hdmi";
+};
+
+&jpeg_codec {
+       compatible = "samsung,exynos4212-jpeg";
+};
+
+&mixer {
+       compatible = "samsung,exynos4212-mixer";
+       clock-names = "mixer", "hdmi", "sclk_hdmi", "vp";
+       clocks = <&clock CLK_MIXER>, <&clock CLK_HDMI>,
+                <&clock CLK_SCLK_HDMI>, <&clock CLK_VP>;
+};
+
+&pinctrl_0 {
+       compatible = "samsung,exynos4x12-pinctrl";
+       reg = <0x11400000 0x1000>;
+       interrupts = <0 47 0>;
+};
+
+&pinctrl_1 {
+       compatible = "samsung,exynos4x12-pinctrl";
+       reg = <0x11000000 0x1000>;
+       interrupts = <0 46 0>;
+
+       wakup_eint: wakeup-interrupt-controller {
+               compatible = "samsung,exynos4210-wakeup-eint";
+               interrupt-parent = <&gic>;
+               interrupts = <0 32 0>;
+       };
+};
+
+&pinctrl_2 {
+       compatible = "samsung,exynos4x12-pinctrl";
+       reg = <0x03860000 0x1000>;
+       interrupt-parent = <&combiner>;
+       interrupts = <10 0>;
+};
+
+&pinctrl_3 {
+       compatible = "samsung,exynos4x12-pinctrl";
+       reg = <0x106E0000 0x1000>;
+       interrupts = <0 72 0>;
+};
+
+&pmu_system_controller {
+       compatible = "samsung,exynos4212-pmu", "syscon";
+       clock-names = "clkout0", "clkout1", "clkout2", "clkout3",
+                       "clkout4", "clkout8", "clkout9";
+       clocks = <&clock CLK_OUT_DMC>, <&clock CLK_OUT_TOP>,
+               <&clock CLK_OUT_LEFTBUS>, <&clock CLK_OUT_RIGHTBUS>,
+               <&clock CLK_OUT_CPU>, <&clock CLK_XXTI>, <&clock CLK_XUSBXTI>;
+       #clock-cells = <1>;
+};
+
+&tmu {
+       compatible = "samsung,exynos4412-tmu";
+       interrupt-parent = <&combiner>;
+       interrupts = <2 4>;
+       reg = <0x100C0000 0x100>;
+       clocks = <&clock 383>;
+       clock-names = "tmu_apbif";
+       status = "disabled";
 };
index a0cc0b6f8f96d52c24729dd1432327e4935f389b..110dbd4fb884de7a6eeb63de3fa897fa08ebe601 100644 (file)
                interrupts = <0 54 0>;
        };
 
-       rtc@101E0000 {
+       rtc: rtc@101E0000 {
                compatible = "samsung,s3c6410-rtc";
                reg = <0x101E0000 0x100>;
                interrupts = <0 43 0>, <0 44 0>;
                status = "disabled";
        };
 
-       fimd@14400000 {
+       fimd: fimd@14400000 {
                compatible = "samsung,exynos5250-fimd";
                interrupt-parent = <&combiner>;
                reg = <0x14400000 0x40000>;
@@ -98,7 +98,7 @@
                status = "disabled";
        };
 
-       dp-controller@145B0000 {
+       dp: dp-controller@145B0000 {
                compatible = "samsung,exynos5-dp";
                reg = <0x145B0000 0x1000>;
                interrupts = <10 3>;
index bc27cc2558fe6518ad990b12a090fb8c7f008f5a..4fe186d01f8a52b52f9155d76b1496b7d586ed7e 100644 (file)
                reg = <0x09>;
                interrupt-parent = <&gpx3>;
                interrupts = <2 IRQ_TYPE_NONE>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&max77686_irq>;
+               wakeup-source;
 
                voltage-regulators {
                        ldo1_reg: LDO1 {
                };
        };
 };
+
+&pinctrl_0 {
+       max77686_irq: max77686-irq {
+               samsung,pins = "gpx3-2";
+               samsung,pin-function = <0xf>;
+               samsung,pin-pud = <0>;
+               samsung,pin-drv = <0>;
+       };
+};
index 1eca97ee4bd6320a3a3a44ede264e269041cd088..b7f4122df456b05438b8f719adaa9eb95a5dfb5f 100644 (file)
                };
        };
 
-       i2c@12CD0000 {
-               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>;
-                                       };
-                               };
-                       };
-               };
-       };
-
        sound {
                compatible = "google,snow-audio-max98095";
 
        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>;
index 257e2f10525de14fb8eee4ca5b4ecd630da18cf7..bf9bee67c4167500b177bcabb01ab4b06b072ab5 100644 (file)
                interrupts = <0 91 0>;
                clocks = <&clock CLK_G2D>;
                clock-names = "fimg2d";
+               iommus = <&sysmmu_g2d>;
        };
 
        mfc: codec@11000000 {
                power-domains = <&pd_mfc>;
                clocks = <&clock CLK_MFC>;
                clock-names = "mfc";
-       };
-
-       rtc: rtc@101E0000 {
-               clocks = <&clock CLK_RTC>;
-               clock-names = "rtc";
-               interrupt-parent = <&pmu_system_controller>;
-               status = "disabled";
+               iommus = <&sysmmu_mfc_l>, <&sysmmu_mfc_r>;
+               iommu-names = "left", "right";
        };
 
        tmu: tmu@10060000 {
                };
        };
 
-       serial@12C00000 {
-               clocks = <&clock CLK_UART0>, <&clock CLK_SCLK_UART0>;
-               clock-names = "uart", "clk_uart_baud0";
-       };
-
-       serial@12C10000 {
-               clocks = <&clock CLK_UART1>, <&clock CLK_SCLK_UART1>;
-               clock-names = "uart", "clk_uart_baud0";
-       };
-
-       serial@12C20000 {
-               clocks = <&clock CLK_UART2>, <&clock CLK_SCLK_UART2>;
-               clock-names = "uart", "clk_uart_baud0";
-       };
-
-       serial@12C30000 {
-               clocks = <&clock CLK_UART3>, <&clock CLK_SCLK_UART3>;
-               clock-names = "uart", "clk_uart_baud0";
-       };
-
        sata: sata@122F0000 {
                compatible = "snps,dwc-ahci";
                samsung,sata-freq = <66>;
                power-domains = <&pd_gsc>;
                clocks = <&clock CLK_GSCL0>;
                clock-names = "gscl";
+               iommu = <&sysmmu_gsc0>;
        };
 
        gsc_1:  gsc@13e10000 {
                power-domains = <&pd_gsc>;
                clocks = <&clock CLK_GSCL1>;
                clock-names = "gscl";
+               iommu = <&sysmmu_gsc1>;
        };
 
        gsc_2:  gsc@13e20000 {
                power-domains = <&pd_gsc>;
                clocks = <&clock CLK_GSCL2>;
                clock-names = "gscl";
+               iommu = <&sysmmu_gsc2>;
        };
 
        gsc_3:  gsc@13e30000 {
                power-domains = <&pd_gsc>;
                clocks = <&clock CLK_GSCL3>;
                clock-names = "gscl";
+               iommu = <&sysmmu_gsc3>;
        };
 
        hdmi: hdmi {
                clocks = <&clock CLK_MIXER>, <&clock CLK_HDMI>,
                         <&clock CLK_SCLK_HDMI>;
                clock-names = "mixer", "hdmi", "sclk_hdmi";
+               iommus = <&sysmmu_tv>;
        };
 
        dp_phy: video-phy@10040720 {
                #phy-cells = <0>;
        };
 
-       dp: dp-controller@145B0000 {
-               power-domains = <&pd_disp1>;
-               clocks = <&clock CLK_DP>;
-               clock-names = "dp";
-               phys = <&dp_phy>;
-               phy-names = "dp";
-       };
-
-       fimd: fimd@14400000 {
-               power-domains = <&pd_disp1>;
-               clocks = <&clock CLK_SCLK_FIMD1>, <&clock CLK_FIMD1>;
-               clock-names = "sclk_fimd", "fimd";
-       };
-
        adc: adc@12D10000 {
                compatible = "samsung,exynos-adc-v1";
                reg = <0x12D10000 0x100>;
                clocks = <&clock CLK_SSS>;
                clock-names = "secss";
        };
+
+       sysmmu_g2d: sysmmu@10A60000 {
+               compatible = "samsung,exynos-sysmmu";
+               reg = <0x10A60000 0x1000>;
+               interrupt-parent = <&combiner>;
+               interrupts = <24 5>;
+               clock-names = "sysmmu", "master";
+               clocks = <&clock CLK_SMMU_2D>, <&clock CLK_G2D>;
+               #iommu-cells = <0>;
+       };
+
+       sysmmu_mfc_r: sysmmu@11200000 {
+               compatible = "samsung,exynos-sysmmu";
+               reg = <0x11200000 0x1000>;
+               interrupt-parent = <&combiner>;
+               interrupts = <6 2>;
+               power-domains = <&pd_mfc>;
+               clock-names = "sysmmu", "master";
+               clocks = <&clock CLK_SMMU_MFCR>, <&clock CLK_MFC>;
+               #iommu-cells = <0>;
+       };
+
+       sysmmu_mfc_l: sysmmu@11210000 {
+               compatible = "samsung,exynos-sysmmu";
+               reg = <0x11210000 0x1000>;
+               interrupt-parent = <&combiner>;
+               interrupts = <8 5>;
+               power-domains = <&pd_mfc>;
+               clock-names = "sysmmu", "master";
+               clocks = <&clock CLK_SMMU_MFCL>, <&clock CLK_MFC>;
+               #iommu-cells = <0>;
+       };
+
+       sysmmu_rotator: sysmmu@11D40000 {
+               compatible = "samsung,exynos-sysmmu";
+               reg = <0x11D40000 0x1000>;
+               interrupt-parent = <&combiner>;
+               interrupts = <4 0>;
+               clock-names = "sysmmu", "master";
+               clocks = <&clock CLK_SMMU_ROTATOR>, <&clock CLK_ROTATOR>;
+               #iommu-cells = <0>;
+       };
+
+       sysmmu_jpeg: sysmmu@11F20000 {
+               compatible = "samsung,exynos-sysmmu";
+               reg = <0x11F20000 0x1000>;
+               interrupt-parent = <&combiner>;
+               interrupts = <4 2>;
+               power-domains = <&pd_gsc>;
+               clock-names = "sysmmu", "master";
+               clocks = <&clock CLK_SMMU_JPEG>, <&clock CLK_JPEG>;
+               #iommu-cells = <0>;
+       };
+
+       sysmmu_fimc_isp: sysmmu@13260000 {
+               compatible = "samsung,exynos-sysmmu";
+               reg = <0x13260000 0x1000>;
+               interrupt-parent = <&combiner>;
+               interrupts = <10 6>;
+               clock-names = "sysmmu";
+               clocks = <&clock CLK_SMMU_FIMC_ISP>;
+               #iommu-cells = <0>;
+       };
+
+       sysmmu_fimc_drc: sysmmu@13270000 {
+               compatible = "samsung,exynos-sysmmu";
+               reg = <0x13270000 0x1000>;
+               interrupt-parent = <&combiner>;
+               interrupts = <11 6>;
+               clock-names = "sysmmu";
+               clocks = <&clock CLK_SMMU_FIMC_DRC>;
+               #iommu-cells = <0>;
+       };
+
+       sysmmu_fimc_fd: sysmmu@132A0000 {
+               compatible = "samsung,exynos-sysmmu";
+               reg = <0x132A0000 0x1000>;
+               interrupt-parent = <&combiner>;
+               interrupts = <5 0>;
+               clock-names = "sysmmu";
+               clocks = <&clock CLK_SMMU_FIMC_FD>;
+               #iommu-cells = <0>;
+       };
+
+       sysmmu_fimc_scc: sysmmu@13280000 {
+               compatible = "samsung,exynos-sysmmu";
+               reg = <0x13280000 0x1000>;
+               interrupt-parent = <&combiner>;
+               interrupts = <5 2>;
+               clock-names = "sysmmu";
+               clocks = <&clock CLK_SMMU_FIMC_SCC>;
+               #iommu-cells = <0>;
+       };
+
+       sysmmu_fimc_scp: sysmmu@13290000 {
+               compatible = "samsung,exynos-sysmmu";
+               reg = <0x13290000 0x1000>;
+               interrupt-parent = <&combiner>;
+               interrupts = <3 6>;
+               clock-names = "sysmmu";
+               clocks = <&clock CLK_SMMU_FIMC_SCP>;
+               #iommu-cells = <0>;
+       };
+
+       sysmmu_fimc_mcuctl: sysmmu@132B0000 {
+               compatible = "samsung,exynos-sysmmu";
+               reg = <0x132B0000 0x1000>;
+               interrupt-parent = <&combiner>;
+               interrupts = <5 4>;
+               clock-names = "sysmmu";
+               clocks = <&clock CLK_SMMU_FIMC_MCU>;
+               #iommu-cells = <0>;
+       };
+
+       sysmmu_fimc_odc: sysmmu@132C0000 {
+               compatible = "samsung,exynos-sysmmu";
+               reg = <0x132C0000 0x1000>;
+               interrupt-parent = <&combiner>;
+               interrupts = <11 0>;
+               clock-names = "sysmmu";
+               clocks = <&clock CLK_SMMU_FIMC_ODC>;
+               #iommu-cells = <0>;
+       };
+
+       sysmmu_fimc_dis0: sysmmu@132D0000 {
+               compatible = "samsung,exynos-sysmmu";
+               reg = <0x132D0000 0x1000>;
+               interrupt-parent = <&combiner>;
+               interrupts = <10 4>;
+               clock-names = "sysmmu";
+               clocks = <&clock CLK_SMMU_FIMC_DIS0>;
+               #iommu-cells = <0>;
+       };
+
+       sysmmu_fimc_dis1: sysmmu@132E0000{
+               compatible = "samsung,exynos-sysmmu";
+               reg = <0x132E0000 0x1000>;
+               interrupt-parent = <&combiner>;
+               interrupts = <9 4>;
+               clock-names = "sysmmu";
+               clocks = <&clock CLK_SMMU_FIMC_DIS1>;
+               #iommu-cells = <0>;
+       };
+
+       sysmmu_fimc_3dnr: sysmmu@132F0000 {
+               compatible = "samsung,exynos-sysmmu";
+               reg = <0x132F0000 0x1000>;
+               interrupt-parent = <&combiner>;
+               interrupts = <5 6>;
+               clock-names = "sysmmu";
+               clocks = <&clock CLK_SMMU_FIMC_3DNR>;
+               #iommu-cells = <0>;
+       };
+
+       sysmmu_fimc_lite0: sysmmu@13C40000 {
+               compatible = "samsung,exynos-sysmmu";
+               reg = <0x13C40000 0x1000>;
+               interrupt-parent = <&combiner>;
+               interrupts = <3 4>;
+               power-domains = <&pd_gsc>;
+               clock-names = "sysmmu", "master";
+               clocks = <&clock CLK_SMMU_FIMC_LITE0>, <&clock CLK_CAMIF_TOP>;
+               #iommu-cells = <0>;
+       };
+
+       sysmmu_fimc_lite1: sysmmu@13C50000 {
+               compatible = "samsung,exynos-sysmmu";
+               reg = <0x13C50000 0x1000>;
+               interrupt-parent = <&combiner>;
+               interrupts = <24 1>;
+               power-domains = <&pd_gsc>;
+               clock-names = "sysmmu", "master";
+               clocks = <&clock CLK_SMMU_FIMC_LITE1>, <&clock CLK_CAMIF_TOP>;
+               #iommu-cells = <0>;
+       };
+
+       sysmmu_gsc0: sysmmu@13E80000 {
+               compatible = "samsung,exynos-sysmmu";
+               reg = <0x13E80000 0x1000>;
+               interrupt-parent = <&combiner>;
+               interrupts = <2 0>;
+               power-domains = <&pd_gsc>;
+               clock-names = "sysmmu", "master";
+               clocks = <&clock CLK_SMMU_GSCL0>, <&clock CLK_GSCL0>;
+               #iommu-cells = <0>;
+       };
+
+       sysmmu_gsc1: sysmmu@13E90000 {
+               compatible = "samsung,exynos-sysmmu";
+               reg = <0x13E90000 0x1000>;
+               interrupt-parent = <&combiner>;
+               interrupts = <2 2>;
+               power-domains = <&pd_gsc>;
+               clock-names = "sysmmu", "master";
+               clocks = <&clock CLK_SMMU_GSCL1>, <&clock CLK_GSCL1>;
+               #iommu-cells = <0>;
+       };
+
+       sysmmu_gsc2: sysmmu@13EA0000 {
+               compatible = "samsung,exynos-sysmmu";
+               reg = <0x13EA0000 0x1000>;
+               interrupt-parent = <&combiner>;
+               interrupts = <2 4>;
+               power-domains = <&pd_gsc>;
+               clock-names = "sysmmu", "master";
+               clocks = <&clock CLK_SMMU_GSCL2>, <&clock CLK_GSCL2>;
+               #iommu-cells = <0>;
+       };
+
+       sysmmu_gsc3: sysmmu@13EB0000 {
+               compatible = "samsung,exynos-sysmmu";
+               reg = <0x13EB0000 0x1000>;
+               interrupt-parent = <&combiner>;
+               interrupts = <2 6>;
+               power-domains = <&pd_gsc>;
+               clock-names = "sysmmu", "master";
+               clocks = <&clock CLK_SMMU_GSCL3>, <&clock CLK_GSCL3>;
+               #iommu-cells = <0>;
+       };
+
+       sysmmu_fimd1: sysmmu@14640000 {
+               compatible = "samsung,exynos-sysmmu";
+               reg = <0x14640000 0x1000>;
+               interrupt-parent = <&combiner>;
+               interrupts = <3 2>;
+               power-domains = <&pd_disp1>;
+               clock-names = "sysmmu", "master";
+               clocks = <&clock CLK_SMMU_FIMD1>, <&clock CLK_FIMD1>;
+               #iommu-cells = <0>;
+       };
+
+       sysmmu_tv: sysmmu@14650000 {
+               compatible = "samsung,exynos-sysmmu";
+               reg = <0x14650000 0x1000>;
+               interrupt-parent = <&combiner>;
+               interrupts = <7 4>;
+               power-domains = <&pd_disp1>;
+               clock-names = "sysmmu", "master";
+               clocks = <&clock CLK_SMMU_TV>, <&clock CLK_MIXER>;
+               #iommu-cells = <0>;
+       };
+};
+
+&dp {
+       power-domains = <&pd_disp1>;
+       clocks = <&clock CLK_DP>;
+       clock-names = "dp";
+       phys = <&dp_phy>;
+       phy-names = "dp";
+};
+
+&fimd {
+       power-domains = <&pd_disp1>;
+       clocks = <&clock CLK_SCLK_FIMD1>, <&clock CLK_FIMD1>;
+       clock-names = "sclk_fimd", "fimd";
+       iommus = <&sysmmu_fimd1>;
+};
+
+&rtc {
+       clocks = <&clock CLK_RTC>;
+       clock-names = "rtc";
+       interrupt-parent = <&pmu_system_controller>;
+       status = "disabled";
+};
+
+&serial_0 {
+       clocks = <&clock CLK_UART0>, <&clock CLK_SCLK_UART0>;
+       clock-names = "uart", "clk_uart_baud0";
+};
+
+&serial_1 {
+       clocks = <&clock CLK_UART1>, <&clock CLK_SCLK_UART1>;
+       clock-names = "uart", "clk_uart_baud0";
+};
+
+&serial_2 {
+       clocks = <&clock CLK_UART2>, <&clock CLK_SCLK_UART2>;
+       clock-names = "uart", "clk_uart_baud0";
+};
+
+&serial_3 {
+       clocks = <&clock CLK_UART3>, <&clock CLK_SCLK_UART3>;
+       clock-names = "uart", "clk_uart_baud0";
 };
index a803b605051b29c4754e889ce6a2cfb930bd1d14..3daef94bee38c4fd9e7aac10ac6eca5da031e386 100644 (file)
@@ -70,7 +70,7 @@
        broken-cd;
        bypass-smu;
        cap-mmc-highspeed;
-       supports-hs200-mode; /* 200 Mhz */
+       supports-hs200-mode; /* 200 MHz */
        card-detect-delay = <200>;
        samsung,dw-mshc-ciu-div = <3>;
        samsung,dw-mshc-sdr-timing = <0 4>;
index b82b6fa15f4861d21087dbe82b578a3c66ff3f4e..eeb4ac22cfcebfb1933f91ed37a586345ad6d2fc 100644 (file)
@@ -13,6 +13,7 @@
 #include "exynos5420.dtsi"
 #include <dt-bindings/interrupt-controller/irq.h>
 #include <dt-bindings/input/input.h>
+#include <dt-bindings/clock/samsung,s2mps11.h>
 
 / {
        model = "Insignal Arndale Octa evaluation board based on EXYNOS5420";
                };
        };
 
-       rtc@101E0000 {
-               status = "okay";
-       };
-
-       codec@11000000 {
-               samsung,mfc-r = <0x43000000 0x800000>;
-               samsung,mfc-l = <0x51000000 0x800000>;
-       };
-
-       mmc@12200000 {
-               status = "okay";
-               broken-cd;
-               card-detect-delay = <200>;
-               samsung,dw-mshc-ciu-div = <3>;
-               samsung,dw-mshc-sdr-timing = <0 4>;
-               samsung,dw-mshc-ddr-timing = <0 2>;
-               pinctrl-names = "default";
-               pinctrl-0 = <&sd0_clk &sd0_cmd &sd0_bus1 &sd0_bus4 &sd0_bus8>;
-               vmmc-supply = <&ldo10_reg>;
-               bus-width = <8>;
-               cap-mmc-highspeed;
-       };
-
-       mmc@12220000 {
-               status = "okay";
-               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_bus1 &sd2_bus4>;
-               vmmc-supply = <&ldo19_reg>;
-               vqmmc-supply = <&ldo13_reg>;
-               bus-width = <4>;
-               cap-sd-highspeed;
-       };
-
-       hsi2c_4: i2c@12CA0000 {
-               status = "okay";
-
-               s2mps11_pmic@66 {
-                       compatible = "samsung,s2mps11-pmic";
-                       reg = <0x66>;
-                       s2mps11,buck2-ramp-delay = <12>;
-                       s2mps11,buck34-ramp-delay = <12>;
-                       s2mps11,buck16-ramp-delay = <12>;
-                       s2mps11,buck6-ramp-enable = <1>;
-                       s2mps11,buck2-ramp-enable = <1>;
-                       s2mps11,buck3-ramp-enable = <1>;
-                       s2mps11,buck4-ramp-enable = <1>;
-
-                       interrupt-parent = <&gpx3>;
-                       interrupts = <2 IRQ_TYPE_LEVEL_HIGH>;
-
-                       s2mps11_osc: clocks {
-                               #clock-cells = <1>;
-                               clock-output-names = "s2mps11_ap",
-                                               "s2mps11_cp", "s2mps11_bt";
-                       };
-
-                       regulators {
-                               ldo1_reg: LDO1 {
-                                       regulator-name = "PVDD_ALIVE_1V0";
-                                       regulator-min-microvolt = <1000000>;
-                                       regulator-max-microvolt = <1000000>;
-                                       regulator-always-on;
-                               };
-
-                               ldo2_reg: LDO2 {
-                                       regulator-name = "PVDD_APIO_1V8";
-                                       regulator-min-microvolt = <1800000>;
-                                       regulator-max-microvolt = <1800000>;
-                               };
-
-                               ldo3_reg: LDO3 {
-                                       regulator-name = "PVDD_APIO_MMCON_1V8";
-                                       regulator-min-microvolt = <1800000>;
-                                       regulator-max-microvolt = <1800000>;
-                                       regulator-always-on;
-                               };
-
-                               ldo4_reg: LDO4 {
-                                       regulator-name = "PVDD_ADC_1V8";
-                                       regulator-min-microvolt = <1800000>;
-                                       regulator-max-microvolt = <1800000>;
-                               };
-
-                               ldo5_reg: LDO5 {
-                                       regulator-name = "PVDD_PLL_1V8";
-                                       regulator-min-microvolt = <1800000>;
-                                       regulator-max-microvolt = <1800000>;
-                                       regulator-always-on;
-                               };
-
-                               ldo6_reg: LDO6 {
-                                       regulator-name = "PVDD_ANAIP_1V0";
-                                       regulator-min-microvolt = <1000000>;
-                                       regulator-max-microvolt = <1000000>;
-                               };
-
-                               ldo7_reg: LDO7 {
-                                       regulator-name = "PVDD_ANAIP_1V8";
-                                       regulator-min-microvolt = <1800000>;
-                                       regulator-max-microvolt = <1800000>;
-                               };
-
-                               ldo8_reg: LDO8 {
-                                       regulator-name = "PVDD_ABB_1V8";
-                                       regulator-min-microvolt = <1800000>;
-                                       regulator-max-microvolt = <1800000>;
-                               };
-
-                               ldo9_reg: LDO9 {
-                                       regulator-name = "PVDD_USB_3V3";
-                                       regulator-min-microvolt = <3000000>;
-                                       regulator-max-microvolt = <3000000>;
-                                       regulator-always-on;
-                               };
-
-                               ldo10_reg: LDO10 {
-                                       regulator-name = "PVDD_PRE_1V8";
-                                       regulator-min-microvolt = <1800000>;
-                                       regulator-max-microvolt = <1800000>;
-                                       regulator-always-on;
-                               };
-
-                               ldo11_reg: LDO11 {
-                                       regulator-name = "PVDD_USB_1V0";
-                                       regulator-min-microvolt = <1000000>;
-                                       regulator-max-microvolt = <1000000>;
-                                       regulator-always-on;
-                               };
-
-                               ldo12_reg: LDO12 {
-                                       regulator-name = "PVDD_HSIC_1V8";
-                                       regulator-min-microvolt = <1800000>;
-                                       regulator-max-microvolt = <1800000>;
-                               };
-
-                               ldo13_reg: LDO13 {
-                                       regulator-name = "PVDD_APIO_MMCOFF_2V8";
-                                       regulator-min-microvolt = <2800000>;
-                                       regulator-max-microvolt = <2800000>;
-                               };
-
-                               ldo15_reg: LDO15 {
-                                       regulator-name = "PVDD_PERI_2V8";
-                                       regulator-min-microvolt = <3300000>;
-                                       regulator-max-microvolt = <3300000>;
-                               };
-
-                               ldo16_reg: LDO16 {
-                                       regulator-name = "PVDD_PERI_3V3";
-                                       regulator-min-microvolt = <2200000>;
-                                       regulator-max-microvolt = <2200000>;
-                               };
-
-                               ldo18_reg: LDO18 {
-                                       regulator-name = "PVDD_EMMC_1V8";
-                                       regulator-min-microvolt = <1800000>;
-                                       regulator-max-microvolt = <1800000>;
-                               };
-
-                               ldo19_reg: LDO19 {
-                                       regulator-name = "PVDD_TFLASH_2V8";
-                                       regulator-min-microvolt = <2800000>;
-                                       regulator-max-microvolt = <2800000>;
-                               };
-
-                               ldo20_reg: LDO20 {
-                                       regulator-name = "PVDD_BTWIFI_1V8";
-                                       regulator-min-microvolt = <1800000>;
-                                       regulator-max-microvolt = <1800000>;
-                               };
-
-                               ldo21_reg: LDO21 {
-                                       regulator-name = "PVDD_CAM1IO_1V8";
-                                       regulator-min-microvolt = <1800000>;
-                                       regulator-max-microvolt = <1800000>;
-                               };
-
-                               ldo23_reg: LDO23 {
-                                       regulator-name = "PVDD_MIFS_1V1";
-                                       regulator-min-microvolt = <1200000>;
-                                       regulator-max-microvolt = <1200000>;
-                                       regulator-always-on;
-                               };
-
-                               ldo24_reg: LDO24 {
-                                       regulator-name = "PVDD_CAM1_AVDD_2V8";
-                                       regulator-min-microvolt = <2800000>;
-                                       regulator-max-microvolt = <2800000>;
-                               };
-
-                               ldo26_reg: LDO26 {
-                                       regulator-name = "PVDD_CAM0_AF_2V8";
-                                       regulator-min-microvolt = <3000000>;
-                                       regulator-max-microvolt = <3000000>;
-                               };
-
-                               ldo27_reg: LDO27 {
-                                       regulator-name = "PVDD_G3DS_1V0";
-                                       regulator-min-microvolt = <1200000>;
-                                       regulator-max-microvolt = <1200000>;
-                               };
-
-                               ldo28_reg: LDO28 {
-                                       regulator-name = "PVDD_TSP_3V3";
-                                       regulator-min-microvolt = <3300000>;
-                                       regulator-max-microvolt = <3300000>;
-                               };
-
-                               ldo29_reg: LDO29 {
-                                       regulator-name = "PVDD_AUDIO_1V8";
-                                       regulator-min-microvolt = <1800000>;
-                                       regulator-max-microvolt = <1800000>;
-                               };
-
-                               ldo31_reg: LDO31 {
-                                       regulator-name = "PVDD_PERI_1V8";
-                                       regulator-min-microvolt = <1800000>;
-                                       regulator-max-microvolt = <1800000>;
-                               };
-
-                               ldo32_reg: LDO32 {
-                                       regulator-name = "PVDD_LCD_1V8";
-                                       regulator-min-microvolt = <1800000>;
-                                       regulator-max-microvolt = <1800000>;
-                               };
-
-                               ldo33_reg: LDO33 {
-                                       regulator-name = "PVDD_CAM0IO_1V8";
-                                       regulator-min-microvolt = <1800000>;
-                                       regulator-max-microvolt = <1800000>;
-                               };
-
-                               ldo35_reg: LDO35 {
-                                       regulator-name = "PVDD_CAM0_DVDD_1V2";
-                                       regulator-min-microvolt = <1200000>;
-                                       regulator-max-microvolt = <1200000>;
-                               };
-
-                               ldo38_reg: LDO38 {
-                                       regulator-name = "PVDD_CAM0_AVDD_2V8";
-                                       regulator-min-microvolt = <2800000>;
-                                       regulator-max-microvolt = <2800000>;
-                               };
-
-                               buck1_reg: BUCK1 {
-                                       regulator-name = "PVDD_MIF_1V1";
-                                       regulator-min-microvolt = <800000>;
-                                       regulator-max-microvolt = <1100000>;
-                                       regulator-always-on;
-                               };
-
-                               buck2_reg: BUCK2 {
-                                       regulator-name = "vdd_arm";
-                                       regulator-min-microvolt = <800000>;
-                                       regulator-max-microvolt = <1000000>;
-                                       regulator-always-on;
-                               };
-
-                               buck3_reg: BUCK3 {
-                                       regulator-name = "PVDD_INT_1V0";
-                                       regulator-min-microvolt = <800000>;
-                                       regulator-max-microvolt = <1000000>;
-                                       regulator-always-on;
-                               };
-
-                               buck4_reg: BUCK4 {
-                                       regulator-name = "PVDD_G3D_1V0";
-                                       regulator-min-microvolt = <800000>;
-                                       regulator-max-microvolt = <1000000>;
-                               };
-
-                               buck5_reg: BUCK5 {
-                                       regulator-name = "PVDD_LPDDR3_1V2";
-                                       regulator-min-microvolt = <800000>;
-                                       regulator-max-microvolt = <1200000>;
-                                       regulator-always-on;
-                               };
-
-                               buck6_reg: BUCK6 {
-                                       regulator-name = "PVDD_KFC_1V0";
-                                       regulator-min-microvolt = <800000>;
-                                       regulator-max-microvolt = <1000000>;
-                                       regulator-always-on;
-                               };
-
-                               buck7_reg: BUCK7 {
-                                       regulator-name = "VIN_LLDO_1V4";
-                                       regulator-min-microvolt = <800000>;
-                                       regulator-max-microvolt = <1400000>;
-                                       regulator-always-on;
-                               };
-
-                               buck8_reg: BUCK8 {
-                                       regulator-name = "VIN_MLDO_2V0";
-                                       regulator-min-microvolt = <800000>;
-                                       regulator-max-microvolt = <2000000>;
-                                       regulator-always-on;
-                               };
-
-                               buck9_reg: BUCK9 {
-                                       regulator-name = "VIN_HLDO_3V5";
-                                       regulator-min-microvolt = <3000000>;
-                                       regulator-max-microvolt = <3500000>;
-                                       regulator-always-on;
-                               };
-
-                               buck10_reg: BUCK10 {
-                                       regulator-name = "PVDD_EMMCF_2V8";
-                                       regulator-min-microvolt = <2800000>;
-                                       regulator-max-microvolt = <2800000>;
-                               };
-                       };
-               };
-       };
-
        gpio_keys {
                compatible = "gpio-keys";
 
 &cci {
        status = "disabled";
 };
+
+&hsi2c_4 {
+       status = "okay";
+
+       s2mps11_pmic@66 {
+               compatible = "samsung,s2mps11-pmic";
+               reg = <0x66>;
+               s2mps11,buck2-ramp-delay = <12>;
+               s2mps11,buck34-ramp-delay = <12>;
+               s2mps11,buck16-ramp-delay = <12>;
+               s2mps11,buck6-ramp-enable = <1>;
+               s2mps11,buck2-ramp-enable = <1>;
+               s2mps11,buck3-ramp-enable = <1>;
+               s2mps11,buck4-ramp-enable = <1>;
+
+               interrupt-parent = <&gpx3>;
+               interrupts = <2 IRQ_TYPE_EDGE_FALLING>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&s2mps11_irq>;
+
+               s2mps11_osc: clocks {
+                       #clock-cells = <1>;
+                       clock-output-names = "s2mps11_ap",
+                                       "s2mps11_cp", "s2mps11_bt";
+               };
+
+               regulators {
+                       ldo1_reg: LDO1 {
+                               regulator-name = "PVDD_ALIVE_1V0";
+                               regulator-min-microvolt = <1000000>;
+                               regulator-max-microvolt = <1000000>;
+                               regulator-always-on;
+                       };
+
+                       ldo2_reg: LDO2 {
+                               regulator-name = "PVDD_APIO_1V8";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                       };
+
+                       ldo3_reg: LDO3 {
+                               regulator-name = "PVDD_APIO_MMCON_1V8";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-always-on;
+                       };
+
+                       ldo4_reg: LDO4 {
+                               regulator-name = "PVDD_ADC_1V8";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                       };
+
+                       ldo5_reg: LDO5 {
+                               regulator-name = "PVDD_PLL_1V8";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-always-on;
+                       };
+
+                       ldo6_reg: LDO6 {
+                               regulator-name = "PVDD_ANAIP_1V0";
+                               regulator-min-microvolt = <1000000>;
+                               regulator-max-microvolt = <1000000>;
+                       };
+
+                       ldo7_reg: LDO7 {
+                               regulator-name = "PVDD_ANAIP_1V8";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                       };
+
+                       ldo8_reg: LDO8 {
+                               regulator-name = "PVDD_ABB_1V8";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                       };
+
+                       ldo9_reg: LDO9 {
+                               regulator-name = "PVDD_USB_3V3";
+                               regulator-min-microvolt = <3000000>;
+                               regulator-max-microvolt = <3000000>;
+                               regulator-always-on;
+                       };
+
+                       ldo10_reg: LDO10 {
+                               regulator-name = "PVDD_PRE_1V8";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-always-on;
+                       };
+
+                       ldo11_reg: LDO11 {
+                               regulator-name = "PVDD_USB_1V0";
+                               regulator-min-microvolt = <1000000>;
+                               regulator-max-microvolt = <1000000>;
+                               regulator-always-on;
+                       };
+
+                       ldo12_reg: LDO12 {
+                               regulator-name = "PVDD_HSIC_1V8";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                       };
+
+                       ldo13_reg: LDO13 {
+                               regulator-name = "PVDD_APIO_MMCOFF_2V8";
+                               regulator-min-microvolt = <2800000>;
+                               regulator-max-microvolt = <2800000>;
+                       };
+
+                       ldo15_reg: LDO15 {
+                               regulator-name = "PVDD_PERI_2V8";
+                               regulator-min-microvolt = <3300000>;
+                               regulator-max-microvolt = <3300000>;
+                       };
+
+                       ldo16_reg: LDO16 {
+                               regulator-name = "PVDD_PERI_3V3";
+                               regulator-min-microvolt = <2200000>;
+                               regulator-max-microvolt = <2200000>;
+                       };
+
+                       ldo18_reg: LDO18 {
+                               regulator-name = "PVDD_EMMC_1V8";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                       };
+
+                       ldo19_reg: LDO19 {
+                               regulator-name = "PVDD_TFLASH_2V8";
+                               regulator-min-microvolt = <2800000>;
+                               regulator-max-microvolt = <2800000>;
+                       };
+
+                       ldo20_reg: LDO20 {
+                               regulator-name = "PVDD_BTWIFI_1V8";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                       };
+
+                       ldo21_reg: LDO21 {
+                               regulator-name = "PVDD_CAM1IO_1V8";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                       };
+
+                       ldo23_reg: LDO23 {
+                               regulator-name = "PVDD_MIFS_1V1";
+                               regulator-min-microvolt = <1200000>;
+                               regulator-max-microvolt = <1200000>;
+                               regulator-always-on;
+                       };
+
+                       ldo24_reg: LDO24 {
+                               regulator-name = "PVDD_CAM1_AVDD_2V8";
+                               regulator-min-microvolt = <2800000>;
+                               regulator-max-microvolt = <2800000>;
+                       };
+
+                       ldo26_reg: LDO26 {
+                               regulator-name = "PVDD_CAM0_AF_2V8";
+                               regulator-min-microvolt = <3000000>;
+                               regulator-max-microvolt = <3000000>;
+                       };
+
+                       ldo27_reg: LDO27 {
+                               regulator-name = "PVDD_G3DS_1V0";
+                               regulator-min-microvolt = <1200000>;
+                               regulator-max-microvolt = <1200000>;
+                       };
+
+                       ldo28_reg: LDO28 {
+                               regulator-name = "PVDD_TSP_3V3";
+                               regulator-min-microvolt = <3300000>;
+                               regulator-max-microvolt = <3300000>;
+                       };
+
+                       ldo29_reg: LDO29 {
+                               regulator-name = "PVDD_AUDIO_1V8";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                       };
+
+                       ldo31_reg: LDO31 {
+                               regulator-name = "PVDD_PERI_1V8";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                       };
+
+                       ldo32_reg: LDO32 {
+                               regulator-name = "PVDD_LCD_1V8";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                       };
+
+                       ldo33_reg: LDO33 {
+                               regulator-name = "PVDD_CAM0IO_1V8";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                       };
+
+                       ldo35_reg: LDO35 {
+                               regulator-name = "PVDD_CAM0_DVDD_1V2";
+                               regulator-min-microvolt = <1200000>;
+                               regulator-max-microvolt = <1200000>;
+                       };
+
+                       ldo38_reg: LDO38 {
+                               regulator-name = "PVDD_CAM0_AVDD_2V8";
+                               regulator-min-microvolt = <2800000>;
+                               regulator-max-microvolt = <2800000>;
+                       };
+
+                       buck1_reg: BUCK1 {
+                               regulator-name = "PVDD_MIF_1V1";
+                               regulator-min-microvolt = <800000>;
+                               regulator-max-microvolt = <1100000>;
+                               regulator-always-on;
+                       };
+
+                       buck2_reg: BUCK2 {
+                               regulator-name = "vdd_arm";
+                               regulator-min-microvolt = <800000>;
+                               regulator-max-microvolt = <1000000>;
+                               regulator-always-on;
+                       };
+
+                       buck3_reg: BUCK3 {
+                               regulator-name = "PVDD_INT_1V0";
+                               regulator-min-microvolt = <800000>;
+                               regulator-max-microvolt = <1000000>;
+                               regulator-always-on;
+                       };
+
+                       buck4_reg: BUCK4 {
+                               regulator-name = "PVDD_G3D_1V0";
+                               regulator-min-microvolt = <800000>;
+                               regulator-max-microvolt = <1000000>;
+                       };
+
+                       buck5_reg: BUCK5 {
+                               regulator-name = "PVDD_LPDDR3_1V2";
+                               regulator-min-microvolt = <800000>;
+                               regulator-max-microvolt = <1200000>;
+                               regulator-always-on;
+                       };
+
+                       buck6_reg: BUCK6 {
+                               regulator-name = "PVDD_KFC_1V0";
+                               regulator-min-microvolt = <800000>;
+                               regulator-max-microvolt = <1000000>;
+                               regulator-always-on;
+                       };
+
+                       buck7_reg: BUCK7 {
+                               regulator-name = "VIN_LLDO_1V4";
+                               regulator-min-microvolt = <800000>;
+                               regulator-max-microvolt = <1400000>;
+                               regulator-always-on;
+                       };
+
+                       buck8_reg: BUCK8 {
+                               regulator-name = "VIN_MLDO_2V0";
+                               regulator-min-microvolt = <800000>;
+                               regulator-max-microvolt = <2000000>;
+                               regulator-always-on;
+                       };
+
+                       buck9_reg: BUCK9 {
+                               regulator-name = "VIN_HLDO_3V5";
+                               regulator-min-microvolt = <3000000>;
+                               regulator-max-microvolt = <3500000>;
+                               regulator-always-on;
+                       };
+
+                       buck10_reg: BUCK10 {
+                               regulator-name = "PVDD_EMMCF_2V8";
+                               regulator-min-microvolt = <2800000>;
+                               regulator-max-microvolt = <2800000>;
+                       };
+               };
+       };
+};
+
+&mfc {
+       samsung,mfc-r = <0x43000000 0x800000>;
+       samsung,mfc-l = <0x51000000 0x800000>;
+};
+
+&mmc_0 {
+       status = "okay";
+       broken-cd;
+       card-detect-delay = <200>;
+       samsung,dw-mshc-ciu-div = <3>;
+       samsung,dw-mshc-sdr-timing = <0 4>;
+       samsung,dw-mshc-ddr-timing = <0 2>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&sd0_clk &sd0_cmd &sd0_bus1 &sd0_bus4 &sd0_bus8>;
+       vmmc-supply = <&ldo10_reg>;
+       bus-width = <8>;
+       cap-mmc-highspeed;
+};
+
+&mmc_2 {
+       status = "okay";
+       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_bus1 &sd2_bus4>;
+       vmmc-supply = <&ldo19_reg>;
+       vqmmc-supply = <&ldo13_reg>;
+       bus-width = <4>;
+       cap-sd-highspeed;
+};
+
+&pinctrl_0 {
+       s2mps11_irq: s2mps11-irq {
+               samsung,pins = "gpx3-2";
+               samsung,pin-function = <0xf>;
+               samsung,pin-pud = <0>;
+               samsung,pin-drv = <0>;
+       };
+};
+
+&rtc {
+       status = "okay";
+       clocks = <&clock CLK_RTC>, <&s2mps11_osc S2MPS11_CLK_AP>;
+       clock-names = "rtc", "rtc_src";
+};
index 146e71118a72b4eef98faf47f644c0216bbb5894..8f4d76c5e11c5821ef7e504f21aa87c6103c92de 100644 (file)
        };
 };
 
-&uart_3 {
+&serial_3 {
        status = "okay";
 };
 
index 9103f2381a6d7ccefd22a429758fd7e3a4755820..98871f972c8a770a28cdca898ff11ef1b134665a 100644 (file)
                };
        };
 
-       rtc@101E0000 {
-               status = "okay";
-       };
-
-       codec@11000000 {
-               samsung,mfc-r = <0x43000000 0x800000>;
-               samsung,mfc-l = <0x51000000 0x800000>;
-       };
-
-       mmc@12200000 {
-               status = "okay";
-               broken-cd;
-               card-detect-delay = <200>;
-               samsung,dw-mshc-ciu-div = <3>;
-               samsung,dw-mshc-sdr-timing = <0 4>;
-               samsung,dw-mshc-ddr-timing = <0 2>;
-               samsung,dw-mshc-hs400-timing = <0 2>;
-               samsung,read-strobe-delay = <90>;
-               pinctrl-names = "default";
-               pinctrl-0 = <&sd0_clk &sd0_cmd &sd0_bus1 &sd0_bus4 &sd0_bus8
-                            &sd0_rclk>;
-               bus-width = <8>;
-               cap-mmc-highspeed;
-       };
-
-       mmc@12220000 {
-               status = "okay";
-               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_bus1 &sd2_bus4>;
-               bus-width = <4>;
-               cap-sd-highspeed;
-       };
-
-       dp-controller@145B0000 {
-               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 = <4>;
-               status = "okay";
-       };
-
-       fimd@14400000 {
-               status = "okay";
-               display-timings {
-                       native-mode = <&timing0>;
-                       timing0: timing@0 {
-                               clock-frequency = <50000>;
-                               hactive = <2560>;
-                               vactive = <1600>;
-                               hfront-porch = <48>;
-                               hback-porch = <80>;
-                               hsync-len = <32>;
-                               vback-porch = <16>;
-                               vfront-porch = <8>;
-                               vsync-len = <6>;
-                       };
-               };
-       };
-
-       pinctrl@13400000 {
-               hdmi_hpd_irq: hdmi-hpd-irq {
-                       samsung,pins = "gpx3-7";
-                       samsung,pin-function = <0>;
-                       samsung,pin-pud = <1>;
-                       samsung,pin-drv = <0>;
-               };
-       };
-
-       pinctrl@14000000 {
-               usb300_vbus_en: usb300-vbus-en {
-                       samsung,pins = "gpg0-5";
-                       samsung,pin-function = <1>;
-                       samsung,pin-pud = <0>;
-                       samsung,pin-drv = <0>;
-               };
-
-               usb301_vbus_en: usb301-vbus-en {
-                       samsung,pins = "gpg1-4";
-                       samsung,pin-function = <1>;
-                       samsung,pin-pud = <0>;
-                       samsung,pin-drv = <0>;
-               };
-       };
-
-       hdmi@14530000 {
-               status = "okay";
-               hpd-gpio = <&gpx3 7 0>;
-               pinctrl-names = "default";
-               pinctrl-0 = <&hdmi_hpd_irq>;
-       };
-
        usb300_vbus_reg: regulator-usb300 {
                compatible = "regulator-fixed";
                regulator-name = "VBUS0";
                enable-active-high;
        };
 
-       phy@12100000 {
-               vbus-supply = <&usb300_vbus_reg>;
-       };
+};
 
-       phy@12500000 {
-               vbus-supply = <&usb301_vbus_reg>;
+&dp {
+       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 = <4>;
+       status = "okay";
+};
+
+&fimd {
+       status = "okay";
+       display-timings {
+               native-mode = <&timing0>;
+               timing0: timing@0 {
+                       clock-frequency = <50000>;
+                       hactive = <2560>;
+                       vactive = <1600>;
+                       hfront-porch = <48>;
+                       hback-porch = <80>;
+                       hsync-len = <32>;
+                       vback-porch = <16>;
+                       vfront-porch = <8>;
+                       vsync-len = <6>;
+               };
        };
+};
 
-       i2c_2: i2c@12C80000 {
-               samsung,i2c-sda-delay = <100>;
-               samsung,i2c-max-bus-freq = <66000>;
-               status = "okay";
+&hdmi {
+       status = "okay";
+       hpd-gpio = <&gpx3 7 0>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&hdmi_hpd_irq>;
+};
 
-               hdmiddc@50 {
-                       compatible = "samsung,exynos4210-hdmiddc";
-                       reg = <0x50>;
+&hsi2c_4 {
+       status = "okay";
+
+       s2mps11_pmic@66 {
+               compatible = "samsung,s2mps11-pmic";
+               reg = <0x66>;
+               s2mps11,buck2-ramp-delay = <12>;
+               s2mps11,buck34-ramp-delay = <12>;
+               s2mps11,buck16-ramp-delay = <12>;
+               s2mps11,buck6-ramp-enable = <1>;
+               s2mps11,buck2-ramp-enable = <1>;
+               s2mps11,buck3-ramp-enable = <1>;
+               s2mps11,buck4-ramp-enable = <1>;
+
+               s2mps11_osc: clocks {
+                       #clock-cells = <1>;
+                       clock-output-names = "s2mps11_ap",
+                                       "s2mps11_cp", "s2mps11_bt";
                };
-       };
 
-       hsi2c_4: i2c@12CA0000 {
-               status = "okay";
-
-               s2mps11_pmic@66 {
-                       compatible = "samsung,s2mps11-pmic";
-                       reg = <0x66>;
-                       s2mps11,buck2-ramp-delay = <12>;
-                       s2mps11,buck34-ramp-delay = <12>;
-                       s2mps11,buck16-ramp-delay = <12>;
-                       s2mps11,buck6-ramp-enable = <1>;
-                       s2mps11,buck2-ramp-enable = <1>;
-                       s2mps11,buck3-ramp-enable = <1>;
-                       s2mps11,buck4-ramp-enable = <1>;
-
-                       s2mps11_osc: clocks {
-                               #clock-cells = <1>;
-                               clock-output-names = "s2mps11_ap",
-                                               "s2mps11_cp", "s2mps11_bt";
+               regulators {
+                       ldo1_reg: LDO1 {
+                               regulator-name = "vdd_ldo1";
+                               regulator-min-microvolt = <1000000>;
+                               regulator-max-microvolt = <1000000>;
+                               regulator-always-on;
+                       };
+
+                       ldo3_reg: LDO3 {
+                               regulator-name = "vdd_ldo3";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-always-on;
+                       };
+
+                       ldo5_reg: LDO5 {
+                               regulator-name = "vdd_ldo5";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-always-on;
+                       };
+
+                       ldo6_reg: LDO6 {
+                               regulator-name = "vdd_ldo6";
+                               regulator-min-microvolt = <1000000>;
+                               regulator-max-microvolt = <1000000>;
+                               regulator-always-on;
+                       };
+
+                       ldo7_reg: LDO7 {
+                               regulator-name = "vdd_ldo7";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-always-on;
+                       };
+
+                       ldo8_reg: LDO8 {
+                               regulator-name = "vdd_ldo8";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-always-on;
+                       };
+
+                       ldo9_reg: LDO9 {
+                               regulator-name = "vdd_ldo9";
+                               regulator-min-microvolt = <3000000>;
+                               regulator-max-microvolt = <3000000>;
+                               regulator-always-on;
+                       };
+
+                       ldo10_reg: LDO10 {
+                               regulator-name = "vdd_ldo10";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-always-on;
+                       };
+
+                       ldo11_reg: LDO11 {
+                               regulator-name = "vdd_ldo11";
+                               regulator-min-microvolt = <1000000>;
+                               regulator-max-microvolt = <1000000>;
+                               regulator-always-on;
+                       };
+
+                       ldo12_reg: LDO12 {
+                               regulator-name = "vdd_ldo12";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-always-on;
                        };
 
-                       regulators {
-                               ldo1_reg: LDO1 {
-                                       regulator-name = "vdd_ldo1";
-                                       regulator-min-microvolt = <1000000>;
-                                       regulator-max-microvolt = <1000000>;
-                                       regulator-always-on;
-                               };
-
-                               ldo3_reg: LDO3 {
-                                       regulator-name = "vdd_ldo3";
-                                       regulator-min-microvolt = <1800000>;
-                                       regulator-max-microvolt = <1800000>;
-                                       regulator-always-on;
-                               };
-
-                               ldo5_reg: LDO5 {
-                                       regulator-name = "vdd_ldo5";
-                                       regulator-min-microvolt = <1800000>;
-                                       regulator-max-microvolt = <1800000>;
-                                       regulator-always-on;
-                               };
-
-                               ldo6_reg: LDO6 {
-                                       regulator-name = "vdd_ldo6";
-                                       regulator-min-microvolt = <1000000>;
-                                       regulator-max-microvolt = <1000000>;
-                                       regulator-always-on;
-                               };
-
-                               ldo7_reg: LDO7 {
-                                       regulator-name = "vdd_ldo7";
-                                       regulator-min-microvolt = <1800000>;
-                                       regulator-max-microvolt = <1800000>;
-                                       regulator-always-on;
-                               };
-
-                               ldo8_reg: LDO8 {
-                                       regulator-name = "vdd_ldo8";
-                                       regulator-min-microvolt = <1800000>;
-                                       regulator-max-microvolt = <1800000>;
-                                       regulator-always-on;
-                               };
-
-                               ldo9_reg: LDO9 {
-                                       regulator-name = "vdd_ldo9";
-                                       regulator-min-microvolt = <3000000>;
-                                       regulator-max-microvolt = <3000000>;
-                                       regulator-always-on;
-                               };
-
-                               ldo10_reg: LDO10 {
-                                       regulator-name = "vdd_ldo10";
-                                       regulator-min-microvolt = <1800000>;
-                                       regulator-max-microvolt = <1800000>;
-                                       regulator-always-on;
-                               };
-
-                               ldo11_reg: LDO11 {
-                                       regulator-name = "vdd_ldo11";
-                                       regulator-min-microvolt = <1000000>;
-                                       regulator-max-microvolt = <1000000>;
-                                       regulator-always-on;
-                               };
-
-                               ldo12_reg: LDO12 {
-                                       regulator-name = "vdd_ldo12";
-                                       regulator-min-microvolt = <1800000>;
-                                       regulator-max-microvolt = <1800000>;
-                                       regulator-always-on;
-                               };
-
-                               ldo13_reg: LDO13 {
-                                       regulator-name = "vdd_ldo13";
-                                       regulator-min-microvolt = <2800000>;
-                                       regulator-max-microvolt = <2800000>;
-                                       regulator-always-on;
-                               };
-
-                               ldo15_reg: LDO15 {
-                                       regulator-name = "vdd_ldo15";
-                                       regulator-min-microvolt = <3100000>;
-                                       regulator-max-microvolt = <3100000>;
-                                       regulator-always-on;
-                               };
-
-                               ldo16_reg: LDO16 {
-                                       regulator-name = "vdd_ldo16";
-                                       regulator-min-microvolt = <2200000>;
-                                       regulator-max-microvolt = <2200000>;
-                                       regulator-always-on;
-                               };
-
-                               ldo17_reg: LDO17 {
-                                       regulator-name = "tsp_avdd";
-                                       regulator-min-microvolt = <3300000>;
-                                       regulator-max-microvolt = <3300000>;
-                                       regulator-always-on;
-                               };
-
-                               ldo19_reg: LDO19 {
-                                       regulator-name = "vdd_sd";
-                                       regulator-min-microvolt = <2800000>;
-                                       regulator-max-microvolt = <2800000>;
-                                       regulator-always-on;
-                               };
-
-                               ldo24_reg: LDO24 {
-                                       regulator-name = "tsp_io";
-                                       regulator-min-microvolt = <2800000>;
-                                       regulator-max-microvolt = <2800000>;
-                                       regulator-always-on;
-                               };
-
-                               buck1_reg: BUCK1 {
-                                       regulator-name = "vdd_mif";
-                                       regulator-min-microvolt = <800000>;
-                                       regulator-max-microvolt = <1300000>;
-                                       regulator-always-on;
-                                       regulator-boot-on;
-                               };
-
-                               buck2_reg: BUCK2 {
-                                       regulator-name = "vdd_arm";
-                                       regulator-min-microvolt = <800000>;
-                                       regulator-max-microvolt = <1500000>;
-                                       regulator-always-on;
-                                       regulator-boot-on;
-                               };
-
-                               buck3_reg: BUCK3 {
-                                       regulator-name = "vdd_int";
-                                       regulator-min-microvolt = <800000>;
-                                       regulator-max-microvolt = <1400000>;
-                                       regulator-always-on;
-                                       regulator-boot-on;
-                               };
-
-                               buck4_reg: BUCK4 {
-                                       regulator-name = "vdd_g3d";
-                                       regulator-min-microvolt = <800000>;
-                                       regulator-max-microvolt = <1400000>;
-                                       regulator-always-on;
-                                       regulator-boot-on;
-                               };
-
-                               buck5_reg: BUCK5 {
-                                       regulator-name = "vdd_mem";
-                                       regulator-min-microvolt = <800000>;
-                                       regulator-max-microvolt = <1400000>;
-                                       regulator-always-on;
-                                       regulator-boot-on;
-                               };
-
-                               buck6_reg: BUCK6 {
-                                       regulator-name = "vdd_kfc";
-                                       regulator-min-microvolt = <800000>;
-                                       regulator-max-microvolt = <1500000>;
-                                       regulator-always-on;
-                                       regulator-boot-on;
-                               };
-
-                               buck7_reg: BUCK7 {
-                                       regulator-name = "vdd_1.0v_ldo";
-                                       regulator-min-microvolt = <800000>;
-                                       regulator-max-microvolt = <1500000>;
-                                       regulator-always-on;
-                                       regulator-boot-on;
-                               };
-
-                               buck8_reg: BUCK8 {
-                                       regulator-name = "vdd_1.8v_ldo";
-                                       regulator-min-microvolt = <800000>;
-                                       regulator-max-microvolt = <1500000>;
-                                       regulator-always-on;
-                                       regulator-boot-on;
-                               };
-
-                               buck9_reg: BUCK9 {
-                                       regulator-name = "vdd_2.8v_ldo";
-                                       regulator-min-microvolt = <3000000>;
-                                       regulator-max-microvolt = <3750000>;
-                                       regulator-always-on;
-                                       regulator-boot-on;
-                               };
-
-                               buck10_reg: BUCK10 {
-                                       regulator-name = "vdd_vmem";
-                                       regulator-min-microvolt = <2850000>;
-                                       regulator-max-microvolt = <2850000>;
-                                       regulator-always-on;
-                                       regulator-boot-on;
-                               };
+                       ldo13_reg: LDO13 {
+                               regulator-name = "vdd_ldo13";
+                               regulator-min-microvolt = <2800000>;
+                               regulator-max-microvolt = <2800000>;
+                               regulator-always-on;
+                       };
+
+                       ldo15_reg: LDO15 {
+                               regulator-name = "vdd_ldo15";
+                               regulator-min-microvolt = <3100000>;
+                               regulator-max-microvolt = <3100000>;
+                               regulator-always-on;
+                       };
+
+                       ldo16_reg: LDO16 {
+                               regulator-name = "vdd_ldo16";
+                               regulator-min-microvolt = <2200000>;
+                               regulator-max-microvolt = <2200000>;
+                               regulator-always-on;
+                       };
+
+                       ldo17_reg: LDO17 {
+                               regulator-name = "tsp_avdd";
+                               regulator-min-microvolt = <3300000>;
+                               regulator-max-microvolt = <3300000>;
+                               regulator-always-on;
+                       };
+
+                       ldo19_reg: LDO19 {
+                               regulator-name = "vdd_sd";
+                               regulator-min-microvolt = <2800000>;
+                               regulator-max-microvolt = <2800000>;
+                               regulator-always-on;
+                       };
+
+                       ldo24_reg: LDO24 {
+                               regulator-name = "tsp_io";
+                               regulator-min-microvolt = <2800000>;
+                               regulator-max-microvolt = <2800000>;
+                               regulator-always-on;
+                       };
+
+                       buck1_reg: BUCK1 {
+                               regulator-name = "vdd_mif";
+                               regulator-min-microvolt = <800000>;
+                               regulator-max-microvolt = <1300000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                       };
+
+                       buck2_reg: BUCK2 {
+                               regulator-name = "vdd_arm";
+                               regulator-min-microvolt = <800000>;
+                               regulator-max-microvolt = <1500000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                       };
+
+                       buck3_reg: BUCK3 {
+                               regulator-name = "vdd_int";
+                               regulator-min-microvolt = <800000>;
+                               regulator-max-microvolt = <1400000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                       };
+
+                       buck4_reg: BUCK4 {
+                               regulator-name = "vdd_g3d";
+                               regulator-min-microvolt = <800000>;
+                               regulator-max-microvolt = <1400000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                       };
+
+                       buck5_reg: BUCK5 {
+                               regulator-name = "vdd_mem";
+                               regulator-min-microvolt = <800000>;
+                               regulator-max-microvolt = <1400000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                       };
+
+                       buck6_reg: BUCK6 {
+                               regulator-name = "vdd_kfc";
+                               regulator-min-microvolt = <800000>;
+                               regulator-max-microvolt = <1500000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                       };
+
+                       buck7_reg: BUCK7 {
+                               regulator-name = "vdd_1.0v_ldo";
+                               regulator-min-microvolt = <800000>;
+                               regulator-max-microvolt = <1500000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                       };
+
+                       buck8_reg: BUCK8 {
+                               regulator-name = "vdd_1.8v_ldo";
+                               regulator-min-microvolt = <800000>;
+                               regulator-max-microvolt = <1500000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                       };
+
+                       buck9_reg: BUCK9 {
+                               regulator-name = "vdd_2.8v_ldo";
+                               regulator-min-microvolt = <3000000>;
+                               regulator-max-microvolt = <3750000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                       };
+
+                       buck10_reg: BUCK10 {
+                               regulator-name = "vdd_vmem";
+                               regulator-min-microvolt = <2850000>;
+                               regulator-max-microvolt = <2850000>;
+                               regulator-always-on;
+                               regulator-boot-on;
                        };
                };
        };
 };
+
+&i2c_2 {
+       samsung,i2c-sda-delay = <100>;
+       samsung,i2c-max-bus-freq = <66000>;
+       status = "okay";
+
+       hdmiddc@50 {
+               compatible = "samsung,exynos4210-hdmiddc";
+               reg = <0x50>;
+       };
+};
+
+&mfc {
+       samsung,mfc-r = <0x43000000 0x800000>;
+       samsung,mfc-l = <0x51000000 0x800000>;
+};
+
+&mmc_0 {
+       status = "okay";
+       broken-cd;
+       card-detect-delay = <200>;
+       samsung,dw-mshc-ciu-div = <3>;
+       samsung,dw-mshc-sdr-timing = <0 4>;
+       samsung,dw-mshc-ddr-timing = <0 2>;
+       samsung,dw-mshc-hs400-timing = <0 2>;
+       samsung,read-strobe-delay = <90>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&sd0_clk &sd0_cmd &sd0_bus1 &sd0_bus4 &sd0_bus8
+                    &sd0_rclk>;
+       bus-width = <8>;
+       cap-mmc-highspeed;
+};
+
+&mmc_2 {
+       status = "okay";
+       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_bus1 &sd2_bus4>;
+       bus-width = <4>;
+       cap-sd-highspeed;
+};
+
+&pinctrl_0 {
+       hdmi_hpd_irq: hdmi-hpd-irq {
+               samsung,pins = "gpx3-7";
+               samsung,pin-function = <0>;
+               samsung,pin-pud = <1>;
+               samsung,pin-drv = <0>;
+       };
+};
+
+&pinctrl_2 {
+       usb300_vbus_en: usb300-vbus-en {
+               samsung,pins = "gpg0-5";
+               samsung,pin-function = <1>;
+               samsung,pin-pud = <0>;
+               samsung,pin-drv = <0>;
+       };
+
+       usb301_vbus_en: usb301-vbus-en {
+               samsung,pins = "gpg1-4";
+               samsung,pin-function = <1>;
+               samsung,pin-pud = <0>;
+               samsung,pin-drv = <0>;
+       };
+};
+
+&rtc {
+       status = "okay";
+};
+
+&usbdrd_phy0 {
+       vbus-supply = <&usb300_vbus_reg>;
+};
+
+&usbdrd_phy1 {
+       vbus-supply = <&usb301_vbus_reg>;
+};
index 45317538bbaeb48309d1b16c0e18beb8a7376639..534f27ceb10b04f0c7a485029827ba2620a88ca3 100644 (file)
                clocks = <&clock CLK_MFC>;
                clock-names = "mfc";
                power-domains = <&mfc_pd>;
+               iommus = <&sysmmu_mfc_l>, <&sysmmu_mfc_r>;
+               iommu-names = "left", "right";
        };
 
        mmc_0: mmc@12200000 {
        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";
+               clocks = <&clock CLK_FIN_PLL>, <&clock CLK_MOUT_USER_ACLK333>;
+               clock-names = "oscclk", "clk0";
                #power-domain-cells = <0>;
        };
 
                compatible = "samsung,exynos4210-pd";
                reg = <0x100440C0 0x20>;
                #power-domain-cells = <0>;
-               clocks = <&clock CLK_FIN_PLL>, <&clock CLK_MOUT_SW_ACLK200>,
+               clocks = <&clock CLK_FIN_PLL>,
                         <&clock CLK_MOUT_USER_ACLK200_DISP1>,
-                        <&clock CLK_MOUT_SW_ACLK300>,
                         <&clock CLK_MOUT_USER_ACLK300_DISP1>,
-                        <&clock CLK_MOUT_SW_ACLK400>,
                         <&clock CLK_MOUT_USER_ACLK400_DISP1>,
                         <&clock CLK_FIMD1>, <&clock CLK_MIXER>;
-               clock-names = "oscclk", "pclk0", "clk0",
-                             "pclk1", "clk1", "pclk2", "clk2",
-                             "asb0", "asb1";
+               clock-names = "oscclk", "clk0", "clk1", "clk2", "asb0", "asb1";
        };
 
        pinctrl_0: pinctrl@13400000 {
                interrupts = <0 47 0>;
        };
 
-       rtc: rtc@101E0000 {
-               clocks = <&clock CLK_RTC>;
-               clock-names = "rtc";
-               interrupt-parent = <&pmu_system_controller>;
-               status = "disabled";
-       };
-
        amba {
                #address-cells = <1>;
                #size-cells = <1>;
                        <&clock_audss EXYNOS_I2S_BUS>,
                        <&clock_audss EXYNOS_SCLK_I2S>;
                clock-names = "iis", "i2s_opclk0", "i2s_opclk1";
+               #clock-cells = <1>;
+               clock-output-names = "i2s_cdclk0";
+               #sound-dai-cells = <1>;
                samsung,idma-addr = <0x03000000>;
                pinctrl-names = "default";
                pinctrl-0 = <&i2s0_bus>;
                dma-names = "tx", "rx";
                clocks = <&clock CLK_I2S1>, <&clock CLK_SCLK_I2S1>;
                clock-names = "iis", "i2s_opclk0";
+               #clock-cells = <1>;
+               clock-output-names = "i2s_cdclk1";
+               #sound-dai-cells = <1>;
                pinctrl-names = "default";
                pinctrl-0 = <&i2s1_bus>;
                status = "disabled";
                dma-names = "tx", "rx";
                clocks = <&clock CLK_I2S2>, <&clock CLK_SCLK_I2S2>;
                clock-names = "iis", "i2s_opclk0";
+               #clock-cells = <1>;
+               clock-output-names = "i2s_cdclk2";
+               #sound-dai-cells = <1>;
                pinctrl-names = "default";
                pinctrl-0 = <&i2s2_bus>;
                status = "disabled";
                status = "disabled";
        };
 
-       uart_0: serial@12C00000 {
-               clocks = <&clock CLK_UART0>, <&clock CLK_SCLK_UART0>;
-               clock-names = "uart", "clk_uart_baud0";
-       };
-
-       uart_1: serial@12C10000 {
-               clocks = <&clock CLK_UART1>, <&clock CLK_SCLK_UART1>;
-               clock-names = "uart", "clk_uart_baud0";
-       };
-
-       uart_2: serial@12C20000 {
-               clocks = <&clock CLK_UART2>, <&clock CLK_SCLK_UART2>;
-               clock-names = "uart", "clk_uart_baud0";
-       };
-
-       uart_3: serial@12C30000 {
-               clocks = <&clock CLK_UART3>, <&clock CLK_SCLK_UART3>;
-               clock-names = "uart", "clk_uart_baud0";
-       };
-
        pwm: pwm@12dd0000 {
                compatible = "samsung,exynos4210-pwm";
                reg = <0x12dd0000 0x100>;
                #phy-cells = <0>;
        };
 
-       dp: dp-controller@145B0000 {
-               clocks = <&clock CLK_DP1>;
-               clock-names = "dp";
-               phys = <&dp_phy>;
-               phy-names = "dp";
-               power-domains = <&disp_pd>;
-       };
-
        mipi_phy: video-phy@10040714 {
                compatible = "samsung,s5pv210-mipi-video-phy";
-               reg = <0x10040714 12>;
+               syscon = <&pmu_system_controller>;
                #phy-cells = <1>;
        };
 
                status = "disabled";
        };
 
-       fimd: fimd@14400000 {
-               clocks = <&clock CLK_SCLK_FIMD1>, <&clock CLK_FIMD1>;
-               clock-names = "sclk_fimd", "fimd";
-               power-domains = <&disp_pd>;
-       };
-
        adc: adc@12D10000 {
                compatible = "samsung,exynos-adc-v2";
                reg = <0x12D10000 0x100>;
                         <&clock CLK_SCLK_HDMI>;
                clock-names = "mixer", "hdmi", "sclk_hdmi";
                power-domains = <&disp_pd>;
+               iommus = <&sysmmu_tv>;
        };
 
        gsc_0: video-scaler@13e00000 {
                clocks = <&clock CLK_GSCL0>;
                clock-names = "gscl";
                power-domains = <&gsc_pd>;
+               iommus = <&sysmmu_gscl0>;
        };
 
        gsc_1: video-scaler@13e10000 {
                clocks = <&clock CLK_GSCL1>;
                clock-names = "gscl";
                power-domains = <&gsc_pd>;
+               iommus = <&sysmmu_gscl1>;
+       };
+
+       jpeg_0: jpeg@11F50000 {
+               compatible = "samsung,exynos5420-jpeg";
+               reg = <0x11F50000 0x1000>;
+               interrupts = <0 89 0>;
+               clock-names = "jpeg";
+               clocks = <&clock CLK_JPEG>;
+               iommus = <&sysmmu_jpeg0>;
+       };
+
+       jpeg_1: jpeg@11F60000 {
+               compatible = "samsung,exynos5420-jpeg";
+               reg = <0x11F60000 0x1000>;
+               interrupts = <0 168 0>;
+               clock-names = "jpeg";
+               clocks = <&clock CLK_JPEG2>;
+               iommus = <&sysmmu_jpeg1>;
        };
 
        pmu_system_controller: system-controller@10040000 {
                samsung,sysreg-phandle = <&sysreg_system_controller>;
                samsung,pmureg-phandle = <&pmu_system_controller>;
        };
+
+       sysmmu_g2dr: sysmmu@0x10A60000 {
+               compatible = "samsung,exynos-sysmmu";
+               reg = <0x10A60000 0x1000>;
+               interrupt-parent = <&combiner>;
+               interrupts = <24 5>;
+               clock-names = "sysmmu", "master";
+               clocks = <&clock CLK_SMMU_G2D>, <&clock CLK_G2D>;
+               #iommu-cells = <0>;
+       };
+
+       sysmmu_g2dw: sysmmu@0x10A70000 {
+               compatible = "samsung,exynos-sysmmu";
+               reg = <0x10A70000 0x1000>;
+               interrupt-parent = <&combiner>;
+               interrupts = <22 2>;
+               clock-names = "sysmmu", "master";
+               clocks = <&clock CLK_SMMU_G2D>, <&clock CLK_G2D>;
+               #iommu-cells = <0>;
+       };
+
+       sysmmu_tv: sysmmu@0x14650000 {
+               compatible = "samsung,exynos-sysmmu";
+               reg = <0x14650000 0x1000>;
+               interrupt-parent = <&combiner>;
+               interrupts = <7 4>;
+               clock-names = "sysmmu", "master";
+               clocks = <&clock CLK_SMMU_MIXER>, <&clock CLK_MIXER>;
+               power-domains = <&disp_pd>;
+               #iommu-cells = <0>;
+       };
+
+       sysmmu_gscl0: sysmmu@0x13E80000 {
+               compatible = "samsung,exynos-sysmmu";
+               reg = <0x13E80000 0x1000>;
+               interrupt-parent = <&combiner>;
+               interrupts = <2 0>;
+               clock-names = "sysmmu", "master";
+               clocks = <&clock CLK_SMMU_GSCL0>, <&clock CLK_GSCL0>;
+               power-domains = <&gsc_pd>;
+               #iommu-cells = <0>;
+       };
+
+       sysmmu_gscl1: sysmmu@0x13E90000 {
+               compatible = "samsung,exynos-sysmmu";
+               reg = <0x13E90000 0x1000>;
+               interrupt-parent = <&combiner>;
+               interrupts = <2 2>;
+               clock-names = "sysmmu", "master";
+               clocks = <&clock CLK_SMMU_GSCL1>, <&clock CLK_GSCL1>;
+               power-domains = <&gsc_pd>;
+               #iommu-cells = <0>;
+       };
+
+       sysmmu_scaler0r: sysmmu@0x12880000 {
+               compatible = "samsung,exynos-sysmmu";
+               reg = <0x12880000 0x1000>;
+               interrupt-parent = <&combiner>;
+               interrupts = <22 4>;
+               clock-names = "sysmmu", "master";
+               clocks = <&clock CLK_SMMU_MSCL0>, <&clock CLK_MSCL0>;
+               #iommu-cells = <0>;
+       };
+
+       sysmmu_scaler1r: sysmmu@0x12890000 {
+               compatible = "samsung,exynos-sysmmu";
+               reg = <0x12890000 0x1000>;
+               interrupts = <0 186 0>;
+               clock-names = "sysmmu", "master";
+               clocks = <&clock CLK_SMMU_MSCL1>, <&clock CLK_MSCL1>;
+               #iommu-cells = <0>;
+       };
+
+       sysmmu_scaler2r: sysmmu@0x128A0000 {
+               compatible = "samsung,exynos-sysmmu";
+               reg = <0x128A0000 0x1000>;
+               interrupts = <0 188 0>;
+               clock-names = "sysmmu", "master";
+               clocks = <&clock CLK_SMMU_MSCL2>, <&clock CLK_MSCL2>;
+               #iommu-cells = <0>;
+       };
+
+       sysmmu_scaler0w: sysmmu@0x128C0000 {
+               compatible = "samsung,exynos-sysmmu";
+               reg = <0x128C0000 0x1000>;
+               interrupt-parent = <&combiner>;
+               interrupts = <27 2>;
+               clock-names = "sysmmu", "master";
+               clocks = <&clock CLK_SMMU_MSCL0>, <&clock CLK_MSCL0>;
+               #iommu-cells = <0>;
+       };
+
+       sysmmu_scaler1w: sysmmu@0x128D0000 {
+               compatible = "samsung,exynos-sysmmu";
+               reg = <0x128D0000 0x1000>;
+               interrupt-parent = <&combiner>;
+               interrupts = <22 6>;
+               clock-names = "sysmmu", "master";
+               clocks = <&clock CLK_SMMU_MSCL1>, <&clock CLK_MSCL1>;
+               #iommu-cells = <0>;
+       };
+
+       sysmmu_scaler2w: sysmmu@0x128E0000 {
+               compatible = "samsung,exynos-sysmmu";
+               reg = <0x128E0000 0x1000>;
+               interrupt-parent = <&combiner>;
+               interrupts = <19 6>;
+               clock-names = "sysmmu", "master";
+               clocks = <&clock CLK_SMMU_MSCL2>, <&clock CLK_MSCL2>;
+               #iommu-cells = <0>;
+       };
+
+       sysmmu_jpeg0: sysmmu@0x11F10000 {
+               compatible = "samsung,exynos-sysmmu";
+               reg = <0x11F10000 0x1000>;
+               interrupt-parent = <&combiner>;
+               interrupts = <4 2>;
+               clock-names = "sysmmu", "master";
+               clocks = <&clock CLK_SMMU_JPEG>, <&clock CLK_JPEG>;
+               #iommu-cells = <0>;
+       };
+
+       sysmmu_jpeg1: sysmmu@0x11F20000 {
+               compatible = "samsung,exynos-sysmmu";
+               reg = <0x11F20000 0x1000>;
+               interrupts = <0 169 0>;
+               clock-names = "sysmmu", "master";
+               clocks = <&clock CLK_SMMU_JPEG2>, <&clock CLK_JPEG2>;
+               #iommu-cells = <0>;
+       };
+
+       sysmmu_mfc_l: sysmmu@0x11200000 {
+               compatible = "samsung,exynos-sysmmu";
+               reg = <0x11200000 0x1000>;
+               interrupt-parent = <&combiner>;
+               interrupts = <6 2>;
+               clock-names = "sysmmu", "master";
+               clocks = <&clock CLK_SMMU_MFCL>, <&clock CLK_MFC>;
+               power-domains = <&mfc_pd>;
+               #iommu-cells = <0>;
+       };
+
+       sysmmu_mfc_r: sysmmu@0x11210000 {
+               compatible = "samsung,exynos-sysmmu";
+               reg = <0x11210000 0x1000>;
+               interrupt-parent = <&combiner>;
+               interrupts = <8 5>;
+               clock-names = "sysmmu", "master";
+               clocks = <&clock CLK_SMMU_MFCR>, <&clock CLK_MFC>;
+               power-domains = <&mfc_pd>;
+               #iommu-cells = <0>;
+       };
+
+       sysmmu_fimd1_0: sysmmu@0x14640000 {
+               compatible = "samsung,exynos-sysmmu";
+               reg = <0x14640000 0x1000>;
+               interrupt-parent = <&combiner>;
+               interrupts = <3 2>;
+               clock-names = "sysmmu", "master";
+               clocks = <&clock CLK_SMMU_FIMD1M0>, <&clock CLK_FIMD1>;
+               power-domains = <&disp_pd>;
+               #iommu-cells = <0>;
+       };
+
+       sysmmu_fimd1_1: sysmmu@0x14680000 {
+               compatible = "samsung,exynos-sysmmu";
+               reg = <0x14680000 0x1000>;
+               interrupt-parent = <&combiner>;
+               interrupts = <3 0>;
+               clock-names = "sysmmu", "master";
+               clocks = <&clock CLK_SMMU_FIMD1M0>, <&clock CLK_FIMD1>;
+               power-domains = <&disp_pd>;
+               #iommu-cells = <0>;
+       };
+};
+
+&dp {
+       clocks = <&clock CLK_DP1>;
+       clock-names = "dp";
+       phys = <&dp_phy>;
+       phy-names = "dp";
+       power-domains = <&disp_pd>;
+};
+
+&fimd {
+       clocks = <&clock CLK_SCLK_FIMD1>, <&clock CLK_FIMD1>;
+       clock-names = "sclk_fimd", "fimd";
+       power-domains = <&disp_pd>;
+       iommus = <&sysmmu_fimd1_0>, <&sysmmu_fimd1_1>;
+       iommu-names = "m0", "m1";
+};
+
+&rtc {
+       clocks = <&clock CLK_RTC>;
+       clock-names = "rtc";
+       interrupt-parent = <&pmu_system_controller>;
+       status = "disabled";
+};
+
+&serial_0 {
+       clocks = <&clock CLK_UART0>, <&clock CLK_SCLK_UART0>;
+       clock-names = "uart", "clk_uart_baud0";
+};
+
+&serial_1 {
+       clocks = <&clock CLK_UART1>, <&clock CLK_SCLK_UART1>;
+       clock-names = "uart", "clk_uart_baud0";
+};
+
+&serial_2 {
+       clocks = <&clock CLK_UART2>, <&clock CLK_SCLK_UART2>;
+       clock-names = "uart", "clk_uart_baud0";
+};
+
+&serial_3 {
+       clocks = <&clock CLK_UART3>, <&clock CLK_SCLK_UART3>;
+       clock-names = "uart", "clk_uart_baud0";
 };
diff --git a/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi b/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi
new file mode 100644 (file)
index 0000000..8adf455
--- /dev/null
@@ -0,0 +1,479 @@
+/*
+ * Hardkernel Odroid XU3 board device tree source
+ *
+ * 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.
+*/
+
+#include <dt-bindings/clock/samsung,s2mps11.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/sound/samsung-i2s.h>
+#include "exynos5800.dtsi"
+
+/ {
+       memory {
+               reg = <0x40000000 0x7EA00000>;
+       };
+
+       chosen {
+               linux,stdout-path = &serial_2;
+       };
+
+       firmware@02073000 {
+               compatible = "samsung,secure-firmware";
+               reg = <0x02073000 0x1000>;
+       };
+
+       fixed-rate-clocks {
+               oscclk {
+                       compatible = "samsung,exynos5420-oscclk";
+                       clock-frequency = <24000000>;
+               };
+       };
+
+       emmc_pwrseq: pwrseq {
+               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>;
+               };
+       };
+};
+
+&clock_audss {
+       assigned-clocks = <&clock_audss EXYNOS_MOUT_AUDSS>,
+                       <&clock_audss EXYNOS_MOUT_I2S>,
+                       <&clock_audss EXYNOS_DOUT_AUD_BUS>;
+       assigned-clock-parents = <&clock CLK_FIN_PLL>,
+                       <&clock_audss EXYNOS_MOUT_AUDSS>;
+       assigned-clock-rates = <0>,
+                       <0>,
+                       <19200000>;
+};
+
+&fimd {
+       status = "okay";
+};
+
+
+&hdmi {
+       status = "okay";
+       hpd-gpio = <&gpx3 7 0>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&hdmi_hpd_irq>;
+
+       vdd_osc-supply = <&ldo7_reg>;
+       vdd_pll-supply = <&ldo6_reg>;
+       vdd-supply = <&ldo6_reg>;
+};
+
+&hsi2c_4 {
+       status = "okay";
+
+       s2mps11_pmic@66 {
+               compatible = "samsung,s2mps11-pmic";
+               reg = <0x66>;
+               s2mps11,buck2-ramp-delay = <12>;
+               s2mps11,buck34-ramp-delay = <12>;
+               s2mps11,buck16-ramp-delay = <12>;
+               s2mps11,buck6-ramp-enable = <1>;
+               s2mps11,buck2-ramp-enable = <1>;
+               s2mps11,buck3-ramp-enable = <1>;
+               s2mps11,buck4-ramp-enable = <1>;
+
+               interrupt-parent = <&gpx0>;
+               interrupts = <4 IRQ_TYPE_EDGE_FALLING>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&s2mps11_irq>;
+
+               s2mps11_osc: clocks {
+                       #clock-cells = <1>;
+                       clock-output-names = "s2mps11_ap",
+                                       "s2mps11_cp", "s2mps11_bt";
+               };
+
+               regulators {
+                       ldo1_reg: LDO1 {
+                               regulator-name = "vdd_ldo1";
+                               regulator-min-microvolt = <1000000>;
+                               regulator-max-microvolt = <1000000>;
+                               regulator-always-on;
+                       };
+
+                       ldo3_reg: LDO3 {
+                               regulator-name = "vdd_ldo3";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-always-on;
+                       };
+
+                       ldo5_reg: LDO5 {
+                               regulator-name = "vdd_ldo5";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-always-on;
+                       };
+
+                       ldo6_reg: LDO6 {
+                               regulator-name = "vdd_ldo6";
+                               regulator-min-microvolt = <1000000>;
+                               regulator-max-microvolt = <1000000>;
+                               regulator-always-on;
+                       };
+
+                       ldo7_reg: LDO7 {
+                               regulator-name = "vdd_ldo7";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-always-on;
+                       };
+
+                       ldo8_reg: LDO8 {
+                               regulator-name = "vdd_ldo8";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-always-on;
+                       };
+
+                       ldo9_reg: LDO9 {
+                               regulator-name = "vdd_ldo9";
+                               regulator-min-microvolt = <3000000>;
+                               regulator-max-microvolt = <3000000>;
+                               regulator-always-on;
+                       };
+
+                       ldo10_reg: LDO10 {
+                               regulator-name = "vdd_ldo10";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-always-on;
+                       };
+
+                       ldo11_reg: LDO11 {
+                               regulator-name = "vdd_ldo11";
+                               regulator-min-microvolt = <1000000>;
+                               regulator-max-microvolt = <1000000>;
+                               regulator-always-on;
+                       };
+
+                       ldo12_reg: LDO12 {
+                               regulator-name = "vdd_ldo12";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-always-on;
+                       };
+
+                       ldo13_reg: LDO13 {
+                               regulator-name = "vdd_ldo13";
+                               regulator-min-microvolt = <2800000>;
+                               regulator-max-microvolt = <2800000>;
+                               regulator-always-on;
+                       };
+
+                       ldo15_reg: LDO15 {
+                               regulator-name = "vdd_ldo15";
+                               regulator-min-microvolt = <3100000>;
+                               regulator-max-microvolt = <3100000>;
+                               regulator-always-on;
+                       };
+
+                       ldo16_reg: LDO16 {
+                               regulator-name = "vdd_ldo16";
+                               regulator-min-microvolt = <2200000>;
+                               regulator-max-microvolt = <2200000>;
+                               regulator-always-on;
+                       };
+
+                       ldo17_reg: LDO17 {
+                               regulator-name = "tsp_avdd";
+                               regulator-min-microvolt = <3300000>;
+                               regulator-max-microvolt = <3300000>;
+                               regulator-always-on;
+                       };
+
+                       ldo19_reg: LDO19 {
+                               regulator-name = "vdd_sd";
+                               regulator-min-microvolt = <2800000>;
+                               regulator-max-microvolt = <2800000>;
+                               regulator-always-on;
+                       };
+
+                       ldo24_reg: LDO24 {
+                               regulator-name = "tsp_io";
+                               regulator-min-microvolt = <2800000>;
+                               regulator-max-microvolt = <2800000>;
+                               regulator-always-on;
+                       };
+
+                       ldo26_reg: LDO26 {
+                               regulator-name = "vdd_ldo26";
+                               regulator-min-microvolt = <3000000>;
+                               regulator-max-microvolt = <3000000>;
+                               regulator-always-on;
+                       };
+
+                       buck1_reg: BUCK1 {
+                               regulator-name = "vdd_mif";
+                               regulator-min-microvolt = <800000>;
+                               regulator-max-microvolt = <1300000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                       };
+
+                       buck2_reg: BUCK2 {
+                               regulator-name = "vdd_arm";
+                               regulator-min-microvolt = <800000>;
+                               regulator-max-microvolt = <1500000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                       };
+
+                       buck3_reg: BUCK3 {
+                               regulator-name = "vdd_int";
+                               regulator-min-microvolt = <800000>;
+                               regulator-max-microvolt = <1400000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                       };
+
+                       buck4_reg: BUCK4 {
+                               regulator-name = "vdd_g3d";
+                               regulator-min-microvolt = <800000>;
+                               regulator-max-microvolt = <1400000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                       };
+
+                       buck5_reg: BUCK5 {
+                               regulator-name = "vdd_mem";
+                               regulator-min-microvolt = <800000>;
+                               regulator-max-microvolt = <1400000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                       };
+
+                       buck6_reg: BUCK6 {
+                               regulator-name = "vdd_kfc";
+                               regulator-min-microvolt = <800000>;
+                               regulator-max-microvolt = <1500000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                       };
+
+                       buck7_reg: BUCK7 {
+                               regulator-name = "vdd_1.0v_ldo";
+                               regulator-min-microvolt = <800000>;
+                               regulator-max-microvolt = <1500000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                       };
+
+                       buck8_reg: BUCK8 {
+                               regulator-name = "vdd_1.8v_ldo";
+                               regulator-min-microvolt = <800000>;
+                               regulator-max-microvolt = <1500000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                       };
+
+                       buck9_reg: BUCK9 {
+                               regulator-name = "vdd_2.8v_ldo";
+                               regulator-min-microvolt = <3000000>;
+                               regulator-max-microvolt = <3750000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                       };
+
+                       buck10_reg: BUCK10 {
+                               regulator-name = "vdd_vmem";
+                               regulator-min-microvolt = <2850000>;
+                               regulator-max-microvolt = <2850000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                       };
+               };
+       };
+};
+
+&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>;
+       status = "okay";
+
+       hdmiddc@50 {
+               compatible = "samsung,exynos4210-hdmiddc";
+               reg = <0x50>;
+       };
+};
+
+&i2s0 {
+       status = "okay";
+};
+
+&mfc {
+       samsung,mfc-r = <0x43000000 0x800000>;
+       samsung,mfc-l = <0x51000000 0x800000>;
+};
+
+&mmc_0 {
+       status = "okay";
+       mmc-pwrseq = <&emmc_pwrseq>;
+       cd-gpios = <&gpc0 2 GPIO_ACTIVE_LOW>;
+       card-detect-delay = <200>;
+       samsung,dw-mshc-ciu-div = <3>;
+       samsung,dw-mshc-sdr-timing = <0 4>;
+       samsung,dw-mshc-ddr-timing = <0 2>;
+       samsung,dw-mshc-hs400-timing = <0 2>;
+       samsung,read-strobe-delay = <90>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&sd0_clk &sd0_cmd &sd0_bus1 &sd0_bus4 &sd0_bus8 &sd0_cd &sd0_rclk>;
+       bus-width = <8>;
+       cap-mmc-highspeed;
+       mmc-hs200-1_8v;
+       mmc-hs400-1_8v;
+};
+
+&mmc_2 {
+       status = "okay";
+       card-detect-delay = <200>;
+       samsung,dw-mshc-ciu-div = <3>;
+       samsung,dw-mshc-sdr-timing = <0 4>;
+       samsung,dw-mshc-ddr-timing = <0 2>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&sd2_clk &sd2_cmd &sd2_cd &sd2_bus1 &sd2_bus4>;
+       bus-width = <4>;
+       cap-sd-highspeed;
+};
+
+&pinctrl_0 {
+       hdmi_hpd_irq: hdmi-hpd-irq {
+               samsung,pins = "gpx3-7";
+               samsung,pin-function = <0>;
+               samsung,pin-pud = <1>;
+               samsung,pin-drv = <0>;
+       };
+
+       s2mps11_irq: s2mps11-irq {
+               samsung,pins = "gpx0-4";
+               samsung,pin-function = <0xf>;
+               samsung,pin-pud = <0>;
+               samsung,pin-drv = <0>;
+       };
+};
+
+&pinctrl_1 {
+       emmc_nrst_pin: emmc-nrst {
+               samsung,pins = "gpd1-0";
+               samsung,pin-function = <0>;
+               samsung,pin-pud = <0>;
+               samsung,pin-drv = <0>;
+       };
+};
+
+&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";
+};
+
+&rtc {
+       status = "okay";
+       clocks = <&clock CLK_RTC>, <&s2mps11_osc S2MPS11_CLK_AP>;
+       clock-names = "rtc", "rtc_src";
+};
+
+&usbdrd_dwc3_0 {
+       dr_mode = "host";
+};
+
+&usbdrd_dwc3_1 {
+       dr_mode = "otg";
+};
diff --git a/arch/arm/boot/dts/exynos5422-odroidxu3-lite.dts b/arch/arm/boot/dts/exynos5422-odroidxu3-lite.dts
new file mode 100644 (file)
index 0000000..c06882b
--- /dev/null
@@ -0,0 +1,20 @@
+/*
+ * Hardkernel Odroid XU3-Lite board 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.
+*/
+
+/dts-v1/;
+#include "exynos5422-odroidxu3-common.dtsi"
+
+/ {
+       model = "Hardkernel Odroid XU3 Lite";
+       compatible = "hardkernel,odroid-xu3-lite", "samsung,exynos5800", "samsung,exynos5";
+};
index edc25cf1d71754d230912f16393333e51574e1a1..78e6a502f320b527f315bfceaebfaed22c111789 100644 (file)
 */
 
 /dts-v1/;
-#include "exynos5800.dtsi"
+#include "exynos5422-odroidxu3-common.dtsi"
 
 / {
        model = "Hardkernel Odroid XU3";
        compatible = "hardkernel,odroid-xu3", "samsung,exynos5800", "samsung,exynos5";
-
-       memory {
-               reg = <0x40000000 0x7EA00000>;
-       };
-
-       chosen {
-               linux,stdout-path = &serial_2;
-       };
-
-       fimd@14400000 {
-               status = "okay";
-       };
-
-       firmware@02073000 {
-               compatible = "samsung,secure-firmware";
-               reg = <0x02073000 0x1000>;
-       };
-
-       fixed-rate-clocks {
-               oscclk {
-                       compatible = "samsung,exynos5420-oscclk";
-                       clock-frequency = <24000000>;
-               };
-       };
-
-       hsi2c_4: i2c@12CA0000 {
-               status = "okay";
-
-               s2mps11_pmic@66 {
-                       compatible = "samsung,s2mps11-pmic";
-                       reg = <0x66>;
-                       s2mps11,buck2-ramp-delay = <12>;
-                       s2mps11,buck34-ramp-delay = <12>;
-                       s2mps11,buck16-ramp-delay = <12>;
-                       s2mps11,buck6-ramp-enable = <1>;
-                       s2mps11,buck2-ramp-enable = <1>;
-                       s2mps11,buck3-ramp-enable = <1>;
-                       s2mps11,buck4-ramp-enable = <1>;
-
-                       s2mps11_osc: clocks {
-                               #clock-cells = <1>;
-                               clock-output-names = "s2mps11_ap",
-                                               "s2mps11_cp", "s2mps11_bt";
-                       };
-
-                       regulators {
-                               ldo1_reg: LDO1 {
-                                       regulator-name = "vdd_ldo1";
-                                       regulator-min-microvolt = <1000000>;
-                                       regulator-max-microvolt = <1000000>;
-                                       regulator-always-on;
-                               };
-
-                               ldo3_reg: LDO3 {
-                                       regulator-name = "vdd_ldo3";
-                                       regulator-min-microvolt = <1800000>;
-                                       regulator-max-microvolt = <1800000>;
-                                       regulator-always-on;
-                               };
-
-                               ldo5_reg: LDO5 {
-                                       regulator-name = "vdd_ldo5";
-                                       regulator-min-microvolt = <1800000>;
-                                       regulator-max-microvolt = <1800000>;
-                                       regulator-always-on;
-                               };
-
-                               ldo6_reg: LDO6 {
-                                       regulator-name = "vdd_ldo6";
-                                       regulator-min-microvolt = <1000000>;
-                                       regulator-max-microvolt = <1000000>;
-                                       regulator-always-on;
-                               };
-
-                               ldo7_reg: LDO7 {
-                                       regulator-name = "vdd_ldo7";
-                                       regulator-min-microvolt = <1800000>;
-                                       regulator-max-microvolt = <1800000>;
-                                       regulator-always-on;
-                               };
-
-                               ldo8_reg: LDO8 {
-                                       regulator-name = "vdd_ldo8";
-                                       regulator-min-microvolt = <1800000>;
-                                       regulator-max-microvolt = <1800000>;
-                                       regulator-always-on;
-                               };
-
-                               ldo9_reg: LDO9 {
-                                       regulator-name = "vdd_ldo9";
-                                       regulator-min-microvolt = <3000000>;
-                                       regulator-max-microvolt = <3000000>;
-                                       regulator-always-on;
-                               };
-
-                               ldo10_reg: LDO10 {
-                                       regulator-name = "vdd_ldo10";
-                                       regulator-min-microvolt = <1800000>;
-                                       regulator-max-microvolt = <1800000>;
-                                       regulator-always-on;
-                               };
-
-                               ldo11_reg: LDO11 {
-                                       regulator-name = "vdd_ldo11";
-                                       regulator-min-microvolt = <1000000>;
-                                       regulator-max-microvolt = <1000000>;
-                                       regulator-always-on;
-                               };
-
-                               ldo12_reg: LDO12 {
-                                       regulator-name = "vdd_ldo12";
-                                       regulator-min-microvolt = <1800000>;
-                                       regulator-max-microvolt = <1800000>;
-                                       regulator-always-on;
-                               };
-
-                               ldo13_reg: LDO13 {
-                                       regulator-name = "vdd_ldo13";
-                                       regulator-min-microvolt = <2800000>;
-                                       regulator-max-microvolt = <2800000>;
-                                       regulator-always-on;
-                               };
-
-                               ldo15_reg: LDO15 {
-                                       regulator-name = "vdd_ldo15";
-                                       regulator-min-microvolt = <3100000>;
-                                       regulator-max-microvolt = <3100000>;
-                                       regulator-always-on;
-                               };
-
-                               ldo16_reg: LDO16 {
-                                       regulator-name = "vdd_ldo16";
-                                       regulator-min-microvolt = <2200000>;
-                                       regulator-max-microvolt = <2200000>;
-                                       regulator-always-on;
-                               };
-
-                               ldo17_reg: LDO17 {
-                                       regulator-name = "tsp_avdd";
-                                       regulator-min-microvolt = <3300000>;
-                                       regulator-max-microvolt = <3300000>;
-                                       regulator-always-on;
-                               };
-
-                               ldo19_reg: LDO19 {
-                                       regulator-name = "vdd_sd";
-                                       regulator-min-microvolt = <2800000>;
-                                       regulator-max-microvolt = <2800000>;
-                                       regulator-always-on;
-                               };
-
-                               ldo24_reg: LDO24 {
-                                       regulator-name = "tsp_io";
-                                       regulator-min-microvolt = <2800000>;
-                                       regulator-max-microvolt = <2800000>;
-                                       regulator-always-on;
-                               };
-
-                               ldo26_reg: LDO26 {
-                                       regulator-name = "vdd_ldo26";
-                                       regulator-min-microvolt = <3000000>;
-                                       regulator-max-microvolt = <3000000>;
-                                       regulator-always-on;
-                               };
-
-                               buck1_reg: BUCK1 {
-                                       regulator-name = "vdd_mif";
-                                       regulator-min-microvolt = <800000>;
-                                       regulator-max-microvolt = <1300000>;
-                                       regulator-always-on;
-                                       regulator-boot-on;
-                               };
-
-                               buck2_reg: BUCK2 {
-                                       regulator-name = "vdd_arm";
-                                       regulator-min-microvolt = <800000>;
-                                       regulator-max-microvolt = <1500000>;
-                                       regulator-always-on;
-                                       regulator-boot-on;
-                               };
-
-                               buck3_reg: BUCK3 {
-                                       regulator-name = "vdd_int";
-                                       regulator-min-microvolt = <800000>;
-                                       regulator-max-microvolt = <1400000>;
-                                       regulator-always-on;
-                                       regulator-boot-on;
-                               };
-
-                               buck4_reg: BUCK4 {
-                                       regulator-name = "vdd_g3d";
-                                       regulator-min-microvolt = <800000>;
-                                       regulator-max-microvolt = <1400000>;
-                                       regulator-always-on;
-                                       regulator-boot-on;
-                               };
-
-                               buck5_reg: BUCK5 {
-                                       regulator-name = "vdd_mem";
-                                       regulator-min-microvolt = <800000>;
-                                       regulator-max-microvolt = <1400000>;
-                                       regulator-always-on;
-                                       regulator-boot-on;
-                               };
-
-                               buck6_reg: BUCK6 {
-                                       regulator-name = "vdd_kfc";
-                                       regulator-min-microvolt = <800000>;
-                                       regulator-max-microvolt = <1500000>;
-                                       regulator-always-on;
-                                       regulator-boot-on;
-                               };
-
-                               buck7_reg: BUCK7 {
-                                       regulator-name = "vdd_1.0v_ldo";
-                                       regulator-min-microvolt = <800000>;
-                                       regulator-max-microvolt = <1500000>;
-                                       regulator-always-on;
-                                       regulator-boot-on;
-                               };
-
-                               buck8_reg: BUCK8 {
-                                       regulator-name = "vdd_1.8v_ldo";
-                                       regulator-min-microvolt = <800000>;
-                                       regulator-max-microvolt = <1500000>;
-                                       regulator-always-on;
-                                       regulator-boot-on;
-                               };
-
-                               buck9_reg: BUCK9 {
-                                       regulator-name = "vdd_2.8v_ldo";
-                                       regulator-min-microvolt = <3000000>;
-                                       regulator-max-microvolt = <3750000>;
-                                       regulator-always-on;
-                                       regulator-boot-on;
-                               };
-
-                               buck10_reg: BUCK10 {
-                                       regulator-name = "vdd_vmem";
-                                       regulator-min-microvolt = <2850000>;
-                                       regulator-max-microvolt = <2850000>;
-                                       regulator-always-on;
-                                       regulator-boot-on;
-                               };
-                       };
-               };
-       };
-
-       emmc_pwrseq: pwrseq {
-               pinctrl-0 = <&emmc_nrst_pin>;
-               pinctrl-names = "default";
-               compatible = "mmc-pwrseq-emmc";
-               reset-gpios = <&gpd1 0 1>;
-       };
-
-       i2c_2: i2c@12C80000 {
-               samsung,i2c-sda-delay = <100>;
-               samsung,i2c-max-bus-freq = <66000>;
-               status = "okay";
-
-               hdmiddc@50 {
-                       compatible = "samsung,exynos4210-hdmiddc";
-                       reg = <0x50>;
-               };
-       };
-
-       rtc@101E0000 {
-               status = "okay";
-       };
-};
-
-&hdmi {
-       status = "okay";
-       hpd-gpio = <&gpx3 7 0>;
-       pinctrl-names = "default";
-       pinctrl-0 = <&hdmi_hpd_irq>;
-
-       vdd_osc-supply = <&ldo7_reg>;
-       vdd_pll-supply = <&ldo6_reg>;
-       vdd-supply = <&ldo6_reg>;
-};
-
-&mfc {
-       samsung,mfc-r = <0x43000000 0x800000>;
-       samsung,mfc-l = <0x51000000 0x800000>;
-};
-
-&mmc_0 {
-       status = "okay";
-       mmc-pwrseq = <&emmc_pwrseq>;
-       broken-cd;
-       card-detect-delay = <200>;
-       samsung,dw-mshc-ciu-div = <3>;
-       samsung,dw-mshc-sdr-timing = <0 4>;
-       samsung,dw-mshc-ddr-timing = <0 2>;
-       pinctrl-names = "default";
-       pinctrl-0 = <&sd0_clk &sd0_cmd &sd0_bus1 &sd0_bus4 &sd0_bus8>;
-       bus-width = <8>;
-       cap-mmc-highspeed;
-};
-
-&mmc_2 {
-       status = "okay";
-       card-detect-delay = <200>;
-       samsung,dw-mshc-ciu-div = <3>;
-       samsung,dw-mshc-sdr-timing = <0 4>;
-       samsung,dw-mshc-ddr-timing = <0 2>;
-       pinctrl-names = "default";
-       pinctrl-0 = <&sd2_clk &sd2_cmd &sd2_cd &sd2_bus1 &sd2_bus4>;
-       bus-width = <4>;
-       cap-sd-highspeed;
-};
-
-&pinctrl_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 {
-       emmc_nrst_pin: emmc-nrst {
-               samsung,pins = "gpd1-0";
-               samsung,pin-function = <0>;
-               samsung,pin-pud = <0>;
-               samsung,pin-drv = <0>;
-       };
-};
-
-&usbdrd_dwc3_0 {
-       dr_mode = "host";
-};
-
-&usbdrd_dwc3_1 {
-       dr_mode = "otg";
 };
 
 &i2c_0 {
index 268609a42b2c04c7a1db748cf6e899a0cded2be3..a98501bab6fc2d0d6a1fbb7d907270bc3619f23f 100644 (file)
                };
        };
 
-       gmac: ethernet@00230000 {
-               fixed_phy;
-               phy_addr = <1>;
-       };
-
        spi {
                status = "disabled";
        };
 
 };
+
+&gmac {
+       fixed_phy;
+       phy_addr = <1>;
+};
index ff55dac6e2193b837bcb64754d39b62d4ee5cabf..e4443f4e65722e8058f2663dbe9a1420043269b0 100644 (file)
                bootargs = "root=/dev/sda2 rw rootwait ignore_loglevel earlyprintk no_console_suspend mem=2048M@0x80000000 mem=6144M@0x100000000 console=ttySAC0,115200";
        };
 
-       spi_0: spi@D0000 {
-
-               flash: w25q128@0 {
-                       #address-cells = <1>;
-                       #size-cells = <1>;
-                       compatible = "winbond,w25q128";
-                       spi-max-frequency = <15625000>;
-                       reg = <0>;
-                       controller-data {
-                               samsung,spi-feedback-delay = <0>;
-                       };
+       fixed-rate-clocks {
+               xtal {
+                       compatible = "samsung,clock-xtal";
+                       clock-frequency = <50000000>;
+               };
+       };
+};
 
-                       partition@00000 {
-                               label = "BootLoader";
-                               reg = <0x60000 0x80000>;
-                               read-only;
-                       };
+&pcie_0 {
+       reset-gpio = <&pin_ctrl 5 0>;
+       status = "okay";
+};
 
-                       partition@e0000 {
-                               label = "Recovery-Kernel";
-                               reg = <0xe0000 0x300000>;
-                               read-only;
-                       };
+&pcie_1 {
+       reset-gpio = <&pin_ctrl 22 0>;
+       status = "okay";
+};
 
-                       partition@3e0000 {
-                               label = "CRAM-FS";
-                               reg = <0x3e0000 0x700000>;
-                               read-only;
-                       };
+&spi_0 {
+       flash: w25q128@0 {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "winbond,w25q128";
+               spi-max-frequency = <15625000>;
+               reg = <0>;
+               controller-data {
+                       samsung,spi-feedback-delay = <0>;
+               };
 
-                       partition@ae0000 {
-                               label = "User-Data";
-                               reg = <0xae0000 0x520000>;
-                       };
+               partition@00000 {
+                       label = "BootLoader";
+                       reg = <0x60000 0x80000>;
+                       read-only;
+               };
 
+               partition@e0000 {
+                       label = "Recovery-Kernel";
+                       reg = <0xe0000 0x300000>;
+                       read-only;
                };
 
-       };
+               partition@3e0000 {
+                       label = "CRAM-FS";
+                       reg = <0x3e0000 0x700000>;
+                       read-only;
+               };
 
-       fixed-rate-clocks {
-               xtal {
-                       compatible = "samsung,clock-xtal";
-                       clock-frequency = <50000000>;
+               partition@ae0000 {
+                       label = "User-Data";
+                       reg = <0xae0000 0x520000>;
                };
-       };
 
-       pcie@290000 {
-               reset-gpio = <&pin_ctrl 5 0>;
-               status = "okay";
        };
 
-       pcie@2a0000 {
-               reset-gpio = <&pin_ctrl 22 0>;
-               status = "okay";
-       };
 };
index 59d9416b3b03f042cd05c412736c1fd432440747..f18b51f2eeaa83883d27e99e80a43611266f60e3 100644 (file)
                clock-names = "usbhost";
        };
 
-       pcie@290000 {
+       pcie_0: pcie@290000 {
                compatible = "samsung,exynos5440-pcie", "snps,dw-pcie";
                reg = <0x290000 0x1000
                        0x270000 0x1000
                status = "disabled";
        };
 
-       pcie@2a0000 {
+       pcie_1: pcie@2a0000 {
                compatible = "samsung,exynos5440-pcie", "snps,dw-pcie";
                reg = <0x2a0000 0x1000
                        0x272000 0x1000
index 02eb8b15374f3c84ef4b215f4d7da85d2e9f342a..7d5b386b5ae6aeb32aed5baf55a2d50ddf374b39 100644 (file)
        };
 };
 
-&uart_3 {
+&serial_3 {
        status = "okay";
 };
 
index 82045398bf1fabdf47664290d636d78a38b23b14..a8b1c53ebe460788da8720a0f217a498d01432f8 100644 (file)
                                status = "okay";
                        };
 
+                       i2c: i2c@80058000 {
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&i2c_pins_b>;
+                               status = "okay";
+                       };
+
                        duart: serial@80070000 {
                                pinctrl-names = "default";
                                pinctrl-0 = <&duart_pins_a>;
index bbcfb5a19c77009e2cf77253f1e49cee8c6d7035..c892d58e8dad38252dfcdd13c5f758cdc05aca36 100644 (file)
                                        fsl,voltage = <MXS_VOLTAGE_HIGH>;
                                        fsl,pull-up = <MXS_PULL_ENABLE>;
                                };
+
+                               i2c_pins_a: i2c@0 {
+                                       reg = <0>;
+                                       fsl,pinmux-ids = <
+                                               MX23_PAD_I2C_SCL__I2C_SCL
+                                               MX23_PAD_I2C_SDA__I2C_SDA
+                                       >;
+                                       fsl,drive-strength = <MXS_DRIVE_8mA>;
+                                       fsl,voltage = <MXS_VOLTAGE_HIGH>;
+                                       fsl,pull-up = <MXS_PULL_ENABLE>;
+                               };
+
+                               i2c_pins_b: i2c@1 {
+                                       reg = <1>;
+                                       fsl,pinmux-ids = <
+                                               MX23_PAD_LCD_ENABLE__I2C_SCL
+                                               MX23_PAD_LCD_HSYNC__I2C_SDA
+                                       >;
+                                       fsl,drive-strength = <MXS_DRIVE_8mA>;
+                                       fsl,voltage = <MXS_VOLTAGE_HIGH>;
+                                       fsl,pull-up = <MXS_PULL_ENABLE>;
+                               };
+
+                               i2c_pins_c: i2c@2 {
+                                       reg = <2>;
+                                       fsl,pinmux-ids = <
+                                               MX23_PAD_SSP1_DATA1__I2C_SCL
+                                               MX23_PAD_SSP1_DATA2__I2C_SDA
+                                       >;
+                                       fsl,drive-strength = <MXS_DRIVE_8mA>;
+                                       fsl,voltage = <MXS_VOLTAGE_HIGH>;
+                                       fsl,pull-up = <MXS_PULL_ENABLE>;
+                               };
                        };
 
                        digctl@8001c000 {
                                status = "disabled";
                        };
 
-                       i2c@80058000 {
+                       i2c: i2c@80058000 {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               compatible = "fsl,imx23-i2c";
                                reg = <0x80058000 0x2000>;
+                               interrupts = <27>;
+                               clock-frequency = <100000>;
                                dmas = <&dma_apbx 3>;
                                dma-names = "rx-tx";
                                status = "disabled";
index b04b6b8850a71de972c5b3ce0fa6f11454740b9d..570aa339a05ec9b5670869cff3d7722899b6cafc 100644 (file)
@@ -99,6 +99,9 @@
                                        solomon,height = <32>;
                                        solomon,width = <128>;
                                        solomon,page-offset = <0>;
+                                       solomon,com-lrremap;
+                                       solomon,com-invdir;
+                                       solomon,com-offset = <32>;
                                };
                        };
 
diff --git a/arch/arm/boot/dts/imx6dl-apf6dev.dts b/arch/arm/boot/dts/imx6dl-apf6dev.dts
new file mode 100644 (file)
index 0000000..df26e54
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2015 Armadeus Systems
+ *
+ * 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.
+ *
+ *     You should have received a copy of the GNU General Public
+ *     License along with this file; 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 "imx6dl.dtsi"
+#include "imx6qdl-apf6.dtsi"
+#include "imx6qdl-apf6dev.dtsi"
+
+/ {
+       model = "Armadeus APF6 Solo Module on APF6Dev Board";
+       compatible = "armadeus,imx6dl-apf6dev", "armadeus,imx6dl-apf6", "fsl,imx6dl";
+
+       memory {
+               reg = <0x10000000 0x20000000>;
+       };
+};
diff --git a/arch/arm/boot/dts/imx6dl-aristainetos2_4.dts b/arch/arm/boot/dts/imx6dl-aristainetos2_4.dts
new file mode 100644 (file)
index 0000000..bb92f30
--- /dev/null
@@ -0,0 +1,159 @@
+/*
+ * support for the imx6 based aristainetos2 board
+ *
+ * Copyright (C) 2015 Heiko Schocher <hs@denx.de>
+ *
+ * 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-aristainetos2.dtsi"
+
+/ {
+       model = "aristainetos2 i.MX6 Dual Lite Board 4";
+       compatible = "fsl,imx6dl";
+
+       memory {
+               reg = <0x10000000 0x40000000>;
+       };
+
+       display0: display@di0 {
+               #address-cells = <1>;
+               #size-cells = <0>;
+               compatible = "fsl,imx-parallel-display";
+               interface-pix-fmt = "rgb24";
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_ipu_disp>;
+
+               port@0 {
+                       reg = <0>;
+                       display0_in: endpoint {
+                               remote-endpoint = <&ipu1_di0_disp0>;
+                       };
+               };
+
+               port@1 {
+                       reg = <1>;
+                       display_out: endpoint {
+                               remote-endpoint = <&panel_in>;
+                       };
+               };
+       };
+};
+
+&ecspi1 {
+       lcd_panel: display@0 {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "lg,lg4573";
+               spi-max-frequency = <10000000>;
+               reg = <0>;
+               power-on-delay = <10>;
+
+               display-timings {
+                       480x800p57 {
+                               native-mode;
+                               clock-frequency = <27000027>;
+                               hactive = <480>;
+                               vactive = <800>;
+                               hfront-porch = <10>;
+                               hback-porch = <59>;
+                               hsync-len = <10>;
+                               vback-porch = <15>;
+                               vfront-porch = <15>;
+                               vsync-len = <15>;
+                               hsync-active = <1>;
+                               vsync-active = <1>;
+                       };
+               };
+
+               port {
+                       panel_in: endpoint {
+                               remote-endpoint = <&display_out>;
+                       };
+               };
+       };
+};
+
+&i2c3 {
+       touch: touch@4b {
+               compatible = "atmel,maxtouch";
+               reg = <0x4b>;
+               interrupt-parent = <&gpio2>;
+               interrupts = <9 8>;
+       };
+};
+
+&ipu1_di0_disp0 {
+       remote-endpoint = <&display0_in>;
+};
+
+&iomuxc {
+       pinctrl_ipu_disp: ipudisp1grp {
+               fsl,pins = <
+                       MX6QDL_PAD_DI0_DISP_CLK__IPU1_DI0_DISP_CLK 0x31
+                       MX6QDL_PAD_DI0_PIN15__IPU1_DI0_PIN15       0xE1
+                       MX6QDL_PAD_DI0_PIN2__IPU1_DI0_PIN02        0x10
+                       MX6QDL_PAD_DI0_PIN3__IPU1_DI0_PIN03        0x10
+                       MX6QDL_PAD_DISP0_DAT0__IPU1_DISP0_DATA00   0xE1
+                       MX6QDL_PAD_DISP0_DAT1__IPU1_DISP0_DATA01   0xE1
+                       MX6QDL_PAD_DISP0_DAT2__IPU1_DISP0_DATA02   0xE1
+                       MX6QDL_PAD_DISP0_DAT3__IPU1_DISP0_DATA03   0xE1
+                       MX6QDL_PAD_DISP0_DAT4__IPU1_DISP0_DATA04   0xE1
+                       MX6QDL_PAD_DISP0_DAT5__IPU1_DISP0_DATA05   0xE1
+                       MX6QDL_PAD_DISP0_DAT6__IPU1_DISP0_DATA06   0xE1
+                       MX6QDL_PAD_DISP0_DAT7__IPU1_DISP0_DATA07   0xE1
+                       MX6QDL_PAD_DISP0_DAT8__IPU1_DISP0_DATA08   0xE1
+                       MX6QDL_PAD_DISP0_DAT9__IPU1_DISP0_DATA09   0xE1
+                       MX6QDL_PAD_DISP0_DAT10__IPU1_DISP0_DATA10  0xE1
+                       MX6QDL_PAD_DISP0_DAT11__IPU1_DISP0_DATA11  0xE1
+                       MX6QDL_PAD_DISP0_DAT12__IPU1_DISP0_DATA12  0xE1
+                       MX6QDL_PAD_DISP0_DAT13__IPU1_DISP0_DATA13  0xE1
+                       MX6QDL_PAD_DISP0_DAT14__IPU1_DISP0_DATA14  0xe1
+                       MX6QDL_PAD_DISP0_DAT15__IPU1_DISP0_DATA15  0xE1
+                       MX6QDL_PAD_DISP0_DAT16__IPU1_DISP0_DATA16  0xE1
+                       MX6QDL_PAD_DISP0_DAT17__IPU1_DISP0_DATA17  0xE1
+                       MX6QDL_PAD_DISP0_DAT18__IPU1_DISP0_DATA18  0xE1
+                       MX6QDL_PAD_DISP0_DAT19__IPU1_DISP0_DATA19  0xE1
+                       MX6QDL_PAD_DISP0_DAT20__IPU1_DISP0_DATA20  0xE1
+                       MX6QDL_PAD_DISP0_DAT21__IPU1_DISP0_DATA21  0xE1
+                       MX6QDL_PAD_DISP0_DAT22__IPU1_DISP0_DATA22  0xE1
+                       MX6QDL_PAD_DISP0_DAT23__IPU1_DISP0_DATA23  0xE1
+               >;
+       };
+};
diff --git a/arch/arm/boot/dts/imx6dl-aristainetos2_7.dts b/arch/arm/boot/dts/imx6dl-aristainetos2_7.dts
new file mode 100644 (file)
index 0000000..3d5ad2c
--- /dev/null
@@ -0,0 +1,97 @@
+/*
+ * support for the imx6 based aristainetos2 board
+ *
+ * Copyright (C) 2015 Heiko Schocher <hs@denx.de>
+ *
+ * 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-aristainetos2.dtsi"
+
+/ {
+       model = "aristainetos2 i.MX6 Dual Lite Board 7";
+       compatible = "fsl,imx6dl";
+
+       memory {
+               reg = <0x10000000 0x40000000>;
+       };
+
+       panel: panel {
+               compatible = "lg,lb070wv8";
+               backlight = <&backlight>;
+               enable-gpios = <&gpio6 15 GPIO_ACTIVE_HIGH>;
+
+               port {
+                       panel_in: endpoint {
+                               remote-endpoint = <&lvds0_out>;
+                       };
+               };
+       };
+};
+
+&i2c3 {
+       touch: touch@4d {
+               compatible = "atmel,maxtouch";
+               reg = <0x4d>;
+               interrupt-parent = <&gpio2>;
+               interrupts = <9 8>;
+       };
+};
+
+&ldb {
+       status = "okay";
+
+       lvds-channel@0 {
+               status = "okay";
+
+               port@0 {
+                       reg = <0>;
+                       lvds0_in: endpoint {
+                               remote-endpoint = <&ipu1_di0_lvds0>;
+                       };
+               };
+
+               port@4 {
+                       reg = <4>;
+                       lvds0_out: endpoint {
+                               remote-endpoint = <&panel_in>;
+                       };
+               };
+       };
+};
index e0b7fe8e18f886608e7dd302409f0d045e1ebb29..2a43917d048e8a689b91c8e87823580907971945 100644 (file)
@@ -7,9 +7,8 @@
  * 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.
+ *     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
diff --git a/arch/arm/boot/dts/imx6dl-gw551x.dts b/arch/arm/boot/dts/imx6dl-gw551x.dts
new file mode 100644 (file)
index 0000000..82d5f85
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2014 Gateworks Corporation
+ *
+ * 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.
+ *
+ *     You should have received a copy of the GNU General Public
+ *     License along with this file; 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 "imx6dl.dtsi"
+#include "imx6qdl-gw551x.dtsi"
+
+/ {
+       model = "Gateworks Ventana i.MX6 DualLite/Solo GW551X";
+       compatible = "gw,imx6dl-gw551x", "gw,ventana", "fsl,imx6dl";
+};
index 7369d2d7da3e545904d84175f353e220d267fef0..d5c9660319627077de2eadf7320076ba3887063c 100644 (file)
@@ -8,9 +8,8 @@
  * 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.
+ *     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
index f94bf72832af891ba34bb449fd5e3d83ae4ba3c3..4b0ec07038256d25cbac349baf758988d5f61183 100644 (file)
        };
 };
 
+&gpt {
+       compatible = "fsl,imx6dl-gpt", "fsl,imx6q-gpt";
+};
+
 &hdmi {
        compatible = "fsl,imx6dl-hdmi";
 };
diff --git a/arch/arm/boot/dts/imx6q-apf6dev.dts b/arch/arm/boot/dts/imx6q-apf6dev.dts
new file mode 100644 (file)
index 0000000..4e4de82
--- /dev/null
@@ -0,0 +1,64 @@
+/*
+ * Copyright 2015 Armadeus Systems
+ *
+ * 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.
+ *
+ *     You should have received a copy of the GNU General Public
+ *     License along with this file; 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 "imx6q.dtsi"
+#include "imx6qdl-apf6.dtsi"
+#include "imx6qdl-apf6dev.dtsi"
+
+/ {
+       model = "Armadeus APF6 Quad / Dual Module on APF6Dev Board";
+       compatible = "armadeus,imx6q-apf6dev", "armadeus,imx6q-apf6", "fsl,imx6q";
+
+       memory {
+               reg = <0x10000000 0x40000000>;
+       };
+};
+
+&sata {
+       status = "okay";
+};
index 670bd8c4c847514f11bc3118f2b561b86fc8099d..353425edcdf4d43d50d834c99597e2c16acc03d6 100644 (file)
@@ -7,9 +7,8 @@
  * 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.
+ *     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
diff --git a/arch/arm/boot/dts/imx6q-gw551x.dts b/arch/arm/boot/dts/imx6q-gw551x.dts
new file mode 100644 (file)
index 0000000..2c7feee
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2014 Gateworks Corporation
+ *
+ * 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.
+ *
+ *     You should have received a copy of the GNU General Public
+ *     License along with this file; 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 "imx6q.dtsi"
+#include "imx6qdl-gw551x.dtsi"
+
+/ {
+       model = "Gateworks Ventana i.MX6 Dual/Quad GW551X";
+       compatible = "gw,imx6q-gw551x", "gw,ventana", "fsl,imx6q";
+};
index 0f6044553a2490106c413b86bba4c5bbf515f6c9..1884c16784e2fdde3338b04cf4d83dfb6a891e51 100644 (file)
@@ -8,9 +8,8 @@
  * 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.
+ *     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
diff --git a/arch/arm/boot/dts/imx6qdl-apf6.dtsi b/arch/arm/boot/dts/imx6qdl-apf6.dtsi
new file mode 100644 (file)
index 0000000..1ebf29f
--- /dev/null
@@ -0,0 +1,158 @@
+/*
+ * Copyright 2015 Armadeus Systems
+ *
+ * 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.
+ *
+ *     You should have received a copy of the GNU General Public
+ *     License along with this file; 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.
+ */
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+
+&fec {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_enet>;
+       phy-mode = "rgmii";
+       phy-reset-duration = <10>;
+       phy-reset-gpios = <&gpio1 24 GPIO_ACTIVE_LOW>;
+       status = "okay";
+};
+
+/* Bluetooth */
+&uart2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_uart2>;
+       status = "okay";
+};
+
+/* Wi-Fi */
+&usdhc1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_usdhc1>;
+       non-removable;
+       status = "okay";
+
+       #address-cells = <1>;
+       #size-cells = <0>;
+       wlcore: wlcore@2 {
+               compatible = "ti,wl1271";
+               reg = <2>;
+               interrupt-parent = <&gpio2>;
+               interrupts = <10 IRQ_TYPE_LEVEL_HIGH>;
+               ref-clock-frequency = <38400000>;
+               tcxo-clock-frequency = <38400000>;
+       };
+};
+
+/* eMMC */
+&usdhc3 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_usdhc3>;
+       bus-width = <8>;
+       no-1-8-v;
+       non-removable;
+       status = "okay";
+};
+
+&iomuxc {
+       apf6 {
+               pinctrl_enet: enetgrp {
+                       fsl,pins = <
+                               MX6QDL_PAD_ENET_MDIO__ENET_MDIO         0x1b8b0
+                               MX6QDL_PAD_ENET_MDC__ENET_MDC           0x1b0b0
+                               MX6QDL_PAD_ENET_REF_CLK__ENET_TX_CLK    0x1b0b0
+                               MX6QDL_PAD_ENET_RX_ER__GPIO1_IO24       0x130b0
+                               MX6QDL_PAD_ENET_TX_EN__GPIO1_IO28       0x130b0
+                               MX6QDL_PAD_RGMII_TXC__RGMII_TXC         0x1b030
+                               MX6QDL_PAD_RGMII_TD0__RGMII_TD0         0x1b030
+                               MX6QDL_PAD_RGMII_TD1__RGMII_TD1         0x1b030
+                               MX6QDL_PAD_RGMII_TD2__RGMII_TD2         0x1b030
+                               MX6QDL_PAD_RGMII_TD3__RGMII_TD3         0x1b030
+                               MX6QDL_PAD_RGMII_TX_CTL__RGMII_TX_CTL   0x1b030
+                               MX6QDL_PAD_RGMII_RXC__RGMII_RXC         0x13030
+                               MX6QDL_PAD_RGMII_RD0__RGMII_RD0         0x1b030
+                               MX6QDL_PAD_RGMII_RD1__RGMII_RD1         0x13030
+                               MX6QDL_PAD_RGMII_RD2__RGMII_RD2         0x1f030
+                               MX6QDL_PAD_RGMII_RD3__RGMII_RD3         0x1f030
+                               MX6QDL_PAD_RGMII_RX_CTL__RGMII_RX_CTL   0x13030
+                       >;
+               };
+
+               pinctrl_uart2: uart2grp {
+                       fsl,pins = <
+                               MX6QDL_PAD_SD4_DAT4__UART2_RX_DATA      0x1b0b0
+                               MX6QDL_PAD_SD4_DAT5__UART2_RTS_B        0x1b0b0
+                               MX6QDL_PAD_SD4_DAT6__UART2_CTS_B        0x1b0b0
+                               MX6QDL_PAD_SD4_DAT7__UART2_TX_DATA      0x1b0b0
+                               MX6QDL_PAD_SD4_DAT3__GPIO2_IO11         0x130b0 /* BT_EN */
+                       >;
+               };
+
+               pinctrl_usdhc1: usdhc1grp {
+                       fsl,pins = <
+                               MX6QDL_PAD_SD1_CMD__SD1_CMD     0x17059
+                               MX6QDL_PAD_SD1_CLK__SD1_CLK     0x10059
+                               MX6QDL_PAD_SD1_DAT0__SD1_DATA0  0x17059
+                               MX6QDL_PAD_SD1_DAT1__SD1_DATA1  0x17059
+                               MX6QDL_PAD_SD1_DAT2__SD1_DATA2  0x17059
+                               MX6QDL_PAD_SD1_DAT3__SD1_DATA3  0x17059
+                               MX6QDL_PAD_SD4_DAT0__GPIO2_IO08 0x1b0b0 /* WL_EN */
+                               MX6QDL_PAD_SD4_DAT2__GPIO2_IO10 0x1b0b0 /* WL_IRQ */
+                       >;
+               };
+
+               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_DAT4__SD3_DATA4  0x17059
+                               MX6QDL_PAD_SD3_DAT5__SD3_DATA5  0x17059
+                               MX6QDL_PAD_SD3_DAT6__SD3_DATA6  0x17059
+                               MX6QDL_PAD_SD3_DAT7__SD3_DATA7  0x17059
+                       >;
+               };
+       };
+};
diff --git a/arch/arm/boot/dts/imx6qdl-apf6dev.dtsi b/arch/arm/boot/dts/imx6qdl-apf6dev.dtsi
new file mode 100644 (file)
index 0000000..e26ebeb
--- /dev/null
@@ -0,0 +1,479 @@
+/*
+ * Copyright 2015 Armadeus Systems
+ *
+ * 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.
+ *
+ *     You should have received a copy of the GNU General Public
+ *     License along with this file; 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.
+ */
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+
+/ {
+       chosen {
+               stdout-path = &uart4;
+       };
+
+       display@di0 {
+               compatible = "fsl,imx-parallel-display";
+               interface-pix-fmt = "bgr666";
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_ipu1_disp1>;
+
+               display-timings {
+                       lw700 {
+                               clock-frequency = <33000033>;
+                               hactive = <800>;
+                               vactive = <480>;
+                               hback-porch = <96>;
+                               hfront-porch = <96>;
+                               vback-porch = <20>;
+                               vfront-porch = <21>;
+                               hsync-len = <64>;
+                               vsync-len = <4>;
+                               hsync-active = <1>;
+                               vsync-active = <1>;
+                               de-active = <1>;
+                               pixelclk-active = <1>;
+                       };
+               };
+
+               port {
+                       display_in: endpoint {
+                               remote-endpoint = <&ipu1_di0_disp0>;
+                       };
+               };
+       };
+
+       gpio-keys {
+               compatible = "gpio-keys";
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_gpio_keys>;
+
+               user-button {
+                       label = "User button";
+                       gpios = <&gpio1 9 GPIO_ACTIVE_LOW>;
+                       linux,code = <BTN_MISC>;
+                       gpio-key,wakeup;
+               };
+       };
+
+       leds {
+               compatible = "gpio-leds";
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_gpio_leds>;
+
+               user-led {
+                       label = "User LED";
+                       gpios = <&gpio7 12 GPIO_ACTIVE_HIGH>;
+                       linux,default-trigger = "heartbeat";
+                       default-state = "on";
+               };
+       };
+
+       regulators {
+               compatible = "simple-bus";
+
+               reg_3p3v: 3p3v {
+                       compatible = "regulator-fixed";
+                       regulator-name = "3P3V";
+                       regulator-min-microvolt = <3300000>;
+                       regulator-max-microvolt = <3300000>;
+                       regulator-always-on;
+               };
+
+               reg_usbh1_vbus: usb-h1-vbus {
+                       compatible = "regulator-fixed";
+                       regulator-name = "usb_h1_vbus";
+                       regulator-min-microvolt = <5000000>;
+                       regulator-max-microvolt = <5000000>;
+                       regulator-always-on;
+               };
+
+               reg_usb_otg_vbus: usb-otg-vbus {
+                       compatible = "regulator-fixed";
+                       regulator-name = "usb_otg_vbus";
+                       regulator-min-microvolt = <5000000>;
+                       regulator-max-microvolt = <5000000>;
+                       regulator-always-on;
+               };
+       };
+
+       sound {
+               compatible = "fsl,imx6-armadeus-sgtl5000",
+                            "fsl,imx-audio-sgtl5000";
+               model = "imx6-armadeus-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>;
+       };
+
+       sound-spdif {
+               compatible = "fsl,imx-audio-spdif";
+               model = "imx-spdif";
+               spdif-controller = <&spdif>;
+               spdif-out;
+       };
+};
+
+&audmux {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_audmux>;
+       status = "okay";
+};
+
+&can2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_flexcan2>;
+       status = "okay";
+};
+
+&ecspi1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_ecspi1>;
+       fsl,spi-num-chipselects = <3>;
+       cs-gpios = <&gpio4 9 GPIO_ACTIVE_LOW>,
+                  <&gpio4 10 GPIO_ACTIVE_LOW>,
+                  <&gpio4 11 GPIO_ACTIVE_LOW>;
+       status = "okay";
+};
+
+&hdmi {
+       ddc-i2c-bus = <&i2c3>;
+       status = "okay";
+};
+
+&i2c1 {
+       clock-frequency = <400000>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_i2c1>;
+       status = "okay";
+
+       touchscreen@48 {
+               compatible = "semtech,sx8654";
+               reg = <0x48>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_touchscreen>;
+               interrupt-parent = <&gpio6>;
+               interrupts = <3 IRQ_TYPE_EDGE_FALLING>;
+       };
+};
+
+&i2c2 {
+       clock-frequency = <400000>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_i2c2>;
+       status = "okay";
+
+       codec: sgtl5000@0a {
+               compatible = "fsl,sgtl5000";
+               reg = <0x0a>;
+               clocks = <&clks 201>;
+               VDDA-supply = <&reg_3p3v>;
+               VDDIO-supply = <&reg_3p3v>;
+       };
+};
+
+&i2c3 {
+       clock-frequency = <400000>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_i2c3>;
+       status = "okay";
+};
+
+&ipu1_di0_disp0 {
+       remote-endpoint = <&display_in>;
+};
+
+&pcie {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_pcie>;
+       reset-gpio = <&gpio6 2 GPIO_ACTIVE_HIGH>;
+       status = "okay";
+};
+
+&pwm3 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_pwm3>;
+       status = "okay";
+};
+
+/* GPS */
+&uart1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_uart1>;
+       status = "okay";
+};
+
+/* GSM */
+&uart3 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_uart3 &pinctrl_gsm>;
+       fsl,uart-has-rtscts;
+       status = "okay";
+};
+
+/* console */
+&uart4 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_uart4>;
+       status = "okay";
+};
+
+&usbh1 {
+       vbus-supply = <&reg_usbh1_vbus>;
+       phy_type = "utmi";
+       status = "okay";
+};
+
+&usbotg {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_usbotg>;
+       vbus-supply = <&reg_usb_otg_vbus>;
+       dr_mode = "otg";
+       status = "okay";
+};
+
+/* microSD */
+&usdhc2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_usdhc2>;
+       cd-gpios = <&gpio1 2 GPIO_ACTIVE_LOW>;
+       no-1-8-v;
+       status = "okay";
+};
+
+&spdif {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_spdif>;
+       status = "okay";
+};
+
+&ssi1 {
+       status = "okay";
+};
+
+&iomuxc {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_gpios>;
+
+       apf6dev {
+               pinctrl_audmux: audmuxgrp {
+                       fsl,pins = <
+                               MX6QDL_PAD_CSI0_DAT4__AUD3_TXC  0x1b0b0
+                               MX6QDL_PAD_CSI0_DAT5__AUD3_TXD  0x1b0b0
+                               MX6QDL_PAD_CSI0_DAT6__AUD3_TXFS 0x1b0b0
+                               MX6QDL_PAD_CSI0_DAT7__AUD3_RXD  0x1b0b0
+                               MX6QDL_PAD_GPIO_0__CCM_CLKO1    0x130b0
+                       >;
+               };
+
+               pinctrl_ecspi1: ecspi1grp {
+                       fsl,pins = <
+                               MX6QDL_PAD_KEY_COL1__ECSPI1_MISO 0x100b1
+                               MX6QDL_PAD_KEY_ROW0__ECSPI1_MOSI 0x100b1
+                               MX6QDL_PAD_KEY_COL0__ECSPI1_SCLK 0x100b1
+                               MX6QDL_PAD_KEY_ROW1__GPIO4_IO09  0x1b0b0
+                               MX6QDL_PAD_KEY_ROW2__GPIO4_IO11  0x1b0b0
+                               MX6QDL_PAD_KEY_COL2__GPIO4_IO10  0x1b0b0
+                       >;
+               };
+
+               pinctrl_flexcan2: flexcan2grp {
+                       fsl,pins = <
+                               MX6QDL_PAD_KEY_COL4__FLEXCAN2_TX 0x1b0b0
+                               MX6QDL_PAD_KEY_ROW4__FLEXCAN2_RX 0x1b0b0
+                       >;
+               };
+
+               pinctrl_gpio_keys: gpiokeysgrp {
+                       fsl,pins = <
+                               MX6QDL_PAD_GPIO_9__GPIO1_IO09 0x1b0b0
+                       >;
+               };
+
+               pinctrl_gpio_leds: gpioledsgrp {
+                       fsl,pins = <
+                               MX6QDL_PAD_GPIO_17__GPIO7_IO12 0x130b0
+                       >;
+               };
+
+               pinctrl_gpios: gpiosgrp {
+                       fsl,pins = <
+                               MX6QDL_PAD_DI0_PIN4__GPIO4_IO20         0x100b1
+                               MX6QDL_PAD_DISP0_DAT18__GPIO5_IO12      0x100b1
+                               MX6QDL_PAD_DISP0_DAT19__GPIO5_IO13      0x100b1
+                               MX6QDL_PAD_DISP0_DAT20__GPIO5_IO14      0x100b1
+                               MX6QDL_PAD_DISP0_DAT21__GPIO5_IO15      0x100b1
+                               MX6QDL_PAD_DISP0_DAT22__GPIO5_IO16      0x100b1
+                               MX6QDL_PAD_DISP0_DAT23__GPIO5_IO17      0x100b1
+                               MX6QDL_PAD_CSI0_PIXCLK__GPIO5_IO18      0x100b1
+                               MX6QDL_PAD_CSI0_VSYNC__GPIO5_IO21       0x100b1
+                       >;
+               };
+
+               pinctrl_gsm: gsmgrp {
+                       fsl,pins = <
+                               MX6QDL_PAD_GPIO_4__GPIO1_IO04  0x130b0 /* GSM_POKIN */
+                               MX6QDL_PAD_GPIO_18__GPIO7_IO13 0x130b0 /* GSM_PWR_EN */
+                       >;
+               };
+
+               pinctrl_i2c1: i2c1grp {
+                       fsl,pins = <
+                               MX6QDL_PAD_CSI0_DAT8__I2C1_SDA 0x4001b8b1
+                               MX6QDL_PAD_CSI0_DAT9__I2C1_SCL 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_6__I2C3_SDA 0x4001b8b1
+                               MX6QDL_PAD_GPIO_5__I2C3_SCL 0x4001b8b1
+                       >;
+               };
+
+               pinctrl_ipu1_disp1: ipu1disp1grp {
+                       fsl,pins = <
+                               MX6QDL_PAD_DI0_DISP_CLK__IPU1_DI0_DISP_CLK      0x100b1
+                               MX6QDL_PAD_DI0_PIN15__IPU1_DI0_PIN15            0x100b1
+                               MX6QDL_PAD_DI0_PIN2__IPU1_DI0_PIN02             0x100b1
+                               MX6QDL_PAD_DI0_PIN3__IPU1_DI0_PIN03             0x100b1
+                               MX6QDL_PAD_DISP0_DAT0__IPU1_DISP0_DATA00        0x100b1
+                               MX6QDL_PAD_DISP0_DAT1__IPU1_DISP0_DATA01        0x100b1
+                               MX6QDL_PAD_DISP0_DAT2__IPU1_DISP0_DATA02        0x100b1
+                               MX6QDL_PAD_DISP0_DAT3__IPU1_DISP0_DATA03        0x100b1
+                               MX6QDL_PAD_DISP0_DAT4__IPU1_DISP0_DATA04        0x100b1
+                               MX6QDL_PAD_DISP0_DAT5__IPU1_DISP0_DATA05        0x100b1
+                               MX6QDL_PAD_DISP0_DAT6__IPU1_DISP0_DATA06        0x100b1
+                               MX6QDL_PAD_DISP0_DAT7__IPU1_DISP0_DATA07        0x100b1
+                               MX6QDL_PAD_DISP0_DAT8__IPU1_DISP0_DATA08        0x100b1
+                               MX6QDL_PAD_DISP0_DAT9__IPU1_DISP0_DATA09        0x100b1
+                               MX6QDL_PAD_DISP0_DAT10__IPU1_DISP0_DATA10       0x100b1
+                               MX6QDL_PAD_DISP0_DAT11__IPU1_DISP0_DATA11       0x100b1
+                               MX6QDL_PAD_DISP0_DAT12__IPU1_DISP0_DATA12       0x100b1
+                               MX6QDL_PAD_DISP0_DAT13__IPU1_DISP0_DATA13       0x100b1
+                               MX6QDL_PAD_DISP0_DAT14__IPU1_DISP0_DATA14       0x100b1
+                               MX6QDL_PAD_DISP0_DAT15__IPU1_DISP0_DATA15       0x100b1
+                               MX6QDL_PAD_DISP0_DAT16__IPU1_DISP0_DATA16       0x100b1
+                               MX6QDL_PAD_DISP0_DAT17__IPU1_DISP0_DATA17       0x100b1
+                       >;
+               };
+
+               pinctrl_pcie: pciegrp {
+                       fsl,pins = <
+                               MX6QDL_PAD_CSI0_DAT16__GPIO6_IO02 0x130b0
+                       >;
+               };
+
+               pinctrl_pwm3: pwm3grp {
+                       fsl,pins = <
+                               MX6QDL_PAD_SD4_DAT1__PWM3_OUT 0x1b0b1
+                       >;
+               };
+
+               pinctrl_uart1: uart1grp {
+                       fsl,pins = <
+                               MX6QDL_PAD_CSI0_DAT10__UART1_TX_DATA 0x1b0b0
+                               MX6QDL_PAD_CSI0_DAT11__UART1_RX_DATA 0x1b0b0
+                       >;
+               };
+
+               pinctrl_uart3: uart3grp {
+                       fsl,pins = <
+                               MX6QDL_PAD_EIM_D23__UART3_CTS_B   0x1b0b0
+                               MX6QDL_PAD_EIM_D24__UART3_TX_DATA 0x1b0b0
+                               MX6QDL_PAD_EIM_D25__UART3_RX_DATA 0x1b0b0
+                               MX6QDL_PAD_EIM_D31__UART3_RTS_B   0x1b0b0
+                       >;
+               };
+
+               pinctrl_uart4: uart4grp {
+                       fsl,pins = <
+                               MX6QDL_PAD_CSI0_DAT12__UART4_TX_DATA 0x1b0b0
+                               MX6QDL_PAD_CSI0_DAT13__UART4_RX_DATA 0x1b0b0
+                       >;
+               };
+
+               pinctrl_usbotg: usbotggrp {
+                       fsl,pins = <
+                               MX6QDL_PAD_GPIO_1__USB_OTG_ID 0x1b0b0
+                       >;
+               };
+
+               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_spdif: spdifgrp {
+                       fsl,pins = <
+                               MX6QDL_PAD_GPIO_19__SPDIF_OUT 0x1b0b0
+                       >;
+               };
+
+               pinctrl_touchscreen: touchscreengrp {
+                       fsl,pins = <
+                               MX6QDL_PAD_CSI0_DAT17__GPIO6_IO03 0x1b0b0
+                       >;
+               };
+       };
+};
diff --git a/arch/arm/boot/dts/imx6qdl-aristainetos2.dtsi b/arch/arm/boot/dts/imx6qdl-aristainetos2.dtsi
new file mode 100644 (file)
index 0000000..1d85de2
--- /dev/null
@@ -0,0 +1,633 @@
+/*
+ * support for the imx6 based aristainetos2 board
+ *
+ * Copyright (C) 2015 Heiko Schocher <hs@denx.de>
+ *
+ * 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/clock/imx6qdl-clock.h>
+
+/ {
+       backlight: backlight {
+               compatible = "pwm-backlight";
+               pwms = <&pwm1 0 5000000>;
+               brightness-levels = <0 4 8 16 32 64 128 255>;
+               default-brightness-level = <7>;
+               enable-gpios = <&gpio6 31 GPIO_ACTIVE_HIGH>;
+       };
+
+       regulators {
+               compatible = "simple-bus";
+
+               reg_2p5v: 2p5v {
+                       compatible = "regulator-fixed";
+                       regulator-name = "2P5V";
+                       regulator-min-microvolt = <2500000>;
+                       regulator-max-microvolt = <2500000>;
+                       regulator-always-on;
+               };
+
+               reg_3p3v: 3p3v {
+                       compatible = "regulator-fixed";
+                       regulator-name = "3P3V";
+                       regulator-min-microvolt = <3300000>;
+                       regulator-max-microvolt = <3300000>;
+                       regulator-always-on;
+               };
+
+               reg_usbh1_vbus: usb-h1-vbus {
+                       compatible = "regulator-fixed";
+                       enable-active-high;
+                       gpio = <&gpio1 0 GPIO_ACTIVE_HIGH>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&pinctrl_aristainetos2_usbh1_vbus>;
+                       regulator-name = "usb_h1_vbus";
+                       regulator-min-microvolt = <5000000>;
+                       regulator-max-microvolt = <5000000>;
+               };
+
+               reg_usbotg_vbus: usb-otg-vbus {
+                       compatible = "regulator-fixed";
+                       enable-active-high;
+                       gpio = <&gpio4 15 GPIO_ACTIVE_HIGH>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&pinctrl_aristainetos2_usbotg_vbus>;
+                       regulator-name = "usb_otg_vbus";
+                       regulator-min-microvolt = <5000000>;
+                       regulator-max-microvolt = <5000000>;
+               };
+       };
+};
+
+&audmux {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_audmux>;
+       status = "okay";
+};
+
+&can1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_flexcan1>;
+       status = "okay";
+};
+
+&can2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_flexcan2>;
+       status = "okay";
+};
+
+&ecspi1 {
+       fsl,spi-num-chipselects = <3>;
+       cs-gpios = <&gpio4 9 GPIO_ACTIVE_HIGH
+                   &gpio4 10 GPIO_ACTIVE_HIGH
+                   &gpio4 11 GPIO_ACTIVE_HIGH>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_ecspi1>;
+       status = "okay";
+};
+
+&ecspi2 {
+       fsl,spi-num-chipselects = <2>;
+       cs-gpios = <&gpio2 26 GPIO_ACTIVE_HIGH &gpio2 27 GPIO_ACTIVE_HIGH>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_ecspi2>;
+       status = "okay";
+};
+
+&ecspi4 {
+       fsl,spi-num-chipselects = <2>;
+       cs-gpios = <&gpio3 29 GPIO_ACTIVE_HIGH &gpio5 2 GPIO_ACTIVE_HIGH>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_ecspi4>;
+       status = "okay";
+
+       flash: m25p80@1 {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "micron,n25q128a11";
+               spi-max-frequency = <20000000>;
+               reg = <1>;
+       };
+};
+
+&i2c1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_i2c1>;
+       status = "okay";
+
+       pmic@58 {
+               compatible = "dlg,da9063";
+               reg = <0x58>;
+               interrupt-parent = <&gpio1>;
+               interrupts = <04 0x8>;
+
+               regulators {
+                       bcore1 {
+                               regulator-name = "bcore1";
+                               regulator-always-on = <1>;
+                               regulator-min-microvolt = <300000>;
+                               regulator-max-microvolt = <3300000>;
+                       };
+
+                       bcore2 {
+                               regulator-name = "bcore2";
+                               regulator-always-on = <1>;
+                               regulator-min-microvolt = <300000>;
+                               regulator-max-microvolt = <3300000>;
+                       };
+
+                       bpro {
+                               regulator-name = "bpro";
+                               regulator-always-on = <1>;
+                               regulator-min-microvolt = <300000>;
+                               regulator-max-microvolt = <3300000>;
+                       };
+
+                       bperi {
+                               regulator-name = "bperi";
+                               regulator-always-on = <1>;
+                               regulator-min-microvolt = <300000>;
+                               regulator-max-microvolt = <3300000>;
+                       };
+
+                       bmem {
+                               regulator-name = "bmem";
+                               regulator-always-on = <1>;
+                               regulator-min-microvolt = <300000>;
+                               regulator-max-microvolt = <3300000>;
+                       };
+
+                       ldo2 {
+                               regulator-name = "ldo2";
+                               regulator-always-on = <1>;
+                               regulator-min-microvolt = <300000>;
+                               regulator-max-microvolt = <1800000>;
+                       };
+
+                       ldo3 {
+                               regulator-name = "ldo3";
+                               regulator-always-on = <1>;
+                               regulator-min-microvolt = <300000>;
+                               regulator-max-microvolt = <3300000>;
+                       };
+
+                       ldo4 {
+                               regulator-name = "ldo4";
+                               regulator-always-on = <1>;
+                               regulator-min-microvolt = <300000>;
+                               regulator-max-microvolt = <3300000>;
+                       };
+
+                       ldo5 {
+                               regulator-name = "ldo5";
+                               regulator-always-on = <1>;
+                               regulator-min-microvolt = <300000>;
+                               regulator-max-microvolt = <3300000>;
+                       };
+
+                       ldo6 {
+                               regulator-name = "ldo6";
+                               regulator-always-on = <1>;
+                               regulator-min-microvolt = <300000>;
+                               regulator-max-microvolt = <3300000>;
+                       };
+
+                       ldo7 {
+                               regulator-name = "ldo7";
+                               regulator-always-on = <1>;
+                               regulator-min-microvolt = <300000>;
+                               regulator-max-microvolt = <3300000>;
+                       };
+
+                       ldo8 {
+                               regulator-name = "ldo8";
+                               regulator-always-on = <1>;
+                               regulator-min-microvolt = <300000>;
+                               regulator-max-microvolt = <3300000>;
+                       };
+
+                       ldo9 {
+                               regulator-name = "ldo9";
+                               regulator-always-on = <1>;
+                               regulator-min-microvolt = <300000>;
+                               regulator-max-microvolt = <3300000>;
+                       };
+
+                       ldo10 {
+                               regulator-name = "ldo10";
+                               regulator-always-on = <1>;
+                               regulator-min-microvolt = <300000>;
+                               regulator-max-microvolt = <3300000>;
+                       };
+
+                       ldo11 {
+                               regulator-name = "ldo11";
+                               regulator-always-on = <1>;
+                               regulator-min-microvolt = <300000>;
+                               regulator-max-microvolt = <3300000>;
+                       };
+
+                       bio {
+                               regulator-name = "bio";
+                               regulator-always-on = <1>;
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                       };
+               };
+       };
+
+       tmp103: tmp103@71 {
+               compatible = "ti,tmp103";
+               reg = <0x71>;
+       };
+};
+
+&i2c2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_i2c2>;
+       status = "okay";
+};
+
+&i2c3 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_i2c3>;
+       status = "okay";
+
+       expander: tca6416@20 {
+               compatible = "ti,tca6416";
+               reg = <0x20>;
+               #gpio-cells = <2>;
+               gpio-controller;
+       };
+
+       rtc@68 {
+               compatible = "dallas,m41t00";
+               reg = <0x68>;
+       };
+};
+
+&i2c4 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_i2c4>;
+       status = "okay";
+
+       eeprom@50{
+               compatible = "atmel,24c64";
+               reg = <0x50>;
+       };
+
+       eeprom@57{
+               compatible = "atmel,24c64";
+               reg = <0x57>;
+       };
+};
+
+&fec {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_enet>;
+       phy-mode = "rgmii";
+       phy-reset-gpios = <&gpio7 18 GPIO_ACTIVE_HIGH>;
+       txd0-skew-ps = <0>;
+       txd1-skew-ps = <0>;
+       txd2-skew-ps = <0>;
+       txd3-skew-ps = <0>;
+       status = "okay";
+};
+
+&gpmi {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_gpmi_nand>;
+       status = "okay";
+};
+
+&pcie {
+       reset-gpio = <&gpio2 16 GPIO_ACTIVE_HIGH>;
+       status = "okay";
+};
+
+&pwm1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_pwm1>;
+       status = "okay";
+};
+
+&uart1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_uart1>;
+       fsl,uart-has-rtscts;
+       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";
+};
+
+&uart4 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_uart4>;
+       status = "okay";
+};
+
+&usbh1 {
+       vbus-supply = <&reg_usbh1_vbus>;
+       dr_mode = "host";
+       status = "okay";
+};
+
+&usbotg {
+       vbus-supply = <&reg_usbotg_vbus>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_usbotg>;
+       disable-over-current;
+       dr_mode = "host";
+       status = "okay";
+};
+
+&usdhc1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_usdhc1>;
+       cd-gpios = <&gpio1 27 GPIO_ACTIVE_HIGH>;
+       no-1-8-v;
+       status = "okay";
+};
+
+&usdhc2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_usdhc2>;
+       cd-gpios = <&gpio4 5 GPIO_ACTIVE_HIGH>;
+       wp-gpios = <&gpio2 10 GPIO_ACTIVE_HIGH>;
+       no-1-8-v;
+       status = "okay";
+};
+
+&iomuxc {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_gpio>;
+
+       pinctrl_audmux: audmux {
+               fsl,pins = <
+                       MX6QDL_PAD_CSI0_DAT7__AUD3_RXD  0x1b0b0
+                       MX6QDL_PAD_CSI0_DAT4__AUD3_TXC  0x1b0b0
+                       MX6QDL_PAD_CSI0_DAT5__AUD3_TXD  0x1b0b0
+                       MX6QDL_PAD_CSI0_DAT6__AUD3_TXFS 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_KEY_ROW1__GPIO4_IO09 0x100b1 /* SS0# */
+                       MX6QDL_PAD_KEY_COL2__GPIO4_IO10 0x100b1 /* SS1# */
+                       MX6QDL_PAD_KEY_ROW2__GPIO4_IO11 0x100b1 /* SS2# */
+               >;
+       };
+
+       pinctrl_ecspi2: ecspi2grp {
+               fsl,pins = <
+                       MX6QDL_PAD_EIM_OE__ECSPI2_MISO  0x100b1
+                       MX6QDL_PAD_EIM_CS0__ECSPI2_SCLK 0x100b1
+                       MX6QDL_PAD_EIM_CS1__ECSPI2_MOSI 0x100b1
+                       MX6QDL_PAD_EIM_RW__GPIO2_IO26   0x100b1 /* SS0# */
+                       MX6QDL_PAD_EIM_LBA__GPIO2_IO27  0x100b1 /* SS1# */
+               >;
+       };
+
+       pinctrl_ecspi4: ecspi4grp {
+               fsl,pins = <
+                       MX6QDL_PAD_EIM_D21__ECSPI4_SCLK 0x100b1
+                       MX6QDL_PAD_EIM_D22__ECSPI4_MISO 0x100b1
+                       MX6QDL_PAD_EIM_D28__ECSPI4_MOSI 0x100b1
+                       MX6QDL_PAD_EIM_D29__GPIO3_IO29  0x100b1 /* SS0# */
+                       MX6QDL_PAD_EIM_A25__GPIO5_IO02  0x100b1 /* SS1# */
+                       MX6QDL_PAD_SD4_DAT7__GPIO2_IO15 0x1b0b0 /* WP pin */
+               >;
+       };
+
+       pinctrl_enet: enetgrp {
+               fsl,pins = <
+                       MX6QDL_PAD_ENET_MDIO__ENET_MDIO       0x1b0b0
+                       MX6QDL_PAD_ENET_MDC__ENET_MDC         0x1b0b0
+                       MX6QDL_PAD_RGMII_TXC__RGMII_TXC       0x1b0b0
+                       MX6QDL_PAD_RGMII_TD0__RGMII_TD0       0x1b0b0
+                       MX6QDL_PAD_RGMII_TD1__RGMII_TD1       0x1b0b0
+                       MX6QDL_PAD_RGMII_TD2__RGMII_TD2       0x1b0b0
+                       MX6QDL_PAD_RGMII_TD3__RGMII_TD3       0x1b0b0
+                       MX6QDL_PAD_RGMII_TX_CTL__RGMII_TX_CTL 0x1b0b0
+                       MX6QDL_PAD_ENET_REF_CLK__ENET_TX_CLK  0x1b0b0
+                       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
+               >;
+       };
+
+       pinctrl_flexcan1: flexcan1grp {
+               fsl,pins = <
+                       MX6QDL_PAD_SD3_CLK__FLEXCAN1_RX 0x1b0b0
+                       MX6QDL_PAD_SD3_CMD__FLEXCAN1_TX 0x1b0b0
+               >;
+       };
+
+       pinctrl_flexcan2: flexcan2grp {
+               fsl,pins = <
+                       MX6QDL_PAD_SD3_DAT0__FLEXCAN2_TX 0x1b0b0
+                       MX6QDL_PAD_SD3_DAT1__FLEXCAN2_RX 0x1b0b0
+               >;
+       };
+
+       pinctrl_gpio: gpiogrp {
+               fsl,pins = <
+                       MX6QDL_PAD_ENET_CRS_DV__GPIO1_IO25      0x1b0b0 /* led enable */
+                       MX6QDL_PAD_NANDF_CS2__GPIO6_IO15        0x1b0b0 /* LCD power enable */
+                       MX6QDL_PAD_NANDF_CS3__GPIO6_IO16        0x1b0b0 /* led yellow */
+                       MX6QDL_PAD_EIM_EB0__GPIO2_IO28          0x1b0b0 /* led red */
+                       MX6QDL_PAD_EIM_A24__GPIO5_IO04          0x1b0b0 /* led green */
+                       MX6QDL_PAD_EIM_EB1__GPIO2_IO29          0x1b0b0 /* led blue */
+                       MX6QDL_PAD_SD3_DAT5__GPIO7_IO00         0x1b0b0 /* Profibus IRQ */
+                       MX6QDL_PAD_SD3_DAT6__GPIO6_IO18         0x1b0b0 /* FPGA IRQ */
+                       MX6QDL_PAD_EIM_A23__GPIO6_IO06          0x1b0b0 /* spi bus #2 SS driver enable */
+                       MX6QDL_PAD_GPIO_18__GPIO7_IO13          0x1b0b0 /* RST_LOC# PHY reset input (has pull-down!)*/
+                       MX6QDL_PAD_ENET_RX_ER__USB_OTG_ID       0x1b0b0 /* USB_OTG_ID = GPIO1_24*/
+                       MX6QDL_PAD_SD4_DAT1__GPIO2_IO09         0x1b0b0 /* Touchscreen IRQ */
+                       MX6QDL_PAD_EIM_A22__GPIO2_IO16          0x1b0b0 /* PCIe reset */
+               >;
+       };
+
+       pinctrl_gpmi_nand: gpmi-nand {
+               fsl,pins = <
+                       MX6QDL_PAD_NANDF_CLE__NAND_CLE     0xb0b1
+                       MX6QDL_PAD_NANDF_ALE__NAND_ALE     0xb0b1
+                       MX6QDL_PAD_NANDF_WP_B__NAND_WP_B   0xb0b1
+                       MX6QDL_PAD_NANDF_RB0__NAND_READY_B 0xb000
+                       MX6QDL_PAD_NANDF_CS0__NAND_CE0_B   0xb0b1
+                       MX6QDL_PAD_SD4_CMD__NAND_RE_B      0xb0b1
+                       MX6QDL_PAD_SD4_CLK__NAND_WE_B      0xb0b1
+                       MX6QDL_PAD_NANDF_D0__NAND_DATA00   0xb0b1
+                       MX6QDL_PAD_NANDF_D1__NAND_DATA01   0xb0b1
+                       MX6QDL_PAD_NANDF_D2__NAND_DATA02   0xb0b1
+                       MX6QDL_PAD_NANDF_D3__NAND_DATA03   0xb0b1
+                       MX6QDL_PAD_NANDF_D4__NAND_DATA04   0xb0b1
+                       MX6QDL_PAD_NANDF_D5__NAND_DATA05   0xb0b1
+                       MX6QDL_PAD_NANDF_D6__NAND_DATA06   0xb0b1
+                       MX6QDL_PAD_NANDF_D7__NAND_DATA07   0xb0b1
+               >;
+       };
+
+       pinctrl_i2c1: i2c1grp {
+               fsl,pins = <
+                       MX6QDL_PAD_CSI0_DAT8__I2C1_SDA 0x4001b8b1
+                       MX6QDL_PAD_CSI0_DAT9__I2C1_SCL 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_6__I2C3_SDA 0x4001b8b1
+               >;
+       };
+
+       pinctrl_i2c4: i2c4grp {
+               fsl,pins = <
+                       MX6QDL_PAD_GPIO_7__I2C4_SCL 0x4001b8b1
+                       MX6QDL_PAD_GPIO_8__I2C4_SDA 0x4001b8b1
+               >;
+       };
+
+       pinctrl_pwm1: pwm1grp {
+               fsl,pins = <
+                       MX6QDL_PAD_GPIO_9__PWM1_OUT     0x1b0b0
+                       MX6QDL_PAD_EIM_BCLK__GPIO6_IO31 0x1b0b0 /* backlight enable */
+               >;
+       };
+
+       pinctrl_uart1: uart1grp {
+               fsl,pins = <
+                       MX6QDL_PAD_CSI0_DAT10__UART1_TX_DATA    0x1b0b1
+                       MX6QDL_PAD_CSI0_DAT11__UART1_RX_DATA    0x1b0b1
+                       MX6QDL_PAD_EIM_D20__UART1_RTS_B         0x1b0b1
+                       MX6QDL_PAD_EIM_D19__UART1_CTS_B         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_D31__UART3_RTS_B   0x1b0b1
+                       MX6QDL_PAD_EIM_D23__UART3_CTS_B   0x1b0b1
+               >;
+       };
+
+       pinctrl_uart4: uart4grp {
+               fsl,pins = <
+                       MX6QDL_PAD_KEY_COL0__UART4_TX_DATA 0x1b0b1
+                       MX6QDL_PAD_KEY_ROW0__UART4_RX_DATA 0x1b0b1
+               >;
+       };
+
+       pinctrl_usbotg: usbotggrp {
+               fsl,pins = <
+                       MX6QDL_PAD_GPIO_1__USB_OTG_ID 0x17059
+               >;
+       };
+
+       pinctrl_aristainetos2_usbh1_vbus: aristainetos-usbh1-vbus {
+               fsl,pins = <MX6QDL_PAD_GPIO_0__USB_H1_PWR 0x130b0>;
+       };
+
+       pinctrl_aristainetos2_usbotg_vbus: aristainetos-usbotg-vbus {
+               fsl,pins = <MX6QDL_PAD_KEY_ROW4__USB_OTG_PWR 0x130b0>;
+       };
+
+       pinctrl_usdhc1: usdhc1grp {
+               fsl,pins = <
+                       MX6QDL_PAD_SD1_CMD__SD1_CMD    0x17059
+                       MX6QDL_PAD_SD1_CLK__SD1_CLK    0x10059
+                       MX6QDL_PAD_SD1_DAT0__SD1_DATA0 0x17059
+                       MX6QDL_PAD_SD1_DAT1__SD1_DATA1 0x17059
+                       MX6QDL_PAD_SD1_DAT2__SD1_DATA2 0x17059
+                       MX6QDL_PAD_SD1_DAT3__SD1_DATA3 0x17059
+                       MX6QDL_PAD_ENET_RXD0__GPIO1_IO27        0x1b0b0 /* SD1 card detect input */
+                       MX6QDL_PAD_DI0_PIN4__GPIO4_IO20         0x1b0b0 /* SD1 write protect input */
+               >;
+       };
+
+       pinctrl_usdhc2: usdhc2grp {
+               fsl,pins = <
+                       MX6QDL_PAD_SD2_CMD__SD2_CMD    0x71
+                       MX6QDL_PAD_SD2_CLK__SD2_CLK    0x71
+                       MX6QDL_PAD_SD2_DAT0__SD2_DATA0 0x71
+                       MX6QDL_PAD_SD2_DAT1__SD2_DATA1 0x71
+                       MX6QDL_PAD_SD2_DAT2__SD2_DATA2 0x71
+                       MX6QDL_PAD_SD2_DAT3__SD2_DATA3 0x71
+                       MX6QDL_PAD_SD3_RST__GPIO7_IO08          0x1b0b0 /* SD2 level shifter output enable */
+                       MX6QDL_PAD_GPIO_19__GPIO4_IO05          0x1b0b0 /* SD2 card detect input */
+                       MX6QDL_PAD_SD4_DAT2__GPIO2_IO10         0x1b0b0 /* SD2 write protect input */
+               >;
+       };
+};
index d033bb1820602773c9c0beaf661f779381344221..59e5d15e3ec4bad9cc664fe0f985502cf39a1375 100644 (file)
@@ -7,9 +7,8 @@
  * 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.
+ *     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
diff --git a/arch/arm/boot/dts/imx6qdl-gw551x.dtsi b/arch/arm/boot/dts/imx6qdl-gw551x.dtsi
new file mode 100644 (file)
index 0000000..d1866a0
--- /dev/null
@@ -0,0 +1,314 @@
+/*
+ * Copyright 2014 Gateworks Corporation
+ *
+ * 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.
+ *
+ *     You should have received a copy of the GNU General Public
+ *     License along with this file; 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.
+ */
+
+#include <dt-bindings/gpio/gpio.h>
+
+/ {
+       /* these are used by bootloader for disabling nodes */
+       aliases {
+               led0 = &led0;
+               nand = &gpmi;
+               ssi0 = &ssi1;
+               usb0 = &usbh1;
+               usb1 = &usbotg;
+       };
+
+       chosen {
+               bootargs = "console=ttymxc1,115200";
+       };
+
+       leds {
+               compatible = "gpio-leds";
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_gpio_leds>;
+
+               led0: user1 {
+                       label = "user1";
+                       gpios = <&gpio4 7 GPIO_ACTIVE_LOW>;
+                       default-state = "on";
+                       linux,default-trigger = "heartbeat";
+               };
+       };
+
+       memory {
+               reg = <0x10000000 0x20000000>;
+       };
+
+       regulators {
+               compatible = "simple-bus";
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               reg_5p0v: regulator@0 {
+                       compatible = "regulator-fixed";
+                       reg = <0>;
+                       regulator-name = "5P0V";
+                       regulator-min-microvolt = <5000000>;
+                       regulator-max-microvolt = <5000000>;
+               };
+
+               reg_usb_h1_vbus: regulator@1 {
+                       compatible = "regulator-fixed";
+                       reg = <1>;
+                       regulator-name = "usb_h1_vbus";
+                       regulator-min-microvolt = <5000000>;
+                       regulator-max-microvolt = <5000000>;
+               };
+
+               reg_usb_otg_vbus: regulator@2 {
+                       compatible = "regulator-fixed";
+                       reg = <2>;
+                       regulator-name = "usb_otg_vbus";
+                       regulator-min-microvolt = <5000000>;
+                       regulator-max-microvolt = <5000000>;
+               };
+       };
+};
+
+&can1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_flexcan1>;
+       status = "okay";
+};
+
+&gpmi {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_gpmi_nand>;
+       status = "okay";
+};
+
+&hdmi {
+       ddc-i2c-bus = <&i2c3>;
+       status = "okay";
+};
+
+&i2c1 {
+       clock-frequency = <100000>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_i2c1>;
+       status = "okay";
+
+       eeprom1: eeprom@50 {
+               compatible = "atmel,24c02";
+               reg = <0x50>;
+               pagesize = <16>;
+       };
+
+       eeprom2: eeprom@51 {
+               compatible = "atmel,24c02";
+               reg = <0x51>;
+               pagesize = <16>;
+       };
+
+       eeprom3: eeprom@52 {
+               compatible = "atmel,24c02";
+               reg = <0x52>;
+               pagesize = <16>;
+       };
+
+       eeprom4: eeprom@53 {
+               compatible = "atmel,24c02";
+               reg = <0x53>;
+               pagesize = <16>;
+       };
+
+       gpio: pca9555@23 {
+               compatible = "nxp,pca9555";
+               reg = <0x23>;
+               gpio-controller;
+               #gpio-cells = <2>;
+       };
+
+       rtc: ds1672@68 {
+               compatible = "dallas,ds1672";
+               reg = <0x68>;
+       };
+};
+
+&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";
+
+       gpio_exp: pca9555@24 {
+               compatible = "nxp,pca9555";
+               reg = <0x24>;
+               gpio-controller;
+               #gpio-cells = <2>;
+       };
+
+};
+
+&pcie {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_pcie>;
+       reset-gpio = <&gpio1 0 GPIO_ACTIVE_LOW>;
+       status = "okay";
+};
+
+&ssi1 {
+       status = "okay";
+};
+
+&uart2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_uart2>;
+       status = "okay";
+};
+
+&uart3 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_uart3>;
+       status = "okay";
+};
+
+&usbotg {
+       vbus-supply = <&reg_usb_otg_vbus>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_usbotg>;
+       disable-over-current;
+       status = "okay";
+};
+
+&usbh1 {
+       vbus-supply = <&reg_usb_h1_vbus>;
+       status = "okay";
+};
+
+&iomuxc {
+       imx6qdl-gw51xx {
+               pinctrl_flexcan1: flexcan1grp {
+                       fsl,pins = <
+                               MX6QDL_PAD_KEY_ROW2__FLEXCAN1_RX        0x1b0b1
+                               MX6QDL_PAD_KEY_COL2__FLEXCAN1_TX        0x1b0b1
+                               MX6QDL_PAD_GPIO_9__GPIO1_IO09           0x4001b0b0 /* CAN_STBY */
+                       >;
+               };
+
+               pinctrl_gpio_leds: gpioledsgrp {
+                       fsl,pins = <
+                               MX6QDL_PAD_KEY_ROW0__GPIO4_IO07   0x1b0b0
+                       >;
+               };
+
+               pinctrl_gpmi_nand: gpminandgrp {
+                       fsl,pins = <
+                               MX6QDL_PAD_NANDF_CLE__NAND_CLE          0xb0b1
+                               MX6QDL_PAD_NANDF_ALE__NAND_ALE          0xb0b1
+                               MX6QDL_PAD_NANDF_WP_B__NAND_WP_B        0xb0b1
+                               MX6QDL_PAD_NANDF_RB0__NAND_READY_B      0xb000
+                               MX6QDL_PAD_NANDF_CS0__NAND_CE0_B        0xb0b1
+                               MX6QDL_PAD_NANDF_CS1__NAND_CE1_B        0xb0b1
+                               MX6QDL_PAD_SD4_CMD__NAND_RE_B           0xb0b1
+                               MX6QDL_PAD_SD4_CLK__NAND_WE_B           0xb0b1
+                               MX6QDL_PAD_NANDF_D0__NAND_DATA00        0xb0b1
+                               MX6QDL_PAD_NANDF_D1__NAND_DATA01        0xb0b1
+                               MX6QDL_PAD_NANDF_D2__NAND_DATA02        0xb0b1
+                               MX6QDL_PAD_NANDF_D3__NAND_DATA03        0xb0b1
+                               MX6QDL_PAD_NANDF_D4__NAND_DATA04        0xb0b1
+                               MX6QDL_PAD_NANDF_D5__NAND_DATA05        0xb0b1
+                               MX6QDL_PAD_NANDF_D6__NAND_DATA06        0xb0b1
+                               MX6QDL_PAD_NANDF_D7__NAND_DATA07        0xb0b1
+                       >;
+               };
+
+               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_3__I2C3_SCL             0x4001b8b1
+                               MX6QDL_PAD_GPIO_6__I2C3_SDA             0x4001b8b1
+                       >;
+               };
+
+               pinctrl_pcie: pciegrp {
+                       fsl,pins = <
+                               MX6QDL_PAD_GPIO_0__GPIO1_IO00           0x1b0b0 /* PCIE RST */
+                       >;
+               };
+
+               pinctrl_uart2: uart2grp {
+                       fsl,pins = <
+                               MX6QDL_PAD_SD4_DAT7__UART2_TX_DATA      0x1b0b1
+                               MX6QDL_PAD_SD4_DAT4__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
+                       >;
+               };
+
+               pinctrl_usbotg: usbotggrp {
+                       fsl,pins = <
+                               MX6QDL_PAD_GPIO_1__USB_OTG_ID           0x17059
+                       >;
+               };
+       };
+};
index 151a3db2aea957f39d4437812e06a46455e117cb..62a82f3eba888f7d16f11e8dc8cac129ae4c2073 100644 (file)
@@ -7,9 +7,8 @@
  * 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.
+ *     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
                        >;
                };
 
+               pinctrl_hummingboard_pcie_reset: hummingboard-pcie-reset {
+                       fsl,pins = <
+                               MX6QDL_PAD_EIM_DA4__GPIO3_IO04 0x1b0b1
+                       >;
+               };
+
                pinctrl_hummingboard_pwm1: pwm1grp {
                        fsl,pins = <MX6QDL_PAD_DISP0_DAT8__PWM1_OUT 0x1b0b1>;
                };
        };
 };
 
+&pcie {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_hummingboard_pcie_reset>;
+       reset-gpio = <&gpio3 4 0>;
+       status = "okay";
+};
+
 &pwm1 {
         pinctrl-names = "default";
         pinctrl-0 = <&pinctrl_hummingboard_pwm1>;
 };
 
 &ssi1 {
-       fsl,mode = "i2s-slave";
        status = "okay";
 };
 
index 4a1820309cdb82e1ac0c9dcdb8fd5b11aa306a02..469ef58ce4bc8c7951ba07008c6dd60260ddecff 100644 (file)
@@ -10,9 +10,8 @@
  * 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.
+ *     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
index 349f82be816eb77c0119cdeeba4eb424711b9bb0..6d4069cc9419eae3361fece8cd52a1e29b25b853 100644 (file)
@@ -7,9 +7,8 @@
  * 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.
+ *     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
  *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  *     OTHER DEALINGS IN THE SOFTWARE.
  */
+#include <dt-bindings/gpio/gpio.h>
+/ {
+       clk_sdio: sdio-clock {
+               compatible = "gpio-gate-clock";
+               #clock-cells = <0>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_microsom_brcm_osc>;
+               enable-gpios = <&gpio5 5 GPIO_ACTIVE_HIGH>;
+       };
+
+       regulators {
+               compatible = "simple-bus";
+
+               reg_brcm: brcm-reg {
+                       compatible = "regulator-fixed";
+                       enable-active-high;
+                       gpio = <&gpio3 19 0>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&pinctrl_microsom_brcm_reg>;
+                       regulator-name = "brcm_reg";
+                       regulator-min-microvolt = <3300000>;
+                       regulator-max-microvolt = <3300000>;
+                       startup-delay-us = <200000>;
+               };
+       };
+
+       usdhc1_pwrseq: usdhc1_pwrseq {
+               compatible = "mmc-pwrseq-simple";
+               reset-gpios = <&gpio5 26 GPIO_ACTIVE_LOW>,
+                             <&gpio6 0 GPIO_ACTIVE_LOW>;
+               clocks = <&clk_sdio>;
+               clock-names = "ext_clock";
+       };
+};
 
 &iomuxc {
        microsom {
+               pinctrl_microsom_brcm_bt: microsom-brcm-bt {
+                       fsl,pins = <
+                               MX6QDL_PAD_CSI0_DAT14__GPIO6_IO00       0x40013070
+                               MX6QDL_PAD_CSI0_DAT15__GPIO6_IO01       0x40013070
+                               MX6QDL_PAD_CSI0_DAT18__GPIO6_IO04       0x40013070
+                       >;
+               };
+
+               pinctrl_microsom_brcm_osc: microsom-brcm-osc {
+                       fsl,pins = <
+                               MX6QDL_PAD_DISP0_DAT11__GPIO5_IO05      0x40013070
+                       >;
+               };
+
+               pinctrl_microsom_brcm_reg: microsom-brcm-reg {
+                       fsl,pins = <
+                               MX6QDL_PAD_EIM_D19__GPIO3_IO19          0x40013070
+                       >;
+               };
+
+               pinctrl_microsom_brcm_wifi: microsom-brcm-wifi {
+                       fsl,pins = <
+                               MX6QDL_PAD_GPIO_8__XTALOSC_REF_CLK_32K  0x1b0b0
+                               MX6QDL_PAD_CSI0_DATA_EN__GPIO5_IO20     0x40013070
+                               MX6QDL_PAD_CSI0_DAT8__GPIO5_IO26        0x40013070
+                               MX6QDL_PAD_CSI0_DAT9__GPIO5_IO27        0x40013070
+                       >;
+               };
+
                pinctrl_microsom_uart1: microsom-uart1 {
                        fsl,pins = <
                                MX6QDL_PAD_CSI0_DAT10__UART1_TX_DATA    0x1b0b1
                                MX6QDL_PAD_CSI0_DAT11__UART1_RX_DATA    0x1b0b1
                        >;
                };
+
+               pinctrl_microsom_uart4: microsom-uart4 {
+                       fsl,pins = <
+                               MX6QDL_PAD_CSI0_DAT12__UART4_TX_DATA 0x1b0b1
+                               MX6QDL_PAD_CSI0_DAT13__UART4_RX_DATA 0x1b0b1
+                               MX6QDL_PAD_CSI0_DAT16__UART4_RTS_B 0x1b0b1
+                               MX6QDL_PAD_CSI0_DAT17__UART4_CTS_B 0x1b0b1
+                       >;
+               };
+
+               pinctrl_microsom_usdhc1: microsom-usdhc1 {
+                       fsl,pins = <
+                               MX6QDL_PAD_SD1_CMD__SD1_CMD    0x17059
+                               MX6QDL_PAD_SD1_CLK__SD1_CLK    0x10059
+                               MX6QDL_PAD_SD1_DAT0__SD1_DATA0 0x17059
+                               MX6QDL_PAD_SD1_DAT1__SD1_DATA1 0x17059
+                               MX6QDL_PAD_SD1_DAT2__SD1_DATA2 0x17059
+                               MX6QDL_PAD_SD1_DAT3__SD1_DATA3 0x17059
+                       >;
+               };
        };
 };
 
        pinctrl-0 = <&pinctrl_microsom_uart1>;
        status = "okay";
 };
+
+/* UART4 - Connected to optional BRCM Wifi/BT/FM */
+&uart4 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_microsom_brcm_bt &pinctrl_microsom_uart4>;
+       fsl,uart-has-rtscts;
+       status = "okay";
+};
+
+/* USDHC1 - Connected to optional BRCM Wifi/BT/FM */
+&usdhc1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_microsom_brcm_wifi &pinctrl_microsom_usdhc1>;
+       bus-width = <4>;
+       mmc-pwrseq = <&usdhc1_pwrseq>;
+       keep-power-in-suspend;
+       non-removable;
+       vmmc-supply = <&reg_brcm>;
+       status = "okay";
+};
index 08218120e770af744b45b56b759898d57eb55d64..3af16dfe417be4bb6ec89a2f870e05f1b2df3214 100644 (file)
                status = "okay";
        };
 
-       backlight_lvds {
+       backlight_lvds: backlight_lvds {
                compatible = "pwm-backlight";
                pwms = <&pwm4 0 5000000>;
                brightness-levels = <0 4 8 16 32 64 128 255>;
                power-supply = <&reg_3p3v>;
                status = "okay";
        };
+
+       panel {
+               compatible = "hannstar,hsd100pxn1";
+               backlight = <&backlight_lvds>;
+
+               port {
+                       panel_in: endpoint {
+                               remote-endpoint = <&lvds0_out>;
+                       };
+               };
+       };
 };
 
 &audmux {
                fsl,data-width = <18>;
                status = "okay";
 
-               display-timings {
-                       native-mode = <&timing0>;
-                       timing0: hsd100pxn1 {
-                               clock-frequency = <65000000>;
-                               hactive = <1024>;
-                               vactive = <768>;
-                               hback-porch = <220>;
-                               hfront-porch = <40>;
-                               vback-porch = <21>;
-                               vfront-porch = <7>;
-                               hsync-len = <60>;
-                               vsync-len = <10>;
+               port@4 {
+                       reg = <4>;
+
+                       lvds0_out: endpoint {
+                               remote-endpoint = <&panel_in>;
                        };
                };
        };
index 0b28a9d5241e5b137ec1f09df2e76f9070675289..e00c44f6a0df888f6ecb8935ddc99b85e932ee43 100644 (file)
                status = "okay";
        };
 
-       backlight_lvds {
+       backlight_lvds: backlight_lvds {
                compatible = "pwm-backlight";
                pwms = <&pwm4 0 5000000>;
                brightness-levels = <0 4 8 16 32 64 128 255>;
                power-supply = <&reg_3p3v>;
                status = "okay";
        };
+
+       panel {
+               compatible = "hannstar,hsd100pxn1";
+               backlight = <&backlight_lvds>;
+
+               port {
+                       panel_in: endpoint {
+                               remote-endpoint = <&lvds0_out>;
+                       };
+               };
+       };
 };
 
 &audmux {
                fsl,data-width = <18>;
                status = "okay";
 
-               display-timings {
-                       native-mode = <&timing0>;
-                       timing0: hsd100pxn1 {
-                               clock-frequency = <65000000>;
-                               hactive = <1024>;
-                               vactive = <768>;
-                               hback-porch = <220>;
-                               hfront-porch = <40>;
-                               vback-porch = <21>;
-                               vfront-porch = <7>;
-                               hsync-len = <60>;
-                               vsync-len = <10>;
+               port@4 {
+                       reg = <4>;
+
+                       lvds0_out: endpoint {
+                               remote-endpoint = <&panel_in>;
                        };
                };
        };
index f74a8ded515f22b9985b8d48b370a45c34e9d88e..e6d13592080d7c701056c2f6a73326aa11e715b5 100644 (file)
                        status = "disabled";
                };
 
+               hdmi: hdmi@0120000 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <0x00120000 0x9000>;
+                       interrupts = <0 115 0x04>;
+                       gpr = <&gpr>;
+                       clocks = <&clks IMX6QDL_CLK_HDMI_IAHB>,
+                                <&clks IMX6QDL_CLK_HDMI_ISFR>;
+                       clock-names = "iahb", "isfr";
+                       status = "disabled";
+
+                       port@0 {
+                               reg = <0>;
+
+                               hdmi_mux_0: endpoint {
+                                       remote-endpoint = <&ipu1_di0_hdmi>;
+                               };
+                       };
+
+                       port@1 {
+                               reg = <1>;
+
+                               hdmi_mux_1: endpoint {
+                                       remote-endpoint = <&ipu1_di1_hdmi>;
+                               };
+                       };
+               };
+
                timer@00a00600 {
                        compatible = "arm,cortex-a9-twd-timer";
                        reg = <0x00a00600 0x20>;
                                clocks = <&clks IMX6QDL_CLK_VPU_AXI>,
                                         <&clks IMX6QDL_CLK_MMDC_CH0_AXI>;
                                clock-names = "per", "ahb";
+                               power-domains = <&gpc 1>;
                                resets = <&src 1>;
                                iram = <&ocram>;
                        };
                                };
                        };
 
-                       hdmi: hdmi@0120000 {
-                               #address-cells = <1>;
-                               #size-cells = <0>;
-                               reg = <0x00120000 0x9000>;
-                               interrupts = <0 115 0x04>;
-                               gpr = <&gpr>;
-                               clocks = <&clks IMX6QDL_CLK_HDMI_IAHB>,
-                                        <&clks IMX6QDL_CLK_HDMI_ISFR>;
-                               clock-names = "iahb", "isfr";
-                               status = "disabled";
-
-                               port@0 {
-                                       reg = <0>;
-
-                                       hdmi_mux_0: endpoint {
-                                               remote-endpoint = <&ipu1_di0_hdmi>;
-                                       };
-                               };
-
-                               port@1 {
-                                       reg = <1>;
-
-                                       hdmi_mux_1: endpoint {
-                                               remote-endpoint = <&ipu1_di1_hdmi>;
-                                       };
-                               };
-                       };
-
                        dcic1: dcic@020e4000 {
                                reg = <0x020e4000 0x4000>;
                                interrupts = <0 124 IRQ_TYPE_LEVEL_HIGH>;
index 64f7decf1fdcb5b2593377105521a0ff9aa3fb78..0da906bd8df2d8ca394e474debb0dbe51eb855d6 100644 (file)
                reg = <0x80000000 0x20000000>;
        };
 
-       regulators {
-               compatible = "simple-bus";
-               #address-cells = <1>;
-               #size-cells = <0>;
-
-               reg_usb_otg1_vbus: regulator@0 {
-                       compatible = "regulator-fixed";
-                       reg = <0>;
-                       regulator-name = "usb_otg1_vbus";
-                       regulator-min-microvolt = <5000000>;
-                       regulator-max-microvolt = <5000000>;
-                       gpio = <&gpio4 0 0>;
-                       enable-active-high;
-               };
-
-               reg_usb_otg2_vbus: regulator@1 {
-                       compatible = "regulator-fixed";
-                       reg = <1>;
-                       regulator-name = "usb_otg2_vbus";
-                       regulator-min-microvolt = <5000000>;
-                       regulator-max-microvolt = <5000000>;
-                       gpio = <&gpio4 2 0>;
-                       enable-active-high;
-               };
-
-               reg_1p8v: regulator@2 {
-                       compatible = "regulator-fixed";
-                       reg = <2>;
-                       regulator-name = "1P8V";
-                       regulator-min-microvolt = <1800000>;
-                       regulator-max-microvolt = <1800000>;
-               };
-       };
-
        usdhc3_pwrseq: usdhc3_pwrseq {
                compatible = "mmc-pwrseq-simple";
                reset-gpios = <&gpio4 5 GPIO_ACTIVE_LOW>,       /* WL_REG_ON */
 };
 
 &usbotg1 {
-       vbus-supply = <&reg_usb_otg1_vbus>;
-       dr_mode = "host";
+       dr_mode = "peripheral";
        disable-over-current;
        status = "okay";
 };
 
 &usbotg2 {
-       vbus-supply = <&reg_usb_otg2_vbus>;
+       dr_mode = "host";
        disable-over-current;
        status = "okay";
 };
diff --git a/arch/arm/boot/dts/imx7d-pinfunc.h b/arch/arm/boot/dts/imx7d-pinfunc.h
new file mode 100644 (file)
index 0000000..a8d8149
--- /dev/null
@@ -0,0 +1,1038 @@
+/*
+ * Copyright (C) 2014-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 __DTS_IMX7D_PINFUNC_H
+#define __DTS_IMX7D_PINFUNC_H
+
+/*
+ * The pin function ID is a tuple of
+ * <mux_reg conf_reg input_reg mux_mode input_val>
+ */
+
+#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_EPDC_DATA00__KPP_ROW3                            0x0034 0x02A4 0x0620 0x3 0x0
+#define MX7D_PAD_EPDC_DATA00__EIM_AD0                             0x0034 0x02A4 0x0000 0x4 0x0
+#define MX7D_PAD_EPDC_DATA00__GPIO2_IO0                           0x0034 0x02A4 0x0000 0x5 0x0
+#define MX7D_PAD_EPDC_DATA00__LCD_DATA0                           0x0034 0x02A4 0x0638 0x6 0x0
+#define MX7D_PAD_EPDC_DATA00__LCD_CLK                             0x0034 0x02A4 0x0000 0x7 0x0
+#define MX7D_PAD_EPDC_DATA01__EPDC_DATA1                          0x0038 0x02A8 0x0000 0x0 0x0
+#define MX7D_PAD_EPDC_DATA01__SIM1_PORT2_CLK                      0x0038 0x02A8 0x0000 0x1 0x0
+#define MX7D_PAD_EPDC_DATA01__QSPI_A_DATA1                        0x0038 0x02A8 0x0000 0x2 0x0
+#define MX7D_PAD_EPDC_DATA01__KPP_COL3                            0x0038 0x02A8 0x0600 0x3 0x0
+#define MX7D_PAD_EPDC_DATA01__EIM_AD1                             0x0038 0x02A8 0x0000 0x4 0x0
+#define MX7D_PAD_EPDC_DATA01__GPIO2_IO1                           0x0038 0x02A8 0x0000 0x5 0x0
+#define MX7D_PAD_EPDC_DATA01__LCD_DATA1                           0x0038 0x02A8 0x063C 0x6 0x0
+#define MX7D_PAD_EPDC_DATA01__LCD_ENABLE                          0x0038 0x02A8 0x0000 0x7 0x0
+#define MX7D_PAD_EPDC_DATA02__EPDC_DATA2                          0x003C 0x02AC 0x0000 0x0 0x0
+#define MX7D_PAD_EPDC_DATA02__SIM1_PORT2_RST_B                    0x003C 0x02AC 0x0000 0x1 0x0
+#define MX7D_PAD_EPDC_DATA02__QSPI_A_DATA2                        0x003C 0x02AC 0x0000 0x2 0x0
+#define MX7D_PAD_EPDC_DATA02__KPP_ROW2                            0x003C 0x02AC 0x061C 0x3 0x0
+#define MX7D_PAD_EPDC_DATA02__EIM_AD2                             0x003C 0x02AC 0x0000 0x4 0x0
+#define MX7D_PAD_EPDC_DATA02__GPIO2_IO2                           0x003C 0x02AC 0x0000 0x5 0x0
+#define MX7D_PAD_EPDC_DATA02__LCD_DATA2                           0x003C 0x02AC 0x0640 0x6 0x0
+#define MX7D_PAD_EPDC_DATA02__LCD_VSYNC                           0x003C 0x02AC 0x0698 0x7 0x0
+#define MX7D_PAD_EPDC_DATA03__EPDC_DATA3                          0x0040 0x02B0 0x0000 0x0 0x0
+#define MX7D_PAD_EPDC_DATA03__SIM1_PORT2_SVEN                     0x0040 0x02B0 0x0000 0x1 0x0
+#define MX7D_PAD_EPDC_DATA03__QSPI_A_DATA3                        0x0040 0x02B0 0x0000 0x2 0x0
+#define MX7D_PAD_EPDC_DATA03__KPP_COL2                            0x0040 0x02B0 0x05FC 0x3 0x0
+#define MX7D_PAD_EPDC_DATA03__EIM_AD3                             0x0040 0x02B0 0x0000 0x4 0x0
+#define MX7D_PAD_EPDC_DATA03__GPIO2_IO3                           0x0040 0x02B0 0x0000 0x5 0x0
+#define MX7D_PAD_EPDC_DATA03__LCD_DATA3                           0x0040 0x02B0 0x0644 0x6 0x0
+#define MX7D_PAD_EPDC_DATA03__LCD_HSYNC                           0x0040 0x02B0 0x0000 0x7 0x0
+#define MX7D_PAD_EPDC_DATA04__EPDC_DATA4                          0x0044 0x02B4 0x0000 0x0 0x0
+#define MX7D_PAD_EPDC_DATA04__SIM1_PORT2_PD                       0x0044 0x02B4 0x0000 0x1 0x0
+#define MX7D_PAD_EPDC_DATA04__QSPI_A_DQS                          0x0044 0x02B4 0x0000 0x2 0x0
+#define MX7D_PAD_EPDC_DATA04__KPP_ROW1                            0x0044 0x02B4 0x0618 0x3 0x0
+#define MX7D_PAD_EPDC_DATA04__EIM_AD4                             0x0044 0x02B4 0x0000 0x4 0x0
+#define MX7D_PAD_EPDC_DATA04__GPIO2_IO4                           0x0044 0x02B4 0x0000 0x5 0x0
+#define MX7D_PAD_EPDC_DATA04__LCD_DATA4                           0x0044 0x02B4 0x0648 0x6 0x0
+#define MX7D_PAD_EPDC_DATA04__JTAG_FAIL                           0x0044 0x02B4 0x0000 0x7 0x0
+#define MX7D_PAD_EPDC_DATA05__EPDC_DATA5                          0x0048 0x02B8 0x0000 0x0 0x0
+#define MX7D_PAD_EPDC_DATA05__SIM2_PORT2_TRXD                     0x0048 0x02B8 0x0000 0x1 0x0
+#define MX7D_PAD_EPDC_DATA05__QSPI_A_SCLK                         0x0048 0x02B8 0x0000 0x2 0x0
+#define MX7D_PAD_EPDC_DATA05__KPP_COL1                            0x0048 0x02B8 0x05F8 0x3 0x0
+#define MX7D_PAD_EPDC_DATA05__EIM_AD5                             0x0048 0x02B8 0x0000 0x4 0x0
+#define MX7D_PAD_EPDC_DATA05__GPIO2_IO5                           0x0048 0x02B8 0x0000 0x5 0x0
+#define MX7D_PAD_EPDC_DATA05__LCD_DATA5                           0x0048 0x02B8 0x064C 0x6 0x0
+#define MX7D_PAD_EPDC_DATA05__JTAG_ACTIVE                         0x0048 0x02B8 0x0000 0x7 0x0
+#define MX7D_PAD_EPDC_DATA06__EPDC_DATA6                          0x004C 0x02BC 0x0000 0x0 0x0
+#define MX7D_PAD_EPDC_DATA06__SIM2_PORT2_CLK                      0x004C 0x02BC 0x0000 0x1 0x0
+#define MX7D_PAD_EPDC_DATA06__QSPI_A_SS0_B                        0x004C 0x02BC 0x0000 0x2 0x0
+#define MX7D_PAD_EPDC_DATA06__KPP_ROW0                            0x004C 0x02BC 0x0614 0x3 0x0
+#define MX7D_PAD_EPDC_DATA06__EIM_AD6                             0x004C 0x02BC 0x0000 0x4 0x0
+#define MX7D_PAD_EPDC_DATA06__GPIO2_IO6                           0x004C 0x02BC 0x0000 0x5 0x0
+#define MX7D_PAD_EPDC_DATA06__LCD_DATA6                           0x004C 0x02BC 0x0650 0x6 0x0
+#define MX7D_PAD_EPDC_DATA06__JTAG_DE_B                           0x004C 0x02BC 0x0000 0x7 0x0
+#define MX7D_PAD_EPDC_DATA07__EPDC_DATA7                          0x0050 0x02C0 0x0000 0x0 0x0
+#define MX7D_PAD_EPDC_DATA07__SIM2_PORT2_RST_B                    0x0050 0x02C0 0x0000 0x1 0x0
+#define MX7D_PAD_EPDC_DATA07__QSPI_A_SS1_B                        0x0050 0x02C0 0x0000 0x2 0x0
+#define MX7D_PAD_EPDC_DATA07__KPP_COL0                            0x0050 0x02C0 0x05F4 0x3 0x0
+#define MX7D_PAD_EPDC_DATA07__EIM_AD7                             0x0050 0x02C0 0x0000 0x4 0x0
+#define MX7D_PAD_EPDC_DATA07__GPIO2_IO7                           0x0050 0x02C0 0x0000 0x5 0x0
+#define MX7D_PAD_EPDC_DATA07__LCD_DATA7                           0x0050 0x02C0 0x0654 0x6 0x0
+#define MX7D_PAD_EPDC_DATA07__JTAG_DONE                           0x0050 0x02C0 0x0000 0x7 0x0
+#define MX7D_PAD_EPDC_DATA08__EPDC_DATA8                          0x0054 0x02C4 0x0000 0x0 0x0
+#define MX7D_PAD_EPDC_DATA08__SIM1_PORT1_TRXD                     0x0054 0x02C4 0x06E4 0x1 0x0
+#define MX7D_PAD_EPDC_DATA08__QSPI_B_DATA0                        0x0054 0x02C4 0x0000 0x2 0x0
+#define MX7D_PAD_EPDC_DATA08__UART6_DCE_RX                        0x0054 0x02C4 0x071C 0x3 0x0
+#define MX7D_PAD_EPDC_DATA08__UART6_DTE_TX                        0x0054 0x02C4 0x0000 0x3 0x0
+#define MX7D_PAD_EPDC_DATA08__EIM_OE                              0x0054 0x02C4 0x0000 0x4 0x0
+#define MX7D_PAD_EPDC_DATA08__GPIO2_IO8                           0x0054 0x02C4 0x0000 0x5 0x0
+#define MX7D_PAD_EPDC_DATA08__LCD_DATA8                           0x0054 0x02C4 0x0658 0x6 0x0
+#define MX7D_PAD_EPDC_DATA08__LCD_BUSY                            0x0054 0x02C4 0x0634 0x7 0x0
+#define MX7D_PAD_EPDC_DATA08__EPDC_SDCLK                          0x0054 0x02C4 0x0000 0x8 0x0
+#define MX7D_PAD_EPDC_DATA09__EPDC_DATA9                          0x0058 0x02C8 0x0000 0x0 0x0
+#define MX7D_PAD_EPDC_DATA09__SIM1_PORT1_CLK                      0x0058 0x02C8 0x0000 0x1 0x0
+#define MX7D_PAD_EPDC_DATA09__QSPI_B_DATA1                        0x0058 0x02C8 0x0000 0x2 0x0
+#define MX7D_PAD_EPDC_DATA09__UART6_DCE_TX                        0x0058 0x02C8 0x0000 0x3 0x0
+#define MX7D_PAD_EPDC_DATA09__UART6_DTE_RX                        0x0058 0x02C8 0x071C 0x3 0x1
+#define MX7D_PAD_EPDC_DATA09__EIM_RW                              0x0058 0x02C8 0x0000 0x4 0x0
+#define MX7D_PAD_EPDC_DATA09__GPIO2_IO9                           0x0058 0x02C8 0x0000 0x5 0x0
+#define MX7D_PAD_EPDC_DATA09__LCD_DATA9                           0x0058 0x02C8 0x065C 0x6 0x0
+#define MX7D_PAD_EPDC_DATA09__LCD_DATA0                           0x0058 0x02C8 0x0638 0x7 0x1
+#define MX7D_PAD_EPDC_DATA09__EPDC_SDLE                           0x0058 0x02C8 0x0000 0x8 0x0
+#define MX7D_PAD_EPDC_DATA10__EPDC_DATA10                         0x005C 0x02CC 0x0000 0x0 0x0
+#define MX7D_PAD_EPDC_DATA10__SIM1_PORT1_RST_B                    0x005C 0x02CC 0x0000 0x1 0x0
+#define MX7D_PAD_EPDC_DATA10__QSPI_B_DATA2                        0x005C 0x02CC 0x0000 0x2 0x0
+#define MX7D_PAD_EPDC_DATA10__UART6_DCE_RTS                       0x005C 0x02CC 0x0718 0x3 0x0
+#define MX7D_PAD_EPDC_DATA10__UART6_DTE_CTS                       0x005C 0x02CC 0x0000 0x3 0x0
+#define MX7D_PAD_EPDC_DATA10__EIM_CS0_B                           0x005C 0x02CC 0x0000 0x4 0x0
+#define MX7D_PAD_EPDC_DATA10__GPIO2_IO10                          0x005C 0x02CC 0x0000 0x5 0x0
+#define MX7D_PAD_EPDC_DATA10__LCD_DATA10                          0x005C 0x02CC 0x0660 0x6 0x0
+#define MX7D_PAD_EPDC_DATA10__LCD_DATA9                           0x005C 0x02CC 0x065C 0x7 0x1
+#define MX7D_PAD_EPDC_DATA10__EPDC_SDOE                           0x005C 0x02CC 0x0000 0x8 0x0
+#define MX7D_PAD_EPDC_DATA11__EPDC_DATA11                         0x0060 0x02D0 0x0000 0x0 0x0
+#define MX7D_PAD_EPDC_DATA11__SIM1_PORT1_SVEN                     0x0060 0x02D0 0x0000 0x1 0x0
+#define MX7D_PAD_EPDC_DATA11__QSPI_B_DATA3                        0x0060 0x02D0 0x0000 0x2 0x0
+#define MX7D_PAD_EPDC_DATA11__UART6_DCE_CTS                       0x0060 0x02D0 0x0000 0x3 0x0
+#define MX7D_PAD_EPDC_DATA11__UART6_DTE_RTS                       0x0060 0x02D0 0x0718 0x3 0x1
+#define MX7D_PAD_EPDC_DATA11__EIM_BCLK                            0x0060 0x02D0 0x0000 0x4 0x0
+#define MX7D_PAD_EPDC_DATA11__GPIO2_IO11                          0x0060 0x02D0 0x0000 0x5 0x0
+#define MX7D_PAD_EPDC_DATA11__LCD_DATA11                          0x0060 0x02D0 0x0664 0x6 0x0
+#define MX7D_PAD_EPDC_DATA11__LCD_DATA1                           0x0060 0x02D0 0x063C 0x7 0x1
+#define MX7D_PAD_EPDC_DATA11__EPDC_SDCE0                          0x0060 0x02D0 0x0000 0x8 0x0
+#define MX7D_PAD_EPDC_DATA12__EPDC_DATA12                         0x0064 0x02D4 0x0000 0x0 0x0
+#define MX7D_PAD_EPDC_DATA12__SIM1_PORT1_PD                       0x0064 0x02D4 0x06E0 0x1 0x0
+#define MX7D_PAD_EPDC_DATA12__QSPI_B_DQS                          0x0064 0x02D4 0x0000 0x2 0x0
+#define MX7D_PAD_EPDC_DATA12__UART7_DCE_RX                        0x0064 0x02D4 0x0724 0x3 0x0
+#define MX7D_PAD_EPDC_DATA12__UART7_DTE_TX                        0x0064 0x02D4 0x0000 0x3 0x0
+#define MX7D_PAD_EPDC_DATA12__EIM_LBA_B                           0x0064 0x02D4 0x0000 0x4 0x0
+#define MX7D_PAD_EPDC_DATA12__GPIO2_IO12                          0x0064 0x02D4 0x0000 0x5 0x0
+#define MX7D_PAD_EPDC_DATA12__LCD_DATA12                          0x0064 0x02D4 0x0668 0x6 0x0
+#define MX7D_PAD_EPDC_DATA12__LCD_DATA21                          0x0064 0x02D4 0x068C 0x7 0x0
+#define MX7D_PAD_EPDC_DATA12__EPDC_GDCLK                          0x0064 0x02D4 0x0000 0x8 0x0
+#define MX7D_PAD_EPDC_DATA13__EPDC_DATA13                         0x0068 0x02D8 0x0000 0x0 0x0
+#define MX7D_PAD_EPDC_DATA13__SIM2_PORT1_TRXD                     0x0068 0x02D8 0x06EC 0x1 0x0
+#define MX7D_PAD_EPDC_DATA13__QSPI_B_SCLK                         0x0068 0x02D8 0x0000 0x2 0x0
+#define MX7D_PAD_EPDC_DATA13__UART7_DCE_TX                        0x0068 0x02D8 0x0000 0x3 0x0
+#define MX7D_PAD_EPDC_DATA13__UART7_DTE_RX                        0x0068 0x02D8 0x0724 0x3 0x1
+#define MX7D_PAD_EPDC_DATA13__EIM_WAIT                            0x0068 0x02D8 0x0000 0x4 0x0
+#define MX7D_PAD_EPDC_DATA13__GPIO2_IO13                          0x0068 0x02D8 0x0000 0x5 0x0
+#define MX7D_PAD_EPDC_DATA13__LCD_DATA13                          0x0068 0x02D8 0x066C 0x6 0x0
+#define MX7D_PAD_EPDC_DATA13__LCD_CS                              0x0068 0x02D8 0x0000 0x7 0x0
+#define MX7D_PAD_EPDC_DATA13__EPDC_GDOE                           0x0068 0x02D8 0x0000 0x8 0x0
+#define MX7D_PAD_EPDC_DATA14__EPDC_DATA14                         0x006C 0x02DC 0x0000 0x0 0x0
+#define MX7D_PAD_EPDC_DATA14__SIM2_PORT1_CLK                      0x006C 0x02DC 0x0000 0x1 0x0
+#define MX7D_PAD_EPDC_DATA14__QSPI_B_SS0_B                        0x006C 0x02DC 0x0000 0x2 0x0
+#define MX7D_PAD_EPDC_DATA14__UART7_DCE_RTS                       0x006C 0x02DC 0x0720 0x3 0x0
+#define MX7D_PAD_EPDC_DATA14__UART7_DTE_CTS                       0x006C 0x02DC 0x0000 0x3 0x0
+#define MX7D_PAD_EPDC_DATA14__EIM_EB_B0                           0x006C 0x02DC 0x0000 0x4 0x0
+#define MX7D_PAD_EPDC_DATA14__GPIO2_IO14                          0x006C 0x02DC 0x0000 0x5 0x0
+#define MX7D_PAD_EPDC_DATA14__LCD_DATA14                          0x006C 0x02DC 0x0670 0x6 0x0
+#define MX7D_PAD_EPDC_DATA14__LCD_DATA22                          0x006C 0x02DC 0x0690 0x7 0x0
+#define MX7D_PAD_EPDC_DATA14__EPDC_GDSP                           0x006C 0x02DC 0x0000 0x8 0x0
+#define MX7D_PAD_EPDC_DATA15__EPDC_DATA15                         0x0070 0x02E0 0x0000 0x0 0x0
+#define MX7D_PAD_EPDC_DATA15__SIM2_PORT1_RST_B                    0x0070 0x02E0 0x0000 0x1 0x0
+#define MX7D_PAD_EPDC_DATA15__QSPI_B_SS1_B                        0x0070 0x02E0 0x0000 0x2 0x0
+#define MX7D_PAD_EPDC_DATA15__UART7_DCE_CTS                       0x0070 0x02E0 0x0000 0x3 0x0
+#define MX7D_PAD_EPDC_DATA15__UART7_DTE_RTS                       0x0070 0x02E0 0x0720 0x3 0x1
+#define MX7D_PAD_EPDC_DATA15__EIM_CS1_B                           0x0070 0x02E0 0x0000 0x4 0x0
+#define MX7D_PAD_EPDC_DATA15__GPIO2_IO15                          0x0070 0x02E0 0x0000 0x5 0x0
+#define MX7D_PAD_EPDC_DATA15__LCD_DATA15                          0x0070 0x02E0 0x0674 0x6 0x0
+#define MX7D_PAD_EPDC_DATA15__LCD_WR_RWN                          0x0070 0x02E0 0x0000 0x7 0x0
+#define MX7D_PAD_EPDC_DATA15__EPDC_PWR_COM                        0x0070 0x02E0 0x0000 0x8 0x0
+#define MX7D_PAD_EPDC_SDCLK__EPDC_SDCLK                           0x0074 0x02E4 0x0000 0x0 0x0
+#define MX7D_PAD_EPDC_SDCLK__SIM2_PORT2_SVEN                      0x0074 0x02E4 0x0000 0x1 0x0
+#define MX7D_PAD_EPDC_SDCLK__ENET2_RGMII_RD0                      0x0074 0x02E4 0x0000 0x2 0x0
+#define MX7D_PAD_EPDC_SDCLK__KPP_ROW4                             0x0074 0x02E4 0x0624 0x3 0x0
+#define MX7D_PAD_EPDC_SDCLK__EIM_AD10                             0x0074 0x02E4 0x0000 0x4 0x0
+#define MX7D_PAD_EPDC_SDCLK__GPIO2_IO16                           0x0074 0x02E4 0x0000 0x5 0x0
+#define MX7D_PAD_EPDC_SDCLK__LCD_CLK                              0x0074 0x02E4 0x0000 0x6 0x0
+#define MX7D_PAD_EPDC_SDCLK__LCD_DATA20                           0x0074 0x02E4 0x0688 0x7 0x0
+#define MX7D_PAD_EPDC_SDLE__EPDC_SDLE                             0x0078 0x02E8 0x0000 0x0 0x0
+#define MX7D_PAD_EPDC_SDLE__SIM2_PORT2_PD                         0x0078 0x02E8 0x0000 0x1 0x0
+#define MX7D_PAD_EPDC_SDLE__ENET2_RGMII_RD1                       0x0078 0x02E8 0x0000 0x2 0x0
+#define MX7D_PAD_EPDC_SDLE__KPP_COL4                              0x0078 0x02E8 0x0604 0x3 0x0
+#define MX7D_PAD_EPDC_SDLE__EIM_AD11                              0x0078 0x02E8 0x0000 0x4 0x0
+#define MX7D_PAD_EPDC_SDLE__GPIO2_IO17                            0x0078 0x02E8 0x0000 0x5 0x0
+#define MX7D_PAD_EPDC_SDLE__LCD_DATA16                            0x0078 0x02E8 0x0678 0x6 0x0
+#define MX7D_PAD_EPDC_SDLE__LCD_DATA8                             0x0078 0x02E8 0x0658 0x7 0x1
+#define MX7D_PAD_EPDC_SDOE__EPDC_SDOE                             0x007C 0x02EC 0x0000 0x0 0x0
+#define MX7D_PAD_EPDC_SDOE__FLEXTIMER1_CH0                        0x007C 0x02EC 0x0584 0x1 0x0
+#define MX7D_PAD_EPDC_SDOE__ENET2_RGMII_RD2                       0x007C 0x02EC 0x0000 0x2 0x0
+#define MX7D_PAD_EPDC_SDOE__KPP_COL5                              0x007C 0x02EC 0x0608 0x3 0x1
+#define MX7D_PAD_EPDC_SDOE__EIM_AD12                              0x007C 0x02EC 0x0000 0x4 0x0
+#define MX7D_PAD_EPDC_SDOE__GPIO2_IO18                            0x007C 0x02EC 0x0000 0x5 0x0
+#define MX7D_PAD_EPDC_SDOE__LCD_DATA17                            0x007C 0x02EC 0x067C 0x6 0x0
+#define MX7D_PAD_EPDC_SDOE__LCD_DATA23                            0x007C 0x02EC 0x0694 0x7 0x0
+#define MX7D_PAD_EPDC_SDSHR__EPDC_SDSHR                           0x0080 0x02F0 0x0000 0x0 0x0
+#define MX7D_PAD_EPDC_SDSHR__FLEXTIMER1_CH1                       0x0080 0x02F0 0x0588 0x1 0x0
+#define MX7D_PAD_EPDC_SDSHR__ENET2_RGMII_RD3                      0x0080 0x02F0 0x0000 0x2 0x0
+#define MX7D_PAD_EPDC_SDSHR__KPP_ROW5                             0x0080 0x02F0 0x0628 0x3 0x1
+#define MX7D_PAD_EPDC_SDSHR__EIM_AD13                             0x0080 0x02F0 0x0000 0x4 0x0
+#define MX7D_PAD_EPDC_SDSHR__GPIO2_IO19                           0x0080 0x02F0 0x0000 0x5 0x0
+#define MX7D_PAD_EPDC_SDSHR__LCD_DATA18                           0x0080 0x02F0 0x0680 0x6 0x0
+#define MX7D_PAD_EPDC_SDSHR__LCD_DATA10                           0x0080 0x02F0 0x0660 0x7 0x1
+#define MX7D_PAD_EPDC_SDCE0__EPDC_SDCE0                           0x0084 0x02F4 0x0000 0x0 0x0
+#define MX7D_PAD_EPDC_SDCE0__FLEXTIMER1_CH2                       0x0084 0x02F4 0x058C 0x1 0x0
+#define MX7D_PAD_EPDC_SDCE0__ENET2_RGMII_RX_CTL                   0x0084 0x02F4 0x0000 0x2 0x0
+#define MX7D_PAD_EPDC_SDCE0__EIM_AD14                             0x0084 0x02F4 0x0000 0x4 0x0
+#define MX7D_PAD_EPDC_SDCE0__GPIO2_IO20                           0x0084 0x02F4 0x0000 0x5 0x0
+#define MX7D_PAD_EPDC_SDCE0__LCD_DATA19                           0x0084 0x02F4 0x0684 0x6 0x0
+#define MX7D_PAD_EPDC_SDCE0__LCD_DATA5                            0x0084 0x02F4 0x064C 0x7 0x1
+#define MX7D_PAD_EPDC_SDCE1__EPDC_SDCE1                           0x0088 0x02F8 0x0000 0x0 0x0
+#define MX7D_PAD_EPDC_SDCE1__FLEXTIMER1_CH3                       0x0088 0x02F8 0x0590 0x1 0x0
+#define MX7D_PAD_EPDC_SDCE1__ENET2_RGMII_RXC                      0x0088 0x02F8 0x0578 0x2 0x0
+#define MX7D_PAD_EPDC_SDCE1__ENET2_RX_ER                          0x0088 0x02F8 0x0000 0x3 0x0
+#define MX7D_PAD_EPDC_SDCE1__EIM_AD15                             0x0088 0x02F8 0x0000 0x4 0x0
+#define MX7D_PAD_EPDC_SDCE1__GPIO2_IO21                           0x0088 0x02F8 0x0000 0x5 0x0
+#define MX7D_PAD_EPDC_SDCE1__LCD_DATA20                           0x0088 0x02F8 0x0688 0x6 0x1
+#define MX7D_PAD_EPDC_SDCE1__LCD_DATA4                            0x0088 0x02F8 0x0648 0x7 0x1
+#define MX7D_PAD_EPDC_SDCE2__EPDC_SDCE2                           0x008C 0x02FC 0x0000 0x0 0x0
+#define MX7D_PAD_EPDC_SDCE2__SIM2_PORT1_SVEN                      0x008C 0x02FC 0x0000 0x1 0x0
+#define MX7D_PAD_EPDC_SDCE2__ENET2_RGMII_TD0                      0x008C 0x02FC 0x0000 0x2 0x0
+#define MX7D_PAD_EPDC_SDCE2__KPP_COL6                             0x008C 0x02FC 0x060C 0x3 0x1
+#define MX7D_PAD_EPDC_SDCE2__EIM_ADDR16                           0x008C 0x02FC 0x0000 0x4 0x0
+#define MX7D_PAD_EPDC_SDCE2__GPIO2_IO22                           0x008C 0x02FC 0x0000 0x5 0x0
+#define MX7D_PAD_EPDC_SDCE2__LCD_DATA21                           0x008C 0x02FC 0x068C 0x6 0x1
+#define MX7D_PAD_EPDC_SDCE2__LCD_DATA3                            0x008C 0x02FC 0x0644 0x7 0x1
+#define MX7D_PAD_EPDC_SDCE3__EPDC_SDCE3                           0x0090 0x0300 0x0000 0x0 0x0
+#define MX7D_PAD_EPDC_SDCE3__SIM2_PORT1_PD                        0x0090 0x0300 0x06E8 0x1 0x0
+#define MX7D_PAD_EPDC_SDCE3__ENET2_RGMII_TD1                      0x0090 0x0300 0x0000 0x2 0x0
+#define MX7D_PAD_EPDC_SDCE3__KPP_ROW6                             0x0090 0x0300 0x062C 0x3 0x1
+#define MX7D_PAD_EPDC_SDCE3__EIM_ADDR17                           0x0090 0x0300 0x0000 0x4 0x0
+#define MX7D_PAD_EPDC_SDCE3__GPIO2_IO23                           0x0090 0x0300 0x0000 0x5 0x0
+#define MX7D_PAD_EPDC_SDCE3__LCD_DATA22                           0x0090 0x0300 0x0690 0x6 0x1
+#define MX7D_PAD_EPDC_SDCE3__LCD_DATA2                            0x0090 0x0300 0x0640 0x7 0x1
+#define MX7D_PAD_EPDC_GDCLK__EPDC_GDCLK                           0x0094 0x0304 0x0000 0x0 0x0
+#define MX7D_PAD_EPDC_GDCLK__FLEXTIMER2_CH0                       0x0094 0x0304 0x05AC 0x1 0x0
+#define MX7D_PAD_EPDC_GDCLK__ENET2_RGMII_TD2                      0x0094 0x0304 0x0000 0x2 0x0
+#define MX7D_PAD_EPDC_GDCLK__KPP_COL7                             0x0094 0x0304 0x0610 0x3 0x0
+#define MX7D_PAD_EPDC_GDCLK__EIM_ADDR18                           0x0094 0x0304 0x0000 0x4 0x0
+#define MX7D_PAD_EPDC_GDCLK__GPIO2_IO24                           0x0094 0x0304 0x0000 0x5 0x0
+#define MX7D_PAD_EPDC_GDCLK__LCD_DATA23                           0x0094 0x0304 0x0694 0x6 0x1
+#define MX7D_PAD_EPDC_GDCLK__LCD_DATA16                           0x0094 0x0304 0x0678 0x7 0x1
+#define MX7D_PAD_EPDC_GDOE__EPDC_GDOE                             0x0098 0x0308 0x0000 0x0 0x0
+#define MX7D_PAD_EPDC_GDOE__FLEXTIMER2_CH1                        0x0098 0x0308 0x05B0 0x1 0x0
+#define MX7D_PAD_EPDC_GDOE__ENET2_RGMII_TD3                       0x0098 0x0308 0x0000 0x2 0x0
+#define MX7D_PAD_EPDC_GDOE__KPP_ROW7                              0x0098 0x0308 0x0630 0x3 0x0
+#define MX7D_PAD_EPDC_GDOE__EIM_ADDR19                            0x0098 0x0308 0x0000 0x4 0x0
+#define MX7D_PAD_EPDC_GDOE__GPIO2_IO25                            0x0098 0x0308 0x0000 0x5 0x0
+#define MX7D_PAD_EPDC_GDOE__LCD_WR_RWN                            0x0098 0x0308 0x0000 0x6 0x0
+#define MX7D_PAD_EPDC_GDOE__LCD_DATA18                            0x0098 0x0308 0x0680 0x7 0x1
+#define MX7D_PAD_EPDC_GDRL__EPDC_GDRL                             0x009C 0x030C 0x0000 0x0 0x0
+#define MX7D_PAD_EPDC_GDRL__FLEXTIMER2_CH2                        0x009C 0x030C 0x05B4 0x1 0x0
+#define MX7D_PAD_EPDC_GDRL__ENET2_RGMII_TX_CTL                    0x009C 0x030C 0x0000 0x2 0x0
+#define MX7D_PAD_EPDC_GDRL__EIM_ADDR20                            0x009C 0x030C 0x0000 0x4 0x0
+#define MX7D_PAD_EPDC_GDRL__GPIO2_IO26                            0x009C 0x030C 0x0000 0x5 0x0
+#define MX7D_PAD_EPDC_GDRL__LCD_RD_E                              0x009C 0x030C 0x0000 0x6 0x0
+#define MX7D_PAD_EPDC_GDRL__LCD_DATA19                            0x009C 0x030C 0x0684 0x7 0x1
+#define MX7D_PAD_EPDC_GDSP__EPDC_GDSP                             0x00A0 0x0310 0x0000 0x0 0x0
+#define MX7D_PAD_EPDC_GDSP__FLEXTIMER2_CH3                        0x00A0 0x0310 0x05B8 0x1 0x0
+#define MX7D_PAD_EPDC_GDSP__ENET2_RGMII_TXC                       0x00A0 0x0310 0x0000 0x2 0x0
+#define MX7D_PAD_EPDC_GDSP__ENET2_TX_ER                           0x00A0 0x0310 0x0000 0x3 0x0
+#define MX7D_PAD_EPDC_GDSP__EIM_ADDR21                            0x00A0 0x0310 0x0000 0x4 0x0
+#define MX7D_PAD_EPDC_GDSP__GPIO2_IO27                            0x00A0 0x0310 0x0000 0x5 0x0
+#define MX7D_PAD_EPDC_GDSP__LCD_BUSY                              0x00A0 0x0310 0x0634 0x6 0x1
+#define MX7D_PAD_EPDC_GDSP__LCD_DATA17                            0x00A0 0x0310 0x067C 0x7 0x1
+#define MX7D_PAD_EPDC_BDR0__EPDC_BDR0                             0x00A4 0x0314 0x0000 0x0 0x0
+#define MX7D_PAD_EPDC_BDR0__ENET2_TX_CLK                          0x00A4 0x0314 0x0000 0x2 0x0
+#define MX7D_PAD_EPDC_BDR0__CCM_ENET_REF_CLK2                     0x00A4 0x0314 0x0570 0x3 0x1
+#define MX7D_PAD_EPDC_BDR0__EIM_ADDR22                            0x00A4 0x0314 0x0000 0x4 0x0
+#define MX7D_PAD_EPDC_BDR0__GPIO2_IO28                            0x00A4 0x0314 0x0000 0x5 0x0
+#define MX7D_PAD_EPDC_BDR0__LCD_CS                                0x00A4 0x0314 0x0000 0x6 0x0
+#define MX7D_PAD_EPDC_BDR0__LCD_DATA7                             0x00A4 0x0314 0x0654 0x7 0x1
+#define MX7D_PAD_EPDC_BDR1__EPDC_BDR1                             0x00A8 0x0318 0x0000 0x0 0x0
+#define MX7D_PAD_EPDC_BDR1__EPDC_SDCLKN                           0x00A8 0x0318 0x0000 0x1 0x0
+#define MX7D_PAD_EPDC_BDR1__ENET2_RX_CLK                          0x00A8 0x0318 0x0578 0x2 0x1
+#define MX7D_PAD_EPDC_BDR1__EIM_AD8                               0x00A8 0x0318 0x0000 0x4 0x0
+#define MX7D_PAD_EPDC_BDR1__GPIO2_IO29                            0x00A8 0x0318 0x0000 0x5 0x0
+#define MX7D_PAD_EPDC_BDR1__LCD_ENABLE                            0x00A8 0x0318 0x0000 0x6 0x0
+#define MX7D_PAD_EPDC_BDR1__LCD_DATA6                             0x00A8 0x0318 0x0650 0x7 0x1
+#define MX7D_PAD_EPDC_PWR_COM__EPDC_PWR_COM                       0x00AC 0x031C 0x0000 0x0 0x0
+#define MX7D_PAD_EPDC_PWR_COM__FLEXTIMER2_PHA                     0x00AC 0x031C 0x05CC 0x1 0x0
+#define MX7D_PAD_EPDC_PWR_COM__ENET2_CRS                          0x00AC 0x031C 0x0000 0x2 0x0
+#define MX7D_PAD_EPDC_PWR_COM__EIM_AD9                            0x00AC 0x031C 0x0000 0x4 0x0
+#define MX7D_PAD_EPDC_PWR_COM__GPIO2_IO30                         0x00AC 0x031C 0x0000 0x5 0x0
+#define MX7D_PAD_EPDC_PWR_COM__LCD_HSYNC                          0x00AC 0x031C 0x0000 0x6 0x0
+#define MX7D_PAD_EPDC_PWR_COM__LCD_DATA11                         0x00AC 0x031C 0x0664 0x7 0x1
+#define MX7D_PAD_EPDC_PWR_STAT__EPDC_PWR_STAT                     0x00B0 0x0320 0x0580 0x0 0x0
+#define MX7D_PAD_EPDC_PWR_STAT__FLEXTIMER2_PHB                    0x00B0 0x0320 0x05D0 0x1 0x0
+#define MX7D_PAD_EPDC_PWR_STAT__ENET2_COL                         0x00B0 0x0320 0x0000 0x2 0x0
+#define MX7D_PAD_EPDC_PWR_STAT__EIM_EB_B1                         0x00B0 0x0320 0x0000 0x4 0x0
+#define MX7D_PAD_EPDC_PWR_STAT__GPIO2_IO31                        0x00B0 0x0320 0x0000 0x5 0x0
+#define MX7D_PAD_EPDC_PWR_STAT__LCD_VSYNC                         0x00B0 0x0320 0x0698 0x6 0x1
+#define MX7D_PAD_EPDC_PWR_STAT__LCD_DATA12                        0x00B0 0x0320 0x0668 0x7 0x1
+#define MX7D_PAD_LCD_CLK__LCD_CLK                                 0x00B4 0x0324 0x0000 0x0 0x0
+#define MX7D_PAD_LCD_CLK__ECSPI4_MISO                             0x00B4 0x0324 0x0558 0x1 0x0
+#define MX7D_PAD_LCD_CLK__ENET1_1588_EVENT2_IN                    0x00B4 0x0324 0x0000 0x2 0x0
+#define MX7D_PAD_LCD_CLK__CSI_DATA16                              0x00B4 0x0324 0x0000 0x3 0x0
+#define MX7D_PAD_LCD_CLK__UART2_DCE_RX                            0x00B4 0x0324 0x06FC 0x4 0x0
+#define MX7D_PAD_LCD_CLK__UART2_DTE_TX                            0x00B4 0x0324 0x0000 0x4 0x0
+#define MX7D_PAD_LCD_CLK__GPIO3_IO0                               0x00B4 0x0324 0x0000 0x5 0x0
+#define MX7D_PAD_LCD_ENABLE__LCD_ENABLE                           0x00B8 0x0328 0x0000 0x0 0x0
+#define MX7D_PAD_LCD_ENABLE__ECSPI4_MOSI                          0x00B8 0x0328 0x055C 0x1 0x0
+#define MX7D_PAD_LCD_ENABLE__ENET1_1588_EVENT3_IN                 0x00B8 0x0328 0x0000 0x2 0x0
+#define MX7D_PAD_LCD_ENABLE__CSI_DATA17                           0x00B8 0x0328 0x0000 0x3 0x0
+#define MX7D_PAD_LCD_ENABLE__UART2_DCE_TX                         0x00B8 0x0328 0x0000 0x4 0x0
+#define MX7D_PAD_LCD_ENABLE__UART2_DTE_RX                         0x00B8 0x0328 0x06FC 0x4 0x1
+#define MX7D_PAD_LCD_ENABLE__GPIO3_IO1                            0x00B8 0x0328 0x0000 0x5 0x0
+#define MX7D_PAD_LCD_HSYNC__LCD_HSYNC                             0x00BC 0x032C 0x0000 0x0 0x0
+#define MX7D_PAD_LCD_HSYNC__ECSPI4_SCLK                           0x00BC 0x032C 0x0554 0x1 0x0
+#define MX7D_PAD_LCD_HSYNC__ENET2_1588_EVENT2_IN                  0x00BC 0x032C 0x0000 0x2 0x0
+#define MX7D_PAD_LCD_HSYNC__CSI_DATA18                            0x00BC 0x032C 0x0000 0x3 0x0
+#define MX7D_PAD_LCD_HSYNC__UART2_DCE_RTS                         0x00BC 0x032C 0x06F8 0x4 0x0
+#define MX7D_PAD_LCD_HSYNC__UART2_DTE_CTS                         0x00BC 0x032C 0x0000 0x4 0x0
+#define MX7D_PAD_LCD_HSYNC__GPIO3_IO2                             0x00BC 0x032C 0x0000 0x5 0x0
+#define MX7D_PAD_LCD_VSYNC__LCD_VSYNC                             0x00C0 0x0330 0x0698 0x0 0x2
+#define MX7D_PAD_LCD_VSYNC__ECSPI4_SS0                            0x00C0 0x0330 0x0560 0x1 0x0
+#define MX7D_PAD_LCD_VSYNC__ENET2_1588_EVENT3_IN                  0x00C0 0x0330 0x0000 0x2 0x0
+#define MX7D_PAD_LCD_VSYNC__CSI_DATA19                            0x00C0 0x0330 0x0000 0x3 0x0
+#define MX7D_PAD_LCD_VSYNC__UART2_DCE_CTS                         0x00C0 0x0330 0x0000 0x4 0x0
+#define MX7D_PAD_LCD_VSYNC__UART2_DTE_RTS                         0x00C0 0x0330 0x06F8 0x4 0x1
+#define MX7D_PAD_LCD_VSYNC__GPIO3_IO3                             0x00C0 0x0330 0x0000 0x5 0x0
+#define MX7D_PAD_LCD_RESET__LCD_RESET                             0x00C4 0x0334 0x0000 0x0 0x0
+#define MX7D_PAD_LCD_RESET__GPT1_COMPARE1                         0x00C4 0x0334 0x0000 0x1 0x0
+#define MX7D_PAD_LCD_RESET__ARM_PLATFORM_EVENTI                   0x00C4 0x0334 0x0000 0x2 0x0
+#define MX7D_PAD_LCD_RESET__CSI_FIELD                             0x00C4 0x0334 0x0000 0x3 0x0
+#define MX7D_PAD_LCD_RESET__EIM_DTACK_B                           0x00C4 0x0334 0x0000 0x4 0x0
+#define MX7D_PAD_LCD_RESET__GPIO3_IO4                             0x00C4 0x0334 0x0000 0x5 0x0
+#define MX7D_PAD_LCD_DATA00__LCD_DATA0                            0x00C8 0x0338 0x0638 0x0 0x2
+#define MX7D_PAD_LCD_DATA00__GPT1_COMPARE2                        0x00C8 0x0338 0x0000 0x1 0x0
+#define MX7D_PAD_LCD_DATA00__CSI_DATA20                           0x00C8 0x0338 0x0000 0x3 0x0
+#define MX7D_PAD_LCD_DATA00__EIM_DATA0                            0x00C8 0x0338 0x0000 0x4 0x0
+#define MX7D_PAD_LCD_DATA00__GPIO3_IO5                            0x00C8 0x0338 0x0000 0x5 0x0
+#define MX7D_PAD_LCD_DATA00__SRC_BOOT_CFG0                        0x00C8 0x0338 0x0000 0x6 0x0
+#define MX7D_PAD_LCD_DATA01__LCD_DATA1                            0x00CC 0x033C 0x063C 0x0 0x2
+#define MX7D_PAD_LCD_DATA01__GPT1_COMPARE3                        0x00CC 0x033C 0x0000 0x1 0x0
+#define MX7D_PAD_LCD_DATA01__CSI_DATA21                           0x00CC 0x033C 0x0000 0x3 0x0
+#define MX7D_PAD_LCD_DATA01__EIM_DATA1                            0x00CC 0x033C 0x0000 0x4 0x0
+#define MX7D_PAD_LCD_DATA01__GPIO3_IO6                            0x00CC 0x033C 0x0000 0x5 0x0
+#define MX7D_PAD_LCD_DATA01__SRC_BOOT_CFG1                        0x00CC 0x033C 0x0000 0x6 0x0
+#define MX7D_PAD_LCD_DATA02__LCD_DATA2                            0x00D0 0x0340 0x0640 0x0 0x2
+#define MX7D_PAD_LCD_DATA02__GPT1_CLK                             0x00D0 0x0340 0x0000 0x1 0x0
+#define MX7D_PAD_LCD_DATA02__CSI_DATA22                           0x00D0 0x0340 0x0000 0x3 0x0
+#define MX7D_PAD_LCD_DATA02__EIM_DATA2                            0x00D0 0x0340 0x0000 0x4 0x0
+#define MX7D_PAD_LCD_DATA02__GPIO3_IO7                            0x00D0 0x0340 0x0000 0x5 0x0
+#define MX7D_PAD_LCD_DATA02__SRC_BOOT_CFG2                        0x00D0 0x0340 0x0000 0x6 0x0
+#define MX7D_PAD_LCD_DATA03__LCD_DATA3                            0x00D4 0x0344 0x0644 0x0 0x2
+#define MX7D_PAD_LCD_DATA03__GPT1_CAPTURE1                        0x00D4 0x0344 0x0000 0x1 0x0
+#define MX7D_PAD_LCD_DATA03__CSI_DATA23                           0x00D4 0x0344 0x0000 0x3 0x0
+#define MX7D_PAD_LCD_DATA03__EIM_DATA3                            0x00D4 0x0344 0x0000 0x4 0x0
+#define MX7D_PAD_LCD_DATA03__GPIO3_IO8                            0x00D4 0x0344 0x0000 0x5 0x0
+#define MX7D_PAD_LCD_DATA03__SRC_BOOT_CFG3                        0x00D4 0x0344 0x0000 0x6 0x0
+#define MX7D_PAD_LCD_DATA04__LCD_DATA4                            0x00D8 0x0348 0x0648 0x0 0x2
+#define MX7D_PAD_LCD_DATA04__GPT1_CAPTURE2                        0x00D8 0x0348 0x0000 0x1 0x0
+#define MX7D_PAD_LCD_DATA04__CSI_VSYNC                            0x00D8 0x0348 0x0520 0x3 0x0
+#define MX7D_PAD_LCD_DATA04__EIM_DATA4                            0x00D8 0x0348 0x0000 0x4 0x0
+#define MX7D_PAD_LCD_DATA04__GPIO3_IO9                            0x00D8 0x0348 0x0000 0x5 0x0
+#define MX7D_PAD_LCD_DATA04__SRC_BOOT_CFG4                        0x00D8 0x0348 0x0000 0x6 0x0
+#define MX7D_PAD_LCD_DATA05__LCD_DATA5                            0x00DC 0x034C 0x064C 0x0 0x2
+#define MX7D_PAD_LCD_DATA05__CSI_HSYNC                            0x00DC 0x034C 0x0518 0x3 0x0
+#define MX7D_PAD_LCD_DATA05__EIM_DATA5                            0x00DC 0x034C 0x0000 0x4 0x0
+#define MX7D_PAD_LCD_DATA05__GPIO3_IO10                           0x00DC 0x034C 0x0000 0x5 0x0
+#define MX7D_PAD_LCD_DATA05__SRC_BOOT_CFG5                        0x00DC 0x034C 0x0000 0x6 0x0
+#define MX7D_PAD_LCD_DATA06__LCD_DATA6                            0x00E0 0x0350 0x0650 0x0 0x2
+#define MX7D_PAD_LCD_DATA06__CSI_PIXCLK                           0x00E0 0x0350 0x051C 0x3 0x0
+#define MX7D_PAD_LCD_DATA06__EIM_DATA6                            0x00E0 0x0350 0x0000 0x4 0x0
+#define MX7D_PAD_LCD_DATA06__GPIO3_IO11                           0x00E0 0x0350 0x0000 0x5 0x0
+#define MX7D_PAD_LCD_DATA06__SRC_BOOT_CFG6                        0x00E0 0x0350 0x0000 0x6 0x0
+#define MX7D_PAD_LCD_DATA07__LCD_DATA7                            0x00E4 0x0354 0x0654 0x0 0x2
+#define MX7D_PAD_LCD_DATA07__CSI_MCLK                             0x00E4 0x0354 0x0000 0x3 0x0
+#define MX7D_PAD_LCD_DATA07__EIM_DATA7                            0x00E4 0x0354 0x0000 0x4 0x0
+#define MX7D_PAD_LCD_DATA07__GPIO3_IO12                           0x00E4 0x0354 0x0000 0x5 0x0
+#define MX7D_PAD_LCD_DATA07__SRC_BOOT_CFG7                        0x00E4 0x0354 0x0000 0x6 0x0
+#define MX7D_PAD_LCD_DATA08__LCD_DATA8                            0x00E8 0x0358 0x0658 0x0 0x2
+#define MX7D_PAD_LCD_DATA08__CSI_DATA9                            0x00E8 0x0358 0x0514 0x3 0x0
+#define MX7D_PAD_LCD_DATA08__EIM_DATA8                            0x00E8 0x0358 0x0000 0x4 0x0
+#define MX7D_PAD_LCD_DATA08__GPIO3_IO13                           0x00E8 0x0358 0x0000 0x5 0x0
+#define MX7D_PAD_LCD_DATA08__SRC_BOOT_CFG8                        0x00E8 0x0358 0x0000 0x6 0x0
+#define MX7D_PAD_LCD_DATA09__LCD_DATA9                            0x00EC 0x035C 0x065C 0x0 0x2
+#define MX7D_PAD_LCD_DATA09__CSI_DATA8                            0x00EC 0x035C 0x0510 0x3 0x0
+#define MX7D_PAD_LCD_DATA09__EIM_DATA9                            0x00EC 0x035C 0x0000 0x4 0x0
+#define MX7D_PAD_LCD_DATA09__GPIO3_IO14                           0x00EC 0x035C 0x0000 0x5 0x0
+#define MX7D_PAD_LCD_DATA09__SRC_BOOT_CFG9                        0x00EC 0x035C 0x0000 0x6 0x0
+#define MX7D_PAD_LCD_DATA10__LCD_DATA10                           0x00F0 0x0360 0x0660 0x0 0x2
+#define MX7D_PAD_LCD_DATA10__CSI_DATA7                            0x00F0 0x0360 0x050C 0x3 0x0
+#define MX7D_PAD_LCD_DATA10__EIM_DATA10                           0x00F0 0x0360 0x0000 0x4 0x0
+#define MX7D_PAD_LCD_DATA10__GPIO3_IO15                           0x00F0 0x0360 0x0000 0x5 0x0
+#define MX7D_PAD_LCD_DATA10__SRC_BOOT_CFG10                       0x00F0 0x0360 0x0000 0x6 0x0
+#define MX7D_PAD_LCD_DATA11__LCD_DATA11                           0x00F4 0x0364 0x0664 0x0 0x2
+#define MX7D_PAD_LCD_DATA11__CSI_DATA6                            0x00F4 0x0364 0x0508 0x3 0x0
+#define MX7D_PAD_LCD_DATA11__EIM_DATA11                           0x00F4 0x0364 0x0000 0x4 0x0
+#define MX7D_PAD_LCD_DATA11__GPIO3_IO16                           0x00F4 0x0364 0x0000 0x5 0x0
+#define MX7D_PAD_LCD_DATA11__SRC_BOOT_CFG11                       0x00F4 0x0364 0x0000 0x6 0x0
+#define MX7D_PAD_LCD_DATA12__LCD_DATA12                           0x00F8 0x0368 0x0668 0x0 0x2
+#define MX7D_PAD_LCD_DATA12__CSI_DATA5                            0x00F8 0x0368 0x0504 0x3 0x0
+#define MX7D_PAD_LCD_DATA12__EIM_DATA12                           0x00F8 0x0368 0x0000 0x4 0x0
+#define MX7D_PAD_LCD_DATA12__GPIO3_IO17                           0x00F8 0x0368 0x0000 0x5 0x0
+#define MX7D_PAD_LCD_DATA12__SRC_BOOT_CFG12                       0x00F8 0x0368 0x0000 0x6 0x0
+#define MX7D_PAD_LCD_DATA13__LCD_DATA13                           0x00FC 0x036C 0x066C 0x0 0x1
+#define MX7D_PAD_LCD_DATA13__CSI_DATA4                            0x00FC 0x036C 0x0500 0x3 0x0
+#define MX7D_PAD_LCD_DATA13__EIM_DATA13                           0x00FC 0x036C 0x0000 0x4 0x0
+#define MX7D_PAD_LCD_DATA13__GPIO3_IO18                           0x00FC 0x036C 0x0000 0x5 0x0
+#define MX7D_PAD_LCD_DATA13__SRC_BOOT_CFG13                       0x00FC 0x036C 0x0000 0x6 0x0
+#define MX7D_PAD_LCD_DATA14__LCD_DATA14                           0x0100 0x0370 0x0670 0x0 0x1
+#define MX7D_PAD_LCD_DATA14__CSI_DATA3                            0x0100 0x0370 0x04FC 0x3 0x0
+#define MX7D_PAD_LCD_DATA14__EIM_DATA14                           0x0100 0x0370 0x0000 0x4 0x0
+#define MX7D_PAD_LCD_DATA14__GPIO3_IO19                           0x0100 0x0370 0x0000 0x5 0x0
+#define MX7D_PAD_LCD_DATA14__SRC_BOOT_CFG14                       0x0100 0x0370 0x0000 0x6 0x0
+#define MX7D_PAD_LCD_DATA15__LCD_DATA15                           0x0104 0x0374 0x0674 0x0 0x1
+#define MX7D_PAD_LCD_DATA15__CSI_DATA2                            0x0104 0x0374 0x04F8 0x3 0x0
+#define MX7D_PAD_LCD_DATA15__EIM_DATA15                           0x0104 0x0374 0x0000 0x4 0x0
+#define MX7D_PAD_LCD_DATA15__GPIO3_IO20                           0x0104 0x0374 0x0000 0x5 0x0
+#define MX7D_PAD_LCD_DATA15__SRC_BOOT_CFG15                       0x0104 0x0374 0x0000 0x6 0x0
+#define MX7D_PAD_LCD_DATA16__LCD_DATA16                           0x0108 0x0378 0x0678 0x0 0x2
+#define MX7D_PAD_LCD_DATA16__FLEXTIMER1_CH4                       0x0108 0x0378 0x0594 0x1 0x0
+#define MX7D_PAD_LCD_DATA16__CSI_DATA1                            0x0108 0x0378 0x0000 0x3 0x0
+#define MX7D_PAD_LCD_DATA16__EIM_CRE                              0x0108 0x0378 0x0000 0x4 0x0
+#define MX7D_PAD_LCD_DATA16__GPIO3_IO21                           0x0108 0x0378 0x0000 0x5 0x0
+#define MX7D_PAD_LCD_DATA16__SRC_BOOT_CFG16                       0x0108 0x0378 0x0000 0x6 0x0
+#define MX7D_PAD_LCD_DATA17__LCD_DATA17                           0x010C 0x037C 0x067C 0x0 0x2
+#define MX7D_PAD_LCD_DATA17__FLEXTIMER1_CH5                       0x010C 0x037C 0x0598 0x1 0x0
+#define MX7D_PAD_LCD_DATA17__CSI_DATA0                            0x010C 0x037C 0x0000 0x3 0x0
+#define MX7D_PAD_LCD_DATA17__EIM_ACLK_FREERUN                     0x010C 0x037C 0x0000 0x4 0x0
+#define MX7D_PAD_LCD_DATA17__GPIO3_IO22                           0x010C 0x037C 0x0000 0x5 0x0
+#define MX7D_PAD_LCD_DATA17__SRC_BOOT_CFG17                       0x010C 0x037C 0x0000 0x6 0x0
+#define MX7D_PAD_LCD_DATA18__LCD_DATA18                           0x0110 0x0380 0x0680 0x0 0x2
+#define MX7D_PAD_LCD_DATA18__FLEXTIMER1_CH6                       0x0110 0x0380 0x059C 0x1 0x0
+#define MX7D_PAD_LCD_DATA18__ARM_PLATFORM_EVENTO                  0x0110 0x0380 0x0000 0x2 0x0
+#define MX7D_PAD_LCD_DATA18__CSI_DATA15                           0x0110 0x0380 0x0000 0x3 0x0
+#define MX7D_PAD_LCD_DATA18__EIM_CS2_B                            0x0110 0x0380 0x0000 0x4 0x0
+#define MX7D_PAD_LCD_DATA18__GPIO3_IO23                           0x0110 0x0380 0x0000 0x5 0x0
+#define MX7D_PAD_LCD_DATA18__SRC_BOOT_CFG18                       0x0110 0x0380 0x0000 0x6 0x0
+#define MX7D_PAD_LCD_DATA19__EIM_CS3_B                            0x0114 0x0384 0x0000 0x4 0x0
+#define MX7D_PAD_LCD_DATA19__GPIO3_IO24                           0x0114 0x0384 0x0000 0x5 0x0
+#define MX7D_PAD_LCD_DATA19__SRC_BOOT_CFG19                       0x0114 0x0384 0x0000 0x6 0x0
+#define MX7D_PAD_LCD_DATA19__LCD_DATA19                           0x0114 0x0384 0x0684 0x0 0x2
+#define MX7D_PAD_LCD_DATA19__FLEXTIMER1_CH7                       0x0114 0x0384 0x05A0 0x1 0x0
+#define MX7D_PAD_LCD_DATA19__CSI_DATA14                           0x0114 0x0384 0x0000 0x3 0x0
+#define MX7D_PAD_LCD_DATA20__EIM_ADDR23                           0x0118 0x0388 0x0000 0x4 0x0
+#define MX7D_PAD_LCD_DATA20__GPIO3_IO25                           0x0118 0x0388 0x0000 0x5 0x0
+#define MX7D_PAD_LCD_DATA20__I2C3_SCL                             0x0118 0x0388 0x05E4 0x6 0x1
+#define MX7D_PAD_LCD_DATA20__LCD_DATA20                           0x0118 0x0388 0x0688 0x0 0x2
+#define MX7D_PAD_LCD_DATA20__FLEXTIMER2_CH4                       0x0118 0x0388 0x05BC 0x1 0x0
+#define MX7D_PAD_LCD_DATA20__ENET1_1588_EVENT2_OUT                0x0118 0x0388 0x0000 0x2 0x0
+#define MX7D_PAD_LCD_DATA20__CSI_DATA13                           0x0118 0x0388 0x0000 0x3 0x0
+#define MX7D_PAD_LCD_DATA21__LCD_DATA21                           0x011C 0x038C 0x068C 0x0 0x2
+#define MX7D_PAD_LCD_DATA21__FLEXTIMER2_CH5                       0x011C 0x038C 0x05C0 0x1 0x0
+#define MX7D_PAD_LCD_DATA21__ENET1_1588_EVENT3_OUT                0x011C 0x038C 0x0000 0x2 0x0
+#define MX7D_PAD_LCD_DATA21__CSI_DATA12                           0x011C 0x038C 0x0000 0x3 0x0
+#define MX7D_PAD_LCD_DATA21__EIM_ADDR24                           0x011C 0x038C 0x0000 0x4 0x0
+#define MX7D_PAD_LCD_DATA21__GPIO3_IO26                           0x011C 0x038C 0x0000 0x5 0x0
+#define MX7D_PAD_LCD_DATA21__I2C3_SDA                             0x011C 0x038C 0x05E8 0x6 0x1
+#define MX7D_PAD_LCD_DATA22__LCD_DATA22                           0x0120 0x0390 0x0690 0x0 0x2
+#define MX7D_PAD_LCD_DATA22__FLEXTIMER2_CH6                       0x0120 0x0390 0x05C4 0x1 0x0
+#define MX7D_PAD_LCD_DATA22__ENET2_1588_EVENT2_OUT                0x0120 0x0390 0x0000 0x2 0x0
+#define MX7D_PAD_LCD_DATA22__CSI_DATA11                           0x0120 0x0390 0x0000 0x3 0x0
+#define MX7D_PAD_LCD_DATA22__EIM_ADDR25                           0x0120 0x0390 0x0000 0x4 0x0
+#define MX7D_PAD_LCD_DATA22__GPIO3_IO27                           0x0120 0x0390 0x0000 0x5 0x0
+#define MX7D_PAD_LCD_DATA22__I2C4_SCL                             0x0120 0x0390 0x05EC 0x6 0x1
+#define MX7D_PAD_LCD_DATA23__LCD_DATA23                           0x0124 0x0394 0x0694 0x0 0x2
+#define MX7D_PAD_LCD_DATA23__FLEXTIMER2_CH7                       0x0124 0x0394 0x05C8 0x1 0x0
+#define MX7D_PAD_LCD_DATA23__ENET2_1588_EVENT3_OUT                0x0124 0x0394 0x0000 0x2 0x0
+#define MX7D_PAD_LCD_DATA23__CSI_DATA10                           0x0124 0x0394 0x0000 0x3 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_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_RX_DATA__ECSPI1_SS1                        0x0128 0x0398 0x0000 0x3 0x0
+#define MX7D_PAD_UART1_RX_DATA__ENET2_1588_EVENT0_IN              0x0128 0x0398 0x0000 0x4 0x0
+#define MX7D_PAD_UART1_RX_DATA__GPIO4_IO0                         0x0128 0x0398 0x0000 0x5 0x0
+#define MX7D_PAD_UART1_RX_DATA__ENET1_MDIO                        0x0128 0x0398 0x0000 0x6 0x0
+#define MX7D_PAD_UART1_TX_DATA__UART1_DCE_TX                      0x012C 0x039C 0x0000 0x0 0x0
+#define MX7D_PAD_UART1_TX_DATA__UART1_DTE_RX                      0x012C 0x039C 0x06F4 0x0 0x1
+#define MX7D_PAD_UART1_TX_DATA__I2C1_SDA                          0x012C 0x039C 0x05D8 0x1 0x0
+#define MX7D_PAD_UART1_TX_DATA__SAI3_MCLK                         0x012C 0x039C 0x0000 0x2 0x0
+#define MX7D_PAD_UART1_TX_DATA__ECSPI1_SS2                        0x012C 0x039C 0x0000 0x3 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_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_UART2_RX_DATA__ECSPI1_SS3                        0x0130 0x03A0 0x0000 0x3 0x0
+#define MX7D_PAD_UART2_RX_DATA__ENET2_1588_EVENT1_IN              0x0130 0x03A0 0x0000 0x4 0x0
+#define MX7D_PAD_UART2_RX_DATA__GPIO4_IO2                         0x0130 0x03A0 0x0000 0x5 0x0
+#define MX7D_PAD_UART2_RX_DATA__ENET2_MDIO                        0x0130 0x03A0 0x0000 0x6 0x0
+#define MX7D_PAD_UART2_TX_DATA__UART2_DCE_TX                      0x0134 0x03A4 0x0000 0x0 0x0
+#define MX7D_PAD_UART2_TX_DATA__UART2_DTE_RX                      0x0134 0x03A4 0x0000 0x0 0x0
+#define MX7D_PAD_UART2_TX_DATA__I2C2_SDA                          0x0134 0x03A4 0x05E0 0x1 0x0
+#define MX7D_PAD_UART2_TX_DATA__SAI3_RX_DATA0                     0x0134 0x03A4 0x06C8 0x2 0x0
+#define MX7D_PAD_UART2_TX_DATA__ECSPI1_RDY                        0x0134 0x03A4 0x0000 0x3 0x0
+#define MX7D_PAD_UART2_TX_DATA__ENET2_1588_EVENT1_OUT             0x0134 0x03A4 0x0000 0x4 0x0
+#define MX7D_PAD_UART2_TX_DATA__GPIO4_IO3                         0x0134 0x03A4 0x0000 0x5 0x0
+#define MX7D_PAD_UART2_TX_DATA__ENET2_MDC                         0x0134 0x03A4 0x0000 0x6 0x0
+#define MX7D_PAD_UART3_RX_DATA__UART3_DCE_RX                      0x0138 0x03A8 0x0704 0x0 0x2
+#define MX7D_PAD_UART3_RX_DATA__UART3_DTE_TX                      0x0138 0x03A8 0x0000 0x0 0x0
+#define MX7D_PAD_UART3_RX_DATA__USB_OTG1_OC                       0x0138 0x03A8 0x072C 0x1 0x0
+#define MX7D_PAD_UART3_RX_DATA__SAI3_RX_SYNC                      0x0138 0x03A8 0x06CC 0x2 0x0
+#define MX7D_PAD_UART3_RX_DATA__ECSPI1_MISO                       0x0138 0x03A8 0x0528 0x3 0x0
+#define MX7D_PAD_UART3_RX_DATA__ENET1_1588_EVENT0_IN              0x0138 0x03A8 0x0000 0x4 0x0
+#define MX7D_PAD_UART3_RX_DATA__GPIO4_IO4                         0x0138 0x03A8 0x0000 0x5 0x0
+#define MX7D_PAD_UART3_RX_DATA__SD1_LCTL                          0x0138 0x03A8 0x0000 0x6 0x0
+#define MX7D_PAD_UART3_TX_DATA__UART3_DCE_TX                      0x013C 0x03AC 0x0000 0x0 0x0
+#define MX7D_PAD_UART3_TX_DATA__UART3_DTE_RX                      0x013C 0x03AC 0x0704 0x0 0x3
+#define MX7D_PAD_UART3_TX_DATA__USB_OTG1_PWR                      0x013C 0x03AC 0x0000 0x1 0x0
+#define MX7D_PAD_UART3_TX_DATA__SAI3_TX_BCLK                      0x013C 0x03AC 0x06D0 0x2 0x0
+#define MX7D_PAD_UART3_TX_DATA__ECSPI1_MOSI                       0x013C 0x03AC 0x052C 0x3 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_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
+#define MX7D_PAD_UART3_RTS_B__ECSPI1_SCLK                         0x0140 0x03B0 0x0000 0x3 0x0
+#define MX7D_PAD_UART3_RTS_B__ENET1_1588_EVENT1_IN                0x0140 0x03B0 0x0000 0x4 0x0
+#define MX7D_PAD_UART3_RTS_B__GPIO4_IO6                           0x0140 0x03B0 0x0000 0x5 0x0
+#define MX7D_PAD_UART3_RTS_B__SD3_LCTL                            0x0140 0x03B0 0x0000 0x6 0x0
+#define MX7D_PAD_UART3_CTS_B__UART3_DCE_CTS                       0x0144 0x03B4 0x0000 0x0 0x0
+#define MX7D_PAD_UART3_CTS_B__UART3_DTE_RTS                       0x0144 0x03B4 0x0700 0x0 0x3
+#define MX7D_PAD_UART3_CTS_B__USB_OTG2_PWR                        0x0144 0x03B4 0x0000 0x1 0x0
+#define MX7D_PAD_UART3_CTS_B__SAI3_TX_SYNC                        0x0144 0x03B4 0x06D4 0x2 0x0
+#define MX7D_PAD_UART3_CTS_B__ECSPI1_SS0                          0x0144 0x03B4 0x0530 0x3 0x0
+#define MX7D_PAD_UART3_CTS_B__ENET1_1588_EVENT1_OUT               0x0144 0x03B4 0x0000 0x4 0x0
+#define MX7D_PAD_UART3_CTS_B__GPIO4_IO7                           0x0144 0x03B4 0x0000 0x5 0x0
+#define MX7D_PAD_UART3_CTS_B__SD1_VSELECT                         0x0144 0x03B4 0x0000 0x6 0x0
+#define MX7D_PAD_I2C1_SCL__I2C1_SCL                               0x0148 0x03B8 0x05D4 0x0 0x1
+#define MX7D_PAD_I2C1_SCL__UART4_DCE_CTS                          0x0148 0x03B8 0x0000 0x1 0x0
+#define MX7D_PAD_I2C1_SCL__UART4_DTE_RTS                          0x0148 0x03B8 0x0708 0x1 0x0
+#define MX7D_PAD_I2C1_SCL__FLEXCAN1_RX                            0x0148 0x03B8 0x04DC 0x2 0x1
+#define MX7D_PAD_I2C1_SCL__ECSPI3_MISO                            0x0148 0x03B8 0x0548 0x3 0x0
+#define MX7D_PAD_I2C1_SCL__GPIO4_IO8                              0x0148 0x03B8 0x0000 0x5 0x0
+#define MX7D_PAD_I2C1_SCL__SD2_VSELECT                            0x0148 0x03B8 0x0000 0x6 0x0
+#define MX7D_PAD_I2C1_SDA__I2C1_SDA                               0x014C 0x03BC 0x05D8 0x0 0x1
+#define MX7D_PAD_I2C1_SDA__UART4_DCE_RTS                          0x014C 0x03BC 0x0708 0x1 0x1
+#define MX7D_PAD_I2C1_SDA__UART4_DTE_CTS                          0x014C 0x03BC 0x0000 0x1 0x0
+#define MX7D_PAD_I2C1_SDA__FLEXCAN1_TX                            0x014C 0x03BC 0x0000 0x2 0x0
+#define MX7D_PAD_I2C1_SDA__ECSPI3_MOSI                            0x014C 0x03BC 0x054C 0x3 0x0
+#define MX7D_PAD_I2C1_SDA__CCM_ENET_REF_CLK1                      0x014C 0x03BC 0x0564 0x4 0x1
+#define MX7D_PAD_I2C1_SDA__GPIO4_IO9                              0x014C 0x03BC 0x0000 0x5 0x0
+#define MX7D_PAD_I2C1_SDA__SD3_VSELECT                            0x014C 0x03BC 0x0000 0x6 0x0
+#define MX7D_PAD_I2C2_SCL__I2C2_SCL                               0x0150 0x03C0 0x05DC 0x0 0x1
+#define MX7D_PAD_I2C2_SCL__UART4_DCE_RX                           0x0150 0x03C0 0x070C 0x1 0x0
+#define MX7D_PAD_I2C2_SCL__UART4_DTE_TX                           0x0150 0x03C0 0x0000 0x1 0x0
+#define MX7D_PAD_I2C2_SCL__WDOG3_WDOG_B                           0x0150 0x03C0 0x0000 0x2 0x0
+#define MX7D_PAD_I2C2_SCL__ECSPI3_SCLK                            0x0150 0x03C0 0x0544 0x3 0x0
+#define MX7D_PAD_I2C2_SCL__CCM_ENET_REF_CLK2                      0x0150 0x03C0 0x0570 0x4 0x2
+#define MX7D_PAD_I2C2_SCL__GPIO4_IO10                             0x0150 0x03C0 0x0000 0x5 0x0
+#define MX7D_PAD_I2C2_SCL__SD3_CD_B                               0x0150 0x03C0 0x0738 0x6 0x1
+#define MX7D_PAD_I2C2_SDA__I2C2_SDA                               0x0154 0x03C4 0x05E0 0x0 0x1
+#define MX7D_PAD_I2C2_SDA__UART4_DCE_TX                           0x0154 0x03C4 0x0000 0x1 0x0
+#define MX7D_PAD_I2C2_SDA__UART4_DTE_RX                           0x0154 0x03C4 0x070C 0x1 0x1
+#define MX7D_PAD_I2C2_SDA__WDOG3_WDOG_RST_B_DEB                   0x0154 0x03C4 0x0000 0x2 0x0
+#define MX7D_PAD_I2C2_SDA__ECSPI3_SS0                             0x0154 0x03C4 0x0550 0x3 0x0
+#define MX7D_PAD_I2C2_SDA__CCM_ENET_REF_CLK3                      0x0154 0x03C4 0x0000 0x4 0x0
+#define MX7D_PAD_I2C2_SDA__GPIO4_IO11                             0x0154 0x03C4 0x0000 0x5 0x0
+#define MX7D_PAD_I2C2_SDA__SD3_WP                                 0x0154 0x03C4 0x073C 0x6 0x1
+#define MX7D_PAD_I2C3_SCL__I2C3_SCL                               0x0158 0x03C8 0x05E4 0x0 0x2
+#define MX7D_PAD_I2C3_SCL__UART5_DCE_CTS                          0x0158 0x03C8 0x0000 0x1 0x0
+#define MX7D_PAD_I2C3_SCL__UART5_DTE_RTS                          0x0158 0x03C8 0x0710 0x1 0x0
+#define MX7D_PAD_I2C3_SCL__FLEXCAN2_RX                            0x0158 0x03C8 0x04E0 0x2 0x1
+#define MX7D_PAD_I2C3_SCL__CSI_VSYNC                              0x0158 0x03C8 0x0520 0x3 0x1
+#define MX7D_PAD_I2C3_SCL__SDMA_EXT_EVENT0                        0x0158 0x03C8 0x06D8 0x4 0x1
+#define MX7D_PAD_I2C3_SCL__GPIO4_IO12                             0x0158 0x03C8 0x0000 0x5 0x0
+#define MX7D_PAD_I2C3_SCL__EPDC_BDR0                              0x0158 0x03C8 0x0000 0x6 0x0
+#define MX7D_PAD_I2C3_SDA__I2C3_SDA                               0x015C 0x03CC 0x05E8 0x0 0x2
+#define MX7D_PAD_I2C3_SDA__UART5_DCE_RTS                          0x015C 0x03CC 0x0710 0x1 0x1
+#define MX7D_PAD_I2C3_SDA__UART5_DTE_CTS                          0x015C 0x03CC 0x0000 0x1 0x0
+#define MX7D_PAD_I2C3_SDA__FLEXCAN2_TX                            0x015C 0x03CC 0x0000 0x2 0x0
+#define MX7D_PAD_I2C3_SDA__CSI_HSYNC                              0x015C 0x03CC 0x0518 0x3 0x1
+#define MX7D_PAD_I2C3_SDA__SDMA_EXT_EVENT1                        0x015C 0x03CC 0x06DC 0x4 0x1
+#define MX7D_PAD_I2C3_SDA__GPIO4_IO13                             0x015C 0x03CC 0x0000 0x5 0x0
+#define MX7D_PAD_I2C3_SDA__EPDC_BDR1                              0x015C 0x03CC 0x0000 0x6 0x0
+#define MX7D_PAD_I2C4_SCL__I2C4_SCL                               0x0160 0x03D0 0x05EC 0x0 0x2
+#define MX7D_PAD_I2C4_SCL__UART5_DCE_RX                           0x0160 0x03D0 0x0714 0x1 0x0
+#define MX7D_PAD_I2C4_SCL__UART5_DTE_TX                           0x0160 0x03D0 0x0000 0x1 0x0
+#define MX7D_PAD_I2C4_SCL__WDOG4_WDOG_B                           0x0160 0x03D0 0x0000 0x2 0x0
+#define MX7D_PAD_I2C4_SCL__CSI_PIXCLK                             0x0160 0x03D0 0x051C 0x3 0x1
+#define MX7D_PAD_I2C4_SCL__USB_OTG1_ID                            0x0160 0x03D0 0x0734 0x4 0x1
+#define MX7D_PAD_I2C4_SCL__GPIO4_IO14                             0x0160 0x03D0 0x0000 0x5 0x0
+#define MX7D_PAD_I2C4_SCL__EPDC_VCOM0                             0x0160 0x03D0 0x0000 0x6 0x0
+#define MX7D_PAD_I2C4_SDA__I2C4_SDA                               0x0164 0x03D4 0x05F0 0x0 0x2
+#define MX7D_PAD_I2C4_SDA__UART5_DCE_TX                           0x0164 0x03D4 0x0000 0x1 0x0
+#define MX7D_PAD_I2C4_SDA__UART5_DTE_RX                           0x0164 0x03D4 0x0714 0x1 0x1
+#define MX7D_PAD_I2C4_SDA__WDOG4_WDOG_RST_B_DEB                   0x0164 0x03D4 0x0000 0x2 0x0
+#define MX7D_PAD_I2C4_SDA__CSI_MCLK                               0x0164 0x03D4 0x0000 0x3 0x0
+#define MX7D_PAD_I2C4_SDA__USB_OTG2_ID                            0x0164 0x03D4 0x0730 0x4 0x1
+#define MX7D_PAD_I2C4_SDA__GPIO4_IO15                             0x0164 0x03D4 0x0000 0x5 0x0
+#define MX7D_PAD_I2C4_SDA__EPDC_VCOM1                             0x0164 0x03D4 0x0000 0x6 0x0
+#define MX7D_PAD_ECSPI1_SCLK__ECSPI1_SCLK                         0x0168 0x03D8 0x0524 0x0 0x1
+#define MX7D_PAD_ECSPI1_SCLK__UART6_DCE_RX                        0x0168 0x03D8 0x071C 0x1 0x2
+#define MX7D_PAD_ECSPI1_SCLK__UART6_DTE_TX                        0x0168 0x03D8 0x0000 0x1 0x0
+#define MX7D_PAD_ECSPI1_SCLK__SD2_DATA4                           0x0168 0x03D8 0x0000 0x2 0x0
+#define MX7D_PAD_ECSPI1_SCLK__CSI_DATA2                           0x0168 0x03D8 0x04F8 0x3 0x1
+#define MX7D_PAD_ECSPI1_SCLK__GPIO4_IO16                          0x0168 0x03D8 0x0000 0x5 0x0
+#define MX7D_PAD_ECSPI1_SCLK__EPDC_PWR_COM                        0x0168 0x03D8 0x0000 0x6 0x0
+#define MX7D_PAD_ECSPI1_MOSI__ECSPI1_MOSI                         0x016C 0x03DC 0x052C 0x0 0x1
+#define MX7D_PAD_ECSPI1_MOSI__UART6_DCE_TX                        0x016C 0x03DC 0x0000 0x1 0x0
+#define MX7D_PAD_ECSPI1_MOSI__UART6_DTE_RX                        0x016C 0x03DC 0x071C 0x1 0x3
+#define MX7D_PAD_ECSPI1_MOSI__SD2_DATA5                           0x016C 0x03DC 0x0000 0x2 0x0
+#define MX7D_PAD_ECSPI1_MOSI__CSI_DATA3                           0x016C 0x03DC 0x04FC 0x3 0x1
+#define MX7D_PAD_ECSPI1_MOSI__GPIO4_IO17                          0x016C 0x03DC 0x0000 0x5 0x0
+#define MX7D_PAD_ECSPI1_MOSI__EPDC_PWR_STAT                       0x016C 0x03DC 0x0580 0x6 0x1
+#define MX7D_PAD_ECSPI1_MISO__ECSPI1_MISO                         0x0170 0x03E0 0x0528 0x0 0x1
+#define MX7D_PAD_ECSPI1_MISO__UART6_DCE_RTS                       0x0170 0x03E0 0x0718 0x1 0x2
+#define MX7D_PAD_ECSPI1_MISO__UART6_DTE_CTS                       0x0170 0x03E0 0x0000 0x1 0x0
+#define MX7D_PAD_ECSPI1_MISO__SD2_DATA6                           0x0170 0x03E0 0x0000 0x2 0x0
+#define MX7D_PAD_ECSPI1_MISO__CSI_DATA4                           0x0170 0x03E0 0x0500 0x3 0x1
+#define MX7D_PAD_ECSPI1_MISO__GPIO4_IO18                          0x0170 0x03E0 0x0000 0x5 0x0
+#define MX7D_PAD_ECSPI1_MISO__EPDC_PWR_IRQ                        0x0170 0x03E0 0x057C 0x6 0x0
+#define MX7D_PAD_ECSPI1_SS0__ECSPI1_SS0                           0x0174 0x03E4 0x0530 0x0 0x1
+#define MX7D_PAD_ECSPI1_SS0__UART6_DCE_CTS                        0x0174 0x03E4 0x0000 0x1 0x0
+#define MX7D_PAD_ECSPI1_SS0__UART6_DTE_RTS                        0x0174 0x03E4 0x0718 0x1 0x3
+#define MX7D_PAD_ECSPI1_SS0__SD2_DATA7                            0x0174 0x03E4 0x0000 0x2 0x0
+#define MX7D_PAD_ECSPI1_SS0__CSI_DATA5                            0x0174 0x03E4 0x0504 0x3 0x1
+#define MX7D_PAD_ECSPI1_SS0__GPIO4_IO19                           0x0174 0x03E4 0x0000 0x5 0x0
+#define MX7D_PAD_ECSPI1_SS0__EPDC_PWR_CTRL3                       0x0174 0x03E4 0x0000 0x6 0x0
+#define MX7D_PAD_ECSPI2_SCLK__ECSPI2_SCLK                         0x0178 0x03E8 0x0534 0x0 0x0
+#define MX7D_PAD_ECSPI2_SCLK__UART7_DCE_RX                        0x0178 0x03E8 0x0724 0x1 0x2
+#define MX7D_PAD_ECSPI2_SCLK__UART7_DTE_TX                        0x0178 0x03E8 0x0000 0x1 0x0
+#define MX7D_PAD_ECSPI2_SCLK__SD1_DATA4                           0x0178 0x03E8 0x0000 0x2 0x0
+#define MX7D_PAD_ECSPI2_SCLK__CSI_DATA6                           0x0178 0x03E8 0x0508 0x3 0x1
+#define MX7D_PAD_ECSPI2_SCLK__LCD_DATA13                          0x0178 0x03E8 0x066C 0x4 0x2
+#define MX7D_PAD_ECSPI2_SCLK__GPIO4_IO20                          0x0178 0x03E8 0x0000 0x5 0x0
+#define MX7D_PAD_ECSPI2_SCLK__EPDC_PWR_CTRL0                      0x0178 0x03E8 0x0000 0x6 0x0
+#define MX7D_PAD_ECSPI2_MOSI__ECSPI2_MOSI                         0x017C 0x03EC 0x053C 0x0 0x0
+#define MX7D_PAD_ECSPI2_MOSI__UART7_DCE_TX                        0x017C 0x03EC 0x0000 0x1 0x0
+#define MX7D_PAD_ECSPI2_MOSI__UART7_DTE_RX                        0x017C 0x03EC 0x0724 0x1 0x3
+#define MX7D_PAD_ECSPI2_MOSI__SD1_DATA5                           0x017C 0x03EC 0x0000 0x2 0x0
+#define MX7D_PAD_ECSPI2_MOSI__CSI_DATA7                           0x017C 0x03EC 0x050C 0x3 0x1
+#define MX7D_PAD_ECSPI2_MOSI__LCD_DATA14                          0x017C 0x03EC 0x0670 0x4 0x2
+#define MX7D_PAD_ECSPI2_MOSI__GPIO4_IO21                          0x017C 0x03EC 0x0000 0x5 0x0
+#define MX7D_PAD_ECSPI2_MOSI__EPDC_PWR_CTRL1                      0x017C 0x03EC 0x0000 0x6 0x0
+#define MX7D_PAD_ECSPI2_MISO__GPIO4_IO22                          0x0180 0x03F0 0x0000 0x5 0x0
+#define MX7D_PAD_ECSPI2_MISO__EPDC_PWR_CTRL2                      0x0180 0x03F0 0x0000 0x6 0x0
+#define MX7D_PAD_ECSPI2_MISO__ECSPI2_MISO                         0x0180 0x03F0 0x0538 0x0 0x0
+#define MX7D_PAD_ECSPI2_MISO__UART7_DCE_RTS                       0x0180 0x03F0 0x0720 0x1 0x2
+#define MX7D_PAD_ECSPI2_MISO__UART7_DTE_CTS                       0x0180 0x03F0 0x0000 0x1 0x0
+#define MX7D_PAD_ECSPI2_MISO__SD1_DATA6                           0x0180 0x03F0 0x0000 0x2 0x0
+#define MX7D_PAD_ECSPI2_MISO__CSI_DATA8                           0x0180 0x03F0 0x0510 0x3 0x1
+#define MX7D_PAD_ECSPI2_MISO__LCD_DATA15                          0x0180 0x03F0 0x0674 0x4 0x2
+#define MX7D_PAD_ECSPI2_SS0__ECSPI2_SS0                           0x0184 0x03F4 0x0540 0x0 0x0
+#define MX7D_PAD_ECSPI2_SS0__UART7_DCE_CTS                        0x0184 0x03F4 0x0000 0x1 0x0
+#define MX7D_PAD_ECSPI2_SS0__UART7_DTE_RTS                        0x0184 0x03F4 0x0720 0x1 0x3
+#define MX7D_PAD_ECSPI2_SS0__SD1_DATA7                            0x0184 0x03F4 0x0000 0x2 0x0
+#define MX7D_PAD_ECSPI2_SS0__CSI_DATA9                            0x0184 0x03F4 0x0514 0x3 0x1
+#define MX7D_PAD_ECSPI2_SS0__LCD_RESET                            0x0184 0x03F4 0x0000 0x4 0x0
+#define MX7D_PAD_ECSPI2_SS0__GPIO4_IO23                           0x0184 0x03F4 0x0000 0x5 0x0
+#define MX7D_PAD_ECSPI2_SS0__EPDC_PWR_WAKE                        0x0184 0x03F4 0x0000 0x6 0x0
+#define MX7D_PAD_SD1_CD_B__SD1_CD_B                               0x0188 0x03F8 0x0000 0x0 0x0
+#define MX7D_PAD_SD1_CD_B__UART6_DCE_RX                           0x0188 0x03F8 0x071C 0x2 0x4
+#define MX7D_PAD_SD1_CD_B__UART6_DTE_TX                           0x0188 0x03F8 0x0000 0x2 0x0
+#define MX7D_PAD_SD1_CD_B__ECSPI4_MISO                            0x0188 0x03F8 0x0558 0x3 0x1
+#define MX7D_PAD_SD1_CD_B__FLEXTIMER1_CH0                         0x0188 0x03F8 0x0584 0x4 0x1
+#define MX7D_PAD_SD1_CD_B__GPIO5_IO0                              0x0188 0x03F8 0x0000 0x5 0x0
+#define MX7D_PAD_SD1_CD_B__CCM_CLKO1                              0x0188 0x03F8 0x0000 0x6 0x0
+#define MX7D_PAD_SD1_WP__SD1_WP                                   0x018C 0x03FC 0x0000 0x0 0x0
+#define MX7D_PAD_SD1_WP__UART6_DCE_TX                             0x018C 0x03FC 0x0000 0x2 0x0
+#define MX7D_PAD_SD1_WP__UART6_DTE_RX                             0x018C 0x03FC 0x071C 0x2 0x5
+#define MX7D_PAD_SD1_WP__ECSPI4_MOSI                              0x018C 0x03FC 0x055C 0x3 0x1
+#define MX7D_PAD_SD1_WP__FLEXTIMER1_CH1                           0x018C 0x03FC 0x0588 0x4 0x1
+#define MX7D_PAD_SD1_WP__GPIO5_IO1                                0x018C 0x03FC 0x0000 0x5 0x0
+#define MX7D_PAD_SD1_WP__CCM_CLKO2                                0x018C 0x03FC 0x0000 0x6 0x0
+#define MX7D_PAD_SD1_RESET_B__SD1_RESET_B                         0x0190 0x0400 0x0000 0x0 0x0
+#define MX7D_PAD_SD1_RESET_B__SAI3_MCLK                           0x0190 0x0400 0x0000 0x1 0x0
+#define MX7D_PAD_SD1_RESET_B__UART6_DCE_RTS                       0x0190 0x0400 0x0718 0x2 0x4
+#define MX7D_PAD_SD1_RESET_B__UART6_DTE_CTS                       0x0190 0x0400 0x0000 0x2 0x0
+#define MX7D_PAD_SD1_RESET_B__ECSPI4_SCLK                         0x0190 0x0400 0x0554 0x3 0x1
+#define MX7D_PAD_SD1_RESET_B__FLEXTIMER1_CH2                      0x0190 0x0400 0x058C 0x4 0x1
+#define MX7D_PAD_SD1_RESET_B__GPIO5_IO2                           0x0190 0x0400 0x0000 0x5 0x0
+#define MX7D_PAD_SD1_CLK__SD1_CLK                                 0x0194 0x0404 0x0000 0x0 0x0
+#define MX7D_PAD_SD1_CLK__SAI3_RX_SYNC                            0x0194 0x0404 0x06CC 0x1 0x1
+#define MX7D_PAD_SD1_CLK__UART6_DCE_CTS                           0x0194 0x0404 0x0000 0x2 0x0
+#define MX7D_PAD_SD1_CLK__UART6_DTE_RTS                           0x0194 0x0404 0x0718 0x2 0x5
+#define MX7D_PAD_SD1_CLK__ECSPI4_SS0                              0x0194 0x0404 0x0560 0x3 0x1
+#define MX7D_PAD_SD1_CLK__FLEXTIMER1_CH3                          0x0194 0x0404 0x0590 0x4 0x1
+#define MX7D_PAD_SD1_CLK__GPIO5_IO3                               0x0194 0x0404 0x0000 0x5 0x0
+#define MX7D_PAD_SD1_CMD__SD1_CMD                                 0x0198 0x0408 0x0000 0x0 0x0
+#define MX7D_PAD_SD1_CMD__SAI3_RX_BCLK                            0x0198 0x0408 0x06C4 0x1 0x1
+#define MX7D_PAD_SD1_CMD__ECSPI4_SS1                              0x0198 0x0408 0x0000 0x3 0x0
+#define MX7D_PAD_SD1_CMD__FLEXTIMER2_CH0                          0x0198 0x0408 0x05AC 0x4 0x1
+#define MX7D_PAD_SD1_CMD__GPIO5_IO4                               0x0198 0x0408 0x0000 0x5 0x0
+#define MX7D_PAD_SD1_DATA0__SD1_DATA0                             0x019C 0x040C 0x0000 0x0 0x0
+#define MX7D_PAD_SD1_DATA0__SAI3_RX_DATA0                         0x019C 0x040C 0x06C8 0x1 0x1
+#define MX7D_PAD_SD1_DATA0__UART7_DCE_RX                          0x019C 0x040C 0x0724 0x2 0x4
+#define MX7D_PAD_SD1_DATA0__UART7_DTE_TX                          0x019C 0x040C 0x0000 0x2 0x0
+#define MX7D_PAD_SD1_DATA0__ECSPI4_SS2                            0x019C 0x040C 0x0000 0x3 0x0
+#define MX7D_PAD_SD1_DATA0__FLEXTIMER2_CH1                        0x019C 0x040C 0x05B0 0x4 0x1
+#define MX7D_PAD_SD1_DATA0__GPIO5_IO5                             0x019C 0x040C 0x0000 0x5 0x0
+#define MX7D_PAD_SD1_DATA0__CCM_EXT_CLK1                          0x019C 0x040C 0x04E4 0x6 0x1
+#define MX7D_PAD_SD1_DATA1__SD1_DATA1                             0x01A0 0x0410 0x0000 0x0 0x0
+#define MX7D_PAD_SD1_DATA1__SAI3_TX_BCLK                          0x01A0 0x0410 0x06D0 0x1 0x1
+#define MX7D_PAD_SD1_DATA1__UART7_DCE_TX                          0x01A0 0x0410 0x0000 0x2 0x0
+#define MX7D_PAD_SD1_DATA1__UART7_DTE_RX                          0x01A0 0x0410 0x0724 0x2 0x5
+#define MX7D_PAD_SD1_DATA1__ECSPI4_SS3                            0x01A0 0x0410 0x0000 0x3 0x0
+#define MX7D_PAD_SD1_DATA1__FLEXTIMER2_CH2                        0x01A0 0x0410 0x05B4 0x4 0x1
+#define MX7D_PAD_SD1_DATA1__GPIO5_IO6                             0x01A0 0x0410 0x0000 0x5 0x0
+#define MX7D_PAD_SD1_DATA1__CCM_EXT_CLK2                          0x01A0 0x0410 0x04E8 0x6 0x1
+#define MX7D_PAD_SD1_DATA2__SD1_DATA2                             0x01A4 0x0414 0x0000 0x0 0x0
+#define MX7D_PAD_SD1_DATA2__SAI3_TX_SYNC                          0x01A4 0x0414 0x06D4 0x1 0x1
+#define MX7D_PAD_SD1_DATA2__UART7_DCE_CTS                         0x01A4 0x0414 0x0000 0x2 0x0
+#define MX7D_PAD_SD1_DATA2__UART7_DTE_RTS                         0x01A4 0x0414 0x0720 0x2 0x4
+#define MX7D_PAD_SD1_DATA2__ECSPI4_RDY                            0x01A4 0x0414 0x0000 0x3 0x0
+#define MX7D_PAD_SD1_DATA2__FLEXTIMER2_CH3                        0x01A4 0x0414 0x05B8 0x4 0x1
+#define MX7D_PAD_SD1_DATA2__GPIO5_IO7                             0x01A4 0x0414 0x0000 0x5 0x0
+#define MX7D_PAD_SD1_DATA2__CCM_EXT_CLK3                          0x01A4 0x0414 0x04EC 0x6 0x1
+#define MX7D_PAD_SD1_DATA3__SD1_DATA3                             0x01A8 0x0418 0x0000 0x0 0x0
+#define MX7D_PAD_SD1_DATA3__SAI3_TX_DATA0                         0x01A8 0x0418 0x0000 0x1 0x0
+#define MX7D_PAD_SD1_DATA3__UART7_DCE_RTS                         0x01A8 0x0418 0x0720 0x2 0x5
+#define MX7D_PAD_SD1_DATA3__UART7_DTE_CTS                         0x01A8 0x0418 0x0000 0x2 0x0
+#define MX7D_PAD_SD1_DATA3__ECSPI3_SS1                            0x01A8 0x0418 0x0000 0x3 0x0
+#define MX7D_PAD_SD1_DATA3__FLEXTIMER1_PHA                        0x01A8 0x0418 0x05A4 0x4 0x1
+#define MX7D_PAD_SD1_DATA3__GPIO5_IO8                             0x01A8 0x0418 0x0000 0x5 0x0
+#define MX7D_PAD_SD1_DATA3__CCM_EXT_CLK4                          0x01A8 0x0418 0x04F0 0x6 0x1
+#define MX7D_PAD_SD2_CD_B__SD2_CD_B                               0x01AC 0x041C 0x0000 0x0 0x0
+#define MX7D_PAD_SD2_CD_B__ENET1_MDIO                             0x01AC 0x041C 0x0568 0x1 0x2
+#define MX7D_PAD_SD2_CD_B__ENET2_MDIO                             0x01AC 0x041C 0x0574 0x2 0x2
+#define MX7D_PAD_SD2_CD_B__ECSPI3_SS2                             0x01AC 0x041C 0x0000 0x3 0x0
+#define MX7D_PAD_SD2_CD_B__FLEXTIMER1_PHB                         0x01AC 0x041C 0x05A8 0x4 0x1
+#define MX7D_PAD_SD2_CD_B__GPIO5_IO9                              0x01AC 0x041C 0x0000 0x5 0x0
+#define MX7D_PAD_SD2_CD_B__SDMA_EXT_EVENT0                        0x01AC 0x041C 0x06D8 0x6 0x2
+#define MX7D_PAD_SD2_WP__SD2_WP                                   0x01B0 0x0420 0x0000 0x0 0x0
+#define MX7D_PAD_SD2_WP__ENET1_MDC                                0x01B0 0x0420 0x0000 0x1 0x0
+#define MX7D_PAD_SD2_WP__ENET2_MDC                                0x01B0 0x0420 0x0000 0x2 0x0
+#define MX7D_PAD_SD2_WP__ECSPI3_SS3                               0x01B0 0x0420 0x0000 0x3 0x0
+#define MX7D_PAD_SD2_WP__USB_OTG1_ID                              0x01B0 0x0420 0x0734 0x4 0x2
+#define MX7D_PAD_SD2_WP__GPIO5_IO10                               0x01B0 0x0420 0x0000 0x5 0x0
+#define MX7D_PAD_SD2_WP__SDMA_EXT_EVENT1                          0x01B0 0x0420 0x06DC 0x6 0x2
+#define MX7D_PAD_SD2_RESET_B__SD2_RESET_B                         0x01B4 0x0424 0x0000 0x0 0x0
+#define MX7D_PAD_SD2_RESET_B__SAI2_MCLK                           0x01B4 0x0424 0x0000 0x1 0x0
+#define MX7D_PAD_SD2_RESET_B__SD2_RESET                           0x01B4 0x0424 0x0000 0x2 0x0
+#define MX7D_PAD_SD2_RESET_B__ECSPI3_RDY                          0x01B4 0x0424 0x0000 0x3 0x0
+#define MX7D_PAD_SD2_RESET_B__USB_OTG2_ID                         0x01B4 0x0424 0x0730 0x4 0x2
+#define MX7D_PAD_SD2_RESET_B__GPIO5_IO11                          0x01B4 0x0424 0x0000 0x5 0x0
+#define MX7D_PAD_SD2_CLK__SD2_CLK                                 0x01B8 0x0428 0x0000 0x0 0x0
+#define MX7D_PAD_SD2_CLK__SAI2_RX_SYNC                            0x01B8 0x0428 0x06B8 0x1 0x0
+#define MX7D_PAD_SD2_CLK__MQS_RIGHT                               0x01B8 0x0428 0x0000 0x2 0x0
+#define MX7D_PAD_SD2_CLK__GPT4_CLK                                0x01B8 0x0428 0x0000 0x3 0x0
+#define MX7D_PAD_SD2_CLK__GPIO5_IO12                              0x01B8 0x0428 0x0000 0x5 0x0
+#define MX7D_PAD_SD2_CMD__SD2_CMD                                 0x01BC 0x042C 0x0000 0x0 0x0
+#define MX7D_PAD_SD2_CMD__SAI2_RX_BCLK                            0x01BC 0x042C 0x06B0 0x1 0x0
+#define MX7D_PAD_SD2_CMD__MQS_LEFT                                0x01BC 0x042C 0x0000 0x2 0x0
+#define MX7D_PAD_SD2_CMD__GPT4_CAPTURE1                           0x01BC 0x042C 0x0000 0x3 0x0
+#define MX7D_PAD_SD2_CMD__SIM2_PORT1_TRXD                         0x01BC 0x042C 0x06EC 0x4 0x1
+#define MX7D_PAD_SD2_CMD__GPIO5_IO13                              0x01BC 0x042C 0x0000 0x5 0x0
+#define MX7D_PAD_SD2_DATA0__SD2_DATA0                             0x01C0 0x0430 0x0000 0x0 0x0
+#define MX7D_PAD_SD2_DATA0__SAI2_RX_DATA0                         0x01C0 0x0430 0x06B4 0x1 0x0
+#define MX7D_PAD_SD2_DATA0__UART4_DCE_RX                          0x01C0 0x0430 0x070C 0x2 0x2
+#define MX7D_PAD_SD2_DATA0__UART4_DTE_TX                          0x01C0 0x0430 0x0000 0x2 0x0
+#define MX7D_PAD_SD2_DATA0__GPT4_CAPTURE2                         0x01C0 0x0430 0x0000 0x3 0x0
+#define MX7D_PAD_SD2_DATA0__SIM2_PORT1_CLK                        0x01C0 0x0430 0x0000 0x4 0x0
+#define MX7D_PAD_SD2_DATA0__GPIO5_IO14                            0x01C0 0x0430 0x0000 0x5 0x0
+#define MX7D_PAD_SD2_DATA1__SD2_DATA1                             0x01C4 0x0434 0x0000 0x0 0x0
+#define MX7D_PAD_SD2_DATA1__SAI2_TX_BCLK                          0x01C4 0x0434 0x06BC 0x1 0x0
+#define MX7D_PAD_SD2_DATA1__UART4_DCE_TX                          0x01C4 0x0434 0x0000 0x2 0x0
+#define MX7D_PAD_SD2_DATA1__UART4_DTE_RX                          0x01C4 0x0434 0x070C 0x2 0x3
+#define MX7D_PAD_SD2_DATA1__GPT4_COMPARE1                         0x01C4 0x0434 0x0000 0x3 0x0
+#define MX7D_PAD_SD2_DATA1__SIM2_PORT1_RST_B                      0x01C4 0x0434 0x0000 0x4 0x0
+#define MX7D_PAD_SD2_DATA1__GPIO5_IO15                            0x01C4 0x0434 0x0000 0x5 0x0
+#define MX7D_PAD_SD2_DATA2__SD2_DATA2                             0x01C8 0x0438 0x0000 0x0 0x0
+#define MX7D_PAD_SD2_DATA2__SAI2_TX_SYNC                          0x01C8 0x0438 0x06C0 0x1 0x0
+#define MX7D_PAD_SD2_DATA2__UART4_DCE_CTS                         0x01C8 0x0438 0x0000 0x2 0x0
+#define MX7D_PAD_SD2_DATA2__UART4_DTE_RTS                         0x01C8 0x0438 0x0708 0x2 0x2
+#define MX7D_PAD_SD2_DATA2__GPT4_COMPARE2                         0x01C8 0x0438 0x0000 0x3 0x0
+#define MX7D_PAD_SD2_DATA2__SIM2_PORT1_SVEN                       0x01C8 0x0438 0x0000 0x4 0x0
+#define MX7D_PAD_SD2_DATA2__GPIO5_IO16                            0x01C8 0x0438 0x0000 0x5 0x0
+#define MX7D_PAD_SD2_DATA3__SD2_DATA3                             0x01CC 0x043C 0x0000 0x0 0x0
+#define MX7D_PAD_SD2_DATA3__SAI2_TX_DATA0                         0x01CC 0x043C 0x0000 0x1 0x0
+#define MX7D_PAD_SD2_DATA3__UART4_DCE_RTS                         0x01CC 0x043C 0x0708 0x2 0x3
+#define MX7D_PAD_SD2_DATA3__UART4_DTE_CTS                         0x01CC 0x043C 0x0000 0x2 0x0
+#define MX7D_PAD_SD2_DATA3__GPT4_COMPARE3                         0x01CC 0x043C 0x0000 0x3 0x0
+#define MX7D_PAD_SD2_DATA3__SIM2_PORT1_PD                         0x01CC 0x043C 0x06E8 0x4 0x1
+#define MX7D_PAD_SD2_DATA3__GPIO5_IO17                            0x01CC 0x043C 0x0000 0x5 0x0
+#define MX7D_PAD_SD3_CLK__SD3_CLK                                 0x01D0 0x0440 0x0000 0x0 0x0
+#define MX7D_PAD_SD3_CLK__NAND_CLE                                0x01D0 0x0440 0x0000 0x1 0x0
+#define MX7D_PAD_SD3_CLK__ECSPI4_MISO                             0x01D0 0x0440 0x0558 0x2 0x2
+#define MX7D_PAD_SD3_CLK__SAI3_RX_SYNC                            0x01D0 0x0440 0x06CC 0x3 0x2
+#define MX7D_PAD_SD3_CLK__GPT3_CLK                                0x01D0 0x0440 0x0000 0x4 0x0
+#define MX7D_PAD_SD3_CLK__GPIO6_IO0                               0x01D0 0x0440 0x0000 0x5 0x0
+#define MX7D_PAD_SD3_CMD__SD3_CMD                                 0x01D4 0x0444 0x0000 0x0 0x0
+#define MX7D_PAD_SD3_CMD__NAND_ALE                                0x01D4 0x0444 0x0000 0x1 0x0
+#define MX7D_PAD_SD3_CMD__ECSPI4_MOSI                             0x01D4 0x0444 0x055C 0x2 0x2
+#define MX7D_PAD_SD3_CMD__SAI3_RX_BCLK                            0x01D4 0x0444 0x06C4 0x3 0x2
+#define MX7D_PAD_SD3_CMD__GPT3_CAPTURE1                           0x01D4 0x0444 0x0000 0x4 0x0
+#define MX7D_PAD_SD3_CMD__GPIO6_IO1                               0x01D4 0x0444 0x0000 0x5 0x0
+#define MX7D_PAD_SD3_DATA0__SD3_DATA0                             0x01D8 0x0448 0x0000 0x0 0x0
+#define MX7D_PAD_SD3_DATA0__NAND_DATA00                           0x01D8 0x0448 0x0000 0x1 0x0
+#define MX7D_PAD_SD3_DATA0__ECSPI4_SS0                            0x01D8 0x0448 0x0560 0x2 0x2
+#define MX7D_PAD_SD3_DATA0__SAI3_RX_DATA0                         0x01D8 0x0448 0x06C8 0x3 0x2
+#define MX7D_PAD_SD3_DATA0__GPT3_CAPTURE2                         0x01D8 0x0448 0x0000 0x4 0x0
+#define MX7D_PAD_SD3_DATA0__GPIO6_IO2                             0x01D8 0x0448 0x0000 0x5 0x0
+#define MX7D_PAD_SD3_DATA1__SD3_DATA1                             0x01DC 0x044C 0x0000 0x0 0x0
+#define MX7D_PAD_SD3_DATA1__NAND_DATA01                           0x01DC 0x044C 0x0000 0x1 0x0
+#define MX7D_PAD_SD3_DATA1__ECSPI4_SCLK                           0x01DC 0x044C 0x0554 0x2 0x2
+#define MX7D_PAD_SD3_DATA1__SAI3_TX_BCLK                          0x01DC 0x044C 0x06D0 0x3 0x2
+#define MX7D_PAD_SD3_DATA1__GPT3_COMPARE1                         0x01DC 0x044C 0x0000 0x4 0x0
+#define MX7D_PAD_SD3_DATA1__GPIO6_IO3                             0x01DC 0x044C 0x0000 0x5 0x0
+#define MX7D_PAD_SD3_DATA2__SD3_DATA2                             0x01E0 0x0450 0x0000 0x0 0x0
+#define MX7D_PAD_SD3_DATA2__NAND_DATA02                           0x01E0 0x0450 0x0000 0x1 0x0
+#define MX7D_PAD_SD3_DATA2__I2C3_SDA                              0x01E0 0x0450 0x05E8 0x2 0x3
+#define MX7D_PAD_SD3_DATA2__SAI3_TX_SYNC                          0x01E0 0x0450 0x06D4 0x3 0x2
+#define MX7D_PAD_SD3_DATA2__GPT3_COMPARE2                         0x01E0 0x0450 0x0000 0x4 0x0
+#define MX7D_PAD_SD3_DATA2__GPIO6_IO4                             0x01E0 0x0450 0x0000 0x5 0x0
+#define MX7D_PAD_SD3_DATA3__SD3_DATA3                             0x01E4 0x0454 0x0000 0x0 0x0
+#define MX7D_PAD_SD3_DATA3__NAND_DATA03                           0x01E4 0x0454 0x0000 0x1 0x0
+#define MX7D_PAD_SD3_DATA3__I2C3_SCL                              0x01E4 0x0454 0x05E4 0x2 0x3
+#define MX7D_PAD_SD3_DATA3__SAI3_TX_DATA0                         0x01E4 0x0454 0x0000 0x3 0x0
+#define MX7D_PAD_SD3_DATA3__GPT3_COMPARE3                         0x01E4 0x0454 0x0000 0x4 0x0
+#define MX7D_PAD_SD3_DATA3__GPIO6_IO5                             0x01E4 0x0454 0x0000 0x5 0x0
+#define MX7D_PAD_SD3_DATA4__SD3_DATA4                             0x01E8 0x0458 0x0000 0x0 0x0
+#define MX7D_PAD_SD3_DATA4__NAND_DATA04                           0x01E8 0x0458 0x0000 0x1 0x0
+#define MX7D_PAD_SD3_DATA4__UART3_DCE_RX                          0x01E8 0x0458 0x0704 0x3 0x4
+#define MX7D_PAD_SD3_DATA4__UART3_DTE_TX                          0x01E8 0x0458 0x0000 0x3 0x0
+#define MX7D_PAD_SD3_DATA4__FLEXCAN2_RX                           0x01E8 0x0458 0x04E0 0x4 0x2
+#define MX7D_PAD_SD3_DATA4__GPIO6_IO6                             0x01E8 0x0458 0x0000 0x5 0x0
+#define MX7D_PAD_SD3_DATA5__SD3_DATA5                             0x01EC 0x045C 0x0000 0x0 0x0
+#define MX7D_PAD_SD3_DATA5__NAND_DATA05                           0x01EC 0x045C 0x0000 0x1 0x0
+#define MX7D_PAD_SD3_DATA5__UART3_DCE_TX                          0x01EC 0x045C 0x0000 0x3 0x0
+#define MX7D_PAD_SD3_DATA5__UART3_DTE_RX                          0x01EC 0x045C 0x0704 0x3 0x5
+#define MX7D_PAD_SD3_DATA5__FLEXCAN1_TX                           0x01EC 0x045C 0x0000 0x4 0x0
+#define MX7D_PAD_SD3_DATA5__GPIO6_IO7                             0x01EC 0x045C 0x0000 0x5 0x0
+#define MX7D_PAD_SD3_DATA6__SD3_DATA6                             0x01F0 0x0460 0x0000 0x0 0x0
+#define MX7D_PAD_SD3_DATA6__NAND_DATA06                           0x01F0 0x0460 0x0000 0x1 0x0
+#define MX7D_PAD_SD3_DATA6__SD3_WP                                0x01F0 0x0460 0x073C 0x2 0x2
+#define MX7D_PAD_SD3_DATA6__UART3_DCE_RTS                         0x01F0 0x0460 0x0700 0x3 0x4
+#define MX7D_PAD_SD3_DATA6__UART3_DTE_CTS                         0x01F0 0x0460 0x0000 0x3 0x0
+#define MX7D_PAD_SD3_DATA6__FLEXCAN2_TX                           0x01F0 0x0460 0x0000 0x4 0x0
+#define MX7D_PAD_SD3_DATA6__GPIO6_IO8                             0x01F0 0x0460 0x0000 0x5 0x0
+#define MX7D_PAD_SD3_DATA7__SD3_DATA7                             0x01F4 0x0464 0x0000 0x0 0x0
+#define MX7D_PAD_SD3_DATA7__NAND_DATA07                           0x01F4 0x0464 0x0000 0x1 0x0
+#define MX7D_PAD_SD3_DATA7__SD3_CD_B                              0x01F4 0x0464 0x0738 0x2 0x2
+#define MX7D_PAD_SD3_DATA7__UART3_DCE_CTS                         0x01F4 0x0464 0x0000 0x3 0x0
+#define MX7D_PAD_SD3_DATA7__UART3_DTE_RTS                         0x01F4 0x0464 0x0700 0x3 0x5
+#define MX7D_PAD_SD3_DATA7__FLEXCAN1_RX                           0x01F4 0x0464 0x04DC 0x4 0x2
+#define MX7D_PAD_SD3_DATA7__GPIO6_IO9                             0x01F4 0x0464 0x0000 0x5 0x0
+#define MX7D_PAD_SD3_STROBE__SD3_STROBE                           0x01F8 0x0468 0x0000 0x0 0x0
+#define MX7D_PAD_SD3_STROBE__NAND_RE_B                            0x01F8 0x0468 0x0000 0x1 0x0
+#define MX7D_PAD_SD3_STROBE__GPIO6_IO10                           0x01F8 0x0468 0x0000 0x5 0x0
+#define MX7D_PAD_SD3_RESET_B__SD3_RESET_B                         0x01FC 0x046C 0x0000 0x0 0x0
+#define MX7D_PAD_SD3_RESET_B__NAND_WE_B                           0x01FC 0x046C 0x0000 0x1 0x0
+#define MX7D_PAD_SD3_RESET_B__SD3_RESET                           0x01FC 0x046C 0x0000 0x2 0x0
+#define MX7D_PAD_SD3_RESET_B__SAI3_MCLK                           0x01FC 0x046C 0x0000 0x3 0x0
+#define MX7D_PAD_SD3_RESET_B__GPIO6_IO11                          0x01FC 0x046C 0x0000 0x5 0x0
+#define MX7D_PAD_SAI1_RX_DATA__SAI1_RX_DATA0                      0x0200 0x0470 0x06A0 0x0 0x0
+#define MX7D_PAD_SAI1_RX_DATA__NAND_CE1_B                         0x0200 0x0470 0x0000 0x1 0x0
+#define MX7D_PAD_SAI1_RX_DATA__UART5_DCE_RX                       0x0200 0x0470 0x0714 0x2 0x2
+#define MX7D_PAD_SAI1_RX_DATA__UART5_DTE_TX                       0x0200 0x0470 0x0000 0x2 0x0
+#define MX7D_PAD_SAI1_RX_DATA__FLEXCAN1_RX                        0x0200 0x0470 0x04DC 0x3 0x3
+#define MX7D_PAD_SAI1_RX_DATA__SIM1_PORT1_TRXD                    0x0200 0x0470 0x06E4 0x4 0x1
+#define MX7D_PAD_SAI1_RX_DATA__GPIO6_IO12                         0x0200 0x0470 0x0000 0x5 0x0
+#define MX7D_PAD_SAI1_RX_DATA__SRC_ANY_PU_RESET                   0x0200 0x0470 0x0000 0x7 0x0
+#define MX7D_PAD_SAI1_TX_BCLK__SAI1_TX_BCLK                       0x0204 0x0474 0x06A8 0x0 0x0
+#define MX7D_PAD_SAI1_TX_BCLK__NAND_CE0_B                         0x0204 0x0474 0x0000 0x1 0x0
+#define MX7D_PAD_SAI1_TX_BCLK__UART5_DCE_TX                       0x0204 0x0474 0x0000 0x2 0x0
+#define MX7D_PAD_SAI1_TX_BCLK__UART5_DTE_RX                       0x0204 0x0474 0x0714 0x2 0x3
+#define MX7D_PAD_SAI1_TX_BCLK__FLEXCAN1_TX                        0x0204 0x0474 0x0000 0x3 0x0
+#define MX7D_PAD_SAI1_TX_BCLK__SIM1_PORT1_CLK                     0x0204 0x0474 0x0000 0x4 0x0
+#define MX7D_PAD_SAI1_TX_BCLK__GPIO6_IO13                         0x0204 0x0474 0x0000 0x5 0x0
+#define MX7D_PAD_SAI1_TX_BCLK__SRC_EARLY_RESET                    0x0204 0x0474 0x0000 0x7 0x0
+#define MX7D_PAD_SAI1_TX_SYNC__SAI1_TX_SYNC                       0x0208 0x0478 0x06AC 0x0 0x0
+#define MX7D_PAD_SAI1_TX_SYNC__NAND_DQS                           0x0208 0x0478 0x0000 0x1 0x0
+#define MX7D_PAD_SAI1_TX_SYNC__UART5_DCE_CTS                      0x0208 0x0478 0x0000 0x2 0x0
+#define MX7D_PAD_SAI1_TX_SYNC__UART5_DTE_RTS                      0x0208 0x0478 0x0710 0x2 0x2
+#define MX7D_PAD_SAI1_TX_SYNC__FLEXCAN2_RX                        0x0208 0x0478 0x04E0 0x3 0x3
+#define MX7D_PAD_SAI1_TX_SYNC__SIM1_PORT1_RST_B                   0x0208 0x0478 0x0000 0x4 0x0
+#define MX7D_PAD_SAI1_TX_SYNC__GPIO6_IO14                         0x0208 0x0478 0x0000 0x5 0x0
+#define MX7D_PAD_SAI1_TX_SYNC__SRC_INT_BOOT                       0x0208 0x0478 0x0000 0x7 0x0
+#define MX7D_PAD_SAI1_TX_DATA__SAI1_TX_DATA0                      0x020C 0x047C 0x0000 0x0 0x0
+#define MX7D_PAD_SAI1_TX_DATA__NAND_READY_B                       0x020C 0x047C 0x0000 0x1 0x0
+#define MX7D_PAD_SAI1_TX_DATA__UART5_DCE_RTS                      0x020C 0x047C 0x0710 0x2 0x3
+#define MX7D_PAD_SAI1_TX_DATA__UART5_DTE_CTS                      0x020C 0x047C 0x0000 0x2 0x0
+#define MX7D_PAD_SAI1_TX_DATA__FLEXCAN2_TX                        0x020C 0x047C 0x0000 0x3 0x0
+#define MX7D_PAD_SAI1_TX_DATA__SIM1_PORT1_SVEN                    0x020C 0x047C 0x0000 0x4 0x0
+#define MX7D_PAD_SAI1_TX_DATA__GPIO6_IO15                         0x020C 0x047C 0x0000 0x5 0x0
+#define MX7D_PAD_SAI1_TX_DATA__SRC_SYSTEM_RESET                   0x020C 0x047C 0x0000 0x7 0x0
+#define MX7D_PAD_SAI1_RX_SYNC__SAI1_RX_SYNC                       0x0210 0x0480 0x06A4 0x0 0x0
+#define MX7D_PAD_SAI1_RX_SYNC__NAND_CE2_B                         0x0210 0x0480 0x0000 0x1 0x0
+#define MX7D_PAD_SAI1_RX_SYNC__SAI2_RX_SYNC                       0x0210 0x0480 0x06B8 0x2 0x1
+#define MX7D_PAD_SAI1_RX_SYNC__I2C4_SCL                           0x0210 0x0480 0x05EC 0x3 0x3
+#define MX7D_PAD_SAI1_RX_SYNC__SIM1_PORT1_PD                      0x0210 0x0480 0x06E0 0x4 0x1
+#define MX7D_PAD_SAI1_RX_SYNC__GPIO6_IO16                         0x0210 0x0480 0x0000 0x5 0x0
+#define MX7D_PAD_SAI1_RX_SYNC__MQS_RIGHT                          0x0210 0x0480 0x0000 0x6 0x0
+#define MX7D_PAD_SAI1_RX_SYNC__SRC_CA7_RESET_B0                   0x0210 0x0480 0x0000 0x7 0x0
+#define MX7D_PAD_SAI1_RX_BCLK__SAI1_RX_BCLK                       0x0214 0x0484 0x069C 0x0 0x0
+#define MX7D_PAD_SAI1_RX_BCLK__NAND_CE3_B                         0x0214 0x0484 0x0000 0x1 0x0
+#define MX7D_PAD_SAI1_RX_BCLK__SAI2_RX_BCLK                       0x0214 0x0484 0x06B0 0x2 0x1
+#define MX7D_PAD_SAI1_RX_BCLK__I2C4_SDA                           0x0214 0x0484 0x05F0 0x3 0x3
+#define MX7D_PAD_SAI1_RX_BCLK__FLEXTIMER2_PHA                     0x0214 0x0484 0x05CC 0x4 0x1
+#define MX7D_PAD_SAI1_RX_BCLK__GPIO6_IO17                         0x0214 0x0484 0x0000 0x5 0x0
+#define MX7D_PAD_SAI1_RX_BCLK__MQS_LEFT                           0x0214 0x0484 0x0000 0x6 0x0
+#define MX7D_PAD_SAI1_RX_BCLK__SRC_CA7_RESET_B1                   0x0214 0x0484 0x0000 0x7 0x0
+#define MX7D_PAD_SAI1_MCLK__SAI1_MCLK                             0x0218 0x0488 0x0000 0x0 0x0
+#define MX7D_PAD_SAI1_MCLK__NAND_WP_B                             0x0218 0x0488 0x0000 0x1 0x0
+#define MX7D_PAD_SAI1_MCLK__SAI2_MCLK                             0x0218 0x0488 0x0000 0x2 0x0
+#define MX7D_PAD_SAI1_MCLK__CCM_PMIC_READY                        0x0218 0x0488 0x04F4 0x3 0x3
+#define MX7D_PAD_SAI1_MCLK__FLEXTIMER2_PHB                        0x0218 0x0488 0x05D0 0x4 0x1
+#define MX7D_PAD_SAI1_MCLK__GPIO6_IO18                            0x0218 0x0488 0x0000 0x5 0x0
+#define MX7D_PAD_SAI1_MCLK__SRC_TESTER_ACK                        0x0218 0x0488 0x0000 0x7 0x0
+#define MX7D_PAD_SAI2_TX_SYNC__SAI2_TX_SYNC                       0x021C 0x048C 0x06C0 0x0 0x1
+#define MX7D_PAD_SAI2_TX_SYNC__ECSPI3_MISO                        0x021C 0x048C 0x0548 0x1 0x1
+#define MX7D_PAD_SAI2_TX_SYNC__UART4_DCE_RX                       0x021C 0x048C 0x070C 0x2 0x4
+#define MX7D_PAD_SAI2_TX_SYNC__UART4_DTE_TX                       0x021C 0x048C 0x0000 0x2 0x0
+#define MX7D_PAD_SAI2_TX_SYNC__UART1_DCE_CTS                      0x021C 0x048C 0x0000 0x3 0x0
+#define MX7D_PAD_SAI2_TX_SYNC__UART1_DTE_RTS                      0x021C 0x048C 0x06F0 0x3 0x0
+#define MX7D_PAD_SAI2_TX_SYNC__FLEXTIMER2_CH4                     0x021C 0x048C 0x05BC 0x4 0x1
+#define MX7D_PAD_SAI2_TX_SYNC__GPIO6_IO19                         0x021C 0x048C 0x0000 0x5 0x0
+#define MX7D_PAD_SAI2_TX_BCLK__SAI2_TX_BCLK                       0x0220 0x0490 0x06BC 0x0 0x1
+#define MX7D_PAD_SAI2_TX_BCLK__ECSPI3_MOSI                        0x0220 0x0490 0x054C 0x1 0x1
+#define MX7D_PAD_SAI2_TX_BCLK__UART4_DCE_TX                       0x0220 0x0490 0x0000 0x2 0x0
+#define MX7D_PAD_SAI2_TX_BCLK__UART4_DTE_RX                       0x0220 0x0490 0x070C 0x2 0x5
+#define MX7D_PAD_SAI2_TX_BCLK__UART1_DCE_RTS                      0x0220 0x0490 0x06F0 0x3 0x1
+#define MX7D_PAD_SAI2_TX_BCLK__UART1_DTE_CTS                      0x0220 0x0490 0x0000 0x3 0x0
+#define MX7D_PAD_SAI2_TX_BCLK__FLEXTIMER2_CH5                     0x0220 0x0490 0x05C0 0x4 0x1
+#define MX7D_PAD_SAI2_TX_BCLK__GPIO6_IO20                         0x0220 0x0490 0x0000 0x5 0x0
+#define MX7D_PAD_SAI2_RX_DATA__SAI2_RX_DATA0                      0x0224 0x0494 0x06B4 0x0 0x1
+#define MX7D_PAD_SAI2_RX_DATA__ECSPI3_SCLK                        0x0224 0x0494 0x0544 0x1 0x1
+#define MX7D_PAD_SAI2_RX_DATA__UART4_DCE_CTS                      0x0224 0x0494 0x0000 0x2 0x0
+#define MX7D_PAD_SAI2_RX_DATA__UART4_DTE_RTS                      0x0224 0x0494 0x0708 0x2 0x4
+#define MX7D_PAD_SAI2_RX_DATA__UART2_DCE_CTS                      0x0224 0x0494 0x0000 0x3 0x0
+#define MX7D_PAD_SAI2_RX_DATA__UART2_DTE_RTS                      0x0224 0x0494 0x06F8 0x3 0x2
+#define MX7D_PAD_SAI2_RX_DATA__FLEXTIMER2_CH6                     0x0224 0x0494 0x05C4 0x4 0x1
+#define MX7D_PAD_SAI2_RX_DATA__GPIO6_IO21                         0x0224 0x0494 0x0000 0x5 0x0
+#define MX7D_PAD_SAI2_RX_DATA__KPP_COL7                           0x0224 0x0494 0x0610 0x6 0x1
+#define MX7D_PAD_SAI2_TX_DATA__SAI2_TX_DATA0                      0x0228 0x0498 0x0000 0x0 0x0
+#define MX7D_PAD_SAI2_TX_DATA__ECSPI3_SS0                         0x0228 0x0498 0x0550 0x1 0x1
+#define MX7D_PAD_SAI2_TX_DATA__UART4_DCE_RTS                      0x0228 0x0498 0x0708 0x2 0x5
+#define MX7D_PAD_SAI2_TX_DATA__UART4_DTE_CTS                      0x0228 0x0498 0x0000 0x2 0x0
+#define MX7D_PAD_SAI2_TX_DATA__UART2_DCE_RTS                      0x0228 0x0498 0x06F8 0x3 0x3
+#define MX7D_PAD_SAI2_TX_DATA__UART2_DTE_CTS                      0x0228 0x0498 0x0000 0x3 0x0
+#define MX7D_PAD_SAI2_TX_DATA__FLEXTIMER2_CH7                     0x0228 0x0498 0x05C8 0x4 0x1
+#define MX7D_PAD_SAI2_TX_DATA__GPIO6_IO22                         0x0228 0x0498 0x0000 0x5 0x0
+#define MX7D_PAD_SAI2_TX_DATA__KPP_ROW7                           0x0228 0x0498 0x0630 0x6 0x1
+#define MX7D_PAD_ENET1_RGMII_RD0__ENET1_RGMII_RD0                 0x022C 0x049C 0x0000 0x0 0x0
+#define MX7D_PAD_ENET1_RGMII_RD0__PWM1_OUT                        0x022C 0x049C 0x0000 0x1 0x0
+#define MX7D_PAD_ENET1_RGMII_RD0__I2C3_SCL                        0x022C 0x049C 0x05E4 0x2 0x4
+#define MX7D_PAD_ENET1_RGMII_RD0__UART1_DCE_CTS                   0x022C 0x049C 0x0000 0x3 0x0
+#define MX7D_PAD_ENET1_RGMII_RD0__UART1_DTE_RTS                   0x022C 0x049C 0x06F0 0x3 0x2
+#define MX7D_PAD_ENET1_RGMII_RD0__EPDC_VCOM0                      0x022C 0x049C 0x0000 0x4 0x0
+#define MX7D_PAD_ENET1_RGMII_RD0__GPIO7_IO0                       0x022C 0x049C 0x0000 0x5 0x0
+#define MX7D_PAD_ENET1_RGMII_RD0__KPP_ROW3                        0x022C 0x049C 0x0620 0x6 0x1
+#define MX7D_PAD_ENET1_RGMII_RD1__ENET1_RGMII_RD1                 0x0230 0x04A0 0x0000 0x0 0x0
+#define MX7D_PAD_ENET1_RGMII_RD1__PWM2_OUT                        0x0230 0x04A0 0x0000 0x1 0x0
+#define MX7D_PAD_ENET1_RGMII_RD1__I2C3_SDA                        0x0230 0x04A0 0x05E8 0x2 0x4
+#define MX7D_PAD_ENET1_RGMII_RD1__UART1_DCE_RTS                   0x0230 0x04A0 0x06F0 0x3 0x3
+#define MX7D_PAD_ENET1_RGMII_RD1__UART1_DTE_CTS                   0x0230 0x04A0 0x0000 0x3 0x0
+#define MX7D_PAD_ENET1_RGMII_RD1__EPDC_VCOM1                      0x0230 0x04A0 0x0000 0x4 0x0
+#define MX7D_PAD_ENET1_RGMII_RD1__GPIO7_IO1                       0x0230 0x04A0 0x0000 0x5 0x0
+#define MX7D_PAD_ENET1_RGMII_RD1__KPP_COL3                        0x0230 0x04A0 0x0600 0x6 0x1
+#define MX7D_PAD_ENET1_RGMII_RD2__ENET1_RGMII_RD2                 0x0234 0x04A4 0x0000 0x0 0x0
+#define MX7D_PAD_ENET1_RGMII_RD2__FLEXCAN1_RX                     0x0234 0x04A4 0x04DC 0x1 0x4
+#define MX7D_PAD_ENET1_RGMII_RD2__ECSPI2_SCLK                     0x0234 0x04A4 0x0534 0x2 0x1
+#define MX7D_PAD_ENET1_RGMII_RD2__UART1_DCE_RX                    0x0234 0x04A4 0x06F4 0x3 0x2
+#define MX7D_PAD_ENET1_RGMII_RD2__UART1_DTE_TX                    0x0234 0x04A4 0x0000 0x3 0x0
+#define MX7D_PAD_ENET1_RGMII_RD2__EPDC_SDCE4                      0x0234 0x04A4 0x0000 0x4 0x0
+#define MX7D_PAD_ENET1_RGMII_RD2__GPIO7_IO2                       0x0234 0x04A4 0x0000 0x5 0x0
+#define MX7D_PAD_ENET1_RGMII_RD2__KPP_ROW2                        0x0234 0x04A4 0x061C 0x6 0x1
+#define MX7D_PAD_ENET1_RGMII_RD3__ENET1_RGMII_RD3                 0x0238 0x04A8 0x0000 0x0 0x0
+#define MX7D_PAD_ENET1_RGMII_RD3__FLEXCAN1_TX                     0x0238 0x04A8 0x0000 0x1 0x0
+#define MX7D_PAD_ENET1_RGMII_RD3__ECSPI2_MOSI                     0x0238 0x04A8 0x053C 0x2 0x1
+#define MX7D_PAD_ENET1_RGMII_RD3__UART1_DCE_TX                    0x0238 0x04A8 0x0000 0x3 0x0
+#define MX7D_PAD_ENET1_RGMII_RD3__UART1_DTE_RX                    0x0238 0x04A8 0x06F4 0x3 0x3
+#define MX7D_PAD_ENET1_RGMII_RD3__EPDC_SDCE5                      0x0238 0x04A8 0x0000 0x4 0x0
+#define MX7D_PAD_ENET1_RGMII_RD3__GPIO7_IO3                       0x0238 0x04A8 0x0000 0x5 0x0
+#define MX7D_PAD_ENET1_RGMII_RD3__KPP_COL2                        0x0238 0x04A8 0x05FC 0x6 0x1
+#define MX7D_PAD_ENET1_RGMII_RX_CTL__ENET1_RGMII_RX_CTL           0x023C 0x04AC 0x0000 0x0 0x0
+#define MX7D_PAD_ENET1_RGMII_RX_CTL__ECSPI2_SS1                   0x023C 0x04AC 0x0000 0x2 0x0
+#define MX7D_PAD_ENET1_RGMII_RX_CTL__EPDC_SDCE6                   0x023C 0x04AC 0x0000 0x4 0x0
+#define MX7D_PAD_ENET1_RGMII_RX_CTL__GPIO7_IO4                    0x023C 0x04AC 0x0000 0x5 0x0
+#define MX7D_PAD_ENET1_RGMII_RX_CTL__KPP_ROW1                     0x023C 0x04AC 0x0618 0x6 0x1
+#define MX7D_PAD_ENET1_RGMII_RXC__ENET1_RGMII_RXC                 0x0240 0x04B0 0x0000 0x0 0x0
+#define MX7D_PAD_ENET1_RGMII_RXC__ENET1_RX_ER                     0x0240 0x04B0 0x0000 0x1 0x0
+#define MX7D_PAD_ENET1_RGMII_RXC__ECSPI2_SS2                      0x0240 0x04B0 0x0000 0x2 0x0
+#define MX7D_PAD_ENET1_RGMII_RXC__EPDC_SDCE7                      0x0240 0x04B0 0x0000 0x4 0x0
+#define MX7D_PAD_ENET1_RGMII_RXC__GPIO7_IO5                       0x0240 0x04B0 0x0000 0x5 0x0
+#define MX7D_PAD_ENET1_RGMII_RXC__KPP_COL1                        0x0240 0x04B0 0x0000 0x6 0x0
+#define MX7D_PAD_ENET1_RGMII_TD0__ENET1_RGMII_TD0                 0x0244 0x04B4 0x0000 0x0 0x0
+#define MX7D_PAD_ENET1_RGMII_TD0__PWM3_OUT                        0x0244 0x04B4 0x0000 0x1 0x0
+#define MX7D_PAD_ENET1_RGMII_TD0__ECSPI2_SS3                      0x0244 0x04B4 0x0000 0x2 0x0
+#define MX7D_PAD_ENET1_RGMII_TD0__EPDC_SDCE8                      0x0244 0x04B4 0x0000 0x4 0x0
+#define MX7D_PAD_ENET1_RGMII_TD0__GPIO7_IO6                       0x0244 0x04B4 0x0000 0x5 0x0
+#define MX7D_PAD_ENET1_RGMII_TD0__KPP_ROW0                        0x0244 0x04B4 0x0614 0x6 0x1
+#define MX7D_PAD_ENET1_RGMII_TD1__ENET1_RGMII_TD1                 0x0248 0x04B8 0x0000 0x0 0x0
+#define MX7D_PAD_ENET1_RGMII_TD1__PWM4_OUT                        0x0248 0x04B8 0x0000 0x1 0x0
+#define MX7D_PAD_ENET1_RGMII_TD1__ECSPI2_RDY                      0x0248 0x04B8 0x0000 0x2 0x0
+#define MX7D_PAD_ENET1_RGMII_TD1__EPDC_SDCE9                      0x0248 0x04B8 0x0000 0x4 0x0
+#define MX7D_PAD_ENET1_RGMII_TD1__GPIO7_IO7                       0x0248 0x04B8 0x0000 0x5 0x0
+#define MX7D_PAD_ENET1_RGMII_TD1__KPP_COL0                        0x0248 0x04B8 0x05F4 0x6 0x1
+#define MX7D_PAD_ENET1_RGMII_TD2__ENET1_RGMII_TD2                 0x024C 0x04BC 0x0000 0x0 0x0
+#define MX7D_PAD_ENET1_RGMII_TD2__FLEXCAN2_RX                     0x024C 0x04BC 0x04E0 0x1 0x4
+#define MX7D_PAD_ENET1_RGMII_TD2__ECSPI2_MISO                     0x024C 0x04BC 0x0538 0x2 0x1
+#define MX7D_PAD_ENET1_RGMII_TD2__I2C4_SCL                        0x024C 0x04BC 0x05EC 0x3 0x4
+#define MX7D_PAD_ENET1_RGMII_TD2__EPDC_SDOED                      0x024C 0x04BC 0x0000 0x4 0x0
+#define MX7D_PAD_ENET1_RGMII_TD2__GPIO7_IO8                       0x024C 0x04BC 0x0000 0x5 0x0
+#define MX7D_PAD_ENET1_RGMII_TD3__ENET1_RGMII_TD3                 0x0250 0x04C0 0x0000 0x0 0x0
+#define MX7D_PAD_ENET1_RGMII_TD3__FLEXCAN2_TX                     0x0250 0x04C0 0x0000 0x1 0x0
+#define MX7D_PAD_ENET1_RGMII_TD3__ECSPI2_SS0                      0x0250 0x04C0 0x0540 0x2 0x1
+#define MX7D_PAD_ENET1_RGMII_TD3__I2C4_SDA                        0x0250 0x04C0 0x05F0 0x3 0x4
+#define MX7D_PAD_ENET1_RGMII_TD3__EPDC_SDOEZ                      0x0250 0x04C0 0x0000 0x4 0x0
+#define MX7D_PAD_ENET1_RGMII_TD3__GPIO7_IO9                       0x0250 0x04C0 0x0000 0x5 0x0
+#define MX7D_PAD_ENET1_RGMII_TD3__CAAM_RNG_OSC_OBS                0x0250 0x04C0 0x0000 0x7 0x0
+#define MX7D_PAD_ENET1_RGMII_TX_CTL__ENET1_RGMII_TX_CTL           0x0254 0x04C4 0x0000 0x0 0x0
+#define MX7D_PAD_ENET1_RGMII_TX_CTL__SAI1_RX_SYNC                 0x0254 0x04C4 0x0000 0x2 0x0
+#define MX7D_PAD_ENET1_RGMII_TX_CTL__GPT2_COMPARE1                0x0254 0x04C4 0x0000 0x3 0x0
+#define MX7D_PAD_ENET1_RGMII_TX_CTL__EPDC_PWR_CTRL2               0x0254 0x04C4 0x0000 0x4 0x0
+#define MX7D_PAD_ENET1_RGMII_TX_CTL__GPIO7_IO10                   0x0254 0x04C4 0x0000 0x5 0x0
+#define MX7D_PAD_ENET1_RGMII_TXC__ENET1_RGMII_TXC                 0x0258 0x04C8 0x0000 0x0 0x0
+#define MX7D_PAD_ENET1_RGMII_TXC__ENET1_TX_ER                     0x0258 0x04C8 0x0000 0x1 0x0
+#define MX7D_PAD_ENET1_RGMII_TXC__SAI1_RX_BCLK                    0x0258 0x04C8 0x0000 0x2 0x0
+#define MX7D_PAD_ENET1_RGMII_TXC__GPT2_COMPARE2                   0x0258 0x04C8 0x0000 0x3 0x0
+#define MX7D_PAD_ENET1_RGMII_TXC__EPDC_PWR_CTRL3                  0x0258 0x04C8 0x0000 0x4 0x0
+#define MX7D_PAD_ENET1_RGMII_TXC__GPIO7_IO11                      0x0258 0x04C8 0x0000 0x5 0x0
+#define MX7D_PAD_ENET1_TX_CLK__ENET1_TX_CLK                       0x025C 0x04CC 0x0000 0x0 0x0
+#define MX7D_PAD_ENET1_TX_CLK__CCM_ENET_REF_CLK1                  0x025C 0x04CC 0x0564 0x1 0x2
+#define MX7D_PAD_ENET1_TX_CLK__SAI1_RX_DATA0                      0x025C 0x04CC 0x06A0 0x2 0x1
+#define MX7D_PAD_ENET1_TX_CLK__GPT2_COMPARE3                      0x025C 0x04CC 0x0000 0x3 0x0
+#define MX7D_PAD_ENET1_TX_CLK__EPDC_PWR_IRQ                       0x025C 0x04CC 0x057C 0x4 0x1
+#define MX7D_PAD_ENET1_TX_CLK__GPIO7_IO12                         0x025C 0x04CC 0x0000 0x5 0x0
+#define MX7D_PAD_ENET1_TX_CLK__CCM_EXT_CLK1                       0x025C 0x04CC 0x04E4 0x6 0x2
+#define MX7D_PAD_ENET1_TX_CLK__CSU_ALARM_AUT0                     0x025C 0x04CC 0x0000 0x7 0x0
+#define MX7D_PAD_ENET1_RX_CLK__ENET1_RX_CLK                       0x0260 0x04D0 0x056C 0x0 0x0
+#define MX7D_PAD_ENET1_RX_CLK__WDOG2_WDOG_B                       0x0260 0x04D0 0x0000 0x1 0x0
+#define MX7D_PAD_ENET1_RX_CLK__SAI1_TX_BCLK                       0x0260 0x04D0 0x06A8 0x2 0x1
+#define MX7D_PAD_ENET1_RX_CLK__GPT2_CLK                           0x0260 0x04D0 0x0000 0x3 0x0
+#define MX7D_PAD_ENET1_RX_CLK__EPDC_PWR_WAKE                      0x0260 0x04D0 0x0000 0x4 0x0
+#define MX7D_PAD_ENET1_RX_CLK__GPIO7_IO13                         0x0260 0x04D0 0x0000 0x5 0x0
+#define MX7D_PAD_ENET1_RX_CLK__CCM_EXT_CLK2                       0x0260 0x04D0 0x04E8 0x6 0x2
+#define MX7D_PAD_ENET1_RX_CLK__CSU_ALARM_AUT1                     0x0260 0x04D0 0x0000 0x7 0x0
+#define MX7D_PAD_ENET1_CRS__ENET1_CRS                             0x0264 0x04D4 0x0000 0x0 0x0
+#define MX7D_PAD_ENET1_CRS__WDOG2_WDOG_RST_B_DEB                  0x0264 0x04D4 0x0000 0x1 0x0
+#define MX7D_PAD_ENET1_CRS__SAI1_TX_SYNC                          0x0264 0x04D4 0x06AC 0x2 0x1
+#define MX7D_PAD_ENET1_CRS__GPT2_CAPTURE1                         0x0264 0x04D4 0x0000 0x3 0x0
+#define MX7D_PAD_ENET1_CRS__EPDC_PWR_CTRL0                        0x0264 0x04D4 0x0000 0x4 0x0
+#define MX7D_PAD_ENET1_CRS__GPIO7_IO14                            0x0264 0x04D4 0x0000 0x5 0x0
+#define MX7D_PAD_ENET1_CRS__CCM_EXT_CLK3                          0x0264 0x04D4 0x04EC 0x6 0x2
+#define MX7D_PAD_ENET1_CRS__CSU_ALARM_AUT2                        0x0264 0x04D4 0x0000 0x7 0x0
+#define MX7D_PAD_ENET1_COL__ENET1_COL                             0x0268 0x04D8 0x0000 0x0 0x0
+#define MX7D_PAD_ENET1_COL__WDOG1_WDOG_ANY                        0x0268 0x04D8 0x0000 0x1 0x0
+#define MX7D_PAD_ENET1_COL__SAI1_TX_DATA0                         0x0268 0x04D8 0x0000 0x2 0x0
+#define MX7D_PAD_ENET1_COL__GPT2_CAPTURE2                         0x0268 0x04D8 0x0000 0x3 0x0
+#define MX7D_PAD_ENET1_COL__EPDC_PWR_CTRL1                        0x0268 0x04D8 0x0000 0x4 0x0
+#define MX7D_PAD_ENET1_COL__GPIO7_IO15                            0x0268 0x04D8 0x0000 0x5 0x0
+#define MX7D_PAD_ENET1_COL__CCM_EXT_CLK4                          0x0268 0x04D8 0x04F0 0x6 0x2
+#define MX7D_PAD_ENET1_COL__CSU_INT_DEB                           0x0268 0x04D8 0x0000 0x7 0x0
+
+#endif /* __DTS_IMX7D_PINFUNC_H */
diff --git a/arch/arm/boot/dts/imx7d-sdb.dts b/arch/arm/boot/dts/imx7d-sdb.dts
new file mode 100644 (file)
index 0000000..4d1a4b9
--- /dev/null
@@ -0,0 +1,408 @@
+/*
+ * Copyright (C) 2015 Freescale Semiconductor, 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 <dt-bindings/input/input.h>
+#include "imx7d.dtsi"
+
+/ {
+       model = "Freescale i.MX7 SabreSD Board";
+       compatible = "fsl,imx7d-sdb", "fsl,imx7d";
+
+       memory {
+               reg = <0x80000000 0x80000000>;
+       };
+
+       regulators {
+               compatible = "simple-bus";
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               reg_usb_otg1_vbus: regulator@0 {
+                       compatible = "regulator-fixed";
+                       reg = <0>;
+                       regulator-name = "usb_otg1_vbus";
+                       regulator-min-microvolt = <5000000>;
+                       regulator-max-microvolt = <5000000>;
+                       gpio = <&gpio1 5 GPIO_ACTIVE_HIGH>;
+                       enable-active-high;
+               };
+
+               reg_usb_otg2_vbus: regulator@1 {
+                       compatible = "regulator-fixed";
+                       reg = <1>;
+                       regulator-name = "usb_otg2_vbus";
+                       regulator-min-microvolt = <5000000>;
+                       regulator-max-microvolt = <5000000>;
+                       gpio = <&gpio4 7 GPIO_ACTIVE_HIGH>;
+                       enable-active-high;
+               };
+
+               reg_can2_3v3: regulator@2 {
+                       compatible = "regulator-fixed";
+                       reg = <2>;
+                       regulator-name = "can2-3v3";
+                       regulator-min-microvolt = <3300000>;
+                       regulator-max-microvolt = <3300000>;
+                       gpio = <&gpio1 7 GPIO_ACTIVE_LOW>;
+               };
+
+               reg_vref_1v8: regulator@3 {
+                       compatible = "regulator-fixed";
+                       reg = <3>;
+                       regulator-name = "vref-1v8";
+                       regulator-min-microvolt = <1800000>;
+                       regulator-max-microvolt = <1800000>;
+               };
+       };
+};
+
+&cpu0 {
+       arm-supply = <&sw1a_reg>;
+};
+
+&i2c1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_i2c1>;
+       status = "okay";
+
+       pmic: pfuze3000@08 {
+               compatible = "fsl,pfuze3000";
+               reg = <0x08>;
+
+               regulators {
+                       sw1a_reg: sw1a {
+                               regulator-min-microvolt = <700000>;
+                               regulator-max-microvolt = <1475000>;
+                               regulator-boot-on;
+                               regulator-always-on;
+                               regulator-ramp-delay = <6250>;
+                       };
+
+                       /* use sw1c_reg to align with pfuze100/pfuze200 */
+                       sw1c_reg: sw1b {
+                               regulator-min-microvolt = <700000>;
+                               regulator-max-microvolt = <1475000>;
+                               regulator-boot-on;
+                               regulator-always-on;
+                               regulator-ramp-delay = <6250>;
+                       };
+
+                       sw2_reg: sw2 {
+                               regulator-min-microvolt = <1500000>;
+                               regulator-max-microvolt = <1850000>;
+                               regulator-boot-on;
+                               regulator-always-on;
+                       };
+
+                       sw3a_reg: sw3 {
+                               regulator-min-microvolt = <900000>;
+                               regulator-max-microvolt = <1650000>;
+                               regulator-boot-on;
+                               regulator-always-on;
+                       };
+
+                       swbst_reg: swbst {
+                               regulator-min-microvolt = <5000000>;
+                               regulator-max-microvolt = <5150000>;
+                       };
+
+                       snvs_reg: vsnvs {
+                               regulator-min-microvolt = <1000000>;
+                               regulator-max-microvolt = <3000000>;
+                               regulator-boot-on;
+                               regulator-always-on;
+                       };
+
+                       vref_reg: vrefddr {
+                               regulator-boot-on;
+                               regulator-always-on;
+                       };
+
+                       vgen1_reg: vldo1 {
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <3300000>;
+                               regulator-always-on;
+                       };
+
+                       vgen2_reg: vldo2 {
+                               regulator-min-microvolt = <800000>;
+                               regulator-max-microvolt = <1550000>;
+                       };
+
+                       vgen3_reg: vccsd {
+                               regulator-min-microvolt = <2850000>;
+                               regulator-max-microvolt = <3300000>;
+                               regulator-always-on;
+                       };
+
+                       vgen4_reg: v33 {
+                               regulator-min-microvolt = <2850000>;
+                               regulator-max-microvolt = <3300000>;
+                               regulator-always-on;
+                       };
+
+                       vgen5_reg: vldo3 {
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <3300000>;
+                               regulator-always-on;
+                       };
+
+                       vgen6_reg: vldo4 {
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <3300000>;
+                               regulator-always-on;
+                       };
+               };
+       };
+};
+
+&i2c2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_i2c2>;
+       status = "okay";
+};
+
+&i2c3 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_i2c3>;
+       status = "okay";
+};
+
+&i2c4 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_i2c4>;
+       status = "okay";
+
+       codec: wm8960@1a {
+               compatible = "wlf,wm8960";
+               reg = <0x1a>;
+               clocks = <&clks IMX7D_AUDIO_MCLK_ROOT_CLK>;
+               clock-names = "mclk";
+               wlf,shared-lrclk;
+       };
+};
+
+&uart1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_uart1>;
+       assigned-clocks = <&clks IMX7D_UART1_ROOT_SRC>;
+       assigned-clock-parents = <&clks IMX7D_PLL_SYS_MAIN_240M_CLK>;
+       status = "okay";
+};
+
+&usdhc1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_usdhc1>;
+       cd-gpios = <&gpio5 0 0>;
+       wp-gpios = <&gpio5 1 0>;
+       enable-sdio-wakeup;
+       keep-power-in-suspend;
+       status = "okay";
+};
+
+&iomuxc {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_hog>;
+
+       imx7d-sdb {
+               pinctrl_hog: hoggrp {
+                       fsl,pins = <
+                               MX7D_PAD_UART3_CTS_B__GPIO4_IO7         0x14
+                               MX7D_PAD_ECSPI2_SS0__GPIO4_IO23         0x34  /* bt reg on */
+                       >;
+               };
+
+               pinctrl_i2c1: i2c1grp {
+                       fsl,pins = <
+                               MX7D_PAD_I2C1_SDA__I2C1_SDA             0x4000007f
+                               MX7D_PAD_I2C1_SCL__I2C1_SCL             0x4000007f
+                       >;
+               };
+
+               pinctrl_i2c2: i2c2grp {
+                       fsl,pins = <
+                               MX7D_PAD_I2C2_SDA__I2C2_SDA             0x4000007f
+                               MX7D_PAD_I2C2_SCL__I2C2_SCL             0x4000007f
+                       >;
+               };
+
+               pinctrl_i2c3: i2c3grp {
+                       fsl,pins = <
+                               MX7D_PAD_I2C3_SDA__I2C3_SDA             0x4000007f
+                               MX7D_PAD_I2C3_SCL__I2C3_SCL             0x4000007f
+                       >;
+               };
+
+               pinctrl_i2c4: i2c4grp {
+                       fsl,pins = <
+                               MX7D_PAD_SAI1_RX_BCLK__I2C4_SDA         0x4000007f
+                               MX7D_PAD_SAI1_RX_SYNC__I2C4_SCL         0x4000007f
+                       >;
+               };
+
+
+               pinctrl_uart1: uart1grp {
+                       fsl,pins = <
+                               MX7D_PAD_UART1_TX_DATA__UART1_DCE_TX    0x79
+                               MX7D_PAD_UART1_RX_DATA__UART1_DCE_RX    0x79
+                       >;
+               };
+
+               pinctrl_uart5: uart5grp {
+                       fsl,pins = <
+                               MX7D_PAD_SAI1_TX_BCLK__UART5_DCE_TX     0x79
+                               MX7D_PAD_SAI1_RX_DATA__UART5_DCE_RX     0x79
+                               MX7D_PAD_SAI1_TX_SYNC__UART5_DCE_CTS    0x79
+                               MX7D_PAD_SAI1_TX_DATA__UART5_DCE_RTS    0x79
+                       >;
+               };
+
+               pinctrl_uart6: uart6grp {
+                       fsl,pins = <
+                               MX7D_PAD_ECSPI1_MOSI__UART6_DCE_TX      0x79
+                               MX7D_PAD_ECSPI1_SCLK__UART6_DCE_RX      0x79
+                               MX7D_PAD_ECSPI1_SS0__UART6_DCE_CTS      0x79
+                               MX7D_PAD_ECSPI1_MISO__UART6_DCE_RTS     0x79
+                       >;
+               };
+
+               pinctrl_usdhc1: usdhc1grp {
+                       fsl,pins = <
+                               MX7D_PAD_SD1_CMD__SD1_CMD               0x59
+                               MX7D_PAD_SD1_CLK__SD1_CLK               0x19
+                               MX7D_PAD_SD1_DATA0__SD1_DATA0           0x59
+                               MX7D_PAD_SD1_DATA1__SD1_DATA1           0x59
+                               MX7D_PAD_SD1_DATA2__SD1_DATA2           0x59
+                               MX7D_PAD_SD1_DATA3__SD1_DATA3           0x59
+                               MX7D_PAD_SD1_CD_B__GPIO5_IO0            0x59 /* CD */
+                               MX7D_PAD_SD1_WP__GPIO5_IO1              0x59 /* WP */
+                               MX7D_PAD_SD1_RESET_B__GPIO5_IO2         0x59 /* vmmc */
+                       >;
+               };
+
+               pinctrl_usdhc2: usdhc2grp {
+                       fsl,pins = <
+                               MX7D_PAD_SD2_CMD__SD2_CMD               0x59
+                               MX7D_PAD_SD2_CLK__SD2_CLK               0x19
+                               MX7D_PAD_SD2_DATA0__SD2_DATA0           0x59
+                               MX7D_PAD_SD2_DATA1__SD2_DATA1           0x59
+                               MX7D_PAD_SD2_DATA2__SD2_DATA2           0x59
+                               MX7D_PAD_SD2_DATA3__SD2_DATA3           0x59
+                               MX7D_PAD_ECSPI2_MOSI__GPIO4_IO21        0x59 /* WL_REG_ON */
+                       >;
+               };
+
+               pinctrl_usdhc2_100mhz: usdhc2grp_100mhz {
+                       fsl,pins = <
+                               MX7D_PAD_SD2_CMD__SD2_CMD               0x5a
+                               MX7D_PAD_SD2_CLK__SD2_CLK               0x1a
+                               MX7D_PAD_SD2_DATA0__SD2_DATA0           0x5a
+                               MX7D_PAD_SD2_DATA1__SD2_DATA1           0x5a
+                               MX7D_PAD_SD2_DATA2__SD2_DATA2           0x5a
+                               MX7D_PAD_SD2_DATA3__SD2_DATA3           0x5a
+                       >;
+               };
+
+               pinctrl_usdhc2_200mhz: usdhc2grp_200mhz {
+                       fsl,pins = <
+                               MX7D_PAD_SD2_CMD__SD2_CMD               0x5b
+                               MX7D_PAD_SD2_CLK__SD2_CLK               0x1b
+                               MX7D_PAD_SD2_DATA0__SD2_DATA0           0x5b
+                               MX7D_PAD_SD2_DATA1__SD2_DATA1           0x5b
+                               MX7D_PAD_SD2_DATA2__SD2_DATA2           0x5b
+                               MX7D_PAD_SD2_DATA3__SD2_DATA3           0x5b
+                       >;
+               };
+
+
+               pinctrl_usdhc3: usdhc3grp {
+                       fsl,pins = <
+                               MX7D_PAD_SD3_CMD__SD3_CMD               0x59
+                               MX7D_PAD_SD3_CLK__SD3_CLK               0x19
+                               MX7D_PAD_SD3_DATA0__SD3_DATA0           0x59
+                               MX7D_PAD_SD3_DATA1__SD3_DATA1           0x59
+                               MX7D_PAD_SD3_DATA2__SD3_DATA2           0x59
+                               MX7D_PAD_SD3_DATA3__SD3_DATA3           0x59
+                               MX7D_PAD_SD3_DATA4__SD3_DATA4           0x59
+                               MX7D_PAD_SD3_DATA5__SD3_DATA5           0x59
+                               MX7D_PAD_SD3_DATA6__SD3_DATA6           0x59
+                               MX7D_PAD_SD3_DATA7__SD3_DATA7           0x59
+                               MX7D_PAD_SD3_STROBE__SD3_STROBE         0x19
+                       >;
+               };
+
+               pinctrl_usdhc3_100mhz: usdhc3grp_100mhz {
+                       fsl,pins = <
+                               MX7D_PAD_SD3_CMD__SD3_CMD               0x5a
+                               MX7D_PAD_SD3_CLK__SD3_CLK               0x1a
+                               MX7D_PAD_SD3_DATA0__SD3_DATA0           0x5a
+                               MX7D_PAD_SD3_DATA1__SD3_DATA1           0x5a
+                               MX7D_PAD_SD3_DATA2__SD3_DATA2           0x5a
+                               MX7D_PAD_SD3_DATA3__SD3_DATA3           0x5a
+                               MX7D_PAD_SD3_DATA4__SD3_DATA4           0x5a
+                               MX7D_PAD_SD3_DATA5__SD3_DATA5           0x5a
+                               MX7D_PAD_SD3_DATA6__SD3_DATA6           0x5a
+                               MX7D_PAD_SD3_DATA7__SD3_DATA7           0x5a
+                               MX7D_PAD_SD3_STROBE__SD3_STROBE         0x1a
+                       >;
+               };
+
+               pinctrl_usdhc3_200mhz: usdhc3grp_200mhz {
+                       fsl,pins = <
+                               MX7D_PAD_SD3_CMD__SD3_CMD               0x5b
+                               MX7D_PAD_SD3_CLK__SD3_CLK               0x1b
+                               MX7D_PAD_SD3_DATA0__SD3_DATA0           0x5b
+                               MX7D_PAD_SD3_DATA1__SD3_DATA1           0x5b
+                               MX7D_PAD_SD3_DATA2__SD3_DATA2           0x5b
+                               MX7D_PAD_SD3_DATA3__SD3_DATA3           0x5b
+                               MX7D_PAD_SD3_DATA4__SD3_DATA4           0x5b
+                               MX7D_PAD_SD3_DATA5__SD3_DATA5           0x5b
+                               MX7D_PAD_SD3_DATA6__SD3_DATA6           0x5b
+                               MX7D_PAD_SD3_DATA7__SD3_DATA7           0x5b
+                               MX7D_PAD_SD3_STROBE__SD3_STROBE         0x1b
+                       >;
+               };
+
+       };
+};
diff --git a/arch/arm/boot/dts/imx7d.dtsi b/arch/arm/boot/dts/imx7d.dtsi
new file mode 100644 (file)
index 0000000..c42cf8d
--- /dev/null
@@ -0,0 +1,486 @@
+/*
+ * Copyright 2015 Freescale Semiconductor, 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.
+ */
+
+#include <dt-bindings/clock/imx7d-clock.h>
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+#include "imx7d-pinfunc.h"
+#include "skeleton.dtsi"
+
+/ {
+       aliases {
+               gpio0 = &gpio1;
+               gpio1 = &gpio2;
+               gpio2 = &gpio3;
+               gpio3 = &gpio4;
+               gpio4 = &gpio5;
+               gpio5 = &gpio6;
+               gpio6 = &gpio7;
+               i2c0 = &i2c1;
+               i2c1 = &i2c2;
+               i2c2 = &i2c3;
+               i2c3 = &i2c4;
+               mmc0 = &usdhc1;
+               mmc1 = &usdhc2;
+               mmc2 = &usdhc3;
+               serial0 = &uart1;
+               serial1 = &uart2;
+               serial2 = &uart3;
+               serial3 = &uart4;
+               serial4 = &uart5;
+               serial5 = &uart6;
+               serial6 = &uart7;
+       };
+
+       cpus {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               cpu0: cpu@0 {
+                       compatible = "arm,cortex-a7";
+                       device_type = "cpu";
+                       reg = <0>;
+                       operating-points = <
+                               /* KHz  uV */
+                               996000  1075000
+                               792000  975000
+                       >;
+                       clock-latency = <61036>; /* two CLK32 periods */
+                       clocks = <&clks IMX7D_ARM_A7_ROOT_CLK>, <&clks IMX7D_ARM_A7_ROOT_SRC>,
+                                <&clks IMX7D_PLL_ARM_MAIN_CLK>, <&clks IMX7D_PLL_SYS_MAIN_CLK>;
+                       clock-names = "arm", "arm_root_src", "pll_arm", "pll_sys_main";
+               };
+
+               cpu1: cpu@1 {
+                       compatible = "arm,cortex-a7";
+                       device_type = "cpu";
+                       reg = <1>;
+               };
+       };
+
+       intc: interrupt-controller@31001000 {
+               compatible = "arm,cortex-a7-gic";
+               #interrupt-cells = <3>;
+               interrupt-controller;
+               reg = <0x31001000 0x1000>,
+                     <0x31002000 0x1000>,
+                     <0x31004000 0x2000>,
+                     <0x31006000 0x2000>;
+       };
+
+       ckil: clock-cki {
+               compatible = "fixed-clock";
+               #clock-cells = <0>;
+               clock-frequency = <32768>;
+               clock-output-names = "ckil";
+       };
+
+       osc: clock-osc {
+               compatible = "fixed-clock";
+               #clock-cells = <0>;
+               clock-frequency = <24000000>;
+               clock-output-names = "osc";
+       };
+
+       soc {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "simple-bus";
+               interrupt-parent = <&intc>;
+               ranges;
+
+               aips1: aips-bus@30000000 {
+                       compatible = "fsl,aips-bus", "simple-bus";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       reg = <0x30000000 0x400000>;
+                       ranges;
+
+                       gpio1: gpio@30200000 {
+                               compatible = "fsl,imx7d-gpio", "fsl,imx35-gpio";
+                               reg = <0x30200000 0x10000>;
+                               interrupts = <GIC_SPI 64 IRQ_TYPE_LEVEL_HIGH>, /* GPIO1_INT15_0 */
+                                            <GIC_SPI 65 IRQ_TYPE_LEVEL_HIGH>; /* GPIO1_INT31_16 */
+                               gpio-controller;
+                               #gpio-cells = <2>;
+                               interrupt-controller;
+                               #interrupt-cells = <2>;
+                       };
+
+                       gpio2: gpio@30210000 {
+                               compatible = "fsl,imx7d-gpio", "fsl,imx35-gpio";
+                               reg = <0x30210000 0x10000>;
+                               interrupts = <GIC_SPI 66 IRQ_TYPE_LEVEL_HIGH>,
+                                            <GIC_SPI 67 IRQ_TYPE_LEVEL_HIGH>;
+                               gpio-controller;
+                               #gpio-cells = <2>;
+                               interrupt-controller;
+                               #interrupt-cells = <2>;
+                       };
+
+                       gpio3: gpio@30220000 {
+                               compatible = "fsl,imx7d-gpio", "fsl,imx35-gpio";
+                               reg = <0x30220000 0x10000>;
+                               interrupts = <GIC_SPI 68 IRQ_TYPE_LEVEL_HIGH>,
+                                            <GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>;
+                               gpio-controller;
+                               #gpio-cells = <2>;
+                               interrupt-controller;
+                               #interrupt-cells = <2>;
+                       };
+
+                       gpio4: gpio@30230000 {
+                               compatible = "fsl,imx7d-gpio", "fsl,imx35-gpio";
+                               reg = <0x30230000 0x10000>;
+                               interrupts = <GIC_SPI 70 IRQ_TYPE_LEVEL_HIGH>,
+                                            <GIC_SPI 71 IRQ_TYPE_LEVEL_HIGH>;
+                               gpio-controller;
+                               #gpio-cells = <2>;
+                               interrupt-controller;
+                               #interrupt-cells = <2>;
+                       };
+
+                       gpio5: gpio@30240000 {
+                               compatible = "fsl,imx7d-gpio", "fsl,imx35-gpio";
+                               reg = <0x30240000 0x10000>;
+                               interrupts = <GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH>,
+                                            <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>;
+                               gpio-controller;
+                               #gpio-cells = <2>;
+                               interrupt-controller;
+                               #interrupt-cells = <2>;
+                       };
+
+                       gpio6: gpio@30250000 {
+                               compatible = "fsl,imx7d-gpio", "fsl,imx35-gpio";
+                               reg = <0x30250000 0x10000>;
+                               interrupts = <GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH>,
+                                            <GIC_SPI 75 IRQ_TYPE_LEVEL_HIGH>;
+                               gpio-controller;
+                               #gpio-cells = <2>;
+                               interrupt-controller;
+                               #interrupt-cells = <2>;
+                       };
+
+                       gpio7: gpio@30260000 {
+                               compatible = "fsl,imx7d-gpio", "fsl,imx35-gpio";
+                               reg = <0x30260000 0x10000>;
+                               interrupts = <GIC_SPI 76 IRQ_TYPE_LEVEL_HIGH>,
+                                            <GIC_SPI 77 IRQ_TYPE_LEVEL_HIGH>;
+                               gpio-controller;
+                               #gpio-cells = <2>;
+                               interrupt-controller;
+                               #interrupt-cells = <2>;
+                       };
+
+                       gpt1: gpt@302d0000 {
+                               compatible = "fsl,imx7d-gpt", "fsl,imx6sx-gpt";
+                               reg = <0x302d0000 0x10000>;
+                               interrupts = <GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH>;
+                               clocks = <&clks IMX7D_CLK_DUMMY>,
+                                        <&clks IMX7D_GPT1_ROOT_CLK>;
+                               clock-names = "ipg", "per";
+                       };
+
+                       gpt2: gpt@302e0000 {
+                               compatible = "fsl,imx7d-gpt", "fsl,imx6sx-gpt";
+                               reg = <0x302e0000 0x10000>;
+                               interrupts = <GIC_SPI 54 IRQ_TYPE_LEVEL_HIGH>;
+                               clocks = <&clks IMX7D_CLK_DUMMY>,
+                                        <&clks IMX7D_GPT2_ROOT_CLK>;
+                               clock-names = "ipg", "per";
+                               status = "disabled";
+                       };
+
+                       gpt3: gpt@302f0000 {
+                               compatible = "fsl,imx7d-gpt", "fsl,imx6sx-gpt";
+                               reg = <0x302f0000 0x10000>;
+                               interrupts = <GIC_SPI 53 IRQ_TYPE_LEVEL_HIGH>;
+                               clocks = <&clks IMX7D_CLK_DUMMY>,
+                                        <&clks IMX7D_GPT3_ROOT_CLK>;
+                               clock-names = "ipg", "per";
+                               status = "disabled";
+                       };
+
+                       gpt4: gpt@30300000 {
+                               compatible = "fsl,imx7d-gpt", "fsl,imx6sx-gpt";
+                               reg = <0x30300000 0x10000>;
+                               interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>;
+                               clocks = <&clks IMX7D_CLK_DUMMY>,
+                                        <&clks IMX7D_GPT4_ROOT_CLK>;
+                               clock-names = "ipg", "per";
+                               status = "disabled";
+                       };
+
+                       iomuxc: iomuxc@30330000 {
+                               compatible = "fsl,imx7d-iomuxc";
+                               reg = <0x30330000 0x10000>;
+                       };
+
+                       gpr: iomuxc-gpr@30340000 {
+                               compatible = "fsl,imx7d-iomuxc-gpr", "syscon";
+                               reg = <0x30340000 0x10000>;
+                       };
+
+                       ocotp: ocotp-ctrl@30350000 {
+                               compatible = "syscon";
+                               reg = <0x30350000 0x10000>;
+                               clocks = <&clks IMX7D_CLK_DUMMY>;
+                               status = "disabled";
+                       };
+
+                       anatop: anatop@30360000 {
+                               compatible = "fsl,imx7d-anatop", "fsl,imx6q-anatop",
+                                       "syscon", "simple-bus";
+                               reg = <0x30360000 0x10000>;
+                               interrupts = <GIC_SPI 49 IRQ_TYPE_LEVEL_HIGH>,
+                                       <GIC_SPI 51 IRQ_TYPE_LEVEL_HIGH>;
+
+                               reg_1p0d: regulator-vdd1p0d@210 {
+                                       compatible = "fsl,anatop-regulator";
+                                       regulator-name = "vdd1p0d";
+                                       regulator-min-microvolt = <800000>;
+                                       regulator-max-microvolt = <1200000>;
+                                       anatop-reg-offset = <0x210>;
+                                       anatop-vol-bit-shift = <8>;
+                                       anatop-vol-bit-width = <5>;
+                                       anatop-min-bit-val = <8>;
+                                       anatop-min-voltage = <800000>;
+                                       anatop-max-voltage = <1200000>;
+                                       anatop-enable-bit = <31>;
+                               };
+                       };
+
+                       snvs: snvs@30370000 {
+                               compatible = "fsl,sec-v4.0-mon", "simple-bus";
+                               #address-cells = <1>;
+                               #size-cells = <1>;
+                               ranges = <0 0x30370000 0x10000>;
+
+                               snvs-rtc-lp@34 {
+                                       compatible = "fsl,sec-v4.0-mon-rtc-lp";
+                                       reg = <0x34 0x58>;
+                                       interrupts = <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>,
+                                                    <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>;
+                               };
+                       };
+
+                       clks: ccm@30380000 {
+                               compatible = "fsl,imx7d-ccm";
+                               reg = <0x30380000 0x10000>;
+                               interrupts = <GIC_SPI 85 IRQ_TYPE_LEVEL_HIGH>,
+                                            <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>;
+                               #clock-cells = <1>;
+                               clocks = <&ckil>, <&osc>;
+                               clock-names = "ckil", "osc";
+                       };
+
+                       src: src@30390000 {
+                               compatible = "fsl,imx7d-src", "fsl,imx51-src", "syscon";
+                               reg = <0x30390000 0x10000>;
+                               interrupts = <GIC_SPI 89 IRQ_TYPE_LEVEL_HIGH>;
+                               #reset-cells = <1>;
+                       };
+               };
+
+               aips3: aips-bus@30800000 {
+                       compatible = "fsl,aips-bus", "simple-bus";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       reg = <0x30800000 0x400000>;
+                       ranges;
+
+                       uart1: serial@30860000 {
+                               compatible = "fsl,imx7d-uart",
+                                            "fsl,imx6q-uart";
+                               reg = <0x30860000 0x10000>;
+                               interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>;
+                               clocks = <&clks IMX7D_UART1_ROOT_CLK>,
+                                       <&clks IMX7D_UART1_ROOT_CLK>;
+                               clock-names = "ipg", "per";
+                               status = "disabled";
+                       };
+
+                       uart2: serial@30870000 {
+                               compatible = "fsl,imx7d-uart",
+                                            "fsl,imx6q-uart";
+                               reg = <0x30870000 0x10000>;
+                               interrupts = <GIC_SPI 27 IRQ_TYPE_LEVEL_HIGH>;
+                               clocks = <&clks IMX7D_UART2_ROOT_CLK>,
+                                       <&clks IMX7D_UART2_ROOT_CLK>;
+                               clock-names = "ipg", "per";
+                               status = "disabled";
+                       };
+
+                       uart3: serial@30880000 {
+                               compatible = "fsl,imx7d-uart",
+                                            "fsl,imx6q-uart";
+                               reg = <0x30880000 0x10000>;
+                               interrupts = <GIC_SPI 28 IRQ_TYPE_LEVEL_HIGH>;
+                               clocks = <&clks IMX7D_UART3_ROOT_CLK>,
+                                       <&clks IMX7D_UART3_ROOT_CLK>;
+                               clock-names = "ipg", "per";
+                               status = "disabled";
+                       };
+
+                       i2c1: i2c@30a20000 {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               compatible = "fsl,imx7d-i2c", "fsl,imx21-i2c";
+                               reg = <0x30a20000 0x10000>;
+                               interrupts = <GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH>;
+                               clocks = <&clks IMX7D_I2C1_ROOT_CLK>;
+                               status = "disabled";
+                       };
+
+                       i2c2: i2c@30a30000 {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               compatible = "fsl,imx7d-i2c", "fsl,imx21-i2c";
+                               reg = <0x30a30000 0x10000>;
+                               interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>;
+                               clocks = <&clks IMX7D_I2C2_ROOT_CLK>;
+                               status = "disabled";
+                       };
+
+                       i2c3: i2c@30a40000 {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               compatible = "fsl,imx7d-i2c", "fsl,imx21-i2c";
+                               reg = <0x30a40000 0x10000>;
+                               interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>;
+                               clocks = <&clks IMX7D_I2C3_ROOT_CLK>;
+                               status = "disabled";
+                       };
+
+                       i2c4: i2c@30a50000 {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               compatible = "fsl,imx7d-i2c", "fsl,imx21-i2c";
+                               reg = <0x30a50000 0x10000>;
+                               interrupts = <GIC_SPI 38 IRQ_TYPE_LEVEL_HIGH>;
+                               clocks = <&clks IMX7D_I2C4_ROOT_CLK>;
+                               status = "disabled";
+                       };
+
+                       uart4: serial@30a60000 {
+                               compatible = "fsl,imx7d-uart",
+                                            "fsl,imx6q-uart";
+                               reg = <0x30a60000 0x10000>;
+                               interrupts = <GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>;
+                               clocks = <&clks IMX7D_UART4_ROOT_CLK>,
+                                       <&clks IMX7D_UART4_ROOT_CLK>;
+                               clock-names = "ipg", "per";
+                               status = "disabled";
+                       };
+
+                       uart5: serial@30a70000 {
+                               compatible = "fsl,imx7d-uart",
+                                            "fsl,imx6q-uart";
+                               reg = <0x30a70000 0x10000>;
+                               interrupts = <GIC_SPI 30 IRQ_TYPE_LEVEL_HIGH>;
+                               clocks = <&clks IMX7D_UART5_ROOT_CLK>,
+                                       <&clks IMX7D_UART5_ROOT_CLK>;
+                               clock-names = "ipg", "per";
+                               status = "disabled";
+                       };
+
+                       uart6: serial@30a80000 {
+                               compatible = "fsl,imx7d-uart",
+                                            "fsl,imx6q-uart";
+                               reg = <0x30a80000 0x10000>;
+                               interrupts = <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>;
+                               clocks = <&clks IMX7D_UART6_ROOT_CLK>,
+                                       <&clks IMX7D_UART6_ROOT_CLK>;
+                               clock-names = "ipg", "per";
+                               status = "disabled";
+                       };
+
+                       uart7: serial@30a90000 {
+                               compatible = "fsl,imx7d-uart",
+                                            "fsl,imx6q-uart";
+                               reg = <0x30a90000 0x10000>;
+                               interrupts = <GIC_SPI 126 IRQ_TYPE_LEVEL_HIGH>;
+                               clocks = <&clks IMX7D_UART7_ROOT_CLK>,
+                                       <&clks IMX7D_UART7_ROOT_CLK>;
+                               clock-names = "ipg", "per";
+                               status = "disabled";
+                       };
+
+                       usdhc1: usdhc@30b40000 {
+                               compatible = "fsl,imx7d-usdhc", "fsl,imx6sl-usdhc";
+                               reg = <0x30b40000 0x10000>;
+                               interrupts = <GIC_SPI 22 IRQ_TYPE_LEVEL_HIGH>;
+                               clocks = <&clks IMX7D_CLK_DUMMY>,
+                                       <&clks IMX7D_CLK_DUMMY>,
+                                       <&clks IMX7D_USDHC1_ROOT_CLK>;
+                               clock-names = "ipg", "ahb", "per";
+                               bus-width = <4>;
+                               status = "disabled";
+                       };
+
+                       usdhc2: usdhc@30b50000 {
+                               compatible = "fsl,imx7d-usdhc", "fsl,imx6sl-usdhc";
+                               reg = <0x30b50000 0x10000>;
+                               interrupts = <GIC_SPI 23 IRQ_TYPE_LEVEL_HIGH>;
+                               clocks = <&clks IMX7D_CLK_DUMMY>,
+                                       <&clks IMX7D_CLK_DUMMY>,
+                                       <&clks IMX7D_USDHC2_ROOT_CLK>;
+                               clock-names = "ipg", "ahb", "per";
+                               bus-width = <4>;
+                               status = "disabled";
+                       };
+
+                       usdhc3: usdhc@30b60000 {
+                               compatible = "fsl,imx7d-usdhc", "fsl,imx6sl-usdhc";
+                               reg = <0x30b60000 0x10000>;
+                               interrupts = <GIC_SPI 24 IRQ_TYPE_LEVEL_HIGH>;
+                               clocks = <&clks IMX7D_CLK_DUMMY>,
+                                       <&clks IMX7D_CLK_DUMMY>,
+                                       <&clks IMX7D_USDHC3_ROOT_CLK>;
+                               clock-names = "ipg", "ahb", "per";
+                               bus-width = <4>;
+                               status = "disabled";
+                       };
+               };
+       };
+};
index 28e38f8c6b0fe46c743b75e5e207089e371bdc5e..3807d4f46ef7c610e102e113615dee8db1508fbc 100644 (file)
@@ -6,7 +6,7 @@
 
 / {
        core-module@10000000 {
-               compatible = "arm,core-module-integrator", "syscon";
+               compatible = "arm,core-module-integrator", "syscon", "simple-mfd";
                reg = <0x10000000 0x200>;
 
                /* Use core module LED to indicate CPU load */
@@ -95,7 +95,7 @@
 
                syscon {
                        /* Debug registers mapped as syscon */
-                       compatible = "syscon";
+                       compatible = "syscon", "simple-mfd";
                        reg = <0x1a000000 0x10>;
 
                        led@04.0 {
index 560d62150ade0d1e29666ae086345054a42d554f..50c83c21d9118baa9b4f0ec2a2e30c20f8d64981 100644 (file)
 };
 
 &mdio {
+       status = "ok";
        ethphy0: ethernet-phy@0 {
                compatible = "marvell,88E1514", "marvell,88E1510", "ethernet-phy-ieee802.3-c22";
                reg = <0>;
diff --git a/arch/arm/boot/dts/k2e-netcp.dtsi b/arch/arm/boot/dts/k2e-netcp.dtsi
new file mode 100644 (file)
index 0000000..b13b3c9
--- /dev/null
@@ -0,0 +1,206 @@
+/*
+ * Device Tree Source for Keystone 2 Edison Netcp driver
+ *
+ * Copyright 2015 Texas Instruments, 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.
+ */
+
+qmss: qmss@2a40000 {
+       compatible = "ti,keystone-navigator-qmss";
+       dma-coherent;
+       #address-cells = <1>;
+       #size-cells = <1>;
+       clocks = <&chipclk13>;
+       ranges;
+       queue-range     = <0 0x2000>;
+       linkram0        = <0x100000 0x4000>;
+       linkram1        = <0 0x10000>;
+
+       qmgrs {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges;
+               qmgr0 {
+                       managed-queues = <0 0x2000>;
+                       reg = <0x2a40000 0x20000>,
+                             <0x2a06000 0x400>,
+                             <0x2a02000 0x1000>,
+                             <0x2a03000 0x1000>,
+                             <0x23a80000 0x20000>,
+                             <0x2a80000 0x20000>;
+                       reg-names = "peek", "status", "config",
+                                   "region", "push", "pop";
+               };
+       };
+       queue-pools {
+               qpend {
+                       qpend-0 {
+                               qrange = <658 8>;
+                               interrupts =<0 40 0xf04 0 41 0xf04 0 42 0xf04
+                                            0 43 0xf04 0 44 0xf04 0 45 0xf04
+                                            0 46 0xf04 0 47 0xf04>;
+                       };
+                       qpend-1 {
+                               qrange = <528 16>;
+                               interrupts = <0 48 0xf04 0 49 0xf04 0 50 0xf04
+                                             0 51 0xf04 0 52 0xf04 0 53 0xf04
+                                             0 54 0xf04 0 55 0xf04 0 56 0xf04
+                                             0 57 0xf04 0 58 0xf04 0 59 0xf04
+                                             0 60 0xf04 0 61 0xf04 0 62 0xf04
+                                             0 63 0xf04>;
+                               qalloc-by-id;
+                       };
+                       qpend-2 {
+                               qrange = <544 16>;
+                               interrupts = <0 64 0xf04 0 65 0xf04 0 66 0xf04
+                                             0 59 0xf04 0 68 0xf04 0 69 0xf04
+                                             0 70 0xf04 0 71 0xf04 0 72 0xf04
+                                             0 73 0xf04 0 74 0xf04 0 75 0xf04
+                                             0 76 0xf04 0 77 0xf04 0 78 0xf04
+                                             0 79 0xf04>;
+                       };
+               };
+               general-purpose {
+                       gp-0 {
+                               qrange = <4000 64>;
+                       };
+                       netcp-tx {
+                               qrange = <896 128>;
+                               qalloc-by-id;
+                       };
+               };
+       };
+       descriptor-regions {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges;
+               region-12 {
+                       id = <12>;
+                       region-spec = <8192 128>;       /* num_desc desc_size */
+                       link-index = <0x4000>;
+               };
+       };
+}; /* qmss */
+
+knav_dmas: knav_dmas@0 {
+       compatible = "ti,keystone-navigator-dma";
+       clocks = <&papllclk>;
+       #address-cells = <1>;
+       #size-cells = <1>;
+       ranges;
+       ti,navigator-cloud-address = <0x23a80000 0x23a90000
+                                0x23a80000 0x23a90000>;
+
+       dma_gbe: dma_gbe@0 {
+               reg = <0x24186000 0x100>,
+                         <0x24187000 0x2a0>,
+                         <0x24188000 0xb60>,
+                         <0x24186100 0x80>,
+                         <0x24189000 0x1000>;
+               reg-names = "global", "txchan", "rxchan",
+                               "txsched", "rxflow";
+       };
+};
+
+netcp: netcp@24000000 {
+       reg = <0x2620110 0x8>;
+       reg-names = "efuse";
+       compatible = "ti,netcp-1.0";
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       /* NetCP address range */
+       ranges = <0 0x24000000 0x1000000>;
+
+       clocks = <&papllclk>, <&clkcpgmac>, <&chipclk12>;
+       dma-coherent;
+
+       ti,navigator-dmas = <&dma_gbe 0>,
+                       <&dma_gbe 8>,
+                       <&dma_gbe 0>;
+       ti,navigator-dma-names = "netrx0", "netrx1", "nettx";
+
+       netcp-devices {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges;
+               gbe@200000 { /* ETHSS */
+                       label = "netcp-gbe";
+                       compatible = "ti,netcp-gbe-9";
+                       reg = <0x200000 0x900>, <0x220000 0x20000>;
+                       /* enable-ale; */
+                       tx-queue = <896>;
+                       tx-channel = "nettx";
+
+                       interfaces {
+                               gbe0: interface-0 {
+                                       slave-port = <0>;
+                                       link-interface  = <1>;
+                                       phy-handle      = <&ethphy0>;
+                               };
+                               gbe1: interface-1 {
+                                       slave-port = <1>;
+                                       link-interface  = <1>;
+                                       phy-handle      = <&ethphy1>;
+                               };
+                       };
+
+                       secondary-slave-ports {
+                               port-2 {
+                                       slave-port = <2>;
+                                       link-interface  = <2>;
+                               };
+                               port-3 {
+                                       slave-port = <3>;
+                                       link-interface  = <2>;
+                               };
+                               port-4 {
+                                       slave-port = <4>;
+                                       link-interface  = <2>;
+                               };
+                               port-5 {
+                                       slave-port = <5>;
+                                       link-interface  = <2>;
+                               };
+                               port-6 {
+                                       slave-port = <6>;
+                                       link-interface  = <2>;
+                               };
+                               port-7 {
+                                       slave-port = <7>;
+                                       link-interface  = <2>;
+                               };
+                       };
+               };
+       };
+
+       netcp-interfaces {
+               interface-0 {
+                       rx-channel = "netrx0";
+                       rx-pool = <1024 12>;
+                       tx-pool = <1024 12>;
+                       rx-queue-depth = <128 128 0 0>;
+                       rx-buffer-size = <1518 4096 0 0>;
+                       rx-queue = <528>;
+                       tx-completion-queue = <530>;
+                       efuse-mac = <1>;
+                       netcp-gbe = <&gbe0>;
+
+               };
+               interface-1 {
+                       rx-channel = "netrx1";
+                       rx-pool = <1024 12>;
+                       tx-pool = <1024 12>;
+                       rx-queue-depth = <128 128 0 0>;
+                       rx-buffer-size = <1518 4096 0 0>;
+                       rx-queue = <529>;
+                       tx-completion-queue = <531>;
+                       efuse-mac = <0>;
+                       local-mac-address = [02 18 31 7e 3e 00];
+                       netcp-gbe = <&gbe1>;
+               };
+       };
+};
index 5fc14683d6df18ccb265538568343177b08fae0f..50e555eab50d98e971014e57ed8611df5a07a007 100644 (file)
                                        <GIC_SPI 376 IRQ_TYPE_EDGE_RISING>;
                        };
                };
+               /include/ "k2e-netcp.dtsi"
        };
 };
 
index 3223cc152a85be670c14f14d8879ac5092837489..660ebf58d547cf4f3f18396159fb7cd5ed7da550 100644 (file)
 };
 
 &mdio {
+       status = "ok";
        ethphy0: ethernet-phy@0 {
                compatible = "marvell,88E1111", "ethernet-phy-ieee802.3-c22";
                reg = <0>;
diff --git a/arch/arm/boot/dts/k2hk-netcp.dtsi b/arch/arm/boot/dts/k2hk-netcp.dtsi
new file mode 100644 (file)
index 0000000..77a32c3
--- /dev/null
@@ -0,0 +1,208 @@
+/*
+ * Device Tree Source for Keystone 2 Hawking Netcp driver
+ *
+ * Copyright 2015 Texas Instruments, 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.
+ */
+
+qmss: qmss@2a40000 {
+       compatible = "ti,keystone-navigator-qmss";
+       dma-coherent;
+       #address-cells = <1>;
+       #size-cells = <1>;
+       clocks = <&chipclk13>;
+       ranges;
+       queue-range     = <0 0x4000>;
+       linkram0        = <0x100000 0x8000>;
+       linkram1        = <0x0 0x10000>;
+
+       qmgrs {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges;
+               qmgr0 {
+                       managed-queues = <0 0x2000>;
+                       reg = <0x2a40000 0x20000>,
+                             <0x2a06000 0x400>,
+                             <0x2a02000 0x1000>,
+                             <0x2a03000 0x1000>,
+                             <0x23a80000 0x20000>,
+                             <0x2a80000 0x20000>;
+                       reg-names = "peek", "status", "config",
+                                   "region", "push", "pop";
+               };
+
+               qmgr1 {
+                       managed-queues = <0x2000 0x2000>;
+                       reg = <0x2a60000 0x20000>,
+                             <0x2a06400 0x400>,
+                             <0x2a04000 0x1000>,
+                             <0x2a05000 0x1000>,
+                             <0x23aa0000 0x20000>,
+                             <0x2aa0000 0x20000>;
+                       reg-names = "peek", "status", "config",
+                                   "region", "push", "pop";
+               };
+       };
+       queue-pools {
+               qpend {
+                       qpend-0 {
+                               qrange = <658 8>;
+                               interrupts =<0 40 0xf04 0 41 0xf04 0 42 0xf04
+                                            0 43 0xf04 0 44 0xf04 0 45 0xf04
+                                            0 46 0xf04 0 47 0xf04>;
+                       };
+                       qpend-1 {
+                               qrange = <8704 16>;
+                               interrupts = <0 48 0xf04 0 49 0xf04 0 50 0xf04
+                                             0 51 0xf04 0 52 0xf04 0 53 0xf04
+                                             0 54 0xf04 0 55 0xf04 0 56 0xf04
+                                             0 57 0xf04 0 58 0xf04 0 59 0xf04
+                                             0 60 0xf04 0 61 0xf04 0 62 0xf04
+                                             0 63 0xf04>;
+                               qalloc-by-id;
+                       };
+                       qpend-2 {
+                               qrange = <8720 16>;
+                               interrupts = <0 64 0xf04 0 65 0xf04 0 66 0xf04
+                                             0 59 0xf04 0 68 0xf04 0 69 0xf04
+                                             0 70 0xf04 0 71 0xf04 0 72 0xf04
+                                             0 73 0xf04 0 74 0xf04 0 75 0xf04
+                                             0 76 0xf04 0 77 0xf04 0 78 0xf04
+                                             0 79 0xf04>;
+                       };
+               };
+               general-purpose {
+                       gp-0 {
+                               qrange = <4000 64>;
+                       };
+                       netcp-tx {
+                               qrange = <640 9>;
+                               qalloc-by-id;
+                       };
+                       netcpx-tx {
+                               qrange = <8752 8>;
+                               qalloc-by-id;
+                       };
+               };
+       };
+       descriptor-regions {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges;
+               region-12 {
+                       id = <12>;
+                       region-spec = <8192 128>;       /* num_desc desc_size */
+                       link-index = <0x4000>;
+               };
+       };
+}; /* qmss */
+
+knav_dmas: knav_dmas@0 {
+       compatible = "ti,keystone-navigator-dma";
+       clocks = <&papllclk>;
+       #address-cells = <1>;
+       #size-cells = <1>;
+       ranges;
+       ti,navigator-cloud-address = <0x23a80000 0x23a90000
+                                  0x23aa0000 0x23ab0000>;
+
+       dma_gbe: dma_gbe@0 {
+               reg = <0x2004000 0x100>,
+                         <0x2004400 0x120>,
+                         <0x2004800 0x300>,
+                         <0x2004c00 0x120>,
+                         <0x2005000 0x400>;
+               reg-names = "global", "txchan", "rxchan",
+                               "txsched", "rxflow";
+       };
+};
+
+netcp: netcp@2000000 {
+       reg = <0x2620110 0x8>;
+       reg-names = "efuse";
+       compatible = "ti,netcp-1.0";
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       /* NetCP address range */
+       ranges  = <0 0x2000000 0x100000>;
+
+       clocks = <&papllclk>, <&clkcpgmac>, <&chipclk12>;
+       dma-coherent;
+
+       ti,navigator-dmas = <&dma_gbe 22>,
+                       <&dma_gbe 23>,
+                       <&dma_gbe 8>;
+       ti,navigator-dma-names = "netrx0", "netrx1", "nettx";
+
+       netcp-devices {
+               ranges;
+               #address-cells = <1>;
+               #size-cells = <1>;
+               gbe@90000 { /* ETHSS */
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       label = "netcp-gbe";
+                       compatible = "ti,netcp-gbe";
+                       reg = <0x90000 0x300>, <0x90400 0x400>, <0x90800 0x700>;
+                       /* enable-ale; */
+                       tx-queue = <648>;
+                       tx-channel = "nettx";
+
+                       interfaces {
+                               gbe0: interface-0 {
+                                       slave-port = <0>;
+                                       link-interface = <1>;
+                                       phy-handle = <&ethphy0>;
+                               };
+                               gbe1: interface-1 {
+                                       slave-port = <1>;
+                                       link-interface = <1>;
+                                       phy-handle = <&ethphy1>;
+                               };
+                       };
+
+                       secondary-slave-ports {
+                               port-2 {
+                                       slave-port = <2>;
+                                       link-interface  = <2>;
+                               };
+                               port-3 {
+                                       slave-port = <3>;
+                                       link-interface  = <2>;
+                               };
+                       };
+               };
+       };
+
+       netcp-interfaces {
+               interface-0 {
+                       rx-channel = "netrx0";
+                       rx-pool = <1024 12>;
+                       tx-pool = <1024 12>;
+                       rx-queue-depth = <128 128 0 0>;
+                       rx-buffer-size = <1518 4096 0 0>;
+                       rx-queue = <8704>;
+                       tx-completion-queue = <8706>;
+                       efuse-mac = <1>;
+                       netcp-gbe = <&gbe0>;
+
+               };
+               interface-1 {
+                       rx-channel = "netrx1";
+                       rx-pool = <1024 12>;
+                       tx-pool = <1024 12>;
+                       rx-queue-depth = <128 128 0 0>;
+                       rx-buffer-size = <1518 4096 0 0>;
+                       rx-queue = <8705>;
+                       tx-completion-queue = <8707>;
+                       efuse-mac = <0>;
+                       local-mac-address = [02 18 31 7e 3e 6f];
+                       netcp-gbe = <&gbe1>;
+               };
+       };
+};
index d721f4b737f79b18387f3983d3e740bcdbb9bf76..ae6472407b2277012096d733bb80951592555d03 100644 (file)
@@ -98,5 +98,6 @@
                        #gpio-cells = <2>;
                        gpio,syscon-dev = <&devctrl 0x25c>;
                };
+               /include/ "k2hk-netcp.dtsi"
        };
 };
index 85cc7f2872d71f04a350ea02cb9f1df398386270..9a69a6b553748bb5752bd12c7dbe9c251e8b7705 100644 (file)
 };
 
 &mdio {
+       status = "ok";
        ethphy0: ethernet-phy@0 {
                compatible = "marvell,88E1514", "marvell,88E1510", "ethernet-phy-ieee802.3-c22";
                reg = <0>;
diff --git a/arch/arm/boot/dts/k2l-netcp.dtsi b/arch/arm/boot/dts/k2l-netcp.dtsi
new file mode 100644 (file)
index 0000000..6b95284
--- /dev/null
@@ -0,0 +1,189 @@
+/*
+ * Device Tree Source for Keystone 2 Lamarr Netcp driver
+ *
+ * Copyright 2015 Texas Instruments, 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.
+ */
+
+qmss: qmss@2a40000 {
+       compatible = "ti,keystone-navigator-qmss";
+       dma-coherent;
+       #address-cells = <1>;
+       #size-cells = <1>;
+       clocks = <&chipclk13>;
+       ranges;
+       queue-range     = <0 0x2000>;
+       linkram0        = <0x100000 0x4000>;
+       linkram1        = <0x70000000 0x10000>; /* 1MB OSR mem */
+
+       qmgrs {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges;
+               qmgr0 {
+                       managed-queues = <0 0x2000>;
+                       reg = <0x2a40000 0x20000>,
+                             <0x2a06000 0x400>,
+                             <0x2a02000 0x1000>,
+                             <0x2a03000 0x1000>,
+                             <0x23a80000 0x20000>,
+                             <0x2a80000 0x20000>;
+                       reg-names = "peek", "status", "config",
+                                   "region", "push", "pop";
+               };
+       };
+       queue-pools {
+               qpend {
+                       qpend-0 {
+                               qrange = <658 8>;
+                               interrupts =<0 40 0xf04 0 41 0xf04 0 42 0xf04
+                                            0 43 0xf04 0 44 0xf04 0 45 0xf04
+                                            0 46 0xf04 0 47 0xf04>;
+                       };
+                       qpend-1 {
+                               qrange = <528 16>;
+                               interrupts = <0 48 0xf04 0 49 0xf04 0 50 0xf04
+                                             0 51 0xf04 0 52 0xf04 0 53 0xf04
+                                             0 54 0xf04 0 55 0xf04 0 56 0xf04
+                                             0 57 0xf04 0 58 0xf04 0 59 0xf04
+                                             0 60 0xf04 0 61 0xf04 0 62 0xf04
+                                             0 63 0xf04>;
+                               qalloc-by-id;
+                       };
+                       qpend-2 {
+                               qrange = <544 16>;
+                               interrupts = <0 64 0xf04 0 65 0xf04 0 66 0xf04
+                                             0 59 0xf04 0 68 0xf04 0 69 0xf04
+                                             0 70 0xf04 0 71 0xf04 0 72 0xf04
+                                             0 73 0xf04 0 74 0xf04 0 75 0xf04
+                                             0 76 0xf04 0 77 0xf04 0 78 0xf04
+                                             0 79 0xf04>;
+                       };
+               };
+               general-purpose {
+                       gp-0 {
+                               qrange = <4000 64>;
+                       };
+                       netcp-tx {
+                               qrange = <896 128>;
+                               qalloc-by-id;
+                       };
+               };
+       };
+       descriptor-regions {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges;
+               region-12 {
+                       id = <12>;
+                       region-spec = <8192 128>;       /* num_desc desc_size */
+                       link-index = <0x4000>;
+               };
+       };
+}; /* qmss */
+
+knav_dmas: knav_dmas@0 {
+       compatible = "ti,keystone-navigator-dma";
+       clocks = <&papllclk>;
+       #address-cells = <1>;
+       #size-cells = <1>;
+       ranges;
+       ti,navigator-cloud-address = <0x23a80000 0x23a90000>;
+
+       dma_gbe: dma_gbe@0 {
+               reg = <0x26186000 0x100>,
+                         <0x26187000 0x2a0>,
+                         <0x26188000 0xb60>,
+                         <0x26186100 0x80>,
+                         <0x26189000 0x1000>;
+               reg-names = "global", "txchan", "rxchan",
+                               "txsched", "rxflow";
+       };
+};
+
+netcp: netcp@26000000 {
+       reg = <0x2620110 0x8>;
+       reg-names = "efuse";
+       compatible = "ti,netcp-1.0";
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       /* NetCP address range */
+       ranges = <0 0x26000000 0x1000000>;
+
+       clocks = <&papllclk>, <&clkcpgmac>, <&chipclk12>;
+       dma-coherent;
+
+       ti,navigator-dmas = <&dma_gbe 0>,
+                       <&dma_gbe 8>,
+                       <&dma_gbe 0>;
+       ti,navigator-dma-names = "netrx0", "netrx1", "nettx";
+
+       netcp-devices {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges;
+               gbe@200000 { /* ETHSS */
+                       label = "netcp-gbe";
+                       compatible = "ti,netcp-gbe-5";
+                       reg = <0x200000 0x900>, <0x220000 0x20000>;
+                       /* enable-ale; */
+                       tx-queue = <896>;
+                       tx-channel = "nettx";
+
+                       interfaces {
+                               gbe0: interface-0 {
+                                       slave-port = <0>;
+                                       link-interface  = <1>;
+                                       phy-handle      = <&ethphy0>;
+                               };
+                               gbe1: interface-1 {
+                                       slave-port = <1>;
+                                       link-interface  = <1>;
+                                       phy-handle      = <&ethphy1>;
+                               };
+                       };
+
+                       secondary-slave-ports {
+                               port-2 {
+                                       slave-port = <2>;
+                                       link-interface  = <2>;
+                               };
+                               port-3 {
+                                       slave-port = <3>;
+                                       link-interface  = <2>;
+                               };
+                       };
+               };
+       };
+
+       netcp-interfaces {
+               interface-0 {
+                       rx-channel = "netrx0";
+                       rx-pool = <1024 12>;
+                       tx-pool = <1024 12>;
+                       rx-queue-depth = <128 128 0 0>;
+                       rx-buffer-size = <1518 4096 0 0>;
+                       rx-queue = <528>;
+                       tx-completion-queue = <530>;
+                       efuse-mac = <1>;
+                       netcp-gbe = <&gbe0>;
+
+               };
+               interface-1 {
+                       rx-channel = "netrx1";
+                       rx-pool = <1024 12>;
+                       tx-pool = <1024 12>;
+                       rx-queue-depth = <128 128 0 0>;
+                       rx-buffer-size = <1518 4096 0 0>;
+                       rx-queue = <529>;
+                       tx-completion-queue = <531>;
+                       efuse-mac = <0>;
+                       local-mac-address = [02 18 31 7e 3e 7f];
+                       netcp-gbe = <&gbe1>;
+               };
+       };
+};
index e32c3baa77b8457bf3bacb230b1da53279890535..0e007483615e4f097bb747a2d882b2e2d3a030aa 100644 (file)
@@ -79,6 +79,7 @@
                        #gpio-cells = <2>;
                        gpio,syscon-dev = <&devctrl 0x24c>;
                };
+               /include/ "k2l-netcp.dtsi"
        };
 };
 
index c9247f8672ae14c24487f9b6902187c48e25fcd3..d2936ad3af1d8d1b73c992906682ed9370c8014d 100644 (file)
@@ -74,7 +74,7 @@
                        m25p16@0 {
                                #address-cells = <1>;
                                #size-cells = <1>;
-                               compatible = "st,m25p16";
+                               compatible = "st,m25p16", "jedec,spi-nor";
                                reg = <0>;
                                spi-max-frequency = <40000000>;
                                mode = <0>;
index ab6ab4933e6bae498216b00efc433ceaf9c157fa..7ec76566acf299e998ebd2207ea790ea71e78ba9 100644 (file)
@@ -42,7 +42,7 @@
                        flash@0 {
                                #address-cells = <1>;
                                #size-cells = <1>;
-                               compatible = "mxicy,mx25l4005a";
+                               compatible = "mxicy,mx25l4005a", "jedec,spi-nor";
                                reg = <0>;
                                spi-max-frequency = <20000000>;
                                mode = <0>;
index 786959ee9cbe1f0b98624cd4bdcbe508bc55586a..0473fcc260f77196d5423d6f753388ebcb7194e0 100644 (file)
@@ -93,7 +93,7 @@
                        m25p80@0 {
                                #address-cells = <1>;
                                #size-cells = <1>;
-                               compatible = "mxicy,mx25l12805d";
+                               compatible = "mxicy,mx25l12805d", "jedec,spi-nor";
                                spi-max-frequency = <50000000>;
                                reg = <0>;
 
index 6467c7924195900f66e91e0ce3bdecc50cf13827..e2abc8246bf3370ef4e2a360a0e15239ad474a60 100644 (file)
@@ -42,7 +42,7 @@
                        m25p40@0 {
                                #address-cells = <1>;
                                #size-cells = <1>;
-                               compatible = "mxicy,mx25l1606e";
+                               compatible = "mxicy,mx25l1606e", "jedec,spi-nor";
                                reg = <0>;
                                spi-max-frequency = <50000000>;
                                mode = <0>;
index 53484474df1f4672ee3b1110f87ed86cbadd613a..1d6528d82969c3dbc8786d0b47a34168f2248315 100644 (file)
@@ -74,7 +74,7 @@
                        m25p40@0 {
                                #address-cells = <1>;
                                #size-cells = <1>;
-                               compatible = "m25p40";
+                               compatible = "m25p40", "jedec,spi-nor";
                                reg = <0>;
                                spi-max-frequency = <25000000>;
                                mode = <0>;
index f82827d6fcff66f93e86b673b7a3f5077ea1bad4..b7e7d78c484e935d9548e8319e3a1b9c5bcdef20 100644 (file)
@@ -65,7 +65,7 @@
                        flash@0 {
                                #address-cells = <1>;
                                #size-cells = <1>;
-                               compatible = "mxicy,mx25l12805d";
+                               compatible = "mxicy,mx25l12805d", "jedec,spi-nor";
                                reg = <0>;
                                spi-max-frequency = <50000000>;
                                mode = <0>;
index b0cfb7cd30b9653155f29fb9c279308e698d1a35..1508b12147df35804837bf2ec9b8882a1681ef09 100644 (file)
@@ -33,7 +33,7 @@
                        flash@0 {
                                #address-cells = <1>;
                                #size-cells = <1>;
-                               compatible = "mxicy,mx25l4005a";
+                               compatible = "mxicy,mx25l4005a", "jedec,spi-nor";
                                reg = <0>;
                                spi-max-frequency = <20000000>;
                                mode = <0>;
index fe6c0246db1ab4749bf453b7e312dbd6ca5667ae..e832b63202640aef7b42667dbe59687c6a9cc662 100644 (file)
@@ -29,7 +29,7 @@
                        flash@0 {
                                #address-cells = <1>;
                                #size-cells = <1>;
-                               compatible = "mxicy,mx25l4005a";
+                               compatible = "mxicy,mx25l4005a", "jedec,spi-nor";
                                reg = <0>;
                                spi-max-frequency = <20000000>;
                                mode = <0>;
index 35a29dee8dd864f818c5cacd437a936eb2de0024..e0b959396ca2bfe4e6e624ef1ff83f1dbb6952fa 100644 (file)
@@ -61,7 +61,7 @@
                        m25p128@0 {
                                #address-cells = <1>;
                                #size-cells = <1>;
-                               compatible = "st,m25p128";
+                               compatible = "st,m25p128", "jedec,spi-nor";
                                reg = <0>;
                                spi-max-frequency = <20000000>;
                                mode = <0>;
index 8be5b2e4626e58bb51c95c0b3f060ed2d56a0aca..04015c174b990ed764fa18f3230b43e47c9c17b9 100644 (file)
                        m25p80@0 {
                                #address-cells = <1>;
                                #size-cells = <1>;
-                               compatible = "st,m25p80";
+                               compatible = "st,m25p80", "jedec,spi-nor";
                                reg = <0>;
                                spi-max-frequency = <20000000>;
                                mode = <0>;
index 610ec0f95858b4691f7c275d8a0d794a27d8863b..ed956b849a71fcf3b2d8b6e1b65bc3ca931c0dde 100644 (file)
@@ -88,7 +88,7 @@
                        flash@0 {
                                #address-cells = <1>;
                                #size-cells = <1>;
-                               compatible = "st,m25p80";
+                               compatible = "st,m25p80", "jedec,spi-nor";
                                spi-max-frequency = <86000000>;
                                reg = <0>;
                                mode = <0>;
index df7f15276575ada26c356e224bb223c63e0b42f8..c56ab6bbfe3c3a1fa1b60f481840cbaa3292a7f2 100644 (file)
@@ -49,7 +49,7 @@
                        m25p128@0 {
                                #address-cells = <1>;
                                #size-cells = <1>;
-                               compatible = "m25p128";
+                               compatible = "m25p128", "jedec,spi-nor";
                                reg = <0>;
                                spi-max-frequency = <20000000>;
                                mode = <0>;
diff --git a/arch/arm/boot/dts/kizbox.dts b/arch/arm/boot/dts/kizbox.dts
deleted file mode 100644 (file)
index e83e4f9..0000000
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * kizbox.dts - Device Tree file for Overkiz Kizbox board
- *
- * Copyright (C) 2012 Boris BREZILLON <linux-arm@overkiz.com>
- *
- * Licensed under GPLv2.
- */
-/dts-v1/;
-#include "at91sam9g20.dtsi"
-
-/ {
-
-       model = "Overkiz kizbox";
-       compatible = "overkiz,kizbox", "atmel,at91sam9g20", "atmel,at91sam9";
-
-       chosen {
-               bootargs = "panic=5 ubi.mtd=1 rootfstype=ubifs root=ubi0:root";
-       };
-
-       memory {
-               reg = <0x20000000 0x2000000>;
-       };
-
-       clocks {
-               #address-cells = <1>;
-               #size-cells = <1>;
-               ranges;
-
-               main_clock: clock@0 {
-                       compatible = "atmel,osc", "fixed-clock";
-                       clock-frequency = <18432000>;
-               };
-
-               main_xtal {
-                       clock-frequency = <18432000>;
-               };
-       };
-
-       ahb {
-               apb {
-                       dbgu: serial@fffff200 {
-                               status = "okay";
-                       };
-
-                       usart0: serial@fffb0000 {
-                               status = "okay";
-                       };
-
-                       usart1: serial@fffb4000 {
-                               status = "okay";
-                       };
-
-                       macb0: ethernet@fffc4000 {
-                               phy-mode = "mii";
-                               pinctrl-0 = <&pinctrl_macb_rmii
-                                            &pinctrl_macb_rmii_mii_alt>;
-                               status = "okay";
-                       };
-
-                       watchdog@fffffd40 {
-                               timeout-sec = <15>;
-                               atmel,max-heartbeat-sec = <16>;
-                               atmel,min-heartbeat-sec = <0>;
-                               status = "okay";
-                       };
-               };
-
-               nand0: nand@40000000 {
-                       nand-bus-width = <8>;
-                       nand-ecc-mode = "soft";
-                       status = "okay";
-
-                       bootloaderkernel@0 {
-                               label = "bootloader-kernel";
-                               reg = <0x0 0xc0000>;
-                       };
-
-                       ubi@c0000 {
-                               label = "ubi";
-                               reg = <0xc0000 0x7f40000>;
-                       };
-
-               };
-
-               usb0: ohci@00500000 {
-                       num-ports = <1>;
-                       status = "okay";
-               };
-       };
-
-       i2c@0 {
-               status = "okay";
-
-               pcf8563@51 {
-                       /* nxp pcf8563 rtc */
-                       compatible = "nxp,pcf8563";
-                       reg = <0x51>;
-               };
-
-       };
-
-       leds {
-               compatible = "gpio-leds";
-
-               led1g {
-                       label = "led1:green";
-                       gpios = <&pioB 0 GPIO_ACTIVE_LOW>;
-                       linux,default-trigger = "none";
-               };
-
-               led1r {
-                       label = "led1:red";
-                       gpios = <&pioB 1 GPIO_ACTIVE_LOW>;
-                       linux,default-trigger = "none";
-               };
-
-               led2g {
-                       label = "led2:green";
-                       gpios = <&pioB 2 GPIO_ACTIVE_LOW>;
-                       linux,default-trigger = "none";
-                       default-state = "on";
-               };
-
-               led2r {
-                       label = "led2:red";
-                       gpios = <&pioB 3 GPIO_ACTIVE_LOW>;
-                       linux,default-trigger = "none";
-               };
-       };
-
-       gpio_keys {
-               compatible = "gpio-keys";
-               #address-cells = <1>;
-               #size-cells = <0>;
-
-               reset {
-                       label = "reset";
-                       gpios = <&pioB 30 GPIO_ACTIVE_LOW>;
-                       linux,code = <0x100>;
-                       gpio-key,wakeup;
-               };
-
-               mode {
-                       label = "mode";
-                       gpios = <&pioB 31 GPIO_ACTIVE_LOW>;
-                       linux,code = <0x101>;
-                       gpio-key,wakeup;
-               };
-       };
-};
diff --git a/arch/arm/boot/dts/logicpd-torpedo-37xx-devkit.dts b/arch/arm/boot/dts/logicpd-torpedo-37xx-devkit.dts
new file mode 100644 (file)
index 0000000..91146c3
--- /dev/null
@@ -0,0 +1,157 @@
+/*
+ * 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 "omap36xx.dtsi"
+#include "logicpd-torpedo-som.dtsi"
+#include "omap-gpmc-smsc9221.dtsi"
+
+/ {
+       model = "LogicPD Zoom DM3730 Torpedo Development Kit";
+       compatible = "logicpd,dm3730-torpedo-devkit", "ti,omap36xx";
+
+       gpio_keys {
+               compatible = "gpio-keys";
+               pinctrl-names = "default";
+               pinctrl-0 = <&gpio_key_pins &gpio_key_pins_wkup>;
+
+               sysboot2 {
+                       label = "sysboot2";
+                       gpios = <&gpio1 2 GPIO_ACTIVE_LOW>;     /* gpio2 */
+                       linux,code = <BTN_0>;
+                       gpio-key,wakeup;
+               };
+
+               sysboot5 {
+                       label = "sysboot5";
+                       gpios = <&gpio1 7 GPIO_ACTIVE_LOW>;     /* gpio7 */
+                       linux,code = <BTN_1>;
+                       gpio-key,wakeup;
+               };
+
+               gpio1 {
+                       label = "gpio1";
+                       gpios = <&gpio6 21 GPIO_ACTIVE_LOW>;    /* gpio181 */
+                       linux,code = <BTN_2>;
+                       gpio-key,wakeup;
+               };
+
+               gpio2 {
+                       label = "gpio2";
+                       gpios = <&gpio6 18 GPIO_ACTIVE_LOW>;    /* gpio178 */
+                       linux,code = <BTN_3>;
+                       gpio-key,wakeup;
+               };
+       };
+
+       leds {
+               compatible = "gpio-leds";
+               pinctrl-names = "default";
+               pinctrl-0 = <&led_pins>;
+
+               led1 {
+                       label = "led1";
+                       gpios = <&gpio6 20 GPIO_ACTIVE_HIGH>;   /* gpio180 */
+                       linux,default-trigger = "cpu0";
+               };
+
+               led2 {
+                       label = "led2";
+                       gpios = <&gpio6 19 GPIO_ACTIVE_HIGH>;   /* gpio179 */
+                       linux,default-trigger = "none";
+               };
+       };
+};
+
+&charger {
+       ti,bb-uvolt = <3200000>;
+       ti,bb-uamp = <150>;
+};
+
+&gpmc {
+       ranges = <1 0 0x08000000 0x1000000>;    /* CS1: 16MB for LAN9221 */
+
+       ethernet@gpmc {
+               pinctrl-names = "default";
+               pinctrl-0 = <&lan9221_pins>;
+               interrupt-parent = <&gpio5>;
+               interrupts = <1 IRQ_TYPE_LEVEL_LOW>;            /* gpio129 */
+               reg = <1 0 0xff>;
+       };
+};
+
+&mmc1 {
+       interrupts-extended = <&intc 83 &omap3_pmx_core 0x11a>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&mmc1_pins &mmc1_cd>;
+       cd-gpios = <&gpio4 31 IRQ_TYPE_LEVEL_LOW>;              /* gpio127 */
+       vmmc-supply = <&vmmc1>;
+       bus-width = <4>;
+       cap-power-off-card;
+};
+
+&omap3_pmx_core {
+       gpio_key_pins: pinmux_gpio_key_pins {
+               pinctrl-single,pins = <
+                       OMAP3_CORE1_IOPAD(0x21d6, PIN_INPUT_PULLUP | MUX_MODE4) /* mcspi2_clk.gpio_178 */
+                       OMAP3_CORE1_IOPAD(0x21dc, PIN_INPUT_PULLUP | MUX_MODE4) /* mcspi2_cs0.gpio_181 */
+               >;
+       };
+
+       led_pins: pinmux_led_pins {
+               pinctrl-single,pins = <
+                       OMAP3_CORE1_IOPAD(0x21d8, PIN_OUTPUT | MUX_MODE4)       /* gpio_179 */
+                       OMAP3_CORE1_IOPAD(0x21da, PIN_OUTPUT | MUX_MODE4)       /* gpio_180 */
+               >;
+       };
+
+       mmc1_pins: pinmux_mmc1_pins {
+               pinctrl-single,pins = <
+                       OMAP3_CORE1_IOPAD(0x2144, PIN_OUTPUT | MUX_MODE0)       /* sdmmc1_clk.sdmmc1_clk */
+                       OMAP3_CORE1_IOPAD(0x2146, PIN_INPUT | MUX_MODE0)        /* sdmmc1_cmd.sdmmc1_cmd */
+                       OMAP3_CORE1_IOPAD(0x2148, PIN_INPUT | MUX_MODE0)        /* sdmmc1_dat0.sdmmc1_dat0 */
+                       OMAP3_CORE1_IOPAD(0x214a, PIN_INPUT | MUX_MODE0)        /* sdmmc1_dat1.sdmmc1_dat1 */
+                       OMAP3_CORE1_IOPAD(0x214c, PIN_INPUT | MUX_MODE0)        /* sdmmc1_dat2.sdmmc1_dat2 */
+                       OMAP3_CORE1_IOPAD(0x214e, PIN_INPUT | MUX_MODE0)        /* sdmmc1_dat3.sdmmc1_dat3 */
+               >;
+       };
+};
+
+&omap3_pmx_wkup {
+       gpio_key_pins_wkup: pinmux_gpio_key_pins_wkup {
+               pinctrl-single,pins = <
+                       OMAP3_WKUP_IOPAD(0x2a0a, PIN_INPUT_PULLUP | MUX_MODE4)  /* sys_boot0.gpio_2 */
+                       OMAP3_WKUP_IOPAD(0x2a14, PIN_INPUT_PULLUP | MUX_MODE4)  /* sys_boot5.gpio_7 */
+               >;
+       };
+
+       lan9221_pins: pinmux_lan9221_pins {
+               pinctrl-single,pins = <
+                       OMAP3_WKUP_IOPAD(0x2a5a, PIN_INPUT | MUX_MODE4)         /* reserved.gpio_129 */
+               >;
+       };
+
+       mmc1_cd: pinmux_mmc1_cd {
+               pinctrl-single,pins = <
+                       OMAP3_WKUP_IOPAD(0x2a54, PIN_INPUT_PULLUP | MUX_MODE4)  /* reserved.gpio_127 */
+               >;
+       };
+};
+
+&uart1 {
+       interrupts-extended = <&intc 72 &omap3_pmx_core OMAP3_UART1_RX>;
+};
+
+/* Wired to the tps65950 on the SOM, only the USB connector is on the devkit */
+&usb_otg_hs {
+       interface-type = <0>;
+       usb-phy = <&usb2_phy>;
+       phys = <&usb2_phy>;
+       phy-names = "usb2-phy";
+       mode = <3>;
+       power = <50>;
+};
diff --git a/arch/arm/boot/dts/logicpd-torpedo-som.dtsi b/arch/arm/boot/dts/logicpd-torpedo-som.dtsi
new file mode 100644 (file)
index 0000000..36387b1
--- /dev/null
@@ -0,0 +1,162 @@
+/*
+ * 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/input/input.h>
+
+/ {
+       cpus {
+               cpu@0 {
+                       cpu0-supply = <&vcc>;
+               };
+       };
+
+       leds {
+               compatible = "gpio-leds";
+               user0 {
+                       label = "user0";
+                       gpios = <&twl_gpio 18 GPIO_ACTIVE_LOW>; /* LEDA */
+                       linux,default-trigger = "none";
+               };
+       };
+
+       wl12xx_vmmc: wl12xx_vmmc {
+               compatible = "regulator-fixed";
+               regulator-name = "vwl1271";
+               regulator-min-microvolt = <1800000>;
+               regulator-max-microvolt = <1800000>;
+               gpio = <&gpio5 29 0>;   /* gpio157 */
+               startup-delay-us = <70000>;
+               enable-active-high;
+               vin-supply = <&vmmc2>;
+       };
+};
+
+&gpmc {
+       ranges = <0 0 0x00000000 0x1000000>;    /* CS0: 16MB for NAND */
+
+       nand@0,0 {
+               linux,mtd-name = "micron,mt29f4g16abbda3w";
+               reg = <0 0 4>; /* CS0, offset 0, IO size 4 */
+               nand-bus-width = <16>;
+               ti,nand-ecc-opt = "bch8";
+               gpmc,sync-clk-ps = <0>;
+               gpmc,cs-on-ns = <0>;
+               gpmc,cs-rd-off-ns = <44>;
+               gpmc,cs-wr-off-ns = <44>;
+               gpmc,adv-on-ns = <6>;
+               gpmc,adv-rd-off-ns = <34>;
+               gpmc,adv-wr-off-ns = <44>;
+               gpmc,we-off-ns = <40>;
+               gpmc,oe-off-ns = <54>;
+               gpmc,access-ns = <64>;
+               gpmc,rd-cycle-ns = <82>;
+               gpmc,wr-cycle-ns = <82>;
+               gpmc,wr-access-ns = <40>;
+               gpmc,wr-data-mux-bus-ns = <0>;
+               gpmc,device-width = <2>;
+               #address-cells = <1>;
+               #size-cells = <1>;
+
+               /* u-boot uses mtdparts=omap2-nand.0:512k(x-loader),1920k(u-boot),128k(u-boot-env),4m(kernel),-(fs) */
+
+               x-loader@0 {
+                       label = "x-loader";
+                       reg = <0 0x80000>;
+               };
+
+               bootloaders@80000 {
+                       label = "u-boot";
+                       reg = <0x80000 0x1e0000>;
+               };
+
+               bootloaders_env@260000 {
+                       label = "u-boot-env";
+                       reg = <0x260000 0x20000>;
+               };
+
+               kernel@280000 {
+                       label = "kernel";
+                       reg = <0x280000 0x400000>;
+               };
+
+               filesystem@680000 {
+                       label = "fs";
+                       reg = <0x680000 0>;     /* 0 = MTDPART_SIZ_FULL */
+               };
+       };
+};
+
+&i2c1 {
+       clock-frequency = <2600000>;
+
+       twl: twl@48 {
+               reg = <0x48>;
+               interrupts = <7>; /* SYS_NIRQ cascaded to intc */
+               interrupt-parent = <&intc>;
+       };
+};
+
+/*
+ * Only found on the wireless SOM. For the SOM without wireless, the pins for
+ * MMC3 can be routed with jumpers to the second MMC slot on the devkit and
+ * gpio157 is not connected. So this should be OK to keep common for now,
+ * probably device tree overlays is the way to go with the various SOM and
+ * jumpering combinations for the long run.
+ */
+&mmc3 {
+       interrupts-extended = <&intc 94 &omap3_pmx_core2 0x46>;
+       pinctrl-0 = <&mmc3_pins &mmc3_core2_pins>;
+       pinctrl-names = "default";
+       vmmc-supply = <&wl12xx_vmmc>;
+       non-removable;
+       bus-width = <4>;
+       cap-power-off-card;
+       #address-cells = <1>;
+       #size-cells = <0>;
+       wlcore: wlcore@2 {
+               compatible = "ti,wl1283";
+               reg = <2>;
+               interrupt-parent = <&gpio5>;
+               interrupts = <24 IRQ_TYPE_LEVEL_HIGH>; /* gpio 152 */
+               ref-clock-frequency = <26000000>;
+       };
+};
+
+&omap3_pmx_core {
+       mmc3_pins: pinmux_mm3_pins {
+               pinctrl-single,pins = <
+                       OMAP3_CORE1_IOPAD(0x2164, PIN_INPUT_PULLUP | MUX_MODE3) /* sdmmc2_dat4.sdmmc3_dat0 */
+                       OMAP3_CORE1_IOPAD(0x2166, PIN_INPUT_PULLUP | MUX_MODE3) /* sdmmc2_dat5.sdmmc3_dat1 */
+                       OMAP3_CORE1_IOPAD(0x2168, PIN_INPUT_PULLUP | MUX_MODE3) /* sdmmc2_dat6.sdmmc3_dat2 */
+                       OMAP3_CORE1_IOPAD(0x216a, PIN_INPUT_PULLUP | MUX_MODE3) /* sdmmc2_dat6.sdmmc3_dat3 */
+                       OMAP3_CORE1_IOPAD(0x2184, PIN_INPUT_PULLUP | MUX_MODE4) /* mcbsp4_clkx.gpio_152 */
+                       OMAP3_CORE1_IOPAD(0x218e, PIN_OUTPUT | MUX_MODE4)       /* mcbsp1_fsr.gpio_157 */
+               >;
+       };
+};
+
+&omap3_pmx_core2 {
+       mmc3_core2_pins: pinmux_mmc3_core2_pins {
+               pinctrl-single,pins = <
+                       OMAP3630_CORE2_IOPAD(0x25d8, PIN_INPUT_PULLUP | MUX_MODE2)   /* etk_clk.sdmmc3_clk */
+                       OMAP3630_CORE2_IOPAD(0x25da, PIN_INPUT_PULLUP | MUX_MODE2)   /* etk_ctl.sdmmc3_cmd */
+               >;
+       };
+};
+
+#include "twl4030.dtsi"
+#include "twl4030_omap3.dtsi"
+
+&twl {
+       twl_power: power {
+               compatible = "ti,twl4030-power-idle-osc-off", "ti,twl4030-power-idle";
+               ti,use_poweroff;
+       };
+};
+
+&twl_gpio {
+       ti,use-leds;
+};
diff --git a/arch/arm/boot/dts/lpc18xx.dtsi b/arch/arm/boot/dts/lpc18xx.dtsi
new file mode 100644 (file)
index 0000000..204da5b
--- /dev/null
@@ -0,0 +1,114 @@
+/*
+ * Common base for NXP LPC18xx and LPC43xx devices.
+ *
+ * Copyright 2015 Joachim Eastwood <manabian@gmail.com>
+ *
+ * This code is released using a dual license strategy: BSD/GPL
+ * You can choose the licence that better fits your requirements.
+ *
+ * Released under the terms of 3-clause BSD License
+ * Released under the terms of GNU General Public License Version 2.0
+ *
+ */
+
+#include "armv7-m.dtsi"
+
+/ {
+       cpus {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               cpu@0 {
+                       compatible = "arm,cortex-m3";
+                       device_type = "cpu";
+                       reg = <0x0>;
+               };
+       };
+
+       clocks {
+               xtal: xtal {
+                       compatible = "fixed-clock";
+                       #clock-cells = <0>;
+                       clock-frequency = <12000000>;
+               };
+
+               /* Temporary hardcode PLL1 until clk drivers are merged */
+               pll1: pll1 {
+                       compatible = "fixed-factor-clock";
+                       clocks = <&xtal>;
+                       #clock-cells = <0>;
+                       clock-div = <1>;
+                       clock-mult = <12>;
+               };
+       };
+
+       soc {
+               uart0: serial@40081000 {
+                       compatible = "ns16550a";
+                       reg = <0x40081000 0x1000>;
+                       reg-shift = <2>;
+                       interrupts = <24>;
+                       clocks = <&pll1>;
+                       status = "disabled";
+               };
+
+               uart1: serial@40082000 {
+                       compatible = "ns16550a";
+                       reg = <0x40082000 0x1000>;
+                       reg-shift = <2>;
+                       interrupts = <25>;
+                       clocks = <&pll1>;
+                       status = "disabled";
+               };
+
+               timer0: timer@40084000 {
+                       compatible = "nxp,lpc3220-timer";
+                       reg = <0x40084000 0x1000>;
+                       interrupts = <12>;
+                       clocks = <&pll1>;
+                       clock-names = "timerclk";
+               };
+
+               timer1: timer@40085000 {
+                       compatible = "nxp,lpc3220-timer";
+                       reg = <0x40085000 0x1000>;
+                       interrupts = <13>;
+                       clocks = <&pll1>;
+                       clock-names = "timerclk";
+               };
+
+               uart2: serial@400c1000 {
+                       compatible = "ns16550a";
+                       reg = <0x400c1000 0x1000>;
+                       reg-shift = <2>;
+                       interrupts = <26>;
+                       clocks = <&pll1>;
+                       status = "disabled";
+               };
+
+               uart3: serial@400c2000 {
+                       compatible = "ns16550a";
+                       reg = <0x400c2000 0x1000>;
+                       reg-shift = <2>;
+                       interrupts = <27>;
+                       clocks = <&pll1>;
+                       status = "disabled";
+               };
+
+               timer2: timer@400c3000 {
+                       compatible = "nxp,lpc3220-timer";
+                       reg = <0x400c3000 0x1000>;
+                       interrupts = <14>;
+                       clocks = <&pll1>;
+                       clock-names = "timerclk";
+               };
+
+               timer3: timer@400c4000 {
+                       compatible = "nxp,lpc3220-timer";
+                       reg = <0x400c4000 0x1000>;
+                       interrupts = <15>;
+                       clocks = <&pll1>;
+                       clock-names = "timerclk";
+               };
+       };
+};
diff --git a/arch/arm/boot/dts/lpc4350-hitex-eval.dts b/arch/arm/boot/dts/lpc4350-hitex-eval.dts
new file mode 100644 (file)
index 0000000..d04072f
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * Hitex LPC4350 Evaluation Board
+ *
+ * Copyright 2015 Ariel D'Alessandro <ariel.dalessandro@gmail.com>
+ *
+ * This code is released using a dual license strategy: BSD/GPL
+ * You can choose the licence that better fits your requirements.
+ *
+ * Released under the terms of 3-clause BSD License
+ * Released under the terms of GNU General Public License Version 2.0
+ *
+ */
+/dts-v1/;
+
+#include "lpc18xx.dtsi"
+#include "lpc4350.dtsi"
+
+/ {
+       model = "Hitex LPC4350 Evaluation Board";
+       compatible = "hitex,lpc4350-eval-board", "nxp,lpc4350";
+
+       aliases {
+               serial0 = &uart0;
+               serial1 = &uart1;
+               serial2 = &uart2;
+               serial3 = &uart3;
+       };
+
+       chosen {
+               stdout-path = &uart0;
+       };
+
+       memory {
+               device_type = "memory";
+               reg = <0x28000000 0x800000>; /* 8 MB */
+       };
+};
+
+&pll1 {
+       clock-mult = <15>;
+};
+
+&uart0 {
+       status = "okay";
+};
diff --git a/arch/arm/boot/dts/lpc4350.dtsi b/arch/arm/boot/dts/lpc4350.dtsi
new file mode 100644 (file)
index 0000000..c4422f5
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * NXP LPC4350 and LPC4330 SoC
+ *
+ * Copyright 2015 Ariel D'Alessandro <ariel.dalessandro@gmail.com>
+ *
+ * This code is released using a dual license strategy: BSD/GPL
+ * You can choose the licence that better fits your requirements.
+ *
+ * Released under the terms of 3-clause BSD License
+ * Released under the terms of GNU General Public License Version 2.0
+ *
+ */
+
+/ {
+       compatible = "nxp,lpc4350", "nxp,lpc4330";
+
+       cpus {
+               cpu@0 {
+                       compatible = "arm,cortex-m4";
+               };
+       };
+
+       soc {
+               sram0: sram@10000000 {
+                       compatible = "mmio-sram";
+                       reg = <0x10000000 0x20000>; /* 96 + 32 KiB local SRAM */
+               };
+
+               sram1: sram@10080000 {
+                       compatible = "mmio-sram";
+                       reg = <0x10080000 0x12000>; /* 64 + 8 KiB local SRAM */
+               };
+
+               sram2: sram@20000000 {
+                       compatible = "mmio-sram";
+                       reg = <0x20000000 0x10000>; /* 4 x 16 KiB AHB SRAM */
+               };
+       };
+};
diff --git a/arch/arm/boot/dts/lpc4357-ea4357-devkit.dts b/arch/arm/boot/dts/lpc4357-ea4357-devkit.dts
new file mode 100644 (file)
index 0000000..08a6f75
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * Embedded Artist LPC4357 Developer's Kit
+ *
+ * Copyright 2015 Joachim Eastwood <manabian@gmail.com>
+ *
+ * This code is released using a dual license strategy: BSD/GPL
+ * You can choose the licence that better fits your requirements.
+ *
+ * Released under the terms of 3-clause BSD License
+ * Released under the terms of GNU General Public License Version 2.0
+ *
+ */
+/dts-v1/;
+
+#include "lpc18xx.dtsi"
+#include "lpc4357.dtsi"
+
+/ {
+       model = "Embedded Artists' LPC4357 Developer's Kit";
+       compatible = "ea,lpc4357-developers-kit", "nxp,lpc4357", "nxp,lpc4350";
+
+       aliases {
+               serial0 = &uart0;
+               serial1 = &uart1;
+               serial2 = &uart2;
+               serial3 = &uart3;
+       };
+
+       chosen {
+               stdout-path = &uart0;
+       };
+
+       memory {
+               device_type = "memory";
+               reg = <0x28000000 0x2000000>; /* 32 MB */
+       };
+};
+
+&uart0 {
+       status = "okay";
+};
diff --git a/arch/arm/boot/dts/lpc4357.dtsi b/arch/arm/boot/dts/lpc4357.dtsi
new file mode 100644 (file)
index 0000000..fb9ecc7
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * NXP LPC435x, LPC433x, LPC4327, LPC4325, LPC4317 and LPC4315 SoC
+ *
+ * Copyright 2015 Joachim Eastwood <manabian@gmail.com>
+ *
+ * This code is released using a dual license strategy: BSD/GPL
+ * You can choose the licence that better fits your requirements.
+ *
+ * Released under the terms of 3-clause BSD License
+ * Released under the terms of GNU General Public License Version 2.0
+ *
+ */
+
+/ {
+       compatible = "nxp,lpc4357";
+
+       cpus {
+               cpu@0 {
+                       compatible = "arm,cortex-m4";
+               };
+       };
+
+       soc {
+               sram0: sram@10000000 {
+                       compatible = "mmio-sram";
+                       reg = <0x10000000 0x8000>; /* 32 KiB local SRAM */
+               };
+
+               sram1: sram@10080000 {
+                       compatible = "mmio-sram";
+                       reg = <0x10080000 0xa000>; /* 32 + 8 KiB local SRAM */
+               };
+
+               sram2: sram@20000000 {
+                       compatible = "mmio-sram";
+                       reg = <0x20000000 0x10000>; /* 4 x 16 KiB AHB SRAM */
+               };
+       };
+};
index aaa786233d934e9885e0551f89fd8c27ae994cf5..ca3402e8240be1478568f23622c3bed965e06cfa 100644 (file)
                              <0 0x10216000 0 0x2000>;
                };
 
-               uart0: serial@11006000 {
+               uart0: serial@11002000 {
                        compatible = "mediatek,mt8127-uart","mediatek,mt6577-uart";
                        reg = <0 0x11002000 0 0x400>;
                        interrupts = <GIC_SPI 51 IRQ_TYPE_LEVEL_LOW>;
                        status = "disabled";
                };
 
-               uart1: serial@11007000 {
+               uart1: serial@11003000 {
                        compatible = "mediatek,mt8127-uart","mediatek,mt6577-uart";
                        reg = <0 0x11003000 0 0x400>;
                        interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_LOW>;
                        status = "disabled";
                };
 
-               uart2: serial@11008000 {
+               uart2: serial@11004000 {
                        compatible = "mediatek,mt8127-uart","mediatek,mt6577-uart";
                        reg = <0 0x11004000 0 0x400>;
                        interrupts = <GIC_SPI 53 IRQ_TYPE_LEVEL_LOW>;
                        status = "disabled";
                };
 
-               uart3: serial@11009000 {
+               uart3: serial@11005000 {
                        compatible = "mediatek,mt8127-uart","mediatek,mt6577-uart";
                        reg = <0 0x11005000 0 0x400>;
                        interrupts = <GIC_SPI 54 IRQ_TYPE_LEVEL_LOW>;
diff --git a/arch/arm/boot/dts/mt8135-pinfunc.h b/arch/arm/boot/dts/mt8135-pinfunc.h
new file mode 100644 (file)
index 0000000..5a60987
--- /dev/null
@@ -0,0 +1,1302 @@
+/*
+ * Copyright (c) 2014 MediaTek Inc.
+ * Author: Hongzhou.Yang <hongzhou.yang@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.
+ */
+
+#ifndef __DTS_MT8135_PINFUNC_H
+#define __DTS_MT8135_PINFUNC_H
+
+#include <dt-bindings/pinctrl/mt65xx.h>
+
+#define MT8135_PIN_0_MSDC0_DAT7__FUNC_GPIO0 (MTK_PIN_NO(0) | 0)
+#define MT8135_PIN_0_MSDC0_DAT7__FUNC_MSDC0_DAT7 (MTK_PIN_NO(0) | 1)
+#define MT8135_PIN_0_MSDC0_DAT7__FUNC_EINT49 (MTK_PIN_NO(0) | 2)
+#define MT8135_PIN_0_MSDC0_DAT7__FUNC_I2SOUT_DAT (MTK_PIN_NO(0) | 3)
+#define MT8135_PIN_0_MSDC0_DAT7__FUNC_DAC_DAT_OUT (MTK_PIN_NO(0) | 4)
+#define MT8135_PIN_0_MSDC0_DAT7__FUNC_PCM1_DO (MTK_PIN_NO(0) | 5)
+#define MT8135_PIN_0_MSDC0_DAT7__FUNC_SPI1_MO (MTK_PIN_NO(0) | 6)
+#define MT8135_PIN_0_MSDC0_DAT7__FUNC_NALE (MTK_PIN_NO(0) | 7)
+
+#define MT8135_PIN_1_MSDC0_DAT6__FUNC_GPIO1 (MTK_PIN_NO(1) | 0)
+#define MT8135_PIN_1_MSDC0_DAT6__FUNC_MSDC0_DAT6 (MTK_PIN_NO(1) | 1)
+#define MT8135_PIN_1_MSDC0_DAT6__FUNC_EINT48 (MTK_PIN_NO(1) | 2)
+#define MT8135_PIN_1_MSDC0_DAT6__FUNC_I2SIN_WS (MTK_PIN_NO(1) | 3)
+#define MT8135_PIN_1_MSDC0_DAT6__FUNC_DAC_WS (MTK_PIN_NO(1) | 4)
+#define MT8135_PIN_1_MSDC0_DAT6__FUNC_PCM1_WS (MTK_PIN_NO(1) | 5)
+#define MT8135_PIN_1_MSDC0_DAT6__FUNC_SPI1_CSN (MTK_PIN_NO(1) | 6)
+#define MT8135_PIN_1_MSDC0_DAT6__FUNC_NCLE (MTK_PIN_NO(1) | 7)
+
+#define MT8135_PIN_2_MSDC0_DAT5__FUNC_GPIO2 (MTK_PIN_NO(2) | 0)
+#define MT8135_PIN_2_MSDC0_DAT5__FUNC_MSDC0_DAT5 (MTK_PIN_NO(2) | 1)
+#define MT8135_PIN_2_MSDC0_DAT5__FUNC_EINT47 (MTK_PIN_NO(2) | 2)
+#define MT8135_PIN_2_MSDC0_DAT5__FUNC_I2SIN_CK (MTK_PIN_NO(2) | 3)
+#define MT8135_PIN_2_MSDC0_DAT5__FUNC_DAC_CK (MTK_PIN_NO(2) | 4)
+#define MT8135_PIN_2_MSDC0_DAT5__FUNC_PCM1_CK (MTK_PIN_NO(2) | 5)
+#define MT8135_PIN_2_MSDC0_DAT5__FUNC_SPI1_CLK (MTK_PIN_NO(2) | 6)
+#define MT8135_PIN_2_MSDC0_DAT5__FUNC_NLD4 (MTK_PIN_NO(2) | 7)
+
+#define MT8135_PIN_3_MSDC0_DAT4__FUNC_GPIO3 (MTK_PIN_NO(3) | 0)
+#define MT8135_PIN_3_MSDC0_DAT4__FUNC_MSDC0_DAT4 (MTK_PIN_NO(3) | 1)
+#define MT8135_PIN_3_MSDC0_DAT4__FUNC_EINT46 (MTK_PIN_NO(3) | 2)
+#define MT8135_PIN_3_MSDC0_DAT4__FUNC_A_FUNC_CK (MTK_PIN_NO(3) | 3)
+#define MT8135_PIN_3_MSDC0_DAT4__FUNC_LSCE1B_2X (MTK_PIN_NO(3) | 6)
+#define MT8135_PIN_3_MSDC0_DAT4__FUNC_NLD5 (MTK_PIN_NO(3) | 7)
+
+#define MT8135_PIN_4_MSDC0_CMD__FUNC_GPIO4 (MTK_PIN_NO(4) | 0)
+#define MT8135_PIN_4_MSDC0_CMD__FUNC_MSDC0_CMD (MTK_PIN_NO(4) | 1)
+#define MT8135_PIN_4_MSDC0_CMD__FUNC_EINT41 (MTK_PIN_NO(4) | 2)
+#define MT8135_PIN_4_MSDC0_CMD__FUNC_A_FUNC_DOUT_0 (MTK_PIN_NO(4) | 3)
+#define MT8135_PIN_4_MSDC0_CMD__FUNC_USB_TEST_IO_0 (MTK_PIN_NO(4) | 5)
+#define MT8135_PIN_4_MSDC0_CMD__FUNC_LRSTB_2X (MTK_PIN_NO(4) | 6)
+#define MT8135_PIN_4_MSDC0_CMD__FUNC_NRNB (MTK_PIN_NO(4) | 7)
+
+#define MT8135_PIN_5_MSDC0_CLK__FUNC_GPIO5 (MTK_PIN_NO(5) | 0)
+#define MT8135_PIN_5_MSDC0_CLK__FUNC_MSDC0_CLK (MTK_PIN_NO(5) | 1)
+#define MT8135_PIN_5_MSDC0_CLK__FUNC_EINT40 (MTK_PIN_NO(5) | 2)
+#define MT8135_PIN_5_MSDC0_CLK__FUNC_A_FUNC_DOUT_1 (MTK_PIN_NO(5) | 3)
+#define MT8135_PIN_5_MSDC0_CLK__FUNC_USB_TEST_IO_1 (MTK_PIN_NO(5) | 5)
+#define MT8135_PIN_5_MSDC0_CLK__FUNC_LPTE (MTK_PIN_NO(5) | 6)
+#define MT8135_PIN_5_MSDC0_CLK__FUNC_NREB (MTK_PIN_NO(5) | 7)
+
+#define MT8135_PIN_6_MSDC0_DAT3__FUNC_GPIO6 (MTK_PIN_NO(6) | 0)
+#define MT8135_PIN_6_MSDC0_DAT3__FUNC_MSDC0_DAT3 (MTK_PIN_NO(6) | 1)
+#define MT8135_PIN_6_MSDC0_DAT3__FUNC_EINT45 (MTK_PIN_NO(6) | 2)
+#define MT8135_PIN_6_MSDC0_DAT3__FUNC_A_FUNC_DOUT_2 (MTK_PIN_NO(6) | 3)
+#define MT8135_PIN_6_MSDC0_DAT3__FUNC_USB_TEST_IO_2 (MTK_PIN_NO(6) | 5)
+#define MT8135_PIN_6_MSDC0_DAT3__FUNC_LSCE0B_2X (MTK_PIN_NO(6) | 6)
+#define MT8135_PIN_6_MSDC0_DAT3__FUNC_NLD7 (MTK_PIN_NO(6) | 7)
+
+#define MT8135_PIN_7_MSDC0_DAT2__FUNC_GPIO7 (MTK_PIN_NO(7) | 0)
+#define MT8135_PIN_7_MSDC0_DAT2__FUNC_MSDC0_DAT2 (MTK_PIN_NO(7) | 1)
+#define MT8135_PIN_7_MSDC0_DAT2__FUNC_EINT44 (MTK_PIN_NO(7) | 2)
+#define MT8135_PIN_7_MSDC0_DAT2__FUNC_A_FUNC_DOUT_3 (MTK_PIN_NO(7) | 3)
+#define MT8135_PIN_7_MSDC0_DAT2__FUNC_USB_TEST_IO_3 (MTK_PIN_NO(7) | 5)
+#define MT8135_PIN_7_MSDC0_DAT2__FUNC_LSA0_2X (MTK_PIN_NO(7) | 6)
+#define MT8135_PIN_7_MSDC0_DAT2__FUNC_NLD14 (MTK_PIN_NO(7) | 7)
+
+#define MT8135_PIN_8_MSDC0_DAT1__FUNC_GPIO8 (MTK_PIN_NO(8) | 0)
+#define MT8135_PIN_8_MSDC0_DAT1__FUNC_MSDC0_DAT1 (MTK_PIN_NO(8) | 1)
+#define MT8135_PIN_8_MSDC0_DAT1__FUNC_EINT43 (MTK_PIN_NO(8) | 2)
+#define MT8135_PIN_8_MSDC0_DAT1__FUNC_USB_TEST_IO_4 (MTK_PIN_NO(8) | 5)
+#define MT8135_PIN_8_MSDC0_DAT1__FUNC_LSCK_2X (MTK_PIN_NO(8) | 6)
+#define MT8135_PIN_8_MSDC0_DAT1__FUNC_NLD11 (MTK_PIN_NO(8) | 7)
+
+#define MT8135_PIN_9_MSDC0_DAT0__FUNC_GPIO9 (MTK_PIN_NO(9) | 0)
+#define MT8135_PIN_9_MSDC0_DAT0__FUNC_MSDC0_DAT0 (MTK_PIN_NO(9) | 1)
+#define MT8135_PIN_9_MSDC0_DAT0__FUNC_EINT42 (MTK_PIN_NO(9) | 2)
+#define MT8135_PIN_9_MSDC0_DAT0__FUNC_USB_TEST_IO_5 (MTK_PIN_NO(9) | 5)
+#define MT8135_PIN_9_MSDC0_DAT0__FUNC_LSDA_2X (MTK_PIN_NO(9) | 6)
+
+#define MT8135_PIN_10_NCEB0__FUNC_GPIO10 (MTK_PIN_NO(10) | 0)
+#define MT8135_PIN_10_NCEB0__FUNC_NCEB0 (MTK_PIN_NO(10) | 1)
+#define MT8135_PIN_10_NCEB0__FUNC_EINT139 (MTK_PIN_NO(10) | 2)
+#define MT8135_PIN_10_NCEB0__FUNC_TESTA_OUT4 (MTK_PIN_NO(10) | 7)
+
+#define MT8135_PIN_11_NCEB1__FUNC_GPIO11 (MTK_PIN_NO(11) | 0)
+#define MT8135_PIN_11_NCEB1__FUNC_NCEB1 (MTK_PIN_NO(11) | 1)
+#define MT8135_PIN_11_NCEB1__FUNC_EINT140 (MTK_PIN_NO(11) | 2)
+#define MT8135_PIN_11_NCEB1__FUNC_USB_DRVVBUS (MTK_PIN_NO(11) | 6)
+#define MT8135_PIN_11_NCEB1__FUNC_TESTA_OUT5 (MTK_PIN_NO(11) | 7)
+
+#define MT8135_PIN_12_NRNB__FUNC_GPIO12 (MTK_PIN_NO(12) | 0)
+#define MT8135_PIN_12_NRNB__FUNC_NRNB (MTK_PIN_NO(12) | 1)
+#define MT8135_PIN_12_NRNB__FUNC_EINT141 (MTK_PIN_NO(12) | 2)
+#define MT8135_PIN_12_NRNB__FUNC_A_FUNC_DOUT_4 (MTK_PIN_NO(12) | 3)
+#define MT8135_PIN_12_NRNB__FUNC_TESTA_OUT6 (MTK_PIN_NO(12) | 7)
+
+#define MT8135_PIN_13_NCLE__FUNC_GPIO13 (MTK_PIN_NO(13) | 0)
+#define MT8135_PIN_13_NCLE__FUNC_NCLE (MTK_PIN_NO(13) | 1)
+#define MT8135_PIN_13_NCLE__FUNC_EINT142 (MTK_PIN_NO(13) | 2)
+#define MT8135_PIN_13_NCLE__FUNC_A_FUNC_DOUT_5 (MTK_PIN_NO(13) | 3)
+#define MT8135_PIN_13_NCLE__FUNC_CM2PDN_1X (MTK_PIN_NO(13) | 4)
+#define MT8135_PIN_13_NCLE__FUNC_NALE (MTK_PIN_NO(13) | 6)
+#define MT8135_PIN_13_NCLE__FUNC_TESTA_OUT7 (MTK_PIN_NO(13) | 7)
+
+#define MT8135_PIN_14_NALE__FUNC_GPIO14 (MTK_PIN_NO(14) | 0)
+#define MT8135_PIN_14_NALE__FUNC_NALE (MTK_PIN_NO(14) | 1)
+#define MT8135_PIN_14_NALE__FUNC_EINT143 (MTK_PIN_NO(14) | 2)
+#define MT8135_PIN_14_NALE__FUNC_A_FUNC_DOUT_6 (MTK_PIN_NO(14) | 3)
+#define MT8135_PIN_14_NALE__FUNC_CM2MCLK_1X (MTK_PIN_NO(14) | 4)
+#define MT8135_PIN_14_NALE__FUNC_IRDA_RXD (MTK_PIN_NO(14) | 5)
+#define MT8135_PIN_14_NALE__FUNC_NCLE (MTK_PIN_NO(14) | 6)
+#define MT8135_PIN_14_NALE__FUNC_TESTA_OUT8 (MTK_PIN_NO(14) | 7)
+
+#define MT8135_PIN_15_NREB__FUNC_GPIO15 (MTK_PIN_NO(15) | 0)
+#define MT8135_PIN_15_NREB__FUNC_NREB (MTK_PIN_NO(15) | 1)
+#define MT8135_PIN_15_NREB__FUNC_EINT144 (MTK_PIN_NO(15) | 2)
+#define MT8135_PIN_15_NREB__FUNC_A_FUNC_DOUT_7 (MTK_PIN_NO(15) | 3)
+#define MT8135_PIN_15_NREB__FUNC_CM2RST_1X (MTK_PIN_NO(15) | 4)
+#define MT8135_PIN_15_NREB__FUNC_IRDA_TXD (MTK_PIN_NO(15) | 5)
+#define MT8135_PIN_15_NREB__FUNC_TESTA_OUT9 (MTK_PIN_NO(15) | 7)
+
+#define MT8135_PIN_16_NWEB__FUNC_GPIO16 (MTK_PIN_NO(16) | 0)
+#define MT8135_PIN_16_NWEB__FUNC_NWEB (MTK_PIN_NO(16) | 1)
+#define MT8135_PIN_16_NWEB__FUNC_EINT145 (MTK_PIN_NO(16) | 2)
+#define MT8135_PIN_16_NWEB__FUNC_A_FUNC_DIN_0 (MTK_PIN_NO(16) | 3)
+#define MT8135_PIN_16_NWEB__FUNC_CM2PCLK_1X (MTK_PIN_NO(16) | 4)
+#define MT8135_PIN_16_NWEB__FUNC_IRDA_PDN (MTK_PIN_NO(16) | 5)
+#define MT8135_PIN_16_NWEB__FUNC_TESTA_OUT10 (MTK_PIN_NO(16) | 7)
+
+#define MT8135_PIN_17_NLD0__FUNC_GPIO17 (MTK_PIN_NO(17) | 0)
+#define MT8135_PIN_17_NLD0__FUNC_NLD0 (MTK_PIN_NO(17) | 1)
+#define MT8135_PIN_17_NLD0__FUNC_EINT146 (MTK_PIN_NO(17) | 2)
+#define MT8135_PIN_17_NLD0__FUNC_A_FUNC_DIN_1 (MTK_PIN_NO(17) | 3)
+#define MT8135_PIN_17_NLD0__FUNC_CM2DAT_1X_0 (MTK_PIN_NO(17) | 4)
+#define MT8135_PIN_17_NLD0__FUNC_I2SIN_CK (MTK_PIN_NO(17) | 5)
+#define MT8135_PIN_17_NLD0__FUNC_DAC_CK (MTK_PIN_NO(17) | 6)
+#define MT8135_PIN_17_NLD0__FUNC_TESTA_OUT11 (MTK_PIN_NO(17) | 7)
+
+#define MT8135_PIN_18_NLD1__FUNC_GPIO18 (MTK_PIN_NO(18) | 0)
+#define MT8135_PIN_18_NLD1__FUNC_NLD1 (MTK_PIN_NO(18) | 1)
+#define MT8135_PIN_18_NLD1__FUNC_EINT147 (MTK_PIN_NO(18) | 2)
+#define MT8135_PIN_18_NLD1__FUNC_A_FUNC_DIN_2 (MTK_PIN_NO(18) | 3)
+#define MT8135_PIN_18_NLD1__FUNC_CM2DAT_1X_1 (MTK_PIN_NO(18) | 4)
+#define MT8135_PIN_18_NLD1__FUNC_I2SIN_WS (MTK_PIN_NO(18) | 5)
+#define MT8135_PIN_18_NLD1__FUNC_DAC_WS (MTK_PIN_NO(18) | 6)
+#define MT8135_PIN_18_NLD1__FUNC_TESTA_OUT12 (MTK_PIN_NO(18) | 7)
+
+#define MT8135_PIN_19_NLD2__FUNC_GPIO19 (MTK_PIN_NO(19) | 0)
+#define MT8135_PIN_19_NLD2__FUNC_NLD2 (MTK_PIN_NO(19) | 1)
+#define MT8135_PIN_19_NLD2__FUNC_EINT148 (MTK_PIN_NO(19) | 2)
+#define MT8135_PIN_19_NLD2__FUNC_A_FUNC_DIN_3 (MTK_PIN_NO(19) | 3)
+#define MT8135_PIN_19_NLD2__FUNC_CM2DAT_1X_2 (MTK_PIN_NO(19) | 4)
+#define MT8135_PIN_19_NLD2__FUNC_I2SOUT_DAT (MTK_PIN_NO(19) | 5)
+#define MT8135_PIN_19_NLD2__FUNC_DAC_DAT_OUT (MTK_PIN_NO(19) | 6)
+#define MT8135_PIN_19_NLD2__FUNC_TESTA_OUT13 (MTK_PIN_NO(19) | 7)
+
+#define MT8135_PIN_20_NLD3__FUNC_GPIO20 (MTK_PIN_NO(20) | 0)
+#define MT8135_PIN_20_NLD3__FUNC_NLD3 (MTK_PIN_NO(20) | 1)
+#define MT8135_PIN_20_NLD3__FUNC_EINT149 (MTK_PIN_NO(20) | 2)
+#define MT8135_PIN_20_NLD3__FUNC_A_FUNC_DIN_4 (MTK_PIN_NO(20) | 3)
+#define MT8135_PIN_20_NLD3__FUNC_CM2DAT_1X_3 (MTK_PIN_NO(20) | 4)
+#define MT8135_PIN_20_NLD3__FUNC_TESTA_OUT14 (MTK_PIN_NO(20) | 7)
+
+#define MT8135_PIN_21_NLD4__FUNC_GPIO21 (MTK_PIN_NO(21) | 0)
+#define MT8135_PIN_21_NLD4__FUNC_NLD4 (MTK_PIN_NO(21) | 1)
+#define MT8135_PIN_21_NLD4__FUNC_EINT150 (MTK_PIN_NO(21) | 2)
+#define MT8135_PIN_21_NLD4__FUNC_A_FUNC_DIN_5 (MTK_PIN_NO(21) | 3)
+#define MT8135_PIN_21_NLD4__FUNC_CM2DAT_1X_4 (MTK_PIN_NO(21) | 4)
+#define MT8135_PIN_21_NLD4__FUNC_TESTA_OUT15 (MTK_PIN_NO(21) | 7)
+
+#define MT8135_PIN_22_NLD5__FUNC_GPIO22 (MTK_PIN_NO(22) | 0)
+#define MT8135_PIN_22_NLD5__FUNC_NLD5 (MTK_PIN_NO(22) | 1)
+#define MT8135_PIN_22_NLD5__FUNC_EINT151 (MTK_PIN_NO(22) | 2)
+#define MT8135_PIN_22_NLD5__FUNC_A_FUNC_DIN_6 (MTK_PIN_NO(22) | 3)
+#define MT8135_PIN_22_NLD5__FUNC_CM2DAT_1X_5 (MTK_PIN_NO(22) | 4)
+#define MT8135_PIN_22_NLD5__FUNC_TESTA_OUT16 (MTK_PIN_NO(22) | 7)
+
+#define MT8135_PIN_23_NLD6__FUNC_GPIO23 (MTK_PIN_NO(23) | 0)
+#define MT8135_PIN_23_NLD6__FUNC_NLD6 (MTK_PIN_NO(23) | 1)
+#define MT8135_PIN_23_NLD6__FUNC_EINT152 (MTK_PIN_NO(23) | 2)
+#define MT8135_PIN_23_NLD6__FUNC_A_FUNC_DIN_7 (MTK_PIN_NO(23) | 3)
+#define MT8135_PIN_23_NLD6__FUNC_CM2DAT_1X_6 (MTK_PIN_NO(23) | 4)
+#define MT8135_PIN_23_NLD6__FUNC_TESTA_OUT17 (MTK_PIN_NO(23) | 7)
+
+#define MT8135_PIN_24_NLD7__FUNC_GPIO24 (MTK_PIN_NO(24) | 0)
+#define MT8135_PIN_24_NLD7__FUNC_NLD7 (MTK_PIN_NO(24) | 1)
+#define MT8135_PIN_24_NLD7__FUNC_EINT153 (MTK_PIN_NO(24) | 2)
+#define MT8135_PIN_24_NLD7__FUNC_A_FUNC_DIN_8 (MTK_PIN_NO(24) | 3)
+#define MT8135_PIN_24_NLD7__FUNC_CM2DAT_1X_7 (MTK_PIN_NO(24) | 4)
+#define MT8135_PIN_24_NLD7__FUNC_TESTA_OUT18 (MTK_PIN_NO(24) | 7)
+
+#define MT8135_PIN_25_NLD8__FUNC_GPIO25 (MTK_PIN_NO(25) | 0)
+#define MT8135_PIN_25_NLD8__FUNC_NLD8 (MTK_PIN_NO(25) | 1)
+#define MT8135_PIN_25_NLD8__FUNC_EINT154 (MTK_PIN_NO(25) | 2)
+#define MT8135_PIN_25_NLD8__FUNC_CM2DAT_1X_8 (MTK_PIN_NO(25) | 4)
+
+#define MT8135_PIN_26_NLD9__FUNC_GPIO26 (MTK_PIN_NO(26) | 0)
+#define MT8135_PIN_26_NLD9__FUNC_NLD9 (MTK_PIN_NO(26) | 1)
+#define MT8135_PIN_26_NLD9__FUNC_EINT155 (MTK_PIN_NO(26) | 2)
+#define MT8135_PIN_26_NLD9__FUNC_CM2DAT_1X_9 (MTK_PIN_NO(26) | 4)
+#define MT8135_PIN_26_NLD9__FUNC_PWM1 (MTK_PIN_NO(26) | 5)
+
+#define MT8135_PIN_27_NLD10__FUNC_GPIO27 (MTK_PIN_NO(27) | 0)
+#define MT8135_PIN_27_NLD10__FUNC_NLD10 (MTK_PIN_NO(27) | 1)
+#define MT8135_PIN_27_NLD10__FUNC_EINT156 (MTK_PIN_NO(27) | 2)
+#define MT8135_PIN_27_NLD10__FUNC_CM2VSYNC_1X (MTK_PIN_NO(27) | 4)
+#define MT8135_PIN_27_NLD10__FUNC_PWM2 (MTK_PIN_NO(27) | 5)
+
+#define MT8135_PIN_28_NLD11__FUNC_GPIO28 (MTK_PIN_NO(28) | 0)
+#define MT8135_PIN_28_NLD11__FUNC_NLD11 (MTK_PIN_NO(28) | 1)
+#define MT8135_PIN_28_NLD11__FUNC_EINT157 (MTK_PIN_NO(28) | 2)
+#define MT8135_PIN_28_NLD11__FUNC_CM2HSYNC_1X (MTK_PIN_NO(28) | 4)
+#define MT8135_PIN_28_NLD11__FUNC_PWM3 (MTK_PIN_NO(28) | 5)
+
+#define MT8135_PIN_29_NLD12__FUNC_GPIO29 (MTK_PIN_NO(29) | 0)
+#define MT8135_PIN_29_NLD12__FUNC_NLD12 (MTK_PIN_NO(29) | 1)
+#define MT8135_PIN_29_NLD12__FUNC_EINT158 (MTK_PIN_NO(29) | 2)
+#define MT8135_PIN_29_NLD12__FUNC_I2SIN_CK (MTK_PIN_NO(29) | 3)
+#define MT8135_PIN_29_NLD12__FUNC_DAC_CK (MTK_PIN_NO(29) | 4)
+#define MT8135_PIN_29_NLD12__FUNC_PCM1_CK (MTK_PIN_NO(29) | 5)
+
+#define MT8135_PIN_30_NLD13__FUNC_GPIO30 (MTK_PIN_NO(30) | 0)
+#define MT8135_PIN_30_NLD13__FUNC_NLD13 (MTK_PIN_NO(30) | 1)
+#define MT8135_PIN_30_NLD13__FUNC_EINT159 (MTK_PIN_NO(30) | 2)
+#define MT8135_PIN_30_NLD13__FUNC_I2SIN_WS (MTK_PIN_NO(30) | 3)
+#define MT8135_PIN_30_NLD13__FUNC_DAC_WS (MTK_PIN_NO(30) | 4)
+#define MT8135_PIN_30_NLD13__FUNC_PCM1_WS (MTK_PIN_NO(30) | 5)
+
+#define MT8135_PIN_31_NLD14__FUNC_GPIO31 (MTK_PIN_NO(31) | 0)
+#define MT8135_PIN_31_NLD14__FUNC_NLD14 (MTK_PIN_NO(31) | 1)
+#define MT8135_PIN_31_NLD14__FUNC_EINT160 (MTK_PIN_NO(31) | 2)
+#define MT8135_PIN_31_NLD14__FUNC_I2SOUT_DAT (MTK_PIN_NO(31) | 3)
+#define MT8135_PIN_31_NLD14__FUNC_DAC_DAT_OUT (MTK_PIN_NO(31) | 4)
+#define MT8135_PIN_31_NLD14__FUNC_PCM1_DO (MTK_PIN_NO(31) | 5)
+
+#define MT8135_PIN_32_NLD15__FUNC_GPIO32 (MTK_PIN_NO(32) | 0)
+#define MT8135_PIN_32_NLD15__FUNC_NLD15 (MTK_PIN_NO(32) | 1)
+#define MT8135_PIN_32_NLD15__FUNC_EINT161 (MTK_PIN_NO(32) | 2)
+#define MT8135_PIN_32_NLD15__FUNC_DISP_PWM (MTK_PIN_NO(32) | 3)
+#define MT8135_PIN_32_NLD15__FUNC_PWM4 (MTK_PIN_NO(32) | 4)
+#define MT8135_PIN_32_NLD15__FUNC_PCM1_DI (MTK_PIN_NO(32) | 5)
+
+#define MT8135_PIN_33_MSDC0_RSTB__FUNC_GPIO33 (MTK_PIN_NO(33) | 0)
+#define MT8135_PIN_33_MSDC0_RSTB__FUNC_MSDC0_RSTB (MTK_PIN_NO(33) | 1)
+#define MT8135_PIN_33_MSDC0_RSTB__FUNC_EINT50 (MTK_PIN_NO(33) | 2)
+#define MT8135_PIN_33_MSDC0_RSTB__FUNC_I2SIN_DAT (MTK_PIN_NO(33) | 3)
+#define MT8135_PIN_33_MSDC0_RSTB__FUNC_PCM1_DI (MTK_PIN_NO(33) | 5)
+#define MT8135_PIN_33_MSDC0_RSTB__FUNC_SPI1_MI (MTK_PIN_NO(33) | 6)
+#define MT8135_PIN_33_MSDC0_RSTB__FUNC_NLD10 (MTK_PIN_NO(33) | 7)
+
+#define MT8135_PIN_34_IDDIG__FUNC_GPIO34 (MTK_PIN_NO(34) | 0)
+#define MT8135_PIN_34_IDDIG__FUNC_IDDIG (MTK_PIN_NO(34) | 1)
+#define MT8135_PIN_34_IDDIG__FUNC_EINT34 (MTK_PIN_NO(34) | 2)
+
+#define MT8135_PIN_35_SCL3__FUNC_GPIO35 (MTK_PIN_NO(35) | 0)
+#define MT8135_PIN_35_SCL3__FUNC_SCL3 (MTK_PIN_NO(35) | 1)
+#define MT8135_PIN_35_SCL3__FUNC_EINT96 (MTK_PIN_NO(35) | 2)
+#define MT8135_PIN_35_SCL3__FUNC_CLKM6 (MTK_PIN_NO(35) | 3)
+#define MT8135_PIN_35_SCL3__FUNC_PWM6 (MTK_PIN_NO(35) | 4)
+
+#define MT8135_PIN_36_SDA3__FUNC_GPIO36 (MTK_PIN_NO(36) | 0)
+#define MT8135_PIN_36_SDA3__FUNC_SDA3 (MTK_PIN_NO(36) | 1)
+#define MT8135_PIN_36_SDA3__FUNC_EINT97 (MTK_PIN_NO(36) | 2)
+
+#define MT8135_PIN_37_AUD_CLK_MOSI__FUNC_GPIO37 (MTK_PIN_NO(37) | 0)
+#define MT8135_PIN_37_AUD_CLK_MOSI__FUNC_AUD_CLK (MTK_PIN_NO(37) | 1)
+#define MT8135_PIN_37_AUD_CLK_MOSI__FUNC_ADC_CK (MTK_PIN_NO(37) | 2)
+#define MT8135_PIN_37_AUD_CLK_MOSI__FUNC_HDMI_SDATA0 (MTK_PIN_NO(37) | 3)
+#define MT8135_PIN_37_AUD_CLK_MOSI__FUNC_EINT19 (MTK_PIN_NO(37) | 4)
+#define MT8135_PIN_37_AUD_CLK_MOSI__FUNC_USB_TEST_IO_6 (MTK_PIN_NO(37) | 5)
+#define MT8135_PIN_37_AUD_CLK_MOSI__FUNC_TESTA_OUT19 (MTK_PIN_NO(37) | 7)
+
+#define MT8135_PIN_38_AUD_DAT_MOSI__FUNC_GPIO38 (MTK_PIN_NO(38) | 0)
+#define MT8135_PIN_38_AUD_DAT_MOSI__FUNC_AUD_DAT_MOSI (MTK_PIN_NO(38) | 1)
+#define MT8135_PIN_38_AUD_DAT_MOSI__FUNC_ADC_WS (MTK_PIN_NO(38) | 2)
+#define MT8135_PIN_38_AUD_DAT_MOSI__FUNC_AUD_DAT_MISO (MTK_PIN_NO(38) | 3)
+#define MT8135_PIN_38_AUD_DAT_MOSI__FUNC_EINT21 (MTK_PIN_NO(38) | 4)
+#define MT8135_PIN_38_AUD_DAT_MOSI__FUNC_USB_TEST_IO_7 (MTK_PIN_NO(38) | 5)
+#define MT8135_PIN_38_AUD_DAT_MOSI__FUNC_TESTA_OUT20 (MTK_PIN_NO(38) | 7)
+
+#define MT8135_PIN_39_AUD_DAT_MISO__FUNC_GPIO39 (MTK_PIN_NO(39) | 0)
+#define MT8135_PIN_39_AUD_DAT_MISO__FUNC_AUD_DAT_MISO (MTK_PIN_NO(39) | 1)
+#define MT8135_PIN_39_AUD_DAT_MISO__FUNC_ADC_DAT_IN (MTK_PIN_NO(39) | 2)
+#define MT8135_PIN_39_AUD_DAT_MISO__FUNC_AUD_DAT_MOSI (MTK_PIN_NO(39) | 3)
+#define MT8135_PIN_39_AUD_DAT_MISO__FUNC_EINT20 (MTK_PIN_NO(39) | 4)
+#define MT8135_PIN_39_AUD_DAT_MISO__FUNC_USB_TEST_IO_8 (MTK_PIN_NO(39) | 5)
+#define MT8135_PIN_39_AUD_DAT_MISO__FUNC_TESTA_OUT21 (MTK_PIN_NO(39) | 7)
+
+#define MT8135_PIN_40_DAC_CLK__FUNC_GPIO40 (MTK_PIN_NO(40) | 0)
+#define MT8135_PIN_40_DAC_CLK__FUNC_DAC_CK (MTK_PIN_NO(40) | 1)
+#define MT8135_PIN_40_DAC_CLK__FUNC_EINT22 (MTK_PIN_NO(40) | 2)
+#define MT8135_PIN_40_DAC_CLK__FUNC_HDMI_SDATA1 (MTK_PIN_NO(40) | 3)
+#define MT8135_PIN_40_DAC_CLK__FUNC_USB_TEST_IO_9 (MTK_PIN_NO(40) | 5)
+#define MT8135_PIN_40_DAC_CLK__FUNC_TESTA_OUT22 (MTK_PIN_NO(40) | 7)
+
+#define MT8135_PIN_41_DAC_WS__FUNC_GPIO41 (MTK_PIN_NO(41) | 0)
+#define MT8135_PIN_41_DAC_WS__FUNC_DAC_WS (MTK_PIN_NO(41) | 1)
+#define MT8135_PIN_41_DAC_WS__FUNC_EINT24 (MTK_PIN_NO(41) | 2)
+#define MT8135_PIN_41_DAC_WS__FUNC_HDMI_SDATA2 (MTK_PIN_NO(41) | 3)
+#define MT8135_PIN_41_DAC_WS__FUNC_USB_TEST_IO_10 (MTK_PIN_NO(41) | 5)
+#define MT8135_PIN_41_DAC_WS__FUNC_TESTA_OUT23 (MTK_PIN_NO(41) | 7)
+
+#define MT8135_PIN_42_DAC_DAT_OUT__FUNC_GPIO42 (MTK_PIN_NO(42) | 0)
+#define MT8135_PIN_42_DAC_DAT_OUT__FUNC_DAC_DAT_OUT (MTK_PIN_NO(42) | 1)
+#define MT8135_PIN_42_DAC_DAT_OUT__FUNC_EINT23 (MTK_PIN_NO(42) | 2)
+#define MT8135_PIN_42_DAC_DAT_OUT__FUNC_HDMI_SDATA3 (MTK_PIN_NO(42) | 3)
+#define MT8135_PIN_42_DAC_DAT_OUT__FUNC_USB_TEST_IO_11 (MTK_PIN_NO(42) | 5)
+#define MT8135_PIN_42_DAC_DAT_OUT__FUNC_TESTA_OUT24 (MTK_PIN_NO(42) | 7)
+
+#define MT8135_PIN_43_PWRAP_SPI0_MO__FUNC_GPIO43 (MTK_PIN_NO(43) | 0)
+#define MT8135_PIN_43_PWRAP_SPI0_MO__FUNC_PWRAP_SPIDI (MTK_PIN_NO(43) | 1)
+#define MT8135_PIN_43_PWRAP_SPI0_MO__FUNC_EINT29 (MTK_PIN_NO(43) | 2)
+
+#define MT8135_PIN_44_PWRAP_SPI0_MI__FUNC_GPIO44 (MTK_PIN_NO(44) | 0)
+#define MT8135_PIN_44_PWRAP_SPI0_MI__FUNC_PWRAP_SPIDO (MTK_PIN_NO(44) | 1)
+#define MT8135_PIN_44_PWRAP_SPI0_MI__FUNC_EINT28 (MTK_PIN_NO(44) | 2)
+
+#define MT8135_PIN_45_PWRAP_SPI0_CSN__FUNC_GPIO45 (MTK_PIN_NO(45) | 0)
+#define MT8135_PIN_45_PWRAP_SPI0_CSN__FUNC_PWRAP_SPICS_B_I (MTK_PIN_NO(45) | 1)
+#define MT8135_PIN_45_PWRAP_SPI0_CSN__FUNC_EINT27 (MTK_PIN_NO(45) | 2)
+
+#define MT8135_PIN_46_PWRAP_SPI0_CLK__FUNC_GPIO46 (MTK_PIN_NO(46) | 0)
+#define MT8135_PIN_46_PWRAP_SPI0_CLK__FUNC_PWRAP_SPICK_I (MTK_PIN_NO(46) | 1)
+#define MT8135_PIN_46_PWRAP_SPI0_CLK__FUNC_EINT26 (MTK_PIN_NO(46) | 2)
+
+#define MT8135_PIN_47_PWRAP_EVENT__FUNC_GPIO47 (MTK_PIN_NO(47) | 0)
+#define MT8135_PIN_47_PWRAP_EVENT__FUNC_PWRAP_EVENT_IN (MTK_PIN_NO(47) | 1)
+#define MT8135_PIN_47_PWRAP_EVENT__FUNC_EINT25 (MTK_PIN_NO(47) | 2)
+#define MT8135_PIN_47_PWRAP_EVENT__FUNC_TESTA_OUT2 (MTK_PIN_NO(47) | 7)
+
+#define MT8135_PIN_48_RTC32K_CK__FUNC_GPIO48 (MTK_PIN_NO(48) | 0)
+#define MT8135_PIN_48_RTC32K_CK__FUNC_RTC32K_CK (MTK_PIN_NO(48) | 1)
+
+#define MT8135_PIN_49_WATCHDOG__FUNC_GPIO49 (MTK_PIN_NO(49) | 0)
+#define MT8135_PIN_49_WATCHDOG__FUNC_WATCHDOG (MTK_PIN_NO(49) | 1)
+#define MT8135_PIN_49_WATCHDOG__FUNC_EINT36 (MTK_PIN_NO(49) | 2)
+
+#define MT8135_PIN_50_SRCLKENA__FUNC_GPIO50 (MTK_PIN_NO(50) | 0)
+#define MT8135_PIN_50_SRCLKENA__FUNC_SRCLKENA (MTK_PIN_NO(50) | 1)
+#define MT8135_PIN_50_SRCLKENA__FUNC_EINT38 (MTK_PIN_NO(50) | 2)
+
+#define MT8135_PIN_51_SRCVOLTEN__FUNC_GPIO51 (MTK_PIN_NO(51) | 0)
+#define MT8135_PIN_51_SRCVOLTEN__FUNC_SRCVOLTEN (MTK_PIN_NO(51) | 1)
+#define MT8135_PIN_51_SRCVOLTEN__FUNC_EINT37 (MTK_PIN_NO(51) | 2)
+
+#define MT8135_PIN_52_EINT0__FUNC_GPIO52 (MTK_PIN_NO(52) | 0)
+#define MT8135_PIN_52_EINT0__FUNC_EINT0 (MTK_PIN_NO(52) | 1)
+#define MT8135_PIN_52_EINT0__FUNC_PWM1 (MTK_PIN_NO(52) | 2)
+#define MT8135_PIN_52_EINT0__FUNC_CLKM0 (MTK_PIN_NO(52) | 3)
+#define MT8135_PIN_52_EINT0__FUNC_SPDIF_OUT (MTK_PIN_NO(52) | 4)
+#define MT8135_PIN_52_EINT0__FUNC_USB_TEST_IO_12 (MTK_PIN_NO(52) | 5)
+#define MT8135_PIN_52_EINT0__FUNC_USB_SCL (MTK_PIN_NO(52) | 7)
+
+#define MT8135_PIN_53_URXD2__FUNC_GPIO53 (MTK_PIN_NO(53) | 0)
+#define MT8135_PIN_53_URXD2__FUNC_URXD2 (MTK_PIN_NO(53) | 1)
+#define MT8135_PIN_53_URXD2__FUNC_EINT83 (MTK_PIN_NO(53) | 2)
+#define MT8135_PIN_53_URXD2__FUNC_HDMI_LRCK (MTK_PIN_NO(53) | 4)
+#define MT8135_PIN_53_URXD2__FUNC_CLKM3 (MTK_PIN_NO(53) | 5)
+#define MT8135_PIN_53_URXD2__FUNC_UTXD2 (MTK_PIN_NO(53) | 7)
+
+#define MT8135_PIN_54_UTXD2__FUNC_GPIO54 (MTK_PIN_NO(54) | 0)
+#define MT8135_PIN_54_UTXD2__FUNC_UTXD2 (MTK_PIN_NO(54) | 1)
+#define MT8135_PIN_54_UTXD2__FUNC_EINT82 (MTK_PIN_NO(54) | 2)
+#define MT8135_PIN_54_UTXD2__FUNC_HDMI_BCK_OUT (MTK_PIN_NO(54) | 4)
+#define MT8135_PIN_54_UTXD2__FUNC_CLKM2 (MTK_PIN_NO(54) | 5)
+#define MT8135_PIN_54_UTXD2__FUNC_URXD2 (MTK_PIN_NO(54) | 7)
+
+#define MT8135_PIN_55_UCTS2__FUNC_GPIO55 (MTK_PIN_NO(55) | 0)
+#define MT8135_PIN_55_UCTS2__FUNC_UCTS2 (MTK_PIN_NO(55) | 1)
+#define MT8135_PIN_55_UCTS2__FUNC_EINT84 (MTK_PIN_NO(55) | 2)
+#define MT8135_PIN_55_UCTS2__FUNC_PWM1 (MTK_PIN_NO(55) | 5)
+#define MT8135_PIN_55_UCTS2__FUNC_URTS2 (MTK_PIN_NO(55) | 7)
+
+#define MT8135_PIN_56_URTS2__FUNC_GPIO56 (MTK_PIN_NO(56) | 0)
+#define MT8135_PIN_56_URTS2__FUNC_URTS2 (MTK_PIN_NO(56) | 1)
+#define MT8135_PIN_56_URTS2__FUNC_EINT85 (MTK_PIN_NO(56) | 2)
+#define MT8135_PIN_56_URTS2__FUNC_PWM2 (MTK_PIN_NO(56) | 5)
+#define MT8135_PIN_56_URTS2__FUNC_UCTS2 (MTK_PIN_NO(56) | 7)
+
+#define MT8135_PIN_57_JTCK__FUNC_GPIO57 (MTK_PIN_NO(57) | 0)
+#define MT8135_PIN_57_JTCK__FUNC_JTCK (MTK_PIN_NO(57) | 1)
+#define MT8135_PIN_57_JTCK__FUNC_EINT188 (MTK_PIN_NO(57) | 2)
+#define MT8135_PIN_57_JTCK__FUNC_DSP1_ICK (MTK_PIN_NO(57) | 3)
+
+#define MT8135_PIN_58_JTDO__FUNC_GPIO58 (MTK_PIN_NO(58) | 0)
+#define MT8135_PIN_58_JTDO__FUNC_JTDO (MTK_PIN_NO(58) | 1)
+#define MT8135_PIN_58_JTDO__FUNC_EINT190 (MTK_PIN_NO(58) | 2)
+#define MT8135_PIN_58_JTDO__FUNC_DSP2_IMS (MTK_PIN_NO(58) | 3)
+
+#define MT8135_PIN_59_JTRST_B__FUNC_GPIO59 (MTK_PIN_NO(59) | 0)
+#define MT8135_PIN_59_JTRST_B__FUNC_JTRST_B (MTK_PIN_NO(59) | 1)
+#define MT8135_PIN_59_JTRST_B__FUNC_EINT0 (MTK_PIN_NO(59) | 2)
+#define MT8135_PIN_59_JTRST_B__FUNC_DSP2_ICK (MTK_PIN_NO(59) | 3)
+
+#define MT8135_PIN_60_JTDI__FUNC_GPIO60 (MTK_PIN_NO(60) | 0)
+#define MT8135_PIN_60_JTDI__FUNC_JTDI (MTK_PIN_NO(60) | 1)
+#define MT8135_PIN_60_JTDI__FUNC_EINT189 (MTK_PIN_NO(60) | 2)
+#define MT8135_PIN_60_JTDI__FUNC_DSP1_IMS (MTK_PIN_NO(60) | 3)
+
+#define MT8135_PIN_61_JRTCK__FUNC_GPIO61 (MTK_PIN_NO(61) | 0)
+#define MT8135_PIN_61_JRTCK__FUNC_JRTCK (MTK_PIN_NO(61) | 1)
+#define MT8135_PIN_61_JRTCK__FUNC_EINT187 (MTK_PIN_NO(61) | 2)
+#define MT8135_PIN_61_JRTCK__FUNC_DSP1_ID (MTK_PIN_NO(61) | 3)
+
+#define MT8135_PIN_62_JTMS__FUNC_GPIO62 (MTK_PIN_NO(62) | 0)
+#define MT8135_PIN_62_JTMS__FUNC_JTMS (MTK_PIN_NO(62) | 1)
+#define MT8135_PIN_62_JTMS__FUNC_EINT191 (MTK_PIN_NO(62) | 2)
+#define MT8135_PIN_62_JTMS__FUNC_DSP2_ID (MTK_PIN_NO(62) | 3)
+
+#define MT8135_PIN_63_MSDC1_INSI__FUNC_GPIO63 (MTK_PIN_NO(63) | 0)
+#define MT8135_PIN_63_MSDC1_INSI__FUNC_MSDC1_INSI (MTK_PIN_NO(63) | 1)
+#define MT8135_PIN_63_MSDC1_INSI__FUNC_SCL5 (MTK_PIN_NO(63) | 3)
+#define MT8135_PIN_63_MSDC1_INSI__FUNC_PWM6 (MTK_PIN_NO(63) | 4)
+#define MT8135_PIN_63_MSDC1_INSI__FUNC_CLKM5 (MTK_PIN_NO(63) | 5)
+#define MT8135_PIN_63_MSDC1_INSI__FUNC_TESTB_OUT6 (MTK_PIN_NO(63) | 7)
+
+#define MT8135_PIN_64_MSDC1_SDWPI__FUNC_GPIO64 (MTK_PIN_NO(64) | 0)
+#define MT8135_PIN_64_MSDC1_SDWPI__FUNC_MSDC1_SDWPI (MTK_PIN_NO(64) | 1)
+#define MT8135_PIN_64_MSDC1_SDWPI__FUNC_EINT58 (MTK_PIN_NO(64) | 2)
+#define MT8135_PIN_64_MSDC1_SDWPI__FUNC_SDA5 (MTK_PIN_NO(64) | 3)
+#define MT8135_PIN_64_MSDC1_SDWPI__FUNC_PWM7 (MTK_PIN_NO(64) | 4)
+#define MT8135_PIN_64_MSDC1_SDWPI__FUNC_CLKM6 (MTK_PIN_NO(64) | 5)
+#define MT8135_PIN_64_MSDC1_SDWPI__FUNC_TESTB_OUT7 (MTK_PIN_NO(64) | 7)
+
+#define MT8135_PIN_65_MSDC2_INSI__FUNC_GPIO65 (MTK_PIN_NO(65) | 0)
+#define MT8135_PIN_65_MSDC2_INSI__FUNC_MSDC2_INSI (MTK_PIN_NO(65) | 1)
+#define MT8135_PIN_65_MSDC2_INSI__FUNC_USB_TEST_IO_27 (MTK_PIN_NO(65) | 5)
+#define MT8135_PIN_65_MSDC2_INSI__FUNC_TESTA_OUT3 (MTK_PIN_NO(65) | 7)
+
+#define MT8135_PIN_66_MSDC2_SDWPI__FUNC_GPIO66 (MTK_PIN_NO(66) | 0)
+#define MT8135_PIN_66_MSDC2_SDWPI__FUNC_MSDC2_SDWPI (MTK_PIN_NO(66) | 1)
+#define MT8135_PIN_66_MSDC2_SDWPI__FUNC_EINT66 (MTK_PIN_NO(66) | 2)
+#define MT8135_PIN_66_MSDC2_SDWPI__FUNC_USB_TEST_IO_28 (MTK_PIN_NO(66) | 5)
+
+#define MT8135_PIN_67_URXD4__FUNC_GPIO67 (MTK_PIN_NO(67) | 0)
+#define MT8135_PIN_67_URXD4__FUNC_URXD4 (MTK_PIN_NO(67) | 1)
+#define MT8135_PIN_67_URXD4__FUNC_EINT89 (MTK_PIN_NO(67) | 2)
+#define MT8135_PIN_67_URXD4__FUNC_URXD1 (MTK_PIN_NO(67) | 3)
+#define MT8135_PIN_67_URXD4__FUNC_UTXD4 (MTK_PIN_NO(67) | 6)
+#define MT8135_PIN_67_URXD4__FUNC_TESTB_OUT10 (MTK_PIN_NO(67) | 7)
+
+#define MT8135_PIN_68_UTXD4__FUNC_GPIO68 (MTK_PIN_NO(68) | 0)
+#define MT8135_PIN_68_UTXD4__FUNC_UTXD4 (MTK_PIN_NO(68) | 1)
+#define MT8135_PIN_68_UTXD4__FUNC_EINT88 (MTK_PIN_NO(68) | 2)
+#define MT8135_PIN_68_UTXD4__FUNC_UTXD1 (MTK_PIN_NO(68) | 3)
+#define MT8135_PIN_68_UTXD4__FUNC_URXD4 (MTK_PIN_NO(68) | 6)
+#define MT8135_PIN_68_UTXD4__FUNC_TESTB_OUT11 (MTK_PIN_NO(68) | 7)
+
+#define MT8135_PIN_69_URXD1__FUNC_GPIO69 (MTK_PIN_NO(69) | 0)
+#define MT8135_PIN_69_URXD1__FUNC_URXD1 (MTK_PIN_NO(69) | 1)
+#define MT8135_PIN_69_URXD1__FUNC_EINT79 (MTK_PIN_NO(69) | 2)
+#define MT8135_PIN_69_URXD1__FUNC_URXD4 (MTK_PIN_NO(69) | 3)
+#define MT8135_PIN_69_URXD1__FUNC_UTXD1 (MTK_PIN_NO(69) | 6)
+#define MT8135_PIN_69_URXD1__FUNC_TESTB_OUT24 (MTK_PIN_NO(69) | 7)
+
+#define MT8135_PIN_70_UTXD1__FUNC_GPIO70 (MTK_PIN_NO(70) | 0)
+#define MT8135_PIN_70_UTXD1__FUNC_UTXD1 (MTK_PIN_NO(70) | 1)
+#define MT8135_PIN_70_UTXD1__FUNC_EINT78 (MTK_PIN_NO(70) | 2)
+#define MT8135_PIN_70_UTXD1__FUNC_UTXD4 (MTK_PIN_NO(70) | 3)
+#define MT8135_PIN_70_UTXD1__FUNC_URXD1 (MTK_PIN_NO(70) | 6)
+#define MT8135_PIN_70_UTXD1__FUNC_TESTB_OUT25 (MTK_PIN_NO(70) | 7)
+
+#define MT8135_PIN_71_UCTS1__FUNC_GPIO71 (MTK_PIN_NO(71) | 0)
+#define MT8135_PIN_71_UCTS1__FUNC_UCTS1 (MTK_PIN_NO(71) | 1)
+#define MT8135_PIN_71_UCTS1__FUNC_EINT80 (MTK_PIN_NO(71) | 2)
+#define MT8135_PIN_71_UCTS1__FUNC_CLKM0 (MTK_PIN_NO(71) | 5)
+#define MT8135_PIN_71_UCTS1__FUNC_URTS1 (MTK_PIN_NO(71) | 6)
+#define MT8135_PIN_71_UCTS1__FUNC_TESTB_OUT31 (MTK_PIN_NO(71) | 7)
+
+#define MT8135_PIN_72_URTS1__FUNC_GPIO72 (MTK_PIN_NO(72) | 0)
+#define MT8135_PIN_72_URTS1__FUNC_URTS1 (MTK_PIN_NO(72) | 1)
+#define MT8135_PIN_72_URTS1__FUNC_EINT81 (MTK_PIN_NO(72) | 2)
+#define MT8135_PIN_72_URTS1__FUNC_CLKM1 (MTK_PIN_NO(72) | 5)
+#define MT8135_PIN_72_URTS1__FUNC_UCTS1 (MTK_PIN_NO(72) | 6)
+#define MT8135_PIN_72_URTS1__FUNC_TESTB_OUT21 (MTK_PIN_NO(72) | 7)
+
+#define MT8135_PIN_73_PWM1__FUNC_GPIO73 (MTK_PIN_NO(73) | 0)
+#define MT8135_PIN_73_PWM1__FUNC_PWM1 (MTK_PIN_NO(73) | 1)
+#define MT8135_PIN_73_PWM1__FUNC_EINT73 (MTK_PIN_NO(73) | 2)
+#define MT8135_PIN_73_PWM1__FUNC_USB_DRVVBUS (MTK_PIN_NO(73) | 5)
+#define MT8135_PIN_73_PWM1__FUNC_DISP_PWM (MTK_PIN_NO(73) | 6)
+#define MT8135_PIN_73_PWM1__FUNC_TESTB_OUT8 (MTK_PIN_NO(73) | 7)
+
+#define MT8135_PIN_74_PWM2__FUNC_GPIO74 (MTK_PIN_NO(74) | 0)
+#define MT8135_PIN_74_PWM2__FUNC_PWM2 (MTK_PIN_NO(74) | 1)
+#define MT8135_PIN_74_PWM2__FUNC_EINT74 (MTK_PIN_NO(74) | 2)
+#define MT8135_PIN_74_PWM2__FUNC_DPI33_CK (MTK_PIN_NO(74) | 3)
+#define MT8135_PIN_74_PWM2__FUNC_PWM5 (MTK_PIN_NO(74) | 4)
+#define MT8135_PIN_74_PWM2__FUNC_URXD2 (MTK_PIN_NO(74) | 5)
+#define MT8135_PIN_74_PWM2__FUNC_DISP_PWM (MTK_PIN_NO(74) | 6)
+#define MT8135_PIN_74_PWM2__FUNC_TESTB_OUT9 (MTK_PIN_NO(74) | 7)
+
+#define MT8135_PIN_75_PWM3__FUNC_GPIO75 (MTK_PIN_NO(75) | 0)
+#define MT8135_PIN_75_PWM3__FUNC_PWM3 (MTK_PIN_NO(75) | 1)
+#define MT8135_PIN_75_PWM3__FUNC_EINT75 (MTK_PIN_NO(75) | 2)
+#define MT8135_PIN_75_PWM3__FUNC_DPI33_D0 (MTK_PIN_NO(75) | 3)
+#define MT8135_PIN_75_PWM3__FUNC_PWM6 (MTK_PIN_NO(75) | 4)
+#define MT8135_PIN_75_PWM3__FUNC_UTXD2 (MTK_PIN_NO(75) | 5)
+#define MT8135_PIN_75_PWM3__FUNC_DISP_PWM (MTK_PIN_NO(75) | 6)
+#define MT8135_PIN_75_PWM3__FUNC_TESTB_OUT12 (MTK_PIN_NO(75) | 7)
+
+#define MT8135_PIN_76_PWM4__FUNC_GPIO76 (MTK_PIN_NO(76) | 0)
+#define MT8135_PIN_76_PWM4__FUNC_PWM4 (MTK_PIN_NO(76) | 1)
+#define MT8135_PIN_76_PWM4__FUNC_EINT76 (MTK_PIN_NO(76) | 2)
+#define MT8135_PIN_76_PWM4__FUNC_DPI33_D1 (MTK_PIN_NO(76) | 3)
+#define MT8135_PIN_76_PWM4__FUNC_PWM7 (MTK_PIN_NO(76) | 4)
+#define MT8135_PIN_76_PWM4__FUNC_DISP_PWM (MTK_PIN_NO(76) | 6)
+#define MT8135_PIN_76_PWM4__FUNC_TESTB_OUT13 (MTK_PIN_NO(76) | 7)
+
+#define MT8135_PIN_77_MSDC2_DAT2__FUNC_GPIO77 (MTK_PIN_NO(77) | 0)
+#define MT8135_PIN_77_MSDC2_DAT2__FUNC_MSDC2_DAT2 (MTK_PIN_NO(77) | 1)
+#define MT8135_PIN_77_MSDC2_DAT2__FUNC_EINT63 (MTK_PIN_NO(77) | 2)
+#define MT8135_PIN_77_MSDC2_DAT2__FUNC_DSP2_IMS (MTK_PIN_NO(77) | 4)
+#define MT8135_PIN_77_MSDC2_DAT2__FUNC_DPI33_D6 (MTK_PIN_NO(77) | 6)
+#define MT8135_PIN_77_MSDC2_DAT2__FUNC_TESTA_OUT25 (MTK_PIN_NO(77) | 7)
+
+#define MT8135_PIN_78_MSDC2_DAT3__FUNC_GPIO78 (MTK_PIN_NO(78) | 0)
+#define MT8135_PIN_78_MSDC2_DAT3__FUNC_MSDC2_DAT3 (MTK_PIN_NO(78) | 1)
+#define MT8135_PIN_78_MSDC2_DAT3__FUNC_EINT64 (MTK_PIN_NO(78) | 2)
+#define MT8135_PIN_78_MSDC2_DAT3__FUNC_DSP2_ID (MTK_PIN_NO(78) | 4)
+#define MT8135_PIN_78_MSDC2_DAT3__FUNC_DPI33_D7 (MTK_PIN_NO(78) | 6)
+#define MT8135_PIN_78_MSDC2_DAT3__FUNC_TESTA_OUT26 (MTK_PIN_NO(78) | 7)
+
+#define MT8135_PIN_79_MSDC2_CMD__FUNC_GPIO79 (MTK_PIN_NO(79) | 0)
+#define MT8135_PIN_79_MSDC2_CMD__FUNC_MSDC2_CMD (MTK_PIN_NO(79) | 1)
+#define MT8135_PIN_79_MSDC2_CMD__FUNC_EINT60 (MTK_PIN_NO(79) | 2)
+#define MT8135_PIN_79_MSDC2_CMD__FUNC_DSP1_IMS (MTK_PIN_NO(79) | 4)
+#define MT8135_PIN_79_MSDC2_CMD__FUNC_PCM1_WS (MTK_PIN_NO(79) | 5)
+#define MT8135_PIN_79_MSDC2_CMD__FUNC_DPI33_D3 (MTK_PIN_NO(79) | 6)
+#define MT8135_PIN_79_MSDC2_CMD__FUNC_TESTA_OUT0 (MTK_PIN_NO(79) | 7)
+
+#define MT8135_PIN_80_MSDC2_CLK__FUNC_GPIO80 (MTK_PIN_NO(80) | 0)
+#define MT8135_PIN_80_MSDC2_CLK__FUNC_MSDC2_CLK (MTK_PIN_NO(80) | 1)
+#define MT8135_PIN_80_MSDC2_CLK__FUNC_EINT59 (MTK_PIN_NO(80) | 2)
+#define MT8135_PIN_80_MSDC2_CLK__FUNC_DSP1_ICK (MTK_PIN_NO(80) | 4)
+#define MT8135_PIN_80_MSDC2_CLK__FUNC_PCM1_CK (MTK_PIN_NO(80) | 5)
+#define MT8135_PIN_80_MSDC2_CLK__FUNC_DPI33_D2 (MTK_PIN_NO(80) | 6)
+#define MT8135_PIN_80_MSDC2_CLK__FUNC_TESTA_OUT1 (MTK_PIN_NO(80) | 7)
+
+#define MT8135_PIN_81_MSDC2_DAT1__FUNC_GPIO81 (MTK_PIN_NO(81) | 0)
+#define MT8135_PIN_81_MSDC2_DAT1__FUNC_MSDC2_DAT1 (MTK_PIN_NO(81) | 1)
+#define MT8135_PIN_81_MSDC2_DAT1__FUNC_EINT62 (MTK_PIN_NO(81) | 2)
+#define MT8135_PIN_81_MSDC2_DAT1__FUNC_DSP2_ICK (MTK_PIN_NO(81) | 4)
+#define MT8135_PIN_81_MSDC2_DAT1__FUNC_PCM1_DO (MTK_PIN_NO(81) | 5)
+#define MT8135_PIN_81_MSDC2_DAT1__FUNC_DPI33_D5 (MTK_PIN_NO(81) | 6)
+
+#define MT8135_PIN_82_MSDC2_DAT0__FUNC_GPIO82 (MTK_PIN_NO(82) | 0)
+#define MT8135_PIN_82_MSDC2_DAT0__FUNC_MSDC2_DAT0 (MTK_PIN_NO(82) | 1)
+#define MT8135_PIN_82_MSDC2_DAT0__FUNC_EINT61 (MTK_PIN_NO(82) | 2)
+#define MT8135_PIN_82_MSDC2_DAT0__FUNC_DSP1_ID (MTK_PIN_NO(82) | 4)
+#define MT8135_PIN_82_MSDC2_DAT0__FUNC_PCM1_DI (MTK_PIN_NO(82) | 5)
+#define MT8135_PIN_82_MSDC2_DAT0__FUNC_DPI33_D4 (MTK_PIN_NO(82) | 6)
+
+#define MT8135_PIN_83_MSDC1_DAT0__FUNC_GPIO83 (MTK_PIN_NO(83) | 0)
+#define MT8135_PIN_83_MSDC1_DAT0__FUNC_MSDC1_DAT0 (MTK_PIN_NO(83) | 1)
+#define MT8135_PIN_83_MSDC1_DAT0__FUNC_EINT53 (MTK_PIN_NO(83) | 2)
+#define MT8135_PIN_83_MSDC1_DAT0__FUNC_SCL1 (MTK_PIN_NO(83) | 3)
+#define MT8135_PIN_83_MSDC1_DAT0__FUNC_PWM2 (MTK_PIN_NO(83) | 4)
+#define MT8135_PIN_83_MSDC1_DAT0__FUNC_CLKM1 (MTK_PIN_NO(83) | 5)
+#define MT8135_PIN_83_MSDC1_DAT0__FUNC_TESTB_OUT2 (MTK_PIN_NO(83) | 7)
+
+#define MT8135_PIN_84_MSDC1_DAT1__FUNC_GPIO84 (MTK_PIN_NO(84) | 0)
+#define MT8135_PIN_84_MSDC1_DAT1__FUNC_MSDC1_DAT1 (MTK_PIN_NO(84) | 1)
+#define MT8135_PIN_84_MSDC1_DAT1__FUNC_EINT54 (MTK_PIN_NO(84) | 2)
+#define MT8135_PIN_84_MSDC1_DAT1__FUNC_SDA1 (MTK_PIN_NO(84) | 3)
+#define MT8135_PIN_84_MSDC1_DAT1__FUNC_PWM3 (MTK_PIN_NO(84) | 4)
+#define MT8135_PIN_84_MSDC1_DAT1__FUNC_CLKM2 (MTK_PIN_NO(84) | 5)
+#define MT8135_PIN_84_MSDC1_DAT1__FUNC_TESTB_OUT3 (MTK_PIN_NO(84) | 7)
+
+#define MT8135_PIN_85_MSDC1_CMD__FUNC_GPIO85 (MTK_PIN_NO(85) | 0)
+#define MT8135_PIN_85_MSDC1_CMD__FUNC_MSDC1_CMD (MTK_PIN_NO(85) | 1)
+#define MT8135_PIN_85_MSDC1_CMD__FUNC_EINT52 (MTK_PIN_NO(85) | 2)
+#define MT8135_PIN_85_MSDC1_CMD__FUNC_SDA0 (MTK_PIN_NO(85) | 3)
+#define MT8135_PIN_85_MSDC1_CMD__FUNC_PWM1 (MTK_PIN_NO(85) | 4)
+#define MT8135_PIN_85_MSDC1_CMD__FUNC_CLKM0 (MTK_PIN_NO(85) | 5)
+#define MT8135_PIN_85_MSDC1_CMD__FUNC_TESTB_OUT1 (MTK_PIN_NO(85) | 7)
+
+#define MT8135_PIN_86_MSDC1_CLK__FUNC_GPIO86 (MTK_PIN_NO(86) | 0)
+#define MT8135_PIN_86_MSDC1_CLK__FUNC_MSDC1_CLK (MTK_PIN_NO(86) | 1)
+#define MT8135_PIN_86_MSDC1_CLK__FUNC_EINT51 (MTK_PIN_NO(86) | 2)
+#define MT8135_PIN_86_MSDC1_CLK__FUNC_SCL0 (MTK_PIN_NO(86) | 3)
+#define MT8135_PIN_86_MSDC1_CLK__FUNC_DISP_PWM (MTK_PIN_NO(86) | 4)
+#define MT8135_PIN_86_MSDC1_CLK__FUNC_TESTB_OUT0 (MTK_PIN_NO(86) | 7)
+
+#define MT8135_PIN_87_MSDC1_DAT2__FUNC_GPIO87 (MTK_PIN_NO(87) | 0)
+#define MT8135_PIN_87_MSDC1_DAT2__FUNC_MSDC1_DAT2 (MTK_PIN_NO(87) | 1)
+#define MT8135_PIN_87_MSDC1_DAT2__FUNC_EINT55 (MTK_PIN_NO(87) | 2)
+#define MT8135_PIN_87_MSDC1_DAT2__FUNC_SCL4 (MTK_PIN_NO(87) | 3)
+#define MT8135_PIN_87_MSDC1_DAT2__FUNC_PWM4 (MTK_PIN_NO(87) | 4)
+#define MT8135_PIN_87_MSDC1_DAT2__FUNC_CLKM3 (MTK_PIN_NO(87) | 5)
+#define MT8135_PIN_87_MSDC1_DAT2__FUNC_TESTB_OUT4 (MTK_PIN_NO(87) | 7)
+
+#define MT8135_PIN_88_MSDC1_DAT3__FUNC_GPIO88 (MTK_PIN_NO(88) | 0)
+#define MT8135_PIN_88_MSDC1_DAT3__FUNC_MSDC1_DAT3 (MTK_PIN_NO(88) | 1)
+#define MT8135_PIN_88_MSDC1_DAT3__FUNC_EINT56 (MTK_PIN_NO(88) | 2)
+#define MT8135_PIN_88_MSDC1_DAT3__FUNC_SDA4 (MTK_PIN_NO(88) | 3)
+#define MT8135_PIN_88_MSDC1_DAT3__FUNC_PWM5 (MTK_PIN_NO(88) | 4)
+#define MT8135_PIN_88_MSDC1_DAT3__FUNC_CLKM4 (MTK_PIN_NO(88) | 5)
+#define MT8135_PIN_88_MSDC1_DAT3__FUNC_TESTB_OUT5 (MTK_PIN_NO(88) | 7)
+
+#define MT8135_PIN_89_MSDC4_DAT0__FUNC_GPIO89 (MTK_PIN_NO(89) | 0)
+#define MT8135_PIN_89_MSDC4_DAT0__FUNC_MSDC4_DAT0 (MTK_PIN_NO(89) | 1)
+#define MT8135_PIN_89_MSDC4_DAT0__FUNC_EINT133 (MTK_PIN_NO(89) | 2)
+#define MT8135_PIN_89_MSDC4_DAT0__FUNC_EXT_FRAME_SYNC (MTK_PIN_NO(89) | 4)
+#define MT8135_PIN_89_MSDC4_DAT0__FUNC_USB_DRVVBUS (MTK_PIN_NO(89) | 5)
+#define MT8135_PIN_89_MSDC4_DAT0__FUNC_A_FUNC_DIN_9 (MTK_PIN_NO(89) | 6)
+#define MT8135_PIN_89_MSDC4_DAT0__FUNC_LPTE (MTK_PIN_NO(89) | 7)
+
+#define MT8135_PIN_90_MSDC4_DAT1__FUNC_GPIO90 (MTK_PIN_NO(90) | 0)
+#define MT8135_PIN_90_MSDC4_DAT1__FUNC_MSDC4_DAT1 (MTK_PIN_NO(90) | 1)
+#define MT8135_PIN_90_MSDC4_DAT1__FUNC_EINT134 (MTK_PIN_NO(90) | 2)
+#define MT8135_PIN_90_MSDC4_DAT1__FUNC_A_FUNC_DIN_10 (MTK_PIN_NO(90) | 6)
+#define MT8135_PIN_90_MSDC4_DAT1__FUNC_LRSTB_1X (MTK_PIN_NO(90) | 7)
+
+#define MT8135_PIN_91_MSDC4_DAT5__FUNC_GPIO91 (MTK_PIN_NO(91) | 0)
+#define MT8135_PIN_91_MSDC4_DAT5__FUNC_MSDC4_DAT5 (MTK_PIN_NO(91) | 1)
+#define MT8135_PIN_91_MSDC4_DAT5__FUNC_EINT136 (MTK_PIN_NO(91) | 2)
+#define MT8135_PIN_91_MSDC4_DAT5__FUNC_I2SIN_WS (MTK_PIN_NO(91) | 3)
+#define MT8135_PIN_91_MSDC4_DAT5__FUNC_DAC_WS (MTK_PIN_NO(91) | 4)
+#define MT8135_PIN_91_MSDC4_DAT5__FUNC_PCM1_WS (MTK_PIN_NO(91) | 5)
+#define MT8135_PIN_91_MSDC4_DAT5__FUNC_A_FUNC_DIN_11 (MTK_PIN_NO(91) | 6)
+#define MT8135_PIN_91_MSDC4_DAT5__FUNC_SPI1_CSN (MTK_PIN_NO(91) | 7)
+
+#define MT8135_PIN_92_MSDC4_DAT6__FUNC_GPIO92 (MTK_PIN_NO(92) | 0)
+#define MT8135_PIN_92_MSDC4_DAT6__FUNC_MSDC4_DAT6 (MTK_PIN_NO(92) | 1)
+#define MT8135_PIN_92_MSDC4_DAT6__FUNC_EINT137 (MTK_PIN_NO(92) | 2)
+#define MT8135_PIN_92_MSDC4_DAT6__FUNC_I2SOUT_DAT (MTK_PIN_NO(92) | 3)
+#define MT8135_PIN_92_MSDC4_DAT6__FUNC_DAC_DAT_OUT (MTK_PIN_NO(92) | 4)
+#define MT8135_PIN_92_MSDC4_DAT6__FUNC_PCM1_DO (MTK_PIN_NO(92) | 5)
+#define MT8135_PIN_92_MSDC4_DAT6__FUNC_A_FUNC_DIN_12 (MTK_PIN_NO(92) | 6)
+#define MT8135_PIN_92_MSDC4_DAT6__FUNC_SPI1_MO (MTK_PIN_NO(92) | 7)
+
+#define MT8135_PIN_93_MSDC4_DAT7__FUNC_GPIO93 (MTK_PIN_NO(93) | 0)
+#define MT8135_PIN_93_MSDC4_DAT7__FUNC_MSDC4_DAT7 (MTK_PIN_NO(93) | 1)
+#define MT8135_PIN_93_MSDC4_DAT7__FUNC_EINT138 (MTK_PIN_NO(93) | 2)
+#define MT8135_PIN_93_MSDC4_DAT7__FUNC_I2SIN_DAT (MTK_PIN_NO(93) | 3)
+#define MT8135_PIN_93_MSDC4_DAT7__FUNC_PCM1_DI (MTK_PIN_NO(93) | 5)
+#define MT8135_PIN_93_MSDC4_DAT7__FUNC_A_FUNC_DIN_13 (MTK_PIN_NO(93) | 6)
+#define MT8135_PIN_93_MSDC4_DAT7__FUNC_SPI1_MI (MTK_PIN_NO(93) | 7)
+
+#define MT8135_PIN_94_MSDC4_DAT4__FUNC_GPIO94 (MTK_PIN_NO(94) | 0)
+#define MT8135_PIN_94_MSDC4_DAT4__FUNC_MSDC4_DAT4 (MTK_PIN_NO(94) | 1)
+#define MT8135_PIN_94_MSDC4_DAT4__FUNC_EINT135 (MTK_PIN_NO(94) | 2)
+#define MT8135_PIN_94_MSDC4_DAT4__FUNC_I2SIN_CK (MTK_PIN_NO(94) | 3)
+#define MT8135_PIN_94_MSDC4_DAT4__FUNC_DAC_CK (MTK_PIN_NO(94) | 4)
+#define MT8135_PIN_94_MSDC4_DAT4__FUNC_PCM1_CK (MTK_PIN_NO(94) | 5)
+#define MT8135_PIN_94_MSDC4_DAT4__FUNC_A_FUNC_DIN_14 (MTK_PIN_NO(94) | 6)
+#define MT8135_PIN_94_MSDC4_DAT4__FUNC_SPI1_CLK (MTK_PIN_NO(94) | 7)
+
+#define MT8135_PIN_95_MSDC4_DAT2__FUNC_GPIO95 (MTK_PIN_NO(95) | 0)
+#define MT8135_PIN_95_MSDC4_DAT2__FUNC_MSDC4_DAT2 (MTK_PIN_NO(95) | 1)
+#define MT8135_PIN_95_MSDC4_DAT2__FUNC_EINT131 (MTK_PIN_NO(95) | 2)
+#define MT8135_PIN_95_MSDC4_DAT2__FUNC_I2SIN_WS (MTK_PIN_NO(95) | 3)
+#define MT8135_PIN_95_MSDC4_DAT2__FUNC_CM2PDN_2X (MTK_PIN_NO(95) | 4)
+#define MT8135_PIN_95_MSDC4_DAT2__FUNC_DAC_WS (MTK_PIN_NO(95) | 5)
+#define MT8135_PIN_95_MSDC4_DAT2__FUNC_PCM1_WS (MTK_PIN_NO(95) | 6)
+#define MT8135_PIN_95_MSDC4_DAT2__FUNC_LSCE0B_1X (MTK_PIN_NO(95) | 7)
+
+#define MT8135_PIN_96_MSDC4_CLK__FUNC_GPIO96 (MTK_PIN_NO(96) | 0)
+#define MT8135_PIN_96_MSDC4_CLK__FUNC_MSDC4_CLK (MTK_PIN_NO(96) | 1)
+#define MT8135_PIN_96_MSDC4_CLK__FUNC_EINT129 (MTK_PIN_NO(96) | 2)
+#define MT8135_PIN_96_MSDC4_CLK__FUNC_DPI1_CK_2X (MTK_PIN_NO(96) | 3)
+#define MT8135_PIN_96_MSDC4_CLK__FUNC_CM2PCLK_2X (MTK_PIN_NO(96) | 4)
+#define MT8135_PIN_96_MSDC4_CLK__FUNC_PWM4 (MTK_PIN_NO(96) | 5)
+#define MT8135_PIN_96_MSDC4_CLK__FUNC_PCM1_DI (MTK_PIN_NO(96) | 6)
+#define MT8135_PIN_96_MSDC4_CLK__FUNC_LSCK_1X (MTK_PIN_NO(96) | 7)
+
+#define MT8135_PIN_97_MSDC4_DAT3__FUNC_GPIO97 (MTK_PIN_NO(97) | 0)
+#define MT8135_PIN_97_MSDC4_DAT3__FUNC_MSDC4_DAT3 (MTK_PIN_NO(97) | 1)
+#define MT8135_PIN_97_MSDC4_DAT3__FUNC_EINT132 (MTK_PIN_NO(97) | 2)
+#define MT8135_PIN_97_MSDC4_DAT3__FUNC_I2SOUT_DAT (MTK_PIN_NO(97) | 3)
+#define MT8135_PIN_97_MSDC4_DAT3__FUNC_CM2RST_2X (MTK_PIN_NO(97) | 4)
+#define MT8135_PIN_97_MSDC4_DAT3__FUNC_DAC_DAT_OUT (MTK_PIN_NO(97) | 5)
+#define MT8135_PIN_97_MSDC4_DAT3__FUNC_PCM1_DO (MTK_PIN_NO(97) | 6)
+#define MT8135_PIN_97_MSDC4_DAT3__FUNC_LSCE1B_1X (MTK_PIN_NO(97) | 7)
+
+#define MT8135_PIN_98_MSDC4_CMD__FUNC_GPIO98 (MTK_PIN_NO(98) | 0)
+#define MT8135_PIN_98_MSDC4_CMD__FUNC_MSDC4_CMD (MTK_PIN_NO(98) | 1)
+#define MT8135_PIN_98_MSDC4_CMD__FUNC_EINT128 (MTK_PIN_NO(98) | 2)
+#define MT8135_PIN_98_MSDC4_CMD__FUNC_DPI1_DE_2X (MTK_PIN_NO(98) | 3)
+#define MT8135_PIN_98_MSDC4_CMD__FUNC_PWM3 (MTK_PIN_NO(98) | 5)
+#define MT8135_PIN_98_MSDC4_CMD__FUNC_LSDA_1X (MTK_PIN_NO(98) | 7)
+
+#define MT8135_PIN_99_MSDC4_RSTB__FUNC_GPIO99 (MTK_PIN_NO(99) | 0)
+#define MT8135_PIN_99_MSDC4_RSTB__FUNC_MSDC4_RSTB (MTK_PIN_NO(99) | 1)
+#define MT8135_PIN_99_MSDC4_RSTB__FUNC_EINT130 (MTK_PIN_NO(99) | 2)
+#define MT8135_PIN_99_MSDC4_RSTB__FUNC_I2SIN_CK (MTK_PIN_NO(99) | 3)
+#define MT8135_PIN_99_MSDC4_RSTB__FUNC_CM2MCLK_2X (MTK_PIN_NO(99) | 4)
+#define MT8135_PIN_99_MSDC4_RSTB__FUNC_DAC_CK (MTK_PIN_NO(99) | 5)
+#define MT8135_PIN_99_MSDC4_RSTB__FUNC_PCM1_CK (MTK_PIN_NO(99) | 6)
+#define MT8135_PIN_99_MSDC4_RSTB__FUNC_LSA0_1X (MTK_PIN_NO(99) | 7)
+
+#define MT8135_PIN_100_SDA0__FUNC_GPIO100 (MTK_PIN_NO(100) | 0)
+#define MT8135_PIN_100_SDA0__FUNC_SDA0 (MTK_PIN_NO(100) | 1)
+#define MT8135_PIN_100_SDA0__FUNC_EINT91 (MTK_PIN_NO(100) | 2)
+#define MT8135_PIN_100_SDA0__FUNC_CLKM1 (MTK_PIN_NO(100) | 3)
+#define MT8135_PIN_100_SDA0__FUNC_PWM1 (MTK_PIN_NO(100) | 4)
+#define MT8135_PIN_100_SDA0__FUNC_A_FUNC_DIN_15 (MTK_PIN_NO(100) | 7)
+
+#define MT8135_PIN_101_SCL0__FUNC_GPIO101 (MTK_PIN_NO(101) | 0)
+#define MT8135_PIN_101_SCL0__FUNC_SCL0 (MTK_PIN_NO(101) | 1)
+#define MT8135_PIN_101_SCL0__FUNC_EINT90 (MTK_PIN_NO(101) | 2)
+#define MT8135_PIN_101_SCL0__FUNC_CLKM0 (MTK_PIN_NO(101) | 3)
+#define MT8135_PIN_101_SCL0__FUNC_DISP_PWM (MTK_PIN_NO(101) | 4)
+#define MT8135_PIN_101_SCL0__FUNC_A_FUNC_DIN_16 (MTK_PIN_NO(101) | 7)
+
+#define MT8135_PIN_102_EINT10_AUXIN2__FUNC_GPIO102 (MTK_PIN_NO(102) | 0)
+#define MT8135_PIN_102_EINT10_AUXIN2__FUNC_EINT10 (MTK_PIN_NO(102) | 1)
+#define MT8135_PIN_102_EINT10_AUXIN2__FUNC_USB_TEST_IO_16 (MTK_PIN_NO(102) | 5)
+#define MT8135_PIN_102_EINT10_AUXIN2__FUNC_TESTB_OUT16 (MTK_PIN_NO(102) | 6)
+#define MT8135_PIN_102_EINT10_AUXIN2__FUNC_A_FUNC_DIN_17 (MTK_PIN_NO(102) | 7)
+
+#define MT8135_PIN_103_EINT11_AUXIN3__FUNC_GPIO103 (MTK_PIN_NO(103) | 0)
+#define MT8135_PIN_103_EINT11_AUXIN3__FUNC_EINT11 (MTK_PIN_NO(103) | 1)
+#define MT8135_PIN_103_EINT11_AUXIN3__FUNC_USB_TEST_IO_17 (MTK_PIN_NO(103) | 5)
+#define MT8135_PIN_103_EINT11_AUXIN3__FUNC_TESTB_OUT17 (MTK_PIN_NO(103) | 6)
+#define MT8135_PIN_103_EINT11_AUXIN3__FUNC_A_FUNC_DIN_18 (MTK_PIN_NO(103) | 7)
+
+#define MT8135_PIN_104_EINT16_AUXIN4__FUNC_GPIO104 (MTK_PIN_NO(104) | 0)
+#define MT8135_PIN_104_EINT16_AUXIN4__FUNC_EINT16 (MTK_PIN_NO(104) | 1)
+#define MT8135_PIN_104_EINT16_AUXIN4__FUNC_USB_TEST_IO_18 (MTK_PIN_NO(104) | 5)
+#define MT8135_PIN_104_EINT16_AUXIN4__FUNC_TESTB_OUT18 (MTK_PIN_NO(104) | 6)
+#define MT8135_PIN_104_EINT16_AUXIN4__FUNC_A_FUNC_DIN_19 (MTK_PIN_NO(104) | 7)
+
+#define MT8135_PIN_105_I2S_CLK__FUNC_GPIO105 (MTK_PIN_NO(105) | 0)
+#define MT8135_PIN_105_I2S_CLK__FUNC_I2SIN_CK (MTK_PIN_NO(105) | 1)
+#define MT8135_PIN_105_I2S_CLK__FUNC_EINT10 (MTK_PIN_NO(105) | 2)
+#define MT8135_PIN_105_I2S_CLK__FUNC_DAC_CK (MTK_PIN_NO(105) | 3)
+#define MT8135_PIN_105_I2S_CLK__FUNC_PCM1_CK (MTK_PIN_NO(105) | 4)
+#define MT8135_PIN_105_I2S_CLK__FUNC_USB_TEST_IO_19 (MTK_PIN_NO(105) | 5)
+#define MT8135_PIN_105_I2S_CLK__FUNC_TESTB_OUT19 (MTK_PIN_NO(105) | 6)
+#define MT8135_PIN_105_I2S_CLK__FUNC_A_FUNC_DIN_20 (MTK_PIN_NO(105) | 7)
+
+#define MT8135_PIN_106_I2S_WS__FUNC_GPIO106 (MTK_PIN_NO(106) | 0)
+#define MT8135_PIN_106_I2S_WS__FUNC_I2SIN_WS (MTK_PIN_NO(106) | 1)
+#define MT8135_PIN_106_I2S_WS__FUNC_EINT13 (MTK_PIN_NO(106) | 2)
+#define MT8135_PIN_106_I2S_WS__FUNC_DAC_WS (MTK_PIN_NO(106) | 3)
+#define MT8135_PIN_106_I2S_WS__FUNC_PCM1_WS (MTK_PIN_NO(106) | 4)
+#define MT8135_PIN_106_I2S_WS__FUNC_USB_TEST_IO_20 (MTK_PIN_NO(106) | 5)
+#define MT8135_PIN_106_I2S_WS__FUNC_TESTB_OUT20 (MTK_PIN_NO(106) | 6)
+#define MT8135_PIN_106_I2S_WS__FUNC_A_FUNC_DIN_21 (MTK_PIN_NO(106) | 7)
+
+#define MT8135_PIN_107_I2S_DATA_IN__FUNC_GPIO107 (MTK_PIN_NO(107) | 0)
+#define MT8135_PIN_107_I2S_DATA_IN__FUNC_I2SIN_DAT (MTK_PIN_NO(107) | 1)
+#define MT8135_PIN_107_I2S_DATA_IN__FUNC_EINT11 (MTK_PIN_NO(107) | 2)
+#define MT8135_PIN_107_I2S_DATA_IN__FUNC_PCM1_DI (MTK_PIN_NO(107) | 4)
+#define MT8135_PIN_107_I2S_DATA_IN__FUNC_USB_TEST_IO_21 (MTK_PIN_NO(107) | 5)
+#define MT8135_PIN_107_I2S_DATA_IN__FUNC_TESTB_OUT22 (MTK_PIN_NO(107) | 6)
+#define MT8135_PIN_107_I2S_DATA_IN__FUNC_A_FUNC_DIN_22 (MTK_PIN_NO(107) | 7)
+
+#define MT8135_PIN_108_I2S_DATA_OUT__FUNC_GPIO108 (MTK_PIN_NO(108) | 0)
+#define MT8135_PIN_108_I2S_DATA_OUT__FUNC_I2SOUT_DAT (MTK_PIN_NO(108) | 1)
+#define MT8135_PIN_108_I2S_DATA_OUT__FUNC_EINT12 (MTK_PIN_NO(108) | 2)
+#define MT8135_PIN_108_I2S_DATA_OUT__FUNC_DAC_DAT_OUT (MTK_PIN_NO(108) | 3)
+#define MT8135_PIN_108_I2S_DATA_OUT__FUNC_PCM1_DO (MTK_PIN_NO(108) | 4)
+#define MT8135_PIN_108_I2S_DATA_OUT__FUNC_USB_TEST_IO_22 (MTK_PIN_NO(108) | 5)
+#define MT8135_PIN_108_I2S_DATA_OUT__FUNC_TESTB_OUT23 (MTK_PIN_NO(108) | 6)
+#define MT8135_PIN_108_I2S_DATA_OUT__FUNC_A_FUNC_DIN_23 (MTK_PIN_NO(108) | 7)
+
+#define MT8135_PIN_109_EINT5__FUNC_GPIO109 (MTK_PIN_NO(109) | 0)
+#define MT8135_PIN_109_EINT5__FUNC_EINT5 (MTK_PIN_NO(109) | 1)
+#define MT8135_PIN_109_EINT5__FUNC_PWM5 (MTK_PIN_NO(109) | 2)
+#define MT8135_PIN_109_EINT5__FUNC_CLKM3 (MTK_PIN_NO(109) | 3)
+#define MT8135_PIN_109_EINT5__FUNC_GPU_JTRSTB (MTK_PIN_NO(109) | 4)
+#define MT8135_PIN_109_EINT5__FUNC_USB_TEST_IO_23 (MTK_PIN_NO(109) | 5)
+#define MT8135_PIN_109_EINT5__FUNC_TESTB_OUT26 (MTK_PIN_NO(109) | 6)
+#define MT8135_PIN_109_EINT5__FUNC_A_FUNC_DIN_24 (MTK_PIN_NO(109) | 7)
+
+#define MT8135_PIN_110_EINT6__FUNC_GPIO110 (MTK_PIN_NO(110) | 0)
+#define MT8135_PIN_110_EINT6__FUNC_EINT6 (MTK_PIN_NO(110) | 1)
+#define MT8135_PIN_110_EINT6__FUNC_PWM6 (MTK_PIN_NO(110) | 2)
+#define MT8135_PIN_110_EINT6__FUNC_CLKM4 (MTK_PIN_NO(110) | 3)
+#define MT8135_PIN_110_EINT6__FUNC_GPU_JTMS (MTK_PIN_NO(110) | 4)
+#define MT8135_PIN_110_EINT6__FUNC_USB_TEST_IO_24 (MTK_PIN_NO(110) | 5)
+#define MT8135_PIN_110_EINT6__FUNC_TESTB_OUT27 (MTK_PIN_NO(110) | 6)
+#define MT8135_PIN_110_EINT6__FUNC_A_FUNC_DIN_25 (MTK_PIN_NO(110) | 7)
+
+#define MT8135_PIN_111_EINT7__FUNC_GPIO111 (MTK_PIN_NO(111) | 0)
+#define MT8135_PIN_111_EINT7__FUNC_EINT7 (MTK_PIN_NO(111) | 1)
+#define MT8135_PIN_111_EINT7__FUNC_PWM7 (MTK_PIN_NO(111) | 2)
+#define MT8135_PIN_111_EINT7__FUNC_CLKM5 (MTK_PIN_NO(111) | 3)
+#define MT8135_PIN_111_EINT7__FUNC_GPU_JTDO (MTK_PIN_NO(111) | 4)
+#define MT8135_PIN_111_EINT7__FUNC_USB_TEST_IO_25 (MTK_PIN_NO(111) | 5)
+#define MT8135_PIN_111_EINT7__FUNC_TESTB_OUT28 (MTK_PIN_NO(111) | 6)
+#define MT8135_PIN_111_EINT7__FUNC_A_FUNC_DIN_26 (MTK_PIN_NO(111) | 7)
+
+#define MT8135_PIN_112_EINT8__FUNC_GPIO112 (MTK_PIN_NO(112) | 0)
+#define MT8135_PIN_112_EINT8__FUNC_EINT8 (MTK_PIN_NO(112) | 1)
+#define MT8135_PIN_112_EINT8__FUNC_DISP_PWM (MTK_PIN_NO(112) | 2)
+#define MT8135_PIN_112_EINT8__FUNC_CLKM6 (MTK_PIN_NO(112) | 3)
+#define MT8135_PIN_112_EINT8__FUNC_GPU_JTDI (MTK_PIN_NO(112) | 4)
+#define MT8135_PIN_112_EINT8__FUNC_USB_TEST_IO_26 (MTK_PIN_NO(112) | 5)
+#define MT8135_PIN_112_EINT8__FUNC_TESTB_OUT29 (MTK_PIN_NO(112) | 6)
+#define MT8135_PIN_112_EINT8__FUNC_EXT_FRAME_SYNC (MTK_PIN_NO(112) | 7)
+
+#define MT8135_PIN_113_EINT9__FUNC_GPIO113 (MTK_PIN_NO(113) | 0)
+#define MT8135_PIN_113_EINT9__FUNC_EINT9 (MTK_PIN_NO(113) | 1)
+#define MT8135_PIN_113_EINT9__FUNC_GPU_JTCK (MTK_PIN_NO(113) | 4)
+#define MT8135_PIN_113_EINT9__FUNC_USB_DRVVBUS (MTK_PIN_NO(113) | 5)
+#define MT8135_PIN_113_EINT9__FUNC_TESTB_OUT30 (MTK_PIN_NO(113) | 6)
+#define MT8135_PIN_113_EINT9__FUNC_A_FUNC_DIN_27 (MTK_PIN_NO(113) | 7)
+
+#define MT8135_PIN_114_LPCE1B__FUNC_GPIO114 (MTK_PIN_NO(114) | 0)
+#define MT8135_PIN_114_LPCE1B__FUNC_LPCE1B (MTK_PIN_NO(114) | 1)
+#define MT8135_PIN_114_LPCE1B__FUNC_EINT127 (MTK_PIN_NO(114) | 2)
+#define MT8135_PIN_114_LPCE1B__FUNC_PWM2 (MTK_PIN_NO(114) | 5)
+#define MT8135_PIN_114_LPCE1B__FUNC_TESTB_OUT14 (MTK_PIN_NO(114) | 6)
+#define MT8135_PIN_114_LPCE1B__FUNC_A_FUNC_DIN_28 (MTK_PIN_NO(114) | 7)
+
+#define MT8135_PIN_115_LPCE0B__FUNC_GPIO115 (MTK_PIN_NO(115) | 0)
+#define MT8135_PIN_115_LPCE0B__FUNC_LPCE0B (MTK_PIN_NO(115) | 1)
+#define MT8135_PIN_115_LPCE0B__FUNC_EINT126 (MTK_PIN_NO(115) | 2)
+#define MT8135_PIN_115_LPCE0B__FUNC_PWM1 (MTK_PIN_NO(115) | 5)
+#define MT8135_PIN_115_LPCE0B__FUNC_TESTB_OUT15 (MTK_PIN_NO(115) | 6)
+#define MT8135_PIN_115_LPCE0B__FUNC_A_FUNC_DIN_29 (MTK_PIN_NO(115) | 7)
+
+#define MT8135_PIN_116_DISP_PWM__FUNC_GPIO116 (MTK_PIN_NO(116) | 0)
+#define MT8135_PIN_116_DISP_PWM__FUNC_DISP_PWM (MTK_PIN_NO(116) | 1)
+#define MT8135_PIN_116_DISP_PWM__FUNC_EINT77 (MTK_PIN_NO(116) | 2)
+#define MT8135_PIN_116_DISP_PWM__FUNC_LSDI (MTK_PIN_NO(116) | 3)
+#define MT8135_PIN_116_DISP_PWM__FUNC_PWM1 (MTK_PIN_NO(116) | 4)
+#define MT8135_PIN_116_DISP_PWM__FUNC_PWM2 (MTK_PIN_NO(116) | 5)
+#define MT8135_PIN_116_DISP_PWM__FUNC_PWM3 (MTK_PIN_NO(116) | 7)
+
+#define MT8135_PIN_117_EINT1__FUNC_GPIO117 (MTK_PIN_NO(117) | 0)
+#define MT8135_PIN_117_EINT1__FUNC_EINT1 (MTK_PIN_NO(117) | 1)
+#define MT8135_PIN_117_EINT1__FUNC_PWM2 (MTK_PIN_NO(117) | 2)
+#define MT8135_PIN_117_EINT1__FUNC_CLKM1 (MTK_PIN_NO(117) | 3)
+#define MT8135_PIN_117_EINT1__FUNC_USB_TEST_IO_13 (MTK_PIN_NO(117) | 5)
+#define MT8135_PIN_117_EINT1__FUNC_USB_SDA (MTK_PIN_NO(117) | 7)
+
+#define MT8135_PIN_118_EINT2__FUNC_GPIO118 (MTK_PIN_NO(118) | 0)
+#define MT8135_PIN_118_EINT2__FUNC_EINT2 (MTK_PIN_NO(118) | 1)
+#define MT8135_PIN_118_EINT2__FUNC_PWM3 (MTK_PIN_NO(118) | 2)
+#define MT8135_PIN_118_EINT2__FUNC_CLKM2 (MTK_PIN_NO(118) | 3)
+#define MT8135_PIN_118_EINT2__FUNC_USB_TEST_IO_14 (MTK_PIN_NO(118) | 5)
+#define MT8135_PIN_118_EINT2__FUNC_SRCLKENAI2 (MTK_PIN_NO(118) | 6)
+#define MT8135_PIN_118_EINT2__FUNC_A_FUNC_DIN_30 (MTK_PIN_NO(118) | 7)
+
+#define MT8135_PIN_119_EINT3__FUNC_GPIO119 (MTK_PIN_NO(119) | 0)
+#define MT8135_PIN_119_EINT3__FUNC_EINT3 (MTK_PIN_NO(119) | 1)
+#define MT8135_PIN_119_EINT3__FUNC_USB_TEST_IO_15 (MTK_PIN_NO(119) | 5)
+#define MT8135_PIN_119_EINT3__FUNC_SRCLKENAI1 (MTK_PIN_NO(119) | 6)
+#define MT8135_PIN_119_EINT3__FUNC_EXT_26M_CK (MTK_PIN_NO(119) | 7)
+
+#define MT8135_PIN_120_EINT4__FUNC_GPIO120 (MTK_PIN_NO(120) | 0)
+#define MT8135_PIN_120_EINT4__FUNC_EINT4 (MTK_PIN_NO(120) | 1)
+#define MT8135_PIN_120_EINT4__FUNC_PWM4 (MTK_PIN_NO(120) | 2)
+#define MT8135_PIN_120_EINT4__FUNC_USB_DRVVBUS (MTK_PIN_NO(120) | 5)
+#define MT8135_PIN_120_EINT4__FUNC_A_FUNC_DIN_31 (MTK_PIN_NO(120) | 7)
+
+#define MT8135_PIN_121_DPIDE__FUNC_GPIO121 (MTK_PIN_NO(121) | 0)
+#define MT8135_PIN_121_DPIDE__FUNC_DPI0_DE (MTK_PIN_NO(121) | 1)
+#define MT8135_PIN_121_DPIDE__FUNC_EINT100 (MTK_PIN_NO(121) | 2)
+#define MT8135_PIN_121_DPIDE__FUNC_I2SOUT_DAT (MTK_PIN_NO(121) | 3)
+#define MT8135_PIN_121_DPIDE__FUNC_DAC_DAT_OUT (MTK_PIN_NO(121) | 4)
+#define MT8135_PIN_121_DPIDE__FUNC_PCM1_DO (MTK_PIN_NO(121) | 5)
+#define MT8135_PIN_121_DPIDE__FUNC_IRDA_TXD (MTK_PIN_NO(121) | 6)
+
+#define MT8135_PIN_122_DPICK__FUNC_GPIO122 (MTK_PIN_NO(122) | 0)
+#define MT8135_PIN_122_DPICK__FUNC_DPI0_CK (MTK_PIN_NO(122) | 1)
+#define MT8135_PIN_122_DPICK__FUNC_EINT101 (MTK_PIN_NO(122) | 2)
+#define MT8135_PIN_122_DPICK__FUNC_I2SIN_DAT (MTK_PIN_NO(122) | 3)
+#define MT8135_PIN_122_DPICK__FUNC_PCM1_DI (MTK_PIN_NO(122) | 5)
+#define MT8135_PIN_122_DPICK__FUNC_IRDA_PDN (MTK_PIN_NO(122) | 6)
+
+#define MT8135_PIN_123_DPIG4__FUNC_GPIO123 (MTK_PIN_NO(123) | 0)
+#define MT8135_PIN_123_DPIG4__FUNC_DPI0_G4 (MTK_PIN_NO(123) | 1)
+#define MT8135_PIN_123_DPIG4__FUNC_EINT114 (MTK_PIN_NO(123) | 2)
+#define MT8135_PIN_123_DPIG4__FUNC_CM2DAT_2X_0 (MTK_PIN_NO(123) | 4)
+#define MT8135_PIN_123_DPIG4__FUNC_DSP2_ID (MTK_PIN_NO(123) | 5)
+
+#define MT8135_PIN_124_DPIG5__FUNC_GPIO124 (MTK_PIN_NO(124) | 0)
+#define MT8135_PIN_124_DPIG5__FUNC_DPI0_G5 (MTK_PIN_NO(124) | 1)
+#define MT8135_PIN_124_DPIG5__FUNC_EINT115 (MTK_PIN_NO(124) | 2)
+#define MT8135_PIN_124_DPIG5__FUNC_CM2DAT_2X_1 (MTK_PIN_NO(124) | 4)
+#define MT8135_PIN_124_DPIG5__FUNC_DSP2_ICK (MTK_PIN_NO(124) | 5)
+
+#define MT8135_PIN_125_DPIR3__FUNC_GPIO125 (MTK_PIN_NO(125) | 0)
+#define MT8135_PIN_125_DPIR3__FUNC_DPI0_R3 (MTK_PIN_NO(125) | 1)
+#define MT8135_PIN_125_DPIR3__FUNC_EINT121 (MTK_PIN_NO(125) | 2)
+#define MT8135_PIN_125_DPIR3__FUNC_CM2DAT_2X_7 (MTK_PIN_NO(125) | 4)
+
+#define MT8135_PIN_126_DPIG1__FUNC_GPIO126 (MTK_PIN_NO(126) | 0)
+#define MT8135_PIN_126_DPIG1__FUNC_DPI0_G1 (MTK_PIN_NO(126) | 1)
+#define MT8135_PIN_126_DPIG1__FUNC_EINT111 (MTK_PIN_NO(126) | 2)
+#define MT8135_PIN_126_DPIG1__FUNC_DSP1_ICK (MTK_PIN_NO(126) | 5)
+
+#define MT8135_PIN_127_DPIVSYNC__FUNC_GPIO127 (MTK_PIN_NO(127) | 0)
+#define MT8135_PIN_127_DPIVSYNC__FUNC_DPI0_VSYNC (MTK_PIN_NO(127) | 1)
+#define MT8135_PIN_127_DPIVSYNC__FUNC_EINT98 (MTK_PIN_NO(127) | 2)
+#define MT8135_PIN_127_DPIVSYNC__FUNC_I2SIN_CK (MTK_PIN_NO(127) | 3)
+#define MT8135_PIN_127_DPIVSYNC__FUNC_DAC_CK (MTK_PIN_NO(127) | 4)
+#define MT8135_PIN_127_DPIVSYNC__FUNC_PCM1_CK (MTK_PIN_NO(127) | 5)
+
+#define MT8135_PIN_128_DPIHSYNC__FUNC_GPIO128 (MTK_PIN_NO(128) | 0)
+#define MT8135_PIN_128_DPIHSYNC__FUNC_DPI0_HSYNC (MTK_PIN_NO(128) | 1)
+#define MT8135_PIN_128_DPIHSYNC__FUNC_EINT99 (MTK_PIN_NO(128) | 2)
+#define MT8135_PIN_128_DPIHSYNC__FUNC_I2SIN_WS (MTK_PIN_NO(128) | 3)
+#define MT8135_PIN_128_DPIHSYNC__FUNC_DAC_WS (MTK_PIN_NO(128) | 4)
+#define MT8135_PIN_128_DPIHSYNC__FUNC_PCM1_WS (MTK_PIN_NO(128) | 5)
+#define MT8135_PIN_128_DPIHSYNC__FUNC_IRDA_RXD (MTK_PIN_NO(128) | 6)
+
+#define MT8135_PIN_129_DPIB0__FUNC_GPIO129 (MTK_PIN_NO(129) | 0)
+#define MT8135_PIN_129_DPIB0__FUNC_DPI0_B0 (MTK_PIN_NO(129) | 1)
+#define MT8135_PIN_129_DPIB0__FUNC_EINT102 (MTK_PIN_NO(129) | 2)
+#define MT8135_PIN_129_DPIB0__FUNC_SCL0 (MTK_PIN_NO(129) | 4)
+#define MT8135_PIN_129_DPIB0__FUNC_DISP_PWM (MTK_PIN_NO(129) | 5)
+
+#define MT8135_PIN_130_DPIB1__FUNC_GPIO130 (MTK_PIN_NO(130) | 0)
+#define MT8135_PIN_130_DPIB1__FUNC_DPI0_B1 (MTK_PIN_NO(130) | 1)
+#define MT8135_PIN_130_DPIB1__FUNC_EINT103 (MTK_PIN_NO(130) | 2)
+#define MT8135_PIN_130_DPIB1__FUNC_CLKM0 (MTK_PIN_NO(130) | 3)
+#define MT8135_PIN_130_DPIB1__FUNC_SDA0 (MTK_PIN_NO(130) | 4)
+#define MT8135_PIN_130_DPIB1__FUNC_PWM1 (MTK_PIN_NO(130) | 5)
+
+#define MT8135_PIN_131_DPIB2__FUNC_GPIO131 (MTK_PIN_NO(131) | 0)
+#define MT8135_PIN_131_DPIB2__FUNC_DPI0_B2 (MTK_PIN_NO(131) | 1)
+#define MT8135_PIN_131_DPIB2__FUNC_EINT104 (MTK_PIN_NO(131) | 2)
+#define MT8135_PIN_131_DPIB2__FUNC_CLKM1 (MTK_PIN_NO(131) | 3)
+#define MT8135_PIN_131_DPIB2__FUNC_SCL1 (MTK_PIN_NO(131) | 4)
+#define MT8135_PIN_131_DPIB2__FUNC_PWM2 (MTK_PIN_NO(131) | 5)
+
+#define MT8135_PIN_132_DPIB3__FUNC_GPIO132 (MTK_PIN_NO(132) | 0)
+#define MT8135_PIN_132_DPIB3__FUNC_DPI0_B3 (MTK_PIN_NO(132) | 1)
+#define MT8135_PIN_132_DPIB3__FUNC_EINT105 (MTK_PIN_NO(132) | 2)
+#define MT8135_PIN_132_DPIB3__FUNC_CLKM2 (MTK_PIN_NO(132) | 3)
+#define MT8135_PIN_132_DPIB3__FUNC_SDA1 (MTK_PIN_NO(132) | 4)
+#define MT8135_PIN_132_DPIB3__FUNC_PWM3 (MTK_PIN_NO(132) | 5)
+
+#define MT8135_PIN_133_DPIB4__FUNC_GPIO133 (MTK_PIN_NO(133) | 0)
+#define MT8135_PIN_133_DPIB4__FUNC_DPI0_B4 (MTK_PIN_NO(133) | 1)
+#define MT8135_PIN_133_DPIB4__FUNC_EINT106 (MTK_PIN_NO(133) | 2)
+#define MT8135_PIN_133_DPIB4__FUNC_CLKM3 (MTK_PIN_NO(133) | 3)
+#define MT8135_PIN_133_DPIB4__FUNC_SCL2 (MTK_PIN_NO(133) | 4)
+#define MT8135_PIN_133_DPIB4__FUNC_PWM4 (MTK_PIN_NO(133) | 5)
+
+#define MT8135_PIN_134_DPIB5__FUNC_GPIO134 (MTK_PIN_NO(134) | 0)
+#define MT8135_PIN_134_DPIB5__FUNC_DPI0_B5 (MTK_PIN_NO(134) | 1)
+#define MT8135_PIN_134_DPIB5__FUNC_EINT107 (MTK_PIN_NO(134) | 2)
+#define MT8135_PIN_134_DPIB5__FUNC_CLKM4 (MTK_PIN_NO(134) | 3)
+#define MT8135_PIN_134_DPIB5__FUNC_SDA2 (MTK_PIN_NO(134) | 4)
+#define MT8135_PIN_134_DPIB5__FUNC_PWM5 (MTK_PIN_NO(134) | 5)
+
+#define MT8135_PIN_135_DPIB6__FUNC_GPIO135 (MTK_PIN_NO(135) | 0)
+#define MT8135_PIN_135_DPIB6__FUNC_DPI0_B6 (MTK_PIN_NO(135) | 1)
+#define MT8135_PIN_135_DPIB6__FUNC_EINT108 (MTK_PIN_NO(135) | 2)
+#define MT8135_PIN_135_DPIB6__FUNC_CLKM5 (MTK_PIN_NO(135) | 3)
+#define MT8135_PIN_135_DPIB6__FUNC_SCL3 (MTK_PIN_NO(135) | 4)
+#define MT8135_PIN_135_DPIB6__FUNC_PWM6 (MTK_PIN_NO(135) | 5)
+
+#define MT8135_PIN_136_DPIB7__FUNC_GPIO136 (MTK_PIN_NO(136) | 0)
+#define MT8135_PIN_136_DPIB7__FUNC_DPI0_B7 (MTK_PIN_NO(136) | 1)
+#define MT8135_PIN_136_DPIB7__FUNC_EINT109 (MTK_PIN_NO(136) | 2)
+#define MT8135_PIN_136_DPIB7__FUNC_CLKM6 (MTK_PIN_NO(136) | 3)
+#define MT8135_PIN_136_DPIB7__FUNC_SDA3 (MTK_PIN_NO(136) | 4)
+#define MT8135_PIN_136_DPIB7__FUNC_PWM7 (MTK_PIN_NO(136) | 5)
+
+#define MT8135_PIN_137_DPIG0__FUNC_GPIO137 (MTK_PIN_NO(137) | 0)
+#define MT8135_PIN_137_DPIG0__FUNC_DPI0_G0 (MTK_PIN_NO(137) | 1)
+#define MT8135_PIN_137_DPIG0__FUNC_EINT110 (MTK_PIN_NO(137) | 2)
+#define MT8135_PIN_137_DPIG0__FUNC_DSP1_ID (MTK_PIN_NO(137) | 5)
+
+#define MT8135_PIN_138_DPIG2__FUNC_GPIO138 (MTK_PIN_NO(138) | 0)
+#define MT8135_PIN_138_DPIG2__FUNC_DPI0_G2 (MTK_PIN_NO(138) | 1)
+#define MT8135_PIN_138_DPIG2__FUNC_EINT112 (MTK_PIN_NO(138) | 2)
+#define MT8135_PIN_138_DPIG2__FUNC_DSP1_IMS (MTK_PIN_NO(138) | 5)
+
+#define MT8135_PIN_139_DPIG3__FUNC_GPIO139 (MTK_PIN_NO(139) | 0)
+#define MT8135_PIN_139_DPIG3__FUNC_DPI0_G3 (MTK_PIN_NO(139) | 1)
+#define MT8135_PIN_139_DPIG3__FUNC_EINT113 (MTK_PIN_NO(139) | 2)
+#define MT8135_PIN_139_DPIG3__FUNC_DSP2_IMS (MTK_PIN_NO(139) | 5)
+
+#define MT8135_PIN_140_DPIG6__FUNC_GPIO140 (MTK_PIN_NO(140) | 0)
+#define MT8135_PIN_140_DPIG6__FUNC_DPI0_G6 (MTK_PIN_NO(140) | 1)
+#define MT8135_PIN_140_DPIG6__FUNC_EINT116 (MTK_PIN_NO(140) | 2)
+#define MT8135_PIN_140_DPIG6__FUNC_CM2DAT_2X_2 (MTK_PIN_NO(140) | 4)
+
+#define MT8135_PIN_141_DPIG7__FUNC_GPIO141 (MTK_PIN_NO(141) | 0)
+#define MT8135_PIN_141_DPIG7__FUNC_DPI0_G7 (MTK_PIN_NO(141) | 1)
+#define MT8135_PIN_141_DPIG7__FUNC_EINT117 (MTK_PIN_NO(141) | 2)
+#define MT8135_PIN_141_DPIG7__FUNC_CM2DAT_2X_3 (MTK_PIN_NO(141) | 4)
+
+#define MT8135_PIN_142_DPIR0__FUNC_GPIO142 (MTK_PIN_NO(142) | 0)
+#define MT8135_PIN_142_DPIR0__FUNC_DPI0_R0 (MTK_PIN_NO(142) | 1)
+#define MT8135_PIN_142_DPIR0__FUNC_EINT118 (MTK_PIN_NO(142) | 2)
+#define MT8135_PIN_142_DPIR0__FUNC_CM2DAT_2X_4 (MTK_PIN_NO(142) | 4)
+
+#define MT8135_PIN_143_DPIR1__FUNC_GPIO143 (MTK_PIN_NO(143) | 0)
+#define MT8135_PIN_143_DPIR1__FUNC_DPI0_R1 (MTK_PIN_NO(143) | 1)
+#define MT8135_PIN_143_DPIR1__FUNC_EINT119 (MTK_PIN_NO(143) | 2)
+#define MT8135_PIN_143_DPIR1__FUNC_CM2DAT_2X_5 (MTK_PIN_NO(143) | 4)
+
+#define MT8135_PIN_144_DPIR2__FUNC_GPIO144 (MTK_PIN_NO(144) | 0)
+#define MT8135_PIN_144_DPIR2__FUNC_DPI0_R2 (MTK_PIN_NO(144) | 1)
+#define MT8135_PIN_144_DPIR2__FUNC_EINT120 (MTK_PIN_NO(144) | 2)
+#define MT8135_PIN_144_DPIR2__FUNC_CM2DAT_2X_6 (MTK_PIN_NO(144) | 4)
+
+#define MT8135_PIN_145_DPIR4__FUNC_GPIO145 (MTK_PIN_NO(145) | 0)
+#define MT8135_PIN_145_DPIR4__FUNC_DPI0_R4 (MTK_PIN_NO(145) | 1)
+#define MT8135_PIN_145_DPIR4__FUNC_EINT122 (MTK_PIN_NO(145) | 2)
+#define MT8135_PIN_145_DPIR4__FUNC_CM2DAT_2X_8 (MTK_PIN_NO(145) | 4)
+
+#define MT8135_PIN_146_DPIR5__FUNC_GPIO146 (MTK_PIN_NO(146) | 0)
+#define MT8135_PIN_146_DPIR5__FUNC_DPI0_R5 (MTK_PIN_NO(146) | 1)
+#define MT8135_PIN_146_DPIR5__FUNC_EINT123 (MTK_PIN_NO(146) | 2)
+#define MT8135_PIN_146_DPIR5__FUNC_CM2DAT_2X_9 (MTK_PIN_NO(146) | 4)
+
+#define MT8135_PIN_147_DPIR6__FUNC_GPIO147 (MTK_PIN_NO(147) | 0)
+#define MT8135_PIN_147_DPIR6__FUNC_DPI0_R6 (MTK_PIN_NO(147) | 1)
+#define MT8135_PIN_147_DPIR6__FUNC_EINT124 (MTK_PIN_NO(147) | 2)
+#define MT8135_PIN_147_DPIR6__FUNC_CM2VSYNC_2X (MTK_PIN_NO(147) | 4)
+
+#define MT8135_PIN_148_DPIR7__FUNC_GPIO148 (MTK_PIN_NO(148) | 0)
+#define MT8135_PIN_148_DPIR7__FUNC_DPI0_R7 (MTK_PIN_NO(148) | 1)
+#define MT8135_PIN_148_DPIR7__FUNC_EINT125 (MTK_PIN_NO(148) | 2)
+#define MT8135_PIN_148_DPIR7__FUNC_CM2HSYNC_2X (MTK_PIN_NO(148) | 4)
+
+#define MT8135_PIN_149_TDN3__FUNC_GPIO149 (MTK_PIN_NO(149) | 0)
+#define MT8135_PIN_149_TDN3__FUNC_EINT36 (MTK_PIN_NO(149) | 2)
+
+#define MT8135_PIN_150_TDP3__FUNC_GPIO150 (MTK_PIN_NO(150) | 0)
+#define MT8135_PIN_150_TDP3__FUNC_EINT35 (MTK_PIN_NO(150) | 2)
+
+#define MT8135_PIN_151_TDN2__FUNC_GPIO151 (MTK_PIN_NO(151) | 0)
+#define MT8135_PIN_151_TDN2__FUNC_EINT169 (MTK_PIN_NO(151) | 2)
+
+#define MT8135_PIN_152_TDP2__FUNC_GPIO152 (MTK_PIN_NO(152) | 0)
+#define MT8135_PIN_152_TDP2__FUNC_EINT168 (MTK_PIN_NO(152) | 2)
+
+#define MT8135_PIN_153_TCN__FUNC_GPIO153 (MTK_PIN_NO(153) | 0)
+#define MT8135_PIN_153_TCN__FUNC_EINT163 (MTK_PIN_NO(153) | 2)
+
+#define MT8135_PIN_154_TCP__FUNC_GPIO154 (MTK_PIN_NO(154) | 0)
+#define MT8135_PIN_154_TCP__FUNC_EINT162 (MTK_PIN_NO(154) | 2)
+
+#define MT8135_PIN_155_TDN1__FUNC_GPIO155 (MTK_PIN_NO(155) | 0)
+#define MT8135_PIN_155_TDN1__FUNC_EINT167 (MTK_PIN_NO(155) | 2)
+
+#define MT8135_PIN_156_TDP1__FUNC_GPIO156 (MTK_PIN_NO(156) | 0)
+#define MT8135_PIN_156_TDP1__FUNC_EINT166 (MTK_PIN_NO(156) | 2)
+
+#define MT8135_PIN_157_TDN0__FUNC_GPIO157 (MTK_PIN_NO(157) | 0)
+#define MT8135_PIN_157_TDN0__FUNC_EINT165 (MTK_PIN_NO(157) | 2)
+
+#define MT8135_PIN_158_TDP0__FUNC_GPIO158 (MTK_PIN_NO(158) | 0)
+#define MT8135_PIN_158_TDP0__FUNC_EINT164 (MTK_PIN_NO(158) | 2)
+
+#define MT8135_PIN_159_RDN3__FUNC_GPIO159 (MTK_PIN_NO(159) | 0)
+#define MT8135_PIN_159_RDN3__FUNC_EINT18 (MTK_PIN_NO(159) | 2)
+
+#define MT8135_PIN_160_RDP3__FUNC_GPIO160 (MTK_PIN_NO(160) | 0)
+#define MT8135_PIN_160_RDP3__FUNC_EINT30 (MTK_PIN_NO(160) | 2)
+
+#define MT8135_PIN_161_RDN2__FUNC_GPIO161 (MTK_PIN_NO(161) | 0)
+#define MT8135_PIN_161_RDN2__FUNC_EINT31 (MTK_PIN_NO(161) | 2)
+
+#define MT8135_PIN_162_RDP2__FUNC_GPIO162 (MTK_PIN_NO(162) | 0)
+#define MT8135_PIN_162_RDP2__FUNC_EINT32 (MTK_PIN_NO(162) | 2)
+
+#define MT8135_PIN_163_RCN__FUNC_GPIO163 (MTK_PIN_NO(163) | 0)
+#define MT8135_PIN_163_RCN__FUNC_EINT33 (MTK_PIN_NO(163) | 2)
+
+#define MT8135_PIN_164_RCP__FUNC_GPIO164 (MTK_PIN_NO(164) | 0)
+#define MT8135_PIN_164_RCP__FUNC_EINT39 (MTK_PIN_NO(164) | 2)
+
+#define MT8135_PIN_165_RDN1__FUNC_GPIO165 (MTK_PIN_NO(165) | 0)
+
+#define MT8135_PIN_166_RDP1__FUNC_GPIO166 (MTK_PIN_NO(166) | 0)
+
+#define MT8135_PIN_167_RDN0__FUNC_GPIO167 (MTK_PIN_NO(167) | 0)
+
+#define MT8135_PIN_168_RDP0__FUNC_GPIO168 (MTK_PIN_NO(168) | 0)
+
+#define MT8135_PIN_169_RDN1_A__FUNC_GPIO169 (MTK_PIN_NO(169) | 0)
+#define MT8135_PIN_169_RDN1_A__FUNC_CMDAT6 (MTK_PIN_NO(169) | 1)
+#define MT8135_PIN_169_RDN1_A__FUNC_EINT175 (MTK_PIN_NO(169) | 2)
+
+#define MT8135_PIN_170_RDP1_A__FUNC_GPIO170 (MTK_PIN_NO(170) | 0)
+#define MT8135_PIN_170_RDP1_A__FUNC_CMDAT7 (MTK_PIN_NO(170) | 1)
+#define MT8135_PIN_170_RDP1_A__FUNC_EINT174 (MTK_PIN_NO(170) | 2)
+
+#define MT8135_PIN_171_RCN_A__FUNC_GPIO171 (MTK_PIN_NO(171) | 0)
+#define MT8135_PIN_171_RCN_A__FUNC_CMDAT8 (MTK_PIN_NO(171) | 1)
+#define MT8135_PIN_171_RCN_A__FUNC_EINT171 (MTK_PIN_NO(171) | 2)
+
+#define MT8135_PIN_172_RCP_A__FUNC_GPIO172 (MTK_PIN_NO(172) | 0)
+#define MT8135_PIN_172_RCP_A__FUNC_CMDAT9 (MTK_PIN_NO(172) | 1)
+#define MT8135_PIN_172_RCP_A__FUNC_EINT170 (MTK_PIN_NO(172) | 2)
+
+#define MT8135_PIN_173_RDN0_A__FUNC_GPIO173 (MTK_PIN_NO(173) | 0)
+#define MT8135_PIN_173_RDN0_A__FUNC_CMHSYNC (MTK_PIN_NO(173) | 1)
+#define MT8135_PIN_173_RDN0_A__FUNC_EINT173 (MTK_PIN_NO(173) | 2)
+
+#define MT8135_PIN_174_RDP0_A__FUNC_GPIO174 (MTK_PIN_NO(174) | 0)
+#define MT8135_PIN_174_RDP0_A__FUNC_CMVSYNC (MTK_PIN_NO(174) | 1)
+#define MT8135_PIN_174_RDP0_A__FUNC_EINT172 (MTK_PIN_NO(174) | 2)
+
+#define MT8135_PIN_175_RDN1_B__FUNC_GPIO175 (MTK_PIN_NO(175) | 0)
+#define MT8135_PIN_175_RDN1_B__FUNC_CMDAT2 (MTK_PIN_NO(175) | 1)
+#define MT8135_PIN_175_RDN1_B__FUNC_EINT181 (MTK_PIN_NO(175) | 2)
+#define MT8135_PIN_175_RDN1_B__FUNC_CMCSD2 (MTK_PIN_NO(175) | 3)
+
+#define MT8135_PIN_176_RDP1_B__FUNC_GPIO176 (MTK_PIN_NO(176) | 0)
+#define MT8135_PIN_176_RDP1_B__FUNC_CMDAT3 (MTK_PIN_NO(176) | 1)
+#define MT8135_PIN_176_RDP1_B__FUNC_EINT180 (MTK_PIN_NO(176) | 2)
+#define MT8135_PIN_176_RDP1_B__FUNC_CMCSD3 (MTK_PIN_NO(176) | 3)
+
+#define MT8135_PIN_177_RCN_B__FUNC_GPIO177 (MTK_PIN_NO(177) | 0)
+#define MT8135_PIN_177_RCN_B__FUNC_CMDAT4 (MTK_PIN_NO(177) | 1)
+#define MT8135_PIN_177_RCN_B__FUNC_EINT177 (MTK_PIN_NO(177) | 2)
+
+#define MT8135_PIN_178_RCP_B__FUNC_GPIO178 (MTK_PIN_NO(178) | 0)
+#define MT8135_PIN_178_RCP_B__FUNC_CMDAT5 (MTK_PIN_NO(178) | 1)
+#define MT8135_PIN_178_RCP_B__FUNC_EINT176 (MTK_PIN_NO(178) | 2)
+
+#define MT8135_PIN_179_RDN0_B__FUNC_GPIO179 (MTK_PIN_NO(179) | 0)
+#define MT8135_PIN_179_RDN0_B__FUNC_CMDAT0 (MTK_PIN_NO(179) | 1)
+#define MT8135_PIN_179_RDN0_B__FUNC_EINT179 (MTK_PIN_NO(179) | 2)
+#define MT8135_PIN_179_RDN0_B__FUNC_CMCSD0 (MTK_PIN_NO(179) | 3)
+
+#define MT8135_PIN_180_RDP0_B__FUNC_GPIO180 (MTK_PIN_NO(180) | 0)
+#define MT8135_PIN_180_RDP0_B__FUNC_CMDAT1 (MTK_PIN_NO(180) | 1)
+#define MT8135_PIN_180_RDP0_B__FUNC_EINT178 (MTK_PIN_NO(180) | 2)
+#define MT8135_PIN_180_RDP0_B__FUNC_CMCSD1 (MTK_PIN_NO(180) | 3)
+
+#define MT8135_PIN_181_CMPCLK__FUNC_GPIO181 (MTK_PIN_NO(181) | 0)
+#define MT8135_PIN_181_CMPCLK__FUNC_CMPCLK (MTK_PIN_NO(181) | 1)
+#define MT8135_PIN_181_CMPCLK__FUNC_EINT182 (MTK_PIN_NO(181) | 2)
+#define MT8135_PIN_181_CMPCLK__FUNC_CMCSK (MTK_PIN_NO(181) | 3)
+#define MT8135_PIN_181_CMPCLK__FUNC_CM2MCLK_4X (MTK_PIN_NO(181) | 4)
+#define MT8135_PIN_181_CMPCLK__FUNC_TS_AUXADC_SEL_3 (MTK_PIN_NO(181) | 5)
+#define MT8135_PIN_181_CMPCLK__FUNC_VENC_TEST_CK (MTK_PIN_NO(181) | 6)
+#define MT8135_PIN_181_CMPCLK__FUNC_TESTA_OUT27 (MTK_PIN_NO(181) | 7)
+
+#define MT8135_PIN_182_CMMCLK__FUNC_GPIO182 (MTK_PIN_NO(182) | 0)
+#define MT8135_PIN_182_CMMCLK__FUNC_CMMCLK (MTK_PIN_NO(182) | 1)
+#define MT8135_PIN_182_CMMCLK__FUNC_EINT183 (MTK_PIN_NO(182) | 2)
+#define MT8135_PIN_182_CMMCLK__FUNC_TS_AUXADC_SEL_2 (MTK_PIN_NO(182) | 5)
+#define MT8135_PIN_182_CMMCLK__FUNC_TESTA_OUT28 (MTK_PIN_NO(182) | 7)
+
+#define MT8135_PIN_183_CMRST__FUNC_GPIO183 (MTK_PIN_NO(183) | 0)
+#define MT8135_PIN_183_CMRST__FUNC_CMRST (MTK_PIN_NO(183) | 1)
+#define MT8135_PIN_183_CMRST__FUNC_EINT185 (MTK_PIN_NO(183) | 2)
+#define MT8135_PIN_183_CMRST__FUNC_TS_AUXADC_SEL_1 (MTK_PIN_NO(183) | 5)
+#define MT8135_PIN_183_CMRST__FUNC_TESTA_OUT30 (MTK_PIN_NO(183) | 7)
+
+#define MT8135_PIN_184_CMPDN__FUNC_GPIO184 (MTK_PIN_NO(184) | 0)
+#define MT8135_PIN_184_CMPDN__FUNC_CMPDN (MTK_PIN_NO(184) | 1)
+#define MT8135_PIN_184_CMPDN__FUNC_EINT184 (MTK_PIN_NO(184) | 2)
+#define MT8135_PIN_184_CMPDN__FUNC_TS_AUXADC_SEL_0 (MTK_PIN_NO(184) | 5)
+#define MT8135_PIN_184_CMPDN__FUNC_TESTA_OUT29 (MTK_PIN_NO(184) | 7)
+
+#define MT8135_PIN_185_CMFLASH__FUNC_GPIO185 (MTK_PIN_NO(185) | 0)
+#define MT8135_PIN_185_CMFLASH__FUNC_CMFLASH (MTK_PIN_NO(185) | 1)
+#define MT8135_PIN_185_CMFLASH__FUNC_EINT186 (MTK_PIN_NO(185) | 2)
+#define MT8135_PIN_185_CMFLASH__FUNC_CM2MCLK_3X (MTK_PIN_NO(185) | 3)
+#define MT8135_PIN_185_CMFLASH__FUNC_MFG_TEST_CK_1 (MTK_PIN_NO(185) | 6)
+#define MT8135_PIN_185_CMFLASH__FUNC_TESTA_OUT31 (MTK_PIN_NO(185) | 7)
+
+#define MT8135_PIN_186_MRG_I2S_PCM_CLK__FUNC_GPIO186 (MTK_PIN_NO(186) | 0)
+#define MT8135_PIN_186_MRG_I2S_PCM_CLK__FUNC_MRG_I2S_P_CLK (MTK_PIN_NO(186) | 1)
+#define MT8135_PIN_186_MRG_I2S_PCM_CLK__FUNC_EINT14 (MTK_PIN_NO(186) | 2)
+#define MT8135_PIN_186_MRG_I2S_PCM_CLK__FUNC_I2SIN_CK (MTK_PIN_NO(186) | 3)
+#define MT8135_PIN_186_MRG_I2S_PCM_CLK__FUNC_PCM0_CK (MTK_PIN_NO(186) | 4)
+#define MT8135_PIN_186_MRG_I2S_PCM_CLK__FUNC_DSP2_ICK (MTK_PIN_NO(186) | 5)
+#define MT8135_PIN_186_MRG_I2S_PCM_CLK__FUNC_IMG_TEST_CK (MTK_PIN_NO(186) | 6)
+#define MT8135_PIN_186_MRG_I2S_PCM_CLK__FUNC_USB_SCL (MTK_PIN_NO(186) | 7)
+
+#define MT8135_PIN_187_MRG_I2S_PCM_SYNC__FUNC_GPIO187 (MTK_PIN_NO(187) | 0)
+#define MT8135_PIN_187_MRG_I2S_PCM_SYNC__FUNC_MRG_I2S_SYNC (MTK_PIN_NO(187) | 1)
+#define MT8135_PIN_187_MRG_I2S_PCM_SYNC__FUNC_EINT16 (MTK_PIN_NO(187) | 2)
+#define MT8135_PIN_187_MRG_I2S_PCM_SYNC__FUNC_I2SIN_WS (MTK_PIN_NO(187) | 3)
+#define MT8135_PIN_187_MRG_I2S_PCM_SYNC__FUNC_PCM0_WS (MTK_PIN_NO(187) | 4)
+#define MT8135_PIN_187_MRG_I2S_PCM_SYNC__FUNC_DISP_TEST_CK (MTK_PIN_NO(187) | 6)
+
+#define MT8135_PIN_188_MRG_I2S_PCM_RX__FUNC_GPIO188 (MTK_PIN_NO(188) | 0)
+#define MT8135_PIN_188_MRG_I2S_PCM_RX__FUNC_MRG_I2S_PCM_RX (MTK_PIN_NO(188) | 1)
+#define MT8135_PIN_188_MRG_I2S_PCM_RX__FUNC_EINT15 (MTK_PIN_NO(188) | 2)
+#define MT8135_PIN_188_MRG_I2S_PCM_RX__FUNC_I2SIN_DAT (MTK_PIN_NO(188) | 3)
+#define MT8135_PIN_188_MRG_I2S_PCM_RX__FUNC_PCM0_DI (MTK_PIN_NO(188) | 4)
+#define MT8135_PIN_188_MRG_I2S_PCM_RX__FUNC_DSP2_ID (MTK_PIN_NO(188) | 5)
+#define MT8135_PIN_188_MRG_I2S_PCM_RX__FUNC_MFG_TEST_CK (MTK_PIN_NO(188) | 6)
+#define MT8135_PIN_188_MRG_I2S_PCM_RX__FUNC_USB_SDA (MTK_PIN_NO(188) | 7)
+
+#define MT8135_PIN_189_MRG_I2S_PCM_TX__FUNC_GPIO189 (MTK_PIN_NO(189) | 0)
+#define MT8135_PIN_189_MRG_I2S_PCM_TX__FUNC_MRG_I2S_PCM_TX (MTK_PIN_NO(189) | 1)
+#define MT8135_PIN_189_MRG_I2S_PCM_TX__FUNC_EINT17 (MTK_PIN_NO(189) | 2)
+#define MT8135_PIN_189_MRG_I2S_PCM_TX__FUNC_I2SOUT_DAT (MTK_PIN_NO(189) | 3)
+#define MT8135_PIN_189_MRG_I2S_PCM_TX__FUNC_PCM0_DO (MTK_PIN_NO(189) | 4)
+#define MT8135_PIN_189_MRG_I2S_PCM_TX__FUNC_VDEC_TEST_CK (MTK_PIN_NO(189) | 6)
+
+#define MT8135_PIN_190_SRCLKENAI__FUNC_GPIO190 (MTK_PIN_NO(190) | 0)
+#define MT8135_PIN_190_SRCLKENAI__FUNC_SRCLKENAI (MTK_PIN_NO(190) | 1)
+
+#define MT8135_PIN_191_URXD3__FUNC_GPIO191 (MTK_PIN_NO(191) | 0)
+#define MT8135_PIN_191_URXD3__FUNC_URXD3 (MTK_PIN_NO(191) | 1)
+#define MT8135_PIN_191_URXD3__FUNC_EINT87 (MTK_PIN_NO(191) | 2)
+#define MT8135_PIN_191_URXD3__FUNC_UTXD3 (MTK_PIN_NO(191) | 3)
+#define MT8135_PIN_191_URXD3__FUNC_TS_AUX_ST (MTK_PIN_NO(191) | 5)
+#define MT8135_PIN_191_URXD3__FUNC_PWM4 (MTK_PIN_NO(191) | 6)
+
+#define MT8135_PIN_192_UTXD3__FUNC_GPIO192 (MTK_PIN_NO(192) | 0)
+#define MT8135_PIN_192_UTXD3__FUNC_UTXD3 (MTK_PIN_NO(192) | 1)
+#define MT8135_PIN_192_UTXD3__FUNC_EINT86 (MTK_PIN_NO(192) | 2)
+#define MT8135_PIN_192_UTXD3__FUNC_URXD3 (MTK_PIN_NO(192) | 3)
+#define MT8135_PIN_192_UTXD3__FUNC_TS_AUX_CS_B (MTK_PIN_NO(192) | 5)
+#define MT8135_PIN_192_UTXD3__FUNC_PWM3 (MTK_PIN_NO(192) | 6)
+
+#define MT8135_PIN_193_SDA2__FUNC_GPIO193 (MTK_PIN_NO(193) | 0)
+#define MT8135_PIN_193_SDA2__FUNC_SDA2 (MTK_PIN_NO(193) | 1)
+#define MT8135_PIN_193_SDA2__FUNC_EINT95 (MTK_PIN_NO(193) | 2)
+#define MT8135_PIN_193_SDA2__FUNC_CLKM5 (MTK_PIN_NO(193) | 3)
+#define MT8135_PIN_193_SDA2__FUNC_PWM5 (MTK_PIN_NO(193) | 4)
+#define MT8135_PIN_193_SDA2__FUNC_TS_AUX_PWDB (MTK_PIN_NO(193) | 5)
+
+#define MT8135_PIN_194_SCL2__FUNC_GPIO194 (MTK_PIN_NO(194) | 0)
+#define MT8135_PIN_194_SCL2__FUNC_SCL2 (MTK_PIN_NO(194) | 1)
+#define MT8135_PIN_194_SCL2__FUNC_EINT94 (MTK_PIN_NO(194) | 2)
+#define MT8135_PIN_194_SCL2__FUNC_CLKM4 (MTK_PIN_NO(194) | 3)
+#define MT8135_PIN_194_SCL2__FUNC_PWM4 (MTK_PIN_NO(194) | 4)
+#define MT8135_PIN_194_SCL2__FUNC_TS_AUXADC_TEST_CK (MTK_PIN_NO(194) | 5)
+
+#define MT8135_PIN_195_SDA1__FUNC_GPIO195 (MTK_PIN_NO(195) | 0)
+#define MT8135_PIN_195_SDA1__FUNC_SDA1 (MTK_PIN_NO(195) | 1)
+#define MT8135_PIN_195_SDA1__FUNC_EINT93 (MTK_PIN_NO(195) | 2)
+#define MT8135_PIN_195_SDA1__FUNC_CLKM3 (MTK_PIN_NO(195) | 3)
+#define MT8135_PIN_195_SDA1__FUNC_PWM3 (MTK_PIN_NO(195) | 4)
+#define MT8135_PIN_195_SDA1__FUNC_TS_AUX_SCLK_PWDB (MTK_PIN_NO(195) | 5)
+
+#define MT8135_PIN_196_SCL1__FUNC_GPIO196 (MTK_PIN_NO(196) | 0)
+#define MT8135_PIN_196_SCL1__FUNC_SCL1 (MTK_PIN_NO(196) | 1)
+#define MT8135_PIN_196_SCL1__FUNC_EINT92 (MTK_PIN_NO(196) | 2)
+#define MT8135_PIN_196_SCL1__FUNC_CLKM2 (MTK_PIN_NO(196) | 3)
+#define MT8135_PIN_196_SCL1__FUNC_PWM2 (MTK_PIN_NO(196) | 4)
+#define MT8135_PIN_196_SCL1__FUNC_TS_AUX_DIN (MTK_PIN_NO(196) | 5)
+
+#define MT8135_PIN_197_MSDC3_DAT2__FUNC_GPIO197 (MTK_PIN_NO(197) | 0)
+#define MT8135_PIN_197_MSDC3_DAT2__FUNC_MSDC3_DAT2 (MTK_PIN_NO(197) | 1)
+#define MT8135_PIN_197_MSDC3_DAT2__FUNC_EINT71 (MTK_PIN_NO(197) | 2)
+#define MT8135_PIN_197_MSDC3_DAT2__FUNC_SCL6 (MTK_PIN_NO(197) | 3)
+#define MT8135_PIN_197_MSDC3_DAT2__FUNC_PWM5 (MTK_PIN_NO(197) | 4)
+#define MT8135_PIN_197_MSDC3_DAT2__FUNC_CLKM4 (MTK_PIN_NO(197) | 5)
+#define MT8135_PIN_197_MSDC3_DAT2__FUNC_MFG_TEST_CK_2 (MTK_PIN_NO(197) | 6)
+
+#define MT8135_PIN_198_MSDC3_DAT3__FUNC_GPIO198 (MTK_PIN_NO(198) | 0)
+#define MT8135_PIN_198_MSDC3_DAT3__FUNC_MSDC3_DAT3 (MTK_PIN_NO(198) | 1)
+#define MT8135_PIN_198_MSDC3_DAT3__FUNC_EINT72 (MTK_PIN_NO(198) | 2)
+#define MT8135_PIN_198_MSDC3_DAT3__FUNC_SDA6 (MTK_PIN_NO(198) | 3)
+#define MT8135_PIN_198_MSDC3_DAT3__FUNC_PWM6 (MTK_PIN_NO(198) | 4)
+#define MT8135_PIN_198_MSDC3_DAT3__FUNC_CLKM5 (MTK_PIN_NO(198) | 5)
+#define MT8135_PIN_198_MSDC3_DAT3__FUNC_MFG_TEST_CK_3 (MTK_PIN_NO(198) | 6)
+
+#define MT8135_PIN_199_MSDC3_CMD__FUNC_GPIO199 (MTK_PIN_NO(199) | 0)
+#define MT8135_PIN_199_MSDC3_CMD__FUNC_MSDC3_CMD (MTK_PIN_NO(199) | 1)
+#define MT8135_PIN_199_MSDC3_CMD__FUNC_EINT68 (MTK_PIN_NO(199) | 2)
+#define MT8135_PIN_199_MSDC3_CMD__FUNC_SDA2 (MTK_PIN_NO(199) | 3)
+#define MT8135_PIN_199_MSDC3_CMD__FUNC_PWM2 (MTK_PIN_NO(199) | 4)
+#define MT8135_PIN_199_MSDC3_CMD__FUNC_CLKM1 (MTK_PIN_NO(199) | 5)
+#define MT8135_PIN_199_MSDC3_CMD__FUNC_MFG_TEST_CK_4 (MTK_PIN_NO(199) | 6)
+
+#define MT8135_PIN_200_MSDC3_CLK__FUNC_GPIO200 (MTK_PIN_NO(200) | 0)
+#define MT8135_PIN_200_MSDC3_CLK__FUNC_MSDC3_CLK (MTK_PIN_NO(200) | 1)
+#define MT8135_PIN_200_MSDC3_CLK__FUNC_EINT67 (MTK_PIN_NO(200) | 2)
+#define MT8135_PIN_200_MSDC3_CLK__FUNC_SCL2 (MTK_PIN_NO(200) | 3)
+#define MT8135_PIN_200_MSDC3_CLK__FUNC_PWM1 (MTK_PIN_NO(200) | 4)
+#define MT8135_PIN_200_MSDC3_CLK__FUNC_CLKM0 (MTK_PIN_NO(200) | 5)
+
+#define MT8135_PIN_201_MSDC3_DAT1__FUNC_GPIO201 (MTK_PIN_NO(201) | 0)
+#define MT8135_PIN_201_MSDC3_DAT1__FUNC_MSDC3_DAT1 (MTK_PIN_NO(201) | 1)
+#define MT8135_PIN_201_MSDC3_DAT1__FUNC_EINT70 (MTK_PIN_NO(201) | 2)
+#define MT8135_PIN_201_MSDC3_DAT1__FUNC_SDA3 (MTK_PIN_NO(201) | 3)
+#define MT8135_PIN_201_MSDC3_DAT1__FUNC_PWM4 (MTK_PIN_NO(201) | 4)
+#define MT8135_PIN_201_MSDC3_DAT1__FUNC_CLKM3 (MTK_PIN_NO(201) | 5)
+
+#define MT8135_PIN_202_MSDC3_DAT0__FUNC_GPIO202 (MTK_PIN_NO(202) | 0)
+#define MT8135_PIN_202_MSDC3_DAT0__FUNC_MSDC3_DAT0 (MTK_PIN_NO(202) | 1)
+#define MT8135_PIN_202_MSDC3_DAT0__FUNC_EINT69 (MTK_PIN_NO(202) | 2)
+#define MT8135_PIN_202_MSDC3_DAT0__FUNC_SCL3 (MTK_PIN_NO(202) | 3)
+#define MT8135_PIN_202_MSDC3_DAT0__FUNC_PWM3 (MTK_PIN_NO(202) | 4)
+#define MT8135_PIN_202_MSDC3_DAT0__FUNC_CLKM2 (MTK_PIN_NO(202) | 5)
+
+#endif /* __DTS_MT8135_PINFUNC_H */
index a161e99ffcc432031d858f90df4078d3b3725e9c..0aba9eb28e2b4fd0e476f114ff72402e939a37b6 100644 (file)
@@ -15,6 +15,7 @@
 #include <dt-bindings/interrupt-controller/irq.h>
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include "skeleton64.dtsi"
+#include "mt8135-pinfunc.h"
 
 / {
        compatible = "mediatek,mt8135";
                compatible = "simple-bus";
                ranges;
 
+               /*
+                * Pinctrl access register at 0x10005000 and 0x1020c000 through
+                * regmap. Register 0x1000b000 is used by EINT.
+                */
+               pio: pinctrl@10005000 {
+                       compatible = "mediatek,mt8135-pinctrl";
+                       reg = <0 0x1000b000 0 0x1000>;
+                       mediatek,pctl-regmap = <&syscfg_pctl_a &syscfg_pctl_b>;
+                       pins-are-numbered;
+                       gpio-controller;
+                       #gpio-cells = <2>;
+                       interrupt-controller;
+                       #interrupt-cells = <2>;
+                       interrupts = <GIC_SPI 116 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 117 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 118 IRQ_TYPE_LEVEL_HIGH>;
+               };
+
+               syscfg_pctl_a: syscfg_pctl_a@10005000 {
+                       compatible = "mediatek,mt8135-pctl-a-syscfg", "syscon";
+                       reg = <0 0x10005000 0 0x1000>;
+               };
+
                timer: timer@10008000 {
                        compatible = "mediatek,mt8135-timer",
                                        "mediatek,mt6577-timer";
                        reg = <0 0x10200030 0 0x1c>;
                };
 
+               syscfg_pctl_b: syscfg_pctl_b@1020c000 {
+                       compatible = "mediatek,mt8135-pctl-b-syscfg", "syscon";
+                       reg = <0 0x1020c000 0 0x1000>;
+               };
+
                gic: interrupt-controller@10211000 {
                        compatible = "arm,cortex-a15-gic";
                        interrupt-controller;
index f5b5a1d96cd740920ab215f2a7b3fc2fdaa9136e..53ae04f9104d6b92f6bce75c337d5fba1c77ae53 100644 (file)
@@ -66,7 +66,7 @@
 
        otg_drv_vbus: pinmux_otg_drv_vbus {
                pinctrl-single,pins = <
-                       OMAP3_CORE1_IOPAD(0x2210, PIN_INPUT_PULLDOWN | MUX_MODE0) /* rmii_50Mhz_clk.usb0_drvvbus */
+                       OMAP3_CORE1_IOPAD(0x2210, PIN_INPUT_PULLDOWN | MUX_MODE0) /* rmii_50MHz_clk.usb0_drvvbus */
                >;
        };
 
index 921de6605f075d878f407d925a5652195bd2b41d..be2297116a1439bcdc8da56cde8b2c3e5c168092 100644 (file)
                };
        };
 };
+
+&gpmc {
+       ranges = <6 0 0x2c000000 0x1000000>;       /* CS6: 16MB for DM9000 */
+
+       ethernet@0,0 {
+               compatible = "davicom,dm9000";
+               reg =  <6 0x000 2
+                       6 0x400 2>; /* CS6, offset 0 and 0x400, IO size 2 */
+               bank-width = <2>;
+               interrupt-parent = <&gpio1>;
+               interrupts = <25 IRQ_TYPE_LEVEL_LOW>;
+               davicom,no-eeprom;
+
+               gpmc,mux-add-data = <0>;
+               gpmc,device-width = <1>;
+               gpmc,wait-pin = <0>;
+               gpmc,cycle2cycle-samecsen = <1>;
+               gpmc,cycle2cycle-diffcsen = <1>;
+
+               gpmc,cs-on-ns = <6>;
+               gpmc,cs-rd-off-ns = <180>;
+               gpmc,cs-wr-off-ns = <180>;
+               gpmc,adv-on-ns = <0>;
+               gpmc,adv-rd-off-ns = <18>;
+               gpmc,adv-wr-off-ns = <48>;
+               gpmc,oe-on-ns = <54>;
+               gpmc,oe-off-ns = <168>;
+               gpmc,we-on-ns = <54>;
+               gpmc,we-off-ns = <168>;
+               gpmc,rd-cycle-ns = <186>;
+               gpmc,wr-cycle-ns = <186>;
+               gpmc,access-ns = <144>;
+               gpmc,page-burst-access-ns = <24>;
+               gpmc,bus-turnaround-ns = <90>;
+               gpmc,cycle2cycle-delay-ns = <90>;
+               gpmc,wait-monitoring-ns = <0>;
+               gpmc,clk-activation-ns = <0>;
+               gpmc,wr-data-mux-bus-ns = <0>;
+               gpmc,wr-access-ns = <0>;
+       };
+};
index 346552b94d9f7705a80642dc8ce86ea6bad800d6..b2589f96d5f7c3a7b0b7cf29698482bc7b89df6f 100644 (file)
@@ -96,6 +96,7 @@
 };
 
 &mmc1 {
+       interrupts-extended = <&intc 83 &omap3_pmx_core 0x11a>;
        vmmc-supply = <&vmmc1>;
        vmmc_aux-supply = <&vsim>;
        bus-width = <8>;
index b9f68817bd6e636d5f1e657a3916de26c3aafcba..7166d8876ea85b89c0e417682c22afd14f5c086d 100644 (file)
                ti,mcbsp = <&mcbsp2>;
        };
 
+        /* GSM audio */
+       sound_telephony {
+               compatible = "simple-audio-card";
+               simple-audio-card,name = "GTA04 voice";
+               simple-audio-card,bitclock-master = <&telephony_link_master>;
+               simple-audio-card,frame-master = <&telephony_link_master>;
+               simple-audio-card,format = "i2s";
+
+               simple-audio-card,cpu {
+                       sound-dai = <&mcbsp4>;
+               };
+
+               telephony_link_master: simple-audio-card,codec {
+                       sound-dai = <&gtm601_codec>;
+               };
+       };
+
+       gtm601_codec: gsm_codec {
+               compatible = "option,gtm601";
+               #sound-dai-cells = <0>;
+       };
+
        spi_lcd {
                compatible = "spi-gpio";
                #address-cells = <0x1>;
                        OMAP3_CORE1_IOPAD(0x210a, PIN_OUTPUT | MUX_MODE0)   /* dss_data23.dss_data23 */
                >;
        };
+
+       hdq_pins: hdq_pins {
+               pinctrl-single,pins = <
+                       OMAP3_CORE1_IOPAD(0x21c6, PIN_INPUT_PULLUP | MUX_MODE0) /* i2c3_sda.hdq */
+               >;
+       };
 };
 
 &omap3_pmx_core2 {
 &mcbsp2 {
        status = "okay";
 };
+
+&hdqw1w {
+        pinctrl-names = "default";
+        pinctrl-0 = <&hdq_pins>;
+};
+
+&mcbsp4 {
+       status = "okay";
+};
index b699bc48f242ef33cf7c390e3a4002a4a1ac3a31..bd6e6769c7ce0664008b815ff10b58d5debdaf15 100644 (file)
                key_enter {
                        label = "enter";
                        gpios = <&gpio4 5 GPIO_ACTIVE_LOW>; /* gpio101 */
-                       linux,code = <0x0107001c>; /* KEY_ENTER */
+                       linux,code = <KEY_ENTER>;
                        gpio-key,wakeup;
                };
 
                key_f1 {
                        label = "f1";
                        gpios = <&gpio4 6 GPIO_ACTIVE_LOW>; /* gpio102 */
-                       linux,code = <0x0303003b>; /* KEY_F1 */
+                       linux,code = <KEY_F1>;
                        gpio-key,wakeup;
                };
 
                key_f2 {
                        label = "f2";
                        gpios = <&gpio4 7 GPIO_ACTIVE_LOW>; /* gpio103 */
-                       linux,code = <0x0403003c>; /* KEY_F2 */
+                       linux,code = <KEY_F2>;
                        gpio-key,wakeup;
                };
 
                key_f3 {
                        label = "f3";
                        gpios = <&gpio4 8 GPIO_ACTIVE_LOW>; /* gpio104 */
-                       linux,code = <0x0503003d>; /* KEY_F3 */
+                       linux,code = <KEY_F3>;
                        gpio-key,wakeup;
                };
 
                key_f4 {
                        label = "f4";
                        gpios = <&gpio4 9 GPIO_ACTIVE_LOW>; /* gpio105 */
-                       linux,code = <0x0704003e>; /* KEY_F4 */
+                       linux,code = <KEY_F4>;
                        gpio-key,wakeup;
                };
 
                key_left {
                        label = "left";
                        gpios = <&gpio4 10 GPIO_ACTIVE_LOW>; /* gpio106 */
-                       linux,code = <0x04070069>; /* KEY_LEFT */
+                       linux,code = <KEY_LEFT>;
                        gpio-key,wakeup;
                };
 
                key_right {
                        label = "right";
                        gpios = <&gpio4 11 GPIO_ACTIVE_LOW>; /* gpio107 */
-                       linux,code = <0x0507006a>; /* KEY_RIGHT */
+                       linux,code = <KEY_RIGHT>;
                        gpio-key,wakeup;
                };
 
                key_up {
                        label = "up";
                        gpios = <&gpio4 12 GPIO_ACTIVE_LOW>; /* gpio108 */
-                       linux,code = <0x06070067>; /* KEY_UP */
+                       linux,code = <KEY_UP>;
                        gpio-key,wakeup;
                };
 
                key_down {
                        label = "down";
                        gpios = <&gpio4 13 GPIO_ACTIVE_LOW>; /* gpio109 */
-                       linux,code = <0x0707006c>; /* KEY_DOWN */
+                       linux,code = <KEY_DOWN>;
                        gpio-key,wakeup;
                };
        };
index 5c16145920eafd9604f0571dfe60a23986313871..5f5e0f3d5b64fcb2283f72b9df923c793be7f75c 100644 (file)
                touchscreen-fuzz-x = <4>;
                touchscreen-fuzz-y = <7>;
                touchscreen-fuzz-pressure = <2>;
-               touchscreen-max-x = <4096>;
-               touchscreen-max-y = <4096>;
+               touchscreen-size-x = <4096>;
+               touchscreen-size-y = <4096>;
                touchscreen-max-pressure = <2048>;
 
                ti,x-plate-ohms = <280>;
index 74777a6e200a68bb7cda9257d70aee78549bc8bd..275618f19a43d3b8860bea6de9944dbdf020c6ce 100644 (file)
 };
 
 &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>;
+       interrupts-extended = <&wakeupgen GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH>,
+                             <&omap5_pmx_core 0x19c>;
 };
 
 &uart5 {
-        pinctrl-names = "default";
-        pinctrl-0 = <&uart5_pins>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart5_pins>;
 };
 
 &cpu0 {
index 80fc5d7e9ef9685cc04fb8771f6205aaeaf5932a..90b99714ad80ef2293cf254c3d43074d79cadb03 100644 (file)
@@ -1,6 +1,6 @@
 /* The pxa3xx skeleton simply augments the 2xx version */
 #include "pxa2xx.dtsi"
-#include "dt-bindings/clock/pxa2xx-clock.h"
+#include "dt-bindings/clock/pxa-clock.h"
 
 / {
        model = "Marvell PXA27x familiy SoC";
                        marvell,intc-nr-irqs = <34>;
                };
 
+               gpio: gpio@40e00000 {
+                       compatible = "intel,pxa27x-gpio";
+                       clocks = <&clks CLK_NONE>;
+               };
+
                pwm0: pwm@40b00000 {
                        compatible = "marvell,pxa270-pwm", "marvell,pxa250-pwm";
                        reg = <0x40b00000 0x10>;
                        #pwm-cells = <1>;
+                       clocks = <&clks CLK_PWM0>;
                };
 
                pwm1: pwm@40b00010 {
                        compatible = "marvell,pxa270-pwm", "marvell,pxa250-pwm";
                        reg = <0x40b00010 0x10>;
                        #pwm-cells = <1>;
+                       clocks = <&clks CLK_PWM1>;
                };
 
                pwm2: pwm@40c00000 {
                        compatible = "marvell,pxa270-pwm", "marvell,pxa250-pwm";
                        reg = <0x40c00000 0x10>;
                        #pwm-cells = <1>;
+                       clocks = <&clks CLK_PWM0>;
                };
 
                pwm3: pwm@40c00010 {
                        compatible = "marvell,pxa270-pwm", "marvell,pxa250-pwm";
                        reg = <0x40c00010 0x10>;
                        #pwm-cells = <1>;
+                       clocks = <&clks CLK_PWM1>;
+               };
+
+               pwri2c: i2c@40f000180 {
+                       compatible = "mrvl,pxa-i2c";
+                       reg = <0x40f00180 0x24>;
+                       interrupts = <6>;
+                       clocks = <&clks CLK_PWRI2C>;
+                       status = "disabled";
+               };
+
+               pxa27x_udc: udc@40600000 {
+                       compatible = "marvell,pxa270-udc";
+                       reg = <0x40600000 0x10000>;
+                       interrupts = <11>;
+                       clocks = <&clks CLK_USB>;
+                       status = "disabled";
+               };
+
+               keypad: keypad@41500000 {
+                       compatible = "marvell,pxa27x-keypad";
+                       reg = <0x41500000 0x4c>;
+                       interrupts = <4>;
+                       clocks = <&clks CLK_KEYPAD>;
+                       status = "disabled";
                };
        };
 
                #size-cells = <1>;
                ranges;
 
-               pxa2xx_clks: pxa2xx_clks@41300004 {
-                       compatible = "marvell,pxa-clocks";
+               clks: pxa2xx_clks@41300004 {
+                       compatible = "marvell,pxa270-clocks";
                        #clock-cells = <1>;
                        status = "okay";
                };
        };
 
+       timer@40a00000 {
+               compatible = "marvell,pxa-timer";
+               reg = <0x40a00000 0x20>;
+               interrupts = <26>;
+               clocks = <&clks CLK_OSTIMER>;
+               status = "okay";
+       };
 };
index c08f84629aa99c68da033838c8e26c04828e150c..71a0cd7388d16f74c9d290e4645deef086997ab1 100644 (file)
@@ -6,7 +6,8 @@
  * Licensed under GPLv2 or later.
  */
 
-/include/ "skeleton.dtsi"
+#include "skeleton.dtsi"
+#include "dt-bindings/clock/pxa-clock.h"
 
 / {
        model = "Marvell PXA2xx family SoC";
@@ -79,6 +80,7 @@
                        compatible = "mrvl,pxa-uart";
                        reg = <0x40100000 0x30>;
                        interrupts = <22>;
+                       clocks = <&clks CLK_FFUART>;
                        status = "disabled";
                };
 
@@ -86,6 +88,7 @@
                        compatible = "mrvl,pxa-uart";
                        reg = <0x40200000 0x30>;
                        interrupts = <21>;
+                       clocks = <&clks CLK_BTUART>;
                        status = "disabled";
                };
 
@@ -93,6 +96,7 @@
                        compatible = "mrvl,pxa-uart";
                        reg = <0x40700000 0x30>;
                        interrupts = <20>;
+                       clocks = <&clks CLK_STUART>;
                        status = "disabled";
                };
 
                        compatible = "mrvl,pxa-i2c";
                        reg = <0x40301680 0x30>;
                        interrupts = <18>;
+                       clocks = <&clks CLK_I2C>;
                        #address-cells = <0x1>;
                        #size-cells = <0>;
                        status = "disabled";
index 83bb0eff697b8648b347c4fb936101c03dc6d4d5..7ad0b177109837bf7c06d47e0acf032af8c86e31 100644 (file)
@@ -1,5 +1,5 @@
 /* The pxa3xx skeleton simply augments the 2xx version */
-/include/ "pxa2xx.dtsi"
+#include "pxa2xx.dtsi"
 
 / {
        model = "Marvell PXA3xx familiy SoC";
@@ -10,6 +10,7 @@
                        compatible = "mrvl,pwri2c";
                        reg = <0x40f500c0 0x30>;
                        interrupts = <6>;
+                       clocks = <&clks CLK_PWRI2C>;
                        #address-cells = <0x1>;
                        #size-cells = <0>;
                        status = "disabled";
@@ -19,6 +20,7 @@
                        compatible = "marvell,pxa3xx-nand";
                        reg = <0x43100000 90>;
                        interrupts = <45>;
+                       clocks = <&clks CLK_NAND>;
                        #address-cells = <1>;
                        #size-cells = <1>;      
                        status = "disabled";
@@ -32,6 +34,7 @@
                gpio: gpio@40e00000 {
                        compatible = "intel,pxa3xx-gpio";
                        reg = <0x40e00000 0x10000>;
+                       clocks = <&clks CLK_GPIO>;
                        interrupt-names = "gpio0", "gpio1", "gpio_mux";
                        interrupts = <8 9 10>;
                        gpio-controller;
                        #interrupt-cells = <0x2>;
                };
        };
+
+       clocks {
+              /*
+               * The muxing of external clocks/internal dividers for osc* clock
+               * sources has been hidden under the carpet by now.
+               */
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges;
+
+               clks: pxa3xx_clks@41300004 {
+                       compatible = "marvell,pxa300-clocks";
+                       #clock-cells = <1>;
+                       status = "okay";
+               };
+       };
+
+       timer@40a00000 {
+               compatible = "marvell,pxa-timer";
+               reg = <0x40a00000 0x20>;
+               interrupts = <26>;
+               clocks = <&clks CLK_OSTIMER>;
+               status = "okay";
+       };
 };
index 5d75666f7f6c955e8ed34201e0c9811a64c66e3f..71512b3ca4443c7e12dfb106a442e73921c81ac5 100644 (file)
                        };
                };
 
+               rpm@108000 {
+                       regulators {
+                               vin_lvs1_3_6-supply = <&pm8921_s4>;
+                               vin_lvs2-supply = <&pm8921_s1>;
+                               vin_lvs4_5_7-supply = <&pm8921_s4>;
+
+                               vdd_l1_l2_l12_l18-supply = <&pm8921_s4>;
+                               vdd_l24-supply = <&pm8921_s1>;
+                               vdd_l25-supply = <&pm8921_s1>;
+                               vdd_l26-supply = <&pm8921_s7>;
+                               vdd_l27-supply = <&pm8921_s7>;
+                               vdd_l28-supply = <&pm8921_s7>;
+
+
+                               /* Buck SMPS */
+                               pm8921_s1: s1 {
+                                       regulator-always-on;
+                                       regulator-min-microvolt = <1225000>;
+                                       regulator-max-microvolt = <1225000>;
+                                       qcom,switch-mode-frequency = <3200000>;
+                                       bias-pull-down;
+                               };
+
+                               pm8921_s3: s3 {
+                                       regulator-min-microvolt = <1000000>;
+                                       regulator-max-microvolt = <1400000>;
+                                       qcom,switch-mode-frequency = <4800000>;
+                               };
+
+                               pm8921_s4: s4 {
+                                       regulator-min-microvolt = <1800000>;
+                                       regulator-max-microvolt = <1800000>;
+                                       qcom,switch-mode-frequency = <3200000>;
+                               };
+
+                               pm8921_s7: s7 {
+                                       regulator-min-microvolt = <1300000>;
+                                       regulator-max-microvolt = <1300000>;
+                                       qcom,switch-mode-frequency = <3200000>;
+                               };
+
+                               pm8921_l3: l3 {
+                                       regulator-min-microvolt = <3050000>;
+                                       regulator-max-microvolt = <3300000>;
+                                       bias-pull-down;
+                               };
+
+                               pm8921_l4: l4 {
+                                       regulator-min-microvolt = <1000000>;
+                                       regulator-max-microvolt = <1800000>;
+                                       bias-pull-down;
+                               };
+
+                               pm8921_l23: l23 {
+                                       regulator-min-microvolt = <1700000>;
+                                       regulator-max-microvolt = <1900000>;
+                                       bias-pull-down;
+                               };
+                       };
+               };
+
                gsbi@12440000 {
                        status = "okay";
                        qcom,mode = <GSBI_PROT_I2C>;
                        };
                };
 
+               /* OTG */
+               usb1_phy: phy@12500000 {
+                       status          = "okay";
+                       vddcx-supply    = <&pm8921_s3>;
+                       v3p3-supply     = <&pm8921_l3>;
+                       v1p8-supply     = <&pm8921_l4>;
+               };
+
+               usb3_phy: phy@12520000 {
+                       status          = "okay";
+                       vddcx-supply    = <&pm8921_s3>;
+                       v3p3-supply     = <&pm8921_l3>;
+                       v1p8-supply     = <&pm8921_l23>;
+               };
+
+               usb4_phy: phy@12530000 {
+                       status          = "okay";
+                       vddcx-supply    = <&pm8921_s3>;
+                       v3p3-supply     = <&pm8921_l3>;
+                       v1p8-supply     = <&pm8921_l23>;
+               };
+
+               gadget1: gadget@12500000 {
+                       status = "ok";
+               };
+
+               /* OTG */
+               usb1: usb@12500000 {
+                       status = "ok";
+               };
+
+               usb3: usb@12520000 {
+                       status = "okay";
+               };
+
+               usb4: usb@12530000 {
+                       status = "okay";
+               };
+
                amba {
                        /* eMMC */
                        sdcc1: sdcc@12400000 {
index e641001ca2a79c80697ac774816442842ebc5556..a7c939ba88730bf7b1e7076dc9b592e9d2b5577d 100644 (file)
@@ -5,15 +5,12 @@
        model = "Qualcomm APQ8064/IFC6410";
        compatible = "qcom,apq8064-ifc6410", "qcom,apq8064";
 
+       aliases {
+               serial0 = &gsbi7_serial;
+       };
+
        soc {
                pinctrl@800000 {
-                       i2c1_pins: i2c1 {
-                               mux {
-                                       pins = "gpio20", "gpio21";
-                                       function = "gsbi1";
-                               };
-                       };
-
                        card_detect: card_detect {
                                mux {
                                        pins = "gpio26";
                        };
                };
 
+               rpm@108000 {
+                       regulators {
+                               vin_lvs1_3_6-supply = <&pm8921_s4>;
+                               vin_lvs2-supply = <&pm8921_s1>;
+                               vin_lvs4_5_7-supply = <&pm8921_s4>;
+
+                               vdd_l1_l2_l12_l18-supply = <&pm8921_s4>;
+                               vdd_l24-supply = <&pm8921_s1>;
+                               vdd_l25-supply = <&pm8921_s1>;
+                               vdd_l26-supply = <&pm8921_s7>;
+                               vdd_l27-supply = <&pm8921_s7>;
+                               vdd_l28-supply = <&pm8921_s7>;
+
+
+                               /* Buck SMPS */
+                               pm8921_s1: s1 {
+                                       regulator-always-on;
+                                       regulator-min-microvolt = <1225000>;
+                                       regulator-max-microvolt = <1225000>;
+                                       qcom,switch-mode-frequency = <3200000>;
+                                       bias-pull-down;
+                               };
+
+                               pm8921_s3: s3 {
+                                       regulator-min-microvolt = <1000000>;
+                                       regulator-max-microvolt = <1400000>;
+                                       qcom,switch-mode-frequency = <4800000>;
+                               };
+
+                               pm8921_s4: s4 {
+                                       regulator-min-microvolt = <1800000>;
+                                       regulator-max-microvolt = <1800000>;
+                                       qcom,switch-mode-frequency = <3200000>;
+                               };
+
+                               pm8921_s7: s7 {
+                                       regulator-min-microvolt = <1300000>;
+                                       regulator-max-microvolt = <1300000>;
+                                       qcom,switch-mode-frequency = <3200000>;
+                               };
+
+                               pm8921_l3: l3 {
+                                       regulator-min-microvolt = <3050000>;
+                                       regulator-max-microvolt = <3300000>;
+                                       bias-pull-down;
+                               };
+
+                               pm8921_l4: l4 {
+                                       regulator-min-microvolt = <1000000>;
+                                       regulator-max-microvolt = <1800000>;
+                                       bias-pull-down;
+                               };
+
+                               pm8921_l6: l6 {
+                                       regulator-min-microvolt = <2950000>;
+                                       regulator-max-microvolt = <2950000>;
+                                       bias-pull-down;
+                               };
+
+                               pm8921_l23: l23 {
+                                       regulator-min-microvolt = <1700000>;
+                                       regulator-max-microvolt = <1900000>;
+                                       bias-pull-down;
+                               };
+                       };
+               };
+
+               gsbi3: gsbi@16200000 {
+                       status = "okay";
+                       qcom,mode = <GSBI_PROT_I2C>;
+                       i2c3: i2c@16280000 {
+                               status = "okay";
+                               pinctrl-0 = <&i2c3_pins>;
+                               pinctrl-names = "default";
+                       };
+               };
+
                gsbi@12440000 {
                        status = "okay";
                        qcom,mode = <GSBI_PROT_I2C>;
                        };
                };
 
+               sata_phy0: phy@1b400000 {
+                       status = "okay";
+               };
+
+               sata0: sata@29000000 {
+                       status          = "okay";
+                       target-supply   = <&pm8921_s4>;
+               };
+
+               /* OTG */
+               usb1_phy: phy@12500000 {
+                       status          = "okay";
+                       vddcx-supply    = <&pm8921_s3>;
+                       v3p3-supply     = <&pm8921_l3>;
+                       v1p8-supply     = <&pm8921_l4>;
+               };
+
+               usb3_phy: phy@12520000 {
+                       status          = "okay";
+                       vddcx-supply    = <&pm8921_s3>;
+                       v3p3-supply     = <&pm8921_l3>;
+                       v1p8-supply     = <&pm8921_l23>;
+               };
+
+               usb4_phy: phy@12530000 {
+                       status          = "okay";
+                       vddcx-supply    = <&pm8921_s3>;
+                       v3p3-supply     = <&pm8921_l3>;
+                       v1p8-supply     = <&pm8921_l23>;
+               };
+
+               gadget1: gadget@12500000 {
+                       status = "okay";
+               };
+
+               /* OTG */
+               usb1: usb@12500000 {
+                       status = "okay";
+               };
+
+               usb3: usb@12520000 {
+                       status = "okay";
+               };
+
+               usb4: usb@12530000 {
+                       status = "okay";
+               };
+
                amba {
                        /* eMMC */
                        sdcc1: sdcc@12400000 {
index 6c1511263a55deacd582b96bd4c57edad59300a8..df2061ec630d16e71165d78ce71a8a4a32092271 100644 (file)
@@ -2,6 +2,7 @@
 
 #include "skeleton.dtsi"
 #include <dt-bindings/clock/qcom,gcc-msm8960.h>
+#include <dt-bindings/reset/qcom,gcc-msm8960.h>
 #include <dt-bindings/clock/qcom,mmcc-msm8960.h>
 #include <dt-bindings/soc/qcom,gsbi.h>
 #include <dt-bindings/interrupt-controller/arm-gic.h>
                                        function = "ps_hold";
                                };
                        };
+
+                       i2c1_pins: i2c1 {
+                               mux {
+                                       pins = "gpio20", "gpio21";
+                                       function = "gsbi1";
+                               };
+                       };
+
+                       i2c3_pins: i2c3 {
+                               mux {
+                                       pins = "gpio8", "gpio9";
+                                       function = "gsbi3";
+                               };
+                       };
                };
 
                intc: interrupt-controller@2000000 {
                        };
                };
 
+               gsbi3: gsbi@16200000 {
+                       status = "disabled";
+                       compatible = "qcom,gsbi-v1.0.0";
+                       reg = <0x16200000 0x100>;
+                       clocks = <&gcc GSBI3_H_CLK>;
+                       clock-names = "iface";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges;
+
+                       i2c3: i2c@16280000 {
+                               compatible = "qcom,i2c-qup-v1.1.1";
+                               reg = <0x16280000 0x1000>;
+                               interrupts = <GIC_SPI 151 IRQ_TYPE_NONE>;
+                               clocks = <&gcc GSBI3_QUP_CLK>,
+                                        <&gcc GSBI3_H_CLK>;
+                               clock-names = "core", "iface";
+                       };
+               };
+
                gsbi7: gsbi@16600000 {
                        status = "disabled";
                        compatible = "qcom,gsbi-v1.0.0";
                        #address-cells = <1>;
                        #size-cells = <1>;
                        ranges;
-
                        syscon-tcsr = <&tcsr>;
 
-                       serial@16640000 {
+                       gsbi7_serial: serial@16640000 {
                                compatible = "qcom,msm-uartdm-v1.3", "qcom,msm-uartdm";
                                reg = <0x16640000 0x1000>,
                                      <0x16600000 0x1000>;
                        #reset-cells = <1>;
                };
 
+               l2cc: clock-controller@2011000 {
+                       compatible      = "syscon";
+                       reg             = <0x2011000 0x1000>;
+               };
+
+               rpm@108000 {
+                       compatible      = "qcom,rpm-apq8064";
+                       reg             = <0x108000 0x1000>;
+                       qcom,ipc        = <&l2cc 0x8 2>;
+
+                       interrupts      = <GIC_SPI 19 IRQ_TYPE_EDGE_RISING>,
+                                         <GIC_SPI 21 IRQ_TYPE_EDGE_RISING>,
+                                         <GIC_SPI 22 IRQ_TYPE_EDGE_RISING>;
+                       interrupt-names = "ack", "err", "wakeup";
+
+                       regulators {
+                               compatible = "qcom,rpm-pm8921-regulators";
+
+                               pm8921_hdmi_switch: hdmi-switch {
+                                       bias-pull-down;
+                               };
+                       };
+               };
+
+               usb1_phy: phy@12500000 {
+                       compatible      = "qcom,usb-otg-ci";
+                       reg             = <0x12500000 0x400>;
+                       interrupts      = <GIC_SPI 100 IRQ_TYPE_NONE>;
+                       status          = "disabled";
+                       dr_mode         = "host";
+
+                       clocks          = <&gcc USB_HS1_XCVR_CLK>,
+                                         <&gcc USB_HS1_H_CLK>;
+                       clock-names     = "core", "iface";
+
+                       resets          = <&gcc USB_HS1_RESET>;
+                       reset-names     = "link";
+               };
+
+               usb3_phy: phy@12520000 {
+                       compatible      = "qcom,usb-otg-ci";
+                       reg             = <0x12520000 0x400>;
+                       interrupts      = <GIC_SPI 188 IRQ_TYPE_NONE>;
+                       status          = "disabled";
+                       dr_mode         = "host";
+
+                       clocks          = <&gcc USB_HS3_XCVR_CLK>,
+                                         <&gcc USB_HS3_H_CLK>;
+                       clock-names     = "core", "iface";
+
+                       resets          = <&gcc USB_HS3_RESET>;
+                       reset-names     = "link";
+               };
+
+               usb4_phy: phy@12530000 {
+                       compatible      = "qcom,usb-otg-ci";
+                       reg             = <0x12530000 0x400>;
+                       interrupts      = <GIC_SPI 215 IRQ_TYPE_NONE>;
+                       status          = "disabled";
+                       dr_mode         = "host";
+
+                       clocks          = <&gcc USB_HS4_XCVR_CLK>,
+                                         <&gcc USB_HS4_H_CLK>;
+                       clock-names     = "core", "iface";
+
+                       resets          = <&gcc USB_HS4_RESET>;
+                       reset-names     = "link";
+               };
+
+               gadget1: gadget@12500000 {
+                       compatible      = "qcom,ci-hdrc";
+                       reg             = <0x12500000 0x400>;
+                       status          = "disabled";
+                       dr_mode         = "peripheral";
+                       interrupts      = <GIC_SPI 100 IRQ_TYPE_NONE>;
+                       usb-phy         = <&usb1_phy>;
+               };
+
+               usb1: usb@12500000 {
+                       compatible      = "qcom,ehci-host";
+                       reg             = <0x12500000 0x400>;
+                       interrupts      = <GIC_SPI 100 IRQ_TYPE_NONE>;
+                       status          = "disabled";
+                       usb-phy         = <&usb1_phy>;
+               };
+
+               usb3: usb@12520000 {
+                       compatible      = "qcom,ehci-host";
+                       reg             = <0x12520000 0x400>;
+                       interrupts      = <GIC_SPI 188 IRQ_TYPE_NONE>;
+                       status          = "disabled";
+                       usb-phy         = <&usb3_phy>;
+               };
+
+               usb4: usb@12530000 {
+                       compatible      = "qcom,ehci-host";
+                       reg             = <0x12530000 0x400>;
+                       interrupts      = <GIC_SPI 215 IRQ_TYPE_NONE>;
+                       status          = "disabled";
+                       usb-phy         = <&usb4_phy>;
+               };
+
+               sata_phy0: phy@1b400000 {
+                       compatible      = "qcom,apq8064-sata-phy";
+                       status          = "disabled";
+                       reg             = <0x1b400000 0x200>;
+                       reg-names       = "phy_mem";
+                       clocks          = <&gcc SATA_PHY_CFG_CLK>;
+                       clock-names     = "cfg";
+                       #phy-cells      = <0>;
+               };
+
+               sata0: sata@29000000 {
+                       compatible              = "generic-ahci";
+                       status                  = "disabled";
+                       reg                     = <0x29000000 0x180>;
+                       interrupts              = <GIC_SPI 209 IRQ_TYPE_NONE>;
+
+                       clocks                  = <&gcc SFAB_SATA_S_H_CLK>,
+                                               <&gcc SATA_H_CLK>,
+                                               <&gcc SATA_A_CLK>,
+                                               <&gcc SATA_RXOOB_CLK>,
+                                               <&gcc SATA_PMALIVE_CLK>;
+                       clock-names             = "slave_iface",
+                                               "iface",
+                                               "bus",
+                                               "rxoob",
+                                               "core_pmalive";
+
+                       assigned-clocks         = <&gcc SATA_RXOOB_CLK>,
+                                               <&gcc SATA_PMALIVE_CLK>;
+                       assigned-clock-rates    = <100000000>, <100000000>;
+
+                       phys                    = <&sata_phy0>;
+                       phy-names               = "sata-phy";
+               };
+
                /* Temporary fixed regulator */
                vsdcc_fixed: vsdcc-regulator {
                        compatible = "regulator-fixed";
index 20bbd19b996ecfc4b883e770f0800dbb4f288215..e0b2ce2910e0aeef770230ac727effc79236dc39 100644 (file)
                };
        };
 
+       cpu-pmu {
+               compatible = "qcom,scorpion-mp-pmu";
+               interrupts = <1 9 0x304>;
+       };
+
        soc: soc {
                #address-cells = <1>;
                #size-cells = <1>;
index 73813cc118f9e968dce4b20e9f2c385764439b80..8f1a0b16201739ead985a49f09a97fcbd3b13ed9 100644 (file)
@@ -1,3 +1,4 @@
+#include <dt-bindings/interrupt-controller/irq.h>
 #include <dt-bindings/spmi/spmi.h>
 
 &spmi_bus {
@@ -7,6 +8,23 @@
                reg = <0x4 SPMI_USID>;
                #address-cells = <1>;
                #size-cells = <0>;
+
+               pm8841_mpps: mpps@a000 {
+                       compatible = "qcom,pm8841-mpp";
+                       reg = <0xa000 0x400>;
+                       gpio-controller;
+                       #gpio-cells = <2>;
+                       interrupts = <4 0xa0 0 IRQ_TYPE_NONE>,
+                                    <4 0xa1 0 IRQ_TYPE_NONE>,
+                                    <4 0xa2 0 IRQ_TYPE_NONE>,
+                                    <4 0xa3 0 IRQ_TYPE_NONE>;
+               };
+
+               temp-alarm@2400 {
+                       compatible = "qcom,spmi-temp-alarm";
+                       reg = <0x2400 0x100>;
+                       interrupts = <4 0x24 0 IRQ_TYPE_EDGE_RISING>;
+               };
        };
 
        usid5: pm8841@5 {
index 24c5088acea2a244f79ae5b4edf537c07b8e22e3..aa774e685018a58d2fdebd408af6aed6e849a0f0 100644 (file)
@@ -1,3 +1,5 @@
+#include <dt-bindings/iio/qcom,spmi-vadc.h>
+#include <dt-bindings/interrupt-controller/irq.h>
 #include <dt-bindings/spmi/spmi.h>
 
 &spmi_bus {
                reg = <0x0 SPMI_USID>;
                #address-cells = <1>;
                #size-cells = <0>;
+
+               rtc@6000 {
+                       compatible = "qcom,pm8941-rtc";
+                       reg = <0x6000 0x100>,
+                             <0x6100 0x100>;
+                       reg-names = "rtc", "alarm";
+                       interrupts = <0x0 0x61 0x1 IRQ_TYPE_EDGE_RISING>;
+               };
+
+               pwrkey@800 {
+                       compatible = "qcom,pm8941-pwrkey";
+                       reg = <0x800 0x100>;
+                       interrupts = <0x0 0x8 0 IRQ_TYPE_EDGE_BOTH>;
+                       debounce = <15625>;
+                       bias-pull-up;
+               };
+
+               pm8941_gpios: gpios@c000 {
+                       compatible = "qcom,pm8941-gpio";
+                       reg = <0xc000 0x2400>;
+                       gpio-controller;
+                       #gpio-cells = <2>;
+                       interrupts = <0 0xc0 0 IRQ_TYPE_NONE>,
+                                    <0 0xc1 0 IRQ_TYPE_NONE>,
+                                    <0 0xc2 0 IRQ_TYPE_NONE>,
+                                    <0 0xc3 0 IRQ_TYPE_NONE>,
+                                    <0 0xc4 0 IRQ_TYPE_NONE>,
+                                    <0 0xc5 0 IRQ_TYPE_NONE>,
+                                    <0 0xc6 0 IRQ_TYPE_NONE>,
+                                    <0 0xc7 0 IRQ_TYPE_NONE>,
+                                    <0 0xc8 0 IRQ_TYPE_NONE>,
+                                    <0 0xc9 0 IRQ_TYPE_NONE>,
+                                    <0 0xca 0 IRQ_TYPE_NONE>,
+                                    <0 0xcb 0 IRQ_TYPE_NONE>,
+                                    <0 0xcc 0 IRQ_TYPE_NONE>,
+                                    <0 0xcd 0 IRQ_TYPE_NONE>,
+                                    <0 0xce 0 IRQ_TYPE_NONE>,
+                                    <0 0xcf 0 IRQ_TYPE_NONE>,
+                                    <0 0xd0 0 IRQ_TYPE_NONE>,
+                                    <0 0xd1 0 IRQ_TYPE_NONE>,
+                                    <0 0xd2 0 IRQ_TYPE_NONE>,
+                                    <0 0xd3 0 IRQ_TYPE_NONE>,
+                                    <0 0xd4 0 IRQ_TYPE_NONE>,
+                                    <0 0xd5 0 IRQ_TYPE_NONE>,
+                                    <0 0xd6 0 IRQ_TYPE_NONE>,
+                                    <0 0xd7 0 IRQ_TYPE_NONE>,
+                                    <0 0xd8 0 IRQ_TYPE_NONE>,
+                                    <0 0xd9 0 IRQ_TYPE_NONE>,
+                                    <0 0xda 0 IRQ_TYPE_NONE>,
+                                    <0 0xdb 0 IRQ_TYPE_NONE>,
+                                    <0 0xdc 0 IRQ_TYPE_NONE>,
+                                    <0 0xdd 0 IRQ_TYPE_NONE>,
+                                    <0 0xde 0 IRQ_TYPE_NONE>,
+                                    <0 0xdf 0 IRQ_TYPE_NONE>,
+                                    <0 0xe0 0 IRQ_TYPE_NONE>,
+                                    <0 0xe1 0 IRQ_TYPE_NONE>,
+                                    <0 0xe2 0 IRQ_TYPE_NONE>,
+                                    <0 0xe3 0 IRQ_TYPE_NONE>;
+               };
+
+               pm8941_mpps: mpps@a000 {
+                       compatible = "qcom,pm8941-mpp";
+                       reg = <0xa000 0x800>;
+                       gpio-controller;
+                       #gpio-cells = <2>;
+                       interrupts = <0 0xa0 0 IRQ_TYPE_NONE>,
+                                    <0 0xa1 0 IRQ_TYPE_NONE>,
+                                    <0 0xa2 0 IRQ_TYPE_NONE>,
+                                    <0 0xa3 0 IRQ_TYPE_NONE>,
+                                    <0 0xa4 0 IRQ_TYPE_NONE>,
+                                    <0 0xa5 0 IRQ_TYPE_NONE>,
+                                    <0 0xa6 0 IRQ_TYPE_NONE>,
+                                    <0 0xa7 0 IRQ_TYPE_NONE>;
+               };
+
+               pm8941_temp: temp-alarm@2400 {
+                       compatible = "qcom,spmi-temp-alarm";
+                       reg = <0x2400 0x100>;
+                       interrupts = <0 0x24 0 IRQ_TYPE_EDGE_RISING>;
+                       io-channels = <&pm8941_vadc VADC_DIE_TEMP>;
+                       io-channel-names = "thermal";
+                       #thermal-sensor-cells = <0>;
+               };
+
+               pm8941_vadc: vadc@3100 {
+                       compatible = "qcom,spmi-vadc";
+                       reg = <0x3100 0x100>;
+                       interrupts = <0x0 0x31 0x0 IRQ_TYPE_EDGE_RISING>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       #io-channel-cells = <1>;
+
+                       die_temp {
+                               reg = <VADC_DIE_TEMP>;
+                       };
+                       ref_625mv {
+                               reg = <VADC_REF_625MV>;
+                       };
+                       ref_1250v {
+                               reg = <VADC_REF_1250MV>;
+                       };
+                       ref_gnd {
+                               reg = <VADC_GND_REF>;
+                       };
+                       ref_vdd {
+                               reg = <VADC_VDD_VADC>;
+                       };
+               };
+
+               pm8941_iadc: iadc@3600 {
+                       compatible = "qcom,pm8941-iadc", "qcom,spmi-iadc";
+                       reg = <0x3600 0x100>,
+                                 <0x12f1 0x1>;
+                       interrupts = <0x0 0x36 0x0 IRQ_TYPE_EDGE_RISING>;
+                       qcom,external-resistor-micro-ohms = <10000>;
+               };
        };
 
        usid1: pm8941@1 {
-               compatible ="qcom,spmi-pmic";
+               compatible = "qcom,spmi-pmic";
                reg = <0x1 SPMI_USID>;
                #address-cells = <1>;
                #size-cells = <0>;
+
+               wled@d800 {
+                       compatible = "qcom,pm8941-wled";
+                       reg = <0xd800 0x100>;
+                       label = "backlight";
+
+                       qcom,cs-out;
+                       qcom,current-limit = <20>;
+                       qcom,current-boost-limit = <805>;
+                       qcom,switching-freq = <1600>;
+                       qcom,ovp = <29>;
+                       qcom,num-strings = <2>;
+               };
        };
 };
index a5a4fe695a46afb08f054e9fd44044bfd4fb3285..5e240ccc08b705d46937abc93747905cb733b46c 100644 (file)
@@ -1,3 +1,5 @@
+#include <dt-bindings/iio/qcom,spmi-vadc.h>
+#include <dt-bindings/interrupt-controller/irq.h>
 #include <dt-bindings/spmi/spmi.h>
 
 &spmi_bus {
@@ -7,6 +9,96 @@
                reg = <0x0 SPMI_USID>;
                #address-cells = <1>;
                #size-cells = <0>;
+
+               rtc@6000 {
+                       compatible = "qcom,pm8941-rtc";
+                       reg = <0x6000 0x100>,
+                             <0x6100 0x100>;
+                       reg-names = "rtc", "alarm";
+                       interrupts = <0x0 0x61 0x1 IRQ_TYPE_EDGE_RISING>;
+               };
+
+               pma8084_gpios: gpios@c000 {
+                       compatible = "qcom,pma8084-gpio";
+                       reg = <0xc000 0x1600>;
+                       gpio-controller;
+                       #gpio-cells = <2>;
+                       interrupts = <0 0xc0 0 IRQ_TYPE_NONE>,
+                                    <0 0xc1 0 IRQ_TYPE_NONE>,
+                                    <0 0xc2 0 IRQ_TYPE_NONE>,
+                                    <0 0xc3 0 IRQ_TYPE_NONE>,
+                                    <0 0xc4 0 IRQ_TYPE_NONE>,
+                                    <0 0xc5 0 IRQ_TYPE_NONE>,
+                                    <0 0xc6 0 IRQ_TYPE_NONE>,
+                                    <0 0xc7 0 IRQ_TYPE_NONE>,
+                                    <0 0xc8 0 IRQ_TYPE_NONE>,
+                                    <0 0xc9 0 IRQ_TYPE_NONE>,
+                                    <0 0xca 0 IRQ_TYPE_NONE>,
+                                    <0 0xcb 0 IRQ_TYPE_NONE>,
+                                    <0 0xcc 0 IRQ_TYPE_NONE>,
+                                    <0 0xcd 0 IRQ_TYPE_NONE>,
+                                    <0 0xce 0 IRQ_TYPE_NONE>,
+                                    <0 0xcf 0 IRQ_TYPE_NONE>,
+                                    <0 0xd0 0 IRQ_TYPE_NONE>,
+                                    <0 0xd1 0 IRQ_TYPE_NONE>,
+                                    <0 0xd2 0 IRQ_TYPE_NONE>,
+                                    <0 0xd3 0 IRQ_TYPE_NONE>,
+                                    <0 0xd4 0 IRQ_TYPE_NONE>,
+                                    <0 0xd5 0 IRQ_TYPE_NONE>;
+               };
+
+               pma8084_mpps: mpps@a000 {
+                       compatible = "qcom,pma8084-mpp";
+                       reg = <0xa000 0x800>;
+                       gpio-controller;
+                       #gpio-cells = <2>;
+                       interrupts = <0 0xa0 0 IRQ_TYPE_NONE>,
+                                    <0 0xa1 0 IRQ_TYPE_NONE>,
+                                    <0 0xa2 0 IRQ_TYPE_NONE>,
+                                    <0 0xa3 0 IRQ_TYPE_NONE>,
+                                    <0 0xa4 0 IRQ_TYPE_NONE>,
+                                    <0 0xa5 0 IRQ_TYPE_NONE>,
+                                    <0 0xa6 0 IRQ_TYPE_NONE>,
+                                    <0 0xa7 0 IRQ_TYPE_NONE>;
+               };
+
+               pma8084_temp: temp-alarm@2400 {
+                       compatible = "qcom,spmi-temp-alarm";
+                       reg = <0x2400 0x100>;
+                       interrupts = <0 0x24 0 IRQ_TYPE_EDGE_RISING>;
+                       #thermal-sensor-cells = <0>;
+                       io-channels = <&pma8084_vadc VADC_DIE_TEMP>;
+                       io-channel-names = "thermal";
+               };
+
+               pma8084_vadc: vadc@3100 {
+                       compatible = "qcom,spmi-vadc";
+                       reg = <0x3100 0x100>;
+                       interrupts = <0x0 0x31 0x0 IRQ_TYPE_EDGE_RISING>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       #io-channel-cells = <1>;
+                       io-channel-ranges;
+
+                       die_temp {
+                               reg = <VADC_DIE_TEMP>;
+                       };
+                       ref_625mv {
+                               reg = <VADC_REF_625MV>;
+                       };
+                       ref_1250v {
+                               reg = <VADC_REF_1250MV>;
+                       };
+                       ref_buf_625mv {
+                               reg = <VADC_SPARE1>;
+                       };
+                       ref_gnd {
+                               reg = <VADC_GND_REF>;
+                       };
+                       ref_vdd {
+                               reg = <VADC_VDD_VADC>;
+                       };
+               };
        };
 
        usid1: pma8084@1 {
index 81a38ceee098087ecd05ab13fa5e700783648e29..a4c425923c05e8cdeff90843a2407eb8884a2bfb 100644 (file)
 
 &i2c5 {
        status = "okay";
-       vdd_dvfs: max8973@1b {
+       vdd_dvfs: regulator@1b {
                compatible = "maxim,max8973";
                reg = <0x1b>;
 
index 0fd889f88109de173c8760d7a7412ec0bc758b1d..7ee22a41c6c974888a69f88542ed039ab9d09591 100644 (file)
                             <0 29 IRQ_TYPE_LEVEL_HIGH>,
                             <0 30 IRQ_TYPE_LEVEL_HIGH>,
                             <0 31 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&mstp4_clks R8A73A4_CLK_IRQC>;
                power-domains = <&pd_c4>;
        };
 
                             <0 55 IRQ_TYPE_LEVEL_HIGH>,
                             <0 56 IRQ_TYPE_LEVEL_HIGH>,
                             <0 57 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&mstp4_clks R8A73A4_CLK_IRQC>;
                power-domains = <&pd_c4>;
        };
 
                mstp4_clks: mstp4_clks@e6150140 {
                        compatible = "renesas,r8a73a4-mstp-clocks", "renesas,cpg-mstp-clocks";
                        reg = <0 0xe6150140 0 4>, <0 0xe615004c 0 4>;
-                       clocks = <&main_div2_clk>, <&cpg_clocks R8A73A4_CLK_HP>,
+                       clocks = <&main_div2_clk>, <&main_div2_clk>,
+                                <&cpg_clocks R8A73A4_CLK_HP>,
                                 <&cpg_clocks R8A73A4_CLK_HP>;
                        #clock-cells = <1>;
                        clock-indices = <
-                               R8A73A4_CLK_IIC5 R8A73A4_CLK_IIC4
-                               R8A73A4_CLK_IIC3
+                               R8A73A4_CLK_IRQC R8A73A4_CLK_IIC5
+                               R8A73A4_CLK_IIC4 R8A73A4_CLK_IIC3
                        >;
                        clock-output-names =
-                               "iic5", "iic4", "iic3";
+                               "irqc", "iic5", "iic4", "iic3";
                };
                mstp5_clks: mstp5_clks@e6150144 {
                        compatible = "renesas,r8a73a4-mstp-clocks", "renesas,cpg-mstp-clocks";
index 9bd0cb439f448d03d51ce8741801a4bcf19171ec..2e31d8c01cbf6a74d2b46ef52d031a90372e6dec 100644 (file)
                gpios = <&pfc 166 GPIO_ACTIVE_LOW>;
        };
 
-       wm8978: wm8978@1a {
+       wm8978: codec@1a {
                #sound-dai-cells = <0>;
                compatible = "wlf,wm8978";
                reg = <0x1a>;
index 83c1c3ca1b8f1400010bb28fba1d8af706633e0a..d84714468cce18df9414a0b8e94ab12beb5e292d 100644 (file)
@@ -67,7 +67,7 @@
        };
 
        /* irqpin0: IRQ0 - IRQ7 */
-       irqpin0: irqpin@e6900000 {
+       irqpin0: interrupt-controller@e6900000 {
                compatible = "renesas,intc-irqpin-r8a7740", "renesas,intc-irqpin";
                #interrupt-cells = <2>;
                interrupt-controller;
@@ -89,7 +89,7 @@
        };
 
        /* irqpin1: IRQ8 - IRQ15 */
-       irqpin1: irqpin@e6900004 {
+       irqpin1: interrupt-controller@e6900004 {
                compatible = "renesas,intc-irqpin-r8a7740", "renesas,intc-irqpin";
                #interrupt-cells = <2>;
                interrupt-controller;
        };
 
        /* irqpin2: IRQ16 - IRQ23 */
-       irqpin2: irqpin@e6900008 {
+       irqpin2: interrupt-controller@e6900008 {
                compatible = "renesas,intc-irqpin-r8a7740", "renesas,intc-irqpin";
                #interrupt-cells = <2>;
                interrupt-controller;
        };
 
        /* irqpin3: IRQ24 - IRQ31 */
-       irqpin3: irqpin@e690000c {
+       irqpin3: interrupt-controller@e690000c {
                compatible = "renesas,intc-irqpin-r8a7740", "renesas,intc-irqpin";
                #interrupt-cells = <2>;
                interrupt-controller;
                status = "disabled";
        };
 
-       scifb8: serial@e6c30000 {
+       scifb: serial@e6c30000 {
                compatible = "renesas,scifb-r8a7740", "renesas,scifb";
                reg = <0xe6c30000 0x100>;
                interrupts = <0 108 IRQ_TYPE_LEVEL_HIGH>;
index 04c0c37bb7843997f127535e7f73e93cbf8bb8bb..dffa6ff303608b19bf27a0ca34f96f2370d2500f 100644 (file)
        flash: flash@0 {
                #address-cells = <1>;
                #size-cells = <1>;
-               compatible = "spansion,s25fl008k";
+               compatible = "spansion,s25fl008k", "jedec,spi-nor";
                reg = <0>;
                spi-max-frequency = <104000000>;
                m25p,fast-read;
index 787fa6f9f46ddf4d2bd0d0db9abb82e4223c2413..90543b12d7e26bcbd9eca0e0c113ffaa718a3873 100644 (file)
@@ -85,7 +85,7 @@
 &i2c0 {
        status = "okay";
 
-       ak4643: sound-codec@12 {
+       ak4643: codec@12 {
                compatible = "asahi-kasei,ak4643";
                #sound-dai-cells = <0>;
                reg = <0x12>;
        flash: flash@0 {
                #address-cells = <1>;
                #size-cells = <1>;
-               compatible = "spansion,s25fl008k";
+               compatible = "spansion,s25fl008k", "jedec,spi-nor";
                reg = <0>;
                spi-max-frequency = <104000000>;
                m25p,fast-read;
index 868f9730953350e9bb8b368b7b71efb5a85e7144..7ce9f5fd586504f20768a16238ed1495c081f456 100644 (file)
@@ -68,7 +68,7 @@
        };
 
        /* irqpin: IRQ0 - IRQ3 */
-       irqpin: irqpin@fe78001c {
+       irqpin: interrupt-controller@fe78001c {
                compatible = "renesas,intc-irqpin-r8a7778", "renesas,intc-irqpin";
                #interrupt-cells = <2>;
                interrupt-controller;
index 540756cdf3914a2af398d08734a48aa5b93ea21b..20afea6f06ef6735d23c382a426e3a09438be457 100644 (file)
                regulator-always-on;
        };
 
-       lan0@18000000 {
+       ethernet@18000000 {
                compatible = "smsc,lan9220", "smsc,lan9115";
                reg = <0x18000000 0x100>;
-               pinctrl-0 = <&lan0_pins>;
+               pinctrl-0 = <&ethernet_pins>;
                pinctrl-names = "default";
 
                phy-mode = "mii";
                };
        };
 
-       lan0_pins: lan0 {
+       ethernet_pins: ethernet {
                intc {
                        renesas,groups = "intc_irq1_b";
                        renesas,function = "intc";
index 5c2219b9f3eb500327236ed90a519fce21d76ce3..5c8071e87ae9c7190a88916d391e7f42b62a4b4a 100644 (file)
                interrupt-controller;
        };
 
-       irqpin0: irqpin@fe780010 {
+       irqpin0: interrupt-controller@fe780010 {
                compatible = "renesas,intc-irqpin-r8a7779", "renesas,intc-irqpin";
                #interrupt-cells = <2>;
                status = "disabled";
index aaa4f258e279ccfac92ff1142faf4fe83ce3195d..2eb8a995ae9fe6fa79df4f98c238f0bdc6e94bbb 100644 (file)
        flash: flash@0 {
                #address-cells = <1>;
                #size-cells = <1>;
-               compatible = "spansion,s25fl512s";
+               compatible = "spansion,s25fl512s", "jedec,spi-nor";
                reg = <0>;
                spi-max-frequency = <30000000>;
                spi-tx-bus-width = <4>;
 
        clock-frequency = <100000>;
 
-       ak4643: sound-codec@12 {
+       ak4643: codec@12 {
                compatible = "asahi-kasei,ak4643";
                #sound-dai-cells = <0>;
                reg = <0x12>;
index e4daa05d6cc4abf079bacf73e3f5dd13a78c272d..51ab8865ea37dc899ddd2fe0948c0d76b6582263 100644 (file)
                             <0 1 IRQ_TYPE_LEVEL_HIGH>,
                             <0 2 IRQ_TYPE_LEVEL_HIGH>,
                             <0 3 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&mstp4_clks R8A7790_CLK_IRQC>;
        };
 
        dmac0: dma-controller@e6700000 {
                dma-channels = <13>;
        };
 
+       usb_dmac0: dma-controller@e65a0000 {
+               compatible = "renesas,usb-dmac";
+               reg = <0 0xe65a0000 0 0x100>;
+               interrupts = <0 109 IRQ_TYPE_LEVEL_HIGH
+                             0 109 IRQ_TYPE_LEVEL_HIGH>;
+               interrupt-names = "ch0", "ch1";
+               clocks = <&mstp3_clks R8A7790_CLK_USBDMAC0>;
+               #dma-cells = <1>;
+               dma-channels = <2>;
+       };
+
+       usb_dmac1: dma-controller@e65b0000 {
+               compatible = "renesas,usb-dmac";
+               reg = <0 0xe65b0000 0 0x100>;
+               interrupts = <0 110 IRQ_TYPE_LEVEL_HIGH
+                             0 110 IRQ_TYPE_LEVEL_HIGH>;
+               interrupt-names = "ch0", "ch1";
+               clocks = <&mstp3_clks R8A7790_CLK_USBDMAC1>;
+               #dma-cells = <1>;
+               dma-channels = <2>;
+       };
+
        i2c0: i2c@e6508000 {
                #address-cells = <1>;
                #size-cells = <0>;
                dma-names = "tx", "rx";
                reg-io-width = <4>;
                status = "disabled";
+               max-frequency = <97500000>;
        };
 
        mmcif1: mmc@ee220000 {
                dma-names = "tx", "rx";
                reg-io-width = <4>;
                status = "disabled";
+               max-frequency = <97500000>;
        };
 
        pfc: pfc@e6060000 {
                renesas,buswait = <4>;
                phys = <&usb0 1>;
                phy-names = "usb";
+               dmas = <&usb_dmac0 0>, <&usb_dmac0 1>,
+                      <&usb_dmac1 0>, <&usb_dmac1 1>;
+               dma-names = "ch0", "ch1", "ch2", "ch3";
                status = "disabled";
        };
 
                                "iic0", "pciec", "iic1", "ssusb", "cmt1",
                                "usbdmac0", "usbdmac1";
                };
+               mstp4_clks: mstp4_clks@e6150140 {
+                       compatible = "renesas,r8a7790-mstp-clocks", "renesas,cpg-mstp-clocks";
+                       reg = <0 0xe6150140 0 4>, <0 0xe615004c 0 4>;
+                       clocks = <&cp_clk>;
+                       #clock-cells = <1>;
+                       clock-indices = <R8A7790_CLK_IRQC>;
+                       clock-output-names = "irqc";
+               };
                mstp5_clks: mstp5_clks@e6150144 {
                        compatible = "renesas,r8a7790-mstp-clocks", "renesas,cpg-mstp-clocks";
                        reg = <0 0xe6150144 0 4>, <0 0xe615003c 0 4>;
 
        msiof0: spi@e6e20000 {
                compatible = "renesas,msiof-r8a7790";
-               reg = <0 0xe6e20000 0 0x0064>, <0 0xe7e20000 0 0x0064>;
+               reg = <0 0xe6e20000 0 0x0064>;
                interrupts = <0 156 IRQ_TYPE_LEVEL_HIGH>;
                clocks = <&mstp0_clks R8A7790_CLK_MSIOF0>;
                dmas = <&dmac0 0x51>, <&dmac0 0x52>;
 
        msiof1: spi@e6e10000 {
                compatible = "renesas,msiof-r8a7790";
-               reg = <0 0xe6e10000 0 0x0064>, <0 0xe7e10000 0 0x0064>;
+               reg = <0 0xe6e10000 0 0x0064>;
                interrupts = <0 157 IRQ_TYPE_LEVEL_HIGH>;
                clocks = <&mstp2_clks R8A7790_CLK_MSIOF1>;
                dmas = <&dmac0 0x55>, <&dmac0 0x56>;
 
        msiof2: spi@e6e00000 {
                compatible = "renesas,msiof-r8a7790";
-               reg = <0 0xe6e00000 0 0x0064>, <0 0xe7e00000 0 0x0064>;
+               reg = <0 0xe6e00000 0 0x0064>;
                interrupts = <0 158 IRQ_TYPE_LEVEL_HIGH>;
                clocks = <&mstp2_clks R8A7790_CLK_MSIOF2>;
                dmas = <&dmac0 0x41>, <&dmac0 0x42>;
 
        msiof3: spi@e6c90000 {
                compatible = "renesas,msiof-r8a7790";
-               reg = <0 0xe6c90000 0 0x0064>, <0 0xe7c90000 0 0x0064>;
+               reg = <0 0xe6c90000 0 0x0064>;
                interrupts = <0 159 IRQ_TYPE_LEVEL_HIGH>;
                clocks = <&mstp2_clks R8A7790_CLK_MSIOF3>;
                dmas = <&dmac0 0x45>, <&dmac0 0x46>;
                status = "disabled";
        };
 
-       rcar_sound: rcar_sound@ec500000 {
+       rcar_sound: sound@ec500000 {
                /*
                 * #sound-dai-cells is required
                 *
index e33e4047b0b0c9207494e8cb3e30e4f2ac7bc6ee..655d1804e5e9ceda08dbe9bd46e26e81344ca38e 100644 (file)
        flash@0 {
                #address-cells = <1>;
                #size-cells = <1>;
-               compatible = "spansion,s25fl512s";
+               compatible = "spansion,s25fl512s", "jedec,spi-nor";
                reg = <0>;
                spi-max-frequency = <30000000>;
                spi-tx-bus-width = <4>;
index 824ddab9c3adcbde11ac8ea62f339af6aa1b3ec6..cffe33ff4d16f41f0bb67a6b96f9b6c791cf4514 100644 (file)
        flash: flash@0 {
                #address-cells = <1>;
                #size-cells = <1>;
-               compatible = "spansion,s25fl512s";
+               compatible = "spansion,s25fl512s", "jedec,spi-nor";
                reg = <0>;
                spi-max-frequency = <30000000>;
                spi-tx-bus-width = <4>;
        status = "okay";
        clock-frequency = <100000>;
 
-       ak4643: sound-codec@12 {
+       ak4643: codec@12 {
                compatible = "asahi-kasei,ak4643";
                #sound-dai-cells = <0>;
                reg = <0x12>;
index e8af960e22084eae12f0165928626b28b07b88cf..dc1cd3f16606071294f31c54bc0b4ef8ec14fe75 100644 (file)
                             <0 15 IRQ_TYPE_LEVEL_HIGH>,
                             <0 16 IRQ_TYPE_LEVEL_HIGH>,
                             <0 17 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&mstp4_clks R8A7791_CLK_IRQC>;
        };
 
        dmac0: dma-controller@e6700000 {
                dma-channels = <13>;
        };
 
+       usb_dmac0: dma-controller@e65a0000 {
+               compatible = "renesas,usb-dmac";
+               reg = <0 0xe65a0000 0 0x100>;
+               interrupts = <0 109 IRQ_TYPE_LEVEL_HIGH
+                             0 109 IRQ_TYPE_LEVEL_HIGH>;
+               interrupt-names = "ch0", "ch1";
+               clocks = <&mstp3_clks R8A7791_CLK_USBDMAC0>;
+               #dma-cells = <1>;
+               dma-channels = <2>;
+       };
+
+       usb_dmac1: dma-controller@e65b0000 {
+               compatible = "renesas,usb-dmac";
+               reg = <0 0xe65b0000 0 0x100>;
+               interrupts = <0 110 IRQ_TYPE_LEVEL_HIGH
+                             0 110 IRQ_TYPE_LEVEL_HIGH>;
+               interrupt-names = "ch0", "ch1";
+               clocks = <&mstp3_clks R8A7791_CLK_USBDMAC1>;
+               #dma-cells = <1>;
+               dma-channels = <2>;
+       };
+
        /* The memory map in the User's Manual maps the cores to bus numbers */
        i2c0: i2c@e6508000 {
                #address-cells = <1>;
                dma-names = "tx", "rx";
                reg-io-width = <4>;
                status = "disabled";
+               max-frequency = <97500000>;
        };
 
        sdhi0: sd@ee100000 {
                renesas,buswait = <4>;
                phys = <&usb0 1>;
                phy-names = "usb";
+               dmas = <&usb_dmac0 0>, <&usb_dmac0 1>,
+                      <&usb_dmac1 0>, <&usb_dmac1 1>;
+               dma-names = "ch0", "ch1", "ch2", "ch3";
                status = "disabled";
        };
 
                                "mmcif0", "i2c7", "pciec", "i2c8", "ssusb", "cmt1",
                                "usbdmac0", "usbdmac1";
                };
+               mstp4_clks: mstp4_clks@e6150140 {
+                       compatible = "renesas,r8a7791-mstp-clocks", "renesas,cpg-mstp-clocks";
+                       reg = <0 0xe6150140 0 4>, <0 0xe615004c 0 4>;
+                       clocks = <&cp_clk>;
+                       #clock-cells = <1>;
+                       clock-indices = <R8A7791_CLK_IRQC>;
+                       clock-output-names = "irqc";
+               };
                mstp5_clks: mstp5_clks@e6150144 {
                        compatible = "renesas,r8a7791-mstp-clocks", "renesas,cpg-mstp-clocks";
                        reg = <0 0xe6150144 0 4>, <0 0xe615003c 0 4>;
 
        msiof0: spi@e6e20000 {
                compatible = "renesas,msiof-r8a7791";
-               reg = <0 0xe6e20000 0 0x0064>, <0 0xe7e20000 0 0x0064>;
+               reg = <0 0xe6e20000 0 0x0064>;
                interrupts = <0 156 IRQ_TYPE_LEVEL_HIGH>;
                clocks = <&mstp0_clks R8A7791_CLK_MSIOF0>;
                dmas = <&dmac0 0x51>, <&dmac0 0x52>;
 
        msiof1: spi@e6e10000 {
                compatible = "renesas,msiof-r8a7791";
-               reg = <0 0xe6e10000 0 0x0064>, <0 0xe7e10000 0 0x0064>;
+               reg = <0 0xe6e10000 0 0x0064>;
                interrupts = <0 157 IRQ_TYPE_LEVEL_HIGH>;
                clocks = <&mstp2_clks R8A7791_CLK_MSIOF1>;
                dmas = <&dmac0 0x55>, <&dmac0 0x56>;
 
        msiof2: spi@e6e00000 {
                compatible = "renesas,msiof-r8a7791";
-               reg = <0 0xe6e00000 0 0x0064>, <0 0xe7e00000 0 0x0064>;
+               reg = <0 0xe6e00000 0 0x0064>;
                interrupts = <0 158 IRQ_TYPE_LEVEL_HIGH>;
                clocks = <&mstp2_clks R8A7791_CLK_MSIOF2>;
                dmas = <&dmac0 0x41>, <&dmac0 0x42>;
                status = "disabled";
        };
 
-       rcar_sound: rcar_sound@ec500000 {
+       rcar_sound: sound@ec500000 {
                /*
                 * #sound-dai-cells is required
                 *
index 7a84aaf2732fcf275c72229dd54581bbb125efc9..b738194233113402f4aa76ed9f6bd1acdf450f47 100644 (file)
                             <0 15 IRQ_TYPE_LEVEL_HIGH>,
                             <0 16 IRQ_TYPE_LEVEL_HIGH>,
                             <0 17 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&mstp4_clks R8A7794_CLK_IRQC>;
        };
 
        dmac0: dma-controller@e6700000 {
                                "sdhi2", "sdhi1", "sdhi0",
                                "mmcif0", "cmt1", "usbdmac0", "usbdmac1";
                };
+               mstp4_clks: mstp4_clks@e6150140 {
+                       compatible = "renesas,r8a7794-mstp-clocks", "renesas,cpg-mstp-clocks";
+                       reg = <0 0xe6150140 0 4>, <0 0xe615004c 0 4>;
+                       clocks = <&cp_clk>;
+                       #clock-cells = <1>;
+                       clock-indices = <R8A7794_CLK_IRQC>;
+                       clock-output-names = "irqc";
+               };
                mstp7_clks: mstp7_clks@e615014c {
                        compatible = "renesas,r8a7794-mstp-clocks", "renesas,cpg-mstp-clocks";
                        reg = <0 0xe615014c 0 4>, <0 0xe61501c4 0 4>;
index baf21ac6ce7f5a2116e65bc9439a87326597a284..b299b26926d42050b38a274e0846e26c95222943 100644 (file)
@@ -2,15 +2,43 @@
  * Copyright (c) 2013 MundoReader S.L.
  * Author: Heiko Stuebner <heiko@sntech.de>
  *
- * 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 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.
  *
- * 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.
+ *  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/;
index 41ffd4951ef3541786a26821ec82fba1e537f69e..d32229b8a996ec480504ce976181776e662dbd48 100644 (file)
@@ -2,15 +2,43 @@
  * Copyright (c) 2013 MundoReader S.L.
  * Author: Heiko Stuebner <heiko@sntech.de>
  *
- * 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 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.
  *
- * 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.
+ *  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>
index bdf85701987d7d355746b26a9b68e323864c4f2b..42faa19edb7effaab868592b94f6a572a20acdcd 100644 (file)
@@ -1,15 +1,43 @@
 /*
  * Copyright (c) 2013 Heiko Stuebner <heiko@sntech.de>
  *
- * 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 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.
  *
- * 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.
+ *  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/;
                compatible = "active-semi,act8846";
                reg = <0x5a>;
                status = "okay";
+               system-power-controller;
 
                pinctrl-names = "default";
                pinctrl-0 = <&act8846_dvs0_ctl>;
index 1d4d79c6688df78bdb622e1f0e36e740eeb602d3..0f23aedf9349d4c2fa3a36dca3691b3792a3a566 100644 (file)
@@ -2,15 +2,43 @@
  * Copyright (c) 2013 MundoReader S.L.
  * Author: Heiko Stuebner <heiko@sntech.de>
  *
- * 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 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.
  *
- * 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.
+ *  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>
index 1687e8336994fc4bb87b5d4edfd7d66250be9626..43949a6771f08466c0431cd2e7237ea87be6076d 100644 (file)
@@ -1,13 +1,41 @@
 /*
- * 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 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.
  *
- * 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.
+ *  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/;
index f62ea78754a956d2f562a8900e3bfcf3cdba4871..18eb6cb495f45449577a872c156ccbfc14f61174 100644 (file)
@@ -1,13 +1,41 @@
 /*
- * 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 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.
  *
- * 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.
+ *  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/;
index 4a457518d8616044b26fbfa34bea17ebbd421f84..844a6fb64658b42e3b184436e0038eb1b971ce9e 100644 (file)
@@ -1,13 +1,41 @@
 /*
- * 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 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.
  *
- * 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.
+ *  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>
                regulator-always-on;
                regulator-boot-on;
        };
+
+       /*
+        * NOTE: vcc_sd isn't hooked up on v1.0 boards where power comes from
+        * vcc_io directly.  Those boards won't be able to power cycle SD cards
+        * but it shouldn't hurt to toggle this pin there anyway.
+        */
+       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>;
+       };
 };
 
 &emmc {
        pinctrl-names = "default";
        pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
        status = "okay";
+       vmmc-supply = <&vcc_sd>;
+       vqmmc-supply = <&vccio_sd>;
 };
 
 &i2c0 {
                sdmmc_cmd: sdmmc-cmd {
                        rockchip,pins = <6 21 RK_FUNC_1 &pcfg_pull_up_drv_8ma>;
                };
+
+               sdmmc_pwr: sdmmc-pwr {
+                       rockchip,pins = <7 11 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
        };
 
        usb {
index b54dd78580c1c77a01035b62d8181d0cd995b18f..0b42372e437944f2ed4ffeff249dbaabec1543a8 100644 (file)
                pinctrl-0 = <&pmic_vsel>, <&pwr_hold>;
                system-power-controller;
 
+               vp1-supply = <&vcc_sys>;
+               vp2-supply = <&vcc_sys>;
+               vp3-supply = <&vcc_sys>;
+               vp4-supply = <&vcc_sys>;
+               inl1-supply = <&vcc_sys>;
+               inl2-supply = <&vcc_sys>;
+               inl3-supply = <&vcc_20>;
+
                regulators {
                        vcc_ddr: REG1 {
                                regulator-name = "vcc_ddr";
        status = "okay";
 };
 
+&tsadc {
+       rockchip,hw-tshut-mode = <0>;
+       rockchip,hw-tshut-polarity = <0>;
+       status = "okay";
+};
+
 &uart0 {
        pinctrl-names = "default";
        pinctrl-0 = <&uart0_xfer>, <&uart0_cts>, <&uart0_rts>;
index d081f0e0da36c3c42fd97626a79d5e4df54bc300..d582811fbd7b0e6995f1eba10c0a2e8a202ae8e9 100644 (file)
        };
 };
 
+&tsadc {
+       rockchip,hw-tshut-mode = <0>;
+       rockchip,hw-tshut-polarity = <0>;
+       status = "okay";
+};
+
 &vopb {
        status = "okay";
 };
index 2695200c0af7915a1492a118b93042652715db02..34040665218627b3c2c167aa1b8faa867449a6de 100644 (file)
@@ -3,9 +3,43 @@
  *
  * Copyright (c) 2014, Fuzhou Rockchip Electronics Co., Ltd
  *
- * 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.
+ * 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/thermal/thermal.h>
index 165968d51d8fd7370ca596833c0e2126fc616970..22316d00493e5c190b5f83a78e61f8e9da90e613 100644 (file)
@@ -1,13 +1,41 @@
 /*
- * 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 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.
  *
- * 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.
+ *  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>
                spi2 = &spi2;
        };
 
+       arm-pmu {
+               compatible = "arm,cortex-a12-pmu";
+               interrupts = <GIC_SPI 151 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 152 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 153 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 154 IRQ_TYPE_LEVEL_HIGH>;
+       };
+
        cpus {
                #address-cells = <1>;
                #size-cells = <0>;
                interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>;
                clocks = <&cru HCLK_USBHOST1>;
                clock-names = "otg";
+               dr_mode = "host";
                phys = <&usbphy2>;
                phy-names = "usb2-phy";
                status = "disabled";
                interrupts = <GIC_SPI 23 IRQ_TYPE_LEVEL_HIGH>;
                clocks = <&cru HCLK_OTG0>;
                clock-names = "otg";
+               dr_mode = "otg";
+               g-np-tx-fifo-size = <16>;
+               g-rx-fifo-size = <275>;
+               g-tx-fifo-size = <256 128 128 64 64 32>;
+               g-use-dma;
                phys = <&usbphy0>;
                phy-names = "usb2-phy";
                status = "disabled";
index c54a9715dcfa376e155ad991f75f32e4b849aad8..a2ae9f32464d5e6b154636002c6cca87b2bf6614 100644 (file)
@@ -2,15 +2,43 @@
  * Copyright (c) 2013 MundoReader S.L.
  * Author: Heiko Stuebner <heiko@sntech.de>
  *
- * 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 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.
  *
- * 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.
+ *  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/interrupt-controller/irq.h>
index ea92fd69529a5be3573a07a028aad7e87e02be9c..f257926c13b775c4e76152b8335d1dec281820c4 100644 (file)
                        #clock-cells = <0>;
                };
        };
+};
 
-       serial@50000000 {
-               status = "okay";
-               pinctrl-names = "default";
-               pinctrl-0 = <&uart0_data>, <&uart0_fctl>;
-       };
+&rtc {
+       status = "okay";
+};
 
-       serial@50004000 {
-               status = "okay";
-               pinctrl-names = "default";
-               pinctrl-0 = <&uart1_data>, <&uart1_fctl>;
-       };
+&sdhci_0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&sd1_clk>, <&sd1_cmd>,
+                       <&sd1_bus1>, <&sd1_bus4>;
+       bus-width = <4>;
+       broken-cd;
+       status = "okay";
+};
 
-       serial@50008000 {
-               status = "okay";
-               pinctrl-names = "default";
-               pinctrl-0 = <&uart2_data>;
-       };
+&sdhci_1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&sd0_clk>, <&sd0_cmd>,
+                       <&sd0_bus1>, <&sd0_bus4>;
+       bus-width = <4>;
+       cd-gpios = <&gpf 1 0>;
+       cd-inverted;
+       status = "okay";
+};
 
-       serial@5000C000 {
-               status = "okay";
-               pinctrl-names = "default";
-               pinctrl-0 = <&uart3_data>;
-       };
+&uart_0 {
+       status = "okay";
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart0_data>, <&uart0_fctl>;
+};
 
-       watchdog@53000000 {
-               status = "okay";
-       };
+&uart_1 {
+       status = "okay";
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart1_data>, <&uart1_fctl>;
+};
 
-       rtc@57000000 {
-               status = "okay";
-       };
+&uart_2 {
+       status = "okay";
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart2_data>;
+};
 
-       sdhci@4AC00000 {
-               pinctrl-names = "default";
-               pinctrl-0 = <&sd0_clk>, <&sd0_cmd>,
-                               <&sd0_bus1>, <&sd0_bus4>;
-               bus-width = <4>;
-               cd-gpios = <&gpf 1 0>;
-               cd-inverted;
-               status = "okay";
-       };
+&uart_3 {
+       status = "okay";
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart3_data>;
+};
 
-       sdhci@4A800000 {
-               pinctrl-names = "default";
-               pinctrl-0 = <&sd1_clk>, <&sd1_cmd>,
-                               <&sd1_bus1>, <&sd1_bus4>;
-               bus-width = <4>;
-               broken-cd;
-               status = "okay";
-       };
+&watchdog {
+       status = "okay";
 };
index 30b8f7e47454ebdeb274303a62073226d0ba8a5a..a5184ff56933c8812eb87f48d5a9b87ba743b4d2 100644 (file)
@@ -17,7 +17,7 @@
        compatible = "samsung,s3c2416";
 
        aliases {
-               serial3 = &uart3;
+               serial3 = &uart_3;
        };
 
        cpus {
@@ -48,7 +48,7 @@
                clock-names = "timers";
        };
 
-       serial@50000000 {
+       uart_0: serial@50000000 {
                compatible = "samsung,s3c2440-uart";
                clock-names = "uart", "clk_uart_baud2",
                                "clk_uart_baud3";
@@ -56,7 +56,7 @@
                                <&clocks SCLK_UART>;
        };
 
-       serial@50004000 {
+       uart_1: serial@50004000 {
                compatible = "samsung,s3c2440-uart";
                clock-names = "uart", "clk_uart_baud2",
                                "clk_uart_baud3";
@@ -64,7 +64,7 @@
                                <&clocks SCLK_UART>;
        };
 
-       serial@50008000 {
+       uart_2: serial@50008000 {
                compatible = "samsung,s3c2440-uart";
                clock-names = "uart", "clk_uart_baud2",
                                "clk_uart_baud3";
@@ -72,7 +72,7 @@
                                <&clocks SCLK_UART>;
        };
 
-       uart3: serial@5000C000 {
+       uart_3: serial@5000C000 {
                compatible = "samsung,s3c2440-uart";
                reg = <0x5000C000 0x4000>;
                interrupts = <1 18 24 4>, <1 18 25 4>;
@@ -83,7 +83,7 @@
                status = "disabled";
        };
 
-       sdhci@4AC00000 {
+       sdhci_1: sdhci@4AC00000 {
                compatible = "samsung,s3c6410-sdhci";
                reg = <0x4AC00000 0x100>;
                interrupts = <0 0 21 3>;
@@ -94,7 +94,7 @@
                status = "disabled";
        };
 
-       sdhci@4A800000 {
+       sdhci_0: sdhci@4A800000 {
                compatible = "samsung,s3c6410-sdhci";
                reg = <0x4A800000 0x100>;
                interrupts = <0 0 20 3>;
                status = "disabled";
        };
 
-       watchdog@53000000 {
+       watchdog: watchdog@53000000 {
                interrupts = <1 9 27 3>;
                clocks = <&clocks PCLK_WDT>;
                clock-names = "watchdog";
        };
 
-       rtc@57000000 {
+       rtc: rtc@57000000 {
                compatible = "samsung,s3c2416-rtc";
                clocks = <&clocks PCLK_RTC>;
                clock-names = "rtc";
index 57ab8587f7b977d4274dfdf2380d9f363f5a06ff..5ab7548e04e1f459eb7105e5808bcc3e54f938b1 100644 (file)
                        compatible = "atmel,at91rm9200-ohci", "usb-ohci";
                        reg = <0x00600000 0x100000>;
                        interrupts = <32 IRQ_TYPE_LEVEL_HIGH 2>;
-                       clocks = <&usb>, <&uhphs_clk>, <&uhphs_clk>,
-                                <&uhpck>;
-                       clock-names = "usb_clk", "ohci_clk", "hclk", "uhpck";
+                       clocks = <&uhphs_clk>, <&uhphs_clk>, <&uhpck>;
+                       clock-names = "ohci_clk", "hclk", "uhpck";
                        status = "disabled";
                };
 
                        compatible = "atmel,at91sam9g45-ehci", "usb-ehci";
                        reg = <0x00700000 0x100000>;
                        interrupts = <32 IRQ_TYPE_LEVEL_HIGH 2>;
-                       clocks = <&utmi>, <&uhphs_clk>, <&uhpck>;
-                       clock-names = "usb_clk", "ehci_clk", "uhpck";
+                       clocks = <&utmi>, <&uhphs_clk>;
+                       clock-names = "usb_clk", "ehci_clk";
                        status = "disabled";
                };
 
                                #address-cells = <1>;
                                #size-cells = <1>;
                                reg = <
-                                       0x70000000 0x10000000   /* NFC Command Registers */
+                                       0x70000000 0x08000000   /* NFC Command Registers */
                                        0xffffc000 0x00000070   /* NFC HSMC regs */
                                        0x00200000 0x00100000   /* NFC SRAM banks */
                                        >;
index 7d6babdab03911aa089d08946df6f9e66e9bd590..2cf9c3611db60a5f6566be6898adab72e8a629d2 100644 (file)
@@ -11,7 +11,8 @@
        compatible = "atmel,sama5d3xcm", "atmel,sama5d3", "atmel,sama5";
 
        chosen {
-               bootargs = "console=ttyS0,115200 rootfstype=ubifs ubi.mtd=5 root=ubi0:rootfs";
+               bootargs = "rootfstype=ubifs ubi.mtd=5 root=ubi0:rootfs";
+               stdout-path = "serial0:115200n8";
        };
 
        memory {
                                        rxd3-skew-ps = <400>;
                                };
                        };
-
-                       pmc: pmc@fffffc00 {
-                               main: mainck {
-                                       clock-frequency = <12000000>;
-                               };
-                       };
                };
 
                nand0: nand@60000000 {
index 6b1bb58f9c0b609fdb3622a02c89d2d394750c81..653a1f851f2b8f5bf641cb586ede4f0841105c6b 100644 (file)
                serial0 = &usart3;
                serial1 = &usart4;
                serial2 = &usart2;
+               serial3 = &usart0;
+               serial4 = &usart1;
+               serial5 = &uart0;
+               serial6 = &uart1;
                gpio0 = &pioA;
                gpio1 = &pioB;
                gpio2 = &pioC;
                        compatible = "atmel,at91rm9200-ohci", "usb-ohci";
                        reg = <0x00500000 0x100000>;
                        interrupts = <46 IRQ_TYPE_LEVEL_HIGH 2>;
-                       clocks = <&usb>, <&uhphs_clk>, <&uhphs_clk>,
-                                <&uhpck>;
-                       clock-names = "usb_clk", "ohci_clk", "hclk", "uhpck";
+                       clocks = <&uhphs_clk>, <&uhphs_clk>, <&uhpck>;
+                       clock-names = "ohci_clk", "hclk", "uhpck";
                        status = "disabled";
                };
 
                        compatible = "atmel,at91sam9g45-ehci", "usb-ehci";
                        reg = <0x00600000 0x100000>;
                        interrupts = <46 IRQ_TYPE_LEVEL_HIGH 2>;
-                       clocks = <&utmi>, <&uhphs_clk>, <&uhpck>;
-                       clock-names = "usb_clk", "ehci_clk", "uhpck";
+                       clocks = <&utmi>, <&uhphs_clk>;
+                       clock-names = "usb_clk", "ehci_clk";
                        status = "disabled";
                };
 
                                #address-cells = <1>;
                                #size-cells = <1>;
                                reg = <
-                                       0x90000000 0x10000000   /* NFC Command Registers */
+                                       0x90000000 0x08000000   /* NFC Command Registers */
                                        0xfc05c000 0x00000070   /* NFC HSMC regs */
                                        0x00100000 0x00100000   /* NFC SRAM banks */
                                          >;
                                clock-names = "mci_clk";
                        };
 
+                       uart0: serial@f8004000 {
+                               compatible = "atmel,at91sam9260-usart";
+                               reg = <0xf8004000 0x100>;
+                               interrupts = <27 IRQ_TYPE_LEVEL_HIGH 5>;
+                               dmas = <&dma1
+                                       (AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1)
+                                       | AT91_XDMAC_DT_PERID(22))>,
+                                      <&dma1
+                                       (AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1)
+                                       | AT91_XDMAC_DT_PERID(23))>;
+                               dma-names = "tx", "rx";
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&pinctrl_uart0>;
+                               clocks = <&uart0_clk>;
+                               clock-names = "usart";
+                               status = "disabled";
+                       };
+
                        ssc0: ssc@f8008000 {
                                compatible = "atmel,at91sam9g45-ssc";
                                reg = <0xf8008000 0x4000>;
                                reg = <0xf8028000 0x60>;
                        };
 
+                       usart0: serial@f802c000 {
+                               compatible = "atmel,at91sam9260-usart";
+                               reg = <0xf802c000 0x100>;
+                               interrupts = <6 IRQ_TYPE_LEVEL_HIGH 5>;
+                               dmas = <&dma0
+                                       (AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1)
+                                       | AT91_XDMAC_DT_PERID(36))>,
+                                      <&dma0
+                                       (AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1)
+                                       | AT91_XDMAC_DT_PERID(37))>;
+                               dma-names = "tx", "rx";
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&pinctrl_usart0 &pinctrl_usart0_rts &pinctrl_usart0_cts>;
+                               clocks = <&usart0_clk>;
+                               clock-names = "usart";
+                               status = "disabled";
+                       };
+
+                       usart1: serial@f8030000 {
+                               compatible = "atmel,at91sam9260-usart";
+                               reg = <0xf8030000 0x100>;
+                               interrupts = <7 IRQ_TYPE_LEVEL_HIGH 5>;
+                               dmas = <&dma0
+                                       (AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1)
+                                       | AT91_XDMAC_DT_PERID(38))>,
+                                      <&dma0
+                                       (AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1)
+                                       | AT91_XDMAC_DT_PERID(39))>;
+                               dma-names = "tx", "rx";
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&pinctrl_usart1 &pinctrl_usart1_rts &pinctrl_usart1_cts>;
+                               clocks = <&usart1_clk>;
+                               clock-names = "usart";
+                               status = "disabled";
+                       };
+
                        mmc1: mmc@fc000000 {
                                compatible = "atmel,hsmci";
                                reg = <0xfc000000 0x600>;
                                clock-names = "mci_clk";
                        };
 
+                       uart1: serial@fc004000 {
+                               compatible = "atmel,at91sam9260-usart";
+                               reg = <0xfc004000 0x100>;
+                               interrupts = <28 IRQ_TYPE_LEVEL_HIGH 5>;
+                               dmas = <&dma1
+                                       (AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1)
+                                       | AT91_XDMAC_DT_PERID(24))>,
+                                      <&dma1
+                                       (AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1)
+                                       | AT91_XDMAC_DT_PERID(25))>;
+                               dma-names = "tx", "rx";
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&pinctrl_uart1>;
+                               clocks = <&uart1_clk>;
+                               clock-names = "usart";
+                               status = "disabled";
+                       };
+
                        usart2: serial@fc008000 {
                                compatible = "atmel,at91sam9260-usart";
                                reg = <0xfc008000 0x100>;
                                status = "disabled";
                        };
 
+                       spi1: spi@fc018000 {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               compatible = "atmel,at91rm9200-spi";
+                               reg = <0xfc018000 0x100>;
+                               interrupts = <38 IRQ_TYPE_LEVEL_HIGH 3>;
+                               dmas = <&dma1
+                                       (AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1)
+                                       | AT91_XDMAC_DT_PERID(12))>,
+                                      <&dma1
+                                       (AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1)
+                                       | AT91_XDMAC_DT_PERID(13))>;
+                               dma-names = "tx", "rx";
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&pinctrl_spi1>;
+                               clocks = <&spi1_clk>;
+                               clock-names = "spi_clk";
+                               status = "disabled";
+                       };
+
+                       spi2: spi@fc01c000 {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               compatible = "atmel,at91rm9200-spi";
+                               reg = <0xfc01c000 0x100>;
+                               interrupts = <39 IRQ_TYPE_LEVEL_HIGH 3>;
+                               dmas = <&dma1
+                                       (AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1)
+                                       | AT91_XDMAC_DT_PERID(14))>,
+                                      <&dma1
+                                       (AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1)
+                                       | AT91_XDMAC_DT_PERID(15))>;
+                               dma-names = "tx", "rx";
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&pinctrl_spi2>;
+                               clocks = <&spi2_clk>;
+                               clock-names = "spi_clk";
+                               status = "disabled";
+                       };
+
                        tcb1: timer@fc020000 {
                                compatible = "atmel,at91sam9x5-tcb";
                                reg = <0xfc020000 0x100>;
                                compatible = "atmel,at91sam9g46-aes";
                                reg = <0xfc044000 0x100>;
                                interrupts = <12 IRQ_TYPE_LEVEL_HIGH 0>;
-                               dmas = <&dma0 (AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1))
-                                       AT91_XDMAC_DT_PERID(41)>,
-                                      <&dma0 (AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1))
-                                       AT91_XDMAC_DT_PERID(40)>;
+                               dmas = <&dma0 (AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1)
+                                       | AT91_XDMAC_DT_PERID(41))>,
+                                      <&dma0 (AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1)
+                                       | AT91_XDMAC_DT_PERID(40))>;
                                dma-names = "tx", "rx";
                                clocks = <&aes_clk>;
                                clock-names = "aes_clk";
                                compatible = "atmel,at91sam9g46-tdes";
                                reg = <0xfc04c000 0x100>;
                                interrupts = <14 IRQ_TYPE_LEVEL_HIGH 0>;
-                               dmas = <&dma0 (AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1))
-                                       AT91_XDMAC_DT_PERID(42)>,
-                                      <&dma0 (AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1))
-                                       AT91_XDMAC_DT_PERID(43)>;
+                               dmas = <&dma0 (AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1)
+                                       | AT91_XDMAC_DT_PERID(42))>,
+                                      <&dma0 (AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1)
+                                       | AT91_XDMAC_DT_PERID(43))>;
                                dma-names = "tx", "rx";
                                clocks = <&tdes_clk>;
                                clock-names = "tdes_clk";
                                compatible = "atmel,at91sam9g46-sha";
                                reg = <0xfc050000 0x100>;
                                interrupts = <15 IRQ_TYPE_LEVEL_HIGH 0>;
-                               dmas = <&dma0 (AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1))
-                                       AT91_XDMAC_DT_PERID(44)>;
+                               dmas = <&dma0 (AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1)
+                                       | AT91_XDMAC_DT_PERID(44))>;
                                dma-names = "tx";
                                clocks = <&sha_clk>;
                                clock-names = "sha_clk";
                                #address-cells = <1>;
                                #size-cells = <1>;
                                compatible = "atmel,at91sam9x5-pinctrl", "atmel,at91rm9200-pinctrl", "simple-bus";
-                               ranges = <0xfc06a000 0xfc06a000 0x4000>;
+                               ranges = <0xfc068000 0xfc068000 0x100
+                                         0xfc06a000 0xfc06a000 0x4000>;
                                /* WARNING: revisit as pin spec has changed */
                                atmel,mux-mask = <
                                        /*   A          B          C  */
                                        };
                                };
 
+                               spi1 {
+                                       pinctrl_spi1: spi1-0 {
+                                               atmel,pins =
+                                                       <AT91_PIOB 18 AT91_PERIPH_A AT91_PINCTRL_NONE   /* SPI1_MISO */
+                                                        AT91_PIOB 19 AT91_PERIPH_A AT91_PINCTRL_NONE   /* SPI1_MOSI */
+                                                        AT91_PIOB 20 AT91_PERIPH_A AT91_PINCTRL_NONE   /* SPI1_SPCK */
+                                                       >;
+                                       };
+                               };
+
+                               spi2 {
+                                       pinctrl_spi2: spi2-0 {
+                                               atmel,pins =
+                                                       <AT91_PIOD 11 AT91_PERIPH_B AT91_PINCTRL_NONE   /* SPI2_MISO conflicts with RTS0 */
+                                                        AT91_PIOD 13 AT91_PERIPH_B AT91_PINCTRL_NONE   /* SPI2_MOSI conflicts with TXD0 */
+                                                        AT91_PIOD 15 AT91_PERIPH_B AT91_PINCTRL_NONE   /* SPI2_SPCK conflicts with RTS1 */
+                                                       >;
+                                       };
+                               };
+
+                               uart0 {
+                                       pinctrl_uart0: uart0-0 {
+                                               atmel,pins =
+                                                       <AT91_PIOE 29 AT91_PERIPH_B AT91_PINCTRL_NONE           /* RXD */
+                                                        AT91_PIOE 30 AT91_PERIPH_B AT91_PINCTRL_PULL_UP        /* TXD */
+                                                       >;
+                                       };
+                               };
+
+                               uart1 {
+                                       pinctrl_uart1: uart1-0 {
+                                               atmel,pins =
+                                                       <AT91_PIOC 25 AT91_PERIPH_C AT91_PINCTRL_NONE           /* RXD */
+                                                        AT91_PIOC 26 AT91_PERIPH_C AT91_PINCTRL_PULL_UP        /* TXD */
+                                                       >;
+                                       };
+                               };
+
+                               usart0 {
+                                       pinctrl_usart0: usart0-0 {
+                                               atmel,pins =
+                                                       <AT91_PIOD 12 AT91_PERIPH_A AT91_PINCTRL_NONE           /* RXD */
+                                                        AT91_PIOD 13 AT91_PERIPH_A AT91_PINCTRL_PULL_UP        /* TXD */
+                                                       >;
+                                       };
+                                       pinctrl_usart0_rts: usart0_rts-0 {
+                                               atmel,pins = <AT91_PIOD 11 AT91_PERIPH_A AT91_PINCTRL_NONE>;
+                                       };
+                                       pinctrl_usart0_cts: usart0_cts-0 {
+                                               atmel,pins = <AT91_PIOD 10 AT91_PERIPH_A AT91_PINCTRL_NONE>;
+                                       };
+                               };
+
+                               usart1 {
+                                       pinctrl_usart1: usart1-0 {
+                                               atmel,pins =
+                                                       <AT91_PIOD 16 AT91_PERIPH_A AT91_PINCTRL_NONE           /* RXD */
+                                                        AT91_PIOD 17 AT91_PERIPH_A AT91_PINCTRL_PULL_UP        /* TXD */
+                                                       >;
+                                       };
+                                       pinctrl_usart1_rts: usart1_rts-0 {
+                                               atmel,pins = <AT91_PIOD 15 AT91_PERIPH_A AT91_PINCTRL_NONE>;
+                                       };
+                                       pinctrl_usart1_cts: usart1_cts-0 {
+                                               atmel,pins = <AT91_PIOD 14 AT91_PERIPH_A AT91_PINCTRL_NONE>;
+                                       };
+                               };
+
                                usart2 {
                                        pinctrl_usart2: usart2-0 {
                                                atmel,pins =
index 022ba505f57339a959d8208732eeb75e585911d4..24b4cd24dceb2f9eca1df72cf2138e9db0e85dbf 100644 (file)
                        gpios = <&pcf8575 14 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_HOME>;
                        label = "SW1";
+                       gpio-key,wakeup;
                };
        };
 
index 45b539ce4d3520356d45470f3bdfeb5f8020ce30..11e17c5f26e2cae27f7f120b2cf6854e61892e76 100644 (file)
@@ -90,7 +90,7 @@
                status = "disabled";
        };
 
-       irqpin0: irqpin@e6900000 {
+       irqpin0: interrupt-controller@e6900000 {
                compatible = "renesas,intc-irqpin-sh73a0", "renesas,intc-irqpin";
                #interrupt-cells = <2>;
                interrupt-controller;
                control-parent;
        };
 
-       irqpin1: irqpin@e6900004 {
+       irqpin1: interrupt-controller@e6900004 {
                compatible = "renesas,intc-irqpin-sh73a0", "renesas,intc-irqpin";
                #interrupt-cells = <2>;
                interrupt-controller;
                control-parent;
        };
 
-       irqpin2: irqpin@e6900008 {
+       irqpin2: interrupt-controller@e6900008 {
                compatible = "renesas,intc-irqpin-sh73a0", "renesas,intc-irqpin";
                #interrupt-cells = <2>;
                interrupt-controller;
                control-parent;
        };
 
-       irqpin3: irqpin@e690000c {
+       irqpin3: interrupt-controller@e690000c {
                compatible = "renesas,intc-irqpin-sh73a0", "renesas,intc-irqpin";
                #interrupt-cells = <2>;
                interrupt-controller;
                status = "disabled";
        };
 
-       scifb8: serial@e6c30000 {
+       scifb: serial@e6c30000 {
                compatible = "renesas,scifb-sh73a0", "renesas,scifb";
                reg = <0xe6c30000 0x100>;
                interrupts = <0 80 IRQ_TYPE_LEVEL_HIGH>;
index d9176e6061731b7c42ee792338fab3509482c603..80f924deed37457409fff03e7924894ead9e4601 100644 (file)
@@ -36,6 +36,7 @@
        cpus {
                #address-cells = <1>;
                #size-cells = <0>;
+               enable-method = "altr,socfpga-smp";
 
                cpu@0 {
                        compatible = "arm,cortex-a9";
                                                clk-phase = <0 135>;
                                        };
 
+                                       sdmmc_clk_divided: sdmmc_clk_divided {
+                                               #clock-cells = <0>;
+                                               compatible = "altr,socfpga-gate-clk";
+                                               clocks = <&sdmmc_clk>;
+                                               clk-gate = <0xa0 8>;
+                                               fixed-divider = <4>;
+                                       };
+
                                        nand_x_clk: nand_x_clk {
                                                #clock-cells = <0>;
                                                compatible = "altr,socfpga-gate-clk";
                        reset-names = "stmmaceth";
                        snps,multicast-filter-bins = <256>;
                        snps,perfect-filter-entries = <128>;
+                       tx-fifo-depth = <4096>;
+                       rx-fifo-depth = <4096>;
                        status = "disabled";
                };
 
                        reset-names = "stmmaceth";
                        snps,multicast-filter-bins = <256>;
                        snps,perfect-filter-entries = <128>;
+                       tx-fifo-depth = <4096>;
+                       rx-fifo-depth = <4096>;
                        status = "disabled";
                };
 
                        fifo-depth = <0x400>;
                        #address-cells = <1>;
                        #size-cells = <0>;
-                       clocks = <&l4_mp_clk>, <&sdmmc_clk>;
+                       clocks = <&l4_mp_clk>, <&sdmmc_clk_divided>;
                        clock-names = "biu", "ciu";
                };
 
                        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>;
index 8a05c47fd57f3a392c187c42da1eac7b71e636a2..f5bebdd6d1becda319ae02bfff4d36301abeca61 100644 (file)
        #address-cells = <1>;
        #size-cells = <1>;
 
-       aliases {
-               ethernet0 = &gmac0;
-               ethernet1 = &gmac1;
-               ethernet2 = &gmac2;
-               serial0 = &uart0;
-               serial1 = &uart1;
-               timer0 = &timer0;
-               timer1 = &timer1;
-               timer2 = &timer2;
-               timer3 = &timer3;
-       };
-
        cpus {
                #address-cells = <1>;
                #size-cells = <0>;
+               enable-method = "altr,socfpga-a10-smp";
 
                cpu@0 {
                        compatible = "arm,cortex-a9";
                                        #address-cells = <1>;
                                        #size-cells = <0>;
 
+                                       cb_intosc_hs_div2_clk: cb_intosc_hs_div2_clk {
+                                               #clock-cells = <0>;
+                                               compatible = "fixed-clock";
+                                       };
+
+                                       cb_intosc_ls_clk: cb_intosc_ls_clk {
+                                               #clock-cells = <0>;
+                                               compatible = "fixed-clock";
+                                       };
+
+                                       f2s_free_clk: f2s_free_clk {
+                                               #clock-cells = <0>;
+                                               compatible = "fixed-clock";
+                                       };
+
                                        osc1: osc1 {
                                                #clock-cells = <0>;
                                                compatible = "fixed-clock";
                                                #address-cells = <1>;
                                                #size-cells = <0>;
                                                #clock-cells = <0>;
-                                               compatible = "altr,socfpga-pll-clock";
-                                               clocks = <&osc1>;
+                                               compatible = "altr,socfpga-a10-pll-clock";
+                                               clocks = <&osc1>, <&cb_intosc_ls_clk>,
+                                                        <&f2s_free_clk>;
+                                               reg = <0x40>;
+
+                                               main_mpu_base_clk: main_mpu_base_clk {
+                                                       #clock-cells = <0>;
+                                                       compatible = "altr,socfpga-a10-perip-clk";
+                                                       clocks = <&main_pll>;
+                                                       div-reg = <0x140 0 11>;
+                                               };
+
+                                               main_noc_base_clk: main_noc_base_clk {
+                                                       #clock-cells = <0>;
+                                                       compatible = "altr,socfpga-a10-perip-clk";
+                                                       clocks = <&main_pll>;
+                                                       div-reg = <0x144 0 11>;
+                                               };
+
+                                               main_emaca_clk: main_emaca_clk {
+                                                       #clock-cells = <0>;
+                                                       compatible = "altr,socfpga-a10-perip-clk";
+                                                       clocks = <&main_pll>;
+                                                       reg = <0x68>;
+                                               };
+
+                                               main_emacb_clk: main_emacb_clk {
+                                                       #clock-cells = <0>;
+                                                       compatible = "altr,socfpga-a10-perip-clk";
+                                                       clocks = <&main_pll>;
+                                                       reg = <0x6C>;
+                                               };
+
+                                               main_emac_ptp_clk: main_emac_ptp_clk {
+                                                       #clock-cells = <0>;
+                                                       compatible = "altr,socfpga-a10-perip-clk";
+                                                       clocks = <&main_pll>;
+                                                       reg = <0x70>;
+                                               };
+
+                                               main_gpio_db_clk: main_gpio_db_clk {
+                                                       #clock-cells = <0>;
+                                                       compatible = "altr,socfpga-a10-perip-clk";
+                                                       clocks = <&main_pll>;
+                                                       reg = <0x74>;
+                                               };
+
+                                               main_sdmmc_clk: main_sdmmc_clk {
+                                                       #clock-cells = <0>;
+                                                       compatible = "altr,socfpga-a10-perip-clk"
+;
+                                                       clocks = <&main_pll>;
+                                                       reg = <0x78>;
+                                               };
+
+                                               main_s2f_usr0_clk: main_s2f_usr0_clk {
+                                                       #clock-cells = <0>;
+                                                       compatible = "altr,socfpga-a10-perip-clk";
+                                                       clocks = <&main_pll>;
+                                                       reg = <0x7C>;
+                                               };
+
+                                               main_s2f_usr1_clk: main_s2f_usr1_clk {
+                                                       #clock-cells = <0>;
+                                                       compatible = "altr,socfpga-a10-perip-clk";
+                                                       clocks = <&main_pll>;
+                                                       reg = <0x80>;
+                                               };
+
+                                               main_hmc_pll_ref_clk: main_hmc_pll_ref_clk {
+                                                       #clock-cells = <0>;
+                                                       compatible = "altr,socfpga-a10-perip-clk";
+                                                       clocks = <&main_pll>;
+                                                       reg = <0x84>;
+                                               };
+
+                                               main_periph_ref_clk: main_periph_ref_clk {
+                                                       #clock-cells = <0>;
+                                                       compatible = "altr,socfpga-a10-perip-clk";
+                                                       clocks = <&main_pll>;
+                                                       reg = <0x9C>;
+                                               };
                                        };
 
                                        periph_pll: periph_pll {
                                                #address-cells = <1>;
                                                #size-cells = <0>;
                                                #clock-cells = <0>;
-                                               compatible = "altr,socfpga-pll-clock";
-                                               clocks = <&osc1>;
+                                               compatible = "altr,socfpga-a10-pll-clock";
+                                               clocks = <&osc1>, <&cb_intosc_ls_clk>,
+                                                        <&f2s_free_clk>, <&main_periph_ref_clk>;
+                                               reg = <0xC0>;
+
+                                               peri_mpu_base_clk: peri_mpu_base_clk {
+                                                       #clock-cells = <0>;
+                                                       compatible = "altr,socfpga-a10-perip-clk";
+                                                       clocks = <&periph_pll>;
+                                                       div-reg = <0x140 16 11>;
+                                               };
+
+                                               peri_noc_base_clk: peri_noc_base_clk {
+                                                       #clock-cells = <0>;
+                                                       compatible = "altr,socfpga-a10-perip-clk";
+                                                       clocks = <&periph_pll>;
+                                                       div-reg = <0x144 16 11>;
+                                               };
+
+                                               peri_emaca_clk: peri_emaca_clk {
+                                                       #clock-cells = <0>;
+                                                       compatible = "altr,socfpga-a10-perip-clk";
+                                                       clocks = <&periph_pll>;
+                                                       reg = <0xE8>;
+                                               };
+
+                                               peri_emacb_clk: peri_emacb_clk {
+                                                       #clock-cells = <0>;
+                                                       compatible = "altr,socfpga-a10-perip-clk";
+                                                       clocks = <&periph_pll>;
+                                                       reg = <0xEC>;
+                                               };
+
+                                               peri_emac_ptp_clk: peri_emac_ptp_clk {
+                                                       #clock-cells = <0>;
+                                                       compatible = "altr,socfpga-a10-perip-clk";
+                                                       clocks = <&periph_pll>;
+                                                       reg = <0xF0>;
+                                               };
+
+                                               peri_gpio_db_clk: peri_gpio_db_clk {
+                                                       #clock-cells = <0>;
+                                                       compatible = "altr,socfpga-a10-perip-clk";
+                                                       clocks = <&periph_pll>;
+                                                       reg = <0xF4>;
+                                               };
+
+                                               peri_sdmmc_clk: peri_sdmmc_clk {
+                                                       #clock-cells = <0>;
+                                                       compatible = "altr,socfpga-a10-perip-clk";
+                                                       clocks = <&periph_pll>;
+                                                       reg = <0xF8>;
+                                               };
+
+                                               peri_s2f_usr0_clk: peri_s2f_usr0_clk {
+                                                       #clock-cells = <0>;
+                                                       compatible = "altr,socfpga-a10-perip-clk";
+                                                       clocks = <&periph_pll>;
+                                                       reg = <0xFC>;
+                                               };
+
+                                               peri_s2f_usr1_clk: peri_s2f_usr1_clk {
+                                                       #clock-cells = <0>;
+                                                       compatible = "altr,socfpga-a10-perip-clk";
+                                                       clocks = <&periph_pll>;
+                                                       reg = <0x100>;
+                                               };
+
+                                               peri_hmc_pll_ref_clk: peri_hmc_pll_ref_clk {
+                                                       #clock-cells = <0>;
+                                                       compatible = "altr,socfpga-a10-perip-clk";
+                                                       clocks = <&periph_pll>;
+                                                       reg = <0x104>;
+                                               };
+                                       };
+
+                                       mpu_free_clk: mpu_free_clk {
+                                               #clock-cells = <0>;
+                                               compatible = "altr,socfpga-a10-perip-clk";
+                                               clocks = <&main_mpu_base_clk>, <&peri_mpu_base_clk>,
+                                                        <&osc1>, <&cb_intosc_hs_div2_clk>,
+                                                        <&f2s_free_clk>;
+                                               reg = <0x60>;
+                                       };
+
+                                       noc_free_clk: noc_free_clk {
+                                               #clock-cells = <0>;
+                                               compatible = "altr,socfpga-a10-perip-clk";
+                                               clocks = <&main_noc_base_clk>, <&peri_noc_base_clk>,
+                                                        <&osc1>, <&cb_intosc_hs_div2_clk>,
+                                                        <&f2s_free_clk>;
+                                               reg = <0x64>;
+                                       };
+
+                                       s2f_user1_free_clk: s2f_user1_free_clk {
+                                               #clock-cells = <0>;
+                                               compatible = "altr,socfpga-a10-perip-clk";
+                                               clocks = <&main_s2f_usr1_clk>, <&peri_s2f_usr1_clk>,
+                                                        <&osc1>, <&cb_intosc_hs_div2_clk>,
+                                                        <&f2s_free_clk>;
+                                               reg = <0x104>;
+                                       };
+
+                                       sdmmc_free_clk: sdmmc_free_clk {
+                                               #clock-cells = <0>;
+                                               compatible = "altr,socfpga-a10-perip-clk";
+                                               clocks = <&main_sdmmc_clk>, <&peri_sdmmc_clk>,
+                                                        <&osc1>, <&cb_intosc_hs_div2_clk>,
+                                                        <&f2s_free_clk>;
+                                               fixed-divider = <4>;
+                                               reg = <0xF8>;
+                                       };
+
+                                       l4_sys_free_clk: l4_sys_free_clk {
+                                               #clock-cells = <0>;
+                                               compatible = "altr,socfpga-a10-perip-clk";
+                                               clocks = <&noc_free_clk>;
+                                               fixed-divider = <4>;
+                                       };
+
+                                       l4_main_clk: l4_main_clk {
+                                               #clock-cells = <0>;
+                                               compatible = "altr,socfpga-a10-gate-clk";
+                                               clocks = <&noc_free_clk>;
+                                               div-reg = <0xA8 0 2>;
+                                               clk-gate = <0x48 1>;
+                                       };
+
+                                       l4_mp_clk: l4_mp_clk {
+                                               #clock-cells = <0>;
+                                               compatible = "altr,socfpga-a10-gate-clk";
+                                               clocks = <&noc_free_clk>;
+                                               div-reg = <0xA8 8 2>;
+                                               clk-gate = <0x48 2>;
+                                       };
+
+                                       l4_sp_clk: l4_sp_clk {
+                                               #clock-cells = <0>;
+                                               compatible = "altr,socfpga-a10-gate-clk";
+                                               clocks = <&noc_free_clk>;
+                                               div-reg = <0xA8 16 2>;
+                                               clk-gate = <0x48 3>;
+                                       };
+
+                                       mpu_periph_clk: mpu_periph_clk {
+                                               #clock-cells = <0>;
+                                               compatible = "altr,socfpga-a10-gate-clk";
+                                               clocks = <&mpu_free_clk>;
+                                               fixed-divider = <4>;
+                                               clk-gate = <0x48 0>;
+                                       };
+
+                                       sdmmc_clk: sdmmc_clk {
+                                               #clock-cells = <0>;
+                                               compatible = "altr,socfpga-a10-gate-clk";
+                                               clocks = <&sdmmc_free_clk>;
+                                               clk-gate = <0xC8 5>;
+                                       };
+
+                                       qspi_clk: qspi_clk {
+                                               #clock-cells = <0>;
+                                               compatible = "altr,socfpga-a10-gate-clk";
+                                               clocks = <&l4_main_clk>;
+                                               clk-gate = <0xC8 11>;
+                                       };
+
+                                       nand_clk: nand_clk {
+                                               #clock-cells = <0>;
+                                               compatible = "altr,socfpga-a10-gate-clk";
+                                               clocks = <&l4_mp_clk>;
+                                               clk-gate = <0xC8 10>;
+                                       };
+
+                                       spi_m_clk: spi_m_clk {
+                                               #clock-cells = <0>;
+                                               compatible = "altr,socfpga-a10-gate-clk";
+                                               clocks = <&l4_main_clk>;
+                                               clk-gate = <0xC8 9>;
+                                       };
+
+                                       usb_clk: usb_clk {
+                                               #clock-cells = <0>;
+                                               compatible = "altr,socfpga-a10-gate-clk";
+                                               clocks = <&l4_mp_clk>;
+                                               clk-gate = <0xC8 8>;
+                                       };
+
+                                       s2f_usr1_clk: s2f_usr1_clk {
+                                               #clock-cells = <0>;
+                                               compatible = "altr,socfpga-a10-gate-clk";
+                                               clocks = <&peri_s2f_usr1_clk>;
+                                               clk-gate = <0xC8 6>;
                                        };
                                };
                };
 
                gmac0: ethernet@ff800000 {
                        compatible = "altr,socfpga-stmmac", "snps,dwmac-3.72a", "snps,dwmac";
+                       altr,sysmgr-syscon = <&sysmgr 0x44 0>;
                        reg = <0xff800000 0x2000>;
                        interrupts = <0 92 IRQ_TYPE_LEVEL_HIGH>;
                        interrupt-names = "macirq";
                        /* Filled in by bootloader */
                        mac-address = [00 00 00 00 00 00];
+                       snps,multicast-filter-bins = <256>;
+                       snps,perfect-filter-entries = <128>;
+                       tx-fifo-depth = <4096>;
+                       rx-fifo-depth = <16384>;
+                       clocks = <&l4_mp_clk>;
+                       clock-names = "stmmaceth";
                        status = "disabled";
                };
 
                gmac1: ethernet@ff802000 {
                        compatible = "altr,socfpga-stmmac", "snps,dwmac-3.72a", "snps,dwmac";
+                       altr,sysmgr-syscon = <&sysmgr 0x48 0>;
                        reg = <0xff802000 0x2000>;
                        interrupts = <0 93 IRQ_TYPE_LEVEL_HIGH>;
                        interrupt-names = "macirq";
                        /* Filled in by bootloader */
                        mac-address = [00 00 00 00 00 00];
+                       snps,multicast-filter-bins = <256>;
+                       snps,perfect-filter-entries = <128>;
+                       tx-fifo-depth = <4096>;
+                       rx-fifo-depth = <16384>;
+                       clocks = <&l4_mp_clk>;
+                       clock-names = "stmmaceth";
                        status = "disabled";
                };
 
                gmac2: ethernet@ff804000 {
                        compatible = "altr,socfpga-stmmac", "snps,dwmac-3.72a", "snps,dwmac";
+                       altr,sysmgr-syscon = <&sysmgr 0x4C 0>;
                        reg = <0xff804000 0x2000>;
                        interrupts = <0 94 IRQ_TYPE_LEVEL_HIGH>;
                        interrupt-names = "macirq";
                        /* Filled in by bootloader */
                        mac-address = [00 00 00 00 00 00];
+                       snps,multicast-filter-bins = <256>;
+                       snps,perfect-filter-entries = <128>;
+                       tx-fifo-depth = <4096>;
+                       rx-fifo-depth = <16384>;
+                       clocks = <&l4_mp_clk>;
+                       clock-names = "stmmaceth";
                        status = "disabled";
                };
 
                        reg = <0xff808000 0x1000>;
                        interrupts = <0 98 IRQ_TYPE_LEVEL_HIGH>;
                        fifo-depth = <0x400>;
+                       clocks = <&l4_mp_clk>, <&sdmmc_free_clk>;
+                       clock-names = "biu", "ciu";
+                       status = "disabled";
                };
 
                ocram: sram@ffe00000 {
                        reg = <0xffd05000 0x100>;
                };
 
+               scu: snoop-control-unit@ffffc000 {
+                       compatible = "arm,cortex-a9-scu";
+                       reg = <0xffffc000 0x100>;
+               };
+
                sysmgr: sysmgr@ffd06000 {
                        compatible = "altr,sys-mgr", "syscon";
                        reg = <0xffd06000 0x300>;
+                       cpu1-start-addr = <0xffd06230>;
                };
 
                /* Local timer */
                        compatible = "arm,cortex-a9-twd-timer";
                        reg = <0xffffc600 0x100>;
                        interrupts = <1 13 0xf04>;
+                       clocks = <&mpu_periph_clk>;
                };
 
                timer0: timer0@ffc02700 {
                        compatible = "snps,dw-apb-timer";
                        interrupts = <0 115 IRQ_TYPE_LEVEL_HIGH>;
                        reg = <0xffc02700 0x100>;
+                       clocks = <&l4_sp_clk>;
+                       clock-names = "timer";
                };
 
                timer1: timer1@ffc02800 {
                        compatible = "snps,dw-apb-timer";
                        interrupts = <0 116 IRQ_TYPE_LEVEL_HIGH>;
                        reg = <0xffc02800 0x100>;
+                       clocks = <&l4_sp_clk>;
+                       clock-names = "timer";
                };
 
                timer2: timer2@ffd00000 {
                        compatible = "snps,dw-apb-timer";
                        interrupts = <0 117 IRQ_TYPE_LEVEL_HIGH>;
                        reg = <0xffd00000 0x100>;
+                       clocks = <&l4_sys_free_clk>;
+                       clock-names = "timer";
                };
 
                timer3: timer3@ffd00100 {
                        compatible = "snps,dw-apb-timer";
                        interrupts = <0 118 IRQ_TYPE_LEVEL_HIGH>;
                        reg = <0xffd01000 0x100>;
+                       clocks = <&l4_sys_free_clk>;
+                       clock-names = "timer";
                };
 
                uart0: serial0@ffc02000 {
                        interrupts = <0 110 IRQ_TYPE_LEVEL_HIGH>;
                        reg-shift = <2>;
                        reg-io-width = <4>;
+                       status = "disabled";
                };
 
                uart1: serial1@ffc02100 {
                        interrupts = <0 111 IRQ_TYPE_LEVEL_HIGH>;
                        reg-shift = <2>;
                        reg-io-width = <4>;
+                       clocks = <&l4_sp_clk>;
+                       status = "disabled";
                };
 
                usbphy0: usbphy@0 {
                        compatible = "snps,dwc2";
                        reg = <0xffb00000 0xffff>;
                        interrupts = <0 95 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&usb_clk>;
+                       clock-names = "otg";
                        phys = <&usbphy0>;
                        phy-names = "usb2-phy";
                        status = "disabled";
                        compatible = "snps,dw-wdt";
                        reg = <0xffd00200 0x100>;
                        interrupts = <0 119 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&l4_sys_free_clk>;
                        status = "disabled";
                };
 
                        compatible = "snps,dw-wdt";
                        reg = <0xffd00300 0x100>;
                        interrupts = <0 120 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&l4_sys_free_clk>;
                        status = "disabled";
                };
        };
diff --git a/arch/arm/boot/dts/socfpga_arria10_socdk.dts b/arch/arm/boot/dts/socfpga_arria10_socdk.dts
deleted file mode 100755 (executable)
index 3015ce8..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (C) 2014 Altera Corporation <www.altera.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.
- *
- * 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/;
-#include "socfpga_arria10.dtsi"
-
-/ {
-       model = "Altera SOCFPGA Arria 10";
-       compatible = "altr,socfpga-arria10", "altr,socfpga";
-
-       chosen {
-               bootargs = "console=ttyS0,115200 rootwait";
-       };
-
-       memory {
-               name = "memory";
-               device_type = "memory";
-               reg = <0x0 0x40000000>; /* 1GB */
-       };
-
-       soc {
-               clkmgr@ffd04000 {
-                       clocks {
-                               osc1 {
-                                       clock-frequency = <25000000>;
-                               };
-                       };
-               };
-
-               serial0@ffc02000 {
-                       status = "okay";
-               };
-       };
-};
diff --git a/arch/arm/boot/dts/socfpga_arria10_socdk.dtsi b/arch/arm/boot/dts/socfpga_arria10_socdk.dtsi
new file mode 100644 (file)
index 0000000..94a0709
--- /dev/null
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2015 Altera Corporation <www.altera.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.
+ *
+ * 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_arria10.dtsi"
+
+/ {
+       model = "Altera SOCFPGA Arria 10";
+       compatible = "altr,socfpga-arria10", "altr,socfpga";
+
+       chosen {
+               bootargs = "console=ttyS0,115200 rootwait";
+       };
+
+       memory {
+               name = "memory";
+               device_type = "memory";
+               reg = <0x0 0x40000000>; /* 1GB */
+       };
+
+       soc {
+               clkmgr@ffd04000 {
+                       clocks {
+                               osc1 {
+                                       clock-frequency = <25000000>;
+                               };
+                       };
+               };
+       };
+};
+
+&gmac0 {
+       phy-mode = "rgmii";
+       phy-addr = <0xffffffff>; /* probe for phy addr */
+
+       /*
+        * These skews assume the user's FPGA design is adding 600ps of delay
+        * for TX_CLK on Arria 10.
+        *
+        * All skews are offset since hardware skew values for the ksz9031
+        * range from a negative skew to a positive skew.
+        * See the micrel-ksz90x1.txt Documentation file for details.
+        */
+       txd0-skew-ps = <0>; /* -420ps */
+       txd1-skew-ps = <0>; /* -420ps */
+       txd2-skew-ps = <0>; /* -420ps */
+       txd3-skew-ps = <0>; /* -420ps */
+       rxd0-skew-ps = <420>; /* 0ps */
+       rxd1-skew-ps = <420>; /* 0ps */
+       rxd2-skew-ps = <420>; /* 0ps */
+       rxd3-skew-ps = <420>; /* 0ps */
+       txen-skew-ps = <0>; /* -420ps */
+       txc-skew-ps = <1860>; /* 960ps */
+       rxdv-skew-ps = <420>; /* 0ps */
+       rxc-skew-ps = <1680>; /* 780ps */
+       max-frame-size = <3800>;
+       status = "okay";
+};
+
+&uart1 {
+       status = "okay";
+};
diff --git a/arch/arm/boot/dts/socfpga_arria10_socdk_sdmmc.dts b/arch/arm/boot/dts/socfpga_arria10_socdk_sdmmc.dts
new file mode 100644 (file)
index 0000000..dbbb751
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2014-2015 Altera Corporation <www.altera.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.
+ *
+ * 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/;
+#include "socfpga_arria10_socdk.dtsi"
+
+&mmc {
+       status = "okay";
+       num-slots = <1>;
+       broken-cd;
+       bus-width = <4>;
+};
index 16ea6f5f2ab81092d76697d020ef575610dc8045..71468a7eb28f146b3c96c06b955ebb3444a8d033 100644 (file)
 &usb1 {
        status = "okay";
 };
+
+&gpio2 {
+       status = "okay";
+};
+
+&i2c1{
+       status = "okay";
+
+       accel1: accel1@53{
+               compatible = "adxl34x";
+               reg = <0x53>;
+
+               interrupt-parent = < &portc >;
+               interrupts = <3 2>;
+       };
+};
index a1814b4574509e10026b2702125cd9b3c9edbb17..019dd2fea208c300baf698052d8c5e24a63b0298 100644 (file)
                device_type = "memory";
                reg = <0x0 0x40000000>; /* 1GB */
        };
+
+       leds: gpio-leds {
+       };
 };
 
 &gmac1 {
        status = "okay";
 };
 
+&gpio0 {
+       status = "okay";
+};
+
+&gpio1 {
+       status = "okay";
+};
+
 &i2c0 {
        status = "okay";
 
        };
 };
 
+&leds {
+       compatible = "gpio-leds";
+
+       led@0 {
+               label = "led:green:heartbeat";
+               gpios = <&porta 28 1>;
+               linux,default-trigger = "heartbeat";
+       };
+
+       led@1 {
+               label = "led:green:D7";
+               gpios = <&portb 19 1>;
+       };
+
+       led@2 {
+               label = "led:green:D8";
+               gpios = <&portb 25 1>;
+       };
+};
+
 &mmc {
        status = "okay";
 };
index 2201cd5da3bb95843278b27c8f855d540d154041..853684ad777337771b48be2982a7c525f95ef1d6 100644 (file)
                interrupt-parent = <&intc>;
                ranges;
 
+               cpus {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       cpu-map {
+                               cluster0 {
+                                       core0 {
+                                               cpu = <&CPU0>;
+                                       };
+                                       core1 {
+                                               cpu = <&CPU1>;
+                                       };
+                               };
+                       };
+                       CPU0: cpu@0 {
+                               device_type = "cpu";
+                               compatible = "arm,cortex-a9";
+                               reg = <0>;
+                       };
+                       CPU1: cpu@1 {
+                               device_type = "cpu";
+                               compatible = "arm,cortex-a9";
+                               reg = <1>;
+                       };
+               };
+
+               ptm@801ae000 {
+                       compatible = "arm,coresight-etm3x", "arm,primecell";
+                       reg = <0x801ae000 0x1000>;
+
+                       clocks = <&prcmu_clk PRCMU_APETRACECLK>, <&prcmu_clk PRCMU_APEATCLK>;
+                       clock-names = "apb_pclk", "atclk";
+                       cpu = <&CPU0>;
+                       port {
+                               ptm0_out_port: endpoint {
+                                       remote-endpoint = <&funnel_in_port0>;
+                               };
+                       };
+               };
+
+               ptm@801af000 {
+                       compatible = "arm,coresight-etm3x", "arm,primecell";
+                       reg = <0x801af000 0x1000>;
+
+                       clocks = <&prcmu_clk PRCMU_APETRACECLK>, <&prcmu_clk PRCMU_APEATCLK>;
+                       clock-names = "apb_pclk", "atclk";
+                       cpu = <&CPU1>;
+                       port {
+                               ptm1_out_port: endpoint {
+                                       remote-endpoint = <&funnel_in_port1>;
+                               };
+                       };
+               };
+
+               funnel@801a6000 {
+                       compatible = "arm,coresight-funnel", "arm,primecell";
+                       reg = <0x801a6000 0x1000>;
+
+                       clocks = <&prcmu_clk PRCMU_APETRACECLK>, <&prcmu_clk PRCMU_APEATCLK>;
+                       clock-names = "apb_pclk", "atclk";
+                       ports {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               /* funnel output ports */
+                               port@0 {
+                                       reg = <0>;
+                                       funnel_out_port: endpoint {
+                                               remote-endpoint =
+                                                       <&replicator_in_port0>;
+                                       };
+                               };
+
+                               /* funnel input ports */
+                               port@1 {
+                                       reg = <0>;
+                                       funnel_in_port0: endpoint {
+                                               slave-mode;
+                                               remote-endpoint = <&ptm0_out_port>;
+                                       };
+                               };
+
+                               port@2 {
+                                       reg = <1>;
+                                       funnel_in_port1: endpoint {
+                                               slave-mode;
+                                               remote-endpoint = <&ptm1_out_port>;
+                                       };
+                               };
+                       };
+               };
+
+               replicator {
+                       compatible = "arm,coresight-replicator";
+                       clocks = <&prcmu_clk PRCMU_APEATCLK>;
+                       clock-names = "atclk";
+
+                       ports {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               /* replicator output ports */
+                               port@0 {
+                                       reg = <0>;
+                                       replicator_out_port0: endpoint {
+                                               remote-endpoint = <&tpiu_in_port>;
+                                       };
+                               };
+                               port@1 {
+                                       reg = <1>;
+                                       replicator_out_port1: endpoint {
+                                               remote-endpoint = <&etb_in_port>;
+                                       };
+                               };
+
+                               /* replicator input port */
+                               port@2 {
+                                       reg = <0>;
+                                       replicator_in_port0: endpoint {
+                                               slave-mode;
+                                               remote-endpoint = <&funnel_out_port>;
+                                       };
+                               };
+                       };
+               };
+
+               tpiu@80190000 {
+                       compatible = "arm,coresight-tpiu", "arm,primecell";
+                       reg = <0x80190000 0x1000>;
+
+                       clocks = <&prcmu_clk PRCMU_APETRACECLK>, <&prcmu_clk PRCMU_APEATCLK>;
+                       clock-names = "apb_pclk", "atclk";
+                       port {
+                               tpiu_in_port: endpoint {
+                                       slave-mode;
+                                       remote-endpoint = <&replicator_out_port0>;
+                               };
+                       };
+               };
+
+               etb@801a4000 {
+                       compatible = "arm,coresight-etb10", "arm,primecell";
+                       reg = <0x801a4000 0x1000>;
+
+                       clocks = <&prcmu_clk PRCMU_APETRACECLK>, <&prcmu_clk PRCMU_APEATCLK>;
+                       clock-names = "apb_pclk", "atclk";
+                       port {
+                               etb_in_port: endpoint {
+                                       slave-mode;
+                                       remote-endpoint = <&replicator_out_port1>;
+                               };
+                       };
+               };
+
                intc: interrupt-controller@a0411000 {
                        compatible = "arm,cortex-a9-gic";
                        #interrupt-cells = <3>;
                              <0xa0410100 0x100>;
                };
 
+               scu@a04100000 {
+                       compatible = "arm,cortex-a9-scu";
+                       reg = <0xa0410000 0x100>;
+               };
+
+               /*
+                * The backup RAM is used for retention during sleep
+                * and various things like spin tables
+                */
+               backupram@80150000 {
+                       compatible = "ste,dbx500-backupram";
+                       reg = <0x80150000 0x2000>;
+               };
+
                L2: l2-cache {
                        compatible = "arm,pl310-cache";
                        reg = <0xa0412000 0x1000>;
                        clocks = <&smp_twd_clk>;
                };
 
+               watchdog@a0410620 {
+                       compatible = "arm,cortex-a9-twd-wdt";
+                       reg = <0xa0410620 0x20>;
+                       interrupts = <1 14 0x304>;
+                       clocks = <&smp_twd_clk>;
+               };
+
                rtc@80154000 {
                        compatible = "arm,rtc-pl031", "arm,primecell";
                        reg = <0x80154000 0x1000>;
index 7d4f8184c522b09e405d8168ac206d39c2254938..78b75256c638af2e70f8a4f95940bdac56b80079 100644 (file)
                        };
                };
 
+               /* Sensors mounted on this board variant */
+               i2c@80128000 {
+                       lis331dl@1c {
+                               /* Accelerometer */
+                               compatible = "st,lis331dl-accel";
+                               st,drdy-int-pin = <1>;
+                               reg = <0x1c>;
+                               vdd-supply = <&ab8500_ldo_aux1_reg>;
+                               vddio-supply = <&db8500_vsmps2_reg>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&accel_stuib_mode>;
+                               interrupt-parent = <&gpio2>;
+                               interrupts = <18 IRQ_TYPE_EDGE_RISING>,
+                                            <19 IRQ_TYPE_EDGE_RISING>;
+                       };
+                       ak8974@0f {
+                               /* Magnetometer */
+                               compatible = "asahi-kasei,ak8974";
+                               reg = <0x0f>;
+                               vdd-supply = <&ab8500_ldo_aux1_reg>;
+                               vddio-supply = <&db8500_vsmps2_reg>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&magneto_stuib_mode>;
+                               interrupt-parent = <&gpio1>;
+                               interrupts = <0 IRQ_TYPE_EDGE_RISING>;
+                       };
+               };
+
                i2c@80110000 {
                        bu21013_tp@5c {
                                compatible = "rohm,bu21013_tp";
                                        };
                                };
                        };
+                       accelerometer {
+                               accel_stuib_mode: accel_stuib {
+                                       /* Accelerometer interrupt lines 1 & 2 */
+                                       stuib_cfg {
+                                               pins = "GPIO82_C1", "GPIO83_D3";
+                                               ste,config = <&gpio_in_pu>;
+                                       };
+                               };
+                       };
+                       magnetometer {
+                               magneto_stuib_mode: magneto_stuib {
+                                       /* Magnetometer uses GPIO 31 and 32, pull these up/down respectively */
+                                       stuib_cfg1 {
+                                               pins = "GPIO31_V3";
+                                               ste,config = <&gpio_in_pu>;
+                                       };
+                                       stuib_cfg2 {
+                                               pins = "GPIO32_V2";
+                                               ste,config = <&gpio_in_pd>;
+                                       };
+                               };
+                       };
                };
        };
 };
index 062c6aae3afa8406580976ddd95869a321d8d69c..0e1c96943d4795e7bd7355c03f5449ec71ae626a 100644 (file)
                                vddio-supply = <&db8500_vsmps2_reg>;
                                pinctrl-names = "default";
                                pinctrl-0 = <&accel_tvk_mode>;
+                               interrupt-parent = <&gpio2>;
+                               interrupts = <18 IRQ_TYPE_EDGE_RISING>,
+                                            <19 IRQ_TYPE_EDGE_RISING>;
                        };
-                       lsm303dlm@1e {
+                       lsm303dlh@1e {
                                /* Magnetometer */
-                               compatible = "st,lsm303dlm-magn";
+                               compatible = "st,lsm303dlh-magn";
                                reg = <0x1e>;
                                vdd-supply = <&ab8500_ldo_aux1_reg>;
                                vddio-supply = <&db8500_vsmps2_reg>;
index f182f6538e902e567602e5e3195d562b572b538f..9a5f2ba139b7376018d8e48a6263e2ad711fa865 100644 (file)
                           reg = <0x1a>;
                };
                lis3lv02dl@1d {
-                          compatible = "st,lis3lv02dl";
-                          reg = <0x1d>;
+                       /* Accelerometer */
+                       compatible = "st,lis3lv02dl-accel";
+                       reg = <0x1d>;
                };
        };
 
index 1bc84ebdccaa2fe119ebb9e542f88b64f017cea9..9edadc37719ffa491aa3ad95c15d27ded3585727 100644 (file)
                                vddio-supply = <&db8500_vsmps2_reg>;
                                pinctrl-names = "default";
                                pinctrl-0 = <&accel_snowball_mode>;
+                               interrupt-parent = <&gpio5>;
+                               interrupts = <3 IRQ_TYPE_EDGE_RISING>, /* INT1 */
+                                            <4 IRQ_TYPE_EDGE_RISING>; /* INT2 */
                        };
-                       lsm303dlm@1e {
+                       lsm303dlh@1e {
                                /* Magnetometer */
-                               compatible = "st,lsm303dlm-magn";
+                               compatible = "st,lsm303dlh-magn";
                                reg = <0x1e>;
                                vdd-supply = <&ab8500_ldo_aux1_reg>;
                                vddio-supply = <&db8500_vsmps2_reg>;
                                pinctrl-names = "default";
                                pinctrl-0 = <&magneto_snowball_mode>;
+                               gpios = <&gpio5 5 0x4>; /* DRDY line */
                        };
                        l3g4200d@68 {
                                /* Gyroscope */
                                reg = <0x68>;
                                vdd-supply = <&ab8500_ldo_aux1_reg>;
                                vddio-supply = <&db8500_vsmps2_reg>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&gyro_snowball_mode>;
+                               gpios = <&gpio5 6 0x4>; /* DRDY line */
+                               interrupt-parent = <&gpio5>;
+                               interrupts = <9 IRQ_TYPE_EDGE_RISING>; /* INT1 */
                        };
                        lsp001wm@5c {
                                /* Barometer/pressure sensor */
                                        };
                                };
                        };
+                       gyro {
+                               gyro_snowball_mode: gyro_snowball {
+                                       snowball_cfg1 {
+                                               pins =
+                                               "GPIO166_A22", /* DRDY */
+                                               "GPIO169_D22"; /* INT */
+                                               ste,config = <&gpio_in_pu>;
+                                       };
+                               };
+                       };
                        magnetometer {
                                magneto_snowball_mode: magneto_snowball {
                                        snowball_cfg1 {
index af487145cd89903f3ad4335bea45c938ce202f34..6d93475be5546afaff1fde83bae34afe7f638cec 100644 (file)
@@ -7,8 +7,8 @@
  * published by the Free Software Foundation.
  */
 /dts-v1/;
-#include "stihxxx-b2120.dtsi"
 #include "stih407.dtsi"
+#include "stihxxx-b2120.dtsi"
 / {
        model = "STiH407 B2120";
        compatible = "st,stih407-b2120", "st,stih407";
index c06a54681912034578cb1dd08656c279841d31cf..838b812cbda10c1ec991aa0a471a7956e1fbace2 100644 (file)
@@ -7,7 +7,10 @@
  * publishhed by the Free Software Foundation.
  */
 #include "stih407-pinctrl.dtsi"
+#include <dt-bindings/mfd/st-lpc.h>
+#include <dt-bindings/phy/phy.h>
 #include <dt-bindings/reset-controller/stih407-resets.h>
+#include <dt-bindings/interrupt-controller/irq-st.h>
 / {
        #address-cells = <1>;
        #size-cells = <1>;
                cache-level = <2>;
        };
 
+       arm-pmu {
+               interrupt-parent = <&intc>;
+               compatible = "arm,cortex-a9-pmu";
+               interrupts = <GIC_PPI 15 IRQ_TYPE_LEVEL_HIGH>;
+       };
+
        soc {
                #address-cells = <1>;
                #size-cells = <1>;
                ranges;
                compatible = "simple-bus";
 
+               restart {
+                       compatible = "st,stih407-restart";
+                       st,syscfg = <&syscfg_sbc_reg>;
+                       status = "okay";
+               };
+
                powerdown: powerdown-controller {
                        compatible = "st,stih407-powerdown";
                        #reset-cells = <1>;
                        reg = <0x94b5100 0x1000>;
                };
 
+               irq-syscfg {
+                       compatible    = "st,stih407-irq-syscfg";
+                       st,syscfg     = <&syscfg_core>;
+                       st,irq-device = <ST_IRQ_SYSCFG_PMU_0>,
+                                       <ST_IRQ_SYSCFG_PMU_1>;
+                       st,fiq-device = <ST_IRQ_SYSCFG_DISABLED>,
+                                       <ST_IRQ_SYSCFG_DISABLED>;
+               };
+
                serial@9830000 {
                        compatible = "st,asc";
                        reg = <0x9830000 0x2c>;
                        #phy-cells = <0>;
                        st,syscfg = <&syscfg_core 0x100 0xf4>;
                        resets = <&softreset STIH407_PICOPHY_SOFTRESET>,
-                                <&picophyreset STIH407_PICOPHY0_RESET>;
+                                <&picophyreset STIH407_PICOPHY2_RESET>;
                        reset-names = "global", "port";
                };
 
                                resets = <&softreset STIH407_MIPHY2_SOFTRESET>;
                        };
                };
+
+               spi@9840000 {
+                       compatible = "st,comms-ssc4-spi";
+                       reg = <0x9840000 0x110>;
+                       interrupts = <GIC_SPI 112 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&clk_s_c0_flexgen CLK_EXT2F_A9>;
+                       clock-names = "ssc";
+                       pinctrl-0 = <&pinctrl_spi0_default>;
+                       pinctrl-names = "default";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       status = "disabled";
+               };
+
+               spi@9841000 {
+                       compatible = "st,comms-ssc4-spi";
+                       reg = <0x9841000 0x110>;
+                       interrupts = <GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&clk_s_c0_flexgen CLK_EXT2F_A9>;
+                       clock-names = "ssc";
+
+                       status = "disabled";
+               };
+
+               spi@9842000 {
+                       compatible = "st,comms-ssc4-spi";
+                       reg = <0x9842000 0x110>;
+                       interrupts = <GIC_SPI 114 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&clk_s_c0_flexgen CLK_EXT2F_A9>;
+                       clock-names = "ssc";
+
+                       status = "disabled";
+               };
+
+               spi@9843000 {
+                       compatible = "st,comms-ssc4-spi";
+                       reg = <0x9843000 0x110>;
+                       interrupts = <GIC_SPI 115 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&clk_s_c0_flexgen CLK_EXT2F_A9>;
+                       clock-names = "ssc";
+
+                       status = "disabled";
+               };
+
+               spi@9844000 {
+                       compatible = "st,comms-ssc4-spi";
+                       reg = <0x9844000 0x110>;
+                       interrupts = <GIC_SPI 116 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&clk_s_c0_flexgen CLK_EXT2F_A9>;
+                       clock-names = "ssc";
+
+                       status = "disabled";
+               };
+
+               /* SBC SSC */
+               spi@9540000 {
+                       compatible = "st,comms-ssc4-spi";
+                       reg = <0x9540000 0x110>;
+                       interrupts = <GIC_SPI 135 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&clk_sysin>;
+                       clock-names = "ssc";
+
+                       status = "disabled";
+               };
+
+               spi@9541000 {
+                       compatible = "st,comms-ssc4-spi";
+                       reg = <0x9541000 0x110>;
+                       interrupts = <GIC_SPI 136 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&clk_sysin>;
+                       clock-names = "ssc";
+
+                       status = "disabled";
+               };
+
+               spi@9542000 {
+                       compatible = "st,comms-ssc4-spi";
+                       reg = <0x9542000 0x110>;
+                       interrupts = <GIC_SPI 137 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&clk_sysin>;
+                       clock-names = "ssc";
+
+                       status = "disabled";
+               };
+
+               mmc0: sdhci@09060000 {
+                       compatible = "st,sdhci-stih407", "st,sdhci";
+                       status = "disabled";
+                       reg = <0x09060000 0x7ff>, <0x9061008 0x20>;
+                       reg-names = "mmc", "top-mmc-delay";
+                       interrupts = <GIC_SPI 92 IRQ_TYPE_NONE>;
+                       interrupt-names = "mmcirq";
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&pinctrl_mmc0>;
+                       clock-names = "mmc";
+                       clocks = <&clk_s_c0_flexgen CLK_MMC_0>;
+                       bus-width = <8>;
+                       non-removable;
+               };
+
+               mmc1: sdhci@09080000 {
+                       compatible = "st,sdhci-stih407", "st,sdhci";
+                       status = "disabled";
+                       reg = <0x09080000 0x7ff>;
+                       reg-names = "mmc";
+                       interrupts = <GIC_SPI 90 IRQ_TYPE_NONE>;
+                       interrupt-names = "mmcirq";
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&pinctrl_sd1>;
+                       clock-names = "mmc";
+                       clocks = <&clk_s_c0_flexgen CLK_MMC_1>;
+                       resets = <&softreset STIH407_MMC1_SOFTRESET>;
+                       bus-width = <4>;
+               };
+
+               /* Watchdog and Real-Time Clock */
+               lpc@8787000 {
+                       compatible = "st,stih407-lpc";
+                       reg = <0x8787000 0x1000>;
+                       interrupts = <GIC_SPI 129 IRQ_TYPE_EDGE_RISING>;
+                       clocks = <&clk_s_d3_flexgen CLK_LPC_0>;
+                       timeout-sec = <120>;
+                       st,syscfg = <&syscfg_core>;
+                       st,lpc-mode = <ST_LPC_MODE_WDT>;
+               };
+
+               lpc@8788000 {
+                       compatible = "st,stih407-lpc";
+                       reg = <0x8788000 0x1000>;
+                       interrupts = <GIC_SPI 130 IRQ_TYPE_EDGE_RISING>;
+                       clocks = <&clk_s_d3_flexgen CLK_LPC_1>;
+                       st,lpc-mode = <ST_LPC_MODE_RTC>;
+               };
+
+               sata0: sata@9b20000 {
+                       compatible = "st,ahci";
+                       reg = <0x9b20000 0x1000>;
+
+                       interrupts = <GIC_SPI 159 IRQ_TYPE_NONE>;
+                       interrupt-names = "hostc";
+
+                       phys = <&phy_port0 PHY_TYPE_SATA>;
+                       phy-names = "ahci_phy";
+
+                       resets = <&powerdown STIH407_SATA0_POWERDOWN>,
+                                <&softreset STIH407_SATA0_SOFTRESET>,
+                                <&softreset STIH407_SATA0_PWR_SOFTRESET>;
+                       reset-names = "pwr-dwn", "sw-rst", "pwr-rst";
+
+                       clock-names = "ahci_clk";
+                       clocks = <&clk_s_c0_flexgen CLK_ICN_REG>;
+
+                       status = "disabled";
+               };
+
+               sata1: sata@9b28000 {
+                       compatible = "st,ahci";
+                       reg = <0x9b28000 0x1000>;
+
+                       interrupts = <GIC_SPI 170 IRQ_TYPE_NONE>;
+                       interrupt-names = "hostc";
+
+                       phys = <&phy_port1 PHY_TYPE_SATA>;
+                       phy-names = "ahci_phy";
+
+                       resets = <&powerdown STIH407_SATA1_POWERDOWN>,
+                                <&softreset STIH407_SATA1_SOFTRESET>,
+                                <&softreset STIH407_SATA1_PWR_SOFTRESET>;
+                       reset-names = "pwr-dwn",
+                                     "sw-rst",
+                                     "pwr-rst";
+
+                       clock-names = "ahci_clk";
+                       clocks = <&clk_s_c0_flexgen CLK_ICN_REG>;
+
+                       status = "disabled";
+               };
+
+               st_dwc3: dwc3@8f94000 {
+                       compatible      = "st,stih407-dwc3";
+                       reg             = <0x08f94000 0x1000>, <0x110 0x4>;
+                       reg-names       = "reg-glue", "syscfg-reg";
+                       st,syscfg       = <&syscfg_core>;
+                       resets          = <&powerdown STIH407_USB3_POWERDOWN>,
+                                         <&softreset STIH407_MIPHY2_SOFTRESET>;
+                       reset-names     = "powerdown", "softreset";
+                       #address-cells  = <1>;
+                       #size-cells     = <1>;
+                       pinctrl-names   = "default";
+                       pinctrl-0       = <&pinctrl_usb3>;
+                       ranges;
+
+                       status = "disabled";
+
+                       dwc3: dwc3@9900000 {
+                               compatible      = "snps,dwc3";
+                               reg             = <0x09900000 0x100000>;
+                               interrupts      = <GIC_SPI 155 IRQ_TYPE_NONE>;
+                               dr_mode         = "host";
+                               phy-names       = "usb2-phy", "usb3-phy";
+                               phys            = <&usb2_picophy0>,
+                                                 <&phy_port2 PHY_TYPE_USB3>;
+                       };
+               };
        };
 };
index 402844cb31524d2f9e75f06b901e7dc9c2496897..0a754f2752121eddc1c5c6540d43bb83cb1585f2 100644 (file)
                                #interrupt-cells = <2>;
                                reg = <0x5000 0x100>;
                                st,bank-name = "PIO5";
+                               st,retime-pin-mask = <0x3f>;
                        };
 
                        rc {
                                #interrupt-cells = <2>;
                                reg = <0x5000 0x100>;
                                st,bank-name = "PIO35";
+                               st,retime-pin-mask = <0x7f>;
                        };
 
                        i2c4 {
index 3efa3b2ebe900df62c504340a8ca60c7aa7849c1..2c560fc30503e68a827f4c2d6f7a3b59e15fed2f 100644 (file)
                                };
                        };
                };
+
+               /* COMMS PWM Module */
+               pwm0: pwm@9810000 {
+                       compatible      = "st,sti-pwm";
+                       status          = "disabled";
+                       #pwm-cells      = <2>;
+                       reg             = <0x9810000 0x68>;
+                       pinctrl-names   = "default";
+                       pinctrl-0       = <&pinctrl_pwm0_chan0_default>;
+                       clock-names     = "pwm";
+                       clocks          = <&clk_sysin>;
+               };
+
+               /* SBC PWM Module */
+               pwm1: pwm@9510000 {
+                       compatible      = "st,sti-pwm";
+                       status          = "disabled";
+                       #pwm-cells      = <2>;
+                       reg             = <0x9510000 0x68>;
+                       pinctrl-names   = "default";
+                       pinctrl-0       = <&pinctrl_pwm1_chan0_default
+                                       &pinctrl_pwm1_chan1_default
+                                       &pinctrl_pwm1_chan2_default
+                                       &pinctrl_pwm1_chan3_default>;
+                       clock-names     = "pwm";
+                       clocks          = <&clk_sysin>;
+                       st,pwm-num-chan = <4>;
+               };
        };
 };
index 2f61a9960dee60d129c7f6c4f84213769cc2856a..16f02c5e33a4682b690dc21288e0f6d88e4e9e3e 100644 (file)
        aliases {
                ttyAS0 = &sbc_serial0;
        };
+
+       soc {
+
+               mmc0: sdhci@09060000 {
+                       max-frequency = <200000000>;
+                       sd-uhs-sdr50;
+                       sd-uhs-sdr104;
+                       sd-uhs-ddr50;
+               };
+       };
 };
index 961799e1dc519e68ddd600645236010032c28420..f1ceee192a0e2c176cbd80f7d91c4c8a024bff81 100644 (file)
                sata0: sata@fe380000{
                        status = "okay";
                };
+
+               /* SAS PWM Module */
+               pwm0: pwm@fed10000 {
+                       status          = "okay";
+               };
+
+               /* SBC PWM Module */
+               pwm1: pwm@fe510000 {
+                       status          = "okay";
+               };
        };
 };
index 9cccf2d6aa26f5c17e0bd83684e17bb4335acabf..051fc16f37063fe18a5957943f0e97b9e830336a 100644 (file)
                                        };
                                };
                        };
+
+                       pwm1 {
+                               pinctrl_pwm1_chan0_default: pwm1-0-default {
+                                       st,pins {
+                                               pwm-out    = <&pio3 0 ALT1 OUT>;
+                                       };
+                               };
+                               pinctrl_pwm1_chan1_default: pwm1-1-default {
+                                       st,pins {
+                                               pwm-out    = <&pio4 4 ALT1 OUT>;
+                                       };
+                               };
+                               pinctrl_pwm1_chan2_default: pwm1-2-default {
+                                       st,pins {
+                                               pwm-out    = <&pio4 6 ALT3 OUT>;
+                                       };
+                               };
+                               pinctrl_pwm1_chan3_default: pwm1-3-default {
+                                       st,pins {
+                                               pwm-out    = <&pio4 7 ALT3 OUT>;
+                                       };
+                               };
+                       };
                };
 
                pin-controller-front {
                                st,bank-name    = "PIO31";
                        };
 
+                       pwm0 {
+                               pinctrl_pwm0_chan0_default: pwm0-0-default {
+                                       st,pins {
+                                               pwm-out    = <&pio9 7 ALT2 OUT>;
+                                       };
+                               };
+                       };
+
                        serial2-oe {
                                pinctrl_serial2_oe: serial2-1 {
                                        st,pins {
                                        };
                                };
                        };
+
+                       pwm0 {
+                               pinctrl_pwm0_chan1_default: pwm0-1-default {
+                                       st,pins {
+                                               pwm-out    = <&pio13 2 ALT2 OUT>;
+                                       };
+                               };
+                               pinctrl_pwm0_chan2_default: pwm0-2-default {
+                                       st,pins {
+                                               pwm-out    = <&pio15 2 ALT4 OUT>;
+                                       };
+                               };
+                               pinctrl_pwm0_chan3_default: pwm0-3-default {
+                                       st,pins {
+                                               pwm-out    = <&pio17 4 ALT1 OUT>;
+                                       };
+                               };
+                       };
+
                };
 
                pin-controller-fvdp-fe {
index eeb7afecbbe6fa9b6dc3bf0b005156547628291c..9dca173e694a1c28715cdc196325c88f16c45cd0 100644 (file)
@@ -13,6 +13,7 @@
 #include <dt-bindings/phy/phy.h>
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/reset-controller/stih416-resets.h>
+#include <dt-bindings/interrupt-controller/irq-st.h>
 / {
        L2: cache-controller {
                compatible = "arm,pl310-cache";
                cache-level = <2>;
        };
 
+       arm-pmu {
+               compatible = "arm,cortex-a9-pmu";
+               interrupt-parent = <&intc>;
+               interrupts = <GIC_PPI 15 IRQ_TYPE_LEVEL_HIGH>;
+       };
+
        soc {
                #address-cells = <1>;
                #size-cells = <1>;
                ranges;
                compatible      = "simple-bus";
 
+               restart {
+                       compatible = "st,stih416-restart";
+                       st,syscfg = <&syscfg_sbc>;
+                       status = "okay";
+               };
+
                powerdown: powerdown-controller {
                        #reset-cells = <1>;
                        compatible = "st,stih416-powerdown";
                        reg             = <0xfe4b5100 0x8>;
                };
 
+               irq-syscfg {
+                       compatible    = "st,stih416-irq-syscfg";
+                       st,syscfg     = <&syscfg_cpu>;
+                       st,irq-device = <ST_IRQ_SYSCFG_PMU_0>,
+                                       <ST_IRQ_SYSCFG_PMU_1>;
+                       st,fiq-device = <ST_IRQ_SYSCFG_DISABLED>,
+                                       <ST_IRQ_SYSCFG_DISABLED>;
+               };
+
                serial2: serial@fed32000{
                        compatible      = "st,asc";
                        status          = "disabled";
                        interrupts      = <0 210 0>;
                        pinctrl-names   = "default";
                        pinctrl-0       = <&pinctrl_sbc_serial1>;
-                       clocks          = <&clk_sysin>;
+                       clocks          = <&clk_sysin>;
                };
 
                i2c@fed40000 {
                                 <&softreset STIH416_USB3_SOFTRESET>;
                        reset-names = "power", "softreset";
                };
+
+               /* SAS PWM Module */
+               pwm0: pwm@fed10000 {
+                       compatible      = "st,sti-pwm";
+                       status          = "disabled";
+                       #pwm-cells      = <2>;
+                       reg             = <0xfed10000 0x68>;
+
+                       pinctrl-names   = "default";
+                       pinctrl-0 =     <&pinctrl_pwm0_chan0_default
+                                       &pinctrl_pwm0_chan1_default
+                                       &pinctrl_pwm0_chan2_default
+                                       &pinctrl_pwm0_chan3_default>;
+
+                       clock-names     = "pwm";
+                       clocks          = <&clk_sysin>;
+                       st,pwm-num-chan = <4>;
+               };
+
+               /* SBC PWM Module */
+               pwm1: pwm@fe510000 {
+                       compatible      = "st,sti-pwm";
+                       status          = "disabled";
+                       #pwm-cells      = <2>;
+                       reg             = <0xfe510000 0x68>;
+
+                       pinctrl-names   = "default";
+                       pinctrl-0       = <&pinctrl_pwm1_chan0_default
+                                       /*
+                                        * Shared with SBC_OBS_NOTRST.  Don't
+                                        * enable unless you really know what
+                                        * you're doing.
+                                        *
+                                        * &pinctrl_pwm1_chan1_default
+                                        */
+                                       &pinctrl_pwm1_chan2_default
+                                       &pinctrl_pwm1_chan3_default>;
+
+                       clock-names     = "pwm";
+                       clocks          = <&clk_sysin>;
+                       st,pwm-num-chan = <3>;
+               };
        };
 };
index 926235c08e4d053a3562c4b8f690017f447b6ebe..82eee39ccb310b79d1079a59c4adc9f77b16622f 100644 (file)
                        st,i2c-min-scl-pulse-width-us = <0>;
                        st,i2c-min-sda-pulse-width-us = <5>;
                };
+
+               mmc1: sdhci@09080000 {
+                       status = "okay";
+               };
+
+               mmc0: sdhci@09060000 {
+                       status = "okay";
+                       max-frequency = <200000000>;
+                       sd-uhs-sdr50;
+                       sd-uhs-sdr104;
+                       sd-uhs-ddr50;
+               };
+
+               miphy28lp_phy: miphy28lp@9b22000 {
+
+                       phy_port0: port@9b22000 {
+                               st,osc-rdy;
+                       };
+
+                       phy_port1: port@9b2a000 {
+                               st,osc-force-ext;
+                       };
+               };
+
+               st_dwc3: dwc3@8f94000 {
+                       status = "okay";
+               };
        };
 };
index c1d859092be7f0397405466d8a3ac3aeccd15cd8..f589fe487f13f2ad41af93506ed9c968c8398150 100644 (file)
                        status = "okay";
                };
 
+               mmc0: sdhci@09060000 {
+                       status = "okay";
+               };
+
+               mmc1: sdhci@09080000 {
+                       status = "okay";
+               };
+
                /* SSC11 to HDMI */
                hdmiddc: i2c@9541000 {
                        status = "okay";
                                st,osc-force-ext;
                        };
                };
+
+               st_dwc3: dwc3@8f94000 {
+                       status = "okay";
+               };
+
        };
 };
diff --git a/arch/arm/boot/dts/stm32f429-disco.dts b/arch/arm/boot/dts/stm32f429-disco.dts
new file mode 100644 (file)
index 0000000..6b9aa59
--- /dev/null
@@ -0,0 +1,71 @@
+/*
+ * Copyright 2015 - Maxime Coquelin <mcoquelin.stm32@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.
+ *
+ *     You should have received a copy of the GNU General Public
+ *     License along with this file; 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 "stm32f429.dtsi"
+
+/ {
+       model = "STMicroelectronics STM32F429i-DISCO board";
+       compatible = "st,stm32f429i-disco", "st,stm32f429";
+
+       chosen {
+               bootargs = "console=ttyS0,115200 root=/dev/ram rdinit=/linuxrc";
+               linux,stdout-path = &usart1;
+       };
+
+       memory {
+               reg = <0x90000000 0x800000>;
+       };
+
+       aliases {
+               serial0 = &usart1;
+       };
+};
+
+&usart1 {
+       status = "okay";
+};
diff --git a/arch/arm/boot/dts/stm32f429.dtsi b/arch/arm/boot/dts/stm32f429.dtsi
new file mode 100644 (file)
index 0000000..aa73b4f
--- /dev/null
@@ -0,0 +1,214 @@
+/*
+ * Copyright 2015 - Maxime Coquelin <mcoquelin.stm32@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.
+ *
+ *     You should have received a copy of the GNU General Public
+ *     License along with this file; 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.
+ */
+
+#include "armv7-m.dtsi"
+
+/ {
+       clocks {
+               clk_sysclk: clk-sysclk {
+                       #clock-cells = <0>;
+                       compatible = "fixed-clock";
+                       clock-frequency = <180000000>;
+               };
+
+               clk_hclk: clk-hclk {
+                       #clock-cells = <0>;
+                       compatible = "fixed-clock";
+                       clock-frequency = <180000000>;
+               };
+
+               clk_pclk1: clk-pclk1 {
+                       #clock-cells = <0>;
+                       compatible = "fixed-clock";
+                       clock-frequency = <45000000>;
+               };
+
+               clk_pclk2: clk-pclk2 {
+                       #clock-cells = <0>;
+                       compatible = "fixed-clock";
+                       clock-frequency = <90000000>;
+               };
+
+               clk_pmtr1: clk-pmtr1 {
+                       #clock-cells = <0>;
+                       compatible = "fixed-clock";
+                       clock-frequency = <90000000>;
+               };
+
+               clk_pmtr2: clk-pmtr2 {
+                       #clock-cells = <0>;
+                       compatible = "fixed-clock";
+                       clock-frequency = <180000000>;
+               };
+
+               clk_systick: clk-systick {
+                       compatible = "fixed-factor-clock";
+                       clocks = <&clk_hclk>;
+                       #clock-cells = <0>;
+                       clock-div = <8>;
+                       clock-mult = <1>;
+               };
+       };
+
+       soc {
+               timer2: timer@40000000 {
+                       compatible = "st,stm32-timer";
+                       reg = <0x40000000 0x400>;
+                       interrupts = <28>;
+                       clocks = <&clk_pmtr1>;
+                       status = "disabled";
+               };
+
+               timer3: timer@40000400 {
+                       compatible = "st,stm32-timer";
+                       reg = <0x40000400 0x400>;
+                       interrupts = <29>;
+                       clocks = <&clk_pmtr1>;
+                       status = "disabled";
+               };
+
+               timer4: timer@40000800 {
+                       compatible = "st,stm32-timer";
+                       reg = <0x40000800 0x400>;
+                       interrupts = <30>;
+                       clocks = <&clk_pmtr1>;
+                       status = "disabled";
+               };
+
+               timer5: timer@40000c00 {
+                       compatible = "st,stm32-timer";
+                       reg = <0x40000c00 0x400>;
+                       interrupts = <50>;
+                       clocks = <&clk_pmtr1>;
+               };
+
+               timer6: timer@40001000 {
+                       compatible = "st,stm32-timer";
+                       reg = <0x40001000 0x400>;
+                       interrupts = <54>;
+                       clocks = <&clk_pmtr1>;
+                       status = "disabled";
+               };
+
+               timer7: timer@40001400 {
+                       compatible = "st,stm32-timer";
+                       reg = <0x40001400 0x400>;
+                       interrupts = <55>;
+                       clocks = <&clk_pmtr1>;
+                       status = "disabled";
+               };
+
+               usart2: serial@40004400 {
+                       compatible = "st,stm32-usart", "st,stm32-uart";
+                       reg = <0x40004400 0x400>;
+                       interrupts = <38>;
+                       clocks = <&clk_pclk1>;
+                       status = "disabled";
+               };
+
+               usart3: serial@40004800 {
+                       compatible = "st,stm32-usart", "st,stm32-uart";
+                       reg = <0x40004800 0x400>;
+                       interrupts = <39>;
+                       clocks = <&clk_pclk1>;
+                       status = "disabled";
+               };
+
+               usart4: serial@40004c00 {
+                       compatible = "st,stm32-uart";
+                       reg = <0x40004c00 0x400>;
+                       interrupts = <52>;
+                       clocks = <&clk_pclk1>;
+                       status = "disabled";
+               };
+
+               usart5: serial@40005000 {
+                       compatible = "st,stm32-uart";
+                       reg = <0x40005000 0x400>;
+                       interrupts = <53>;
+                       clocks = <&clk_pclk1>;
+                       status = "disabled";
+               };
+
+               usart7: serial@40007800 {
+                       compatible = "st,stm32-usart", "st,stm32-uart";
+                       reg = <0x40007800 0x400>;
+                       interrupts = <82>;
+                       clocks = <&clk_pclk1>;
+                       status = "disabled";
+               };
+
+               usart8: serial@40007c00 {
+                       compatible = "st,stm32-usart", "st,stm32-uart";
+                       reg = <0x40007c00 0x400>;
+                       interrupts = <83>;
+                       clocks = <&clk_pclk1>;
+                       status = "disabled";
+               };
+
+               usart1: serial@40011000 {
+                       compatible = "st,stm32-usart", "st,stm32-uart";
+                       reg = <0x40011000 0x400>;
+                       interrupts = <37>;
+                       clocks = <&clk_pclk2>;
+                       status = "disabled";
+               };
+
+               usart6: serial@40011400 {
+                       compatible = "st,stm32-usart", "st,stm32-uart";
+                       reg = <0x40011400 0x400>;
+                       interrupts = <71>;
+                       clocks = <&clk_pclk2>;
+                       status = "disabled";
+               };
+       };
+};
+
+&systick {
+       clocks = <&clk_systick>;
+       status = "okay";
+};
index b67e5be618cfd45ed9f530149d60a70438e76bc5..2630d78d9e0456b58039723151ca26128c6065d4 100644 (file)
  *     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 file; 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
        model = "Mele A1000";
        compatible = "mele,a1000", "allwinner,sun4i-a10";
 
-       soc@01c00000 {
-               emac: ethernet@01c0b000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&emac_pins_a>;
-                       phy = <&phy1>;
-                       status = "okay";
-               };
-
-               mdio@01c0b080 {
-                       phy-supply = <&reg_emac_3v3>;
-                       status = "okay";
-
-                       phy1: ethernet-phy@1 {
-                               reg = <1>;
-                       };
-               };
-
-               mmc0: mmc@01c0f000 {
-                       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";
-               };
-
-               usbphy: phy@01c13400 {
-                       usb1_vbus-supply = <&reg_usb1_vbus>;
-                       usb2_vbus-supply = <&reg_usb2_vbus>;
-                       status = "okay";
-               };
-
-               ehci0: usb@01c14000 {
-                       status = "okay";
-               };
-
-               ohci0: usb@01c14400 {
-                       status = "okay";
-               };
-
-               ahci: sata@01c18000 {
-                       status = "okay";
-               };
-
-               ehci1: usb@01c1c000 {
-                       status = "okay";
-               };
-
-               ohci1: usb@01c1c400 {
-                       status = "okay";
-               };
-
-               pinctrl@01c20800 {
-                       emac_power_pin_a1000: emac_power_pin@0 {
-                               allwinner,pins = "PH15";
-                               allwinner,function = "gpio_out";
-                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-                       };
-
-                       led_pins_a1000: led_pins@0 {
-                               allwinner,pins = "PH10", "PH20";
-                               allwinner,function = "gpio_out";
-                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-                       };
-               };
-
-               ir0: ir@01c21800 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&ir0_pins_a>;
-                       status = "okay";
-               };
-
-               uart0: serial@01c28000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&uart0_pins_a>;
-                       status = "okay";
-               };
-
-               i2c0: i2c@01c2ac00 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&i2c0_pins_a>;
-                       status = "okay";
-
-                       axp209: pmic@34 {
-                               compatible = "x-powers,axp209";
-                               reg = <0x34>;
-                               interrupts = <0>;
+       aliases {
+               serial0 = &uart0;
+       };
 
-                               interrupt-controller;
-                               #interrupt-cells = <1>;
-                       };
-               };
+       chosen {
+               stdout-path = "serial0:115200n8";
        };
 
        leds {
                enable-active-high;
                gpio = <&pio 7 15 GPIO_ACTIVE_HIGH>;
        };
+};
+
+&ahci {
+       status = "okay";
+};
 
-       reg_usb1_vbus: usb1-vbus {
-               status = "okay";
+&ehci0 {
+       status = "okay";
+};
+
+&ehci1 {
+       status = "okay";
+};
+
+&emac {
+       pinctrl-names = "default";
+       pinctrl-0 = <&emac_pins_a>;
+       phy = <&phy1>;
+       status = "okay";
+};
+
+&emac_sram {
+       status = "okay";
+};
+
+&i2c0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c0_pins_a>;
+       status = "okay";
+
+       axp209: pmic@34 {
+               compatible = "x-powers,axp209";
+               reg = <0x34>;
+               interrupts = <0>;
+
+               interrupt-controller;
+               #interrupt-cells = <1>;
+       };
+};
+
+&ir0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&ir0_rx_pins_a>;
+       status = "okay";
+};
+
+&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_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 {
+       emac_power_pin_a1000: emac_power_pin@0 {
+               allwinner,pins = "PH15";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
        };
 
-       reg_usb2_vbus: usb2-vbus {
-               status = "okay";
+       led_pins_a1000: led_pins@0 {
+               allwinner,pins = "PH10", "PH20";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
        };
 };
+
+&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 490b77c9bb36757ab5b61ea00d6cae4431fc2954..93d435670ef1eeedb2b7d62dea8d730f16790dda 100644 (file)
  *     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 file; 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
        model = "BA10 tvbox";
        compatible = "allwinner,ba10-tvbox", "allwinner,sun4i-a10";
 
-       soc@01c00000 {
-               emac: ethernet@01c0b000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&emac_pins_a>;
-                       phy = <&phy1>;
-                       status = "okay";
-               };
-
-               mdio@01c0b080 {
-                       status = "okay";
-
-                       phy1: ethernet-phy@1 {
-                               reg = <1>;
-                       };
-               };
-
-               mmc0: mmc@01c0f000 {
-                       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";
-               };
-
-               usbphy: phy@01c13400 {
-                       usb1_vbus-supply = <&reg_usb1_vbus>;
-                       usb2_vbus-supply = <&reg_usb2_vbus>;
-                       status = "okay";
-               };
-
-               ehci0: usb@01c14000 {
-                       status = "okay";
-               };
-
-               ohci0: usb@01c14400 {
-                       status = "okay";
-               };
-
-               ehci1: usb@01c1c000 {
-                       status = "okay";
-               };
-
-               ohci1: usb@01c1c400 {
-                       status = "okay";
-               };
-
-               pinctrl@01c20800 {
-                       usb2_vbus_pin_a: usb2_vbus_pin@0 {
-                               allwinner,pins = "PH12";
-                       };
-               };
-
-               ir0: ir@01c21800 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&ir0_pins_a>;
-                       status = "okay";
-               };
-
-               uart0: serial@01c28000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&uart0_pins_a>;
-                       status = "okay";
-               };
-
-               i2c0: i2c@01c2ac00 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&i2c0_pins_a>;
-                       status = "okay";
-
-                       axp209: pmic@34 {
-                               compatible = "x-powers,axp209";
-                               reg = <0x34>;
-                               interrupts = <0>;
-
-                               interrupt-controller;
-                               #interrupt-cells = <1>;
-                       };
-               };
+       aliases {
+               serial0 = &uart0;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
        };
+};
+
+&ehci0 {
+       status = "okay";
+};
+
+&ehci1 {
+       status = "okay";
+};
+
+&emac {
+       pinctrl-names = "default";
+       pinctrl-0 = <&emac_pins_a>;
+       phy = <&phy1>;
+       status = "okay";
+};
+
+&emac_sram {
+       status = "okay";
+};
+
+&i2c0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c0_pins_a>;
+       status = "okay";
+
+       axp209: pmic@34 {
+               compatible = "x-powers,axp209";
+               reg = <0x34>;
+               interrupts = <0>;
 
-       reg_usb1_vbus: usb1-vbus {
-               status = "okay";
+               interrupt-controller;
+               #interrupt-cells = <1>;
        };
+};
+
+&ir0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&ir0_rx_pins_a>;
+       status = "okay";
+};
+
+&mdio {
+       status = "okay";
 
-       reg_usb2_vbus: usb2-vbus {
-               gpio = <&pio 7 12 GPIO_ACTIVE_HIGH>;
-               status = "okay";
+       phy1: ethernet-phy@1 {
+               reg = <1>;
        };
 };
+
+&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 {
+       usb2_vbus_pin_a: usb2_vbus_pin@0 {
+               allwinner,pins = "PH12";
+       };
+};
+
+&reg_usb1_vbus {
+       status = "okay";
+};
+
+&reg_usb2_vbus {
+       gpio = <&pio 7 12 GPIO_ACTIVE_HIGH>;
+       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 58214f2495984f03f4c62d3b4006d27269028f57..5878a0b11f7be387d9d09daf10b2ee884788dcb2 100644 (file)
  *     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 file; 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
 #include "sun4i-a10.dtsi"
 #include "sunxi-common-regulators.dtsi"
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
 
 / {
        model = "Chuwi V7 CW0825";
        compatible = "chuwi,v7-cw0825", "allwinner,sun4i-a10";
+
+       aliases {
+               serial0 = &uart0;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
 };
 
 &ehci1 {
        };
 };
 
+&lradc {
+       vref-supply = <&reg_vcc3v0>;
+       status = "okay";
+
+       button@800 {
+               label = "Volume Up";
+               linux,code = <KEY_VOLUMEUP>;
+               channel = <0>;
+               voltage = <800000>;
+       };
+
+       button@1000 {
+               label = "Volume Down";
+               linux,code = <KEY_VOLUMEDOWN>;
+               channel = <0>;
+               voltage = <1000000>;
+       };
+
+       button@1200 {
+               label = "Back";
+               linux,code = <KEY_BACK>;
+               channel = <0>;
+               voltage = <1200000>;
+       };
+};
+
 &mmc0 {
        pinctrl-names = "default";
        pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>;
index 4260c2b476073dab60fefdce1d580eeb6ab6d965..9afb4e0185935ee4ffdda47e3595cc352341364a 100644 (file)
  *     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 file; 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
        model = "Cubietech Cubieboard";
        compatible = "cubietech,a10-cubieboard", "allwinner,sun4i-a10";
 
-       soc@01c00000 {
-               emac: ethernet@01c0b000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&emac_pins_a>;
-                       phy = <&phy1>;
-                       status = "okay";
-               };
-
-               mdio@01c0b080 {
-                       status = "okay";
-
-                       phy1: ethernet-phy@1 {
-                               reg = <1>;
-                       };
-               };
-
-               mmc0: mmc@01c0f000 {
-                       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";
-               };
-
-               usbphy: phy@01c13400 {
-                       usb1_vbus-supply = <&reg_usb1_vbus>;
-                       usb2_vbus-supply = <&reg_usb2_vbus>;
-                       status = "okay";
-               };
-
-               ehci0: usb@01c14000 {
-                       status = "okay";
-               };
-
-               ohci0: usb@01c14400 {
-                       status = "okay";
-               };
-
-               ahci: sata@01c18000 {
-                       target-supply = <&reg_ahci_5v>;
-                       status = "okay";
-               };
-
-               ehci1: usb@01c1c000 {
-                       status = "okay";
-               };
-
-               ohci1: usb@01c1c400 {
-                       status = "okay";
-               };
-
-               pinctrl@01c20800 {
-                       led_pins_cubieboard: led_pins@0 {
-                               allwinner,pins = "PH20", "PH21";
-                               allwinner,function = "gpio_out";
-                               allwinner,drive = <SUN4I_PINCTRL_20_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-                       };
-               };
-
-               ir0: ir@01c21800 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&ir0_pins_a>;
-                       status = "okay";
-               };
-
-               uart0: serial@01c28000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&uart0_pins_a>;
-                       status = "okay";
-               };
-
-               i2c0: i2c@01c2ac00 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&i2c0_pins_a>;
-                       status = "okay";
-
-                       axp209: pmic@34 {
-                               reg = <0x34>;
-                               interrupts = <0>;
-                       };
-               };
-
-               i2c1: i2c@01c2b000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&i2c1_pins_a>;
-                       status = "okay";
-               };
+       aliases {
+               serial0 = &uart0;
+       };
 
-               spi0: spi@01c05000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&spi0_pins_a>;
-                       status = "okay";
-               };
+       chosen {
+               stdout-path = "serial0:115200n8";
        };
 
        leds {
                        linux,default-trigger = "heartbeat";
                };
        };
+};
 
-       reg_ahci_5v: ahci-5v {
-               status = "okay";
-       };
+&ahci {
+       target-supply = <&reg_ahci_5v>;
+       status = "okay";
+};
+
+&cpu0 {
+       cpu-supply = <&reg_dcdc2>;
+};
 
-       reg_usb1_vbus: usb1-vbus {
-               status = "okay";
+&ehci0 {
+       status = "okay";
+};
+
+&ehci1 {
+       status = "okay";
+};
+
+&emac {
+       pinctrl-names = "default";
+       pinctrl-0 = <&emac_pins_a>;
+       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>;
        };
+};
 
-       reg_usb2_vbus: usb2-vbus {
-               status = "okay";
+&i2c1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c1_pins_a>;
+       status = "okay";
+};
+
+&ir0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&ir0_rx_pins_a>;
+       status = "okay";
+};
+
+&mdio {
+       status = "okay";
+
+       phy1: ethernet-phy@1 {
+               reg = <1>;
        };
 };
 
-#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";
+};
 
-&cpu0 {
-       cpu-supply = <&reg_dcdc2>;
+&ohci0 {
+       status = "okay";
 };
 
+&ohci1 {
+       status = "okay";
+};
+
+&pio {
+       led_pins_cubieboard: led_pins@0 {
+               allwinner,pins = "PH20", "PH21";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_20_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+       };
+};
+
+&reg_ahci_5v {
+       status = "okay";
+};
+
+#include "axp209.dtsi"
+
 &reg_dcdc2 {
        regulator-always-on;
        regulator-min-microvolt = <1000000>;
        regulator-max-microvolt = <3000000>;
        regulator-name = "avcc";
 };
+
+&reg_usb1_vbus {
+       status = "okay";
+};
+
+&reg_usb2_vbus {
+       status = "okay";
+};
+
+&spi0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&spi0_pins_a>,
+                   <&spi0_cs0_pins_a>;
+       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";
+};
diff --git a/arch/arm/boot/dts/sun4i-a10-gemei-g9.dts b/arch/arm/boot/dts/sun4i-a10-gemei-g9.dts
new file mode 100644 (file)
index 0000000..570754d
--- /dev/null
@@ -0,0 +1,171 @@
+/*
+ * Copyright 2015 Priit Laes
+ *
+ * Priit Laes <plaes@plaes.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 "sun4i-a10.dtsi"
+#include "sunxi-common-regulators.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+       model = "Gemei G9 Tablet";
+       compatible = "gemei,g9", "allwinner,sun4i-a10";
+
+       aliases {
+               serial0 = &uart0;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+};
+
+/*
+ * TODO:
+ *   2x cameras via CSI
+ *   bma250 IRQs
+ *   AXP battery management
+ *   NAND
+ *   OTG
+ *   Touchscreen - gt801_2plus1 @ i2c adapter 2 @ 0x48
+ */
+
+&ehci0 {
+       status = "okay";
+};
+
+&ehci1 {
+       status = "okay";
+};
+
+&i2c0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c0_pins_a>;
+       status = "okay";
+
+       axp209: pmic@34 {
+               compatible = "x-powers,axp209";
+               reg = <0x34>;
+               interrupts = <0>;
+
+               interrupt-controller;
+               #interrupt-cells = <1>;
+       };
+};
+
+&i2c1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c1_pins_a>;
+       status = "okay";
+
+       /* Accelerometer */
+       bma250@18 {
+               compatible = "bosch,bma250";
+               reg = <0x18>;
+
+               /*
+                * TODO: interrupt pins:
+                * int1 - PH00
+                * int2 - PI10
+                */
+       };
+};
+
+&lradc {
+       vref-supply = <&reg_vcc3v0>;
+
+       status = "okay";
+
+       button@158 {
+               label = "Volume Down";
+               linux,code = <KEY_VOLUMEDOWN>;
+               channel = <0>;
+               voltage = <158730>;
+       };
+
+       button@349 {
+               label = "Volume Up";
+               linux,code = <KEY_VOLUMEUP>;
+               channel = <0>;
+               voltage = <349206>;
+       };
+
+       button@1142 {
+               label = "Esc";
+               linux,code = <KEY_ESC>;
+               channel = <0>;
+               voltage = <1142856>;
+       };
+};
+
+&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>; /* PH01 */
+       cd-inverted;
+       status = "okay";
+};
+
+&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 d3f73ea25567a4d809f3604a8b3eab6509901504..2b17c519915165cf821d3c86d5af4ee634eab1f9 100644 (file)
  *     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 file; 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
        model = "Miniand Hackberry";
        compatible = "miniand,hackberry", "allwinner,sun4i-a10";
 
-       soc@01c00000 {
-               emac: ethernet@01c0b000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&emac_pins_a>;
-                       phy = <&phy0>;
-                       status = "okay";
-               };
-
-               mdio@01c0b080 {
-                       phy-supply = <&reg_emac_3v3>;
-                       status = "okay";
-
-                       phy0: ethernet-phy@0 {
-                               reg = <0>;
-                       };
-               };
-
-               mmc0: mmc@01c0f000 {
-                       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";
-               };
-
-               usbphy: phy@01c13400 {
-                       usb1_vbus-supply = <&reg_usb1_vbus>;
-                       usb2_vbus-supply = <&reg_usb2_vbus>;
-                       status = "okay";
-               };
-
-               ehci0: usb@01c14000 {
-                       status = "okay";
-               };
-
-               ohci0: usb@01c14400 {
-                       status = "okay";
-               };
-
-               ehci1: usb@01c1c000 {
-                       status = "okay";
-               };
-
-               ohci1: usb@01c1c400 {
-                       status = "okay";
-               };
-
-               pio: pinctrl@01c20800 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&hackberry_hogs>;
-
-                       hackberry_hogs: hogs@0 {
-                               allwinner,pins = "PH19";
-                               allwinner,function = "gpio_out";
-                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-                       };
-
-                       usb2_vbus_pin_hackberry: usb2_vbus_pin@0 {
-                                       allwinner,pins = "PH12";
-                                       allwinner,function = "gpio_out";
-                                       allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-                                       allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-                       };
-               };
-
-               ir0: ir@01c21800 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&ir0_pins_a>;
-                       status = "okay";
-               };
-
-               uart0: serial@01c28000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&uart0_pins_a>;
-                       status = "okay";
-               };
-
-               i2c0: i2c@01c2ac00 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&i2c0_pins_a>;
-                       status = "okay";
-
-                       axp209: pmic@34 {
-                               compatible = "x-powers,axp209";
-                               reg = <0x34>;
-                               interrupts = <0>;
-
-                               interrupt-controller;
-                               #interrupt-cells = <1>;
-                       };
-               };
+       aliases {
+               serial0 = &uart0;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
        };
 
        reg_emac_3v3: emac-3v3 {
                enable-active-high;
                gpio = <&pio 7 19 GPIO_ACTIVE_HIGH>;
        };
+};
 
-       reg_usb1_vbus: usb1-vbus {
-               status = "okay";
+&ehci0 {
+       status = "okay";
+};
+
+&ehci1 {
+       status = "okay";
+};
+
+&emac {
+       pinctrl-names = "default";
+       pinctrl-0 = <&emac_pins_a>;
+       phy = <&phy0>;
+       status = "okay";
+};
+
+&emac_sram {
+       status = "okay";
+};
+
+&ir0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&ir0_rx_pins_a>;
+       status = "okay";
+};
+
+&mdio {
+       phy-supply = <&reg_emac_3v3>;
+       status = "okay";
+
+       phy0: ethernet-phy@0 {
+               reg = <0>;
        };
+};
 
-       reg_usb2_vbus: usb2-vbus {
-               pinctrl-0 = <&usb2_vbus_pin_hackberry>;
-               gpio = <&pio 7 12 GPIO_ACTIVE_HIGH>;
-               status = "okay";
+&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 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&hackberry_hogs>;
+
+       hackberry_hogs: hogs@0 {
+               allwinner,pins = "PH19";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+       };
+
+       usb2_vbus_pin_hackberry: usb2_vbus_pin@0 {
+               allwinner,pins = "PH12";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
        };
 };
+
+&reg_usb1_vbus {
+       status = "okay";
+};
+
+&reg_usb2_vbus {
+       pinctrl-0 = <&usb2_vbus_pin_hackberry>;
+       gpio = <&pio 7 12 GPIO_ACTIVE_HIGH>;
+       status = "okay";
+};
+
+&usbphy {
+       usb1_vbus-supply = <&reg_usb1_vbus>;
+       usb2_vbus-supply = <&reg_usb2_vbus>;
+       status = "okay";
+};
+
+&uart0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart0_pins_a>;
+       status = "okay";
+};
index c88382aacc36b630903c464cbb85fc274639ab95..43f58fbe161ceccaa1f85469d97780ce68486270 100644 (file)
  *     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 file; 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
 / {
        model = "Hyundai A7HD";
        compatible = "hyundai,a7hd", "allwinner,sun4i-a10";
+
+       aliases {
+               serial0 = &uart0;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
 };
 
 &ehci1 {
index 482914333bba2759cb4b92235c25c1b6d89ac2e2..6c927a824ba20f4ac9f9c89b484fe978618a6cdc 100644 (file)
  *     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 file; 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
                serial0 = &uart0;
        };
 
-       soc@01c00000 {
-               mmc0: mmc@01c0f000 {
-                       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";
-               };
-
-               uart0: serial@01c28000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&uart0_pins_a>;
-                       status = "okay";
-               };
-
-               usbphy: phy@01c13400 {
-                       usb1_vbus-supply = <&reg_usb1_vbus>;
-                       usb2_vbus-supply = <&reg_usb2_vbus>;
-                       status = "okay";
-               };
-
-               ehci0: usb@01c14000 {
-                       status = "okay";
-               };
-
-               ohci0: usb@01c14400 {
-                       status = "okay";
-               };
-
-               ehci1: usb@01c1c000 {
-                       status = "okay";
-               };
-
-               ohci1: usb@01c1c400 {
-                       status = "okay";
-               };
-
-               i2c0: i2c@01c2ac00 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&i2c0_pins_a>;
-                       status = "okay";
-
-                       axp209: pmic@34 {
-                               compatible = "x-powers,axp209";
-                               reg = <0x34>;
-                               interrupts = <0>;
-
-                               interrupt-controller;
-                               #interrupt-cells = <1>;
-                       };
-               };
+       chosen {
+               stdout-path = "serial0:115200n8";
        };
+};
 
-       reg_usb1_vbus: usb1-vbus {
-               status = "okay";
-       };
+&ehci0 {
+       status = "okay";
+};
+
+&ehci1 {
+       status = "okay";
+};
 
-       reg_usb2_vbus: usb2-vbus {
-               status = "okay";
+&i2c0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c0_pins_a>;
+       status = "okay";
+
+       axp209: pmic@34 {
+               compatible = "x-powers,axp209";
+               reg = <0x34>;
+               interrupts = <0>;
+
+               interrupt-controller;
+               #interrupt-cells = <1>;
        };
 };
+
+&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";
+};
+
+&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";
+};
diff --git a/arch/arm/boot/dts/sun4i-a10-jesurun-q5.dts b/arch/arm/boot/dts/sun4i-a10-jesurun-q5.dts
new file mode 100644 (file)
index 0000000..dc2f2ae
--- /dev/null
@@ -0,0 +1,193 @@
+/*
+ * Copyright 2015 Gábor Nyers
+ *
+ * Gábor Nyers <gabor.nyers@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 "sun4i-a10.dtsi"
+#include "sunxi-common-regulators.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/pinctrl/sun4i-a10.h>
+
+/ {
+       model = "Jesurun Q5";
+       compatible = "jesurun,q5", "allwinner,sun4i-a10";
+
+       aliases {
+               serial0 = &uart0;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       leds {
+               compatible = "gpio-leds";
+               pinctrl-names = "default";
+               pinctrl-0 = <&led_pins_q5>;
+
+               green {
+                       label = "q5:green:usr";
+                       gpios = <&pio 7 20 GPIO_ACTIVE_HIGH>;  /* PH20 */
+               };
+
+       };
+
+       reg_emac_3v3: emac-3v3 {
+               compatible = "regulator-fixed";
+               pinctrl-names = "default";
+               pinctrl-0 = <&emac_power_pin_q5>;
+               regulator-name = "emac-3v3";
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+               enable-active-high;
+               gpio = <&pio 7 19 GPIO_ACTIVE_HIGH>;   /* PH19 */
+       };
+};
+
+&ahci {
+       status = "okay";
+};
+
+&ehci0 {
+       status = "okay";
+};
+
+&ehci1 {
+       status = "okay";
+};
+
+&emac {
+       pinctrl-names = "default";
+       pinctrl-0 = <&emac_pins_a>;
+       phy = <&phy1>;
+       status = "okay";
+};
+
+&emac_sram {
+       status = "okay";
+};
+
+&i2c0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c0_pins_a>;
+       status = "okay";
+
+       axp209: pmic@34 {
+               compatible = "x-powers,axp209";
+               reg = <0x34>;
+               interrupts = <0>;
+
+               interrupt-controller;
+               #interrupt-cells = <1>;
+       };
+};
+
+&ir0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&ir0_rx_pins_a>;
+       status = "okay";
+};
+
+&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_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 {
+       emac_power_pin_q5: emac_power_pin@0 {
+               allwinner,pins = "PH19";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+       };
+
+       led_pins_q5: led_pins@0 {
+               allwinner,pins = "PH20";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+       };
+};
+
+&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 9ee86a700c2b46b37108e132cb6c9d04681b1de4..02158bcd64ee50c19cd45d845f666c52c496484d 100644 (file)
  *     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 file; 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
        model = "HAOYU Electronics Marsboard A10";
        compatible = "haoyu,a10-marsboard", "allwinner,sun4i-a10";
 
+       aliases {
+               serial0 = &uart0;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
        leds {
                compatible = "gpio-leds";
                pinctrl-names = "default";
        status = "okay";
 };
 
+&emac_sram {
+       status = "okay";
+};
+
 &emac {
        pinctrl-names = "default";
        pinctrl-0 = <&emac_pins_a>;
 
 &spi0 {
        pinctrl-names = "default";
-       pinctrl-0 = <&spi0_pins_a>;
+       pinctrl-0 = <&spi0_pins_a>,
+                   <&spi0_cs0_pins_a>;
        status = "okay";
 };
 
index eb5fd6904a69c1feca27cced90dc297c163ba312..ebe2a04ef649a11d8b1c1d1263b3ca1300d0a2ef 100644 (file)
  *     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 file; 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
        model = "PineRiver Mini X-Plus";
        compatible = "pineriver,mini-xplus", "allwinner,sun4i-a10";
 
-       soc@01c00000 {
-               mmc0: mmc@01c0f000 {
-                       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";
-               };
-
-               usbphy: phy@01c13400 {
-                       usb1_vbus-supply = <&reg_usb1_vbus>;
-                       usb2_vbus-supply = <&reg_usb2_vbus>;
-                       status = "okay";
-               };
-
-               ehci0: usb@01c14000 {
-                       status = "okay";
-               };
-
-               ohci0: usb@01c14400 {
-                       status = "okay";
-               };
-
-               ehci1: usb@01c1c000 {
-                       status = "okay";
-               };
-
-               ohci1: usb@01c1c400 {
-                       status = "okay";
-               };
-
-               pinctrl@01c20800 {
-                       ir0_pins_a: ir0@0 {
-                               /* The ir receiver is not always populated */
-                               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
-                       };
-               };
-
-               ir0: ir@01c21800 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&ir0_pins_a>;
-                       status = "okay";
-               };
-
-               uart0: serial@01c28000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&uart0_pins_a>;
-                       status = "okay";
-               };
-
-               i2c0: i2c@01c2ac00 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&i2c0_pins_a>;
-                       status = "okay";
-
-                       axp209: pmic@34 {
-                               compatible = "x-powers,axp209";
-                               reg = <0x34>;
-                               interrupts = <0>;
-
-                               interrupt-controller;
-                               #interrupt-cells = <1>;
-                       };
-               };
+       aliases {
+               serial0 = &uart0;
        };
 
-       reg_usb1_vbus: usb1-vbus {
-               status = "okay";
+       chosen {
+               stdout-path = "serial0:115200n8";
        };
+};
+
+&ehci0 {
+       status = "okay";
+};
+
+&ehci1 {
+       status = "okay";
+};
+
+&i2c0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c0_pins_a>;
+       status = "okay";
 
-       reg_usb2_vbus: usb2-vbus {
-               status = "okay";
+       axp209: pmic@34 {
+               compatible = "x-powers,axp209";
+               reg = <0x34>;
+               interrupts = <0>;
+
+               interrupt-controller;
+               #interrupt-cells = <1>;
        };
 };
+
+&ir0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&ir0_rx_pins_a>;
+       status = "okay";
+};
+
+&ir0_rx_pins_a {
+       /* The ir receiver is not always populated */
+       allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+};
+
+&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";
+};
+
+&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 e9a6886f0d5135e93a351a3226e2d8cf73250d2b..3c7eebe170882d67623ed7ca1aa005bb662dddb3 100644 (file)
  *     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 file; 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
 / {
        model = "MK802";
        compatible = "allwinner,mk802", "allwinner,sun4i-a10";
+
+       aliases {
+               serial0 = &uart0;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
 };
 
 &ehci0 {
index 802eda494d1c4def3fceb2ca151778d31dda0f87..c861fa7e356c62d348c1c9b482c3a26afe88aeef 100644 (file)
  *     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 file; 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
 / {
        model = "MK802ii";
        compatible = "allwinner,mk802ii", "allwinner,sun4i-a10";
+
+       aliases {
+               serial0 = &uart0;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
 };
 
 &ehci0 {
index 75742f8f96f3d1800d803a7fc2b2d3bd352413f5..b64aa4eb071e34d49b384e1731657dce451aa972 100644 (file)
  *     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 file; 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
        model = "Olimex A10-OLinuXino-LIME";
        compatible = "olimex,a10-olinuxino-lime", "allwinner,sun4i-a10";
 
-       cpus {
-               cpu0: cpu@0 {
-                       /*
-                        * The A10-Lime is known to be unstable
-                        * when running at 1008 MHz
-                        */
-                       operating-points = <
-                               /* kHz    uV */
-                               912000  1350000
-                               864000  1300000
-                               624000  1250000
-                               >;
-                       cooling-max-level = <2>;
-               };
+       aliases {
+               serial0 = &uart0;
        };
 
-       soc@01c00000 {
-               emac: ethernet@01c0b000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&emac_pins_a>;
-                       phy = <&phy1>;
-                       status = "okay";
-               };
-
-               mdio@01c0b080 {
-                       status = "okay";
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
 
-                       phy1: ethernet-phy@1 {
-                               reg = <1>;
-                       };
-               };
+       leds {
+               compatible = "gpio-leds";
+               pinctrl-names = "default";
+               pinctrl-0 = <&led_pins_olinuxinolime>;
 
-               mmc0: mmc@01c0f000 {
-                       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";
+               green {
+                       label = "a10-olinuxino-lime:green:usr";
+                       gpios = <&pio 7 2 GPIO_ACTIVE_HIGH>;
+                       default-state = "on";
                };
+       };
+};
 
-               usbphy: phy@01c13400 {
-                       usb1_vbus-supply = <&reg_usb1_vbus>;
-                       usb2_vbus-supply = <&reg_usb2_vbus>;
-                       status = "okay";
-               };
+&ahci {
+       target-supply = <&reg_ahci_5v>;
+       status = "okay";
+};
 
-               ehci0: usb@01c14000 {
-                       status = "okay";
-               };
+&cpu0 {
+       /*
+        * The A10-Lime is known to be unstable when running at 1008 MHz
+        */
+       operating-points = <
+               /* kHz    uV */
+               912000  1350000
+               864000  1300000
+               624000  1250000
+               >;
+       cooling-max-level = <2>;
+};
 
-               ohci0: usb@01c14400 {
-                       status = "okay";
-               };
+&ehci0 {
+       status = "okay";
+};
 
-               ahci: sata@01c18000 {
-                       target-supply = <&reg_ahci_5v>;
-                       status = "okay";
-               };
+&ehci1 {
+       status = "okay";
+};
 
-               ehci1: usb@01c1c000 {
-                       status = "okay";
-               };
+&emac {
+       pinctrl-names = "default";
+       pinctrl-0 = <&emac_pins_a>;
+       phy = <&phy1>;
+       status = "okay";
+};
 
-               ohci1: usb@01c1c400 {
-                       status = "okay";
-               };
+&emac_sram {
+       status = "okay";
+};
 
-               pinctrl@01c20800 {
-                       ahci_pwr_pin_olinuxinolime: 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_olinuxinolime: led_pins@0 {
-                               allwinner,pins = "PH2";
-                               allwinner,function = "gpio_out";
-                               allwinner,drive = <SUN4I_PINCTRL_20_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-                       };
-               };
+&i2c0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c0_pins_a>;
+       status = "okay";
 
-               uart0: serial@01c28000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&uart0_pins_a>;
-                       status = "okay";
-               };
+       axp209: pmic@34 {
+               compatible = "x-powers,axp209";
+               reg = <0x34>;
+               interrupts = <0>;
 
-               i2c0: i2c@01c2ac00 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&i2c0_pins_a>;
-                       status = "okay";
+               interrupt-controller;
+               #interrupt-cells = <1>;
+       };
+};
 
-                       axp209: pmic@34 {
-                               compatible = "x-powers,axp209";
-                               reg = <0x34>;
-                               interrupts = <0>;
+&mdio {
+       status = "okay";
 
-                               interrupt-controller;
-                               #interrupt-cells = <1>;
-                       };
-               };
+       phy1: ethernet-phy@1 {
+               reg = <1>;
        };
+};
 
-       leds {
-               compatible = "gpio-leds";
-               pinctrl-names = "default";
-               pinctrl-0 = <&led_pins_olinuxinolime>;
+&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";
+};
 
-               green {
-                       label = "a10-olinuxino-lime:green:usr";
-                       gpios = <&pio 7 2 GPIO_ACTIVE_HIGH>;
-                       default-state = "on";
-               };
-       };
+&ohci0 {
+       status = "okay";
+};
 
-       reg_ahci_5v: ahci-5v {
-               pinctrl-0 = <&ahci_pwr_pin_olinuxinolime>;
-               gpio = <&pio 2 3 GPIO_ACTIVE_HIGH>;
-               status = "okay";
-       };
+&ohci1 {
+       status = "okay";
+};
 
-       reg_usb1_vbus: usb1-vbus {
-               status = "okay";
+&pio {
+       ahci_pwr_pin_olinuxinolime: ahci_pwr_pin@1 {
+               allwinner,pins = "PC3";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
        };
 
-       reg_usb2_vbus: usb2-vbus {
-               status = "okay";
+       led_pins_olinuxinolime: 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_olinuxinolime>;
+       gpio = <&pio 2 3 GPIO_ACTIVE_HIGH>;
+       status = "okay";
+};
+
+&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 9d1e5482cf82de3961c1fd068989271f740a4bf9..4e3e1b9d8217e356c9c11953ff84eb2eee4f48ad 100644 (file)
  *     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 file; 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
        model = "LinkSprite pcDuino";
        compatible = "linksprite,a10-pcduino", "allwinner,sun4i-a10";
 
-       soc@01c00000 {
-               emac: ethernet@01c0b000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&emac_pins_a>;
-                       phy = <&phy1>;
-                       status = "okay";
-               };
-
-               pinctrl@01c20800 {
-                       led_pins_pcduino: led_pins@0 {
-                               allwinner,pins = "PH15", "PH16";
-                               allwinner,function = "gpio_out";
-                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-                       };
-
-                       key_pins_pcduino: key_pins@0 {
-                               allwinner,pins = "PH17", "PH18", "PH19";
-                               allwinner,function = "gpio_in";
-                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-                       };
-               };
-
-               mdio@01c0b080 {
-                       status = "okay";
-
-                       phy1: ethernet-phy@1 {
-                               reg = <1>;
-                       };
-               };
-
-               mmc0: mmc@01c0f000 {
-                       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";
-               };
-
-               usbphy: phy@01c13400 {
-                       usb1_vbus-supply = <&reg_usb1_vbus>;
-                       usb2_vbus-supply = <&reg_usb2_vbus>;
-                       status = "okay";
-               };
-
-               ehci0: usb@01c14000 {
-                       status = "okay";
-               };
-
-               ohci0: usb@01c14400 {
-                       status = "okay";
-               };
-
-               ehci1: usb@01c1c000 {
-                       status = "okay";
-               };
-
-               ohci1: usb@01c1c400 {
-                       status = "okay";
-               };
-
-               uart0: serial@01c28000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&uart0_pins_a>;
-                       status = "okay";
-               };
-
-               i2c0: i2c@01c2ac00 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&i2c0_pins_a>;
-                       status = "okay";
-
-                       axp209: pmic@34 {
-                               compatible = "x-powers,axp209";
-                               reg = <0x34>;
-                               interrupts = <0>;
+       aliases {
+               serial0 = &uart0;
+       };
 
-                               interrupt-controller;
-                               #interrupt-cells = <1>;
-                       };
-               };
+       chosen {
+               stdout-path = "serial0:115200n8";
        };
 
        leds {
                        gpios = <&pio 7 19 GPIO_ACTIVE_LOW>;
                };
        };
+};
 
-       reg_usb1_vbus: usb1-vbus {
-               status = "okay";
+&ehci0 {
+       status = "okay";
+};
+
+&ehci1 {
+       status = "okay";
+};
+
+&emac {
+       pinctrl-names = "default";
+       pinctrl-0 = <&emac_pins_a>;
+       phy = <&phy1>;
+       status = "okay";
+};
+
+&emac_sram {
+       status = "okay";
+};
+
+&i2c0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c0_pins_a>;
+       status = "okay";
+
+       axp209: pmic@34 {
+               compatible = "x-powers,axp209";
+               reg = <0x34>;
+               interrupts = <0>;
+
+               interrupt-controller;
+               #interrupt-cells = <1>;
+       };
+};
+
+&mdio {
+       status = "okay";
+
+       phy1: ethernet-phy@1 {
+               reg = <1>;
+       };
+};
+
+&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 {
+       led_pins_pcduino: led_pins@0 {
+               allwinner,pins = "PH15", "PH16";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
        };
 
-       reg_usb2_vbus: usb2-vbus {
-               status = "okay";
+       key_pins_pcduino: key_pins@0 {
+               allwinner,pins = "PH17", "PH18", "PH19";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
        };
 };
+
+&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 eebb7853e00bbad39916e804453929a2935cc831..61c03d1fe5303301a7ee44f1069c3865da958313 100644 (file)
@@ -2,12 +2,43 @@
  * Copyright 2012 Stefan Roese
  * Stefan Roese <sr@denx.de>
  *
- * 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 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.
  */
 
 #include "skeleton.dtsi"
@@ -30,7 +61,8 @@
                ranges;
 
                framebuffer@0 {
-                       compatible = "allwinner,simple-framebuffer", "simple-framebuffer";
+                       compatible = "allwinner,simple-framebuffer",
+                                    "simple-framebuffer";
                        allwinner,pipeline = "de_be0-lcd0-hdmi";
                        clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 43>,
                                 <&ahb_gates 44>;
@@ -38,7 +70,8 @@
                };
 
                framebuffer@1 {
-                       compatible = "allwinner,simple-framebuffer", "simple-framebuffer";
+                       compatible = "allwinner,simple-framebuffer",
+                                    "simple-framebuffer";
                        allwinner,pipeline = "de_fe0-de_be0-lcd0-hdmi";
                        clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 43>,
                                 <&ahb_gates 44>, <&ahb_gates 46>;
                        clocks = <&cpu>;
                        clock-latency = <244144>; /* 8 32k periods */
                        operating-points = <
-                               /* kHz    uV */
+                               /* kHz    uV */
                                1008000 1400000
-                               912000  1350000
-                               864000  1300000
-                               624000  1250000
+                               912000  1350000
+                               864000  1300000
+                               624000  1250000
                                >;
                        #cooling-cells = <2>;
                        cooling-min-level = <0>;
 
                usb_clk: clk@01c200cc {
                        #clock-cells = <1>;
-                       #reset-cells = <1>;
+                       #reset-cells = <1>;
                        compatible = "allwinner,sun4i-a10-usb-clk";
                        reg = <0x01c200cc 0x4>;
                        clocks = <&pll6 1>;
-                       clock-output-names = "usb_ohci0", "usb_ohci1", "usb_phy";
+                       clock-output-names = "usb_ohci0", "usb_ohci1",
+                                            "usb_phy";
                };
 
                spi3_clk: clk@01c200d4 {
                #size-cells = <1>;
                ranges;
 
+               sram-controller@01c00000 {
+                       compatible = "allwinner,sun4i-a10-sram-controller";
+                       reg = <0x01c00000 0x30>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges;
+
+                       sram_a: sram@00000000 {
+                               compatible = "mmio-sram";
+                               reg = <0x00000000 0xc000>;
+                               #address-cells = <1>;
+                               #size-cells = <1>;
+                               ranges = <0 0x00000000 0xc000>;
+
+                               emac_sram: sram-section@8000 {
+                                       compatible = "allwinner,sun4i-a10-sram-a3-a4";
+                                       reg = <0x8000 0x4000>;
+                                       status = "disabled";
+                               };
+                       };
+
+                       sram_d: sram@00010000 {
+                               compatible = "mmio-sram";
+                               reg = <0x00010000 0x1000>;
+                               #address-cells = <1>;
+                               #size-cells = <1>;
+                               ranges = <0 0x00010000 0x1000>;
+
+                               otg_sram: sram-section@0000 {
+                                       compatible = "allwinner,sun4i-a10-sram-d";
+                                       reg = <0x0000 0x1000>;
+                                       status = "disabled";
+                               };
+                       };
+               };
+
                dma: dma-controller@01c02000 {
                        compatible = "allwinner,sun4i-a10-dma";
                        reg = <0x01c02000 0x1000>;
                        reg = <0x01c0b000 0x1000>;
                        interrupts = <55>;
                        clocks = <&ahb_gates 17>;
+                       allwinner,sram = <&emac_sram 1>;
                        status = "disabled";
                };
 
                                      "sample";
                        interrupts = <32>;
                        status = "disabled";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
                };
 
                mmc1: mmc@01c10000 {
                                      "sample";
                        interrupts = <33>;
                        status = "disabled";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
                };
 
                mmc2: mmc@01c11000 {
                                      "sample";
                        interrupts = <34>;
                        status = "disabled";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
                };
 
                mmc3: mmc@01c12000 {
                                      "sample";
                        interrupts = <35>;
                        status = "disabled";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
                };
 
                usbphy: phy@01c13400 {
                        };
 
                        mmc0_pins_a: mmc0@0 {
-                               allwinner,pins = "PF0","PF1","PF2","PF3","PF4","PF5";
+                               allwinner,pins = "PF0", "PF1", "PF2",
+                                                "PF3", "PF4", "PF5";
                                allwinner,function = "mmc0";
                                allwinner,drive = <SUN4I_PINCTRL_30_MA>;
                                allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
                                allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
                        };
 
-                       ir0_pins_a: ir0@0 {
-                               allwinner,pins = "PB3","PB4";
+                       ir0_rx_pins_a: ir0@0 {
+                               allwinner,pins = "PB4";
                                allwinner,function = "ir0";
                                allwinner,drive = <SUN4I_PINCTRL_10_MA>;
                                allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
                        };
 
-                       ir1_pins_a: ir1@0 {
-                               allwinner,pins = "PB22","PB23";
+                       ir0_tx_pins_a: ir0@1 {
+                               allwinner,pins = "PB3";
+                               allwinner,function = "ir0";
+                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+                       };
+
+                       ir1_rx_pins_a: ir1@0 {
+                               allwinner,pins = "PB23";
+                               allwinner,function = "ir1";
+                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+                       };
+
+                       ir1_tx_pins_a: ir1@1 {
+                               allwinner,pins = "PB22";
                                allwinner,function = "ir1";
                                allwinner,drive = <SUN4I_PINCTRL_10_MA>;
                                allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
                        };
 
                        spi0_pins_a: spi0@0 {
-                               allwinner,pins = "PI10", "PI11", "PI12", "PI13";
+                               allwinner,pins = "PI11", "PI12", "PI13";
+                               allwinner,function = "spi0";
+                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+                       };
+
+                       spi0_cs0_pins_a: spi0_cs0@0 {
+                               allwinner,pins = "PI10";
                                allwinner,function = "spi0";
                                allwinner,drive = <SUN4I_PINCTRL_10_MA>;
                                allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
                        };
 
                        spi1_pins_a: spi1@0 {
-                               allwinner,pins = "PI16", "PI17", "PI18", "PI19";
+                               allwinner,pins = "PI17", "PI18", "PI19";
+                               allwinner,function = "spi1";
+                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+                       };
+
+                       spi1_cs0_pins_a: spi1_cs0@0 {
+                               allwinner,pins = "PI16";
                                allwinner,function = "spi1";
                                allwinner,drive = <SUN4I_PINCTRL_10_MA>;
                                allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
                        };
 
                        spi2_pins_a: spi2@0 {
-                               allwinner,pins = "PB14", "PB15", "PB16", "PB17";
+                               allwinner,pins = "PC20", "PC21", "PC22";
                                allwinner,function = "spi2";
                                allwinner,drive = <SUN4I_PINCTRL_10_MA>;
                                allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
                        };
 
                        spi2_pins_b: spi2@1 {
-                               allwinner,pins = "PC19", "PC20", "PC21", "PC22";
+                               allwinner,pins = "PB15", "PB16", "PB17";
+                               allwinner,function = "spi2";
+                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+                       };
+
+                       spi2_cs0_pins_a: spi2_cs0@0 {
+                               allwinner,pins = "PC19";
+                               allwinner,function = "spi2";
+                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+                       };
+
+                       spi2_cs0_pins_b: spi2_cs0@1 {
+                               allwinner,pins = "PB14";
                                allwinner,function = "spi2";
                                allwinner,drive = <SUN4I_PINCTRL_10_MA>;
                                allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
diff --git a/arch/arm/boot/dts/sun5i-a10s-auxtek-t004.dts b/arch/arm/boot/dts/sun5i-a10s-auxtek-t004.dts
new file mode 100644 (file)
index 0000000..2b3511e
--- /dev/null
@@ -0,0 +1,154 @@
+/*
+ * 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 t004 A10s hdmi tv-stick";
+       compatible = "allwinner,auxtek-t004", "allwinner,sun5i-a10s";
+
+       aliases {
+               serial0 = &uart0;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       leds {
+               compatible = "gpio-leds";
+               pinctrl-names = "default";
+               pinctrl-0 = <&led_pins_t004>;
+
+               red {
+                       label = "t004-tv-dongle:red:usr";
+                       gpios = <&pio 1 2 GPIO_ACTIVE_HIGH>; /* PB2 */
+                       default-state = "on";
+               };
+       };
+
+       reg_vmmc1: vmmc1 {
+               compatible = "regulator-fixed";
+               pinctrl-names = "default";
+               pinctrl-0 = <&mmc1_vcc_en_pin_t004>;
+               regulator-name = "vmmc1";
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+               enable-active-high;
+               gpio = <&pio 1 18 GPIO_ACTIVE_HIGH>; /* PB18 */
+       };
+};
+
+&ehci0 {
+       status = "okay";
+};
+
+&mmc0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_t004>;
+       vmmc-supply = <&reg_vcc3v3>;
+       bus-width = <4>;
+       cd-gpios = <&pio 6 1 GPIO_ACTIVE_HIGH>; /* PG1 */
+       cd-inverted;
+       status = "okay";
+};
+
+&mmc1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&mmc1_pins_a>;
+       vmmc-supply = <&reg_vmmc1>;
+       bus-width = <4>;
+       non-removable;
+       cap-sdio-irq;
+       status = "okay";
+};
+
+&ohci0 {
+       status = "okay";
+};
+
+&pio {
+       mmc0_cd_pin_t004: mmc0_cd_pin@0 {
+               allwinner,pins = "PG1";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+       };
+
+       mmc1_vcc_en_pin_t004: mmc1_vcc_en_pin@0 {
+               allwinner,pins = "PB18";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+       };
+
+       led_pins_t004: led_pins@0 {
+               allwinner,pins = "PB2";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_20_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+       };
+};
+
+&reg_usb1_vbus {
+       gpio = <&pio 6 13 GPIO_ACTIVE_HIGH>; /* PG13 */
+       status = "okay";
+};
+
+&uart0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart0_pins_a>;
+       status = "okay";
+};
+
+&usb1_vbus_pin_a {
+       allwinner,pins = "PG13";
+};
+
+&usbphy {
+       usb1_vbus-supply = <&reg_usb1_vbus>;
+       status = "okay";
+};
index b21af87d9eae4e6674690a80110a10f7789808ed..46ff9407826df08827e09e6c69846f914017b1ba 100644 (file)
  *     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 file; 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
        model = "MK802-A10s";
        compatible = "allwinner,a10s-mk802", "allwinner,sun5i-a10s";
 
+       aliases {
+               serial0 = &uart0;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
        leds {
                compatible = "gpio-leds";
                pinctrl-names = "default";
index 2bbc93b935ca5bbe8f9af0536c8e0f6cf5263051..a7e19e4847f75d60050b71f219e17d80f29e5c19 100644 (file)
  *     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 file; 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
                serial2 = &uart3;
        };
 
-       soc@01c00000 {
-               emac: ethernet@01c0b000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&emac_pins_a>;
-                       phy = <&phy1>;
-                       status = "okay";
-               };
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
 
-               mdio@01c0b080 {
-                       status = "okay";
+       leds {
+               compatible = "gpio-leds";
+               pinctrl-names = "default";
+               pinctrl-0 = <&led_pins_olinuxino>;
 
-                       phy1: ethernet-phy@1 {
-                               reg = <1>;
-                       };
+               green {
+                       label = "a10s-olinuxino-micro:green:usr";
+                       gpios = <&pio 4 3 GPIO_ACTIVE_HIGH>;
+                       default-state = "on";
                };
+       };
+};
 
-               mmc0: mmc@01c0f000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_olinuxino_micro>;
-                       vmmc-supply = <&reg_vcc3v3>;
-                       bus-width = <4>;
-                       cd-gpios = <&pio 6 1 GPIO_ACTIVE_HIGH>; /* PG1 */
-                       cd-inverted;
-                       status = "okay";
-               };
+&ehci0 {
+       status = "okay";
+};
 
-               mmc1: mmc@01c10000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&mmc1_pins_a>, <&mmc1_cd_pin_olinuxino_micro>;
-                       vmmc-supply = <&reg_vcc3v3>;
-                       bus-width = <4>;
-                       cd-gpios = <&pio 6 13 GPIO_ACTIVE_HIGH>; /* PG13 */
-                       cd-inverted;
-                       status = "okay";
-               };
+&emac {
+       pinctrl-names = "default";
+       pinctrl-0 = <&emac_pins_a>;
+       phy = <&phy1>;
+       status = "okay";
+};
 
-               usbphy: phy@01c13400 {
-                       usb1_vbus-supply = <&reg_usb1_vbus>;
-                       status = "okay";
-               };
+&emac_sram {
+       status = "okay";
+};
 
-               ehci0: usb@01c14000 {
-                       status = "okay";
-               };
+&i2c0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c0_pins_a>;
+       status = "okay";
+};
 
-               ohci0: usb@01c14400 {
-                       status = "okay";
-               };
+&i2c1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c1_pins_a>;
+       status = "okay";
 
-               pinctrl@01c20800 {
-                       mmc0_cd_pin_olinuxino_micro: mmc0_cd_pin@0 {
-                               allwinner,pins = "PG1";
-                               allwinner,function = "gpio_in";
-                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
-                       };
-
-                       mmc1_cd_pin_olinuxino_micro: mmc1_cd_pin@0 {
-                               allwinner,pins = "PG13";
-                               allwinner,function = "gpio_in";
-                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
-                       };
-
-                       led_pins_olinuxino: led_pins@0 {
-                               allwinner,pins = "PE3";
-                               allwinner,function = "gpio_out";
-                               allwinner,drive = <SUN4I_PINCTRL_20_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-                       };
-
-                       usb1_vbus_pin_olinuxino_m: usb1_vbus_pin@0 {
-                               allwinner,pins = "PB10";
-                               allwinner,function = "gpio_out";
-                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-                       };
-               };
+       at24@50 {
+               compatible = "at,24c16";
+               pagesize = <16>;
+               reg = <0x50>;
+               read-only;
+       };
+};
 
-               lradc: lradc@01c22800 {
-                       vref-supply = <&reg_vcc3v0>;
-                       status = "okay";
-
-                       button@191 {
-                               label = "Volume Up";
-                               linux,code = <KEY_VOLUMEUP>;
-                               channel = <0>;
-                               voltage = <191274>;
-                       };
-
-                       button@392 {
-                               label = "Volume Down";
-                               linux,code = <KEY_VOLUMEDOWN>;
-                               channel = <0>;
-                               voltage = <392644>;
-                       };
-
-                       button@601 {
-                               label = "Menu";
-                               linux,code = <KEY_MENU>;
-                               channel = <0>;
-                               voltage = <601151>;
-                       };
-
-                       button@795 {
-                               label = "Enter";
-                               linux,code = <KEY_ENTER>;
-                               channel = <0>;
-                               voltage = <795090>;
-                       };
-
-                       button@987 {
-                               label = "Home";
-                               linux,code = <KEY_HOMEPAGE>;
-                               channel = <0>;
-                               voltage = <987387>;
-                       };
-               };
+&i2c2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c2_pins_a>;
+       status = "okay";
+};
 
-               uart0: serial@01c28000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&uart0_pins_a>;
-                       status = "okay";
-               };
+&lradc {
+       vref-supply = <&reg_vcc3v0>;
+       status = "okay";
 
-               uart2: serial@01c28800 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&uart2_pins_a>;
-                       status = "okay";
-               };
+       button@191 {
+               label = "Volume Up";
+               linux,code = <KEY_VOLUMEUP>;
+               channel = <0>;
+               voltage = <191274>;
+       };
 
-               uart3: serial@01c28c00 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&uart3_pins_a>;
-                       status = "okay";
-               };
+       button@392 {
+               label = "Volume Down";
+               linux,code = <KEY_VOLUMEDOWN>;
+               channel = <0>;
+               voltage = <392644>;
+       };
 
-               i2c0: i2c@01c2ac00 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&i2c0_pins_a>;
-                       status = "okay";
-               };
+       button@601 {
+               label = "Menu";
+               linux,code = <KEY_MENU>;
+               channel = <0>;
+               voltage = <601151>;
+       };
 
-               i2c1: i2c@01c2b000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&i2c1_pins_a>;
-                       status = "okay";
-
-                       at24@50 {
-                               compatible = "at,24c16";
-                               pagesize = <16>;
-                               reg = <0x50>;
-                               read-only;
-                       };
-               };
+       button@795 {
+               label = "Enter";
+               linux,code = <KEY_ENTER>;
+               channel = <0>;
+               voltage = <795090>;
+       };
 
-               i2c2: i2c@01c2b400 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&i2c2_pins_a>;
-                       status = "okay";
-               };
+       button@987 {
+               label = "Home";
+               linux,code = <KEY_HOMEPAGE>;
+               channel = <0>;
+               voltage = <987387>;
        };
+};
 
-       leds {
-               compatible = "gpio-leds";
-               pinctrl-names = "default";
-               pinctrl-0 = <&led_pins_olinuxino>;
+&mdio {
+       status = "okay";
 
-               green {
-                       label = "a10s-olinuxino-micro:green:usr";
-                       gpios = <&pio 4 3 GPIO_ACTIVE_HIGH>;
-                       default-state = "on";
-               };
+       phy1: ethernet-phy@1 {
+               reg = <1>;
        };
+};
+
+&mmc0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_olinuxino_micro>;
+       vmmc-supply = <&reg_vcc3v3>;
+       bus-width = <4>;
+       cd-gpios = <&pio 6 1 GPIO_ACTIVE_HIGH>; /* PG1 */
+       cd-inverted;
+       status = "okay";
+};
+
+&mmc1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&mmc1_pins_a>, <&mmc1_cd_pin_olinuxino_micro>;
+       vmmc-supply = <&reg_vcc3v3>;
+       bus-width = <4>;
+       cd-gpios = <&pio 6 13 GPIO_ACTIVE_HIGH>; /* PG13 */
+       cd-inverted;
+       status = "okay";
+};
+
+&ohci0 {
+       status = "okay";
+};
 
-       reg_usb1_vbus: usb1-vbus {
-               pinctrl-0 = <&usb1_vbus_pin_olinuxino_m>;
-               gpio = <&pio 1 10 GPIO_ACTIVE_HIGH>;
-               status = "okay";
+&pio {
+       mmc0_cd_pin_olinuxino_micro: mmc0_cd_pin@0 {
+               allwinner,pins = "PG1";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
        };
+
+       mmc1_cd_pin_olinuxino_micro: mmc1_cd_pin@0 {
+               allwinner,pins = "PG13";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+       };
+
+       led_pins_olinuxino: led_pins@0 {
+               allwinner,pins = "PE3";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_20_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+       };
+
+       usb1_vbus_pin_olinuxino_m: usb1_vbus_pin@0 {
+               allwinner,pins = "PB10";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+       };
+};
+
+&reg_usb1_vbus {
+       pinctrl-0 = <&usb1_vbus_pin_olinuxino_m>;
+       gpio = <&pio 1 10 GPIO_ACTIVE_HIGH>;
+       status = "okay";
 };
+
+&uart0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart0_pins_a>;
+       status = "okay";
+};
+
+&uart2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart2_pins_a>;
+       status = "okay";
+};
+
+&uart3 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart3_pins_a>;
+       status = "okay";
+};
+
+&usbphy {
+       usb1_vbus-supply = <&reg_usb1_vbus>;
+       status = "okay";
+};
+
index 7deddfc9df8b52196d18a3e2119dc73c06ccb619..3b057983c74a1f5e68a8fe7941fba3419d4fa5b4 100644 (file)
  *     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 file; 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
        model = "R7 A10s hdmi tv-stick";
        compatible = "allwinner,r7-tv-dongle", "allwinner,sun5i-a10s";
 
-       soc@01c00000 {
-               mmc0: mmc@01c0f000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_r7>;
-                       vmmc-supply = <&reg_vcc3v3>;
-                       bus-width = <4>;
-                       cd-gpios = <&pio 6 1 GPIO_ACTIVE_HIGH>; /* PG1 */
-                       cd-inverted;
-                       status = "okay";
-               };
-
-               mmc1: mmc@01c10000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&mmc1_pins_a>;
-                       vmmc-supply = <&reg_vcc3v3>;
-                       bus-width = <4>;
-                       non-removable;
-                       status = "okay";
-               };
-
-               usbphy: phy@01c13400 {
-                       usb1_vbus-supply = <&reg_usb1_vbus>;
-                       status = "okay";
-               };
-
-               ehci0: usb@01c14000 {
-                       status = "okay";
-               };
-
-               ohci0: usb@01c14400 {
-                       status = "okay";
-               };
-
-               pinctrl@01c20800 {
-                       mmc0_cd_pin_r7: 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_r7: led_pins@0 {
-                               allwinner,pins = "PB2";
-                               allwinner,function = "gpio_out";
-                               allwinner,drive = <SUN4I_PINCTRL_20_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-                       };
-
-                       usb1_vbus_pin_r7: usb1_vbus_pin@0 {
-                               allwinner,pins = "PG13";
-                               allwinner,function = "gpio_out";
-                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-                       };
-               };
+       aliases {
+               serial0 = &uart0;
+       };
 
-               uart0: serial@01c28000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&uart0_pins_a>;
-                       status = "okay";
-               };
+       chosen {
+               stdout-path = "serial0:115200n8";
        };
 
        leds {
                        default-state = "on";
                };
        };
+};
+
+&ehci0 {
+       status = "okay";
+};
 
-       reg_usb1_vbus: usb1-vbus {
-               pinctrl-0 = <&usb1_vbus_pin_r7>;
-               gpio = <&pio 6 13 GPIO_ACTIVE_HIGH>;
-               status = "okay";
+&mmc0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_r7>;
+       vmmc-supply = <&reg_vcc3v3>;
+       bus-width = <4>;
+       cd-gpios = <&pio 6 1 GPIO_ACTIVE_HIGH>; /* PG1 */
+       cd-inverted;
+       status = "okay";
+};
+
+&mmc1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&mmc1_pins_a>;
+       vmmc-supply = <&reg_vcc3v3>;
+       bus-width = <4>;
+       non-removable;
+       status = "okay";
+};
+
+&ohci0 {
+       status = "okay";
+};
+
+&pio {
+       mmc0_cd_pin_r7: 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_r7: led_pins@0 {
+               allwinner,pins = "PB2";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_20_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
        };
+
+       usb1_vbus_pin_r7: usb1_vbus_pin@0 {
+               allwinner,pins = "PG13";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+       };
+};
+
+&reg_usb1_vbus {
+       pinctrl-0 = <&usb1_vbus_pin_r7>;
+       gpio = <&pio 6 13 GPIO_ACTIVE_HIGH>;
+       status = "okay";
+};
+
+&uart0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart0_pins_a>;
+       status = "okay";
+};
+
+&usbphy {
+       usb1_vbus-supply = <&reg_usb1_vbus>;
+       status = "okay";
 };
index 2fd8988f310c6e25dc2d215a35ed1e633d95f83a..f11efb722bbb025cc7f0d5b7b22524e3bc060c45 100644 (file)
@@ -3,16 +3,49 @@
  *
  * Maxime Ripard <maxime.ripard@free-electrons.com>
  *
- * 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 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.
  */
 
 #include "skeleton.dtsi"
 
+#include "sun5i.dtsi"
+
 #include <dt-bindings/dma/sun4i-a10.h>
 #include <dt-bindings/pinctrl/sun4i-a10.h>
 
@@ -29,7 +62,8 @@
                ranges;
 
                framebuffer@0 {
-                       compatible = "allwinner,simple-framebuffer", "simple-framebuffer";
+                       compatible = "allwinner,simple-framebuffer",
+                                    "simple-framebuffer";
                        allwinner,pipeline = "de_be0-lcd0-hdmi";
                        clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 43>,
                                 <&ahb_gates 44>;
                };
        };
 
-       cpus {
-               cpu@0 {
-                       compatible = "arm,cortex-a8";
-               };
-       };
-
-       memory {
-               reg = <0x40000000 0x20000000>;
-       };
-
        clocks {
-               #address-cells = <1>;
-               #size-cells = <1>;
-               ranges;
-
-               /*
-                * This is a dummy clock, to be used as placeholder on
-                * other mux clocks when a specific parent clock is not
-                * yet implemented. It should be dropped when the driver
-                * is complete.
-                */
-               dummy: dummy {
-                       #clock-cells = <0>;
-                       compatible = "fixed-clock";
-                       clock-frequency = <0>;
-               };
-
-               osc24M: clk@01c20050 {
-                       #clock-cells = <0>;
-                       compatible = "allwinner,sun4i-a10-osc-clk";
-                       reg = <0x01c20050 0x4>;
-                       clock-frequency = <24000000>;
-                       clock-output-names = "osc24M";
-               };
-
-               osc32k: clk@0 {
-                       #clock-cells = <0>;
-                       compatible = "fixed-clock";
-                       clock-frequency = <32768>;
-                       clock-output-names = "osc32k";
-               };
-
-               pll1: clk@01c20000 {
-                       #clock-cells = <0>;
-                       compatible = "allwinner,sun4i-a10-pll1-clk";
-                       reg = <0x01c20000 0x4>;
-                       clocks = <&osc24M>;
-                       clock-output-names = "pll1";
-               };
-
-               pll4: clk@01c20018 {
-                       #clock-cells = <0>;
-                       compatible = "allwinner,sun4i-a10-pll1-clk";
-                       reg = <0x01c20018 0x4>;
-                       clocks = <&osc24M>;
-                       clock-output-names = "pll4";
-               };
-
-               pll5: clk@01c20020 {
-                       #clock-cells = <1>;
-                       compatible = "allwinner,sun4i-a10-pll5-clk";
-                       reg = <0x01c20020 0x4>;
-                       clocks = <&osc24M>;
-                       clock-output-names = "pll5_ddr", "pll5_other";
-               };
-
-               pll6: clk@01c20028 {
-                       #clock-cells = <1>;
-                       compatible = "allwinner,sun4i-a10-pll6-clk";
-                       reg = <0x01c20028 0x4>;
-                       clocks = <&osc24M>;
-                       clock-output-names = "pll6_sata", "pll6_other", "pll6";
-               };
-
-               /* dummy is 200M */
-               cpu: cpu@01c20054 {
-                       #clock-cells = <0>;
-                       compatible = "allwinner,sun4i-a10-cpu-clk";
-                       reg = <0x01c20054 0x4>;
-                       clocks = <&osc32k>, <&osc24M>, <&pll1>, <&dummy>;
-                       clock-output-names = "cpu";
-               };
-
-               axi: axi@01c20054 {
-                       #clock-cells = <0>;
-                       compatible = "allwinner,sun4i-a10-axi-clk";
-                       reg = <0x01c20054 0x4>;
-                       clocks = <&cpu>;
-                       clock-output-names = "axi";
-               };
-
-               axi_gates: clk@01c2005c {
-                       #clock-cells = <1>;
-                       compatible = "allwinner,sun4i-a10-axi-gates-clk";
-                       reg = <0x01c2005c 0x4>;
-                       clocks = <&axi>;
-                       clock-output-names = "axi_dram";
-               };
-
-               ahb: ahb@01c20054 {
-                       #clock-cells = <0>;
-                       compatible = "allwinner,sun4i-a10-ahb-clk";
-                       reg = <0x01c20054 0x4>;
-                       clocks = <&axi>;
-                       clock-output-names = "ahb";
-               };
-
                ahb_gates: clk@01c20060 {
                        #clock-cells = <1>;
                        compatible = "allwinner,sun5i-a10s-ahb-gates-clk";
                        reg = <0x01c20060 0x8>;
                        clocks = <&ahb>;
-                       clock-output-names = "ahb_usbotg", "ahb_ehci", "ahb_ohci",
-                               "ahb_ss", "ahb_dma", "ahb_bist", "ahb_mmc0",
-                               "ahb_mmc1", "ahb_mmc2", "ahb_nand", "ahb_sdram",
-                               "ahb_emac", "ahb_ts", "ahb_spi0", "ahb_spi1",
-                               "ahb_spi2", "ahb_gps", "ahb_stimer", "ahb_ve",
-                               "ahb_tve", "ahb_lcd", "ahb_csi", "ahb_hdmi",
-                               "ahb_de_be", "ahb_de_fe", "ahb_iep", "ahb_mali400";
-               };
-
-               apb0: apb0@01c20054 {
-                       #clock-cells = <0>;
-                       compatible = "allwinner,sun4i-a10-apb0-clk";
-                       reg = <0x01c20054 0x4>;
-                       clocks = <&ahb>;
-                       clock-output-names = "apb0";
+                       clock-output-names = "ahb_usbotg", "ahb_ehci",
+                                            "ahb_ohci", "ahb_ss", "ahb_dma",
+                                            "ahb_bist", "ahb_mmc0", "ahb_mmc1",
+                                            "ahb_mmc2", "ahb_nand",
+                                            "ahb_sdram", "ahb_emac", "ahb_ts",
+                                            "ahb_spi0", "ahb_spi1", "ahb_spi2",
+                                            "ahb_gps", "ahb_stimer", "ahb_ve",
+                                            "ahb_tve", "ahb_lcd", "ahb_csi",
+                                            "ahb_hdmi", "ahb_de_be",
+                                            "ahb_de_fe", "ahb_iep",
+                                            "ahb_mali400";
                };
 
                apb0_gates: clk@01c20068 {
                        compatible = "allwinner,sun5i-a10s-apb0-gates-clk";
                        reg = <0x01c20068 0x4>;
                        clocks = <&apb0>;
-                       clock-output-names = "apb0_codec", "apb0_iis", "apb0_pio",
-                               "apb0_ir", "apb0_keypad";
-               };
-
-               apb1: clk@01c20058 {
-                       #clock-cells = <0>;
-                       compatible = "allwinner,sun4i-a10-apb1-clk";
-                       reg = <0x01c20058 0x4>;
-                       clocks = <&osc24M>, <&pll6 1>, <&osc32k>;
-                       clock-output-names = "apb1";
+                       clock-output-names = "apb0_codec", "apb0_iis",
+                                            "apb0_pio", "apb0_ir",
+                                            "apb0_keypad";
                };
 
                apb1_gates: clk@01c2006c {
                                "apb1_i2c2", "apb1_uart0", "apb1_uart1",
                                "apb1_uart2", "apb1_uart3";
                };
-
-               nand_clk: clk@01c20080 {
-                       #clock-cells = <0>;
-                       compatible = "allwinner,sun4i-a10-mod0-clk";
-                       reg = <0x01c20080 0x4>;
-                       clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
-                       clock-output-names = "nand";
-               };
-
-               ms_clk: clk@01c20084 {
-                       #clock-cells = <0>;
-                       compatible = "allwinner,sun4i-a10-mod0-clk";
-                       reg = <0x01c20084 0x4>;
-                       clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
-                       clock-output-names = "ms";
-               };
-
-               mmc0_clk: clk@01c20088 {
-                       #clock-cells = <1>;
-                       compatible = "allwinner,sun4i-a10-mmc-clk";
-                       reg = <0x01c20088 0x4>;
-                       clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
-                       clock-output-names = "mmc0",
-                                            "mmc0_output",
-                                            "mmc0_sample";
-               };
-
-               mmc1_clk: clk@01c2008c {
-                       #clock-cells = <1>;
-                       compatible = "allwinner,sun4i-a10-mmc-clk";
-                       reg = <0x01c2008c 0x4>;
-                       clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
-                       clock-output-names = "mmc1",
-                                            "mmc1_output",
-                                            "mmc1_sample";
-               };
-
-               mmc2_clk: clk@01c20090 {
-                       #clock-cells = <1>;
-                       compatible = "allwinner,sun4i-a10-mmc-clk";
-                       reg = <0x01c20090 0x4>;
-                       clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
-                       clock-output-names = "mmc2",
-                                            "mmc2_output",
-                                            "mmc2_sample";
-               };
-
-               ts_clk: clk@01c20098 {
-                       #clock-cells = <0>;
-                       compatible = "allwinner,sun4i-a10-mod0-clk";
-                       reg = <0x01c20098 0x4>;
-                       clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
-                       clock-output-names = "ts";
-               };
-
-               ss_clk: clk@01c2009c {
-                       #clock-cells = <0>;
-                       compatible = "allwinner,sun4i-a10-mod0-clk";
-                       reg = <0x01c2009c 0x4>;
-                       clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
-                       clock-output-names = "ss";
-               };
-
-               spi0_clk: clk@01c200a0 {
-                       #clock-cells = <0>;
-                       compatible = "allwinner,sun4i-a10-mod0-clk";
-                       reg = <0x01c200a0 0x4>;
-                       clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
-                       clock-output-names = "spi0";
-               };
-
-               spi1_clk: clk@01c200a4 {
-                       #clock-cells = <0>;
-                       compatible = "allwinner,sun4i-a10-mod0-clk";
-                       reg = <0x01c200a4 0x4>;
-                       clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
-                       clock-output-names = "spi1";
-               };
-
-               spi2_clk: clk@01c200a8 {
-                       #clock-cells = <0>;
-                       compatible = "allwinner,sun4i-a10-mod0-clk";
-                       reg = <0x01c200a8 0x4>;
-                       clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
-                       clock-output-names = "spi2";
-               };
-
-               ir0_clk: clk@01c200b0 {
-                       #clock-cells = <0>;
-                       compatible = "allwinner,sun4i-a10-mod0-clk";
-                       reg = <0x01c200b0 0x4>;
-                       clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
-                       clock-output-names = "ir0";
-               };
-
-               usb_clk: clk@01c200cc {
-                       #clock-cells = <1>;
-                       #reset-cells = <1>;
-                       compatible = "allwinner,sun5i-a13-usb-clk";
-                       reg = <0x01c200cc 0x4>;
-                       clocks = <&pll6 1>;
-                       clock-output-names = "usb_ohci0", "usb_phy";
-               };
-
-               mbus_clk: clk@01c2015c {
-                       #clock-cells = <0>;
-                       compatible = "allwinner,sun5i-a13-mbus-clk";
-                       reg = <0x01c2015c 0x4>;
-                       clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
-                       clock-output-names = "mbus";
-               };
        };
 
        soc@01c00000 {
-               compatible = "simple-bus";
-               #address-cells = <1>;
-               #size-cells = <1>;
-               ranges;
-
-               dma: dma-controller@01c02000 {
-                       compatible = "allwinner,sun4i-a10-dma";
-                       reg = <0x01c02000 0x1000>;
-                       interrupts = <27>;
-                       clocks = <&ahb_gates 6>;
-                       #dma-cells = <2>;
-               };
-
-               spi0: spi@01c05000 {
-                       compatible = "allwinner,sun4i-a10-spi";
-                       reg = <0x01c05000 0x1000>;
-                       interrupts = <10>;
-                       clocks = <&ahb_gates 20>, <&spi0_clk>;
-                       clock-names = "ahb", "mod";
-                       dmas = <&dma SUN4I_DMA_DEDICATED 27>,
-                              <&dma SUN4I_DMA_DEDICATED 26>;
-                       dma-names = "rx", "tx";
-                       status = "disabled";
-                       #address-cells = <1>;
-                       #size-cells = <0>;
-               };
-
-               spi1: spi@01c06000 {
-                       compatible = "allwinner,sun4i-a10-spi";
-                       reg = <0x01c06000 0x1000>;
-                       interrupts = <11>;
-                       clocks = <&ahb_gates 21>, <&spi1_clk>;
-                       clock-names = "ahb", "mod";
-                       dmas = <&dma SUN4I_DMA_DEDICATED 9>,
-                              <&dma SUN4I_DMA_DEDICATED 8>;
-                       dma-names = "rx", "tx";
-                       status = "disabled";
-                       #address-cells = <1>;
-                       #size-cells = <0>;
-               };
-
                emac: ethernet@01c0b000 {
                        compatible = "allwinner,sun4i-a10-emac";
                        reg = <0x01c0b000 0x1000>;
                        interrupts = <55>;
                        clocks = <&ahb_gates 17>;
+                       allwinner,sram = <&emac_sram 1>;
                        status = "disabled";
                };
 
                        #size-cells = <0>;
                };
 
-               mmc0: mmc@01c0f000 {
-                       compatible = "allwinner,sun5i-a13-mmc";
-                       reg = <0x01c0f000 0x1000>;
-                       clocks = <&ahb_gates 8>,
-                                <&mmc0_clk 0>,
-                                <&mmc0_clk 1>,
-                                <&mmc0_clk 2>;
-                       clock-names = "ahb",
-                                     "mmc",
-                                     "output",
-                                     "sample";
-                       interrupts = <32>;
-                       status = "disabled";
-               };
-
-               mmc1: mmc@01c10000 {
-                       compatible = "allwinner,sun5i-a13-mmc";
-                       reg = <0x01c10000 0x1000>;
-                       clocks = <&ahb_gates 9>,
-                                <&mmc1_clk 0>,
-                                <&mmc1_clk 1>,
-                                <&mmc1_clk 2>;
-                       clock-names = "ahb",
-                                     "mmc",
-                                     "output",
-                                     "sample";
-                       interrupts = <33>;
-                       status = "disabled";
-               };
-
-               mmc2: mmc@01c11000 {
-                       compatible = "allwinner,sun5i-a13-mmc";
-                       reg = <0x01c11000 0x1000>;
-                       clocks = <&ahb_gates 10>,
-                                <&mmc2_clk 0>,
-                                <&mmc2_clk 1>,
-                                <&mmc2_clk 2>;
-                       clock-names = "ahb",
-                                     "mmc",
-                                     "output",
-                                     "sample";
-                       interrupts = <34>;
-                       status = "disabled";
-               };
-
-               usbphy: phy@01c13400 {
-                       #phy-cells = <1>;
-                       compatible = "allwinner,sun5i-a13-usb-phy";
-                       reg = <0x01c13400 0x10 0x01c14800 0x4>;
-                       reg-names = "phy_ctrl", "pmu1";
-                       clocks = <&usb_clk 8>;
-                       clock-names = "usb_phy";
-                       resets = <&usb_clk 0>, <&usb_clk 1>;
-                       reset-names = "usb0_reset", "usb1_reset";
-                       status = "disabled";
-               };
-
-               ehci0: usb@01c14000 {
-                       compatible = "allwinner,sun5i-a10s-ehci", "generic-ehci";
-                       reg = <0x01c14000 0x100>;
-                       interrupts = <39>;
-                       clocks = <&ahb_gates 1>;
-                       phys = <&usbphy 1>;
-                       phy-names = "usb";
-                       status = "disabled";
-               };
-
-               ohci0: usb@01c14400 {
-                       compatible = "allwinner,sun5i-a10s-ohci", "generic-ohci";
-                       reg = <0x01c14400 0x100>;
-                       interrupts = <40>;
-                       clocks = <&usb_clk 6>, <&ahb_gates 2>;
-                       phys = <&usbphy 1>;
-                       phy-names = "usb";
-                       status = "disabled";
-               };
-
-               spi2: spi@01c17000 {
-                       compatible = "allwinner,sun4i-a10-spi";
-                       reg = <0x01c17000 0x1000>;
-                       interrupts = <12>;
-                       clocks = <&ahb_gates 22>, <&spi2_clk>;
-                       clock-names = "ahb", "mod";
-                       dmas = <&dma SUN4I_DMA_DEDICATED 29>,
-                              <&dma SUN4I_DMA_DEDICATED 28>;
-                       dma-names = "rx", "tx";
-                       status = "disabled";
-                       #address-cells = <1>;
-                       #size-cells = <0>;
-               };
-
-               intc: interrupt-controller@01c20400 {
-                       compatible = "allwinner,sun4i-a10-ic";
-                       reg = <0x01c20400 0x400>;
-                       interrupt-controller;
-                       #interrupt-cells = <1>;
-               };
-
-               pio: pinctrl@01c20800 {
-                       compatible = "allwinner,sun5i-a10s-pinctrl";
-                       reg = <0x01c20800 0x400>;
-                       interrupts = <28>;
-                       clocks = <&apb0_gates 5>;
-                       gpio-controller;
-                       interrupt-controller;
-                       #interrupt-cells = <2>;
-                       #size-cells = <0>;
-                       #gpio-cells = <3>;
-
-                       uart0_pins_a: uart0@0 {
-                               allwinner,pins = "PB19", "PB20";
-                               allwinner,function = "uart0";
-                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-                       };
-
-                       uart2_pins_a: uart2@0 {
-                               allwinner,pins = "PC18", "PC19";
-                               allwinner,function = "uart2";
-                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-                               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",
-                                               "PA7", "PA8", "PA9", "PA10",
-                                               "PA11", "PA12", "PA13", "PA14",
-                                               "PA15", "PA16";
-                               allwinner,function = "emac";
-                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-                       };
-
-                       i2c0_pins_a: i2c0@0 {
-                               allwinner,pins = "PB0", "PB1";
-                               allwinner,function = "i2c0";
-                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-                       };
-
-                       i2c1_pins_a: i2c1@0 {
-                               allwinner,pins = "PB15", "PB16";
-                               allwinner,function = "i2c1";
-                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-                       };
-
-                       i2c2_pins_a: i2c2@0 {
-                               allwinner,pins = "PB17", "PB18";
-                               allwinner,function = "i2c2";
-                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-                       };
-
-                       mmc0_pins_a: mmc0@0 {
-                               allwinner,pins = "PF0","PF1","PF2","PF3","PF4","PF5";
-                               allwinner,function = "mmc0";
-                               allwinner,drive = <SUN4I_PINCTRL_30_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-                       };
-
-                       mmc1_pins_a: mmc1@0 {
-                               allwinner,pins = "PG3","PG4","PG5","PG6","PG7","PG8";
-                               allwinner,function = "mmc1";
-                               allwinner,drive = <SUN4I_PINCTRL_30_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-                       };
-               };
-
-               timer@01c20c00 {
-                       compatible = "allwinner,sun4i-a10-timer";
-                       reg = <0x01c20c00 0x90>;
-                       interrupts = <22>;
-                       clocks = <&osc24M>;
-               };
-
-               wdt: watchdog@01c20c90 {
-                       compatible = "allwinner,sun4i-a10-wdt";
-                       reg = <0x01c20c90 0x10>;
-               };
-
-               lradc: lradc@01c22800 {
-                       compatible = "allwinner,sun4i-a10-lradc-keys";
-                       reg = <0x01c22800 0x100>;
-                       interrupts = <31>;
-                       status = "disabled";
-               };
-
-               sid: eeprom@01c23800 {
-                       compatible = "allwinner,sun4i-a10-sid";
-                       reg = <0x01c23800 0x10>;
-               };
-
-               rtp: rtp@01c25000 {
-                       compatible = "allwinner,sun4i-a10-ts";
-                       reg = <0x01c25000 0x100>;
-                       interrupts = <29>;
-                       #thermal-sensor-cells = <0>;
-               };
-
                uart0: serial@01c28000 {
                        compatible = "snps,dw-apb-uart";
                        reg = <0x01c28000 0x400>;
                        status = "disabled";
                };
 
-               uart1: serial@01c28400 {
-                       compatible = "snps,dw-apb-uart";
-                       reg = <0x01c28400 0x400>;
-                       interrupts = <2>;
-                       reg-shift = <2>;
-                       reg-io-width = <4>;
-                       clocks = <&apb1_gates 17>;
-                       status = "disabled";
-               };
-
                uart2: serial@01c28800 {
                        compatible = "snps,dw-apb-uart";
                        reg = <0x01c28800 0x400>;
                        clocks = <&apb1_gates 18>;
                        status = "disabled";
                };
+       };
+};
 
-               uart3: serial@01c28c00 {
-                       compatible = "snps,dw-apb-uart";
-                       reg = <0x01c28c00 0x400>;
-                       interrupts = <4>;
-                       reg-shift = <2>;
-                       reg-io-width = <4>;
-                       clocks = <&apb1_gates 19>;
-                       status = "disabled";
-               };
+&pio {
+       compatible = "allwinner,sun5i-a10s-pinctrl";
 
-               i2c0: i2c@01c2ac00 {
-                       #address-cells = <1>;
-                       #size-cells = <0>;
-                       compatible = "allwinner,sun5i-a10s-i2c", "allwinner,sun4i-a10-i2c";
-                       reg = <0x01c2ac00 0x400>;
-                       interrupts = <7>;
-                       clocks = <&apb1_gates 0>;
-                       status = "disabled";
-               };
+       uart0_pins_a: uart0@0 {
+               allwinner,pins = "PB19", "PB20";
+               allwinner,function = "uart0";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+       };
 
-               i2c1: i2c@01c2b000 {
-                       #address-cells = <1>;
-                       #size-cells = <0>;
-                       compatible = "allwinner,sun5i-a10s-i2c", "allwinner,sun4i-a10-i2c";
-                       reg = <0x01c2b000 0x400>;
-                       interrupts = <8>;
-                       clocks = <&apb1_gates 1>;
-                       status = "disabled";
-               };
+       uart2_pins_a: uart2@0 {
+               allwinner,pins = "PC18", "PC19";
+               allwinner,function = "uart2";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+       };
 
-               i2c2: i2c@01c2b400 {
-                       #address-cells = <1>;
-                       #size-cells = <0>;
-                       compatible = "allwinner,sun5i-a10s-i2c", "allwinner,sun4i-a10-i2c";
-                       reg = <0x01c2b400 0x400>;
-                       interrupts = <9>;
-                       clocks = <&apb1_gates 2>;
-                       status = "disabled";
-               };
+       uart3_pins_a: uart3@0 {
+               allwinner,pins = "PG9", "PG10";
+               allwinner,function = "uart3";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+       };
 
-               timer@01c60000 {
-                       compatible = "allwinner,sun5i-a13-hstimer";
-                       reg = <0x01c60000 0x1000>;
-                       interrupts = <82>, <83>;
-                       clocks = <&ahb_gates 28>;
-               };
+       emac_pins_a: emac0@0 {
+               allwinner,pins = "PA0", "PA1", "PA2",
+                               "PA3", "PA4", "PA5", "PA6",
+                               "PA7", "PA8", "PA9", "PA10",
+                               "PA11", "PA12", "PA13", "PA14",
+                               "PA15", "PA16";
+               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";
+               allwinner,function = "mmc1";
+               allwinner,drive = <SUN4I_PINCTRL_30_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+       };
+};
+
+&sram_a {
+       emac_sram: sram-section@8000 {
+               compatible = "allwinner,sun4i-a10-sram-a3-a4";
+               reg = <0x8000 0x4000>;
+               status = "disabled";
        };
 };
index 03aa04555630ed0067b77a402f52d068046468d8..990f9d61ae4d01756a812fe2a7b4fc7c5b9cae2f 100644 (file)
  *     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 file; 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
                serial0 = &uart1;
        };
 
-       soc@01c00000 {
-               mmc0: mmc@01c0f000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_h702>;
-                       vmmc-supply = <&reg_vcc3v3>;
-                       bus-width = <4>;
-                       cd-gpios = <&pio 6 0 GPIO_ACTIVE_HIGH>; /* PG0 */
-                       cd-inverted;
-                       status = "okay";
-               };
-
-               usbphy: phy@01c13400 {
-                       usb1_vbus-supply = <&reg_ldo3>;
-                       status = "okay";
-               };
-
-               ehci0: usb@01c14000 {
-                       status = "okay";
-               };
-
-               ohci0: usb@01c14400 {
-                       status = "okay";
-               };
-
-               pinctrl@01c20800 {
-                       mmc0_cd_pin_h702: mmc0_cd_pin@0 {
-                               allwinner,pins = "PG0";
-                               allwinner,function = "gpio_in";
-                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
-                       };
-               };
-
-               uart1: serial@01c28400 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&uart1_pins_b>;
-                       status = "okay";
-               };
-
-               i2c0: i2c@01c2ac00 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&i2c0_pins_a>;
-                       status = "okay";
-
-                       axp209: pmic@34 {
-                               reg = <0x34>;
-                               interrupts = <0>;
-                       };
-               };
-
-               i2c1: i2c@01c2b000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&i2c1_pins_a>;
-                       status = "okay";
-
-                       pcf8563: rtc@51 {
-                               compatible = "nxp,pcf8563";
-                               reg = <0x51>;
-                       };
-               };
-
-               i2c2: i2c@01c2b400 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&i2c2_pins_a>;
-                       status = "okay";
-               };
+       chosen {
+               stdout-path = "serial0:115200n8";
        };
 };
 
-#include "axp209.dtsi"
-
 &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>;
+       };
+};
+
+&i2c1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c1_pins_a>;
+       status = "okay";
+
+       pcf8563: rtc@51 {
+               compatible = "nxp,pcf8563";
+               reg = <0x51>;
+       };
+};
+
+&i2c2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c2_pins_a>;
+       status = "okay";
+};
+
+&mmc0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_h702>;
+       vmmc-supply = <&reg_vcc3v3>;
+       bus-width = <4>;
+       cd-gpios = <&pio 6 0 GPIO_ACTIVE_HIGH>; /* PG0 */
+       cd-inverted;
+       status = "okay";
+};
+
+&ohci0 {
+       status = "okay";
+};
+
+&pio {
+       mmc0_cd_pin_h702: mmc0_cd_pin@0 {
+               allwinner,pins = "PG0";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+       };
+};
+
+#include "axp209.dtsi"
+
 &reg_dcdc2 {
        regulator-always-on;
        regulator-min-microvolt = <1000000>;
        regulator-max-microvolt = <3300000>;
        regulator-name = "vcc-wifi";
 };
+
+&uart1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart1_pins_b>;
+       status = "okay";
+};
+
+&usbphy {
+       usb1_vbus-supply = <&reg_ldo3>;
+       status = "okay";
+};
index 03deb84268cebac916c225424f5cd3697dd682e4..ad84fe4276c9594748ab234d5b9c38a8dc87dfe0 100644 (file)
  *     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 file; 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
                serial0 = &uart1;
        };
 
-       soc@01c00000 {
-               mmc0: mmc@01c0f000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_olinuxinom>;
-                       vmmc-supply = <&reg_vcc3v3>;
-                       bus-width = <4>;
-                       cd-gpios = <&pio 6 0 GPIO_ACTIVE_HIGH>; /* PG0 */
-                       cd-inverted;
-                       status = "okay";
-               };
-
-               usbphy: phy@01c13400 {
-                       usb1_vbus-supply = <&reg_usb1_vbus>;
-                       status = "okay";
-               };
-
-               ehci0: usb@01c14000 {
-                       status = "okay";
-               };
-
-               ohci0: usb@01c14400 {
-                       status = "okay";
-               };
-
-               pinctrl@01c20800 {
-                       mmc0_cd_pin_olinuxinom: mmc0_cd_pin@0 {
-                               allwinner,pins = "PG0";
-                               allwinner,function = "gpio_in";
-                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
-                       };
-
-                       led_pins_olinuxinom: led_pins@0 {
-                               allwinner,pins = "PG9";
-                               allwinner,function = "gpio_out";
-                               allwinner,drive = <SUN4I_PINCTRL_20_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-                       };
-
-                       usb1_vbus_pin_olinuxinom: usb1_vbus_pin@0 {
-                               allwinner,pins = "PG11";
-                               allwinner,function = "gpio_out";
-                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-                       };
-               };
-
-               uart1: serial@01c28400 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&uart1_pins_b>;
-                       status = "okay";
-               };
-
-               i2c0: i2c@01c2ac00 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&i2c0_pins_a>;
-                       status = "okay";
-               };
-
-               i2c1: i2c@01c2b000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&i2c1_pins_a>;
-                       status = "okay";
-               };
-
-               i2c2: i2c@01c2b400 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&i2c2_pins_a>;
-                       status = "okay";
-               };
+       chosen {
+               stdout-path = "serial0:115200n8";
        };
 
        leds {
                        default-state = "on";
                };
        };
+};
+
+&ehci0 {
+       status = "okay";
+};
 
-       reg_usb1_vbus: usb1-vbus {
-               pinctrl-0 = <&usb1_vbus_pin_olinuxinom>;
-               gpio = <&pio 6 11 GPIO_ACTIVE_HIGH>;
-               status = "okay";
+&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>;
+       status = "okay";
+};
+
+&mmc0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_olinuxinom>;
+       vmmc-supply = <&reg_vcc3v3>;
+       bus-width = <4>;
+       cd-gpios = <&pio 6 0 GPIO_ACTIVE_HIGH>; /* PG0 */
+       cd-inverted;
+       status = "okay";
+};
+
+&ohci0 {
+       status = "okay";
+};
+
+&pio {
+       mmc0_cd_pin_olinuxinom: mmc0_cd_pin@0 {
+               allwinner,pins = "PG0";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
        };
+
+       led_pins_olinuxinom: led_pins@0 {
+               allwinner,pins = "PG9";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_20_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+       };
+
+       usb1_vbus_pin_olinuxinom: usb1_vbus_pin@0 {
+               allwinner,pins = "PG11";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+       };
+};
+
+&reg_usb1_vbus {
+       pinctrl-0 = <&usb1_vbus_pin_olinuxinom>;
+       gpio = <&pio 6 11 GPIO_ACTIVE_HIGH>;
+       status = "okay";
+};
+
+&uart1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart1_pins_b>;
+       status = "okay";
+};
+
+&usbphy {
+       usb1_vbus-supply = <&reg_usb1_vbus>;
+       status = "okay";
 };
index 6b24876ed462907f805e3e658ab8e8d0b93ae20c..42324005eb7c0ead40426a9eefcd9b4449423c1b 100644 (file)
  *     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 file; 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
                serial0 = &uart1;
        };
 
-       soc@01c00000 {
-               mmc0: mmc@01c0f000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_olinuxino>;
-                       vmmc-supply = <&reg_vcc3v3>;
-                       bus-width = <4>;
-                       cd-gpios = <&pio 6 0 GPIO_ACTIVE_HIGH>; /* PG0 */
-                       cd-inverted;
-                       status = "okay";
-               };
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
 
-               usbphy: phy@01c13400 {
-                       usb1_vbus-supply = <&reg_usb1_vbus>;
-                       status = "okay";
-               };
+       leds {
+               compatible = "gpio-leds";
+               pinctrl-names = "default";
+               pinctrl-0 = <&led_pins_olinuxino>;
 
-               ehci0: usb@01c14000 {
-                       status = "okay";
+               power {
+                       gpios = <&pio 6 9 GPIO_ACTIVE_HIGH>;
+                       default-state = "on";
                };
+       };
+};
 
-               ohci0: usb@01c14400 {
-                       status = "okay";
-               };
+&ehci0 {
+       status = "okay";
+};
 
-               pinctrl@01c20800 {
-                       mmc0_cd_pin_olinuxino: mmc0_cd_pin@0 {
-                               allwinner,pins = "PG0";
-                               allwinner,function = "gpio_in";
-                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
-                       };
-
-                       led_pins_olinuxino: led_pins@0 {
-                               allwinner,pins = "PG9";
-                               allwinner,function = "gpio_out";
-                               allwinner,drive = <SUN4I_PINCTRL_20_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-                       };
-
-                       usb1_vbus_pin_olinuxino: usb1_vbus_pin@0 {
-                               allwinner,pins = "PG11";
-                               allwinner,function = "gpio_out";
-                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-                       };
-               };
+&i2c0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c0_pins_a>;
+       status = "okay";
 
-               lradc: lradc@01c22800 {
-                       vref-supply = <&reg_vcc3v0>;
-                       status = "okay";
-
-                       button@191 {
-                               label = "Volume Up";
-                               linux,code = <KEY_VOLUMEUP>;
-                               channel = <0>;
-                               voltage = <191274>;
-                       };
-
-                       button@392 {
-                               label = "Volume Down";
-                               linux,code = <KEY_VOLUMEDOWN>;
-                               channel = <0>;
-                               voltage = <392644>;
-                       };
-
-                       button@601 {
-                               label = "Menu";
-                               linux,code = <KEY_MENU>;
-                               channel = <0>;
-                               voltage = <601151>;
-                       };
-
-                       button@795 {
-                               label = "Enter";
-                               linux,code = <KEY_ENTER>;
-                               channel = <0>;
-                               voltage = <795090>;
-                       };
-
-                       button@987 {
-                               label = "Home";
-                               linux,code = <KEY_HOMEPAGE>;
-                               channel = <0>;
-                               voltage = <987387>;
-                       };
-               };
+       axp209: pmic@34 {
+               compatible = "x-powers,axp209";
+               reg = <0x34>;
+               interrupts = <0>;
 
-               uart1: serial@01c28400 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&uart1_pins_b>;
-                       status = "okay";
-               };
+               interrupt-controller;
+               #interrupt-cells = <1>;
+       };
+};
 
-               i2c0: i2c@01c2ac00 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&i2c0_pins_a>;
-                       status = "okay";
+&i2c1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c1_pins_a>;
+       status = "okay";
+};
 
-                       axp209: pmic@34 {
-                               compatible = "x-powers,axp209";
-                               reg = <0x34>;
-                               interrupts = <0>;
+&i2c2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c2_pins_a>;
+       status = "okay";
+};
 
-                               interrupt-controller;
-                               #interrupt-cells = <1>;
-                       };
-               };
+&lradc {
+       vref-supply = <&reg_vcc3v0>;
+       status = "okay";
 
-               i2c1: i2c@01c2b000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&i2c1_pins_a>;
-                       status = "okay";
-               };
+       button@191 {
+               label = "Volume Up";
+               linux,code = <KEY_VOLUMEUP>;
+               channel = <0>;
+               voltage = <191274>;
+       };
 
-               i2c2: i2c@01c2b400 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&i2c2_pins_a>;
-                       status = "okay";
-               };
+       button@392 {
+               label = "Volume Down";
+               linux,code = <KEY_VOLUMEDOWN>;
+               channel = <0>;
+               voltage = <392644>;
        };
 
-       leds {
-               compatible = "gpio-leds";
-               pinctrl-names = "default";
-               pinctrl-0 = <&led_pins_olinuxino>;
+       button@601 {
+               label = "Menu";
+               linux,code = <KEY_MENU>;
+               channel = <0>;
+               voltage = <601151>;
+       };
 
-               power {
-                       gpios = <&pio 6 9 GPIO_ACTIVE_HIGH>;
-                       default-state = "on";
-               };
+       button@795 {
+               label = "Enter";
+               linux,code = <KEY_ENTER>;
+               channel = <0>;
+               voltage = <795090>;
+       };
+
+       button@987 {
+               label = "Home";
+               linux,code = <KEY_HOMEPAGE>;
+               channel = <0>;
+               voltage = <987387>;
+       };
+};
+
+&mmc0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_olinuxino>;
+       vmmc-supply = <&reg_vcc3v3>;
+       bus-width = <4>;
+       cd-gpios = <&pio 6 0 GPIO_ACTIVE_HIGH>; /* PG0 */
+       cd-inverted;
+       status = "okay";
+};
+
+&ohci0 {
+       status = "okay";
+};
+
+&pio {
+       mmc0_cd_pin_olinuxino: mmc0_cd_pin@0 {
+               allwinner,pins = "PG0";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+       };
+
+       led_pins_olinuxino: led_pins@0 {
+               allwinner,pins = "PG9";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_20_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
        };
 
-       reg_usb1_vbus: usb1-vbus {
-               pinctrl-0 = <&usb1_vbus_pin_olinuxino>;
-               gpio = <&pio 6 11 GPIO_ACTIVE_HIGH>;
-               status = "okay";
+       usb1_vbus_pin_olinuxino: usb1_vbus_pin@0 {
+               allwinner,pins = "PG11";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
        };
 };
+
+&reg_usb1_vbus {
+       pinctrl-0 = <&usb1_vbus_pin_olinuxino>;
+       gpio = <&pio 6 11 GPIO_ACTIVE_HIGH>;
+       status = "okay";
+};
+
+&uart1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart1_pins_b>;
+       status = "okay";
+};
+
+&usbphy {
+       usb1_vbus-supply = <&reg_usb1_vbus>;
+       status = "okay";
+};
diff --git a/arch/arm/boot/dts/sun5i-a13-utoo-p66.dts b/arch/arm/boot/dts/sun5i-a13-utoo-p66.dts
new file mode 100644 (file)
index 0000000..514f159
--- /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 "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 = "Utoo P66";
+       compatible = "utoo,p66", "allwinner,sun5i-a13";
+
+       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 6 12 GPIO_ACTIVE_HIGH>, /* PG12, sda */
+                       <&pio 6 10 GPIO_ACTIVE_HIGH>; /* PG10, scl */
+               i2c-gpio,delay-us = <5>;
+       };
+};
+
+&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";
+
+       icn8318: touchscreen@40 {
+               compatible = "chipone,icn8318";
+               reg = <0x40>;
+               interrupt-parent = <&pio>;
+               interrupts = <9 IRQ_TYPE_EDGE_FALLING>; /* EINT9 (PG9) */
+               pinctrl-names = "default";
+               pinctrl-0 = <&ts_wake_pin_p66>;
+               wake-gpios = <&pio 1 3 GPIO_ACTIVE_HIGH>; /* PB3 */
+               touchscreen-size-x = <800>;
+               touchscreen-size-y = <480>;
+               touchscreen-inverted-x;
+               touchscreen-swapped-x-y;
+       };
+
+       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_p66>;
+       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;
+       };
+};
+
+&pio {
+       mmc0_cd_pin_p66: mmc0_cd_pin@0 {
+               allwinner,pins = "PG0";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+       };
+
+       i2c_lcd_pins: i2c_lcd_pin@0 {
+               allwinner,pins = "PG10", "PG12";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+       };
+
+       ts_wake_pin_p66: ts_wake_pin@0 {
+               allwinner,pins = "PB3";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+       };
+
+       usb0_vbus_pin_a: usb0_vbus_pin@0 {
+               allwinner,pins = "PB4";
+               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_ldo3 {
+       regulator-min-microvolt = <3300000>;
+       regulator-max-microvolt = <3300000>;
+       regulator-name = "vcc-wifi";
+};
+
+&reg_usb0_vbus {
+       gpio = <&pio 1 4 GPIO_ACTIVE_HIGH>; /* PB4 */
+       status = "okay";
+};
+
+&usbphy {
+       usb0_vbus-supply = <&reg_usb0_vbus>;
+       usb1_vbus-supply = <&reg_ldo3>;
+       status = "okay";
+};
index 883cb4873688f2f80ce3036ca2a60f338aa4bb67..976d4faa2179ace0c60d6adc269deb226c314e15 100644 (file)
@@ -3,20 +3,51 @@
  *
  * Maxime Ripard <maxime.ripard@free-electrons.com>
  *
- * 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 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.
  */
 
 #include "skeleton.dtsi"
 
-#include <dt-bindings/thermal/thermal.h>
+#include "sun5i.dtsi"
 
-#include <dt-bindings/dma/sun4i-a10.h>
 #include <dt-bindings/pinctrl/sun4i-a10.h>
+#include <dt-bindings/thermal/thermal.h>
 
 / {
        interrupt-parent = <&intc>;
                };
        };
 
-       cpus {
-               #address-cells = <1>;
-               #size-cells = <0>;
-
-               cpu0: cpu@0 {
-                       device_type = "cpu";
-                       compatible = "arm,cortex-a8";
-                       reg = <0x0>;
-                       clocks = <&cpu>;
-                       clock-latency = <244144>; /* 8 32k periods */
-                       operating-points = <
-                               /* kHz    uV */
-                               1008000 1400000
-                               912000  1350000
-                               864000  1300000
-                               624000  1200000
-                               576000  1200000
-                               432000  1200000
-                               >;
-                       #cooling-cells = <2>;
-                       cooling-min-level = <0>;
-                       cooling-max-level = <5>;
-               };
-       };
-
        thermal-zones {
                cpu_thermal {
                        /* milliseconds */
                };
        };
 
-       memory {
-               reg = <0x40000000 0x20000000>;
-       };
-
        clocks {
-               #address-cells = <1>;
-               #size-cells = <1>;
-               ranges;
-
-               /*
-                * This is a dummy clock, to be used as placeholder on
-                * other mux clocks when a specific parent clock is not
-                * yet implemented. It should be dropped when the driver
-                * is complete.
-                */
-               dummy: dummy {
-                       #clock-cells = <0>;
-                       compatible = "fixed-clock";
-                       clock-frequency = <0>;
-               };
-
-               osc24M: clk@01c20050 {
-                       #clock-cells = <0>;
-                       compatible = "allwinner,sun4i-a10-osc-clk";
-                       reg = <0x01c20050 0x4>;
-                       clock-frequency = <24000000>;
-                       clock-output-names = "osc24M";
-               };
-
-               osc32k: clk@0 {
-                       #clock-cells = <0>;
-                       compatible = "fixed-clock";
-                       clock-frequency = <32768>;
-                       clock-output-names = "osc32k";
-               };
-
-               pll1: clk@01c20000 {
-                       #clock-cells = <0>;
-                       compatible = "allwinner,sun4i-a10-pll1-clk";
-                       reg = <0x01c20000 0x4>;
-                       clocks = <&osc24M>;
-                       clock-output-names = "pll1";
-               };
-
-               pll4: clk@01c20018 {
-                       #clock-cells = <0>;
-                       compatible = "allwinner,sun4i-a10-pll1-clk";
-                       reg = <0x01c20018 0x4>;
-                       clocks = <&osc24M>;
-                       clock-output-names = "pll4";
-               };
-
-               pll5: clk@01c20020 {
-                       #clock-cells = <1>;
-                       compatible = "allwinner,sun4i-a10-pll5-clk";
-                       reg = <0x01c20020 0x4>;
-                       clocks = <&osc24M>;
-                       clock-output-names = "pll5_ddr", "pll5_other";
-               };
-
-               pll6: clk@01c20028 {
-                       #clock-cells = <1>;
-                       compatible = "allwinner,sun4i-a10-pll6-clk";
-                       reg = <0x01c20028 0x4>;
-                       clocks = <&osc24M>;
-                       clock-output-names = "pll6_sata", "pll6_other", "pll6";
-               };
-
-               /* dummy is 200M */
-               cpu: cpu@01c20054 {
-                       #clock-cells = <0>;
-                       compatible = "allwinner,sun4i-a10-cpu-clk";
-                       reg = <0x01c20054 0x4>;
-                       clocks = <&osc32k>, <&osc24M>, <&pll1>, <&dummy>;
-                       clock-output-names = "cpu";
-               };
-
-               axi: axi@01c20054 {
-                       #clock-cells = <0>;
-                       compatible = "allwinner,sun4i-a10-axi-clk";
-                       reg = <0x01c20054 0x4>;
-                       clocks = <&cpu>;
-                       clock-output-names = "axi";
-               };
-
-               axi_gates: clk@01c2005c {
-                       #clock-cells = <1>;
-                       compatible = "allwinner,sun4i-a10-axi-gates-clk";
-                       reg = <0x01c2005c 0x4>;
-                       clocks = <&axi>;
-                       clock-output-names = "axi_dram";
-               };
-
-               ahb: ahb@01c20054 {
-                       #clock-cells = <0>;
-                       compatible = "allwinner,sun4i-a10-ahb-clk";
-                       reg = <0x01c20054 0x4>;
-                       clocks = <&axi>;
-                       clock-output-names = "ahb";
-               };
-
                ahb_gates: clk@01c20060 {
                        #clock-cells = <1>;
                        compatible = "allwinner,sun5i-a13-ahb-gates-clk";
                        reg = <0x01c20060 0x8>;
                        clocks = <&ahb>;
-                       clock-output-names = "ahb_usbotg", "ahb_ehci", "ahb_ohci",
-                               "ahb_ss", "ahb_dma", "ahb_bist", "ahb_mmc0",
-                               "ahb_mmc1", "ahb_mmc2", "ahb_nand", "ahb_sdram",
-                               "ahb_spi0", "ahb_spi1", "ahb_spi2", "ahb_stimer",
-                               "ahb_ve", "ahb_lcd", "ahb_csi", "ahb_de_be",
-                               "ahb_de_fe", "ahb_iep", "ahb_mali400";
-               };
-
-               apb0: apb0@01c20054 {
-                       #clock-cells = <0>;
-                       compatible = "allwinner,sun4i-a10-apb0-clk";
-                       reg = <0x01c20054 0x4>;
-                       clocks = <&ahb>;
-                       clock-output-names = "apb0";
+                       clock-output-names = "ahb_usbotg", "ahb_ehci",
+                                            "ahb_ohci", "ahb_ss", "ahb_dma",
+                                            "ahb_bist", "ahb_mmc0", "ahb_mmc1",
+                                            "ahb_mmc2", "ahb_nand",
+                                            "ahb_sdram", "ahb_spi0",
+                                            "ahb_spi1", "ahb_spi2",
+                                            "ahb_stimer", "ahb_ve", "ahb_lcd",
+                                            "ahb_csi", "ahb_de_be",
+                                            "ahb_de_fe", "ahb_iep",
+                                            "ahb_mali400";
                };
 
                apb0_gates: clk@01c20068 {
                        compatible = "allwinner,sun5i-a13-apb0-gates-clk";
                        reg = <0x01c20068 0x4>;
                        clocks = <&apb0>;
-                       clock-output-names = "apb0_codec", "apb0_pio", "apb0_ir";
-               };
-
-               apb1: clk@01c20058 {
-                       #clock-cells = <0>;
-                       compatible = "allwinner,sun4i-a10-apb1-clk";
-                       reg = <0x01c20058 0x4>;
-                       clocks = <&osc24M>, <&pll6 1>, <&osc32k>;
-                       clock-output-names = "apb1";
+                       clock-output-names = "apb0_codec", "apb0_pio",
+                                            "apb0_ir";
                };
 
                apb1_gates: clk@01c2006c {
                        clock-output-names = "apb1_i2c0", "apb1_i2c1",
                                "apb1_i2c2", "apb1_uart1", "apb1_uart3";
                };
-
-               nand_clk: clk@01c20080 {
-                       #clock-cells = <0>;
-                       compatible = "allwinner,sun4i-a10-mod0-clk";
-                       reg = <0x01c20080 0x4>;
-                       clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
-                       clock-output-names = "nand";
-               };
-
-               ms_clk: clk@01c20084 {
-                       #clock-cells = <0>;
-                       compatible = "allwinner,sun4i-a10-mod0-clk";
-                       reg = <0x01c20084 0x4>;
-                       clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
-                       clock-output-names = "ms";
-               };
-
-               mmc0_clk: clk@01c20088 {
-                       #clock-cells = <1>;
-                       compatible = "allwinner,sun4i-a10-mmc-clk";
-                       reg = <0x01c20088 0x4>;
-                       clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
-                       clock-output-names = "mmc0",
-                                            "mmc0_output",
-                                            "mmc0_sample";
-               };
-
-               mmc1_clk: clk@01c2008c {
-                       #clock-cells = <1>;
-                       compatible = "allwinner,sun4i-a10-mmc-clk";
-                       reg = <0x01c2008c 0x4>;
-                       clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
-                       clock-output-names = "mmc1",
-                                            "mmc1_output",
-                                            "mmc1_sample";
-               };
-
-               mmc2_clk: clk@01c20090 {
-                       #clock-cells = <1>;
-                       compatible = "allwinner,sun4i-a10-mmc-clk";
-                       reg = <0x01c20090 0x4>;
-                       clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
-                       clock-output-names = "mmc2",
-                                            "mmc2_output",
-                                            "mmc2_sample";
-               };
-
-               ts_clk: clk@01c20098 {
-                       #clock-cells = <0>;
-                       compatible = "allwinner,sun4i-a10-mod0-clk";
-                       reg = <0x01c20098 0x4>;
-                       clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
-                       clock-output-names = "ts";
-               };
-
-               ss_clk: clk@01c2009c {
-                       #clock-cells = <0>;
-                       compatible = "allwinner,sun4i-a10-mod0-clk";
-                       reg = <0x01c2009c 0x4>;
-                       clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
-                       clock-output-names = "ss";
-               };
-
-               spi0_clk: clk@01c200a0 {
-                       #clock-cells = <0>;
-                       compatible = "allwinner,sun4i-a10-mod0-clk";
-                       reg = <0x01c200a0 0x4>;
-                       clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
-                       clock-output-names = "spi0";
-               };
-
-               spi1_clk: clk@01c200a4 {
-                       #clock-cells = <0>;
-                       compatible = "allwinner,sun4i-a10-mod0-clk";
-                       reg = <0x01c200a4 0x4>;
-                       clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
-                       clock-output-names = "spi1";
-               };
-
-               spi2_clk: clk@01c200a8 {
-                       #clock-cells = <0>;
-                       compatible = "allwinner,sun4i-a10-mod0-clk";
-                       reg = <0x01c200a8 0x4>;
-                       clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
-                       clock-output-names = "spi2";
-               };
-
-               ir0_clk: clk@01c200b0 {
-                       #clock-cells = <0>;
-                       compatible = "allwinner,sun4i-a10-mod0-clk";
-                       reg = <0x01c200b0 0x4>;
-                       clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
-                       clock-output-names = "ir0";
-               };
-
-               usb_clk: clk@01c200cc {
-                       #clock-cells = <1>;
-                       #reset-cells = <1>;
-                       compatible = "allwinner,sun5i-a13-usb-clk";
-                       reg = <0x01c200cc 0x4>;
-                       clocks = <&pll6 1>;
-                       clock-output-names = "usb_ohci0", "usb_phy";
-               };
-
-               mbus_clk: clk@01c2015c {
-                       #clock-cells = <0>;
-                       compatible = "allwinner,sun5i-a13-mbus-clk";
-                       reg = <0x01c2015c 0x4>;
-                       clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
-                       clock-output-names = "mbus";
-               };
        };
+};
 
-       soc@01c00000 {
-               compatible = "simple-bus";
-               #address-cells = <1>;
-               #size-cells = <1>;
-               ranges;
-
-               dma: dma-controller@01c02000 {
-                       compatible = "allwinner,sun4i-a10-dma";
-                       reg = <0x01c02000 0x1000>;
-                       interrupts = <27>;
-                       clocks = <&ahb_gates 6>;
-                       #dma-cells = <2>;
-               };
-
-               spi0: spi@01c05000 {
-                       compatible = "allwinner,sun4i-a10-spi";
-                       reg = <0x01c05000 0x1000>;
-                       interrupts = <10>;
-                       clocks = <&ahb_gates 20>, <&spi0_clk>;
-                       clock-names = "ahb", "mod";
-                       dmas = <&dma SUN4I_DMA_DEDICATED 27>,
-                              <&dma SUN4I_DMA_DEDICATED 26>;
-                       dma-names = "rx", "tx";
-                       status = "disabled";
-                       #address-cells = <1>;
-                       #size-cells = <0>;
-               };
-
-               spi1: spi@01c06000 {
-                       compatible = "allwinner,sun4i-a10-spi";
-                       reg = <0x01c06000 0x1000>;
-                       interrupts = <11>;
-                       clocks = <&ahb_gates 21>, <&spi1_clk>;
-                       clock-names = "ahb", "mod";
-                       dmas = <&dma SUN4I_DMA_DEDICATED 9>,
-                              <&dma SUN4I_DMA_DEDICATED 8>;
-                       dma-names = "rx", "tx";
-                       status = "disabled";
-                       #address-cells = <1>;
-                       #size-cells = <0>;
-               };
-
-               mmc0: mmc@01c0f000 {
-                       compatible = "allwinner,sun5i-a13-mmc";
-                       reg = <0x01c0f000 0x1000>;
-                       clocks = <&ahb_gates 8>,
-                                <&mmc0_clk 0>,
-                                <&mmc0_clk 1>,
-                                <&mmc0_clk 2>;
-                       clock-names = "ahb",
-                                     "mmc",
-                                     "output",
-                                     "sample";
-                       interrupts = <32>;
-                       status = "disabled";
-               };
-
-               mmc2: mmc@01c11000 {
-                       compatible = "allwinner,sun5i-a13-mmc";
-                       reg = <0x01c11000 0x1000>;
-                       clocks = <&ahb_gates 10>,
-                                <&mmc2_clk 0>,
-                                <&mmc2_clk 1>,
-                                <&mmc2_clk 2>;
-                       clock-names = "ahb",
-                                     "mmc",
-                                     "output",
-                                     "sample";
-                       interrupts = <34>;
-                       status = "disabled";
-               };
-
-               usbphy: phy@01c13400 {
-                       #phy-cells = <1>;
-                       compatible = "allwinner,sun5i-a13-usb-phy";
-                       reg = <0x01c13400 0x10 0x01c14800 0x4>;
-                       reg-names = "phy_ctrl", "pmu1";
-                       clocks = <&usb_clk 8>;
-                       clock-names = "usb_phy";
-                       resets = <&usb_clk 0>, <&usb_clk 1>;
-                       reset-names = "usb0_reset", "usb1_reset";
-                       status = "disabled";
-               };
-
-               ehci0: usb@01c14000 {
-                       compatible = "allwinner,sun5i-a13-ehci", "generic-ehci";
-                       reg = <0x01c14000 0x100>;
-                       interrupts = <39>;
-                       clocks = <&ahb_gates 1>;
-                       phys = <&usbphy 1>;
-                       phy-names = "usb";
-                       status = "disabled";
-               };
-
-               ohci0: usb@01c14400 {
-                       compatible = "allwinner,sun5i-a13-ohci", "generic-ohci";
-                       reg = <0x01c14400 0x100>;
-                       interrupts = <40>;
-                       clocks = <&usb_clk 6>, <&ahb_gates 2>;
-                       phys = <&usbphy 1>;
-                       phy-names = "usb";
-                       status = "disabled";
-               };
-
-               spi2: spi@01c17000 {
-                       compatible = "allwinner,sun4i-a10-spi";
-                       reg = <0x01c17000 0x1000>;
-                       interrupts = <12>;
-                       clocks = <&ahb_gates 22>, <&spi2_clk>;
-                       clock-names = "ahb", "mod";
-                       dmas = <&dma SUN4I_DMA_DEDICATED 29>,
-                              <&dma SUN4I_DMA_DEDICATED 28>;
-                       dma-names = "rx", "tx";
-                       status = "disabled";
-                       #address-cells = <1>;
-                       #size-cells = <0>;
-               };
-
-               intc: interrupt-controller@01c20400 {
-                       compatible = "allwinner,sun4i-a10-ic";
-                       reg = <0x01c20400 0x400>;
-                       interrupt-controller;
-                       #interrupt-cells = <1>;
-               };
-
-               pio: pinctrl@01c20800 {
-                       compatible = "allwinner,sun5i-a13-pinctrl";
-                       reg = <0x01c20800 0x400>;
-                       interrupts = <28>;
-                       clocks = <&apb0_gates 5>;
-                       gpio-controller;
-                       interrupt-controller;
-                       #interrupt-cells = <2>;
-                       #size-cells = <0>;
-                       #gpio-cells = <3>;
-
-                       uart1_pins_a: uart1@0 {
-                               allwinner,pins = "PE10", "PE11";
-                               allwinner,function = "uart1";
-                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-                       };
-
-                       uart1_pins_b: uart1@1 {
-                               allwinner,pins = "PG3", "PG4";
-                               allwinner,function = "uart1";
-                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-                       };
-
-                       i2c0_pins_a: i2c0@0 {
-                               allwinner,pins = "PB0", "PB1";
-                               allwinner,function = "i2c0";
-                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-                       };
-
-                       i2c1_pins_a: i2c1@0 {
-                               allwinner,pins = "PB15", "PB16";
-                               allwinner,function = "i2c1";
-                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-                       };
-
-                       i2c2_pins_a: i2c2@0 {
-                               allwinner,pins = "PB17", "PB18";
-                               allwinner,function = "i2c2";
-                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-                       };
-
-                       mmc0_pins_a: mmc0@0 {
-                               allwinner,pins = "PF0","PF1","PF2","PF3","PF4","PF5";
-                               allwinner,function = "mmc0";
-                               allwinner,drive = <SUN4I_PINCTRL_30_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-                       };
-               };
-
-               timer@01c20c00 {
-                       compatible = "allwinner,sun4i-a10-timer";
-                       reg = <0x01c20c00 0x90>;
-                       interrupts = <22>;
-                       clocks = <&osc24M>;
-               };
-
-               wdt: watchdog@01c20c90 {
-                       compatible = "allwinner,sun4i-a10-wdt";
-                       reg = <0x01c20c90 0x10>;
-               };
-
-               lradc: lradc@01c22800 {
-                       compatible = "allwinner,sun4i-a10-lradc-keys";
-                       reg = <0x01c22800 0x100>;
-                       interrupts = <31>;
-                       status = "disabled";
-               };
-
-               sid: eeprom@01c23800 {
-                       compatible = "allwinner,sun4i-a10-sid";
-                       reg = <0x01c23800 0x10>;
-               };
-
-               rtp: rtp@01c25000 {
-                       compatible = "allwinner,sun4i-a10-ts";
-                       reg = <0x01c25000 0x100>;
-                       interrupts = <29>;
-                       #thermal-sensor-cells = <0>;
-               };
-
-               uart1: serial@01c28400 {
-                       compatible = "snps,dw-apb-uart";
-                       reg = <0x01c28400 0x400>;
-                       interrupts = <2>;
-                       reg-shift = <2>;
-                       reg-io-width = <4>;
-                       clocks = <&apb1_gates 17>;
-                       status = "disabled";
-               };
-
-               uart3: serial@01c28c00 {
-                       compatible = "snps,dw-apb-uart";
-                       reg = <0x01c28c00 0x400>;
-                       interrupts = <4>;
-                       reg-shift = <2>;
-                       reg-io-width = <4>;
-                       clocks = <&apb1_gates 19>;
-                       status = "disabled";
-               };
-
-               i2c0: i2c@01c2ac00 {
-                       compatible = "allwinner,sun5i-a13-i2c", "allwinner,sun4i-a10-i2c";
-                       reg = <0x01c2ac00 0x400>;
-                       interrupts = <7>;
-                       clocks = <&apb1_gates 0>;
-                       status = "disabled";
-                       #address-cells = <1>;
-                       #size-cells = <0>;
-               };
+&cpu0 {
+       clock-latency = <244144>; /* 8 32k periods */
+       operating-points = <
+               /* kHz    uV */
+               1008000 1400000
+               912000  1350000
+               864000  1300000
+               624000  1200000
+               576000  1200000
+               432000  1200000
+               >;
+       #cooling-cells = <2>;
+       cooling-min-level = <0>;
+       cooling-max-level = <5>;
+};
 
-               i2c1: i2c@01c2b000 {
-                       compatible = "allwinner,sun5i-a13-i2c", "allwinner,sun4i-a10-i2c";
-                       reg = <0x01c2b000 0x400>;
-                       interrupts = <8>;
-                       clocks = <&apb1_gates 1>;
-                       status = "disabled";
-                       #address-cells = <1>;
-                       #size-cells = <0>;
-               };
+&pio {
+       compatible = "allwinner,sun5i-a13-pinctrl";
 
-               i2c2: i2c@01c2b400 {
-                       compatible = "allwinner,sun5i-a13-i2c", "allwinner,sun4i-a10-i2c";
-                       reg = <0x01c2b400 0x400>;
-                       interrupts = <9>;
-                       clocks = <&apb1_gates 2>;
-                       status = "disabled";
-                       #address-cells = <1>;
-                       #size-cells = <0>;
-               };
+       uart1_pins_a: uart1@0 {
+               allwinner,pins = "PE10", "PE11";
+               allwinner,function = "uart1";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+       };
 
-               timer@01c60000 {
-                       compatible = "allwinner,sun5i-a13-hstimer";
-                       reg = <0x01c60000 0x1000>;
-                       interrupts = <82>, <83>;
-                       clocks = <&ahb_gates 28>;
-               };
+       uart1_pins_b: uart1@1 {
+               allwinner,pins = "PG3", "PG4";
+               allwinner,function = "uart1";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
        };
 };
diff --git a/arch/arm/boot/dts/sun5i.dtsi b/arch/arm/boot/dts/sun5i.dtsi
new file mode 100644 (file)
index 0000000..54b0978
--- /dev/null
@@ -0,0 +1,609 @@
+/*
+ * Copyright 2012-2015 Maxime Ripard
+ *
+ * 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 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.
+ */
+
+#include "skeleton.dtsi"
+
+#include <dt-bindings/dma/sun4i-a10.h>
+#include <dt-bindings/pinctrl/sun4i-a10.h>
+
+/ {
+       interrupt-parent = <&intc>;
+
+       cpus {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               cpu0: cpu@0 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a8";
+                       reg = <0x0>;
+                       clocks = <&cpu>;
+               };
+       };
+
+       clocks {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges;
+
+               /*
+                * This is a dummy clock, to be used as placeholder on
+                * other mux clocks when a specific parent clock is not
+                * yet implemented. It should be dropped when the driver
+                * is complete.
+                */
+               dummy: dummy {
+                       #clock-cells = <0>;
+                       compatible = "fixed-clock";
+                       clock-frequency = <0>;
+               };
+
+               osc24M: clk@01c20050 {
+                       #clock-cells = <0>;
+                       compatible = "allwinner,sun4i-a10-osc-clk";
+                       reg = <0x01c20050 0x4>;
+                       clock-frequency = <24000000>;
+                       clock-output-names = "osc24M";
+               };
+
+               osc32k: clk@0 {
+                       #clock-cells = <0>;
+                       compatible = "fixed-clock";
+                       clock-frequency = <32768>;
+                       clock-output-names = "osc32k";
+               };
+
+               pll1: clk@01c20000 {
+                       #clock-cells = <0>;
+                       compatible = "allwinner,sun4i-a10-pll1-clk";
+                       reg = <0x01c20000 0x4>;
+                       clocks = <&osc24M>;
+                       clock-output-names = "pll1";
+               };
+
+               pll4: clk@01c20018 {
+                       #clock-cells = <0>;
+                       compatible = "allwinner,sun4i-a10-pll1-clk";
+                       reg = <0x01c20018 0x4>;
+                       clocks = <&osc24M>;
+                       clock-output-names = "pll4";
+               };
+
+               pll5: clk@01c20020 {
+                       #clock-cells = <1>;
+                       compatible = "allwinner,sun4i-a10-pll5-clk";
+                       reg = <0x01c20020 0x4>;
+                       clocks = <&osc24M>;
+                       clock-output-names = "pll5_ddr", "pll5_other";
+               };
+
+               pll6: clk@01c20028 {
+                       #clock-cells = <1>;
+                       compatible = "allwinner,sun4i-a10-pll6-clk";
+                       reg = <0x01c20028 0x4>;
+                       clocks = <&osc24M>;
+                       clock-output-names = "pll6_sata", "pll6_other", "pll6";
+               };
+
+               /* dummy is 200M */
+               cpu: cpu@01c20054 {
+                       #clock-cells = <0>;
+                       compatible = "allwinner,sun4i-a10-cpu-clk";
+                       reg = <0x01c20054 0x4>;
+                       clocks = <&osc32k>, <&osc24M>, <&pll1>, <&dummy>;
+                       clock-output-names = "cpu";
+               };
+
+               axi: axi@01c20054 {
+                       #clock-cells = <0>;
+                       compatible = "allwinner,sun4i-a10-axi-clk";
+                       reg = <0x01c20054 0x4>;
+                       clocks = <&cpu>;
+                       clock-output-names = "axi";
+               };
+
+               ahb: ahb@01c20054 {
+                       #clock-cells = <0>;
+                       compatible = "allwinner,sun5i-a13-ahb-clk";
+                       reg = <0x01c20054 0x4>;
+                       clocks = <&axi>, <&cpu>, <&pll6 1>;
+                       clock-output-names = "ahb";
+                       /*
+                        * Use PLL6 as parent, instead of CPU/AXI
+                        * which has rate changes due to cpufreq
+                        */
+                       assigned-clocks = <&ahb>;
+                       assigned-clock-parents = <&pll6 1>;
+               };
+
+               apb0: apb0@01c20054 {
+                       #clock-cells = <0>;
+                       compatible = "allwinner,sun4i-a10-apb0-clk";
+                       reg = <0x01c20054 0x4>;
+                       clocks = <&ahb>;
+                       clock-output-names = "apb0";
+               };
+
+               apb1: clk@01c20058 {
+                       #clock-cells = <0>;
+                       compatible = "allwinner,sun4i-a10-apb1-clk";
+                       reg = <0x01c20058 0x4>;
+                       clocks = <&osc24M>, <&pll6 1>, <&osc32k>;
+                       clock-output-names = "apb1";
+               };
+
+               axi_gates: clk@01c2005c {
+                       #clock-cells = <1>;
+                       compatible = "allwinner,sun4i-a10-axi-gates-clk";
+                       reg = <0x01c2005c 0x4>;
+                       clocks = <&axi>;
+                       clock-output-names = "axi_dram";
+               };
+
+               nand_clk: clk@01c20080 {
+                       #clock-cells = <0>;
+                       compatible = "allwinner,sun4i-a10-mod0-clk";
+                       reg = <0x01c20080 0x4>;
+                       clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
+                       clock-output-names = "nand";
+               };
+
+               ms_clk: clk@01c20084 {
+                       #clock-cells = <0>;
+                       compatible = "allwinner,sun4i-a10-mod0-clk";
+                       reg = <0x01c20084 0x4>;
+                       clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
+                       clock-output-names = "ms";
+               };
+
+               mmc0_clk: clk@01c20088 {
+                       #clock-cells = <1>;
+                       compatible = "allwinner,sun4i-a10-mmc-clk";
+                       reg = <0x01c20088 0x4>;
+                       clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
+                       clock-output-names = "mmc0",
+                                            "mmc0_output",
+                                            "mmc0_sample";
+               };
+
+               mmc1_clk: clk@01c2008c {
+                       #clock-cells = <1>;
+                       compatible = "allwinner,sun4i-a10-mmc-clk";
+                       reg = <0x01c2008c 0x4>;
+                       clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
+                       clock-output-names = "mmc1",
+                                            "mmc1_output",
+                                            "mmc1_sample";
+               };
+
+               mmc2_clk: clk@01c20090 {
+                       #clock-cells = <1>;
+                       compatible = "allwinner,sun4i-a10-mmc-clk";
+                       reg = <0x01c20090 0x4>;
+                       clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
+                       clock-output-names = "mmc2",
+                                            "mmc2_output",
+                                            "mmc2_sample";
+               };
+
+               ts_clk: clk@01c20098 {
+                       #clock-cells = <0>;
+                       compatible = "allwinner,sun4i-a10-mod0-clk";
+                       reg = <0x01c20098 0x4>;
+                       clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
+                       clock-output-names = "ts";
+               };
+
+               ss_clk: clk@01c2009c {
+                       #clock-cells = <0>;
+                       compatible = "allwinner,sun4i-a10-mod0-clk";
+                       reg = <0x01c2009c 0x4>;
+                       clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
+                       clock-output-names = "ss";
+               };
+
+               spi0_clk: clk@01c200a0 {
+                       #clock-cells = <0>;
+                       compatible = "allwinner,sun4i-a10-mod0-clk";
+                       reg = <0x01c200a0 0x4>;
+                       clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
+                       clock-output-names = "spi0";
+               };
+
+               spi1_clk: clk@01c200a4 {
+                       #clock-cells = <0>;
+                       compatible = "allwinner,sun4i-a10-mod0-clk";
+                       reg = <0x01c200a4 0x4>;
+                       clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
+                       clock-output-names = "spi1";
+               };
+
+               spi2_clk: clk@01c200a8 {
+                       #clock-cells = <0>;
+                       compatible = "allwinner,sun4i-a10-mod0-clk";
+                       reg = <0x01c200a8 0x4>;
+                       clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
+                       clock-output-names = "spi2";
+               };
+
+               ir0_clk: clk@01c200b0 {
+                       #clock-cells = <0>;
+                       compatible = "allwinner,sun4i-a10-mod0-clk";
+                       reg = <0x01c200b0 0x4>;
+                       clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
+                       clock-output-names = "ir0";
+               };
+
+               usb_clk: clk@01c200cc {
+                       #clock-cells = <1>;
+                       #reset-cells = <1>;
+                       compatible = "allwinner,sun5i-a13-usb-clk";
+                       reg = <0x01c200cc 0x4>;
+                       clocks = <&pll6 1>;
+                       clock-output-names = "usb_ohci0", "usb_phy";
+               };
+
+               mbus_clk: clk@01c2015c {
+                       #clock-cells = <0>;
+                       compatible = "allwinner,sun5i-a13-mbus-clk";
+                       reg = <0x01c2015c 0x4>;
+                       clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
+                       clock-output-names = "mbus";
+               };
+       };
+
+       soc@01c00000 {
+               compatible = "simple-bus";
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges;
+
+               sram-controller@01c00000 {
+                       compatible = "allwinner,sun4i-a10-sram-controller";
+                       reg = <0x01c00000 0x30>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges;
+
+                       sram_a: sram@00000000 {
+                               compatible = "mmio-sram";
+                               reg = <0x00000000 0xc000>;
+                               #address-cells = <1>;
+                               #size-cells = <1>;
+                               ranges = <0 0x00000000 0xc000>;
+                       };
+
+                       sram_d: sram@00010000 {
+                               compatible = "mmio-sram";
+                               reg = <0x00010000 0x1000>;
+                               #address-cells = <1>;
+                               #size-cells = <1>;
+                               ranges = <0 0x00010000 0x1000>;
+
+                               otg_sram: sram-section@0000 {
+                                       compatible = "allwinner,sun4i-a10-sram-d";
+                                       reg = <0x0000 0x1000>;
+                                       status = "disabled";
+                               };
+                       };
+               };
+
+               dma: dma-controller@01c02000 {
+                       compatible = "allwinner,sun4i-a10-dma";
+                       reg = <0x01c02000 0x1000>;
+                       interrupts = <27>;
+                       clocks = <&ahb_gates 6>;
+                       #dma-cells = <2>;
+               };
+
+               spi0: spi@01c05000 {
+                       compatible = "allwinner,sun4i-a10-spi";
+                       reg = <0x01c05000 0x1000>;
+                       interrupts = <10>;
+                       clocks = <&ahb_gates 20>, <&spi0_clk>;
+                       clock-names = "ahb", "mod";
+                       dmas = <&dma SUN4I_DMA_DEDICATED 27>,
+                              <&dma SUN4I_DMA_DEDICATED 26>;
+                       dma-names = "rx", "tx";
+                       status = "disabled";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+               };
+
+               spi1: spi@01c06000 {
+                       compatible = "allwinner,sun4i-a10-spi";
+                       reg = <0x01c06000 0x1000>;
+                       interrupts = <11>;
+                       clocks = <&ahb_gates 21>, <&spi1_clk>;
+                       clock-names = "ahb", "mod";
+                       dmas = <&dma SUN4I_DMA_DEDICATED 9>,
+                              <&dma SUN4I_DMA_DEDICATED 8>;
+                       dma-names = "rx", "tx";
+                       status = "disabled";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+               };
+
+               mmc0: mmc@01c0f000 {
+                       compatible = "allwinner,sun5i-a13-mmc";
+                       reg = <0x01c0f000 0x1000>;
+                       clocks = <&ahb_gates 8>,
+                                <&mmc0_clk 0>,
+                                <&mmc0_clk 1>,
+                                <&mmc0_clk 2>;
+                       clock-names = "ahb",
+                                     "mmc",
+                                     "output",
+                                     "sample";
+                       interrupts = <32>;
+                       status = "disabled";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+               };
+
+               mmc1: mmc@01c10000 {
+                       compatible = "allwinner,sun5i-a13-mmc";
+                       reg = <0x01c10000 0x1000>;
+                       clocks = <&ahb_gates 9>,
+                                <&mmc1_clk 0>,
+                                <&mmc1_clk 1>,
+                                <&mmc1_clk 2>;
+                       clock-names = "ahb",
+                                     "mmc",
+                                     "output",
+                                     "sample";
+                       interrupts = <33>;
+                       status = "disabled";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+               };
+
+               mmc2: mmc@01c11000 {
+                       compatible = "allwinner,sun5i-a13-mmc";
+                       reg = <0x01c11000 0x1000>;
+                       clocks = <&ahb_gates 10>,
+                                <&mmc2_clk 0>,
+                                <&mmc2_clk 1>,
+                                <&mmc2_clk 2>;
+                       clock-names = "ahb",
+                                     "mmc",
+                                     "output",
+                                     "sample";
+                       interrupts = <34>;
+                       status = "disabled";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+               };
+
+               usbphy: phy@01c13400 {
+                       #phy-cells = <1>;
+                       compatible = "allwinner,sun5i-a13-usb-phy";
+                       reg = <0x01c13400 0x10 0x01c14800 0x4>;
+                       reg-names = "phy_ctrl", "pmu1";
+                       clocks = <&usb_clk 8>;
+                       clock-names = "usb_phy";
+                       resets = <&usb_clk 0>, <&usb_clk 1>;
+                       reset-names = "usb0_reset", "usb1_reset";
+                       status = "disabled";
+               };
+
+               ehci0: usb@01c14000 {
+                       compatible = "allwinner,sun5i-a13-ehci", "generic-ehci";
+                       reg = <0x01c14000 0x100>;
+                       interrupts = <39>;
+                       clocks = <&ahb_gates 1>;
+                       phys = <&usbphy 1>;
+                       phy-names = "usb";
+                       status = "disabled";
+               };
+
+               ohci0: usb@01c14400 {
+                       compatible = "allwinner,sun5i-a13-ohci", "generic-ohci";
+                       reg = <0x01c14400 0x100>;
+                       interrupts = <40>;
+                       clocks = <&usb_clk 6>, <&ahb_gates 2>;
+                       phys = <&usbphy 1>;
+                       phy-names = "usb";
+                       status = "disabled";
+               };
+
+               spi2: spi@01c17000 {
+                       compatible = "allwinner,sun4i-a10-spi";
+                       reg = <0x01c17000 0x1000>;
+                       interrupts = <12>;
+                       clocks = <&ahb_gates 22>, <&spi2_clk>;
+                       clock-names = "ahb", "mod";
+                       dmas = <&dma SUN4I_DMA_DEDICATED 29>,
+                              <&dma SUN4I_DMA_DEDICATED 28>;
+                       dma-names = "rx", "tx";
+                       status = "disabled";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+               };
+
+               intc: interrupt-controller@01c20400 {
+                       compatible = "allwinner,sun4i-a10-ic";
+                       reg = <0x01c20400 0x400>;
+                       interrupt-controller;
+                       #interrupt-cells = <1>;
+               };
+
+               pio: pinctrl@01c20800 {
+                       reg = <0x01c20800 0x400>;
+                       interrupts = <28>;
+                       clocks = <&apb0_gates 5>;
+                       gpio-controller;
+                       interrupt-controller;
+                       #interrupt-cells = <2>;
+                       #size-cells = <0>;
+                       #gpio-cells = <3>;
+
+                       i2c0_pins_a: i2c0@0 {
+                               allwinner,pins = "PB0", "PB1";
+                               allwinner,function = "i2c0";
+                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+                       };
+
+                       i2c1_pins_a: i2c1@0 {
+                               allwinner,pins = "PB15", "PB16";
+                               allwinner,function = "i2c1";
+                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+                       };
+
+                       i2c2_pins_a: i2c2@0 {
+                               allwinner,pins = "PB17", "PB18";
+                               allwinner,function = "i2c2";
+                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+                       };
+
+                       mmc0_pins_a: mmc0@0 {
+                               allwinner,pins = "PF0", "PF1", "PF2", "PF3",
+                                                "PF4", "PF5";
+                               allwinner,function = "mmc0";
+                               allwinner,drive = <SUN4I_PINCTRL_30_MA>;
+                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+                       };
+
+                       mmc2_pins_a: mmc2@0 {
+                               allwinner,pins = "PC6", "PC7", "PC8", "PC9",
+                                       "PC10", "PC11", "PC12", "PC13",
+                                       "PC14", "PC15";
+                               allwinner,function = "mmc2";
+                               allwinner,drive = <SUN4I_PINCTRL_30_MA>;
+                               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+                       };
+               };
+
+               timer@01c20c00 {
+                       compatible = "allwinner,sun4i-a10-timer";
+                       reg = <0x01c20c00 0x90>;
+                       interrupts = <22>;
+                       clocks = <&osc24M>;
+               };
+
+               wdt: watchdog@01c20c90 {
+                       compatible = "allwinner,sun4i-a10-wdt";
+                       reg = <0x01c20c90 0x10>;
+               };
+
+               lradc: lradc@01c22800 {
+                       compatible = "allwinner,sun4i-a10-lradc-keys";
+                       reg = <0x01c22800 0x100>;
+                       interrupts = <31>;
+                       status = "disabled";
+               };
+
+               sid: eeprom@01c23800 {
+                       compatible = "allwinner,sun4i-a10-sid";
+                       reg = <0x01c23800 0x10>;
+               };
+
+               rtp: rtp@01c25000 {
+                       compatible = "allwinner,sun5i-a13-ts";
+                       reg = <0x01c25000 0x100>;
+                       interrupts = <29>;
+                       #thermal-sensor-cells = <0>;
+               };
+
+               uart1: serial@01c28400 {
+                       compatible = "snps,dw-apb-uart";
+                       reg = <0x01c28400 0x400>;
+                       interrupts = <2>;
+                       reg-shift = <2>;
+                       reg-io-width = <4>;
+                       clocks = <&apb1_gates 17>;
+                       status = "disabled";
+               };
+
+               uart3: serial@01c28c00 {
+                       compatible = "snps,dw-apb-uart";
+                       reg = <0x01c28c00 0x400>;
+                       interrupts = <4>;
+                       reg-shift = <2>;
+                       reg-io-width = <4>;
+                       clocks = <&apb1_gates 19>;
+                       status = "disabled";
+               };
+
+               i2c0: i2c@01c2ac00 {
+                       compatible = "allwinner,sun4i-a10-i2c";
+                       reg = <0x01c2ac00 0x400>;
+                       interrupts = <7>;
+                       clocks = <&apb1_gates 0>;
+                       status = "disabled";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+               };
+
+               i2c1: i2c@01c2b000 {
+                       compatible = "allwinner,sun4i-a10-i2c";
+                       reg = <0x01c2b000 0x400>;
+                       interrupts = <8>;
+                       clocks = <&apb1_gates 1>;
+                       status = "disabled";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+               };
+
+               i2c2: i2c@01c2b400 {
+                       compatible = "allwinner,sun4i-a10-i2c";
+                       reg = <0x01c2b400 0x400>;
+                       interrupts = <9>;
+                       clocks = <&apb1_gates 2>;
+                       status = "disabled";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+               };
+
+               timer@01c60000 {
+                       compatible = "allwinner,sun5i-a13-hstimer";
+                       reg = <0x01c60000 0x1000>;
+                       interrupts = <82>, <83>;
+                       clocks = <&ahb_gates 28>;
+               };
+       };
+};
index be9f5ee6b59e1331f738ba680326868b3d5cd7f2..2f8cfab771e234487edcebd23c22b0aa24bac1fd 100644 (file)
  *     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 file; 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
        model = "Allwinner A31 APP4 EVB1 Evaluation Board";
        compatible = "allwinner,app4-evb1", "allwinner,sun6i-a31";
 
+       aliases {
+               serial0 = &uart0;
+       };
+
        chosen {
-               bootargs = "earlyprintk console=ttyS0,115200";
+               stdout-path = "serial0:115200n8";
        };
+};
 
-       soc@01c00000 {
-               pio: pinctrl@01c20800 {
-                       usb1_vbus_pin_a: usb1_vbus_pin@0 {
-                               allwinner,pins = "PH27";
-                               allwinner,function = "gpio_out";
-                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-                       };
-               };
+&ehci0 {
+       status = "okay";
+};
 
-               usbphy: phy@01c19400 {
-                       usb1_vbus-supply = <&reg_usb1_vbus>;
-                       status = "okay";
-               };
+&pio {
+       usb1_vbus_pin_a: usb1_vbus_pin@0 {
+               allwinner,pins = "PH27";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+       };
+};
 
-               ehci0: usb@01c1a000 {
-                       status = "okay";
-               };
+&reg_usb1_vbus {
+       pinctrl-0 = <&usb1_vbus_pin_a>;
+       gpio = <&pio 7 27 GPIO_ACTIVE_HIGH>;
+       status = "okay";
+};
 
-               uart0: serial@01c28000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&uart0_pins_a>;
-                       status = "okay";
-               };
-       };
+&uart0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart0_pins_a>;
+       status = "okay";
+};
 
-       reg_usb1_vbus: usb1-vbus {
-               pinctrl-0 = <&usb1_vbus_pin_a>;
-               gpio = <&pio 7 27 GPIO_ACTIVE_HIGH>;
-               status = "okay";
-       };
+&usbphy {
+       usb1_vbus-supply = <&reg_usb1_vbus>;
+       status = "okay";
 };
index 84630e56acd75fcad3542596509ba7c027dcf28f..0cf9926d1e93bebdc333c45f83c2dfe7610f50b9 100644 (file)
  *     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 file; 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
        model = "WITS A31 Colombus Evaluation Board";
        compatible = "wits,colombus", "allwinner,sun6i-a31";
 
+       aliases {
+               serial0 = &uart0;
+       };
+
        chosen {
-               bootargs = "earlyprintk console=ttyS0,115200";
+               stdout-path = "serial0:115200n8";
        };
+};
+
+&ehci1 {
+       status = "okay";
+};
+
+&i2c0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c0_pins_a>;
+       status = "fail";
+};
+
+&i2c1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c1_pins_a>;
+       status = "okay";
+};
+
+&i2c2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c2_pins_a>;
+       status = "okay";
+};
+
+&mmc0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_colombus>;
+       vmmc-supply = <&reg_vcc3v0>;
+       bus-width = <4>;
+       cd-gpios = <&pio 0 8 GPIO_ACTIVE_HIGH>; /* PA8 */
+       cd-inverted;
+       status = "okay";
+};
 
-       soc@01c00000 {
-               mmc0: mmc@01c0f000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_colombus>;
-                       vmmc-supply = <&reg_vcc3v0>;
-                       bus-width = <4>;
-                       cd-gpios = <&pio 0 8 GPIO_ACTIVE_HIGH>; /* PA8 */
-                       cd-inverted;
-                       status = "okay";
-               };
-
-               usbphy: phy@01c19400 {
-                       usb2_vbus-supply = <&reg_usb2_vbus>;
-                       status = "okay";
-               };
-
-               ehci1: usb@01c1b000 {
-                       status = "okay";
-               };
-
-               pio: pinctrl@01c20800 {
-                       mmc0_pins_a: mmc0@0 {
-                               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
-                       };
-
-                       mmc0_cd_pin_colombus: mmc0_cd_pin@0 {
-                               allwinner,pins = "PA8";
-                               allwinner,function = "gpio_in";
-                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
-                       };
-
-                       usb2_vbus_pin_colombus: usb2_vbus_pin@0 {
-                               allwinner,pins = "PH24";
-                               allwinner,function = "gpio_out";
-                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-                       };
-               };
-
-               uart0: serial@01c28000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&uart0_pins_a>;
-                       status = "okay";
-               };
-
-               i2c0: i2c@01c2ac00 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&i2c0_pins_a>;
-                       status = "fail";
-               };
-
-               i2c1: i2c@01c2b000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&i2c1_pins_a>;
-                       status = "okay";
-               };
-
-               i2c2: i2c@01c2b400 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&i2c2_pins_a>;
-                       status = "okay";
-               };
+&mmc0_pins_a {
+       allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+};
+
+&pio {
+       mmc0_cd_pin_colombus: mmc0_cd_pin@0 {
+               allwinner,pins = "PA8";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
        };
 
-       reg_usb2_vbus: usb2-vbus {
-               pinctrl-names = "default";
-               pinctrl-0 = <&usb2_vbus_pin_colombus>;
-               gpio = <&pio 7 24 GPIO_ACTIVE_HIGH>;
-               status = "okay";
+       usb2_vbus_pin_colombus: usb2_vbus_pin@0 {
+               allwinner,pins = "PH24";
+               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_colombus>;
+       gpio = <&pio 7 24 GPIO_ACTIVE_HIGH>;
+       status = "okay";
+};
+
+&uart0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart0_pins_a>;
+       status = "okay";
+};
+
+&usbphy {
+       usb2_vbus-supply = <&reg_usb2_vbus>;
+       status = "okay";
+};
index 8b61b1b342e0a12dd13fc0d255be74eece684df8..d0cfadac0691ddfe179f879eab18c54544db45bd 100644 (file)
  *     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 file; 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
        model = "Merrii A31 Hummingbird";
        compatible = "merrii,a31-hummingbird", "allwinner,sun6i-a31";
 
+       aliases {
+               serial0 = &uart0;
+       };
+
        chosen {
-               bootargs = "earlyprintk console=ttyS0,115200";
+               stdout-path = "serial0:115200n8";
+       };
+
+       wifi_pwrseq: wifi_pwrseq {
+               compatible = "mmc-pwrseq-simple";
+               reset-gpios = <&pio 6 10 GPIO_ACTIVE_LOW>; /* PG10 */
        };
 };
 
        };
 };
 
+&ir {
+       pinctrl-names = "default";
+       pinctrl-0 = <&ir_pins_a>;
+       status = "okay";
+};
+
 &mmc0 {
        pinctrl-names = "default";
        pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_hummingbird>;
-       vmmc-supply = <&reg_vcc3v0>;
+       vmmc-supply = <&vcc_3v0>;
        bus-width = <4>;
        cd-gpios = <&pio 0 8 GPIO_ACTIVE_HIGH>; /* PA8 */
        cd-inverted;
        allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
 };
 
+&mmc1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&mmc1_pins_a>, <&wifi_reset_pin_hummingbird>;
+       vmmc-supply = <&vcc_wifi>;
+       mmc-pwrseq = <&wifi_pwrseq>;
+       bus-width = <4>;
+       non-removable;
+       status = "okay";
+};
+
 &ohci0 {
        status = "okay";
 };
                allwinner,drive = <SUN4I_PINCTRL_10_MA>;
                allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
        };
+
+       wifi_reset_pin_hummingbird: wifi_reset_pin@0 {
+               allwinner,pins = "PG10";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+       };
+};
+
+&p2wi {
+       status = "okay";
+
+       axp221: 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";
+                       };
+               };
+       };
 };
 
 &reg_usb1_vbus {
diff --git a/arch/arm/boot/dts/sun6i-a31-i7.dts b/arch/arm/boot/dts/sun6i-a31-i7.dts
new file mode 100644 (file)
index 0000000..e9185da
--- /dev/null
@@ -0,0 +1,149 @@
+/*
+ * 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 "sun6i-a31.dtsi"
+#include "sunxi-common-regulators.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/pinctrl/sun4i-a10.h>
+
+/ {
+       model = "Mele I7 Quad top set box";
+       compatible = "mele,i7", "allwinner,sun6i-a31";
+
+       aliases {
+               serial0 = &uart0;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       leds {
+               compatible = "gpio-leds";
+               pinctrl-names = "default";
+               pinctrl-0 = <&led_pins_i7>;
+
+               blue {
+                       label = "i7:blue:usr";
+                       gpios = <&pio 7 13 GPIO_ACTIVE_HIGH>;
+               };
+       };
+};
+
+&ehci0 {
+       status = "okay";
+};
+
+&ehci1 {
+       status = "okay";
+};
+
+&gmac {
+       pinctrl-names = "default";
+       pinctrl-0 = <&gmac_pins_mii_a>;
+       phy = <&phy1>;
+       phy-mode = "mii";
+       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_i7>;
+       vmmc-supply = <&reg_vcc3v3>;
+       bus-width = <4>;
+       cd-gpios = <&pio 7 22 GPIO_ACTIVE_HIGH>; /* PH22 */
+       cd-inverted;
+       status = "okay";
+};
+
+&pio {
+       led_pins_i7: led_pins@0 {
+               allwinner,pins = "PH13";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+       };
+
+       mmc0_cd_pin_i7: mmc0_cd_pin@0 {
+               allwinner,pins = "PH22";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+       };
+
+       usb1_vbus_pin_i7: usb1_vbus_pin@0 {
+               allwinner,pins = "PC27";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+       };
+};
+
+&reg_usb1_vbus {
+       pinctrl-names = "default";
+       pinctrl-0 = <&usb1_vbus_pin_i7>;
+       gpio = <&pio 2 27 GPIO_ACTIVE_HIGH>;
+       status = "okay";
+};
+
+&uart0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart0_pins_a>;
+       status = "okay";
+};
+
+&usbphy {
+       usb1_vbus-supply = <&reg_usb1_vbus>;
+       status = "okay";
+};
index 139a21e6b695f1219d3750d0f5ff22d246134e1b..6e0e5687a09c73a03a6512bf2bf7f8015c6b4b12 100644 (file)
  *     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 file; 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
 #include <dt-bindings/pinctrl/sun4i-a10.h>
 
 / {
-       model = "Mele M9 / A1000G Quad top set box";
+       model = "Mele M9 top set box";
        compatible = "mele,m9", "allwinner,sun6i-a31";
 
+       aliases {
+               serial0 = &uart0;
+       };
+
        chosen {
-               bootargs = "earlyprintk console=ttyS0,115200";
+               stdout-path = "serial0:115200n8";
        };
 
-       soc@01c00000 {
-               mmc0: mmc@01c0f000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_m9>;
-                       vmmc-supply = <&reg_vcc3v3>;
-                       bus-width = <4>;
-                       cd-gpios = <&pio 7 22 GPIO_ACTIVE_HIGH>; /* PH22 */
-                       cd-inverted;
-                       status = "okay";
-               };
+       leds {
+               compatible = "gpio-leds";
+               pinctrl-names = "default";
+               pinctrl-0 = <&led_pins_m9>;
 
-               usbphy: phy@01c19400 {
-                       usb1_vbus-supply = <&reg_usb1_vbus>;
-                       status = "okay";
+               blue {
+                       label = "m9:blue:usr";
+                       gpios = <&pio 7 13 GPIO_ACTIVE_HIGH>;
                };
+       };
+};
 
-               ehci0: usb@01c1a000 {
-                       status = "okay";
-               };
+&ehci0 {
+       status = "okay";
+};
 
-               ehci1: usb@01c1b000 {
-                       status = "okay";
-               };
+&ehci1 {
+       status = "okay";
+};
 
-               pio: pinctrl@01c20800 {
-                       led_pins_m9: led_pins@0 {
-                               allwinner,pins = "PH13";
-                               allwinner,function = "gpio_out";
-                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-                       };
-
-                       mmc0_cd_pin_m9: mmc0_cd_pin@0 {
-                               allwinner,pins = "PH22";
-                               allwinner,function = "gpio_in";
-                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
-                       };
-
-                       usb1_vbus_pin_m9: usb1_vbus_pin@0 {
-                               allwinner,pins = "PC27";
-                               allwinner,function = "gpio_out";
-                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-                       };
-               };
+&gmac {
+       pinctrl-names = "default";
+       pinctrl-0 = <&gmac_pins_mii_a>;
+       phy = <&phy1>;
+       phy-mode = "mii";
+       status = "okay";
 
-               uart0: serial@01c28000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&uart0_pins_a>;
-                       status = "okay";
-               };
+       phy1: ethernet-phy@1 {
+               reg = <1>;
+       };
+};
 
-               gmac: ethernet@01c30000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&gmac_pins_mii_a>;
-                       phy = <&phy1>;
-                       phy-mode = "mii";
-                       status = "okay";
+&ir {
+       pinctrl-names = "default";
+       pinctrl-0 = <&ir_pins_a>;
+       status = "okay";
+};
 
-                       phy1: ethernet-phy@1 {
-                               reg = <1>;
-                       };
-               };
+&mmc0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_m9>;
+       vmmc-supply = <&reg_vcc3v3>;
+       bus-width = <4>;
+       cd-gpios = <&pio 7 22 GPIO_ACTIVE_HIGH>; /* PH22 */
+       cd-inverted;
+       status = "okay";
+};
 
-               ir@01f02000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&ir_pins_a>;
-                       status = "okay";
-               };
+&pio {
+       led_pins_m9: led_pins@0 {
+               allwinner,pins = "PH13";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
        };
 
-       leds {
-               compatible = "gpio-leds";
-               pinctrl-names = "default";
-               pinctrl-0 = <&led_pins_m9>;
-
-               blue {
-                       label = "m9:blue:usr";
-                       gpios = <&pio 7 13 GPIO_ACTIVE_HIGH>;
-               };
+       mmc0_cd_pin_m9: mmc0_cd_pin@0 {
+               allwinner,pins = "PH22";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
        };
 
-       reg_usb1_vbus: usb1-vbus {
-               pinctrl-names = "default";
-               pinctrl-0 = <&usb1_vbus_pin_m9>;
-               gpio = <&pio 2 27 GPIO_ACTIVE_HIGH>;
-               status = "okay";
+       usb1_vbus_pin_m9: usb1_vbus_pin@0 {
+               allwinner,pins = "PC27";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
        };
 };
+
+&reg_usb1_vbus {
+       pinctrl-names = "default";
+       pinctrl-0 = <&usb1_vbus_pin_m9>;
+       gpio = <&pio 2 27 GPIO_ACTIVE_HIGH>;
+       status = "okay";
+};
+
+&uart0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart0_pins_a>;
+       status = "okay";
+};
+
+&usbphy {
+       usb1_vbus-supply = <&reg_usb1_vbus>;
+       status = "okay";
+};
diff --git a/arch/arm/boot/dts/sun6i-a31-mele-a1000g-quad.dts b/arch/arm/boot/dts/sun6i-a31-mele-a1000g-quad.dts
new file mode 100644 (file)
index 0000000..4404f37
--- /dev/null
@@ -0,0 +1,149 @@
+/*
+ * Copyright 2014 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 "sun6i-a31.dtsi"
+#include "sunxi-common-regulators.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/pinctrl/sun4i-a10.h>
+
+/ {
+       model = "Mele A1000G Quad top set box";
+       compatible = "mele,a1000g-quad", "allwinner,sun6i-a31";
+
+       aliases {
+               serial0 = &uart0;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       leds {
+               compatible = "gpio-leds";
+               pinctrl-names = "default";
+               pinctrl-0 = <&led_pins_m9>;
+
+               blue {
+                       label = "m9:blue:usr";
+                       gpios = <&pio 7 13 GPIO_ACTIVE_HIGH>;
+               };
+       };
+};
+
+&ehci0 {
+       status = "okay";
+};
+
+&ehci1 {
+       status = "okay";
+};
+
+&gmac {
+       pinctrl-names = "default";
+       pinctrl-0 = <&gmac_pins_mii_a>;
+       phy = <&phy1>;
+       phy-mode = "mii";
+       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_m9>;
+       vmmc-supply = <&reg_vcc3v3>;
+       bus-width = <4>;
+       cd-gpios = <&pio 7 22 GPIO_ACTIVE_HIGH>; /* PH22 */
+       cd-inverted;
+       status = "okay";
+};
+
+&pio {
+       led_pins_m9: led_pins@0 {
+               allwinner,pins = "PH13";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+       };
+
+       mmc0_cd_pin_m9: mmc0_cd_pin@0 {
+               allwinner,pins = "PH22";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+       };
+
+       usb1_vbus_pin_m9: usb1_vbus_pin@0 {
+               allwinner,pins = "PC27";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+       };
+};
+
+&reg_usb1_vbus {
+       pinctrl-names = "default";
+       pinctrl-0 = <&usb1_vbus_pin_m9>;
+       gpio = <&pio 2 27 GPIO_ACTIVE_HIGH>;
+       status = "okay";
+};
+
+&uart0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart0_pins_a>;
+       status = "okay";
+};
+
+&usbphy {
+       usb1_vbus-supply = <&reg_usb1_vbus>;
+       status = "okay";
+};
index fa2f403ccf28adf4f6aa10c08978dd3b59b6e709..008047a018cf2b645cc85136c194be665376c5ef 100644 (file)
  *     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 file; 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
@@ -50,6 +45,7 @@
 #include "skeleton.dtsi"
 
 #include <dt-bindings/interrupt-controller/arm-gic.h>
+#include <dt-bindings/thermal/thermal.h>
 
 #include <dt-bindings/pinctrl/sun4i-a10.h>
 
@@ -66,7 +62,8 @@
                ranges;
 
                framebuffer@0 {
-                       compatible = "allwinner,simple-framebuffer", "simple-framebuffer";
+                       compatible = "allwinner,simple-framebuffer",
+                                    "simple-framebuffer";
                        allwinner,pipeline = "de_be0-lcd0-hdmi";
                        clocks = <&pll6 0>;
                        status = "disabled";
                #address-cells = <1>;
                #size-cells = <0>;
 
-               cpu@0 {
+               cpu0: cpu@0 {
                        compatible = "arm,cortex-a7";
                        device_type = "cpu";
                        reg = <0>;
+                       clocks = <&cpu>;
+                       clock-latency = <244144>; /* 8 32k periods */
+                       operating-points = <
+                               /* kHz    uV */
+                               1008000 1200000
+                               864000  1200000
+                               720000  1100000
+                               480000  1000000
+                               >;
+                       #cooling-cells = <2>;
+                       cooling-min-level = <0>;
+                       cooling-max-level = <3>;
                };
 
                cpu@1 {
                };
        };
 
+       thermal-zones {
+               cpu_thermal {
+                       /* milliseconds */
+                       polling-delay-passive = <250>;
+                       polling-delay = <1000>;
+                       thermal-sensors = <&rtp>;
+
+                       cooling-maps {
+                               map0 {
+                                       trip = <&cpu_alert0>;
+                                       cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+                               };
+                       };
+
+                       trips {
+                               cpu_alert0: cpu_alert0 {
+                                       /* milliCelsius */
+                                       temperature = <70000>;
+                                       hysteresis = <2000>;
+                                       type = "passive";
+                               };
+
+                               cpu_crit: cpu_crit {
+                                       /* milliCelsius */
+                                       temperature = <100000>;
+                                       hysteresis = <2000>;
+                                       type = "critical";
+                               };
+                       };
+               };
+       };
+
        memory {
                reg = <0x40000000 0x80000000>;
        };
                        reg = <0x01c20054 0x4>;
                        clocks = <&osc32k>, <&osc24M>, <&axi>, <&pll6 0>;
                        clock-output-names = "ahb1";
+
+                       /*
+                        * Clock AHB1 from PLL6, instead of CPU/AXI which
+                        * has rate changes due to cpufreq. Also the DMA
+                        * controller requires AHB1 clocked from PLL6.
+                        */
+                       assigned-clocks = <&ahb1>;
+                       assigned-clock-parents = <&pll6 0>;
                };
 
                ahb1_gates: clk@01c20060 {
                        reg = <0x01c2006c 0x4>;
                        clocks = <&apb2>;
                        clock-output-names = "apb2_i2c0", "apb2_i2c1",
-                                       "apb2_i2c2", "apb2_i2c3", "apb2_uart0",
-                                       "apb2_uart1", "apb2_uart2", "apb2_uart3",
-                                       "apb2_uart4", "apb2_uart5";
+                                            "apb2_i2c2", "apb2_i2c3",
+                                            "apb2_uart0", "apb2_uart1",
+                                            "apb2_uart2", "apb2_uart3",
+                                            "apb2_uart4", "apb2_uart5";
                };
 
                mmc0_clk: clk@01c20088 {
 
                usb_clk: clk@01c200cc {
                        #clock-cells = <1>;
-                       #reset-cells = <1>;
+                       #reset-cells = <1>;
                        compatible = "allwinner,sun6i-a31-usb-clk";
                        reg = <0x01c200cc 0x4>;
                        clocks = <&osc24M>;
                };
 
                /*
-                * The following two are dummy clocks, placeholders used in the gmac_tx
-                * clock. The gmac driver will choose one parent depending on the PHY
-                * interface mode, using clk_set_rate auto-reparenting.
-                * The actual TX clock rate is not controlled by the gmac_tx clock.
+                * The following two are dummy clocks, placeholders
+                * used in the gmac_tx clock. The gmac driver will
+                * choose one parent depending on the PHY interface
+                * mode, using clk_set_rate auto-reparenting.
+                *
+                * The actual TX clock rate is not controlled by the
+                * gmac_tx clock.
                 */
                mii_phy_tx_clk: clk@1 {
                        #clock-cells = <0>;
                        clocks = <&ahb1_gates 6>;
                        resets = <&ahb1_rst 6>;
                        #dma-cells = <1>;
-
-                       /* DMA controller requires AHB1 clocked from PLL6 */
-                       assigned-clocks = <&ahb1>;
-                       assigned-clock-parents = <&pll6 0>;
                };
 
                mmc0: mmc@01c0f000 {
                        reset-names = "ahb";
                        interrupts = <GIC_SPI 60 IRQ_TYPE_LEVEL_HIGH>;
                        status = "disabled";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
                };
 
                mmc1: mmc@01c10000 {
                        reset-names = "ahb";
                        interrupts = <GIC_SPI 61 IRQ_TYPE_LEVEL_HIGH>;
                        status = "disabled";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
                };
 
                mmc2: mmc@01c11000 {
                        reset-names = "ahb";
                        interrupts = <GIC_SPI 62 IRQ_TYPE_LEVEL_HIGH>;
                        status = "disabled";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
                };
 
                mmc3: mmc@01c12000 {
                        reset-names = "ahb";
                        interrupts = <GIC_SPI 63 IRQ_TYPE_LEVEL_HIGH>;
                        status = "disabled";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
                };
 
                usbphy: phy@01c19400 {
                        };
 
                        mmc0_pins_a: mmc0@0 {
-                               allwinner,pins = "PF0","PF1","PF2","PF3","PF4","PF5";
+                               allwinner,pins = "PF0", "PF1", "PF2",
+                                                "PF3", "PF4", "PF5";
                                allwinner,function = "mmc0";
                                allwinner,drive = <SUN4I_PINCTRL_30_MA>;
                                allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
                        };
 
+                       mmc1_pins_a: mmc1@0 {
+                               allwinner,pins = "PG0", "PG1", "PG2", "PG3",
+                                                "PG4", "PG5";
+                               allwinner,function = "mmc1";
+                               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",
                };
 
                timer@01c60000 {
-                       compatible = "allwinner,sun6i-a31-hstimer", "allwinner,sun7i-a20-hstimer";
+                       compatible = "allwinner,sun6i-a31-hstimer",
+                                    "allwinner,sun7i-a20-hstimer";
                        reg = <0x01c60000 0x1000>;
                        interrupts = <GIC_SPI 51 IRQ_TYPE_LEVEL_HIGH>,
                                     <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>,
                        ar100: ar100_clk {
                                compatible = "allwinner,sun6i-a31-ar100-clk";
                                #clock-cells = <0>;
-                               clocks = <&osc32k>, <&osc24M>, <&pll6 0>, <&pll6 0>;
+                               clocks = <&osc32k>, <&osc24M>, <&pll6 0>,
+                                        <&pll6 0>;
                                clock-output-names = "ar100";
                        };
 
                                allwinner,drive = <SUN4I_PINCTRL_10_MA>;
                                allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
                        };
+
+                       p2wi_pins: p2wi {
+                               allwinner,pins = "PL0", "PL1";
+                               allwinner,function = "s_p2wi";
+                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+                       };
+               };
+
+               p2wi: i2c@01f03400 {
+                       compatible = "allwinner,sun6i-a31-p2wi";
+                       reg = <0x01f03400 0x400>;
+                       interrupts = <GIC_SPI 39 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&apb0_gates 3>;
+                       clock-frequency = <100000>;
+                       resets = <&apb0_rst 3>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&p2wi_pins>;
+                       status = "disabled";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
                };
        };
 };
index bc3734f67cf058dac78698fe0ef9184ba62dc893..1e2411a2bceac845237b62cf9f404d2817be4e77 100644 (file)
  *     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
 / {
        model = "CSQ CS908 top set box";
        compatible = "csq,cs908", "allwinner,sun6i-a31s";
-};
 
-&usbphy {
-       status = "okay";
+       aliases {
+               serial0 = &uart0;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
 };
 
 &ehci0 {
        status = "okay";
 };
 
-&ohci1 {
-       status = "okay";
-};
-
-&pio {
-       usb1_vbus_pin_csq908: usb1_vbus_pin@0 {
-               allwinner,pins = "PC27";
-               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";
-};
-
 &gmac {
        pinctrl-names = "default";
        pinctrl-0 = <&gmac_pins_mii_a>;
        pinctrl-0 = <&ir_pins_a>;
        status = "okay";
 };
+
+&ohci1 {
+       status = "okay";
+};
+
+&uart0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart0_pins_a>;
+       status = "okay";
+};
+
+&usbphy {
+       status = "okay";
+};
index eaf5ec8fd459cb36bcee658897f5fd93ac6cd36d..c17a32771b98c881f408d56b388bbb3209e25905 100644 (file)
  *     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
index 5dd139e7792e122edd1235a61dd6c2a452594d58..9f7b472e6725606cfd850cf1fc69b961ea6d6e20 100644 (file)
  *     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 file; 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
                serial2 = &uart7;
        };
 
-       soc@01c00000 {
-               spi0: spi@01c05000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&spi0_pins_a>;
-                       status = "okay";
-               };
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
 
-               mmc0: mmc@01c0f000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_bananapi>;
-                       vmmc-supply = <&reg_vcc3v3>;
-                       bus-width = <4>;
-                       cd-gpios = <&pio 7 10 GPIO_ACTIVE_HIGH>; /* PH10 */
-                       cd-inverted;
-                       status = "okay";
-               };
+       leds {
+               compatible = "gpio-leds";
+               pinctrl-names = "default";
+               pinctrl-0 = <&led_pins_bananapi>;
 
-               usbphy: phy@01c13400 {
-                       usb1_vbus-supply = <&reg_usb1_vbus>;
-                       usb2_vbus-supply = <&reg_usb2_vbus>;
-                       status = "okay";
+               green {
+                       label = "bananapi:green:usr";
+                       gpios = <&pio 7 24 GPIO_ACTIVE_HIGH>;
                };
+       };
 
-               ehci0: usb@01c14000 {
-                       status = "okay";
-               };
+       reg_gmac_3v3: gmac-3v3 {
+               compatible = "regulator-fixed";
+               pinctrl-names = "default";
+               pinctrl-0 = <&gmac_power_pin_bananapi>;
+               regulator-name = "gmac-3v3";
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+               startup-delay-us = <100000>;
+               enable-active-high;
+               gpio = <&pio 7 23 GPIO_ACTIVE_HIGH>;
+       };
+};
 
-               ohci0: usb@01c14400 {
-                       status = "okay";
-               };
+&ahci {
+       status = "okay";
+};
 
-               ahci: sata@01c18000 {
-                       status = "okay";
-               };
+&ehci0 {
+       status = "okay";
+};
 
-               ehci1: usb@01c1c000 {
-                       status = "okay";
-               };
+&ehci1 {
+       status = "okay";
+};
 
-               ohci1: usb@01c1c400 {
-                       status = "okay";
-               };
+&gmac {
+       pinctrl-names = "default";
+       pinctrl-0 = <&gmac_pins_rgmii_a>;
+       phy = <&phy1>;
+       phy-mode = "rgmii";
+       phy-supply = <&reg_gmac_3v3>;
+       status = "okay";
 
-               pinctrl@01c20800 {
-                       mmc0_cd_pin_bananapi: mmc0_cd_pin@0 {
-                               allwinner,pins = "PH10";
-                               allwinner,function = "gpio_in";
-                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
-                       };
-
-                       gmac_power_pin_bananapi: gmac_power_pin@0 {
-                               allwinner,pins = "PH23";
-                               allwinner,function = "gpio_out";
-                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-                       };
-
-                       led_pins_bananapi: led_pins@0 {
-                               allwinner,pins = "PH24";
-                               allwinner,function = "gpio_out";
-                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-                       };
-               };
+       phy1: ethernet-phy@1 {
+               reg = <1>;
+       };
+};
 
-               ir0: ir@01c21800 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&ir0_pins_a>;
-                       status = "okay";
-               };
+&i2c0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c0_pins_a>;
+       status = "okay";
 
-               uart0: serial@01c28000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&uart0_pins_a>;
-                       status = "okay";
-               };
+       axp209: pmic@34 {
+               compatible = "x-powers,axp209";
+               reg = <0x34>;
+               interrupt-parent = <&nmi_intc>;
+               interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
 
-               uart3: serial@01c28c00 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&uart3_pins_b>;
-                       status = "okay";
-               };
+               interrupt-controller;
+               #interrupt-cells = <1>;
+       };
+};
 
-               uart7: serial@01c29c00 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&uart7_pins_a>;
-                       status = "okay";
-               };
+&i2c2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c2_pins_a>;
+       status = "okay";
+};
 
-               i2c0: i2c@01c2ac00 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&i2c0_pins_a>;
-                       status = "okay";
+&ir0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&ir0_rx_pins_a>;
+       status = "okay";
+};
 
-                       axp209: pmic@34 {
-                               compatible = "x-powers,axp209";
-                               reg = <0x34>;
-                               interrupt-parent = <&nmi_intc>;
-                               interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
+&mmc0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_bananapi>;
+       vmmc-supply = <&reg_vcc3v3>;
+       bus-width = <4>;
+       cd-gpios = <&pio 7 10 GPIO_ACTIVE_HIGH>; /* PH10 */
+       cd-inverted;
+       status = "okay";
+};
 
-                               interrupt-controller;
-                               #interrupt-cells = <1>;
-                       };
-               };
+&ohci0 {
+       status = "okay";
+};
 
-               i2c2: i2c@01c2b400 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&i2c2_pins_a>;
-                       status = "okay";
-               };
+&ohci1 {
+       status = "okay";
+};
 
-               gmac: ethernet@01c50000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&gmac_pins_rgmii_a>;
-                       phy = <&phy1>;
-                       phy-mode = "rgmii";
-                       phy-supply = <&reg_gmac_3v3>;
-                       status = "okay";
-
-                       phy1: ethernet-phy@1 {
-                               reg = <1>;
-                       };
-               };
+&pio {
+       mmc0_cd_pin_bananapi: mmc0_cd_pin@0 {
+               allwinner,pins = "PH10";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
        };
 
-       leds {
-               compatible = "gpio-leds";
-               pinctrl-names = "default";
-               pinctrl-0 = <&led_pins_bananapi>;
-
-               green {
-                       label = "bananapi:green:usr";
-                       gpios = <&pio 7 24 GPIO_ACTIVE_HIGH>;
-               };
+       gmac_power_pin_bananapi: gmac_power_pin@0 {
+               allwinner,pins = "PH23";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
        };
 
-       reg_usb1_vbus: usb1-vbus {
-               status = "okay";
+       led_pins_bananapi: led_pins@0 {
+               allwinner,pins = "PH24";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
        };
+};
 
-       reg_usb2_vbus: usb2-vbus {
-               status = "okay";
-       };
+&reg_usb1_vbus {
+       status = "okay";
+};
 
-       reg_gmac_3v3: gmac-3v3 {
-               compatible = "regulator-fixed";
-               pinctrl-names = "default";
-               pinctrl-0 = <&gmac_power_pin_bananapi>;
-               regulator-name = "gmac-3v3";
-               regulator-min-microvolt = <3300000>;
-               regulator-max-microvolt = <3300000>;
-               startup-delay-us = <100000>;
-               enable-active-high;
-               gpio = <&pio 7 23 GPIO_ACTIVE_HIGH>;
-       };
+&reg_usb2_vbus {
+       status = "okay";
+};
+
+&spi0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&spi0_pins_a>,
+                   <&spi0_cs0_pins_a>,
+                   <&spi0_cs1_pins_a>;
+       status = "okay";
+};
+
+&uart0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart0_pins_a>;
+       status = "okay";
+};
+
+&uart3 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart3_pins_b>;
+       status = "okay";
+};
+
+&uart7 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart7_pins_a>;
+       status = "okay";
+};
+
+&usbphy {
+       usb1_vbus-supply = <&reg_usb1_vbus>;
+       usb2_vbus-supply = <&reg_usb2_vbus>;
+       status = "okay";
 };
index fb89fe7ed21b61e28de41fe18c55b9f3ea217f51..18fcc87f462132366e1a3978118fb1800f9a46fc 100644 (file)
  *     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 file; 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
        model = "LeMaker Banana Pro";
        compatible = "lemaker,bananapro", "allwinner,sun7i-a20";
 
+       aliases {
+               serial0 = &uart0;
+               serial1 = &uart4;
+               serial2 = &uart7;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
        leds {
                compatible = "gpio-leds";
                pinctrl-names = "default";
 
 &ir0 {
        pinctrl-names = "default";
-       pinctrl-0 = <&ir0_pins_a>;
+       pinctrl-0 = <&ir0_rx_pins_a>;
        status = "okay";
 };
 
 
 &spi0 {
        pinctrl-names = "default";
-       pinctrl-0 = <&spi0_pins_a>;
+       pinctrl-0 = <&spi0_pins_a>,
+                   <&spi0_cs0_pins_a>,
+                   <&spi0_cs1_pins_a>;
        status = "okay";
 };
 
        status = "okay";
 };
 
-&uart2 {
+&uart4 {
        pinctrl-names = "default";
-       pinctrl-0 = <&uart2_pins_a>;
+       pinctrl-0 = <&uart4_pins_b>;
        status = "okay";
 };
 
index c4ab6edb6f1567881fdef0f1d8c9e802967f780c..39a51d5143f73b075d8dc4d4e7781d3ea919a2c5 100644 (file)
  *     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 file; 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
        model = "Cubietech Cubieboard2";
        compatible = "cubietech,cubieboard2", "allwinner,sun7i-a20";
 
-       soc@01c00000 {
-               mmc0: mmc@01c0f000 {
-                       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";
-               };
-
-               usbphy: phy@01c13400 {
-                       usb1_vbus-supply = <&reg_usb1_vbus>;
-                       usb2_vbus-supply = <&reg_usb2_vbus>;
-                       status = "okay";
-               };
-
-               ehci0: usb@01c14000 {
-                       status = "okay";
-               };
-
-               ohci0: usb@01c14400 {
-                       status = "okay";
-               };
-
-               ahci: sata@01c18000 {
-                       target-supply = <&reg_ahci_5v>;
-                       status = "okay";
-               };
-
-               ehci1: usb@01c1c000 {
-                       status = "okay";
-               };
-
-               ohci1: usb@01c1c400 {
-                       status = "okay";
-               };
-
-               pinctrl@01c20800 {
-                       led_pins_cubieboard2: led_pins@0 {
-                               allwinner,pins = "PH20", "PH21";
-                               allwinner,function = "gpio_out";
-                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-                       };
-               };
-
-               ir0: ir@01c21800 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&ir0_pins_a>;
-                       status = "okay";
-               };
-
-               uart0: serial@01c28000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&uart0_pins_a>;
-                       status = "okay";
-               };
-
-               i2c0: i2c@01c2ac00 {
-                       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: i2c@01c2b000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&i2c1_pins_a>;
-                       status = "okay";
-               };
-
-               gmac: ethernet@01c50000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&gmac_pins_mii_a>;
-                       phy = <&phy1>;
-                       phy-mode = "mii";
-                       status = "okay";
+       aliases {
+               serial0 = &uart0;
+       };
 
-                       phy1: ethernet-phy@1 {
-                               reg = <1>;
-                       };
-               };
+       chosen {
+               stdout-path = "serial0:115200n8";
        };
 
        leds {
                        gpios = <&pio 7 20 GPIO_ACTIVE_HIGH>;
                };
        };
+};
 
-       reg_ahci_5v: ahci-5v {
-               status = "okay";
-       };
+&ahci {
+       target-supply = <&reg_ahci_5v>;
+       status = "okay";
+};
 
-       reg_usb1_vbus: usb1-vbus {
-               status = "okay";
+&cpu0 {
+       cpu-supply = <&reg_dcdc2>;
+};
+
+&ehci0 {
+       status = "okay";
+};
+
+&ehci1 {
+       status = "okay";
+};
+
+&gmac {
+       pinctrl-names = "default";
+       pinctrl-0 = <&gmac_pins_mii_a>;
+       phy = <&phy1>;
+       phy-mode = "mii";
+       status = "okay";
+
+       phy1: ethernet-phy@1 {
+               reg = <1>;
        };
+};
 
-       reg_usb2_vbus: usb2-vbus {
-               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>;
        };
 };
 
-#include "axp209.dtsi"
+&i2c1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c1_pins_a>;
+       status = "okay";
+};
 
-&cpu0 {
-       cpu-supply = <&reg_dcdc2>;
+&ir0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&ir0_rx_pins_a>;
+       status = "okay";
+};
+
+&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 {
+       led_pins_cubieboard2: led_pins@0 {
+               allwinner,pins = "PH20", "PH21";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+       };
+};
+
+&reg_ahci_5v {
+       status = "okay";
+};
+
+#include "axp209.dtsi"
+
 &reg_dcdc2 {
        regulator-always-on;
        regulator-min-microvolt = <1000000>;
        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 8f74a649576da72da1d563cac0832a512951c9a4..4611e2f5a99e85577f4ba7ad7363e7878049305b 100644 (file)
  *     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 file; 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
        model = "Cubietech Cubietruck";
        compatible = "cubietech,cubietruck", "allwinner,sun7i-a20";
 
-       soc@01c00000 {
-               mmc0: mmc@01c0f000 {
-                       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: mmc@01c12000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&mmc3_pins_a>;
-                       vmmc-supply = <&reg_vmmc3>;
-                       bus-width = <4>;
-                       non-removable;
-                       status = "okay";
-               };
-
-               usbphy: phy@01c13400 {
-                       usb0_vbus-supply = <&reg_usb0_vbus>;
-                       usb1_vbus-supply = <&reg_usb1_vbus>;
-                       usb2_vbus-supply = <&reg_usb2_vbus>;
-                       status = "okay";
-               };
-
-               ehci0: usb@01c14000 {
-                       status = "okay";
-               };
-
-               ohci0: usb@01c14400 {
-                       status = "okay";
-               };
-
-               ahci: sata@01c18000 {
-                       target-supply = <&reg_ahci_5v>;
-                       status = "okay";
-               };
-
-               ehci1: usb@01c1c000 {
-                       status = "okay";
-               };
-
-               ohci1: usb@01c1c400 {
-                       status = "okay";
-               };
-
-               pinctrl@01c20800 {
-                       mmc3_pins_a: mmc3@0 {
-                               /* AP6210 requires pull-up */
-                               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
-                       };
-
-                       vmmc3_pin_cubietruck: vmmc3_pin@0 {
-                               allwinner,pins = "PH9";
-                               allwinner,function = "gpio_out";
-                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-                       };
-
-                       ahci_pwr_pin_cubietruck: ahci_pwr_pin@1 {
-                               allwinner,pins = "PH12";
-                               allwinner,function = "gpio_out";
-                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-                       };
-
-                       led_pins_cubietruck: led_pins@0 {
-                               allwinner,pins = "PH7", "PH11", "PH20", "PH21";
-                               allwinner,function = "gpio_out";
-                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-                       };
-
-                       usb0_vbus_pin_a: usb0_vbus_pin@0 {
-                               allwinner,pins = "PH17";
-                               allwinner,function = "gpio_out";
-                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-                       };
-               };
-
-               pwm: pwm@01c20e00 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&pwm0_pins_a>, <&pwm1_pins_a>;
-                       status = "okay";
-               };
-
-               ir0: ir@01c21800 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&ir0_pins_a>;
-                       status = "okay";
-               };
-
-               uart0: serial@01c28000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&uart0_pins_a>;
-                       status = "okay";
-               };
-
-               i2c0: i2c@01c2ac00 {
-                       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: i2c@01c2b000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&i2c1_pins_a>;
-                       status = "okay";
-               };
-
-               i2c2: i2c@01c2b400 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&i2c2_pins_a>;
-                       status = "okay";
-               };
-
-               gmac: ethernet@01c50000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&gmac_pins_rgmii_a>;
-                       phy = <&phy1>;
-                       phy-mode = "rgmii";
-                       status = "okay";
+       aliases {
+               serial0 = &uart0;
+       };
 
-                       phy1: ethernet-phy@1 {
-                               reg = <1>;
-                       };
-               };
+       chosen {
+               stdout-path = "serial0:115200n8";
        };
 
        leds {
                };
        };
 
-       reg_ahci_5v: ahci-5v {
-               pinctrl-0 = <&ahci_pwr_pin_cubietruck>;
-               gpio = <&pio 7 12 GPIO_ACTIVE_HIGH>;
-               status = "okay";
-       };
-
-       reg_usb0_vbus: usb0-vbus {
-               pinctrl-0 = <&usb0_vbus_pin_a>;
-               gpio = <&pio 7 17 GPIO_ACTIVE_HIGH>;
-               status = "okay";
-       };
-
-       reg_usb1_vbus: usb1-vbus {
-               status = "okay";
-       };
-
-       reg_usb2_vbus: usb2-vbus {
-               status = "okay";
-       };
-
        reg_vmmc3: vmmc3 {
                compatible = "regulator-fixed";
                pinctrl-names = "default";
        };
 };
 
-#include "axp209.dtsi"
+&ahci {
+       target-supply = <&reg_ahci_5v>;
+       status = "okay";
+};
 
 &cpu0 {
        cpu-supply = <&reg_dcdc2>;
 };
 
+&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>;
+       };
+};
+
+&i2c1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c1_pins_a>;
+       status = "okay";
+};
+
+&i2c2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c2_pins_a>;
+       status = "okay";
+};
+
+&ir0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&ir0_rx_pins_a>;
+       status = "okay";
+};
+
+&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_vmmc3>;
+       bus-width = <4>;
+       non-removable;
+       status = "okay";
+
+       brcmf: bcrmf@1 {
+               reg = <1>;
+               compatible = "brcm,bcm4329-fmac";
+               interrupt-parent = <&pio>;
+               interrupts = <10 IRQ_TYPE_LEVEL_LOW>; /* PH10 / EINT10 */
+               interrupt-names = "host-wake";
+       };
+};
+
+&mmc3_pins_a {
+       /* AP6210 requires pull-up */
+       allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+};
+
+&ohci0 {
+       status = "okay";
+};
+
+&ohci1 {
+       status = "okay";
+};
+
+&pio {
+       vmmc3_pin_cubietruck: vmmc3_pin@0 {
+               allwinner,pins = "PH9";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+       };
+
+       ahci_pwr_pin_cubietruck: ahci_pwr_pin@1 {
+               allwinner,pins = "PH12";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+       };
+
+       led_pins_cubietruck: led_pins@0 {
+               allwinner,pins = "PH7", "PH11", "PH20", "PH21";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+       };
+
+       usb0_vbus_pin_a: usb0_vbus_pin@0 {
+               allwinner,pins = "PH17";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+       };
+};
+
+&pwm {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pwm0_pins_a>, <&pwm1_pins_a>;
+       status = "okay";
+};
+
+&reg_ahci_5v {
+       pinctrl-0 = <&ahci_pwr_pin_cubietruck>;
+       gpio = <&pio 7 12 GPIO_ACTIVE_HIGH>;
+       status = "okay";
+};
+
+#include "axp209.dtsi"
+
 &reg_dcdc2 {
        regulator-always-on;
        regulator-min-microvolt = <1000000>;
        regulator-max-microvolt = <3000000>;
        regulator-name = "avcc";
 };
+
+&reg_usb0_vbus {
+       pinctrl-0 = <&usb0_vbus_pin_a>;
+       gpio = <&pio 7 17 GPIO_ACTIVE_HIGH>;
+       status = "okay";
+};
+
+&reg_usb1_vbus {
+       status = "okay";
+};
+
+&reg_usb2_vbus {
+       status = "okay";
+};
+
+&uart0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart0_pins_a>;
+       status = "okay";
+};
+
+&usbphy {
+       usb0_vbus-supply = <&reg_usb0_vbus>;
+       usb1_vbus-supply = <&reg_usb1_vbus>;
+       usb2_vbus-supply = <&reg_usb2_vbus>;
+       status = "okay";
+};
index 86a944ce19f8c6f2e01e650070945ba02a759f10..37f4a54974526f2c484fcf23e2c6432aabd467df 100644 (file)
@@ -3,12 +3,43 @@
  *
  * Wills Wang <wills.wang.open@gmail.com>
  *
- * 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 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/;
                serial4 = &uart5;
        };
 
-       soc@01c00000 {
-               mmc0: mmc@01c0f000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>;
-                       vmmc-supply = <&reg_vcc3v0>;
-                       bus-width = <4>;
-                       cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */
-                       cd-inverted;
-                       status = "okay";
-               };
-
-               mmc3: mmc@01c12000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&mmc3_pins_a>;
-                       vmmc-supply = <&reg_mmc3_vdd>;
-                       bus-width = <4>;
-                       non-removable;
-                       status = "okay";
-               };
-
-               usbphy: phy@01c13400 {
-                       usb1_vbus-supply = <&reg_usb1_vbus>;
-                       usb2_vbus-supply = <&reg_usb2_vbus>;
-                       status = "okay";
-               };
-
-               ehci0: usb@01c14000 {
-                       status = "okay";
-               };
-
-               ohci0: usb@01c14400 {
-                       status = "okay";
-               };
-
-               ahci: sata@01c18000 {
-                       target-supply = <&reg_ahci_5v>;
-                       status = "okay";
-               };
-
-               ehci1: usb@01c1c000 {
-                       status = "okay";
-               };
-
-               ohci1: usb@01c1c400 {
-                       status = "okay";
-               };
-
-               pio: pinctrl@01c20800 {
-                       ahci_pwr_pin_a20_hummingbird: ahci_pwr_pin@0 {
-                               allwinner,pins = "PH15";
-                               allwinner,function = "gpio_out";
-                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-                       };
-
-                       usb1_vbus_pin_a20_hummingbird: usb1_vbus_pin@0 {
-                               allwinner,pins = "PH2";
-                               allwinner,function = "gpio_out";
-                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-                       };
-
-                       mmc3_vdd_pin_a20_hummingbird: mmc3_vdd_pin@0 {
-                               allwinner,pins = "PH9";
-                               allwinner,function = "gpio_out";
-                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-                       };
-
-                       gmac_vdd_pin_a20_hummingbird: gmac_vdd_pin@0 {
-                               allwinner,pins = "PH16";
-                               allwinner,function = "gpio_out";
-                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-                       };
-               };
-
-               pwm: pwm@01c20e00 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&pwm0_pins_a>;
-                       status = "okay";
-               };
-
-               ir0: ir@01c21800 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&ir0_pins_a>;
-                       status = "okay";
-               };
-
-               uart0: serial@01c28000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&uart0_pins_a>;
-                       status = "okay";
-               };
-
-               uart2: serial@01c28800 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&uart2_pins_a>;
-                       status = "okay";
-               };
-
-               uart3: serial@01c28c00 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&uart3_pins_a>;
-                       status = "okay";
-               };
-
-               uart4: serial@01c29000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&uart4_pins_a>;
-                       status = "okay";
-               };
-
-               uart5: serial@01c29400 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&uart5_pins_a>;
-                       status = "okay";
-               };
-
-               i2c0: i2c@01c2ac00 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&i2c0_pins_a>;
-                       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>;
-                       };
-               };
-
-               i2c1: i2c@01c2b000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&i2c1_pins_a>;
-                       status = "okay";
-               };
-
-               i2c2: i2c@01c2b400 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&i2c2_pins_a>;
-                       status = "okay";
-               };
-
-               i2c3: i2c@01c2b800 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&i2c3_pins_a>;
-                       status = "okay";
-               };
-
-               spi2: spi@01c17000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&spi2_pins_b>;
-                       status = "okay";
-               };
-
-               gmac: ethernet@01c50000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&gmac_pins_rgmii_a>;
-                       phy = <&phy1>;
-                       phy-mode = "rgmii";
-                       phy-supply = <&reg_gmac_vdd>;
-                       /* phy reset config */
-                       snps,reset-gpio = <&pio 0 17 GPIO_ACTIVE_HIGH>; /* PA17 */
-                       snps,reset-active-low;
-                       /* wait 1s after reset, otherwise fail to read phy id */
-                       snps,reset-delays-us = <0 10000 1000000>;
-                       status = "okay";
-
-                       phy1: ethernet-phy@1 {
-                               reg = <1>;
-                       };
-               };
-       };
-
-       reg_ahci_5v: ahci-5v {
-               pinctrl-0 = <&ahci_pwr_pin_a20_hummingbird>;
-               gpio = <&pio 7 15 GPIO_ACTIVE_HIGH>; /* PH15 */
-               status = "okay";
-       };
-
-       reg_usb1_vbus: usb1-vbus {
-               pinctrl-0 = <&usb1_vbus_pin_a20_hummingbird>;
-               gpio = <&pio 7 2 GPIO_ACTIVE_HIGH>; /* PH2 */
-               status = "okay";
-       };
-
-       reg_usb2_vbus: usb2-vbus {
-               status = "okay";
+       chosen {
+               stdout-path = "serial0:115200n8";
        };
 
        reg_mmc3_vdd: mmc3_vdd {
                gpio = <&pio 7 16 GPIO_ACTIVE_HIGH>; /* PH16 */
        };
 };
+
+&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";
+       phy-supply = <&reg_gmac_vdd>;
+       /* phy reset config */
+       snps,reset-gpio = <&pio 0 17 GPIO_ACTIVE_HIGH>; /* PA17 */
+       snps,reset-active-low;
+       /* wait 1s after reset, otherwise fail to read phy id */
+       snps,reset-delays-us = <0 10000 1000000>;
+       status = "okay";
+
+       phy1: ethernet-phy@1 {
+               reg = <1>;
+       };
+};
+
+&i2c0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c0_pins_a>;
+       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>;
+       };
+};
+
+&i2c1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c1_pins_a>;
+       status = "okay";
+};
+
+&i2c2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c2_pins_a>;
+       status = "okay";
+};
+
+&i2c3 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c3_pins_a>;
+       status = "okay";
+};
+
+&ir0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&ir0_rx_pins_a>;
+       status = "okay";
+};
+
+&mmc0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>;
+       vmmc-supply = <&reg_vcc3v0>;
+       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_mmc3_vdd>;
+       bus-width = <4>;
+       non-removable;
+       status = "okay";
+};
+
+&ohci0 {
+       status = "okay";
+};
+
+&ohci1 {
+       status = "okay";
+};
+
+&pio {
+       ahci_pwr_pin_a20_hummingbird: ahci_pwr_pin@0 {
+               allwinner,pins = "PH15";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+       };
+
+       usb1_vbus_pin_a20_hummingbird: usb1_vbus_pin@0 {
+               allwinner,pins = "PH2";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+       };
+
+       mmc3_vdd_pin_a20_hummingbird: mmc3_vdd_pin@0 {
+               allwinner,pins = "PH9";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+       };
+
+       gmac_vdd_pin_a20_hummingbird: gmac_vdd_pin@0 {
+               allwinner,pins = "PH16";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+       };
+};
+
+&pwm {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pwm0_pins_a>;
+       status = "okay";
+};
+
+&reg_ahci_5v {
+       pinctrl-0 = <&ahci_pwr_pin_a20_hummingbird>;
+       gpio = <&pio 7 15 GPIO_ACTIVE_HIGH>; /* PH15 */
+       status = "okay";
+};
+
+&reg_usb1_vbus {
+       pinctrl-0 = <&usb1_vbus_pin_a20_hummingbird>;
+       gpio = <&pio 7 2 GPIO_ACTIVE_HIGH>; /* PH2 */
+       status = "okay";
+};
+
+&reg_usb2_vbus {
+       status = "okay";
+};
+
+&spi2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&spi2_pins_b>,
+                   <&spi2_cs0_pins_b>;
+       status = "okay";
+};
+
+&uart0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart0_pins_a>;
+       status = "okay";
+};
+
+&uart2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart2_pins_a>;
+       status = "okay";
+};
+
+&uart3 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart3_pins_a>;
+       status = "okay";
+};
+
+&uart4 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart4_pins_a>;
+       status = "okay";
+};
+
+&uart5 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart5_pins_a>;
+       status = "okay";
+};
+
+&usbphy {
+       usb1_vbus-supply = <&reg_usb1_vbus>;
+       usb2_vbus-supply = <&reg_usb2_vbus>;
+       status = "okay";
+};
index 06148b4d000fd275413a19703b8af8d2e24d5510..f32f6f20d92339cb1f1f20bdeb158d98a05da418 100644 (file)
  *     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 file; 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
        model = "I12 / Q5 / QT840A A20 tvbox";
        compatible = "allwinner,i12-tvbox", "allwinner,sun7i-a20";
 
-       soc@01c00000 {
-               mmc0: mmc@01c0f000 {
-                       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: mmc@01c12000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&mmc3_pins_a>;
-                       vmmc-supply = <&reg_vmmc3>;
-                       bus-width = <4>;
-                       non-removable;
-                       status = "okay";
-               };
-
-               usbphy: phy@01c13400 {
-                       usb1_vbus-supply = <&reg_usb1_vbus>;
-                       usb2_vbus-supply = <&reg_usb2_vbus>;
-                       status = "okay";
-               };
-
-               ehci0: usb@01c14000 {
-                       status = "okay";
-               };
-
-               ohci0: usb@01c14400 {
-                       status = "okay";
-               };
-
-               ehci1: usb@01c1c000 {
-                       status = "okay";
-               };
-
-               ohci1: usb@01c1c400 {
-                       status = "okay";
-               };
-
-               pinctrl@01c20800 {
-                       mmc3_pins_a: mmc3@0 {
-                               /* AP6210 / AP6330 requires pull-up */
-                               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
-                       };
-
-                       vmmc3_pin_i12_tvbox: vmmc3_pin@0 {
-                               allwinner,pins = "PH2";
-                               allwinner,function = "gpio_out";
-                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-                       };
-
-                       vmmc3_io_pin_i12_tvbox: vmmc3_io_pin@0 {
-                               allwinner,pins = "PH12";
-                               allwinner,function = "gpio_out";
-                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-                       };
-
-                       gmac_power_pin_i12_tvbox: gmac_power_pin@0 {
-                               allwinner,pins = "PH21";
-                               allwinner,function = "gpio_out";
-                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-                       };
-
-                       led_pins_i12_tvbox: led_pins@0 {
-                               allwinner,pins = "PH9", "PH20";
-                               allwinner,function = "gpio_out";
-                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-                       };
-               };
-
-               ir0: ir@01c21800 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&ir0_pins_a>;
-                       status = "okay";
-               };
-
-               uart0: serial@01c28000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&uart0_pins_a>;
-                       status = "okay";
-               };
-
-               i2c0: i2c@01c2ac00 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&i2c0_pins_a>;
-                       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>;
-                       };
-               };
+       aliases {
+               serial0 = &uart0;
+       };
 
-               gmac: ethernet@01c50000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&gmac_pins_mii_a>;
-                       phy = <&phy1>;
-                       phy-mode = "mii";
-                       phy-supply = <&reg_gmac_3v3>;
-                       status = "okay";
-
-                       phy1: ethernet-phy@1 {
-                               reg = <1>;
-                       };
-               };
+       chosen {
+               stdout-path = "serial0:115200n8";
        };
 
        leds {
                };
        };
 
-       reg_usb1_vbus: usb1-vbus {
-               status = "okay";
-       };
-
-       reg_usb2_vbus: usb2-vbus {
-               status = "okay";
-       };
-
        reg_vmmc3: vmmc3 {
                compatible = "regulator-fixed";
                pinctrl-names = "default";
                gpio = <&pio 7 21 GPIO_ACTIVE_HIGH>;
        };
 };
+
+&ehci0 {
+       status = "okay";
+};
+
+&ehci1 {
+       status = "okay";
+};
+
+&gmac {
+       pinctrl-names = "default";
+       pinctrl-0 = <&gmac_pins_mii_a>;
+       phy = <&phy1>;
+       phy-mode = "mii";
+       phy-supply = <&reg_gmac_3v3>;
+       status = "okay";
+
+       phy1: ethernet-phy@1 {
+               reg = <1>;
+       };
+};
+
+&i2c0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c0_pins_a>;
+       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>;
+       };
+};
+
+&ir0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&ir0_rx_pins_a>;
+       status = "okay";
+};
+
+&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_vmmc3>;
+       bus-width = <4>;
+       non-removable;
+       status = "okay";
+
+       brcmf: bcrmf@1 {
+               reg = <1>;
+               compatible = "brcm,bcm4329-fmac";
+               interrupt-parent = <&pio>;
+               interrupts = <10 IRQ_TYPE_LEVEL_LOW>; /* PH10 / EINT10 */
+               interrupt-names = "host-wake";
+       };
+};
+
+&mmc3_pins_a {
+       /* AP6210 / AP6330 requires pull-up */
+       allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+};
+
+&ohci0 {
+       status = "okay";
+};
+
+&ohci1 {
+       status = "okay";
+};
+
+&pio {
+       vmmc3_pin_i12_tvbox: vmmc3_pin@0 {
+               allwinner,pins = "PH2";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+       };
+
+       vmmc3_io_pin_i12_tvbox: vmmc3_io_pin@0 {
+               allwinner,pins = "PH12";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+       };
+
+       gmac_power_pin_i12_tvbox: gmac_power_pin@0 {
+               allwinner,pins = "PH21";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+       };
+
+       led_pins_i12_tvbox: led_pins@0 {
+               allwinner,pins = "PH9", "PH20";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+       };
+};
+
+&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 5add9f243ec392a03340b2ea4fbc4539904a2174..8d9ea48dd98c43edaa8e8666f8ecaf277b1bfcb2 100644 (file)
  *     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 file; 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
        model = "Mele M3";
        compatible = "mele,m3", "allwinner,sun7i-a20";
 
-       soc@01c00000 {
-               mmc0: mmc@01c0f000 {
-                       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";
-               };
+       aliases {
+               serial0 = &uart0;
+       };
 
-               mmc2: mmc@01c11000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&mmc2_pins_a>;
-                       vmmc-supply = <&reg_vcc3v3>;
-                       bus-width = <4>;
-                       non-removable;
-                       status = "okay";
-               };
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
 
-               usbphy: phy@01c13400 {
-                       usb1_vbus-supply = <&reg_usb1_vbus>;
-                       usb2_vbus-supply = <&reg_usb2_vbus>;
-                       status = "okay";
-               };
+       leds {
+               compatible = "gpio-leds";
+               pinctrl-names = "default";
+               pinctrl-0 = <&led_pins_m3>;
 
-               ehci0: usb@01c14000 {
-                       status = "okay";
+               blue {
+                       label = "m3:blue:usr";
+                       gpios = <&pio 7 20 GPIO_ACTIVE_HIGH>;
                };
+       };
+};
 
-               ohci0: usb@01c14400 {
-                       status = "okay";
-               };
+&ehci0 {
+       status = "okay";
+};
 
-               ehci1: usb@01c1c000 {
-                       status = "okay";
-               };
+&ehci1 {
+       status = "okay";
+};
 
-               ohci1: usb@01c1c400 {
-                       status = "okay";
-               };
+&gmac {
+       pinctrl-names = "default";
+       pinctrl-0 = <&gmac_pins_mii_a>;
+       phy = <&phy1>;
+       phy-mode = "mii";
+       status = "okay";
 
-               pinctrl@01c20800 {
-                       led_pins_m3: led_pins@0 {
-                               allwinner,pins = "PH20";
-                               allwinner,function = "gpio_out";
-                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-                       };
-               };
+       phy1: ethernet-phy@1 {
+               reg = <1>;
+       };
+};
 
-               ir0: ir@01c21800 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&ir0_pins_a>;
-                       status = "okay";
-               };
+&i2c0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c0_pins_a>;
+       status = "okay";
 
-               uart0: serial@01c28000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&uart0_pins_a>;
-                       status = "okay";
-               };
+       axp209: pmic@34 {
+               compatible = "x-powers,axp209";
+               reg = <0x34>;
+               interrupt-parent = <&nmi_intc>;
+               interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
 
-               i2c0: i2c@01c2ac00 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&i2c0_pins_a>;
-                       status = "okay";
+               interrupt-controller;
+               #interrupt-cells = <1>;
+       };
+};
 
-                       axp209: pmic@34 {
-                               compatible = "x-powers,axp209";
-                               reg = <0x34>;
-                               interrupt-parent = <&nmi_intc>;
-                               interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
+&ir0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&ir0_rx_pins_a>;
+       status = "okay";
+};
 
-                               interrupt-controller;
-                               #interrupt-cells = <1>;
-                       };
-               };
+&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";
+};
 
-               gmac: ethernet@01c50000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&gmac_pins_mii_a>;
-                       phy = <&phy1>;
-                       phy-mode = "mii";
-                       status = "okay";
+&mmc2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&mmc2_pins_a>;
+       vmmc-supply = <&reg_vcc3v3>;
+       bus-width = <4>;
+       non-removable;
+       status = "okay";
+};
 
-                       phy1: ethernet-phy@1 {
-                               reg = <1>;
-                       };
-               };
-       };
+&ohci0 {
+       status = "okay";
+};
 
-       leds {
-               compatible = "gpio-leds";
-               pinctrl-names = "default";
-               pinctrl-0 = <&led_pins_m3>;
+&ohci1 {
+       status = "okay";
+};
 
-               blue {
-                       label = "m3:blue:usr";
-                       gpios = <&pio 7 20 GPIO_ACTIVE_HIGH>;
-               };
+&pio {
+       led_pins_m3: led_pins@0 {
+               allwinner,pins = "PH20";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
        };
+};
 
-       reg_usb1_vbus: usb1-vbus {
-               status = "okay";
-       };
+&reg_usb1_vbus {
+       status = "okay";
+};
 
-       reg_usb2_vbus: usb2-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";
 };
diff --git a/arch/arm/boot/dts/sun7i-a20-mk808c.dts b/arch/arm/boot/dts/sun7i-a20-mk808c.dts
new file mode 100644 (file)
index 0000000..4f432f8
--- /dev/null
@@ -0,0 +1,148 @@
+/*
+ * Copyright 2015 Marcus Cooper
+ *
+ * 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.
+ *
+ *     You should have received a copy of the GNU General Public
+ *     License along with this file; 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 "sun7i-a20.dtsi"
+#include "sunxi-common-regulators.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+
+/ {
+       model = "mk808c";
+       compatible = "allwinner,mk808c", "allwinner,sun7i-a20";
+
+       aliases {
+               serial0 = &uart0;
+               serial1 = &uart2;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+};
+
+&ehci0 {
+       status = "okay";
+};
+
+&ehci1 {
+       status = "okay";
+};
+
+&i2c0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c0_pins_a>;
+       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>;
+       };
+};
+
+&i2c1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c1_pins_a>;
+       status = "okay";
+};
+
+&i2c2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c2_pins_a>;
+       status = "okay";
+};
+
+&mmc0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>;
+       vmmc-supply = <&reg_vcc3v0>;
+       bus-width = <4>;
+       cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */
+       cd-inverted;
+       status = "okay";
+};
+
+&ohci0 {
+       status = "okay";
+};
+
+&ohci1 {
+       status = "okay";
+};
+
+&reg_usb1_vbus {
+       status = "okay";
+};
+
+&reg_usb2_vbus {
+       status = "okay";
+};
+
+&uart0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart0_pins_a>;
+       status = "okay";
+};
+
+&uart2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart2_pins_a>;
+       status = "okay";
+};
+
+&usbphy {
+       usb1_vbus-supply = <&reg_usb1_vbus>;
+       usb2_vbus-supply = <&reg_usb2_vbus>;
+       status = "okay";
+};
index 12ded69d61ebc3cc9d8343450cc8f8d8c580244f..769726dfb04622247aa3dd4a23531d2a1a42e445 100644 (file)
  *     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 file; 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
        model = "Olimex A20-OLinuXino-LIME";
        compatible = "olimex,a20-olinuxino-lime", "allwinner,sun7i-a20";
 
-       soc@01c00000 {
-               mmc0: mmc@01c0f000 {
-                       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";
-               };
+       aliases {
+               serial0 = &uart0;
+       };
 
-               usbphy: phy@01c13400 {
-                       usb1_vbus-supply = <&reg_usb1_vbus>;
-                       usb2_vbus-supply = <&reg_usb2_vbus>;
-                       status = "okay";
-               };
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
 
-               ehci0: usb@01c14000 {
-                       status = "okay";
-               };
+       leds {
+               compatible = "gpio-leds";
+               pinctrl-names = "default";
+               pinctrl-0 = <&led_pins_olinuxinolime>;
 
-               ohci0: usb@01c14400 {
-                       status = "okay";
+               green {
+                       label = "a20-olinuxino-lime:green:usr";
+                       gpios = <&pio 7 2 GPIO_ACTIVE_HIGH>;
+                       default-state = "on";
                };
+       };
+};
 
-               ahci: sata@01c18000 {
-                       target-supply = <&reg_ahci_5v>;
-                       status = "okay";
-               };
+&ahci {
+       target-supply = <&reg_ahci_5v>;
+       status = "okay";
+};
 
-               ehci1: usb@01c1c000 {
-                       status = "okay";
-               };
+&ehci0 {
+       status = "okay";
+};
 
-               ohci1: usb@01c1c400 {
-                       status = "okay";
-               };
+&ehci1 {
+       status = "okay";
+};
 
-               pinctrl@01c20800 {
-                       ahci_pwr_pin_olinuxinolime: 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_olinuxinolime: led_pins@0 {
-                               allwinner,pins = "PH2";
-                               allwinner,function = "gpio_out";
-                               allwinner,drive = <SUN4I_PINCTRL_20_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-                       };
-               };
+&gmac {
+       pinctrl-names = "default";
+       pinctrl-0 = <&gmac_pins_mii_a>;
+       phy = <&phy1>;
+       phy-mode = "mii";
+       status = "okay";
 
-               uart0: serial@01c28000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&uart0_pins_a>;
-                       status = "okay";
-               };
+       phy1: ethernet-phy@1 {
+               reg = <1>;
+       };
+};
 
-               i2c0: i2c@01c2ac00 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&i2c0_pins_a>;
-                       status = "okay";
+&i2c0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c0_pins_a>;
+       status = "okay";
 
-                       axp209: pmic@34 {
-                               compatible = "x-powers,axp209";
-                               reg = <0x34>;
-                               interrupt-parent = <&nmi_intc>;
-                               interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
+       axp209: pmic@34 {
+               compatible = "x-powers,axp209";
+               reg = <0x34>;
+               interrupt-parent = <&nmi_intc>;
+               interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
 
-                               interrupt-controller;
-                               #interrupt-cells = <1>;
-                       };
-               };
+               interrupt-controller;
+               #interrupt-cells = <1>;
+       };
+};
 
-               gmac: ethernet@01c50000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&gmac_pins_mii_a>;
-                       phy = <&phy1>;
-                       phy-mode = "mii";
-                       status = "okay";
+&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";
+};
 
-                       phy1: ethernet-phy@1 {
-                               reg = <1>;
-                       };
-               };
-       };
+&ohci0 {
+       status = "okay";
+};
 
-       leds {
-               compatible = "gpio-leds";
-               pinctrl-names = "default";
-               pinctrl-0 = <&led_pins_olinuxinolime>;
+&ohci1 {
+       status = "okay";
+};
 
-               green {
-                       label = "a20-olinuxino-lime:green:usr";
-                       gpios = <&pio 7 2 GPIO_ACTIVE_HIGH>;
-                       default-state = "on";
-               };
+&pio {
+       ahci_pwr_pin_olinuxinolime: ahci_pwr_pin@1 {
+               allwinner,pins = "PC3";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
        };
 
-       reg_ahci_5v: ahci-5v {
-               pinctrl-0 = <&ahci_pwr_pin_olinuxinolime>;
-               gpio = <&pio 2 3 GPIO_ACTIVE_HIGH>;
-               status = "okay";
+       led_pins_olinuxinolime: led_pins@0 {
+               allwinner,pins = "PH2";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_20_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
        };
+};
 
-       reg_usb1_vbus: usb1-vbus {
-               status = "okay";
-       };
+&reg_ahci_5v {
+       pinctrl-0 = <&ahci_pwr_pin_olinuxinolime>;
+       gpio = <&pio 2 3 GPIO_ACTIVE_HIGH>;
+       status = "okay";
+};
 
-       reg_usb2_vbus: usb2-vbus {
-               status = "okay";
-       };
+&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 260dbd3bf29d5fc71aa4b4a35eb73bda634f748e..8acff78272b7fe571f38758ef4d335a9ff32c28e 100644 (file)
  *     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 file; 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
        model = "Olimex A20-OLinuXino-LIME2";
        compatible = "olimex,a20-olinuxino-lime2", "allwinner,sun7i-a20";
 
-       soc@01c00000 {
-               mmc0: mmc@01c0f000 {
-                       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";
-               };
+       aliases {
+               serial0 = &uart0;
+       };
 
-               usbphy: phy@01c13400 {
-                       usb1_vbus-supply = <&reg_usb1_vbus>;
-                       usb2_vbus-supply = <&reg_usb2_vbus>;
-                       status = "okay";
-               };
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
 
-               ehci0: usb@01c14000 {
-                       status = "okay";
-               };
+       leds {
+               compatible = "gpio-leds";
+               pinctrl-names = "default";
+               pinctrl-0 = <&led_pins_olinuxinolime>;
 
-               ohci0: usb@01c14400 {
-                       status = "okay";
+               green {
+                       label = "a20-olinuxino-lime2:green:usr";
+                       gpios = <&pio 7 2 GPIO_ACTIVE_HIGH>;
+                       default-state = "on";
                };
+       };
 
-               ahci: sata@01c18000 {
-                       target-supply = <&reg_ahci_5v>;
-                       status = "okay";
-               };
+       reg_axp_ipsout: axp_ipsout {
+               compatible = "regulator-fixed";
+               regulator-name = "axp-ipsout";
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;
+               regulator-always-on;
+       };
+};
 
-               ehci1: usb@01c1c000 {
-                       status = "okay";
-               };
+&ahci {
+       target-supply = <&reg_ahci_5v>;
+       status = "okay";
+};
 
-               ohci1: usb@01c1c400 {
-                       status = "okay";
-               };
+&ehci0 {
+       status = "okay";
+};
 
-               pinctrl@01c20800 {
-                       ahci_pwr_pin_olinuxinolime: ahci_pwr_pin@1 {
-                               allwinner,pins = "PC3";
-                               allwinner,function = "gpio_out";
-                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-                       };
+&ehci1 {
+       status = "okay";
+};
+
+&gmac {
+       pinctrl-names = "default";
+       pinctrl-0 = <&gmac_pins_rgmii_a>;
+       phy = <&phy1>;
+       phy-mode = "rgmii";
+       status = "okay";
 
-                       led_pins_olinuxinolime: led_pins@0 {
-                               allwinner,pins = "PH2";
-                               allwinner,function = "gpio_out";
-                               allwinner,drive = <SUN4I_PINCTRL_20_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+       phy1: ethernet-phy@1 {
+               reg = <1>;
+       };
+};
+
+&i2c0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c0_pins_a>;
+       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>;
+
+               acin-supply = <&reg_axp_ipsout>;
+               vin2-supply = <&reg_axp_ipsout>;
+               vin3-supply = <&reg_axp_ipsout>;
+               ldo24in-supply = <&reg_axp_ipsout>;
+               ldo3in-supply = <&reg_axp_ipsout>;
+
+               regulators {
+                       vdd_rtc: ldo1 {
+                               regulator-min-microvolt = <1300000>;
+                               regulator-max-microvolt = <1300000>;
+                               regulator-always-on;
                        };
-               };
 
-               uart0: serial@01c28000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&uart0_pins_a>;
-                       status = "okay";
-               };
+                       avcc: ldo2 {
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <3300000>;
+                               regulator-always-on;
+                       };
 
-               i2c0: i2c@01c2ac00 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&i2c0_pins_a>;
-                       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>;
-
-                               acin-supply = <&reg_axp_ipsout>;
-                               vin2-supply = <&reg_axp_ipsout>;
-                               vin3-supply = <&reg_axp_ipsout>;
-                               ldo24in-supply = <&reg_axp_ipsout>;
-                               ldo3in-supply = <&reg_axp_ipsout>;
-
-                               regulators {
-                                       vdd_rtc: ldo1 {
-                                               regulator-min-microvolt = <1300000>;
-                                               regulator-max-microvolt = <1300000>;
-                                               regulator-always-on;
-                                       };
-
-                                       avcc: ldo2 {
-                                               regulator-min-microvolt = <1800000>;
-                                               regulator-max-microvolt = <3300000>;
-                                               regulator-always-on;
-                                       };
-
-                                       vcc_csi0: ldo3 {
-                                               regulator-min-microvolt = <700000>;
-                                               regulator-max-microvolt = <3500000>;
-                                               regulator-always-on;
-                                       };
-
-                                       vcc_csi1: ldo4 {
-                                               regulator-min-microvolt = <1250000>;
-                                               regulator-max-microvolt = <3300000>;
-                                               regulator-always-on;
-                                       };
-
-                                       vdd_cpu: dcdc2 {
-                                               regulator-min-microvolt = <700000>;
-                                               regulator-max-microvolt = <2275000>;
-                                               regulator-always-on;
-                                       };
-
-                                       vdd_int: dcdc3 {
-                                               regulator-min-microvolt = <700000>;
-                                               regulator-max-microvolt = <3500000>;
-                                               regulator-always-on;
-                                       };
-                               };
+                       vcc_csi0: ldo3 {
+                               regulator-min-microvolt = <700000>;
+                               regulator-max-microvolt = <3500000>;
+                               regulator-always-on;
                        };
-               };
 
-               i2c1: i2c@01c2b000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&i2c1_pins_a>;
-                       status = "okay";
-               };
+                       vcc_csi1: ldo4 {
+                               regulator-min-microvolt = <1250000>;
+                               regulator-max-microvolt = <3300000>;
+                               regulator-always-on;
+                       };
 
-               gmac: ethernet@01c50000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&gmac_pins_rgmii_a>;
-                       phy = <&phy1>;
-                       phy-mode = "rgmii";
-                       status = "okay";
+                       vdd_cpu: dcdc2 {
+                               regulator-min-microvolt = <700000>;
+                               regulator-max-microvolt = <2275000>;
+                               regulator-always-on;
+                       };
 
-                       phy1: ethernet-phy@1 {
-                               reg = <1>;
+                       vdd_int: dcdc3 {
+                               regulator-min-microvolt = <700000>;
+                               regulator-max-microvolt = <3500000>;
+                               regulator-always-on;
                        };
                };
        };
+};
 
-       leds {
-               compatible = "gpio-leds";
-               pinctrl-names = "default";
-               pinctrl-0 = <&led_pins_olinuxinolime>;
+&i2c1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c1_pins_a>;
+       status = "okay";
+};
 
-               green {
-                       label = "a20-olinuxino-lime2:green:usr";
-                       gpios = <&pio 7 2 GPIO_ACTIVE_HIGH>;
-                       default-state = "on";
-               };
-       };
+&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";
+};
 
-       reg_ahci_5v: ahci-5v {
-               pinctrl-0 = <&ahci_pwr_pin_olinuxinolime>;
-               gpio = <&pio 2 3 GPIO_ACTIVE_HIGH>;
-               status = "okay";
-       };
+&ohci0 {
+       status = "okay";
+};
 
-       reg_usb1_vbus: usb1-vbus {
-               status = "okay";
-       };
+&ohci1 {
+       status = "okay";
+};
 
-       reg_usb2_vbus: usb2-vbus {
-               status = "okay";
+&pio {
+       ahci_pwr_pin_olinuxinolime: ahci_pwr_pin@1 {
+               allwinner,pins = "PC3";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
        };
 
-       reg_axp_ipsout: axp_ipsout {
-               compatible = "regulator-fixed";
-               regulator-name = "axp-ipsout";
-               regulator-min-microvolt = <5000000>;
-               regulator-max-microvolt = <5000000>;
-               regulator-always-on;
+       led_pins_olinuxinolime: 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_olinuxinolime>;
+       gpio = <&pio 2 3 GPIO_ACTIVE_HIGH>;
+       status = "okay";
+};
+
+&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 714e15ac5416b71f2b56b60646092eeb24d3d0d2..00f8f25eccae57f7a5d64f138d71a9dc8dc8af65 100644 (file)
@@ -3,12 +3,43 @@
  *
  * Maxime Ripard <maxime.ripard@free-electrons.com>
  *
- * 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 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/;
                spi1 = &spi2;
        };
 
-       soc@01c00000 {
-               spi1: spi@01c06000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&spi1_pins_a>;
-                       status = "okay";
-               };
-
-               mmc0: mmc@01c0f000 {
-                       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";
-               };
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
 
-               mmc3: mmc@01c12000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&mmc3_pins_a>, <&mmc3_cd_pin_olinuxinom>;
-                       vmmc-supply = <&reg_vcc3v3>;
-                       bus-width = <4>;
-                       cd-gpios = <&pio 7 11 GPIO_ACTIVE_HIGH>; /* PH11 */
-                       cd-inverted;
-                       status = "okay";
-               };
+       leds {
+               compatible = "gpio-leds";
+               pinctrl-names = "default";
+               pinctrl-0 = <&led_pins_olinuxino>;
 
-               usbphy: phy@01c13400 {
-                       usb1_vbus-supply = <&reg_usb1_vbus>;
-                       usb2_vbus-supply = <&reg_usb2_vbus>;
-                       status = "okay";
+               green {
+                       label = "a20-olinuxino-micro:green:usr";
+                       gpios = <&pio 7 2 GPIO_ACTIVE_HIGH>;
+                       default-state = "on";
                };
+       };
+};
 
-               ehci0: usb@01c14000 {
-                       status = "okay";
-               };
+&ahci {
+       target-supply = <&reg_ahci_5v>;
+       status = "okay";
+};
 
-               ohci0: usb@01c14400 {
-                       status = "okay";
-               };
+&ehci0 {
+       status = "okay";
+};
 
-               spi2: spi@01c17000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&spi2_pins_a>;
-                       status = "okay";
-               };
+&ehci1 {
+       status = "okay";
+};
 
-               ahci: sata@01c18000 {
-                       target-supply = <&reg_ahci_5v>;
-                       status = "okay";
-               };
+&gmac {
+       pinctrl-names = "default";
+       pinctrl-0 = <&gmac_pins_mii_a>;
+       phy = <&phy1>;
+       phy-mode = "mii";
+       status = "okay";
 
-               ehci1: usb@01c1c000 {
-                       status = "okay";
-               };
+       phy1: ethernet-phy@1 {
+               reg = <1>;
+       };
+};
 
-               ohci1: usb@01c1c400 {
-                       status = "okay";
-               };
+&i2c0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c0_pins_a>;
+       status = "okay";
 
-               pinctrl@01c20800 {
-                       mmc3_cd_pin_olinuxinom: mmc3_cd_pin@0 {
-                               allwinner,pins = "PH11";
-                               allwinner,function = "gpio_in";
-                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
-                       };
-
-                       led_pins_olinuxino: led_pins@0 {
-                               allwinner,pins = "PH2";
-                               allwinner,function = "gpio_out";
-                               allwinner,drive = <SUN4I_PINCTRL_20_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-                       };
-               };
+       axp209: pmic@34 {
+               compatible = "x-powers,axp209";
+               reg = <0x34>;
+               interrupt-parent = <&nmi_intc>;
+               interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
 
-               lradc: lradc@01c22800 {
-                       vref-supply = <&reg_vcc3v0>;
-                       status = "okay";
-
-                       button@191 {
-                               label = "Volume Up";
-                               linux,code = <KEY_VOLUMEUP>;
-                               channel = <0>;
-                               voltage = <191274>;
-                       };
-
-                       button@392 {
-                               label = "Volume Down";
-                               linux,code = <KEY_VOLUMEDOWN>;
-                               channel = <0>;
-                               voltage = <392644>;
-                       };
-
-                       button@601 {
-                               label = "Menu";
-                               linux,code = <KEY_MENU>;
-                               channel = <0>;
-                               voltage = <601151>;
-                       };
-
-                       button@795 {
-                               label = "Search";
-                               linux,code = <KEY_SEARCH>;
-                               channel = <0>;
-                               voltage = <795090>;
-                       };
-
-                       button@987 {
-                               label = "Home";
-                               linux,code = <KEY_HOMEPAGE>;
-                               channel = <0>;
-                               voltage = <987387>;
-                       };
-
-                       button@1184 {
-                               label = "Esc";
-                               linux,code = <KEY_ESC>;
-                               channel = <0>;
-                               voltage = <1184678>;
-                       };
-
-                       button@1398 {
-                               label = "Enter";
-                               linux,code = <KEY_ENTER>;
-                               channel = <0>;
-                               voltage = <1398804>;
-                       };
-               };
+               interrupt-controller;
+               #interrupt-cells = <1>;
+       };
+};
 
-               uart0: serial@01c28000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&uart0_pins_a>;
-                       status = "okay";
-               };
+&i2c1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c1_pins_a>;
+       status = "okay";
+};
 
-               uart6: serial@01c29800 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&uart6_pins_a>;
-                       status = "okay";
-               };
+&i2c2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c2_pins_a>;
+       status = "okay";
+};
 
-               uart7: serial@01c29c00 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&uart7_pins_a>;
-                       status = "okay";
-               };
+&lradc {
+       vref-supply = <&reg_vcc3v0>;
+       status = "okay";
 
-               i2c0: i2c@01c2ac00 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&i2c0_pins_a>;
-                       status = "okay";
+       button@191 {
+               label = "Volume Up";
+               linux,code = <KEY_VOLUMEUP>;
+               channel = <0>;
+               voltage = <191274>;
+       };
 
-                       axp209: pmic@34 {
-                               compatible = "x-powers,axp209";
-                               reg = <0x34>;
-                               interrupt-parent = <&nmi_intc>;
-                               interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
+       button@392 {
+               label = "Volume Down";
+               linux,code = <KEY_VOLUMEDOWN>;
+               channel = <0>;
+               voltage = <392644>;
+       };
 
-                               interrupt-controller;
-                               #interrupt-cells = <1>;
-                       };
-               };
+       button@601 {
+               label = "Menu";
+               linux,code = <KEY_MENU>;
+               channel = <0>;
+               voltage = <601151>;
+       };
 
-               i2c1: i2c@01c2b000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&i2c1_pins_a>;
-                       status = "okay";
-               };
+       button@795 {
+               label = "Search";
+               linux,code = <KEY_SEARCH>;
+               channel = <0>;
+               voltage = <795090>;
+       };
 
-               i2c2: i2c@01c2b400 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&i2c2_pins_a>;
-                       status = "okay";
-               };
+       button@987 {
+               label = "Home";
+               linux,code = <KEY_HOMEPAGE>;
+               channel = <0>;
+               voltage = <987387>;
+       };
 
-               gmac: ethernet@01c50000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&gmac_pins_mii_a>;
-                       phy = <&phy1>;
-                       phy-mode = "mii";
-                       status = "okay";
+       button@1184 {
+               label = "Esc";
+               linux,code = <KEY_ESC>;
+               channel = <0>;
+               voltage = <1184678>;
+       };
 
-                       phy1: ethernet-phy@1 {
-                               reg = <1>;
-                       };
-               };
+       button@1398 {
+               label = "Enter";
+               linux,code = <KEY_ENTER>;
+               channel = <0>;
+               voltage = <1398804>;
        };
+};
 
-       leds {
-               compatible = "gpio-leds";
-               pinctrl-names = "default";
-               pinctrl-0 = <&led_pins_olinuxino>;
+&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";
+};
 
-               green {
-                       label = "a20-olinuxino-micro:green:usr";
-                       gpios = <&pio 7 2 GPIO_ACTIVE_HIGH>;
-                       default-state = "on";
-               };
-       };
+&mmc3 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&mmc3_pins_a>, <&mmc3_cd_pin_olinuxinom>;
+       vmmc-supply = <&reg_vcc3v3>;
+       bus-width = <4>;
+       cd-gpios = <&pio 7 11 GPIO_ACTIVE_HIGH>; /* PH11 */
+       cd-inverted;
+       status = "okay";
+};
 
-       reg_ahci_5v: ahci-5v {
-               status = "okay";
-       };
+&ohci0 {
+       status = "okay";
+};
+
+&ohci1 {
+       status = "okay";
+};
 
-       reg_usb1_vbus: usb1-vbus {
-               status = "okay";
+&pio {
+       mmc3_cd_pin_olinuxinom: mmc3_cd_pin@0 {
+               allwinner,pins = "PH11";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
        };
 
-       reg_usb2_vbus: usb2-vbus {
-               status = "okay";
+       led_pins_olinuxino: 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 {
+       status = "okay";
+};
+
+&reg_usb1_vbus {
+       status = "okay";
+};
+
+&reg_usb2_vbus {
+       status = "okay";
+};
+
+&spi1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&spi1_pins_a>,
+                   <&spi1_cs0_pins_a>;
+       status = "okay";
+};
+
+&spi2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&spi2_pins_a>,
+                   <&spi2_cs0_pins_a>;
+       status = "okay";
+};
+
+&uart0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart0_pins_a>;
+       status = "okay";
+};
+
+&uart6 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart6_pins_a>;
+       status = "okay";
+};
+
+&uart7 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart7_pins_a>;
+       status = "okay";
+};
+
+&usbphy {
+       usb1_vbus-supply = <&reg_usb1_vbus>;
+       usb2_vbus-supply = <&reg_usb2_vbus>;
+       status = "okay";
+};
diff --git a/arch/arm/boot/dts/sun7i-a20-orangepi-mini.dts b/arch/arm/boot/dts/sun7i-a20-orangepi-mini.dts
new file mode 100644 (file)
index 0000000..73cd81e
--- /dev/null
@@ -0,0 +1,250 @@
+/*
+ * Copyright 2015 Hans de Goede <hdegoede@redhat.com>
+ *
+ * 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 "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 = "Orange Pi Mini";
+       compatible = "xunlong,orangepi-mini", "allwinner,sun7i-a20";
+
+       aliases {
+               serial0 = &uart0;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       leds {
+               compatible = "gpio-leds";
+               pinctrl-names = "default";
+               pinctrl-0 = <&led_pins_orangepi>;
+
+               green {
+                       label = "orangepi:green:usr";
+                       gpios = <&pio 7 24 GPIO_ACTIVE_HIGH>; /* PH24 */
+               };
+
+               blue {
+                       label = "orangepi:blue:usr";
+                       gpios = <&pio 7 25 GPIO_ACTIVE_HIGH>; /* PH25 */
+               };
+       };
+
+       reg_gmac_3v3: gmac-3v3 {
+               compatible = "regulator-fixed";
+               pinctrl-names = "default";
+               pinctrl-0 = <&gmac_power_pin_orangepi>;
+               regulator-name = "gmac-3v3";
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+               startup-delay-us = <100000>;
+               enable-active-high;
+               gpio = <&pio 7 23 GPIO_ACTIVE_HIGH>; /* PH23 */
+       };
+};
+
+&ahci {
+       status = "okay";
+};
+
+&ehci0 {
+       status = "okay";
+};
+
+&ehci1 {
+       status = "okay";
+};
+
+&gmac {
+       pinctrl-names = "default";
+       pinctrl-0 = <&gmac_pins_rgmii_a>;
+       phy = <&phy1>;
+       phy-mode = "rgmii";
+       phy-supply = <&reg_gmac_3v3>;
+       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>;
+       };
+};
+
+#include "axp209.dtsi"
+
+&ir0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&ir0_rx_pins_a>;
+       status = "okay";
+};
+
+&mmc0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_orangepi>;
+       vmmc-supply = <&reg_vcc3v3>;
+       bus-width = <4>;
+       cd-gpios = <&pio 7 10 GPIO_ACTIVE_HIGH>; /* PH10 */
+       cd-inverted;
+       status = "okay";
+};
+
+&mmc3 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&mmc3_pins_a>, <&mmc3_cd_pin_orangepi>;
+       vmmc-supply = <&reg_vcc3v3>;
+       bus-width = <4>;
+       cd-gpios = <&pio 7 11 GPIO_ACTIVE_HIGH>; /* PH11 */
+       cd-inverted;
+       status = "okay";
+};
+
+&pio {
+       mmc0_cd_pin_orangepi: mmc0_cd_pin@0 {
+               allwinner,pins = "PH10";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+       };
+
+       mmc3_cd_pin_orangepi: mmc3_cd_pin@0 {
+               allwinner,pins = "PH11";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+       };
+
+       usb2_vbus_pin_bananapro: usb2_vbus_pin@0 {
+               allwinner,pins = "PH22";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+       };
+
+       gmac_power_pin_orangepi: gmac_power_pin@0 {
+               allwinner,pins = "PH23";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+       };
+
+       led_pins_orangepi: led_pins@0 {
+               allwinner,pins = "PH24", "PH25";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+       };
+
+       usb1_vbus_pin_bananapro: usb1_vbus_pin@0 {
+               allwinner,pins = "PH26";
+               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_usb1_vbus {
+       pinctrl-0 = <&usb1_vbus_pin_bananapro>;
+       gpio = <&pio 7 26 GPIO_ACTIVE_HIGH>; /* PH26 */
+       status = "okay";
+};
+
+&reg_usb2_vbus {
+       pinctrl-0 = <&usb2_vbus_pin_bananapro>;
+       gpio = <&pio 7 22 GPIO_ACTIVE_HIGH>; /* PH22 */
+       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";
+};
diff --git a/arch/arm/boot/dts/sun7i-a20-orangepi.dts b/arch/arm/boot/dts/sun7i-a20-orangepi.dts
new file mode 100644 (file)
index 0000000..55a06ce
--- /dev/null
@@ -0,0 +1,228 @@
+/*
+ * Copyright 2015 Hans de Goede <hdegoede@redhat.com>
+ *
+ * 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 "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 = "Orange Pi";
+       compatible = "xunlong,orangepi", "allwinner,sun7i-a20";
+
+       aliases {
+               serial0 = &uart0;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       leds {
+               compatible = "gpio-leds";
+               pinctrl-names = "default";
+               pinctrl-0 = <&led_pins_orangepi>;
+
+               green {
+                       label = "orangepi:green:usr";
+                       gpios = <&pio 7 24 GPIO_ACTIVE_HIGH>; /* PH24 */
+               };
+       };
+
+       reg_gmac_3v3: gmac-3v3 {
+               compatible = "regulator-fixed";
+               pinctrl-names = "default";
+               pinctrl-0 = <&gmac_power_pin_orangepi>;
+               regulator-name = "gmac-3v3";
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+               startup-delay-us = <100000>;
+               enable-active-high;
+               gpio = <&pio 7 23 GPIO_ACTIVE_HIGH>; /* PH23 */
+       };
+};
+
+&ahci {
+       status = "okay";
+};
+
+&ehci0 {
+       status = "okay";
+};
+
+&ehci1 {
+       status = "okay";
+};
+
+&gmac {
+       pinctrl-names = "default";
+       pinctrl-0 = <&gmac_pins_rgmii_a>;
+       phy = <&phy1>;
+       phy-mode = "rgmii";
+       phy-supply = <&reg_gmac_3v3>;
+       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>;
+       };
+};
+
+#include "axp209.dtsi"
+
+&ir0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&ir0_rx_pins_a>;
+       status = "okay";
+};
+
+&mmc0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_orangepi>;
+       vmmc-supply = <&reg_vcc3v3>;
+       bus-width = <4>;
+       cd-gpios = <&pio 7 10 GPIO_ACTIVE_HIGH>; /* PH10 */
+       cd-inverted;
+       status = "okay";
+};
+
+&pio {
+       mmc0_cd_pin_orangepi: mmc0_cd_pin@0 {
+               allwinner,pins = "PH10";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+       };
+
+       usb2_vbus_pin_bananapro: usb2_vbus_pin@0 {
+               allwinner,pins = "PH22";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+       };
+
+       gmac_power_pin_orangepi: gmac_power_pin@0 {
+               allwinner,pins = "PH23";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+       };
+
+       led_pins_orangepi: led_pins@0 {
+               allwinner,pins = "PH24";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+       };
+
+       usb1_vbus_pin_bananapro: usb1_vbus_pin@0 {
+               allwinner,pins = "PH26";
+               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_usb1_vbus {
+       pinctrl-0 = <&usb1_vbus_pin_bananapro>;
+       gpio = <&pio 7 26 GPIO_ACTIVE_HIGH>; /* PH26 */
+       status = "okay";
+};
+
+&reg_usb2_vbus {
+       pinctrl-0 = <&usb2_vbus_pin_bananapro>;
+       gpio = <&pio 7 22 GPIO_ACTIVE_HIGH>; /* PH22 */
+       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";
+};
diff --git a/arch/arm/boot/dts/sun7i-a20-pcduino3-nano.dts b/arch/arm/boot/dts/sun7i-a20-pcduino3-nano.dts
new file mode 100644 (file)
index 0000000..5361fce
--- /dev/null
@@ -0,0 +1,194 @@
+/*
+ * Copyright 2015 Adam Sampson <ats@offog.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 "sun7i-a20.dtsi"
+#include "sunxi-common-regulators.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+
+/ {
+       model = "LinkSprite pcDuino3 Nano";
+       compatible = "linksprite,pcduino3-nano", "allwinner,sun7i-a20";
+
+       aliases {
+               serial0 = &uart0;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       leds {
+               compatible = "gpio-leds";
+               pinctrl-names = "default";
+               pinctrl-0 = <&led_pins_pcduino3_nano>;
+
+               /* Marked "LED3" on the PCB. */
+               usr1 {
+                       label = "pcduino3-nano:green:usr1";
+                       gpios = <&pio 7 16 GPIO_ACTIVE_LOW>; /* PH16 */
+               };
+
+               /* Marked "LED4" on the PCB. */
+               usr2 {
+                       label = "pcduino3-nano:green:usr2";
+                       gpios = <&pio 7 15 GPIO_ACTIVE_LOW>; /* PH15 */
+               };
+       };
+};
+
+&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 {
+               compatible = "x-powers,axp209";
+               reg = <0x34>;
+               interrupt-parent = <&nmi_intc>;
+               interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
+
+               interrupt-controller;
+               #interrupt-cells = <1>;
+       };
+};
+
+&ir0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&ir0_rx_pins_a>;
+       status = "okay";
+};
+
+&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_pcduino3_nano: ahci_pwr_pin@0 {
+               allwinner,pins = "PH2";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+       };
+
+       led_pins_pcduino3_nano: led_pins@0 {
+               allwinner,pins = "PH16", "PH15";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+       };
+
+       usb1_vbus_pin_pcduino3_nano: usb1_vbus_pin@0 {
+               allwinner,pins = "PH11";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+       };
+};
+
+&reg_ahci_5v {
+       pinctrl-0 = <&ahci_pwr_pin_pcduino3_nano>;
+       gpio = <&pio 7 2 GPIO_ACTIVE_HIGH>; /* PH2 */
+       status = "okay";
+};
+
+&reg_usb1_vbus {
+       pinctrl-0 = <&usb1_vbus_pin_pcduino3_nano>;
+       gpio = <&pio 7 11 GPIO_ACTIVE_HIGH>; /* PH11 */
+       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 0a2c2aeb4687ea999b7e0d7849efa0c755a5c7cb..afc9ecebed21a6c4c89b9981d1d71a1eb1b0641f 100644 (file)
  *     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 file; 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
        model = "LinkSprite pcDuino3";
        compatible = "linksprite,pcduino3", "allwinner,sun7i-a20";
 
-       soc@01c00000 {
-               mmc0: mmc@01c0f000 {
-                       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";
-               };
-
-               usbphy: phy@01c13400 {
-                       usb1_vbus-supply = <&reg_usb1_vbus>;
-                       usb2_vbus-supply = <&reg_usb2_vbus>;
-                       status = "okay";
-               };
-
-               ehci0: usb@01c14000 {
-                       status = "okay";
-               };
-
-               ohci0: usb@01c14400 {
-                       status = "okay";
-               };
-
-               ahci: sata@01c18000 {
-                       target-supply = <&reg_ahci_5v>;
-                       status = "okay";
-               };
-
-               ehci1: usb@01c1c000 {
-                       status = "okay";
-               };
-
-               ohci1: usb@01c1c400 {
-                       status = "okay";
-               };
-
-               pinctrl@01c20800 {
-                       ahci_pwr_pin_a: ahci_pwr_pin@0 {
-                               allwinner,pins = "PH2";
-                       };
-
-                       led_pins_pcduino3: led_pins@0 {
-                               allwinner,pins = "PH15", "PH16";
-                               allwinner,function = "gpio_out";
-                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-                       };
-
-                       key_pins_pcduino3: key_pins@0 {
-                               allwinner,pins = "PH17", "PH18", "PH19";
-                               allwinner,function = "gpio_in";
-                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-                       };
-               };
-
-               ir0: ir@01c21800 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&ir0_pins_a>;
-                       status = "okay";
-               };
-
-               uart0: serial@01c28000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&uart0_pins_a>;
-                       status = "okay";
-               };
-
-               i2c0: i2c@01c2ac00 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&i2c0_pins_a>;
-                       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>;
-                       };
-               };
-
-               gmac: ethernet@01c50000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&gmac_pins_mii_a>;
-                       phy = <&phy1>;
-                       phy-mode = "mii";
-                       status = "okay";
+       aliases {
+               serial0 = &uart0;
+       };
 
-                       phy1: ethernet-phy@1 {
-                               reg = <1>;
-                       };
-               };
+       chosen {
+               stdout-path = "serial0:115200n8";
        };
 
        leds {
                        gpios = <&pio 7 19 GPIO_ACTIVE_LOW>;
                };
        };
+};
 
-       reg_usb1_vbus: usb1-vbus {
-               status = "okay";
+&ahci {
+       target-supply = <&reg_ahci_5v>;
+       status = "okay";
+};
+
+&ahci_pwr_pin_a {
+       allwinner,pins = "PH2";
+};
+
+&ehci0 {
+       status = "okay";
+};
+
+&ehci1 {
+       status = "okay";
+};
+
+&gmac {
+       pinctrl-names = "default";
+       pinctrl-0 = <&gmac_pins_mii_a>;
+       phy = <&phy1>;
+       phy-mode = "mii";
+       status = "okay";
+
+       phy1: ethernet-phy@1 {
+               reg = <1>;
        };
+};
+
+&i2c0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c0_pins_a>;
+       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>;
+       };
+};
+
+&ir0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&ir0_rx_pins_a>;
+       status = "okay";
+};
+
+&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";
+};
 
-       reg_usb2_vbus: usb2-vbus {
-               status = "okay";
+&pio {
+       led_pins_pcduino3: led_pins@0 {
+               allwinner,pins = "PH15", "PH16";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
        };
 
-       reg_ahci_5v: ahci-5v {
-               gpio = <&pio 7 2 GPIO_ACTIVE_HIGH>;
-               status = "okay";
+       key_pins_pcduino3: key_pins@0 {
+               allwinner,pins = "PH17", "PH18", "PH19";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
        };
 };
+
+&reg_ahci_5v {
+       gpio = <&pio 7 2 GPIO_ACTIVE_HIGH>;
+       status = "okay";
+};
+
+&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";
+};
diff --git a/arch/arm/boot/dts/sun7i-a20-wexler-tab7200.dts b/arch/arm/boot/dts/sun7i-a20-wexler-tab7200.dts
new file mode 100644 (file)
index 0000000..83c6d3f
--- /dev/null
@@ -0,0 +1,183 @@
+/*
+ * Copyright 2015 Aleksei Mamlin
+ * Aleksei Mamlin <mamlinav@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/input/input.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+
+/ {
+       model = "Wexler TAB7200";
+       compatible = "wexler,tab7200", "allwinner,sun7i-a20";
+
+       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>;
+               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";
+};
+
+&lradc {
+       vref-supply = <&reg_vcc3v0>;
+       status = "okay";
+
+       button@571 {
+               label = "Volume Up";
+               linux,code = <KEY_VOLUMEUP>;
+               channel = <0>;
+               voltage = <571428>;
+       };
+
+       button@761 {
+               label = "Volume Down";
+               linux,code = <KEY_VOLUMEDOWN>;
+               channel = <0>;
+               voltage = <761904>;
+       };
+};
+
+&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";
+};
+
+#include "axp209.dtsi"
+
+&reg_dcdc2 {
+       regulator-always-on;
+       regulator-min-microvolt = <1000000>;
+       regulator-max-microvolt = <1450000>;
+       regulator-name = "vdd-cpu";
+};
+
+&reg_dcdc3 {
+       regulator-always-on;
+       regulator-min-microvolt = <1000000>;
+       regulator-max-microvolt = <1400000>;
+       regulator-name = "vdd-int-dll";
+};
+
+&reg_ldo1 {
+       regulator-name = "vdd-rtc";
+};
+
+&reg_ldo2 {
+       regulator-always-on;
+       regulator-min-microvolt = <3000000>;
+       regulator-max-microvolt = <3000000>;
+       regulator-name = "avcc";
+};
+
+&reg_usb1_vbus {
+       status = "okay";
+};
+
+&reg_usb2_vbus {
+       status = "okay";
+};
+
+&uart0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart0_pins_a>;
+       status = "okay";
+};
+
+&usbphy {
+       usb1_vbus-supply = <&reg_usb1_vbus>;
+       usb2_vbus-supply = <&reg_usb2_vbus>;
+       status = "okay";
+};
index fdd181792b4beeb553ab55e275361d6bd6ecab07..6a63f30c9a699d0e4620aac31f64247ad9c1f95b 100644 (file)
  *     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 file; 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
@@ -68,7 +63,8 @@
                ranges;
 
                framebuffer@0 {
-                       compatible = "allwinner,simple-framebuffer", "simple-framebuffer";
+                       compatible = "allwinner,simple-framebuffer",
+                                    "simple-framebuffer";
                        allwinner,pipeline = "de_be0-lcd0-hdmi";
                        clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 43>,
                                 <&ahb_gates 44>;
                        clocks = <&cpu>;
                        clock-latency = <244144>; /* 8 32k periods */
                        operating-points = <
-                               /* kHz    uV */
-                               960000  1400000
-                               912000  1400000
-                               864000  1300000
-                               720000  1200000
-                               528000  1100000
-                               312000  1000000
-                               144000  900000
+                               /* kHz    uV */
+                               960000  1400000
+                               912000  1400000
+                               864000  1300000
+                               720000  1200000
+                               528000  1100000
+                               312000  1000000
+                               144000  900000
                                >;
                        #cooling-cells = <2>;
                        cooling-min-level = <0>;
                        compatible = "allwinner,sun4i-a10-pll6-clk";
                        reg = <0x01c20028 0x4>;
                        clocks = <&osc24M>;
-                       clock-output-names = "pll6_sata", "pll6_other", "pll6";
+                       clock-output-names = "pll6_sata", "pll6_other", "pll6",
+                                            "pll6_div_4";
                };
 
                pll8: clk@01c20040 {
 
                ahb: ahb@01c20054 {
                        #clock-cells = <0>;
-                       compatible = "allwinner,sun4i-a10-ahb-clk";
+                       compatible = "allwinner,sun5i-a13-ahb-clk";
                        reg = <0x01c20054 0x4>;
-                       clocks = <&axi>;
+                       clocks = <&axi>, <&pll6 3>, <&pll6 1>;
                        clock-output-names = "ahb";
+                       /*
+                        * Use PLL6 as parent, instead of CPU/AXI
+                        * which has rate changes due to cpufreq
+                        */
+                       assigned-clocks = <&ahb>;
+                       assigned-clock-parents = <&pll6 3>;
                };
 
                ahb_gates: clk@01c20060 {
 
                usb_clk: clk@01c200cc {
                        #clock-cells = <1>;
-                       #reset-cells = <1>;
+                       #reset-cells = <1>;
                        compatible = "allwinner,sun4i-a10-usb-clk";
                        reg = <0x01c200cc 0x4>;
                        clocks = <&pll6 1>;
-                       clock-output-names = "usb_ohci0", "usb_ohci1", "usb_phy";
+                       clock-output-names = "usb_ohci0", "usb_ohci1",
+                                            "usb_phy";
                };
 
                spi3_clk: clk@01c200d4 {
                };
 
                /*
-                * The following two are dummy clocks, placeholders used in the gmac_tx
-                * clock. The gmac driver will choose one parent depending on the PHY
-                * interface mode, using clk_set_rate auto-reparenting.
-                * The actual TX clock rate is not controlled by the gmac_tx clock.
+                * The following two are dummy clocks, placeholders
+                * used in the gmac_tx clock. The gmac driver will
+                * choose one parent depending on the PHY interface
+                * mode, using clk_set_rate auto-reparenting.
+                *
+                * The actual TX clock rate is not controlled by the
+                * gmac_tx clock.
                 */
                mii_phy_tx_clk: clk@2 {
                        #clock-cells = <0>;
                #size-cells = <1>;
                ranges;
 
+               sram-controller@01c00000 {
+                       compatible = "allwinner,sun4i-a10-sram-controller";
+                       reg = <0x01c00000 0x30>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges;
+
+                       sram_a: sram@00000000 {
+                               compatible = "mmio-sram";
+                               reg = <0x00000000 0xc000>;
+                               #address-cells = <1>;
+                               #size-cells = <1>;
+                               ranges = <0 0x00000000 0xc000>;
+
+                               emac_sram: sram-section@8000 {
+                                       compatible = "allwinner,sun4i-a10-sram-a3-a4";
+                                       reg = <0x8000 0x4000>;
+                                       status = "disabled";
+                               };
+                       };
+
+                       sram_d: sram@00010000 {
+                               compatible = "mmio-sram";
+                               reg = <0x00010000 0x1000>;
+                               #address-cells = <1>;
+                               #size-cells = <1>;
+                               ranges = <0 0x00010000 0x1000>;
+
+                               otg_sram: sram-section@0000 {
+                                       compatible = "allwinner,sun4i-a10-sram-d";
+                                       reg = <0x0000 0x1000>;
+                                       status = "disabled";
+                               };
+                       };
+               };
+
                nmi_intc: interrupt-controller@01c00030 {
                        compatible = "allwinner,sun7i-a20-sc-nmi";
                        interrupt-controller;
                        reg = <0x01c0b000 0x1000>;
                        interrupts = <GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH>;
                        clocks = <&ahb_gates 17>;
+                       allwinner,sram = <&emac_sram 1>;
                        status = "disabled";
                };
 
                                      "sample";
                        interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
                        status = "disabled";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
                };
 
                mmc1: mmc@01c10000 {
                                      "sample";
                        interrupts = <GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>;
                        status = "disabled";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
                };
 
                mmc2: mmc@01c11000 {
                                      "sample";
                        interrupts = <GIC_SPI 34 IRQ_TYPE_LEVEL_HIGH>;
                        status = "disabled";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
                };
 
                mmc3: mmc@01c12000 {
                                      "sample";
                        interrupts = <GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH>;
                        status = "disabled";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
                };
 
                usbphy: phy@01c13400 {
                                allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
                        };
 
+                       uart4_pins_b: uart4@1 {
+                               allwinner,pins = "PH4", "PH5";
+                               allwinner,function = "uart4";
+                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+                       };
+
                        uart5_pins_a: uart5@0 {
                                allwinner,pins = "PI10", "PI11";
                                allwinner,function = "uart5";
                        };
 
                        spi0_pins_a: spi0@0 {
-                               allwinner,pins = "PI10", "PI11", "PI12", "PI13", "PI14";
+                               allwinner,pins = "PI11", "PI12", "PI13";
+                               allwinner,function = "spi0";
+                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+                       };
+
+                       spi0_cs0_pins_a: spi0_cs0@0 {
+                               allwinner,pins = "PI10";
+                               allwinner,function = "spi0";
+                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+                       };
+
+                       spi0_cs1_pins_a: spi0_cs1@0 {
+                               allwinner,pins = "PI14";
                                allwinner,function = "spi0";
                                allwinner,drive = <SUN4I_PINCTRL_10_MA>;
                                allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
                        };
 
                        spi1_pins_a: spi1@0 {
-                               allwinner,pins = "PI16", "PI17", "PI18", "PI19";
+                               allwinner,pins = "PI17", "PI18", "PI19";
+                               allwinner,function = "spi1";
+                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+                       };
+
+                       spi1_cs0_pins_a: spi1_cs0@0 {
+                               allwinner,pins = "PI16";
                                allwinner,function = "spi1";
                                allwinner,drive = <SUN4I_PINCTRL_10_MA>;
                                allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
                        };
 
                        spi2_pins_a: spi2@0 {
-                               allwinner,pins = "PC19", "PC20", "PC21", "PC22";
+                               allwinner,pins = "PC20", "PC21", "PC22";
                                allwinner,function = "spi2";
                                allwinner,drive = <SUN4I_PINCTRL_10_MA>;
                                allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
                        };
 
                        spi2_pins_b: spi2@1 {
-                               allwinner,pins = "PB14", "PB15", "PB16", "PB17";
+                               allwinner,pins = "PB15", "PB16", "PB17";
+                               allwinner,function = "spi2";
+                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+                       };
+
+                       spi2_cs0_pins_a: spi2_cs0@0 {
+                               allwinner,pins = "PC19";
+                               allwinner,function = "spi2";
+                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+                       };
+
+                       spi2_cs0_pins_b: spi2_cs0@1 {
+                               allwinner,pins = "PB14";
                                allwinner,function = "spi2";
                                allwinner,drive = <SUN4I_PINCTRL_10_MA>;
                                allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
                        };
 
                        mmc0_pins_a: mmc0@0 {
-                               allwinner,pins = "PF0","PF1","PF2","PF3","PF4","PF5";
+                               allwinner,pins = "PF0", "PF1", "PF2",
+                                                "PF3", "PF4", "PF5";
                                allwinner,function = "mmc0";
                                allwinner,drive = <SUN4I_PINCTRL_30_MA>;
                                allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
                        };
 
                        mmc2_pins_a: mmc2@0 {
-                               allwinner,pins = "PC6","PC7","PC8","PC9","PC10","PC11";
+                               allwinner,pins = "PC6", "PC7", "PC8",
+                                                "PC9", "PC10", "PC11";
                                allwinner,function = "mmc2";
                                allwinner,drive = <SUN4I_PINCTRL_30_MA>;
                                allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
                        };
 
                        mmc3_pins_a: mmc3@0 {
-                               allwinner,pins = "PI4","PI5","PI6","PI7","PI8","PI9";
+                               allwinner,pins = "PI4", "PI5", "PI6",
+                                                "PI7", "PI8", "PI9";
                                allwinner,function = "mmc3";
                                allwinner,drive = <SUN4I_PINCTRL_30_MA>;
                                allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
                        };
 
-                       ir0_pins_a: ir0@0 {
-                                   allwinner,pins = "PB3","PB4";
+                       ir0_rx_pins_a: ir0@0 {
+                                   allwinner,pins = "PB4";
                                    allwinner,function = "ir0";
                                    allwinner,drive = <SUN4I_PINCTRL_10_MA>;
                                    allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
                        };
 
-                       ir1_pins_a: ir1@0 {
-                                   allwinner,pins = "PB22","PB23";
+                       ir0_tx_pins_a: ir0@1 {
+                                   allwinner,pins = "PB3";
+                                   allwinner,function = "ir0";
+                                   allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+                                   allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+                       };
+
+                       ir1_rx_pins_a: ir1@0 {
+                                   allwinner,pins = "PB23";
+                                   allwinner,function = "ir1";
+                                   allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+                                   allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+                       };
+
+                       ir1_tx_pins_a: ir1@1 {
+                                   allwinner,pins = "PB22";
                                    allwinner,function = "ir1";
                                    allwinner,drive = <SUN4I_PINCTRL_10_MA>;
                                    allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
                };
 
                rtp: rtp@01c25000 {
-                       compatible = "allwinner,sun4i-a10-ts";
+                       compatible = "allwinner,sun5i-a13-ts";
                        reg = <0x01c25000 0x100>;
                        interrupts = <GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>;
                        #thermal-sensor-cells = <0>;
                };
 
                i2c0: i2c@01c2ac00 {
-                       compatible = "allwinner,sun7i-a20-i2c", "allwinner,sun4i-a10-i2c";
+                       compatible = "allwinner,sun7i-a20-i2c",
+                                    "allwinner,sun4i-a10-i2c";
                        reg = <0x01c2ac00 0x400>;
                        interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>;
                        clocks = <&apb1_gates 0>;
                };
 
                i2c1: i2c@01c2b000 {
-                       compatible = "allwinner,sun7i-a20-i2c", "allwinner,sun4i-a10-i2c";
+                       compatible = "allwinner,sun7i-a20-i2c",
+                                    "allwinner,sun4i-a10-i2c";
                        reg = <0x01c2b000 0x400>;
                        interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>;
                        clocks = <&apb1_gates 1>;
                };
 
                i2c2: i2c@01c2b400 {
-                       compatible = "allwinner,sun7i-a20-i2c", "allwinner,sun4i-a10-i2c";
+                       compatible = "allwinner,sun7i-a20-i2c",
+                                    "allwinner,sun4i-a10-i2c";
                        reg = <0x01c2b400 0x400>;
                        interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>;
                        clocks = <&apb1_gates 2>;
                };
 
                i2c3: i2c@01c2b800 {
-                       compatible = "allwinner,sun7i-a20-i2c", "allwinner,sun4i-a10-i2c";
+                       compatible = "allwinner,sun7i-a20-i2c",
+                                    "allwinner,sun4i-a10-i2c";
                        reg = <0x01c2b800 0x400>;
                        interrupts = <GIC_SPI 88 IRQ_TYPE_LEVEL_HIGH>;
                        clocks = <&apb1_gates 3>;
                };
 
                i2c4: i2c@01c2c000 {
-                       compatible = "allwinner,sun7i-a20-i2c", "allwinner,sun4i-a10-i2c";
+                       compatible = "allwinner,sun7i-a20-i2c",
+                                    "allwinner,sun4i-a10-i2c";
                        reg = <0x01c2c000 0x400>;
                        interrupts = <GIC_SPI 89 IRQ_TYPE_LEVEL_HIGH>;
                        clocks = <&apb1_gates 15>;
diff --git a/arch/arm/boot/dts/sun8i-a23-a33.dtsi b/arch/arm/boot/dts/sun8i-a23-a33.dtsi
new file mode 100644 (file)
index 0000000..7abd0ae
--- /dev/null
@@ -0,0 +1,636 @@
+/*
+ * 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.
+ */
+
+#include "skeleton.dtsi"
+
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+
+#include <dt-bindings/pinctrl/sun4i-a10.h>
+
+/ {
+       interrupt-parent = <&gic>;
+
+       chosen {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges;
+
+               framebuffer@0 {
+                       compatible = "allwinner,simple-framebuffer",
+                                    "simple-framebuffer";
+                       allwinner,pipeline = "de_be0-lcd0";
+                       clocks = <&pll6 0>;
+                       status = "disabled";
+               };
+       };
+
+       timer {
+               compatible = "arm,armv7-timer";
+               interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
+                            <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
+                            <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
+                            <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>;
+               clock-frequency = <24000000>;
+               arm,cpu-registers-not-fw-configured;
+       };
+
+       cpus {
+               enable-method = "allwinner,sun8i-a23";
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               cpu@0 {
+                       compatible = "arm,cortex-a7";
+                       device_type = "cpu";
+                       reg = <0>;
+               };
+
+               cpu@1 {
+                       compatible = "arm,cortex-a7";
+                       device_type = "cpu";
+                       reg = <1>;
+               };
+       };
+
+       clocks {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges;
+
+               osc24M: osc24M_clk {
+                       #clock-cells = <0>;
+                       compatible = "fixed-clock";
+                       clock-frequency = <24000000>;
+                       clock-output-names = "osc24M";
+               };
+
+               osc32k: osc32k_clk {
+                       #clock-cells = <0>;
+                       compatible = "fixed-clock";
+                       clock-frequency = <32768>;
+                       clock-output-names = "osc32k";
+               };
+
+               pll1: clk@01c20000 {
+                       #clock-cells = <0>;
+                       compatible = "allwinner,sun8i-a23-pll1-clk";
+                       reg = <0x01c20000 0x4>;
+                       clocks = <&osc24M>;
+                       clock-output-names = "pll1";
+               };
+
+               /* dummy clock until actually implemented */
+               pll5: pll5_clk {
+                       #clock-cells = <0>;
+                       compatible = "fixed-clock";
+                       clock-frequency = <0>;
+                       clock-output-names = "pll5";
+               };
+
+               pll6: clk@01c20028 {
+                       #clock-cells = <1>;
+                       compatible = "allwinner,sun6i-a31-pll6-clk";
+                       reg = <0x01c20028 0x4>;
+                       clocks = <&osc24M>;
+                       clock-output-names = "pll6", "pll6x2";
+               };
+
+               cpu: cpu_clk@01c20050 {
+                       #clock-cells = <0>;
+                       compatible = "allwinner,sun4i-a10-cpu-clk";
+                       reg = <0x01c20050 0x4>;
+
+                       /*
+                        * PLL1 is listed twice here.
+                        * While it looks suspicious, it's actually documented
+                        * that way both in the datasheet and in the code from
+                        * Allwinner.
+                        */
+                       clocks = <&osc32k>, <&osc24M>, <&pll1>, <&pll1>;
+                       clock-output-names = "cpu";
+               };
+
+               axi: axi_clk@01c20050 {
+                       #clock-cells = <0>;
+                       compatible = "allwinner,sun8i-a23-axi-clk";
+                       reg = <0x01c20050 0x4>;
+                       clocks = <&cpu>;
+                       clock-output-names = "axi";
+               };
+
+               ahb1: ahb1_clk@01c20054 {
+                       #clock-cells = <0>;
+                       compatible = "allwinner,sun6i-a31-ahb1-clk";
+                       reg = <0x01c20054 0x4>;
+                       clocks = <&osc32k>, <&osc24M>, <&axi>, <&pll6 0>;
+                       clock-output-names = "ahb1";
+               };
+
+               apb1: apb1_clk@01c20054 {
+                       #clock-cells = <0>;
+                       compatible = "allwinner,sun4i-a10-apb0-clk";
+                       reg = <0x01c20054 0x4>;
+                       clocks = <&ahb1>;
+                       clock-output-names = "apb1";
+               };
+
+               ahb1_gates: clk@01c20060 {
+                       #clock-cells = <1>;
+                       compatible = "allwinner,sun8i-a23-ahb1-gates-clk";
+                       reg = <0x01c20060 0x8>;
+                       clocks = <&ahb1>;
+                       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";
+                       reg = <0x01c20068 0x4>;
+                       clocks = <&apb1>;
+                       clock-output-names = "apb1_codec", "apb1_pio",
+                                       "apb1_daudio0", "apb1_daudio1";
+               };
+
+               apb2: clk@01c20058 {
+                       #clock-cells = <0>;
+                       compatible = "allwinner,sun4i-a10-apb1-clk";
+                       reg = <0x01c20058 0x4>;
+                       clocks = <&osc32k>, <&osc24M>, <&pll6 0>, <&pll6 0>;
+                       clock-output-names = "apb2";
+               };
+
+               apb2_gates: clk@01c2006c {
+                       #clock-cells = <1>;
+                       compatible = "allwinner,sun8i-a23-apb2-gates-clk";
+                       reg = <0x01c2006c 0x4>;
+                       clocks = <&apb2>;
+                       clock-output-names = "apb2_i2c0", "apb2_i2c1",
+                                       "apb2_i2c2", "apb2_uart0",
+                                       "apb2_uart1", "apb2_uart2",
+                                       "apb2_uart3", "apb2_uart4";
+               };
+
+               mmc0_clk: clk@01c20088 {
+                       #clock-cells = <1>;
+                       compatible = "allwinner,sun4i-a10-mmc-clk";
+                       reg = <0x01c20088 0x4>;
+                       clocks = <&osc24M>, <&pll6 0>;
+                       clock-output-names = "mmc0",
+                                            "mmc0_output",
+                                            "mmc0_sample";
+               };
+
+               mmc1_clk: clk@01c2008c {
+                       #clock-cells = <1>;
+                       compatible = "allwinner,sun4i-a10-mmc-clk";
+                       reg = <0x01c2008c 0x4>;
+                       clocks = <&osc24M>, <&pll6 0>;
+                       clock-output-names = "mmc1",
+                                            "mmc1_output",
+                                            "mmc1_sample";
+               };
+
+               mmc2_clk: clk@01c20090 {
+                       #clock-cells = <1>;
+                       compatible = "allwinner,sun4i-a10-mmc-clk";
+                       reg = <0x01c20090 0x4>;
+                       clocks = <&osc24M>, <&pll6 0>;
+                       clock-output-names = "mmc2",
+                                            "mmc2_output",
+                                            "mmc2_sample";
+               };
+
+               usb_clk: clk@01c200cc {
+                       #clock-cells = <1>;
+                       #reset-cells = <1>;
+                       compatible = "allwinner,sun8i-a23-usb-clk";
+                       reg = <0x01c200cc 0x4>;
+                       clocks = <&osc24M>;
+                       clock-output-names = "usb_phy0", "usb_phy1", "usb_hsic",
+                                            "usb_hsic_12M", "usb_ohci0";
+               };
+       };
+
+       soc@01c00000 {
+               compatible = "simple-bus";
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges;
+
+               dma: dma-controller@01c02000 {
+                       compatible = "allwinner,sun8i-a23-dma";
+                       reg = <0x01c02000 0x1000>;
+                       interrupts = <GIC_SPI 50 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&ahb1_gates 6>;
+                       resets = <&ahb1_rst 6>;
+                       #dma-cells = <1>;
+               };
+
+               mmc0: mmc@01c0f000 {
+                       compatible = "allwinner,sun5i-a13-mmc";
+                       reg = <0x01c0f000 0x1000>;
+                       clocks = <&ahb1_gates 8>,
+                                <&mmc0_clk 0>,
+                                <&mmc0_clk 1>,
+                                <&mmc0_clk 2>;
+                       clock-names = "ahb",
+                                     "mmc",
+                                     "output",
+                                     "sample";
+                       resets = <&ahb1_rst 8>;
+                       reset-names = "ahb";
+                       interrupts = <GIC_SPI 60 IRQ_TYPE_LEVEL_HIGH>;
+                       status = "disabled";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+               };
+
+               mmc1: mmc@01c10000 {
+                       compatible = "allwinner,sun5i-a13-mmc";
+                       reg = <0x01c10000 0x1000>;
+                       clocks = <&ahb1_gates 9>,
+                                <&mmc1_clk 0>,
+                                <&mmc1_clk 1>,
+                                <&mmc1_clk 2>;
+                       clock-names = "ahb",
+                                     "mmc",
+                                     "output",
+                                     "sample";
+                       resets = <&ahb1_rst 9>;
+                       reset-names = "ahb";
+                       interrupts = <GIC_SPI 61 IRQ_TYPE_LEVEL_HIGH>;
+                       status = "disabled";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+               };
+
+               mmc2: mmc@01c11000 {
+                       compatible = "allwinner,sun5i-a13-mmc";
+                       reg = <0x01c11000 0x1000>;
+                       clocks = <&ahb1_gates 10>,
+                                <&mmc2_clk 0>,
+                                <&mmc2_clk 1>,
+                                <&mmc2_clk 2>;
+                       clock-names = "ahb",
+                                     "mmc",
+                                     "output",
+                                     "sample";
+                       resets = <&ahb1_rst 10>;
+                       reset-names = "ahb";
+                       interrupts = <GIC_SPI 62 IRQ_TYPE_LEVEL_HIGH>;
+                       status = "disabled";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+               };
+
+               pio: pinctrl@01c20800 {
+                       /* compatible gets set in SoC specific dtsi file */
+                       reg = <0x01c20800 0x400>;
+                       /* interrupts get set in SoC specific dtsi file */
+                       clocks = <&apb1_gates 5>;
+                       gpio-controller;
+                       interrupt-controller;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       #gpio-cells = <3>;
+
+                       uart0_pins_a: uart0@0 {
+                               allwinner,pins = "PF2", "PF4";
+                               allwinner,function = "uart0";
+                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+                       };
+
+                       mmc0_pins_a: mmc0@0 {
+                               allwinner,pins = "PF0", "PF1", "PF2",
+                                                "PF3", "PF4", "PF5";
+                               allwinner,function = "mmc0";
+                               allwinner,drive = <SUN4I_PINCTRL_30_MA>;
+                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+                       };
+
+                       mmc1_pins_a: mmc1@0 {
+                               allwinner,pins = "PG0", "PG1", "PG2",
+                                                "PG3", "PG4", "PG5";
+                               allwinner,function = "mmc1";
+                               allwinner,drive = <SUN4I_PINCTRL_30_MA>;
+                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+                       };
+
+                       mmc2_8bit_pins: mmc2_8bit {
+                               allwinner,pins = "PC5", "PC6", "PC8",
+                                                "PC9", "PC10", "PC11",
+                                                "PC12", "PC13", "PC14",
+                                                "PC15";
+                               allwinner,function = "mmc2";
+                               allwinner,drive = <SUN4I_PINCTRL_30_MA>;
+                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+                       };
+
+                       i2c0_pins_a: i2c0@0 {
+                               allwinner,pins = "PH2", "PH3";
+                               allwinner,function = "i2c0";
+                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+                       };
+
+                       i2c1_pins_a: i2c1@0 {
+                               allwinner,pins = "PH4", "PH5";
+                               allwinner,function = "i2c1";
+                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+                       };
+
+                       i2c2_pins_a: i2c2@0 {
+                               allwinner,pins = "PE12", "PE13";
+                               allwinner,function = "i2c2";
+                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+                       };
+               };
+
+               ahb1_rst: reset@01c202c0 {
+                       #reset-cells = <1>;
+                       compatible = "allwinner,sun6i-a31-clock-reset";
+                       reg = <0x01c202c0 0xc>;
+               };
+
+               apb1_rst: reset@01c202d0 {
+                       #reset-cells = <1>;
+                       compatible = "allwinner,sun6i-a31-clock-reset";
+                       reg = <0x01c202d0 0x4>;
+               };
+
+               apb2_rst: reset@01c202d8 {
+                       #reset-cells = <1>;
+                       compatible = "allwinner,sun6i-a31-clock-reset";
+                       reg = <0x01c202d8 0x4>;
+               };
+
+               timer@01c20c00 {
+                       compatible = "allwinner,sun4i-a10-timer";
+                       reg = <0x01c20c00 0xa0>;
+                       interrupts = <GIC_SPI 18 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&osc24M>;
+               };
+
+               wdt0: watchdog@01c20ca0 {
+                       compatible = "allwinner,sun6i-a31-wdt";
+                       reg = <0x01c20ca0 0x20>;
+                       interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>;
+               };
+
+               lradc: lradc@01c22800 {
+                       compatible = "allwinner,sun4i-a10-lradc-keys";
+                       reg = <0x01c22800 0x100>;
+                       interrupts = <GIC_SPI 30 IRQ_TYPE_LEVEL_HIGH>;
+                       status = "disabled";
+               };
+
+               uart0: serial@01c28000 {
+                       compatible = "snps,dw-apb-uart";
+                       reg = <0x01c28000 0x400>;
+                       interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>;
+                       reg-shift = <2>;
+                       reg-io-width = <4>;
+                       clocks = <&apb2_gates 16>;
+                       resets = <&apb2_rst 16>;
+                       dmas = <&dma 6>, <&dma 6>;
+                       dma-names = "rx", "tx";
+                       status = "disabled";
+               };
+
+               uart1: serial@01c28400 {
+                       compatible = "snps,dw-apb-uart";
+                       reg = <0x01c28400 0x400>;
+                       interrupts = <GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>;
+                       reg-shift = <2>;
+                       reg-io-width = <4>;
+                       clocks = <&apb2_gates 17>;
+                       resets = <&apb2_rst 17>;
+                       dmas = <&dma 7>, <&dma 7>;
+                       dma-names = "rx", "tx";
+                       status = "disabled";
+               };
+
+               uart2: serial@01c28800 {
+                       compatible = "snps,dw-apb-uart";
+                       reg = <0x01c28800 0x400>;
+                       interrupts = <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>;
+                       reg-shift = <2>;
+                       reg-io-width = <4>;
+                       clocks = <&apb2_gates 18>;
+                       resets = <&apb2_rst 18>;
+                       dmas = <&dma 8>, <&dma 8>;
+                       dma-names = "rx", "tx";
+                       status = "disabled";
+               };
+
+               uart3: serial@01c28c00 {
+                       compatible = "snps,dw-apb-uart";
+                       reg = <0x01c28c00 0x400>;
+                       interrupts = <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>;
+                       reg-shift = <2>;
+                       reg-io-width = <4>;
+                       clocks = <&apb2_gates 19>;
+                       resets = <&apb2_rst 19>;
+                       dmas = <&dma 9>, <&dma 9>;
+                       dma-names = "rx", "tx";
+                       status = "disabled";
+               };
+
+               uart4: serial@01c29000 {
+                       compatible = "snps,dw-apb-uart";
+                       reg = <0x01c29000 0x400>;
+                       interrupts = <GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>;
+                       reg-shift = <2>;
+                       reg-io-width = <4>;
+                       clocks = <&apb2_gates 20>;
+                       resets = <&apb2_rst 20>;
+                       dmas = <&dma 10>, <&dma 10>;
+                       dma-names = "rx", "tx";
+                       status = "disabled";
+               };
+
+               i2c0: i2c@01c2ac00 {
+                       compatible = "allwinner,sun6i-a31-i2c";
+                       reg = <0x01c2ac00 0x400>;
+                       interrupts = <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&apb2_gates 0>;
+                       resets = <&apb2_rst 0>;
+                       status = "disabled";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+               };
+
+               i2c1: i2c@01c2b000 {
+                       compatible = "allwinner,sun6i-a31-i2c";
+                       reg = <0x01c2b000 0x400>;
+                       interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&apb2_gates 1>;
+                       resets = <&apb2_rst 1>;
+                       status = "disabled";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+               };
+
+               i2c2: i2c@01c2b400 {
+                       compatible = "allwinner,sun6i-a31-i2c";
+                       reg = <0x01c2b400 0x400>;
+                       interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&apb2_gates 2>;
+                       resets = <&apb2_rst 2>;
+                       status = "disabled";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+               };
+
+               gic: interrupt-controller@01c81000 {
+                       compatible = "arm,cortex-a7-gic", "arm,cortex-a15-gic";
+                       reg = <0x01c81000 0x1000>,
+                             <0x01c82000 0x1000>,
+                             <0x01c84000 0x2000>,
+                             <0x01c86000 0x2000>;
+                       interrupt-controller;
+                       #interrupt-cells = <3>;
+                       interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>;
+               };
+
+               rtc: rtc@01f00000 {
+                       compatible = "allwinner,sun6i-a31-rtc";
+                       reg = <0x01f00000 0x54>;
+                       interrupts = <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 41 IRQ_TYPE_LEVEL_HIGH>;
+               };
+
+               prcm@01f01400 {
+                       compatible = "allwinner,sun8i-a23-prcm";
+                       reg = <0x01f01400 0x200>;
+
+                       ar100: ar100_clk {
+                               compatible = "fixed-factor-clock";
+                               #clock-cells = <0>;
+                               clock-div = <1>;
+                               clock-mult = <1>;
+                               clocks = <&osc24M>;
+                               clock-output-names = "ar100";
+                       };
+
+                       ahb0: ahb0_clk {
+                               compatible = "fixed-factor-clock";
+                               #clock-cells = <0>;
+                               clock-div = <1>;
+                               clock-mult = <1>;
+                               clocks = <&ar100>;
+                               clock-output-names = "ahb0";
+                       };
+
+                       apb0: apb0_clk {
+                               compatible = "allwinner,sun8i-a23-apb0-clk";
+                               #clock-cells = <0>;
+                               clocks = <&ahb0>;
+                               clock-output-names = "apb0";
+                       };
+
+                       apb0_gates: apb0_gates_clk {
+                               compatible = "allwinner,sun8i-a23-apb0-gates-clk";
+                               #clock-cells = <1>;
+                               clocks = <&apb0>;
+                               clock-output-names = "apb0_pio", "apb0_timer",
+                                               "apb0_rsb", "apb0_uart",
+                                               "apb0_i2c";
+                       };
+
+                       apb0_rst: apb0_rst {
+                               compatible = "allwinner,sun6i-a31-clock-reset";
+                               #reset-cells = <1>;
+                       };
+               };
+
+               cpucfg@01f01c00 {
+                       compatible = "allwinner,sun8i-a23-cpuconfig";
+                       reg = <0x01f01c00 0x300>;
+               };
+
+               r_uart: serial@01f02800 {
+                       compatible = "snps,dw-apb-uart";
+                       reg = <0x01f02800 0x400>;
+                       interrupts = <GIC_SPI 38 IRQ_TYPE_LEVEL_HIGH>;
+                       reg-shift = <2>;
+                       reg-io-width = <4>;
+                       clocks = <&apb0_gates 4>;
+                       resets = <&apb0_rst 4>;
+                       status = "disabled";
+               };
+
+               r_pio: pinctrl@01f02c00 {
+                       compatible = "allwinner,sun8i-a23-r-pinctrl";
+                       reg = <0x01f02c00 0x400>;
+                       interrupts = <GIC_SPI 45 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&apb0_gates 0>;
+                       resets = <&apb0_rst 0>;
+                       gpio-controller;
+                       interrupt-controller;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       #gpio-cells = <3>;
+
+                       r_uart_pins_a: r_uart@0 {
+                               allwinner,pins = "PL2", "PL3";
+                               allwinner,function = "s_uart";
+                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+                       };
+               };
+       };
+};
diff --git a/arch/arm/boot/dts/sun8i-a23-evb.dts b/arch/arm/boot/dts/sun8i-a23-evb.dts
new file mode 100644 (file)
index 0000000..610786e
--- /dev/null
@@ -0,0 +1,134 @@
+/*
+ * Copyright 2015 Maxime Ripard
+ *
+ * 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 "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 A23 Evaluation Board";
+       compatible = "allwinner,sun8i-a23-evb", "allwinner,sun8i-a23";
+
+       aliases {
+               i2c0 = &i2c0;
+               i2c1 = &i2c1;
+               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@190 {
+               label = "Volume Up";
+               linux,code = <KEY_VOLUMEUP>;
+               channel = <0>;
+               voltage = <190000>;
+       };
+
+       button@390 {
+               label = "Volume Down";
+               linux,code = <KEY_VOLUMEDOWN>;
+               channel = <0>;
+               voltage = <390000>;
+       };
+
+       button@600 {
+               label = "Home";
+               linux,code = <KEY_HOME>;
+               channel = <0>;
+               voltage = <600000>;
+       };
+};
+
+&mmc0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_evb>;
+       vmmc-supply = <&reg_vcc3v0>;
+       bus-width = <4>;
+       cd-gpios = <&pio 1 4 GPIO_ACTIVE_HIGH>; /* PB4 */
+       cd-inverted;
+       status = "okay";
+};
+
+&pio {
+       mmc0_cd_pin_evb: mmc0_cd_pin@0 {
+               allwinner,pins = "PB4";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+       };
+};
+
+/*
+ * The RX line has a non-populated resistance. In order to use it, you
+ * need to solder R207 on the back of the board in order to close the
+ * line and get a working UART.
+ */
+&r_uart {
+       pinctrl-names = "default";
+       pinctrl-0 = <&r_uart_pins_a>;
+       status = "okay";
+};
index dd31c53e2ab6bda7cf9eead953c5a0aa30371fe9..382d64c3b78e6dcf05614dda6f6994d7bbd0d948 100644 (file)
  *     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 file; 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
index 623573e4608059adb710f135064a828bc6c9f6fe..95134c69cfc1b9050eadc07a32cc7cad96ddbea3 100644 (file)
  *     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 file; 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
        };
 
        chosen {
-               bootargs = "earlyprintk console=ttyS0,115200";
+               stdout-path = "serial0:115200n8";
        };
+};
 
-       soc@01c00000 {
-               mmc0: mmc@01c0f000 {
-                       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";
-               };
-
-               pinctrl@01c20800 {
-                       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>;
-                       };
-               };
+&i2c0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c0_pins_a>;
+       status = "okay";
+};
 
-               lradc: lradc@01c22800 {
-                       vref-supply = <&reg_vcc3v0>;
-                       status = "okay";
+&i2c1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c1_pins_a>;
+       status = "okay";
+};
 
-                       button@200 {
-                               label = "Volume Up";
-                               linux,code = <KEY_VOLUMEUP>;
-                               channel = <0>;
-                               voltage = <200000>;
-                       };
+&i2c2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c2_pins_a>;
+       /* pull-ups and devices require PMIC regulator */
+       status = "failed";
+};
 
-                       button@400 {
-                               label = "Volume Down";
-                               linux,code = <KEY_VOLUMEDOWN>;
-                               channel = <0>;
-                               voltage = <400000>;
-                       };
-               };
+&lradc {
+       vref-supply = <&reg_vcc3v0>;
+       status = "okay";
 
-               i2c0: i2c@01c2ac00 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&i2c0_pins_a>;
-                       status = "okay";
-               };
+       button@200 {
+               label = "Volume Up";
+               linux,code = <KEY_VOLUMEUP>;
+               channel = <0>;
+               voltage = <200000>;
+       };
 
-               i2c1: i2c@01c2b000 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&i2c1_pins_a>;
-                       status = "okay";
-               };
+       button@400 {
+               label = "Volume Down";
+               linux,code = <KEY_VOLUMEDOWN>;
+               channel = <0>;
+               voltage = <400000>;
+       };
+};
 
-               i2c2: i2c@01c2b400 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&i2c2_pins_a>;
-                       /* pull-ups and devices require PMIC regulator */
-                       status = "failed";
-               };
+&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";
+};
 
-               r_uart: serial@01f02800 {
-                       pinctrl-names = "default";
-                       pinctrl-0 = <&r_uart_pins_a>;
-                       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";
+};
index 382ebd137ee4fbe97514362eee3f336d4e253047..8698f7aa31c71b20f9c67f2334c8c970fa48c989 100644 (file)
  *     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 file; 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
  *     OTHER DEALINGS IN THE SOFTWARE.
  */
 
-#include "skeleton.dtsi"
-
-#include <dt-bindings/interrupt-controller/arm-gic.h>
-
-#include <dt-bindings/pinctrl/sun4i-a10.h>
+#include "sun8i-a23-a33.dtsi"
 
 / {
-       interrupt-parent = <&gic>;
-
-       chosen {
-               #address-cells = <1>;
-               #size-cells = <1>;
-               ranges;
-
-               framebuffer@0 {
-                       compatible = "allwinner,simple-framebuffer",
-                                    "simple-framebuffer";
-                       allwinner,pipeline = "de_be0-lcd0";
-                       clocks = <&pll6 0>;
-                       status = "disabled";
-               };
-       };
-
-       cpus {
-               #address-cells = <1>;
-               #size-cells = <0>;
-
-               cpu@0 {
-                       compatible = "arm,cortex-a7";
-                       device_type = "cpu";
-                       reg = <0>;
-               };
-
-               cpu@1 {
-                       compatible = "arm,cortex-a7";
-                       device_type = "cpu";
-                       reg = <1>;
-               };
-       };
-
        memory {
                reg = <0x40000000 0x40000000>;
        };
 
        clocks {
-               #address-cells = <1>;
-               #size-cells = <1>;
-               ranges;
-
-               osc24M: osc24M_clk {
-                       #clock-cells = <0>;
-                       compatible = "fixed-clock";
-                       clock-frequency = <24000000>;
-                       clock-output-names = "osc24M";
-               };
-
-               osc32k: osc32k_clk {
-                       #clock-cells = <0>;
-                       compatible = "fixed-clock";
-                       clock-frequency = <32768>;
-                       clock-output-names = "osc32k";
-               };
-
-               pll1: clk@01c20000 {
-                       #clock-cells = <0>;
-                       compatible = "allwinner,sun8i-a23-pll1-clk";
-                       reg = <0x01c20000 0x4>;
-                       clocks = <&osc24M>;
-                       clock-output-names = "pll1";
-               };
-
-               /* dummy clock until actually implemented */
-               pll5: pll5_clk {
-                       #clock-cells = <0>;
-                       compatible = "fixed-clock";
-                       clock-frequency = <0>;
-                       clock-output-names = "pll5";
-               };
-
-               pll6: clk@01c20028 {
-                       #clock-cells = <1>;
-                       compatible = "allwinner,sun6i-a31-pll6-clk";
-                       reg = <0x01c20028 0x4>;
-                       clocks = <&osc24M>;
-                       clock-output-names = "pll6", "pll6x2";
-               };
-
-               cpu: cpu_clk@01c20050 {
-                       #clock-cells = <0>;
-                       compatible = "allwinner,sun4i-a10-cpu-clk";
-                       reg = <0x01c20050 0x4>;
-
-                       /*
-                        * PLL1 is listed twice here.
-                        * While it looks suspicious, it's actually documented
-                        * that way both in the datasheet and in the code from
-                        * Allwinner.
-                        */
-                       clocks = <&osc32k>, <&osc24M>, <&pll1>, <&pll1>;
-                       clock-output-names = "cpu";
-               };
-
-               axi: axi_clk@01c20050 {
-                       #clock-cells = <0>;
-                       compatible = "allwinner,sun8i-a23-axi-clk";
-                       reg = <0x01c20050 0x4>;
-                       clocks = <&cpu>;
-                       clock-output-names = "axi";
-               };
-
-               ahb1: ahb1_clk@01c20054 {
-                       #clock-cells = <0>;
-                       compatible = "allwinner,sun6i-a31-ahb1-clk";
-                       reg = <0x01c20054 0x4>;
-                       clocks = <&osc32k>, <&osc24M>, <&axi>, <&pll6 0>;
-                       clock-output-names = "ahb1";
-               };
-
-               apb1: apb1_clk@01c20054 {
-                       #clock-cells = <0>;
-                       compatible = "allwinner,sun4i-a10-apb0-clk";
-                       reg = <0x01c20054 0x4>;
-                       clocks = <&ahb1>;
-                       clock-output-names = "apb1";
-               };
-
-               ahb1_gates: clk@01c20060 {
-                       #clock-cells = <1>;
-                       compatible = "allwinner,sun8i-a23-ahb1-gates-clk";
-                       reg = <0x01c20060 0x8>;
-                       clocks = <&ahb1>;
-                       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";
-                       reg = <0x01c20068 0x4>;
-                       clocks = <&apb1>;
-                       clock-output-names = "apb1_codec", "apb1_pio",
-                                       "apb1_daudio0", "apb1_daudio1";
-               };
-
-               apb2: clk@01c20058 {
-                       #clock-cells = <0>;
-                       compatible = "allwinner,sun4i-a10-apb1-clk";
-                       reg = <0x01c20058 0x4>;
-                       clocks = <&osc32k>, <&osc24M>, <&pll6 0>, <&pll6 0>;
-                       clock-output-names = "apb2";
-               };
-
-               apb2_gates: clk@01c2006c {
-                       #clock-cells = <1>;
-                       compatible = "allwinner,sun8i-a23-apb2-gates-clk";
-                       reg = <0x01c2006c 0x4>;
-                       clocks = <&apb2>;
-                       clock-output-names = "apb2_i2c0", "apb2_i2c1",
-                                       "apb2_i2c2", "apb2_uart0",
-                                       "apb2_uart1", "apb2_uart2",
-                                       "apb2_uart3", "apb2_uart4";
-               };
-
-               mmc0_clk: clk@01c20088 {
-                       #clock-cells = <1>;
-                       compatible = "allwinner,sun4i-a10-mmc-clk";
-                       reg = <0x01c20088 0x4>;
-                       clocks = <&osc24M>, <&pll6 0>;
-                       clock-output-names = "mmc0",
-                                            "mmc0_output",
-                                            "mmc0_sample";
-               };
-
-               mmc1_clk: clk@01c2008c {
-                       #clock-cells = <1>;
-                       compatible = "allwinner,sun4i-a10-mmc-clk";
-                       reg = <0x01c2008c 0x4>;
-                       clocks = <&osc24M>, <&pll6 0>;
-                       clock-output-names = "mmc1",
-                                            "mmc1_output",
-                                            "mmc1_sample";
-               };
-
-               mmc2_clk: clk@01c20090 {
-                       #clock-cells = <1>;
-                       compatible = "allwinner,sun4i-a10-mmc-clk";
-                       reg = <0x01c20090 0x4>;
-                       clocks = <&osc24M>, <&pll6 0>;
-                       clock-output-names = "mmc2",
-                                            "mmc2_output",
-                                            "mmc2_sample";
-               };
-
                mbus_clk: clk@01c2015c {
                        #clock-cells = <0>;
                        compatible = "allwinner,sun8i-a23-mbus-clk";
                        clock-output-names = "mbus";
                };
        };
+};
 
-       soc@01c00000 {
-               compatible = "simple-bus";
-               #address-cells = <1>;
-               #size-cells = <1>;
-               ranges;
-
-               dma: dma-controller@01c02000 {
-                       compatible = "allwinner,sun8i-a23-dma";
-                       reg = <0x01c02000 0x1000>;
-                       interrupts = <GIC_SPI 50 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&ahb1_gates 6>;
-                       resets = <&ahb1_rst 6>;
-                       #dma-cells = <1>;
-               };
-
-               mmc0: mmc@01c0f000 {
-                       compatible = "allwinner,sun5i-a13-mmc";
-                       reg = <0x01c0f000 0x1000>;
-                       clocks = <&ahb1_gates 8>,
-                                <&mmc0_clk 0>,
-                                <&mmc0_clk 1>,
-                                <&mmc0_clk 2>;
-                       clock-names = "ahb",
-                                     "mmc",
-                                     "output",
-                                     "sample";
-                       resets = <&ahb1_rst 8>;
-                       reset-names = "ahb";
-                       interrupts = <GIC_SPI 60 IRQ_TYPE_LEVEL_HIGH>;
-                       status = "disabled";
-               };
-
-               mmc1: mmc@01c10000 {
-                       compatible = "allwinner,sun5i-a13-mmc";
-                       reg = <0x01c10000 0x1000>;
-                       clocks = <&ahb1_gates 9>,
-                                <&mmc1_clk 0>,
-                                <&mmc1_clk 1>,
-                                <&mmc1_clk 2>;
-                       clock-names = "ahb",
-                                     "mmc",
-                                     "output",
-                                     "sample";
-                       resets = <&ahb1_rst 9>;
-                       reset-names = "ahb";
-                       interrupts = <GIC_SPI 61 IRQ_TYPE_LEVEL_HIGH>;
-                       status = "disabled";
-               };
-
-               mmc2: mmc@01c11000 {
-                       compatible = "allwinner,sun5i-a13-mmc";
-                       reg = <0x01c11000 0x1000>;
-                       clocks = <&ahb1_gates 10>,
-                                <&mmc2_clk 0>,
-                                <&mmc2_clk 1>,
-                                <&mmc2_clk 2>;
-                       clock-names = "ahb",
-                                     "mmc",
-                                     "output",
-                                     "sample";
-                       resets = <&ahb1_rst 10>;
-                       reset-names = "ahb";
-                       interrupts = <GIC_SPI 62 IRQ_TYPE_LEVEL_HIGH>;
-                       status = "disabled";
-               };
-
-               pio: pinctrl@01c20800 {
-                       compatible = "allwinner,sun8i-a23-pinctrl";
-                       reg = <0x01c20800 0x400>;
-                       interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>,
-                                    <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>,
-                                    <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&apb1_gates 5>;
-                       gpio-controller;
-                       interrupt-controller;
-                       #address-cells = <1>;
-                       #size-cells = <0>;
-                       #gpio-cells = <3>;
-
-                       uart0_pins_a: uart0@0 {
-                               allwinner,pins = "PF2", "PF4";
-                               allwinner,function = "uart0";
-                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-                       };
-
-                       mmc0_pins_a: mmc0@0 {
-                               allwinner,pins = "PF0","PF1","PF2","PF3","PF4","PF5";
-                               allwinner,function = "mmc0";
-                               allwinner,drive = <SUN4I_PINCTRL_30_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-                       };
-
-                       mmc1_pins_a: mmc1@0 {
-                               allwinner,pins = "PG0","PG1","PG2","PG3","PG4","PG5";
-                               allwinner,function = "mmc1";
-                               allwinner,drive = <SUN4I_PINCTRL_30_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-                       };
-
-                       i2c0_pins_a: i2c0@0 {
-                               allwinner,pins = "PH2", "PH3";
-                               allwinner,function = "i2c0";
-                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-                       };
-
-                       i2c1_pins_a: i2c1@0 {
-                               allwinner,pins = "PH4", "PH5";
-                               allwinner,function = "i2c1";
-                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-                       };
-
-                       i2c2_pins_a: i2c2@0 {
-                               allwinner,pins = "PE12", "PE13";
-                               allwinner,function = "i2c2";
-                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-                       };
-               };
-
-               ahb1_rst: reset@01c202c0 {
-                       #reset-cells = <1>;
-                       compatible = "allwinner,sun6i-a31-clock-reset";
-                       reg = <0x01c202c0 0xc>;
-               };
-
-               apb1_rst: reset@01c202d0 {
-                       #reset-cells = <1>;
-                       compatible = "allwinner,sun6i-a31-clock-reset";
-                       reg = <0x01c202d0 0x4>;
-               };
-
-               apb2_rst: reset@01c202d8 {
-                       #reset-cells = <1>;
-                       compatible = "allwinner,sun6i-a31-clock-reset";
-                       reg = <0x01c202d8 0x4>;
-               };
-
-               timer@01c20c00 {
-                       compatible = "allwinner,sun4i-a10-timer";
-                       reg = <0x01c20c00 0xa0>;
-                       interrupts = <GIC_SPI 18 IRQ_TYPE_LEVEL_HIGH>,
-                                    <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&osc24M>;
-               };
-
-               wdt0: watchdog@01c20ca0 {
-                       compatible = "allwinner,sun6i-a31-wdt";
-                       reg = <0x01c20ca0 0x20>;
-                       interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>;
-               };
-
-               lradc: lradc@01c22800 {
-                       compatible = "allwinner,sun4i-a10-lradc-keys";
-                       reg = <0x01c22800 0x100>;
-                       interrupts = <GIC_SPI 30 IRQ_TYPE_LEVEL_HIGH>;
-                       status = "disabled";
-               };
-
-               uart0: serial@01c28000 {
-                       compatible = "snps,dw-apb-uart";
-                       reg = <0x01c28000 0x400>;
-                       interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>;
-                       reg-shift = <2>;
-                       reg-io-width = <4>;
-                       clocks = <&apb2_gates 16>;
-                       resets = <&apb2_rst 16>;
-                       dmas = <&dma 6>, <&dma 6>;
-                       dma-names = "rx", "tx";
-                       status = "disabled";
-               };
-
-               uart1: serial@01c28400 {
-                       compatible = "snps,dw-apb-uart";
-                       reg = <0x01c28400 0x400>;
-                       interrupts = <GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>;
-                       reg-shift = <2>;
-                       reg-io-width = <4>;
-                       clocks = <&apb2_gates 17>;
-                       resets = <&apb2_rst 17>;
-                       dmas = <&dma 7>, <&dma 7>;
-                       dma-names = "rx", "tx";
-                       status = "disabled";
-               };
-
-               uart2: serial@01c28800 {
-                       compatible = "snps,dw-apb-uart";
-                       reg = <0x01c28800 0x400>;
-                       interrupts = <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>;
-                       reg-shift = <2>;
-                       reg-io-width = <4>;
-                       clocks = <&apb2_gates 18>;
-                       resets = <&apb2_rst 18>;
-                       dmas = <&dma 8>, <&dma 8>;
-                       dma-names = "rx", "tx";
-                       status = "disabled";
-               };
-
-               uart3: serial@01c28c00 {
-                       compatible = "snps,dw-apb-uart";
-                       reg = <0x01c28c00 0x400>;
-                       interrupts = <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>;
-                       reg-shift = <2>;
-                       reg-io-width = <4>;
-                       clocks = <&apb2_gates 19>;
-                       resets = <&apb2_rst 19>;
-                       dmas = <&dma 9>, <&dma 9>;
-                       dma-names = "rx", "tx";
-                       status = "disabled";
-               };
-
-               uart4: serial@01c29000 {
-                       compatible = "snps,dw-apb-uart";
-                       reg = <0x01c29000 0x400>;
-                       interrupts = <GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>;
-                       reg-shift = <2>;
-                       reg-io-width = <4>;
-                       clocks = <&apb2_gates 20>;
-                       resets = <&apb2_rst 20>;
-                       dmas = <&dma 10>, <&dma 10>;
-                       dma-names = "rx", "tx";
-                       status = "disabled";
-               };
-
-               i2c0: i2c@01c2ac00 {
-                       compatible = "allwinner,sun6i-a31-i2c";
-                       reg = <0x01c2ac00 0x400>;
-                       interrupts = <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&apb2_gates 0>;
-                       resets = <&apb2_rst 0>;
-                       status = "disabled";
-                       #address-cells = <1>;
-                       #size-cells = <0>;
-               };
-
-               i2c1: i2c@01c2b000 {
-                       compatible = "allwinner,sun6i-a31-i2c";
-                       reg = <0x01c2b000 0x400>;
-                       interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&apb2_gates 1>;
-                       resets = <&apb2_rst 1>;
-                       status = "disabled";
-                       #address-cells = <1>;
-                       #size-cells = <0>;
-               };
-
-               i2c2: i2c@01c2b400 {
-                       compatible = "allwinner,sun6i-a31-i2c";
-                       reg = <0x01c2b400 0x400>;
-                       interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&apb2_gates 2>;
-                       resets = <&apb2_rst 2>;
-                       status = "disabled";
-                       #address-cells = <1>;
-                       #size-cells = <0>;
-               };
-
-               gic: interrupt-controller@01c81000 {
-                       compatible = "arm,cortex-a7-gic", "arm,cortex-a15-gic";
-                       reg = <0x01c81000 0x1000>,
-                             <0x01c82000 0x1000>,
-                             <0x01c84000 0x2000>,
-                             <0x01c86000 0x2000>;
-                       interrupt-controller;
-                       #interrupt-cells = <3>;
-                       interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>;
-               };
-
-               rtc: rtc@01f00000 {
-                       compatible = "allwinner,sun6i-a31-rtc";
-                       reg = <0x01f00000 0x54>;
-                       interrupts = <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>,
-                                    <GIC_SPI 41 IRQ_TYPE_LEVEL_HIGH>;
-               };
-
-               prcm@01f01400 {
-                       compatible = "allwinner,sun8i-a23-prcm";
-                       reg = <0x01f01400 0x200>;
-
-                       ar100: ar100_clk {
-                               compatible = "fixed-factor-clock";
-                               #clock-cells = <0>;
-                               clock-div = <1>;
-                               clock-mult = <1>;
-                               clocks = <&osc24M>;
-                               clock-output-names = "ar100";
-                       };
-
-                       ahb0: ahb0_clk {
-                               compatible = "fixed-factor-clock";
-                               #clock-cells = <0>;
-                               clock-div = <1>;
-                               clock-mult = <1>;
-                               clocks = <&ar100>;
-                               clock-output-names = "ahb0";
-                       };
-
-                       apb0: apb0_clk {
-                               compatible = "allwinner,sun8i-a23-apb0-clk";
-                               #clock-cells = <0>;
-                               clocks = <&ahb0>;
-                               clock-output-names = "apb0";
-                       };
-
-                       apb0_gates: apb0_gates_clk {
-                               compatible = "allwinner,sun8i-a23-apb0-gates-clk";
-                               #clock-cells = <1>;
-                               clocks = <&apb0>;
-                               clock-output-names = "apb0_pio", "apb0_timer",
-                                               "apb0_rsb", "apb0_uart",
-                                               "apb0_i2c";
-                       };
-
-                       apb0_rst: apb0_rst {
-                               compatible = "allwinner,sun6i-a31-clock-reset";
-                               #reset-cells = <1>;
-                       };
-               };
-
-               r_uart: serial@01f02800 {
-                       compatible = "snps,dw-apb-uart";
-                       reg = <0x01f02800 0x400>;
-                       interrupts = <GIC_SPI 38 IRQ_TYPE_LEVEL_HIGH>;
-                       reg-shift = <2>;
-                       reg-io-width = <4>;
-                       clocks = <&apb0_gates 4>;
-                       resets = <&apb0_rst 4>;
-                       status = "disabled";
-               };
-
-               r_pio: pinctrl@01f02c00 {
-                       compatible = "allwinner,sun8i-a23-r-pinctrl";
-                       reg = <0x01f02c00 0x400>;
-                       interrupts = <GIC_SPI 45 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&apb0_gates 0>;
-                       resets = <&apb0_rst 0>;
-                       gpio-controller;
-                       interrupt-controller;
-                       #address-cells = <1>;
-                       #size-cells = <0>;
-                       #gpio-cells = <3>;
-
-                       r_uart_pins_a: r_uart@0 {
-                               allwinner,pins = "PL2", "PL3";
-                               allwinner,function = "s_uart";
-                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-                       };
-               };
-       };
+&pio {
+       compatible = "allwinner,sun8i-a23-pinctrl";
+       interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>,
+                    <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>,
+                    <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>;
 };
diff --git a/arch/arm/boot/dts/sun8i-a33-et-q8-v1.6.dts b/arch/arm/boot/dts/sun8i-a33-et-q8-v1.6.dts
new file mode 100644 (file)
index 0000000..19db844
--- /dev/null
@@ -0,0 +1,88 @@
+/*
+ * 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";
+};
diff --git a/arch/arm/boot/dts/sun8i-a33-ga10h-v1.1.dts b/arch/arm/boot/dts/sun8i-a33-ga10h-v1.1.dts
new file mode 100644 (file)
index 0000000..8667033
--- /dev/null
@@ -0,0 +1,125 @@
+/*
+ * 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 = "Allwinner GA10H Quad Core Tablet (v1.1)";
+       compatible = "allwinner,ga10h-v1.1", "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>;
+       };
+
+       button@600 {
+               label = "Back";
+               linux,code = <KEY_BACK>;
+               channel = <0>;
+               voltage = <600000>;
+       };
+};
+
+&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";
+};
diff --git a/arch/arm/boot/dts/sun8i-a33-sinlinx-sina33.dts b/arch/arm/boot/dts/sun8i-a33-sinlinx-sina33.dts
new file mode 100644 (file)
index 0000000..5788c29
--- /dev/null
@@ -0,0 +1,129 @@
+/*
+ * 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.
+ */
+
+/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 = "Sinlinx SinA33";
+       compatible = "sinlinx,sina33", "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 = <191011>;
+       };
+
+       button@400 {
+               label = "Volume Down";
+               linux,code = <KEY_VOLUMEDOWN>;
+               channel = <0>;
+               voltage = <391304>;
+       };
+
+       button@600 {
+               label = "Home";
+               linux,code = <KEY_HOME>;
+               channel = <0>;
+               voltage = <600000>;
+       };
+};
+
+&mmc0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_sina33>;
+       vmmc-supply = <&reg_vcc3v0>;
+       bus-width = <4>;
+       cd-gpios = <&pio 1 4 GPIO_ACTIVE_HIGH>; /* PB4 */
+       cd-inverted;
+       status = "okay";
+};
+
+&mmc2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&mmc2_8bit_pins>;
+       vmmc-supply = <&reg_vcc3v0>;
+       bus-width = <8>;
+       non-removable;
+       status = "okay";
+};
+
+&mmc2_8bit_pins {
+       /* eMMC is missing pull-ups */
+       allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+};
+
+&pio {
+       mmc0_cd_pin_sina33: mmc0_cd_pin@0 {
+               allwinner,pins = "PB4";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+       };
+};
+
+&uart0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart0_pins_b>;
+       status = "okay";
+};
diff --git a/arch/arm/boot/dts/sun8i-a33.dtsi b/arch/arm/boot/dts/sun8i-a33.dtsi
new file mode 100644 (file)
index 0000000..85ee080
--- /dev/null
@@ -0,0 +1,97 @@
+/*
+ * 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.
+ */
+
+#include "sun8i-a23-a33.dtsi"
+
+/ {
+       cpus {
+               cpu@2 {
+                       compatible = "arm,cortex-a7";
+                       device_type = "cpu";
+                       reg = <2>;
+               };
+
+               cpu@3 {
+                       compatible = "arm,cortex-a7";
+                       device_type = "cpu";
+                       reg = <3>;
+               };
+       };
+
+       memory {
+               reg = <0x40000000 0x80000000>;
+       };
+
+       clocks {
+               /* Dummy clock for pll11 (DDR1) until actually implemented */
+               pll11: pll11_clk {
+                       #clock-cells = <0>;
+                       compatible = "fixed-clock";
+                       clock-frequency = <0>;
+                       clock-output-names = "pll11";
+               };
+
+               mbus_clk: clk@01c2015c {
+                       #clock-cells = <0>;
+                       compatible = "allwinner,sun8i-a23-mbus-clk";
+                       reg = <0x01c2015c 0x4>;
+                       clocks = <&osc24M>, <&pll6 1>, <&pll5>, <&pll11>;
+                       clock-output-names = "mbus";
+               };
+       };
+};
+
+&pio {
+       compatible = "allwinner,sun8i-a33-pinctrl";
+       interrupts = <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>,
+                    <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>;
+
+       uart0_pins_b: uart0@1 {
+               allwinner,pins = "PB0", "PB1";
+               allwinner,function = "uart0";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+       };
+
+};
diff --git a/arch/arm/boot/dts/sun9i-a80-cubieboard4.dts b/arch/arm/boot/dts/sun9i-a80-cubieboard4.dts
new file mode 100644 (file)
index 0000000..6484dcf
--- /dev/null
@@ -0,0 +1,99 @@
+/*
+ * Copyright 2015 Tyler Baker
+ *
+ * Tyler Baker <tyler.baker@linaro.org>
+ * 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 "sun9i-a80.dtsi"
+#include "sunxi-common-regulators.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/pinctrl/sun4i-a10.h>
+
+/ {
+       model = "Cubietech Cubieboard4";
+       compatible = "cubietech,a80-cubieboard4", "allwinner,sun9i-a80";
+
+       aliases {
+               serial0 = &uart0;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+};
+
+&pio {
+       mmc0_cd_pin_cubieboard4: mmc0_cd_pin@0 {
+               allwinner,pins = "PH18";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+       };
+};
+
+&mmc0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&mmc0_pins>, <&mmc0_cd_pin_cubieboard4>;
+       vmmc-supply = <&reg_vcc3v0>;
+       bus-width = <4>;
+       cd-gpios = <&pio 7 18 GPIO_ACTIVE_HIGH>; /* PH18 */
+       cd-inverted;
+       status = "okay";
+};
+
+&mmc2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&mmc2_8bit_pins>;
+       vmmc-supply = <&reg_vcc3v0>;
+       bus-width = <8>;
+       non-removable;
+       status = "okay";
+};
+
+&uart0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart0_pins_a>;
+       status = "okay";
+};
index a3fed2bdf620328424916c694b6b478de20d9b4f..6ce4b5e8b615a64eb1ade806b4db1a899a095b17 100644 (file)
  *     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 file; 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
@@ -64,7 +59,7 @@
        };
 
        chosen {
-               bootargs = "earlyprintk console=ttyS0,115200";
+               stdout-path = "serial0:115200n8";
        };
 
        leds {
                        gpios = <&pio 7 0 GPIO_ACTIVE_HIGH>;
                };
        };
+
+       reg_usb3_vbus: usb3-vbus {
+               compatible = "regulator-fixed";
+               pinctrl-names = "default";
+               pinctrl-0 = <&usb3_vbus_pin_optimus>;
+               regulator-name = "usb3-vbus";
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;
+               enable-active-high;
+               gpio = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH5 */
+       };
+};
+
+&ehci0 {
+       status = "okay";
+};
+
+&ehci1 {
+       status = "okay";
+};
+
+&ehci2 {
+       status = "okay";
 };
 
 &i2c3 {
        allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
 };
 
+&ohci0 {
+       status = "okay";
+};
+
+&ohci2 {
+       status = "okay";
+};
+
 &pio {
        led_pins_optimus: led-pins@0 {
                allwinner,pins = "PH0", "PH1";
                allwinner,drive = <SUN4I_PINCTRL_10_MA>;
                allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
        };
+
+       usb1_vbus_pin_optimus: usb1_vbus_pin@1 {
+               allwinner,pins = "PH4";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+       };
+
+       usb3_vbus_pin_optimus: usb3_vbus_pin@1 {
+               allwinner,pins = "PH5";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+       };
 };
 
 &mmc0 {
        status = "okay";
 };
 
+&reg_usb1_vbus {
+       pinctrl-0 = <&usb1_vbus_pin_optimus>;
+       gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
+       status = "okay";
+};
+
 &uart0 {
        pinctrl-names = "default";
        pinctrl-0 = <&uart0_pins_a>;
        /* Enable internal pull-up */
        allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
 };
+
+&usbphy1 {
+       phy-supply = <&reg_usb1_vbus>;
+       status = "okay";
+};
+
+&usbphy2 {
+       status = "okay";
+};
+
+&usbphy3 {
+       phy-supply = <&reg_usb3_vbus>;
+       status = "okay";
+};
index f0f6fb91f8c36cc5835be3c5509a4eadc81f200d..a43ad779ee2f68546a26da570f19ba601c2dc15b 100644 (file)
  *     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 file; 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
                reg = <0 0x20000000 0x02 0>;
        };
 
+       timer {
+               compatible = "arm,armv7-timer";
+               interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
+                            <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
+                            <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
+                            <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>;
+               clock-frequency = <24000000>;
+               arm,cpu-registers-not-fw-configured;
+       };
+
        clocks {
                #address-cells = <1>;
                #size-cells = <1>;
                        clock-output-names = "osc32k";
                };
 
+               usb_mod_clk: clk@00a08000 {
+                       #clock-cells = <1>;
+                       #reset-cells = <1>;
+                       compatible = "allwinner,sun9i-a80-usb-mod-clk";
+                       reg = <0x00a08000 0x4>;
+                       clocks = <&ahb1_gates 1>;
+                       clock-output-names = "usb0_ahb", "usb_ohci0",
+                                            "usb1_ahb", "usb_ohci1",
+                                            "usb2_ahb", "usb_ohci2";
+               };
+
+               usb_phy_clk: clk@00a08004 {
+                       #clock-cells = <1>;
+                       #reset-cells = <1>;
+                       compatible = "allwinner,sun9i-a80-usb-phy-clk";
+                       reg = <0x00a08004 0x4>;
+                       clocks = <&ahb1_gates 1>;
+                       clock-output-names = "usb_phy0", "usb_hsic1_480M",
+                                            "usb_phy1", "usb_hsic2_480M",
+                                            "usb_phy2", "usb_hsic_12M";
+               };
+
                pll4: clk@0600000c {
                        #clock-cells = <0>;
                        compatible = "allwinner,sun9i-a80-pll4-clk";
                                        "ahb0_ss", "ahb0_sd", "ahb0_nand1",
                                        "ahb0_nand0", "ahb0_sdram",
                                        "ahb0_mipi_hsi", "ahb0_sata", "ahb0_ts",
-                                       "ahb0_spi0","ahb0_spi1", "ahb0_spi2",
+                                       "ahb0_spi0", "ahb0_spi1", "ahb0_spi2",
                                        "ahb0_spi3";
                };
 
                 */
                ranges = <0 0 0 0x20000000>;
 
+               ehci0: usb@00a00000 {
+                       compatible = "allwinner,sun9i-a80-ehci", "generic-ehci";
+                       reg = <0x00a00000 0x100>;
+                       interrupts = <GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&usb_mod_clk 1>;
+                       resets = <&usb_mod_clk 17>;
+                       phys = <&usbphy1>;
+                       phy-names = "usb";
+                       status = "disabled";
+               };
+
+               ohci0: usb@00a00400 {
+                       compatible = "allwinner,sun9i-a80-ohci", "generic-ohci";
+                       reg = <0x00a00400 0x100>;
+                       interrupts = <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&usb_mod_clk 1>, <&usb_mod_clk 2>;
+                       resets = <&usb_mod_clk 17>;
+                       phys = <&usbphy1>;
+                       phy-names = "usb";
+                       status = "disabled";
+               };
+
+               usbphy1: phy@00a00800 {
+                       compatible = "allwinner,sun9i-a80-usb-phy";
+                       reg = <0x00a00800 0x4>;
+                       clocks = <&usb_phy_clk 1>;
+                       clock-names = "phy";
+                       resets = <&usb_phy_clk 17>;
+                       reset-names = "phy";
+                       status = "disabled";
+                       #phy-cells = <0>;
+               };
+
+               ehci1: usb@00a01000 {
+                       compatible = "allwinner,sun9i-a80-ehci", "generic-ehci";
+                       reg = <0x00a01000 0x100>;
+                       interrupts = <GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&usb_mod_clk 3>;
+                       resets = <&usb_mod_clk 18>;
+                       phys = <&usbphy2>;
+                       phy-names = "usb";
+                       status = "disabled";
+               };
+
+               usbphy2: phy@00a01800 {
+                       compatible = "allwinner,sun9i-a80-usb-phy";
+                       reg = <0x00a01800 0x4>;
+                       clocks = <&usb_phy_clk 2>, <&usb_phy_clk 10>,
+                                <&usb_phy_clk 3>;
+                       clock-names = "hsic_480M", "hsic_12M", "phy";
+                       resets = <&usb_phy_clk 18>, <&usb_phy_clk 19>;
+                       reset-names = "hsic", "phy";
+                       status = "disabled";
+                       #phy-cells = <0>;
+                       /* usb1 is always used with HSIC */
+                       phy_type = "hsic";
+               };
+
+               ehci2: usb@00a02000 {
+                       compatible = "allwinner,sun9i-a80-ehci", "generic-ehci";
+                       reg = <0x00a02000 0x100>;
+                       interrupts = <GIC_SPI 76 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&usb_mod_clk 5>;
+                       resets = <&usb_mod_clk 19>;
+                       phys = <&usbphy3>;
+                       phy-names = "usb";
+                       status = "disabled";
+               };
+
+               ohci2: usb@00a02400 {
+                       compatible = "allwinner,sun9i-a80-ohci", "generic-ohci";
+                       reg = <0x00a02400 0x100>;
+                       interrupts = <GIC_SPI 77 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&usb_mod_clk 5>, <&usb_mod_clk 6>;
+                       resets = <&usb_mod_clk 19>;
+                       phys = <&usbphy3>;
+                       phy-names = "usb";
+                       status = "disabled";
+               };
+
+               usbphy3: phy@00a02800 {
+                       compatible = "allwinner,sun9i-a80-usb-phy";
+                       reg = <0x00a02800 0x4>;
+                       clocks = <&usb_phy_clk 4>, <&usb_phy_clk 10>,
+                                <&usb_phy_clk 5>;
+                       clock-names = "hsic_480M", "hsic_12M", "phy";
+                       resets = <&usb_phy_clk 20>, <&usb_phy_clk 21>;
+                       reset-names = "hsic", "phy";
+                       status = "disabled";
+                       #phy-cells = <0>;
+               };
+
                mmc0: mmc@01c0f000 {
                        compatible = "allwinner,sun5i-a13-mmc";
                        reg = <0x01c0f000 0x1000>;
                        reset-names = "ahb";
                        interrupts = <GIC_SPI 60 IRQ_TYPE_LEVEL_HIGH>;
                        status = "disabled";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
                };
 
                mmc1: mmc@01c10000 {
                        reset-names = "ahb";
                        interrupts = <GIC_SPI 61 IRQ_TYPE_LEVEL_HIGH>;
                        status = "disabled";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
                };
 
                mmc2: mmc@01c11000 {
                        reset-names = "ahb";
                        interrupts = <GIC_SPI 62 IRQ_TYPE_LEVEL_HIGH>;
                        status = "disabled";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
                };
 
                mmc3: mmc@01c12000 {
                        reset-names = "ahb";
                        interrupts = <GIC_SPI 63 IRQ_TYPE_LEVEL_HIGH>;
                        status = "disabled";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
                };
 
                mmc_config_clk: clk@01c13000 {
                        clocks = <&osc24M>;
                };
 
+               wdt: watchdog@06000ca0 {
+                       compatible = "allwinner,sun6i-a31-wdt";
+                       reg = <0x06000ca0 0x20>;
+                       interrupts = <GIC_SPI 24 IRQ_TYPE_LEVEL_HIGH>;
+               };
+
                pio: pinctrl@06000800 {
                        compatible = "allwinner,sun9i-a80-pinctrl";
                        reg = <0x06000800 0x400>;
index e02baa66b33c610a7515c61de1edf2362f0033f3..51cc8383f70f5d82fee3ca750d6c15b18b1bacbc 100644 (file)
  *     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 file; 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
index ed8a8acd3d34b44d9e63afedf6f6a88e541e96d5..bd43ed6d6ec7c02296a3deac796a443511340476 100644 (file)
                target-12v-supply = <&vdd_12v0_sata>;
        };
 
+       hda@0,70030000 {
+               status = "okay";
+       };
+
        padctl@0,7009f000 {
                pinctrl-0 = <&padctl_default>;
                pinctrl-names = "default";
index 5c3f7813360d2a59bffcc463f059b2047440fabf..79e724bb7df78b1c11e42b5e7648c5f64254df41 100644 (file)
        sdhci@0,700b0600 {
                status = "okay";
                bus-width = <8>;
+               non-removable;
        };
 
        ahub@0,70300000 {
                        compatible = "regulator-fixed";
                        reg = <5>;
                        regulator-name = "+VDD_LED";
+                       regulator-min-microvolt = <3300000>;
+                       regulator-max-microvolt = <3300000>;
                        gpio = <&gpio TEGRA_GPIO(P, 2) GPIO_ACTIVE_HIGH>;
                        enable-active-high;
                        vin-supply = <&vdd_mux>;
index 13cc7ca5e031e5f1814697e8ead9546079f6d04e..01a9f742b08f4fe2bf3a4184dbf34dd46dd7ccf9 100644 (file)
        apbmisc@0,70000800 {
                compatible = "nvidia,tegra124-apbmisc", "nvidia,tegra20-apbmisc";
                reg = <0x0 0x70000800 0x0 0x64>,   /* Chip revision */
-                     <0x0 0x7000E864 0x0 0x04>;   /* Strapping options */
+                     <0x0 0x7000e864 0x0 0x04>;   /* Strapping options */
        };
 
        pinmux: pinmux@0,70000868 {
                clocks = <&tegra_car TEGRA124_CLK_HDA>,
                         <&tegra_car TEGRA124_CLK_HDA2HDMI>,
                         <&tegra_car TEGRA124_CLK_HDA2CODEC_2X>;
-               clock-names = "hda", "hda2hdmi", "hdacodec_2x";
+               clock-names = "hda", "hda2hdmi", "hda2codec_2x";
                resets = <&tegra_car 125>, /* hda */
                         <&tegra_car 128>, /* hda2hdmi */
                         <&tegra_car 111>; /* hda2codec_2x */
-               reset-names = "hda", "hda2hdmi", "hdacodec_2x";
+               reset-names = "hda", "hda2hdmi", "hda2codec_2x";
                status = "disabled";
        };
 
index e2fed27122497b6f330904f43de95739b6cbe6cb..aea8994b35f27db74aff4f4c33fe0c6b77aabadd 100644 (file)
@@ -31,6 +31,7 @@
 
                        vdd-supply = <&hdmi_vdd_reg>;
                        pll-supply = <&hdmi_pll_reg>;
+                       hdmi-supply = <&vdd_hdmi>;
 
                        nvidia,ddc-i2c-bus = <&hdmi_ddc>;
                        nvidia,hpd-gpio = <&gpio TEGRA_GPIO(N, 7)
                        gpio = <&gpio TEGRA_GPIO(W, 0) GPIO_ACTIVE_HIGH>;
                        enable-active-high;
                };
+
+               vdd_hdmi: regulator@6 {
+                       compatible = "regulator-fixed";
+                       reg = <6>;
+                       regulator-name = "VDDIO_HDMI";
+                       regulator-min-microvolt = <5000000>;
+                       regulator-max-microvolt = <5000000>;
+                       gpio = <&gpio TEGRA_GPIO(V, 5) GPIO_ACTIVE_HIGH>;
+                       enable-active-high;
+                       vin-supply = <&vdd_5v0_reg>;
+               };
        };
 
        sound {
index adf6b048d0bb52b5355f26eb06f79212a2e34cde..f444b67f55c6becc04f33b2748ba5f28eb994d6c 100644 (file)
 
        fuse@7000f800 {
                compatible = "nvidia,tegra20-efuse";
-               reg = <0x7000F800 0x400>;
+               reg = <0x7000f800 0x400>;
                clocks = <&tegra_car TEGRA20_CLK_FUSE>;
                clock-names = "fuse";
                resets = <&tegra_car 39>;
index a1b682ea01bd70ab94025cd12a4d5205d45f9db7..bb1ca158273c8f90d43d8e9833f4d4e76d5ac510 100644 (file)
@@ -1,3 +1,4 @@
+#include <dt-bindings/input/input.h>
 #include "tegra30.dtsi"
 
 /**
@@ -12,7 +13,7 @@
  * tegra30-cardhu-a04.dts.
  * The identification of board is done in two ways, by looking the sticker
  * on PCB and by reading board id eeprom.
- * The stciker will have number like 600-81291-1000-002 C.3. In this 4th
+ * The sticker will have number like 600-81291-1000-002 C.3. In this 4th
  * number is the fab version like here it is 002 and hence fab version A02.
  * The (downstream internal) U-Boot of Cardhu display the board-id as
  * follows:
                         <&tegra_car TEGRA30_CLK_EXTERN1>;
                clock-names = "pll_a", "pll_a_out0", "mclk";
        };
+
+       gpio-keys {
+               compatible = "gpio-keys";
+
+               power {
+                       label = "Power";
+                       interrupt-parent = <&pmic>;
+                       interrupts = <2 0>;
+                       linux,code = <KEY_POWER>;
+                       debounce-interval = <100>;
+                       gpio-key,wakeup;
+               };
+
+               volume-down {
+                       label = "Volume Down";
+                       gpios = <&gpio TEGRA_GPIO(R, 0) GPIO_ACTIVE_LOW>;
+                       linux,code = <KEY_VOLUMEDOWN>;
+                       debounce-interval = <10>;
+               };
+
+               volume-up {
+                       label = "Volume Up";
+                       gpios = <&gpio TEGRA_GPIO(R, 1) GPIO_ACTIVE_LOW>;
+                       linux,code = <KEY_VOLUMEUP>;
+                       debounce-interval = <10>;
+               };
+       };
 };
index 60e205a0f63d99640798938fcf06c55bf86980b1..782b11b2af6aa53470afed4f2432ce9f00a22c03 100644 (file)
                reset-names = "fuse";
        };
 
+       hda@70030000 {
+               compatible = "nvidia,tegra30-hda";
+               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_HDA2CODEC_2X>;
+               clock-names = "hda", "hda2hdmi", "hda2codec_2x";
+               resets = <&tegra_car 125>, /* hda */
+                        <&tegra_car 128>, /* hda2hdmi */
+                        <&tegra_car 111>; /* hda2codec_2x */
+               reset-names = "hda", "hda2hdmi", "hda2codec_2x";
+               status = "disabled";
+       };
+
        ahub@70080000 {
                compatible = "nvidia,tegra30-ahub";
                reg = <0x70080000 0x200
diff --git a/arch/arm/boot/dts/uniphier-ph1-ld4-ref.dts b/arch/arm/boot/dts/uniphier-ph1-ld4-ref.dts
new file mode 100644 (file)
index 0000000..200b0c9
--- /dev/null
@@ -0,0 +1,79 @@
+/*
+ * Device Tree Source for UniPhier PH1-LD4 Reference 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-ph1-ld4.dtsi"
+/include/ "uniphier-support-card.dtsi"
+
+/ {
+       model = "UniPhier PH1-LD4 Reference Board";
+       compatible = "socionext,ph1-ld4-ref", "socionext,ph1-ld4";
+
+       memory {
+               device_type = "memory";
+               reg = <0x80000000 0x20000000>;
+       };
+
+       chosen {
+               bootargs = "console=ttyS0,115200";
+               stdout-path = &serialsc;
+       };
+
+       aliases {
+               serial0 = &serialsc;
+       };
+};
+
+&extbus {
+       ranges = <0 0x00000000 0x0f000000 0x01000000
+                 1 0x00000000 0x00000000 0x08000000>;
+};
+
+&support_card {
+       ranges = <0x00000000 1 0x03f00000 0x00100000>;
+};
+
+&serialsc {
+       interrupts = <0 49 4>;
+};
diff --git a/arch/arm/boot/dts/uniphier-ph1-ld4.dtsi b/arch/arm/boot/dts/uniphier-ph1-ld4.dtsi
new file mode 100644 (file)
index 0000000..6a34c56
--- /dev/null
@@ -0,0 +1,110 @@
+/*
+ * Device Tree Source for UniPhier PH1-LD4 SoC
+ *
+ * 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.
+ */
+
+/include/ "skeleton.dtsi"
+
+/ {
+       compatible = "socionext,ph1-ld4";
+
+       cpus {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               cpu@0 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a9";
+                       reg = <0>;
+               };
+       };
+
+       clocks {
+               arm_timer_clk: arm_timer_clk {
+                       #clock-cells = <0>;
+                       compatible = "fixed-clock";
+                       clock-frequency = <50000000>;
+               };
+       };
+
+       soc {
+               compatible = "simple-bus";
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges;
+               interrupt-parent = <&intc>;
+
+               extbus: extbus {
+                       compatible = "simple-bus";
+                       #address-cells = <2>;
+                       #size-cells = <1>;
+               };
+
+               system-bus-controller-misc@59800000 {
+                       compatible = "socionext,uniphier-system-bus-controller-misc",
+                                    "syscon";
+                       reg = <0x59800000 0x2000>;
+               };
+
+               timer@60000200 {
+                       compatible = "arm,cortex-a9-global-timer";
+                       reg = <0x60000200 0x20>;
+                       interrupts = <1 11 0x104>;
+                       clocks = <&arm_timer_clk>;
+               };
+
+               timer@60000600 {
+                       compatible = "arm,cortex-a9-twd-timer";
+                       reg = <0x60000600 0x20>;
+                       interrupts = <1 13 0x104>;
+                       clocks = <&arm_timer_clk>;
+               };
+
+               intc: interrupt-controller@60001000 {
+                       compatible = "arm,cortex-a9-gic";
+                       #interrupt-cells = <3>;
+                       interrupt-controller;
+                       reg = <0x60001000 0x1000>,
+                             <0x60000100 0x100>;
+               };
+       };
+};
diff --git a/arch/arm/boot/dts/uniphier-ph1-pro4-ref.dts b/arch/arm/boot/dts/uniphier-ph1-pro4-ref.dts
new file mode 100644 (file)
index 0000000..d891135
--- /dev/null
@@ -0,0 +1,79 @@
+/*
+ * Device Tree Source for UniPhier PH1-Pro4 Reference 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-ph1-pro4.dtsi"
+/include/ "uniphier-support-card.dtsi"
+
+/ {
+       model = "UniPhier PH1-Pro4 Reference Board";
+       compatible = "socionext,ph1-pro4-ref", "socionext,ph1-pro4";
+
+       memory {
+               device_type = "memory";
+               reg = <0x80000000 0x40000000>;
+       };
+
+       chosen {
+               bootargs = "console=ttyS0,115200";
+               stdout-path = &serialsc;
+       };
+
+       aliases {
+               serial0 = &serialsc;
+       };
+};
+
+&extbus {
+       ranges = <0 0x00000000 0x0f000000 0x01000000
+                 1 0x00000000 0x00000000 0x08000000>;
+};
+
+&support_card {
+       ranges = <0x00000000 1 0x03f00000 0x00100000>;
+};
+
+&serialsc {
+       interrupts = <0 50 4>;
+};
diff --git a/arch/arm/boot/dts/uniphier-ph1-pro4.dtsi b/arch/arm/boot/dts/uniphier-ph1-pro4.dtsi
new file mode 100644 (file)
index 0000000..dc63360
--- /dev/null
@@ -0,0 +1,117 @@
+/*
+ * Device Tree Source for UniPhier PH1-Pro4 SoC
+ *
+ * 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.
+ */
+
+/include/ "skeleton.dtsi"
+
+/ {
+       compatible = "socionext,ph1-pro4";
+
+       cpus {
+               #address-cells = <1>;
+               #size-cells = <0>;
+               enable-method = "socionext,uniphier-smp";
+
+               cpu@0 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a9";
+                       reg = <0>;
+               };
+
+               cpu@1 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a9";
+                       reg = <1>;
+               };
+       };
+
+       clocks {
+               arm_timer_clk: arm_timer_clk {
+                       #clock-cells = <0>;
+                       compatible = "fixed-clock";
+                       clock-frequency = <50000000>;
+               };
+       };
+
+       soc {
+               compatible = "simple-bus";
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges;
+               interrupt-parent = <&intc>;
+
+               extbus: extbus {
+                       compatible = "simple-bus";
+                       #address-cells = <2>;
+                       #size-cells = <1>;
+               };
+
+               system-bus-controller-misc@59800000 {
+                       compatible = "socionext,uniphier-system-bus-controller-misc",
+                                    "syscon";
+                       reg = <0x59800000 0x2000>;
+               };
+
+               timer@60000200 {
+                       compatible = "arm,cortex-a9-global-timer";
+                       reg = <0x60000200 0x20>;
+                       interrupts = <1 11 0x304>;
+                       clocks = <&arm_timer_clk>;
+               };
+
+               timer@60000600 {
+                       compatible = "arm,cortex-a9-twd-timer";
+                       reg = <0x60000600 0x20>;
+                       interrupts = <1 13 0x304>;
+                       clocks = <&arm_timer_clk>;
+               };
+
+               intc: interrupt-controller@60001000 {
+                       compatible = "arm,cortex-a9-gic";
+                       #interrupt-cells = <3>;
+                       interrupt-controller;
+                       reg = <0x60001000 0x1000>,
+                             <0x60000100 0x100>;
+               };
+       };
+};
diff --git a/arch/arm/boot/dts/uniphier-ph1-sld3-ref.dts b/arch/arm/boot/dts/uniphier-ph1-sld3-ref.dts
new file mode 100644 (file)
index 0000000..3ea64ae
--- /dev/null
@@ -0,0 +1,80 @@
+/*
+ * Device Tree Source for UniPhier PH1-sLD3 Reference 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-ph1-sld3.dtsi"
+/include/ "uniphier-support-card.dtsi"
+
+/ {
+       model = "UniPhier PH1-sLD3 Reference Board";
+       compatible = "socionext,ph1-sld3-ref", "socionext,ph1-sld3";
+
+       memory {
+               device_type = "memory";
+               reg = <0x80000000 0x20000000
+                      0xc0000000 0x20000000>;
+       };
+
+       chosen {
+               bootargs = "console=ttyS0,115200";
+               stdout-path = &serialsc;
+       };
+
+       aliases {
+               serial0 = &serialsc;
+       };
+};
+
+&extbus {
+       ranges = <0 0x00000000 0x0f000000 0x01000000
+                 1 0x00000000 0x00000000 0x08000000>;
+};
+
+&support_card {
+       ranges = <0x00000000 1 0x03f00000 0x00100000>;
+};
+
+&serialsc {
+       interrupts = <0 49 4>;
+};
diff --git a/arch/arm/boot/dts/uniphier-ph1-sld3.dtsi b/arch/arm/boot/dts/uniphier-ph1-sld3.dtsi
new file mode 100644 (file)
index 0000000..248b188
--- /dev/null
@@ -0,0 +1,117 @@
+/*
+ * Device Tree Source for UniPhier PH1-sLD3 SoC
+ *
+ * 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.
+ */
+
+/include/ "skeleton.dtsi"
+
+/ {
+       compatible = "socionext,ph1-sld3";
+
+       cpus {
+               #address-cells = <1>;
+               #size-cells = <0>;
+               enable-method = "socionext,uniphier-smp";
+
+               cpu@0 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a9";
+                       reg = <0>;
+               };
+
+               cpu@1 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a9";
+                       reg = <1>;
+               };
+       };
+
+       clocks {
+               arm_timer_clk: arm_timer_clk {
+                       #clock-cells = <0>;
+                       compatible = "fixed-clock";
+                       clock-frequency = <50000000>;
+               };
+       };
+
+       soc {
+               compatible = "simple-bus";
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges;
+               interrupt-parent = <&intc>;
+
+               extbus: extbus {
+                       compatible = "simple-bus";
+                       #address-cells = <2>;
+                       #size-cells = <1>;
+               };
+
+               timer@20000200 {
+                       compatible = "arm,cortex-a9-global-timer";
+                       reg = <0x20000200 0x20>;
+                       interrupts = <1 11 0x304>;
+                       clocks = <&arm_timer_clk>;
+               };
+
+               timer@20000600 {
+                       compatible = "arm,cortex-a9-twd-timer";
+                       reg = <0x20000600 0x20>;
+                       interrupts = <1 13 0x304>;
+                       clocks = <&arm_timer_clk>;
+               };
+
+               intc: interrupt-controller@20001000 {
+                       compatible = "arm,cortex-a9-gic";
+                       #interrupt-cells = <3>;
+                       interrupt-controller;
+                       reg = <0x20001000 0x1000>,
+                             <0x20000100 0x100>;
+               };
+
+               system-bus-controller-misc@59800000 {
+                       compatible = "socionext,uniphier-system-bus-controller-misc",
+                                    "syscon";
+                       reg = <0x59800000 0x2000>;
+               };
+       };
+};
diff --git a/arch/arm/boot/dts/uniphier-ph1-sld8-ref.dts b/arch/arm/boot/dts/uniphier-ph1-sld8-ref.dts
new file mode 100644 (file)
index 0000000..dcdc4f7
--- /dev/null
@@ -0,0 +1,79 @@
+/*
+ * Device Tree Source for UniPhier PH1-sLD8 Reference 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-ph1-sld8.dtsi"
+/include/ "uniphier-support-card.dtsi"
+
+/ {
+       model = "UniPhier PH1-sLD8 Reference Board";
+       compatible = "socionext,ph1-sld8-ref", "socionext,ph1-sld8";
+
+       memory {
+               device_type = "memory";
+               reg = <0x80000000 0x20000000>;
+       };
+
+       chosen {
+               bootargs = "console=ttyS0,115200";
+               stdout-path = &serialsc;
+       };
+
+       aliases {
+               serial0 = &serialsc;
+       };
+};
+
+&extbus {
+       ranges = <0 0x00000000 0x0f000000 0x01000000
+                 1 0x00000000 0x00000000 0x08000000>;
+};
+
+&support_card {
+       ranges = <0x00000000 1 0x03f00000 0x00100000>;
+};
+
+&serialsc {
+       interrupts = <0 48 4>;
+};
diff --git a/arch/arm/boot/dts/uniphier-ph1-sld8.dtsi b/arch/arm/boot/dts/uniphier-ph1-sld8.dtsi
new file mode 100644 (file)
index 0000000..baa71e1
--- /dev/null
@@ -0,0 +1,110 @@
+/*
+ * Device Tree Source for UniPhier PH1-sLD8 SoC
+ *
+ * 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.
+ */
+
+/include/ "skeleton.dtsi"
+
+/ {
+       compatible = "socionext,ph1-sld8";
+
+       cpus {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               cpu@0 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a9";
+                       reg = <0>;
+               };
+       };
+
+       clocks {
+               arm_timer_clk: arm_timer_clk {
+                       #clock-cells = <0>;
+                       compatible = "fixed-clock";
+                       clock-frequency = <50000000>;
+               };
+       };
+
+       soc {
+               compatible = "simple-bus";
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges;
+               interrupt-parent = <&intc>;
+
+               extbus: extbus {
+                       compatible = "simple-bus";
+                       #address-cells = <2>;
+                       #size-cells = <1>;
+               };
+
+               system-bus-controller-misc@59800000 {
+                       compatible = "socionext,uniphier-system-bus-controller-misc",
+                                    "syscon";
+                       reg = <0x59800000 0x2000>;
+               };
+
+               timer@60000200 {
+                       compatible = "arm,cortex-a9-global-timer";
+                       reg = <0x60000200 0x20>;
+                       interrupts = <1 11 0x104>;
+                       clocks = <&arm_timer_clk>;
+               };
+
+               timer@60000600 {
+                       compatible = "arm,cortex-a9-twd-timer";
+                       reg = <0x60000600 0x20>;
+                       interrupts = <1 13 0x104>;
+                       clocks = <&arm_timer_clk>;
+               };
+
+               intc: interrupt-controller@60001000 {
+                       compatible = "arm,cortex-a9-gic";
+                       #interrupt-cells = <3>;
+                       interrupt-controller;
+                       reg = <0x60001000 0x1000>,
+                             <0x60000100 0x100>;
+               };
+       };
+};
diff --git a/arch/arm/boot/dts/uniphier-support-card.dtsi b/arch/arm/boot/dts/uniphier-support-card.dtsi
new file mode 100644 (file)
index 0000000..da271e3
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ * Device Tree Source for UniPhier Support Card (Expansion 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.
+ */
+
+&extbus {
+       support_card: support_card {
+               compatible = "simple-bus";
+               #address-cells = <1>;
+               #size-cells = <1>;
+
+               ethsc: ethernet@00000000 {
+                       compatible = "smsc,lan9118", "smsc,lan9115";
+                       reg = <0x00000000 0x1000>;
+                       phy-mode = "mii";
+                       reg-io-width = <4>;
+               };
+
+               serialsc: uart@000b0000 {
+                       compatible = "ns16550a";
+                       reg = <0x000b0000 0x20>;
+                       clock-frequency = <12288000>;
+                       reg-shift = <1>;
+               };
+       };
+};
index fbef0828e9303ca54d3a2304b0d4b2cf26bea417..68ca125b56ea2f9db1642e05ef75f1e6534625f2 100644 (file)
                                VF610_PAD_PTC9__ENET_RMII1_MDC          0x30d2
                                VF610_PAD_PTC10__ENET_RMII1_MDIO        0x30d3
                                VF610_PAD_PTC11__ENET_RMII1_CRS         0x30d1
-                               VF610_PAD_PTC12__ENET_RMII_RXD1         0x30d1
+                               VF610_PAD_PTC12__ENET_RMII1_RXD1        0x30d1
                                VF610_PAD_PTC13__ENET_RMII1_RXD0        0x30d1
                                VF610_PAD_PTC14__ENET_RMII1_RXER        0x30d1
                                VF610_PAD_PTC15__ENET_RMII1_TXD1        0x30d2
index fd8758b639f5a0c01e252a56772402472e67b04b..5447f2594659906a126248a64b7842ae902765f2 100644 (file)
@@ -68,7 +68,7 @@
                                VF610_PAD_PTC9__ENET_RMII1_MDC          0x30d2
                                VF610_PAD_PTC10__ENET_RMII1_MDIO        0x30d3
                                VF610_PAD_PTC11__ENET_RMII1_CRS         0x30d1
-                               VF610_PAD_PTC12__ENET_RMII_RXD1         0x30d1
+                               VF610_PAD_PTC12__ENET_RMII1_RXD1        0x30d1
                                VF610_PAD_PTC13__ENET_RMII1_RXD0        0x30d1
                                VF610_PAD_PTC14__ENET_RMII1_RXER        0x30d1
                                VF610_PAD_PTC15__ENET_RMII1_TXD1        0x30d2
index 1ee681f7ce2fb2456127662eaba5f5864cd9e4eb..fcad7132c871f01e98a3a46dd66536f7945eaf75 100644 (file)
 #define VF610_PAD_PTC11__MLB_DATA              0x0E0 0x358 ALT6 0x1
 #define VF610_PAD_PTC11__DEBUG_OUT             0x0E0 0x000 ALT7 0x0
 #define VF610_PAD_PTC12__GPIO_57               0x0E4 0x000 ALT0 0x0
-#define VF610_PAD_PTC12__ENET_RMII_RXD1                0x0E4 0x000 ALT1 0x0
+#define VF610_PAD_PTC12__ENET_RMII1_RXD1       0x0E4 0x000 ALT1 0x0
 #define VF610_PAD_PTC12__ESAI_SDO1             0x0E4 0x318 ALT3 0x1
 #define VF610_PAD_PTC12__SAI2_TX_BCLK          0x0E4 0x370 ALT5 0x1
 #define VF610_PAD_PTC12__DEBUG_OUT3            0x0E4 0x000 ALT7 0x0
index f64fddce3e2ae0d757027e3e7eb358bb4fb2765b..375ab23ca7438049bac8c46022dceed27a17e25f 100644 (file)
                                VF610_PAD_PTC9__ENET_RMII1_MDC          0x30d2
                                VF610_PAD_PTC10__ENET_RMII1_MDIO        0x30d3
                                VF610_PAD_PTC11__ENET_RMII1_CRS         0x30d1
-                               VF610_PAD_PTC12__ENET_RMII_RXD1         0x30d1
+                               VF610_PAD_PTC12__ENET_RMII1_RXD1        0x30d1
                                VF610_PAD_PTC13__ENET_RMII1_RXD0        0x30d1
                                VF610_PAD_PTC14__ENET_RMII1_RXER        0x30d1
                                VF610_PAD_PTC15__ENET_RMII1_TXD1        0x30d2
diff --git a/arch/arm/boot/dts/vf610m4-colibri.dts b/arch/arm/boot/dts/vf610m4-colibri.dts
new file mode 100644 (file)
index 0000000..2931a80
--- /dev/null
@@ -0,0 +1,99 @@
+/*
+ * Device tree for Colibri VF61 Cortex-M4 support
+ *
+ * Copyright (C) 2015 Stefan Agner
+ *
+ * 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 , 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 "vf610m4.dtsi"
+
+/ {
+       model = "VF610 Cortex-M4";
+       compatible = "fsl,vf610m4";
+
+       chosen {
+               bootargs = "console=ttyLP2,115200 clk_ignore_unused init=/linuxrc rw";
+               linux,stdout-path = "&uart2";
+       };
+
+       memory {
+               reg = <0x8c000000 0x3000000>;
+       };
+};
+
+&gpio0 {
+       status = "disabled";
+};
+
+&gpio1 {
+       status = "disabled";
+};
+
+&gpio2 {
+       status = "disabled";
+};
+
+&gpio3 {
+       status = "disabled";
+};
+
+&gpio4 {
+       status = "disabled";
+};
+
+&uart2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_uart2>;
+       status = "okay";
+};
+
+&iomuxc {
+       vf610-colibri {
+               pinctrl_uart2: uart2grp {
+                       fsl,pins = <
+                               VF610_PAD_PTD0__UART2_TX                0x21a2
+                               VF610_PAD_PTD1__UART2_RX                0x21a1
+                               VF610_PAD_PTD2__UART2_RTS               0x21a2
+                               VF610_PAD_PTD3__UART2_CTS               0x21a1
+                       >;
+               };
+       };
+};
diff --git a/arch/arm/boot/dts/vf610m4.dtsi b/arch/arm/boot/dts/vf610m4.dtsi
new file mode 100644 (file)
index 0000000..9ffe2eb
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * Device tree for VF6xx Cortex-M4 support
+ *
+ * Copyright (C) 2015 Stefan Agner
+ *
+ * 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 , 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 "armv7-m.dtsi"
+#include "vfxxx.dtsi"
+
+&mscm_ir {
+       interrupt-parent = <&nvic>;
+};
diff --git a/arch/arm/boot/dts/zx296702-ad1.dts b/arch/arm/boot/dts/zx296702-ad1.dts
new file mode 100644 (file)
index 0000000..081f980
--- /dev/null
@@ -0,0 +1,48 @@
+
+/dts-v1/;
+
+#include "zx296702.dtsi"
+
+/ {
+       model = "ZTE ZX296702 AD1 Board";
+       compatible = "zte,zx296702-ad1", "zte,zx296702";
+
+       aliases {
+               serial0 = &uart0;
+               serial1 = &uart1;
+       };
+
+       memory {
+               reg = <0x50000000 0x20000000>;
+       };
+};
+
+&mmc0 {
+       num-slots = <1>;
+       supports-highspeed;
+       non-removable;
+       disable-wp;
+       status = "okay";
+
+       slot@0 {
+               reg = <0>;
+               bus-width = <4>;
+       };
+};
+
+&mmc1 {
+       num-slots = <1>;
+       supports-highspeed;
+       non-removable;
+       disable-wp;
+       status = "okay";
+
+       slot@0 {
+               reg = <0>;
+               bus-width = <8>;
+       };
+};
+
+&uart0 {
+       status = "okay";
+};
diff --git a/arch/arm/boot/dts/zx296702.dtsi b/arch/arm/boot/dts/zx296702.dtsi
new file mode 100644 (file)
index 0000000..d45c8fc
--- /dev/null
@@ -0,0 +1,139 @@
+
+#include "skeleton.dtsi"
+#include <dt-bindings/clock/zx296702-clock.h>
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+
+/ {
+       cpus {
+               #address-cells = <1>;
+               #size-cells = <0>;
+               enable-method = "zte,zx296702-smp";
+
+               cpu@0 {
+                       compatible = "arm,cortex-a9";
+                       device_type = "cpu";
+                       next-level-cache = <&l2cc>;
+                       reg = <0>;
+               };
+
+               cpu@1 {
+                       compatible = "arm,cortex-a9";
+                       device_type = "cpu";
+                       next-level-cache = <&l2cc>;
+                       reg = <1>;
+               };
+       };
+
+
+       soc {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "simple-bus";
+               interrupt-parent = <&intc>;
+               ranges;
+
+               matrix: bus-matrix@400000 {
+                       compatible = "zte,zx-bus-matrix";
+                       reg = <0x00400000 0x1000>;
+               };
+
+               intc: interrupt-controller@00801000 {
+                       compatible = "arm,cortex-a9-gic";
+                       #interrupt-cells = <3>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       interrupt-controller;
+                       reg = <0x00801000 0x1000>,
+                             <0x00800100 0x100>;
+               };
+
+               global_timer: timer@008000200 {
+                       compatible = "arm,cortex-a9-global-timer";
+                       reg = <0x00800200 0x20>;
+                       interrupts = <GIC_PPI 11 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-parent = <&intc>;
+                       clocks = <&topclk ZX296702_A9_PERIPHCLK>;
+               };
+
+               l2cc: l2-cache-controller@0x00c00000 {
+                       compatible = "arm,pl310-cache";
+                       reg = <0x00c00000 0x1000>;
+                       cache-unified;
+                       cache-level = <2>;
+                       arm,data-latency = <1 1 1>;
+                       arm,tag-latency = <1 1 1>;
+                       arm,double-linefill = <1>;
+                       arm,double-linefill-incr = <0>;
+               };
+
+               pcu: pcu@0xa0008000 {
+                       compatible = "zte,zx296702-pcu";
+                       reg = <0xa0008000 0x1000>;
+               };
+
+               topclk: topclk@0x09800000 {
+                       compatible = "zte,zx296702-topcrm-clk";
+                       reg = <0x09800000 0x1000>;
+                       #clock-cells = <1>;
+               };
+
+               lsp1clk: lsp1clk@0x09400000 {
+                       compatible = "zte,zx296702-lsp1crpm-clk";
+                       reg = <0x09400000 0x1000>;
+                       #clock-cells = <1>;
+               };
+
+               lsp0clk: lsp0clk@0x0b000000 {
+                       compatible = "zte,zx296702-lsp0crpm-clk";
+                       reg = <0x0b000000 0x1000>;
+                       #clock-cells = <1>;
+               };
+
+               uart0: serial@0x09405000 {
+                       compatible = "zte,zx296702-uart";
+                       reg = <0x09405000 0x1000>;
+                       interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&lsp1clk ZX296702_UART0_WCLK>;
+                       status = "disabled";
+               };
+
+               uart1: serial@0x09406000 {
+                       compatible = "zte,zx296702-uart";
+                       reg = <0x09406000 0x1000>;
+                       interrupts = <GIC_SPI 38 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&lsp1clk ZX296702_UART1_WCLK>;
+                       status = "disabled";
+               };
+
+               mmc0: mmc@0x09408000 {
+                       compatible = "snps,dw-mshc";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <0x09408000 0x1000>;
+                       interrupts = <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>;
+                       fifo-depth = <32>;
+                       clocks = <&lsp1clk ZX296702_SDMMC0_PCLK>,
+                                <&lsp1clk ZX296702_SDMMC0_WCLK>;
+                       clock-names = "biu", "ciu";
+                       status = "disabled";
+               };
+
+               mmc1: mmc@0x0b003000 {
+                       compatible = "snps,dw-mshc";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <0x0b003000 0x1000>;
+                       interrupts = <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>;
+                       fifo-depth = <32>;
+                       clocks = <&lsp0clk ZX296702_SDMMC1_PCLK>,
+                                <&lsp0clk ZX296702_SDMMC1_WCLK>;
+                       clock-names = "biu", "ciu";
+                       status = "disabled";
+               };
+
+               sysctrl: sysctrl@0xa0007000 {
+                       compatible = "zte,sysctrl", "syscon";
+                       reg = <0xa0007000 0x1000>;
+               };
+       };
+};
index 9ea54b3dba09b7de9be7936ae0a755c4ed115a97..06915080b875dd34b163859cb71c5bc0925de373 100644 (file)
                };
 
                gem0: ethernet@e000b000 {
-                       compatible = "cdns,zynq-gem";
+                       compatible = "cdns,zynq-gem", "cdns,gem";
                        reg = <0xe000b000 0x1000>;
                        status = "disabled";
                        interrupts = <0 22 4>;
                };
 
                gem1: ethernet@e000c000 {
-                       compatible = "cdns,zynq-gem";
+                       compatible = "cdns,zynq-gem", "cdns,gem";
                        reg = <0xe000c000 0x1000>;
                        status = "disabled";
                        interrupts = <0 45 4>;
index 174571232ea5e1bdad51daf3a068187de054c331..9efd16cb2859dbb25a40851516dc377a540e8edd 100644 (file)
        model = "Adapteva Parallella Board";
        compatible = "adapteva,parallella", "xlnx,zynq-7000";
 
+       aliases {
+               ethernet0 = &gem0;
+               serial0 = &uart1;
+       };
+
        memory {
                device_type = "memory";
                reg = <0x0 0x40000000>;
        };
 
        chosen {
-               bootargs = "console=ttyPS0,115200 earlyprintk root=/dev/mmcblk0p2 rootfstype=ext4 rw rootwait";
-               linux,stdout-path = "/amba/serial@e0001000";
+               bootargs = "earlyprintk root=/dev/mmcblk0p2 rootfstype=ext4 rw rootwait";
+               stdout-path = "serial0:115200n8";
        };
 };
 
index 1fc1d3911e9bd4180442ef6d969a222367000bb7..fb59d34e8ee6868799130f36e2d029c86e576277 100644 (file)
@@ -30,7 +30,8 @@
        };
 
        chosen {
-               bootargs = "console=ttyPS0,115200 earlyprintk";
+               bootargs = "earlyprintk";
+               stdout-path = "serial0:115200n8";
        };
 
        leds {
index 850518d9b8ac33eebd8edc82ba4fcd00879a1a6e..abf5d238ae04aa6224d5da7e0d83f67f640ec6df 100644 (file)
@@ -30,7 +30,8 @@
        };
 
        chosen {
-               bootargs = "console=ttyPS0,115200 earlyprintk";
+               bootargs = "earlyprintk";
+               stdout-path = "serial0:115200n8";
        };
 
        usb_phy0: phy0 {
index 5658bc8434de9abdd514d22f350e9f014ac7c6fc..b9f2522012e8ce180b445f0d31929f32baf9be0a 100644 (file)
@@ -29,7 +29,8 @@
        };
 
        chosen {
-               bootargs = "console=ttyPS0,115200 earlyprintk";
+               bootargs = "earlyprintk";
+               stdout-path = "serial0:115200n8";
        };
 
        usb_phy0: phy0 {
index a9a12ce5023b3cbe1553e294dd91c4cfe64d7684..16c9cacd668d4af08660cc0679e1314ca6a54086 100644 (file)
        model = "Zynq ZYBO Development Board";
        compatible = "digilent,zynq-zybo", "xlnx,zynq-7000";
 
+       aliases {
+               ethernet0 = &gem0;
+               serial0 = &uart1;
+       };
+
        memory {
                device_type = "memory";
                reg = <0x0 0x20000000>;
        };
 
        chosen {
-               bootargs = "console=ttyPS0,115200 earlyprintk";
+               bootargs = "earlyprintk";
+               stdout-path = "serial0:115200n8";
        };
 
 };
index bcef49a21801436dc7f4251c3fa788e17f769a3e..94b5dcabdeccddec2e6179abc87601bc0ed0ca03 100644 (file)
@@ -131,6 +131,8 @@ CONFIG_POWER_RESET=y
 CONFIG_WATCHDOG=y
 CONFIG_AT91SAM9X_WATCHDOG=y
 CONFIG_SSB=m
+CONFIG_REGULATOR=y
+CONFIG_REGULATOR_FIXED_VOLTAGE=y
 CONFIG_FB=y
 CONFIG_FB_ATMEL=y
 CONFIG_BACKLIGHT_LCD_SUPPORT=y
index c4c17e3a8e1aa32694b6b8950b67b2daba5b50d5..c0dac0f0f804d65dfce101d2e82dbb866208b4f2 100644 (file)
@@ -16,6 +16,7 @@ CONFIG_EMBEDDED=y
 # CONFIG_IOSCHED_DEADLINE is not set
 # CONFIG_IOSCHED_CFQ is not set
 # CONFIG_MMU is not set
+CONFIG_ARM_SINGLE_ARMV7M=y
 CONFIG_ARCH_EFM32=y
 CONFIG_SET_MEM_PARAM=y
 CONFIG_DRAM_BASE=0x88000000
@@ -85,7 +86,6 @@ CONFIG_GPIO_SYSFS=y
 # CONFIG_USB_SUPPORT is not set
 CONFIG_MMC=y
 CONFIG_MMC_SPI=y
-# CONFIG_IOMMU_SUPPORT is not set
 CONFIG_EXT2_FS=y
 # CONFIG_FILE_LOCKING is not set
 # CONFIG_DNOTIFY is not set
index d034c96c039bd054c98eb28f4dc868e2212e53e9..9504e779028834deaa29731f24c9f4adf63aa24a 100644 (file)
@@ -26,11 +26,11 @@ CONFIG_ZBOOT_ROM_BSS=0x0
 CONFIG_ARM_APPENDED_DTB=y
 CONFIG_ARM_ATAG_DTB_COMPAT=y
 CONFIG_CMDLINE="root=/dev/ram0 rw ramdisk=8192 initrd=0x41000000,8M console=ttySAC1,115200 init=/linuxrc mem=256M"
+CONFIG_CPU_FREQ=y
 CONFIG_CPU_IDLE=y
 CONFIG_ARM_EXYNOS_CPUIDLE=y
 CONFIG_VFP=y
 CONFIG_NEON=y
-CONFIG_PM=y
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
@@ -40,15 +40,11 @@ CONFIG_IP_PNP=y
 CONFIG_IP_PNP_DHCP=y
 CONFIG_IP_PNP_BOOTP=y
 CONFIG_IP_PNP_RARP=y
-CONFIG_WIRELESS=y
 CONFIG_CFG80211=y
-CONFIG_MWIFIEX=y
-CONFIG_MWIFIEX_SDIO=y
 CONFIG_RFKILL_REGULATOR=y
 CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
 CONFIG_DEVTMPFS=y
 CONFIG_DEVTMPFS_MOUNT=y
-CONFIG_PROC_DEVICETREE=y
 CONFIG_DMA_CMA=y
 CONFIG_CMA_SIZE_MBYTES=64
 CONFIG_BLK_DEV_LOOP=y
@@ -66,7 +62,8 @@ CONFIG_SMSC911X=y
 CONFIG_USB_USBNET=y
 CONFIG_USB_NET_SMSC75XX=y
 CONFIG_USB_NET_SMSC95XX=y
-CONFIG_USB_GADGET=y
+CONFIG_MWIFIEX=y
+CONFIG_MWIFIEX_SDIO=y
 CONFIG_INPUT_EVDEV=y
 CONFIG_KEYBOARD_GPIO=y
 CONFIG_KEYBOARD_CROS_EC=y
@@ -81,16 +78,13 @@ CONFIG_SERIAL_OF_PLATFORM=y
 CONFIG_HW_RANDOM=y
 CONFIG_TCG_TPM=y
 CONFIG_TCG_TIS_I2C_INFINEON=y
-CONFIG_I2C=y
 CONFIG_I2C_CHARDEV=y
 CONFIG_I2C_MUX=y
 CONFIG_I2C_ARB_GPIO_CHALLENGE=y
-CONFIG_I2C_EXYNOS5=y
 CONFIG_I2C_GPIO=y
 CONFIG_I2C_CROS_EC_TUNNEL=y
 CONFIG_SPI=y
 CONFIG_SPI_S3C64XX=y
-CONFIG_I2C_S3C2410=y
 CONFIG_DEBUG_GPIO=y
 CONFIG_POWER_SUPPLY=y
 CONFIG_BATTERY_SBS=y
@@ -99,13 +93,13 @@ CONFIG_BATTERY_MAX17042=y
 CONFIG_CHARGER_MAX14577=y
 CONFIG_CHARGER_MAX77693=y
 CONFIG_CHARGER_TPS65090=y
-CONFIG_HWMON=y
 CONFIG_SENSORS_LM90=y
-CONFIG_CPU_FREQ=y
-CONFIG_CPU_THERMAL=y
+CONFIG_SENSORS_PWM_FAN=y
+CONFIG_SENSORS_INA2XX=y
 CONFIG_THERMAL=y
-CONFIG_EXYNOS_THERMAL=y
+CONFIG_CPU_THERMAL=y
 CONFIG_THERMAL_EMULATION=y
+CONFIG_EXYNOS_THERMAL=y
 CONFIG_WATCHDOG=y
 CONFIG_S3C2410_WATCHDOG=y
 CONFIG_MFD_CROS_EC=y
@@ -123,36 +117,27 @@ CONFIG_REGULATOR_GPIO=y
 CONFIG_REGULATOR_MAX14577=y
 CONFIG_REGULATOR_MAX8997=y
 CONFIG_REGULATOR_MAX77686=y
-CONFIG_REGULATOR_MAX77802=y
 CONFIG_REGULATOR_MAX77693=y
+CONFIG_REGULATOR_MAX77802=y
 CONFIG_REGULATOR_S2MPA01=y
 CONFIG_REGULATOR_S2MPS11=y
 CONFIG_REGULATOR_S5M8767=y
 CONFIG_REGULATOR_TPS65090=y
 CONFIG_DRM=y
-CONFIG_DRM_EXYNOS_HDMI=y
-CONFIG_DRM_BRIDGE=y
 CONFIG_DRM_PTN3460=y
 CONFIG_DRM_PS8622=y
 CONFIG_DRM_EXYNOS=y
 CONFIG_DRM_EXYNOS_FIMD=y
-CONFIG_DRM_EXYNOS_DP=y
-CONFIG_DRM_PANEL=y
+CONFIG_DRM_EXYNOS_DSI=y
+CONFIG_DRM_EXYNOS_HDMI=y
 CONFIG_DRM_PANEL_SIMPLE=y
-CONFIG_FB=y
-CONFIG_FB_MODE_HELPERS=y
+CONFIG_DRM_PANEL_S6E8AA0=y
 CONFIG_FB_SIMPLE=y
 CONFIG_EXYNOS_VIDEO=y
 CONFIG_EXYNOS_MIPI_DSI=y
-CONFIG_BACKLIGHT_LCD_SUPPORT=y
 CONFIG_LCD_CLASS_DEVICE=y
 CONFIG_LCD_PLATFORM=y
-CONFIG_BACKLIGHT_CLASS_DEVICE=y
-CONFIG_BACKLIGHT_GENERIC=y
 CONFIG_BACKLIGHT_PWM=y
-CONFIG_FRAMEBUFFER_CONSOLE=y
-CONFIG_FONTS=y
-CONFIG_FONT_7x14=y
 CONFIG_LOGO=y
 CONFIG_SOUND=y
 CONFIG_SND=y
@@ -169,6 +154,7 @@ CONFIG_USB_OHCI_EXYNOS=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_DWC3=y
 CONFIG_USB_HSIC_USB3503=y
+CONFIG_USB_GADGET=y
 CONFIG_MMC=y
 CONFIG_MMC_BLOCK_MINORS=16
 CONFIG_MMC_SDHCI=y
@@ -197,11 +183,6 @@ CONFIG_EXYNOS_ADC=y
 CONFIG_PWM=y
 CONFIG_PWM_SAMSUNG=y
 CONFIG_PHY_EXYNOS5250_SATA=y
-CONFIG_PHY_SAMSUNG_USB2=y
-CONFIG_PHY_EXYNOS4210_USB2=y
-CONFIG_PHY_EXYNOS4X12_USB2=y
-CONFIG_PHY_EXYNOS5250_USB2=y
-CONFIG_PHY_EXYNOS5_USBDRD=y
 CONFIG_EXT2_FS=y
 CONFIG_EXT3_FS=y
 CONFIG_EXT4_FS=y
@@ -217,15 +198,16 @@ CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_ASCII=y
 CONFIG_NLS_ISO8859_1=y
 CONFIG_PRINTK_TIME=y
+CONFIG_DEBUG_INFO=y
 CONFIG_DEBUG_FS=y
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_KERNEL=y
-CONFIG_DETECT_HUNG_TASK=y
+CONFIG_LOCKUP_DETECTOR=y
 CONFIG_DEBUG_RT_MUTEXES=y
 CONFIG_DEBUG_SPINLOCK=y
 CONFIG_DEBUG_MUTEXES=y
-CONFIG_LOCKUP_DETECTOR=y
-CONFIG_DEBUG_INFO=y
 CONFIG_DEBUG_USER=y
 CONFIG_CRYPTO_SHA256=y
 CONFIG_CRC_CCITT=y
+CONFIG_FONTS=y
+CONFIG_FONT_7x14=y
index c34da5878b6c617c476d256a019e6cd9d2588d21..5997dbc69822af26b1c7cbd86679ae2488529de8 100644 (file)
@@ -33,6 +33,7 @@ CONFIG_ATA=y
 CONFIG_SATA_AHCI_PLATFORM=y
 CONFIG_NETDEVICES=y
 CONFIG_HIX5HD2_GMAC=y
+CONFIG_HIP04_ETH=y
 CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250_DEPRECATED_OPTIONS=y
 CONFIG_SERIAL_8250_CONSOLE=y
@@ -51,6 +52,7 @@ CONFIG_GPIO_SYSFS=y
 CONFIG_GPIOLIB=y
 CONFIG_GPIO_GENERIC_PLATFORM=y
 CONFIG_REGULATOR_GPIO=y
+CONFIG_GPIO_DWAPB=y
 CONFIG_MFD_SYSCON=y
 CONFIG_POWER_RESET_SYSCON=y
 CONFIG_DRM=y
index fdeb1c83dcb57c1f2fd61c4a967df8e9248e4172..b47863d49ac6aaf192f4feac7111f0b7e8d21488 100644 (file)
@@ -38,7 +38,9 @@ CONFIG_SOC_IMX53=y
 CONFIG_SOC_IMX6Q=y
 CONFIG_SOC_IMX6SL=y
 CONFIG_SOC_IMX6SX=y
+CONFIG_SOC_IMX7D=y
 CONFIG_SOC_VF610=y
+CONFIG_SOC_LS1021A=y
 CONFIG_PCI=y
 CONFIG_PCI_IMX6=y
 CONFIG_SMP=y
@@ -73,6 +75,7 @@ CONFIG_CAN=y
 CONFIG_CAN_FLEXCAN=y
 CONFIG_BT=y
 CONFIG_BT_HCIUART=y
+CONFIG_BT_HCIUART_LL=y
 CONFIG_BT_HCIUART_3WIRE=y
 CONFIG_CFG80211=y
 CONFIG_MAC80211=y
@@ -139,6 +142,10 @@ CONFIG_USB_RTL8152=m
 CONFIG_USB_USBNET=m
 CONFIG_USB_NET_CDC_EEM=m
 CONFIG_BRCMFMAC=m
+CONFIG_WL_TI=y
+CONFIG_WL12XX=m
+CONFIG_WLCORE_SDIO=m
+# CONFIG_WILINK_PLATFORM_DATA is not set
 # CONFIG_INPUT_MOUSEDEV_PSAUX is not set
 CONFIG_INPUT_EVDEV=y
 CONFIG_INPUT_EVBUG=m
@@ -151,6 +158,7 @@ CONFIG_TOUCHSCREEN_EGALAX=y
 CONFIG_TOUCHSCREEN_MC13783=y
 CONFIG_TOUCHSCREEN_TSC2007=y
 CONFIG_TOUCHSCREEN_STMPE=y
+CONFIG_TOUCHSCREEN_SX8654=y
 CONFIG_INPUT_MISC=y
 CONFIG_INPUT_MMA8450=y
 CONFIG_SERIO_SERPORT=m
@@ -283,6 +291,7 @@ CONFIG_RTC_CLASS=y
 CONFIG_RTC_INTF_DEV_UIE_EMUL=y
 CONFIG_RTC_DRV_DS1307=y
 CONFIG_RTC_DRV_ISL1208=y
+CONFIG_RTC_DRV_PCF8523=y
 CONFIG_RTC_DRV_PCF8563=y
 CONFIG_RTC_DRV_MC13XXX=y
 CONFIG_RTC_DRV_MXC=y
index f8a1c8f2c7c4a01ddc31c6f8cef7a2881aa9ed77..95ce1284bd42d329205f61a5894fd731aabc678f 100644 (file)
@@ -123,6 +123,9 @@ CONFIG_EEPROM_AT24=y
 CONFIG_SCSI=y
 CONFIG_BLK_DEV_SD=y
 CONFIG_NETDEVICES=y
+CONFIG_TI_KEYSTONE_NETCP=y
+CONFIG_TI_KEYSTONE_NETCP_ETHSS=y
+CONFIG_PHYLIB=y
 CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250_CONSOLE=y
 CONFIG_SERIAL_OF_PLATFORM=y
@@ -152,6 +155,9 @@ CONFIG_USB_DWC3_VERBOSE=y
 CONFIG_KEYSTONE_USB_PHY=y
 CONFIG_DMADEVICES=y
 CONFIG_TI_EDMA=y
+CONFIG_SOC_TI=y
+CONFIG_KEYSTONE_NAVIGATOR_QMSS=y
+CONFIG_KEYSTONE_NAVIGATOR_DMA=y
 CONFIG_MEMORY=y
 CONFIG_TI_AEMIF=y
 CONFIG_EXT4_FS=y
diff --git a/arch/arm/configs/lpc18xx_defconfig b/arch/arm/configs/lpc18xx_defconfig
new file mode 100644 (file)
index 0000000..1c47f86
--- /dev/null
@@ -0,0 +1,151 @@
+CONFIG_CROSS_COMPILE="arm-linux-gnueabihf-"
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_BLK_DEV_INITRD=y
+# CONFIG_RD_BZIP2 is not set
+# CONFIG_RD_LZMA is not set
+# CONFIG_RD_XZ is not set
+# CONFIG_RD_LZO is not set
+# CONFIG_RD_LZ4 is not set
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+# CONFIG_UID16 is not set
+# CONFIG_BASE_FULL is not set
+# CONFIG_FUTEX is not set
+# CONFIG_EPOLL is not set
+# CONFIG_SIGNALFD is not set
+# CONFIG_EVENTFD is not set
+# CONFIG_AIO is not set
+CONFIG_EMBEDDED=y
+# CONFIG_VM_EVENT_COUNTERS is not set
+# CONFIG_SLUB_DEBUG is not set
+# CONFIG_LBDAF is not set
+# CONFIG_BLK_DEV_BSG is not set
+# CONFIG_IOSCHED_DEADLINE is not set
+# CONFIG_IOSCHED_CFQ is not set
+# CONFIG_MMU is not set
+CONFIG_ARM_SINGLE_ARMV7M=y
+CONFIG_ARCH_LPC18XX=y
+CONFIG_SET_MEM_PARAM=y
+CONFIG_DRAM_BASE=0x28000000
+CONFIG_DRAM_SIZE=0x02000000
+CONFIG_FLASH_MEM_BASE=0x1b000000
+CONFIG_FLASH_SIZE=0x00080000
+CONFIG_PREEMPT=y
+CONFIG_ZBOOT_ROM_TEXT=0x0
+CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_ARM_APPENDED_DTB=y
+CONFIG_BINFMT_FLAT=y
+CONFIG_BINFMT_ZFLAT=y
+CONFIG_BINFMT_SHARED_FLAT=y
+# CONFIG_COREDUMP is not set
+CONFIG_NET=y
+CONFIG_PACKET=y
+CONFIG_UNIX=y
+CONFIG_INET=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_WIRELESS is not set
+CONFIG_DEVTMPFS=y
+CONFIG_DEVTMPFS_MOUNT=y
+# CONFIG_FW_LOADER is not set
+CONFIG_MTD=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_BLK_DEV_RAM=y
+CONFIG_SRAM=y
+CONFIG_EEPROM_AT24=y
+CONFIG_NETDEVICES=y
+# CONFIG_NET_VENDOR_ARC is not set
+# 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_HISILICON 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_MICROCHIP is not set
+# CONFIG_NET_VENDOR_NATSEMI is not set
+# CONFIG_NET_VENDOR_QUALCOMM is not set
+# CONFIG_NET_VENDOR_ROCKER is not set
+# CONFIG_NET_VENDOR_SAMSUNG is not set
+# CONFIG_NET_VENDOR_SEEQ is not set
+# CONFIG_NET_VENDOR_SMSC is not set
+CONFIG_STMMAC_ETH=y
+# CONFIG_NET_VENDOR_VIA is not set
+# CONFIG_NET_VENDOR_WIZNET is not set
+CONFIG_SMSC_PHY=y
+# CONFIG_USB_NET_DRIVERS is not set
+# CONFIG_WLAN is not set
+# CONFIG_INPUT_MOUSEDEV is not set
+CONFIG_INPUT_EVDEV=y
+# CONFIG_KEYBOARD_ATKBD is not set
+CONFIG_KEYBOARD_GPIO=y
+CONFIG_KEYBOARD_GPIO_POLLED=y
+# CONFIG_INPUT_MOUSE is not set
+# CONFIG_SERIO is not set
+# CONFIG_VT is not set
+# CONFIG_UNIX98_PTYS is not set
+# CONFIG_LEGACY_PTYS is not set
+CONFIG_SERIAL_NONSTANDARD=y
+# CONFIG_DEVKMEM is not set
+CONFIG_SERIAL_8250=y
+# CONFIG_SERIAL_8250_DEPRECATED_OPTIONS is not set
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_OF_PLATFORM=y
+# CONFIG_HW_RANDOM is not set
+CONFIG_I2C=y
+CONFIG_SPI=y
+CONFIG_SPI_PL022=y
+CONFIG_GPIO_SYSFS=y
+CONFIG_GPIO_74XX_MMIO=y
+CONFIG_SENSORS_LM75=y
+CONFIG_WATCHDOG=y
+CONFIG_WATCHDOG_CORE=y
+CONFIG_MFD_SYSCON=y
+CONFIG_REGULATOR=y
+CONFIG_REGULATOR_FIXED_VOLTAGE=y
+CONFIG_FB=y
+CONFIG_FB_ARMCLCD=y
+CONFIG_USB=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_EHCI_ROOT_HUB_TT=y
+CONFIG_MMC=y
+CONFIG_MMC_DW=y
+CONFIG_MMC_DW_IDMAC=y
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
+CONFIG_LEDS_PCA9532=y
+CONFIG_LEDS_PCA9532_GPIO=y
+CONFIG_LEDS_GPIO=y
+CONFIG_LEDS_TRIGGERS=y
+CONFIG_LEDS_TRIGGER_HEARTBEAT=y
+CONFIG_RTC_CLASS=y
+CONFIG_DMADEVICES=y
+CONFIG_AMBA_PL08X=y
+CONFIG_EXT2_FS=y
+# CONFIG_FILE_LOCKING is not set
+# CONFIG_DNOTIFY is not set
+# CONFIG_INOTIFY_USER is not set
+# CONFIG_NETWORK_FILESYSTEMS is not set
+CONFIG_PRINTK_TIME=y
+CONFIG_DEBUG_INFO=y
+# CONFIG_ENABLE_WARN_DEPRECATED is not set
+# CONFIG_ENABLE_MUST_CHECK is not set
+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
+CONFIG_CRC7=y
index fbbb1915c6a95a81ac3edc58a6725f96c3c8b890..fd6a6d23bc20b0f470c757a1592d88cf84ac5a9c 100644 (file)
@@ -20,6 +20,9 @@ CONFIG_MACH_ARMADA_38X=y
 CONFIG_MACH_ARMADA_39X=y
 CONFIG_MACH_ARMADA_XP=y
 CONFIG_MACH_DOVE=y
+CONFIG_ARCH_AT91=y
+CONFIG_SOC_SAMA5D3=y
+CONFIG_SOC_SAMA5D4=y
 CONFIG_ARCH_BCM=y
 CONFIG_ARCH_BCM_CYGNUS=y
 CONFIG_ARCH_BCM_21664=y
@@ -30,6 +33,7 @@ CONFIG_ARCH_BERLIN=y
 CONFIG_MACH_BERLIN_BG2=y
 CONFIG_MACH_BERLIN_BG2CD=y
 CONFIG_MACH_BERLIN_BG2Q=y
+CONFIG_ARCH_DIGICOLOR=y
 CONFIG_ARCH_HIGHBANK=y
 CONFIG_ARCH_HISI=y
 CONFIG_ARCH_HI3xxx=y
@@ -72,6 +76,7 @@ CONFIG_ARCH_EMEV2=y
 CONFIG_ARCH_R7S72100=y
 CONFIG_ARCH_R8A73A4=y
 CONFIG_ARCH_R8A7740=y
+CONFIG_ARCH_R8A7778=y
 CONFIG_ARCH_R8A7779=y
 CONFIG_ARCH_R8A7790=y
 CONFIG_ARCH_R8A7791=y
@@ -86,6 +91,7 @@ CONFIG_ARCH_TEGRA_3x_SOC=y
 CONFIG_ARCH_TEGRA_114_SOC=y
 CONFIG_ARCH_TEGRA_124_SOC=y
 CONFIG_TEGRA_EMC_SCALING_ENABLE=y
+CONFIG_ARCH_UNIPHIER=y
 CONFIG_ARCH_U8500=y
 CONFIG_MACH_HREFV60=y
 CONFIG_MACH_SNOWBALL=y
@@ -115,8 +121,11 @@ CONFIG_CPU_FREQ=y
 CONFIG_CPU_FREQ_STAT_DETAILS=y
 CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
 CONFIG_CPU_IDLE=y
+CONFIG_ARM_CPUIDLE=y
 CONFIG_NEON=y
+CONFIG_KERNEL_MODE_NEON=y
 CONFIG_ARM_ZYNQ_CPUIDLE=y
+CONFIG_ARM_EXYNOS_CPUIDLE=y
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
@@ -137,6 +146,7 @@ CONFIG_CAN=y
 CONFIG_CAN_RAW=y
 CONFIG_CAN_BCM=y
 CONFIG_CAN_DEV=y
+CONFIG_CAN_AT91=m
 CONFIG_CAN_XILINXCAN=y
 CONFIG_CAN_MCP251X=y
 CONFIG_BT=m
@@ -158,13 +168,16 @@ CONFIG_MTD_CMDLINE_PARTS=y
 CONFIG_MTD_BLOCK=y
 CONFIG_MTD_M25P80=y
 CONFIG_MTD_NAND=y
+CONFIG_MTD_NAND_ATMEL=y
 CONFIG_MTD_NAND_DAVINCI=y
 CONFIG_MTD_SPI_NOR=y
 CONFIG_MTD_UBI=y
 CONFIG_BLK_DEV_LOOP=y
 CONFIG_AD525X_DPOT=y
 CONFIG_AD525X_DPOT_I2C=y
+CONFIG_ATMEL_TCLIB=y
 CONFIG_ICS932S401=y
+CONFIG_ATMEL_SSC=m
 CONFIG_APDS9802ALS=y
 CONFIG_ISL29003=y
 CONFIG_EEPROM_AT24=y
@@ -213,12 +226,14 @@ CONFIG_MWIFIEX=m
 CONFIG_MWIFIEX_SDIO=m
 CONFIG_INPUT_JOYDEV=y
 CONFIG_INPUT_EVDEV=y
+CONFIG_KEYBOARD_QT1070=m
 CONFIG_KEYBOARD_GPIO=y
 CONFIG_KEYBOARD_TEGRA=y
 CONFIG_KEYBOARD_SPEAR=y
 CONFIG_KEYBOARD_ST_KEYSCAN=y
 CONFIG_KEYBOARD_CROS_EC=y
 CONFIG_MOUSE_PS2_ELANTECH=y
+CONFIG_MOUSE_CYAPA=m
 CONFIG_MOUSE_ELAN_I2C=y
 CONFIG_INPUT_TOUCHSCREEN=y
 CONFIG_TOUCHSCREEN_ATMEL_MXT=y
@@ -237,6 +252,9 @@ CONFIG_SERIAL_8250_EM=y
 CONFIG_SERIAL_8250_MT6577=y
 CONFIG_SERIAL_AMBA_PL011=y
 CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
+CONFIG_SERIAL_ATMEL=y
+CONFIG_SERIAL_ATMEL_CONSOLE=y
+CONFIG_SERIAL_ATMEL_TTYAT=y
 CONFIG_SERIAL_MESON=y
 CONFIG_SERIAL_MESON_CONSOLE=y
 CONFIG_SERIAL_SAMSUNG=y
@@ -260,15 +278,20 @@ CONFIG_SERIAL_XILINX_PS_UART=y
 CONFIG_SERIAL_XILINX_PS_UART_CONSOLE=y
 CONFIG_SERIAL_FSL_LPUART=y
 CONFIG_SERIAL_FSL_LPUART_CONSOLE=y
+CONFIG_SERIAL_CONEXANT_DIGICOLOR=y
+CONFIG_SERIAL_CONEXANT_DIGICOLOR_CONSOLE=y
 CONFIG_SERIAL_ST_ASC=y
 CONFIG_SERIAL_ST_ASC_CONSOLE=y
 CONFIG_I2C_CHARDEV=y
 CONFIG_I2C_DAVINCI=y
 CONFIG_I2C_MUX=y
+CONFIG_I2C_ARB_GPIO_CHALLENGE=m
 CONFIG_I2C_MUX_PCA954x=y
 CONFIG_I2C_MUX_PINCTRL=y
+CONFIG_I2C_AT91=m
 CONFIG_I2C_CADENCE=y
 CONFIG_I2C_DESIGNWARE_PLATFORM=y
+CONFIG_I2C_DIGICOLOR=m
 CONFIG_I2C_GPIO=m
 CONFIG_I2C_EXYNOS5=y
 CONFIG_I2C_MV64XXX=y
@@ -280,13 +303,16 @@ CONFIG_I2C_ST=y
 CONFIG_I2C_TEGRA=y
 CONFIG_I2C_XILINX=y
 CONFIG_I2C_RCAR=y
+CONFIG_I2C_CROS_EC_TUNNEL=m
 CONFIG_SPI=y
+CONFIG_SPI_ATMEL=m
 CONFIG_SPI_CADENCE=y
 CONFIG_SPI_DAVINCI=y
 CONFIG_SPI_OMAP24XX=y
 CONFIG_SPI_ORION=y
 CONFIG_SPI_PL022=y
 CONFIG_SPI_RSPI=y
+CONFIG_SPI_S3C64XX=m
 CONFIG_SPI_SH_MSIOF=m
 CONFIG_SPI_SH_HSPI=y
 CONFIG_SPI_SIRF=y
@@ -317,6 +343,10 @@ CONFIG_GPIO_SYSCON=y
 CONFIG_GPIO_TPS6586X=y
 CONFIG_GPIO_TPS65910=y
 CONFIG_BATTERY_SBS=y
+CONFIG_BATTERY_MAX17040=m
+CONFIG_BATTERY_MAX17042=m
+CONFIG_CHARGER_MAX14577=m
+CONFIG_CHARGER_MAX77693=m
 CONFIG_CHARGER_TPS65090=y
 CONFIG_POWER_RESET_AS3722=y
 CONFIG_POWER_RESET_GPIO=y
@@ -330,13 +360,15 @@ CONFIG_THERMAL=y
 CONFIG_CPU_THERMAL=y
 CONFIG_RCAR_THERMAL=y
 CONFIG_ARMADA_THERMAL=y
-CONFIG_DAVINCI_WATCHDOG
+CONFIG_DAVINCI_WATCHDOG=m
+CONFIG_EXYNOS_THERMAL=m
 CONFIG_ST_THERMAL_SYSCFG=y
 CONFIG_ST_THERMAL_MEMMAP=y
 CONFIG_WATCHDOG=y
 CONFIG_XILINX_WATCHDOG=y
 CONFIG_ARM_SP805_WATCHDOG=y
 CONFIG_ORION_WATCHDOG=y
+CONFIG_ST_LPC_WATCHDOG=y
 CONFIG_SUNXI_WATCHDOG=y
 CONFIG_MESON_WATCHDOG=y
 CONFIG_MFD_AS3711=y
@@ -344,8 +376,11 @@ CONFIG_MFD_AS3722=y
 CONFIG_MFD_BCM590XX=y
 CONFIG_MFD_AXP20X=y
 CONFIG_MFD_CROS_EC=y
+CONFIG_MFD_CROS_EC_I2C=m
 CONFIG_MFD_CROS_EC_SPI=y
+CONFIG_MFD_MAX14577=y
 CONFIG_MFD_MAX77686=y
+CONFIG_MFD_MAX77693=y
 CONFIG_MFD_MAX8907=y
 CONFIG_MFD_SEC_CORE=y
 CONFIG_MFD_STMPE=y
@@ -362,9 +397,11 @@ CONFIG_REGULATOR_DA9210=y
 CONFIG_REGULATOR_GPIO=y
 CONFIG_MFD_SYSCON=y
 CONFIG_POWER_RESET_SYSCON=y
+CONFIG_REGULATOR_MAX14577=m
 CONFIG_REGULATOR_MAX8907=y
 CONFIG_REGULATOR_MAX8973=y
 CONFIG_REGULATOR_MAX77686=y
+CONFIG_REGULATOR_MAX77693=m
 CONFIG_REGULATOR_PALMAS=y
 CONFIG_REGULATOR_S2MPS11=y
 CONFIG_REGULATOR_S5M8767=y
@@ -375,7 +412,7 @@ CONFIG_REGULATOR_TPS6586X=y
 CONFIG_REGULATOR_TPS65910=y
 CONFIG_REGULATOR_TWL4030=y
 CONFIG_REGULATOR_VEXPRESS=y
-CONFIG_MEDIA_SUPPORT=y
+CONFIG_MEDIA_SUPPORT=m
 CONFIG_MEDIA_CAMERA_SUPPORT=y
 CONFIG_MEDIA_CONTROLLER=y
 CONFIG_VIDEO_V4L2_SUBDEV_API=y
@@ -390,9 +427,17 @@ CONFIG_V4L_MEM2MEM_DRIVERS=y
 CONFIG_VIDEO_RENESAS_VSP1=m
 # CONFIG_MEDIA_SUBDRV_AUTOSELECT is not set
 CONFIG_VIDEO_ADV7180=m
+CONFIG_VIDEO_ML86V7667=m
 CONFIG_DRM=y
+CONFIG_DRM_PTN3460=m
+CONFIG_DRM_PS8622=m
+CONFIG_DRM_EXYNOS=m
+CONFIG_DRM_EXYNOS_DSI=y
+CONFIG_DRM_EXYNOS_FIMD=y
+CONFIG_DRM_EXYNOS_HDMI=y
 CONFIG_DRM_RCAR_DU=m
 CONFIG_DRM_TEGRA=y
+CONFIG_DRM_PANEL_S6E8AA0=m
 CONFIG_DRM_PANEL_SIMPLE=y
 CONFIG_FB_ARMCLCD=y
 CONFIG_FB_WM8505=y
@@ -401,24 +446,27 @@ CONFIG_FB_SIMPLE=y
 CONFIG_FB_SH_MOBILE_MERAM=y
 CONFIG_BACKLIGHT_LCD_SUPPORT=y
 CONFIG_BACKLIGHT_CLASS_DEVICE=y
+CONFIG_LCD_PLATFORM=m
 CONFIG_BACKLIGHT_PWM=y
 CONFIG_BACKLIGHT_AS3711=y
 CONFIG_FRAMEBUFFER_CONSOLE=y
 CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
-CONFIG_SOUND=y
-CONFIG_SND=y
+CONFIG_SOUND=m
+CONFIG_SND=m
 CONFIG_SND_DYNAMIC_MINORS=y
 CONFIG_SND_USB_AUDIO=y
-CONFIG_SND_SOC=y
+CONFIG_SND_SOC=m
+CONFIG_SND_ATMEL_SOC=m
+CONFIG_SND_ATMEL_SOC_WM8904=m
 CONFIG_SND_SOC_SH4_FSI=m
 CONFIG_SND_SOC_RCAR=m
-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_TRIMSLICE=y
-CONFIG_SND_SOC_TEGRA_ALC5632=y
-CONFIG_SND_SOC_TEGRA_MAX98090=y
+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_TRIMSLICE=m
+CONFIG_SND_SOC_TEGRA_ALC5632=m
+CONFIG_SND_SOC_TEGRA_MAX98090=m
 CONFIG_SND_SOC_AK4642=m
 CONFIG_SND_SOC_WM8978=m
 CONFIG_USB=y
@@ -433,6 +481,7 @@ CONFIG_USB_ISP1760=y
 CONFIG_USB_OHCI_HCD=y
 CONFIG_USB_OHCI_HCD_STI=y
 CONFIG_USB_OHCI_HCD_PLATFORM=y
+CONFIG_USB_OHCI_EXYNOS=m
 CONFIG_USB_R8A66597_HCD=m
 CONFIG_USB_RENESAS_USBHS=m
 CONFIG_USB_STORAGE=y
@@ -448,7 +497,6 @@ CONFIG_USB_GPIO_VBUS=y
 CONFIG_USB_ISP1301=y
 CONFIG_USB_MXS_PHY=y
 CONFIG_USB_RCAR_PHY=m
-CONFIG_USB_RCAR_GEN2_PHY=m
 CONFIG_USB_GADGET=y
 CONFIG_USB_RENESAS_USBHS_UDC=m
 CONFIG_MMC=y
@@ -468,6 +516,7 @@ CONFIG_MMC_SDHCI_BCM_KONA=y
 CONFIG_MMC_SDHCI_ST=y
 CONFIG_MMC_OMAP=y
 CONFIG_MMC_OMAP_HS=y
+CONFIG_MMC_ATMELMCI=y
 CONFIG_MMC_MVSDIO=y
 CONFIG_MMC_SDHI=y
 CONFIG_MMC_DW=y
@@ -500,14 +549,22 @@ CONFIG_RTC_DRV_AS3722=y
 CONFIG_RTC_DRV_DS1307=y
 CONFIG_RTC_DRV_MAX8907=y
 CONFIG_RTC_DRV_MAX77686=y
+CONFIG_RTC_DRV_MAX77802=m
 CONFIG_RTC_DRV_RS5C372=m
 CONFIG_RTC_DRV_PALMAS=y
+CONFIG_RTC_DRV_ST_LPC=y
 CONFIG_RTC_DRV_TWL4030=y
 CONFIG_RTC_DRV_TPS6586X=y
 CONFIG_RTC_DRV_TPS65910=y
 CONFIG_RTC_DRV_S35390A=m
+CONFIG_RTC_DRV_RX8581=m
 CONFIG_RTC_DRV_EM3027=y
+CONFIG_RTC_DRV_DIGICOLOR=m
+CONFIG_RTC_DRV_S5M=m
+CONFIG_RTC_DRV_S3C=m
 CONFIG_RTC_DRV_PL031=y
+CONFIG_RTC_DRV_AT91RM9200=m
+CONFIG_RTC_DRV_AT91SAM9=m
 CONFIG_RTC_DRV_VT8500=y
 CONFIG_RTC_DRV_SUN6I=y
 CONFIG_RTC_DRV_SUNXI=y
@@ -515,6 +572,8 @@ CONFIG_RTC_DRV_MV=y
 CONFIG_RTC_DRV_TEGRA=y
 CONFIG_DMADEVICES=y
 CONFIG_DW_DMAC=y
+CONFIG_AT_HDMAC=y
+CONFIG_AT_XDMAC=y
 CONFIG_MV_XOR=y
 CONFIG_TEGRA20_APB_DMA=y
 CONFIG_SH_DMAE=y
@@ -537,8 +596,13 @@ CONFIG_SERIO_NVEC_PS2=y
 CONFIG_NVEC_POWER=y
 CONFIG_NVEC_PAZ00=y
 CONFIG_QCOM_GSBI=y
+CONFIG_QCOM_PM=y
 CONFIG_COMMON_CLK_QCOM=y
+CONFIG_CHROME_PLATFORMS=y
+CONFIG_CROS_EC_CHARDEV=m
 CONFIG_COMMON_CLK_MAX77686=y
+CONFIG_COMMON_CLK_MAX77802=m
+CONFIG_COMMON_CLK_S2MPS11=m
 CONFIG_APQ_MMCC_8084=y
 CONFIG_MSM_GCC_8660=y
 CONFIG_MSM_MMCC_8960=y
@@ -550,10 +614,14 @@ CONFIG_ARM_TEGRA_DEVFREQ=m
 CONFIG_MEMORY=y
 CONFIG_TI_AEMIF=y
 CONFIG_IIO=y
+CONFIG_AT91_ADC=m
 CONFIG_XILINX_XADC=y
 CONFIG_AK8975=y
 CONFIG_PWM=y
+CONFIG_PWM_ATMEL=m
+CONFIG_PWM_ATMEL_TCB=m
 CONFIG_PWM_RENESAS_TPU=y
+CONFIG_PWM_SAMSUNG=m
 CONFIG_PWM_TEGRA=y
 CONFIG_PWM_VT8500=y
 CONFIG_PHY_HIX5HD2_SATA=y
@@ -561,10 +629,12 @@ CONFIG_OMAP_USB2=y
 CONFIG_TI_PIPE3=y
 CONFIG_PHY_MIPHY28LP=y
 CONFIG_PHY_MIPHY365X=y
+CONFIG_PHY_RCAR_GEN2=m
 CONFIG_PHY_STIH41X_USB=y
 CONFIG_PHY_STIH407_USB=y
 CONFIG_PHY_SUN4I_USB=y
 CONFIG_PHY_SUN9I_USB=y
+CONFIG_PHY_SAMSUNG_USB2=m
 CONFIG_EXT4_FS=y
 CONFIG_AUTOFS4_FS=y
 CONFIG_MSDOS_FS=y
@@ -590,3 +660,17 @@ CONFIG_LOCKUP_DETECTOR=y
 CONFIG_CRYPTO_DEV_TEGRA_AES=y
 CONFIG_CPUFREQ_DT=y
 CONFIG_KEYSTONE_IRQ=y
+CONFIG_ARM_CRYPTO=y
+CONFIG_CRYPTO_SHA1_ARM=m
+CONFIG_CRYPTO_SHA1_ARM_NEON=m
+CONFIG_CRYPTO_SHA1_ARM_CE=m
+CONFIG_CRYPTO_SHA2_ARM_CE=m
+CONFIG_CRYPTO_SHA256_ARM=m
+CONFIG_CRYPTO_SHA512_ARM=m
+CONFIG_CRYPTO_AES_ARM=m
+CONFIG_CRYPTO_AES_ARM_BS=m
+CONFIG_CRYPTO_AES_ARM_CE=m
+CONFIG_CRYPTO_GHASH_ARM_CE=m
+CONFIG_CRYPTO_DEV_ATMEL_AES=m
+CONFIG_CRYPTO_DEV_ATMEL_TDES=m
+CONFIG_CRYPTO_DEV_ATMEL_SHA=m
index 3743ca221d402ce5d89df72baca5b1500ebb799b..ac521e764d10903b2b344021f49295fab979a838 100644 (file)
@@ -152,6 +152,7 @@ CONFIG_NETDEVICES=y
 # CONFIG_NET_CADENCE is not set
 # CONFIG_NET_VENDOR_BROADCOM is not set
 # CONFIG_NET_VENDOR_CIRRUS is not set
+CONFIG_DM9000=y
 # CONFIG_NET_VENDOR_FARADAY is not set
 # CONFIG_NET_VENDOR_HISILICON is not set
 # CONFIG_NET_VENDOR_INTEL is not set
@@ -204,6 +205,7 @@ CONFIG_KEYBOARD_TWL4030=m
 CONFIG_INPUT_TOUCHSCREEN=y
 CONFIG_TOUCHSCREEN_ADS7846=m
 CONFIG_TOUCHSCREEN_EDT_FT5X06=m
+CONFIG_TOUCHSCREEN_PIXCIR=m
 CONFIG_TOUCHSCREEN_TSC2005=m
 CONFIG_TOUCHSCREEN_TSC2007=m
 CONFIG_INPUT_MISC=y
@@ -401,6 +403,7 @@ CONFIG_PWM_TIECAP=m
 CONFIG_PWM_TIEHRPWM=m
 CONFIG_PWM_TWL=m
 CONFIG_PWM_TWL_LED=m
+CONFIG_PHY_DM816X_USB=m
 CONFIG_OMAP_USB2=m
 CONFIG_TI_PIPE3=y
 CONFIG_TWL4030_USB=m
index d2f2babfd47a0985adda898f6de949cffb2010eb..e6a6f282e3de0bc60b0c0fb604469033bb19e75d 100644 (file)
@@ -30,6 +30,7 @@ CONFIG_CLEANCACHE=y
 CONFIG_ARM_APPENDED_DTB=y
 CONFIG_ARM_ATAG_DTB_COMPAT=y
 CONFIG_CPU_IDLE=y
+CONFIG_ARM_CPUIDLE=y
 CONFIG_VFP=y
 CONFIG_NEON=y
 # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
@@ -143,6 +144,7 @@ CONFIG_MSM_MMCC_8960=y
 CONFIG_MSM_MMCC_8974=y
 CONFIG_MSM_IOMMU=y
 CONFIG_QCOM_GSBI=y
+CONFIG_QCOM_PM=y
 CONFIG_PHY_QCOM_APQ8064_SATA=y
 CONFIG_PHY_QCOM_IPQ806X_SATA=y
 CONFIG_EXT2_FS=y
index 510c747c65b446b173fb241d15da8c16983a989e..31eb951880aee1f6d1fd879071134b2bd83490a0 100644 (file)
@@ -136,6 +136,7 @@ CONFIG_POWER_RESET=y
 # CONFIG_HWMON is not set
 CONFIG_SSB=m
 CONFIG_REGULATOR=y
+CONFIG_REGULATOR_FIXED_VOLTAGE=y
 CONFIG_REGULATOR_ACT8865=y
 CONFIG_MEDIA_SUPPORT=y
 CONFIG_MEDIA_CAMERA_SUPPORT=y
index b58618e2d13c51c869c3d4fa2b1c43aa7f61fd41..9961fbd633f8d1658829ad84efb81b9cc57c427f 100644 (file)
@@ -121,7 +121,6 @@ CONFIG_WATCHDOG=y
 CONFIG_DA9063_WATCHDOG=y
 CONFIG_MFD_AS3711=y
 CONFIG_MFD_DA9063=y
-CONFIG_REGULATOR=y
 CONFIG_REGULATOR_AS3711=y
 CONFIG_REGULATOR_DA9210=y
 CONFIG_REGULATOR_GPIO=y
@@ -160,7 +159,6 @@ CONFIG_USB_OHCI_HCD=y
 CONFIG_USB_R8A66597_HCD=y
 CONFIG_USB_RENESAS_USBHS=y
 CONFIG_USB_RCAR_PHY=y
-CONFIG_USB_RCAR_GEN2_PHY=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_RENESAS_USBHS_UDC=y
 CONFIG_USB_ETH=y
@@ -182,6 +180,8 @@ CONFIG_IIO=y
 CONFIG_AK8975=y
 CONFIG_PWM=y
 CONFIG_PWM_RENESAS_TPU=y
+CONFIG_GENERIC_PHY=y
+CONFIG_PHY_RCAR_GEN2=y
 # CONFIG_DNOTIFY is not set
 CONFIG_MSDOS_FS=y
 CONFIG_VFAT_FS=y
diff --git a/arch/arm/configs/stm32_defconfig b/arch/arm/configs/stm32_defconfig
new file mode 100644 (file)
index 0000000..4725fab
--- /dev/null
@@ -0,0 +1,70 @@
+CONFIG_NO_HZ_IDLE=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_LOG_BUF_SHIFT=16
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+# CONFIG_UID16 is not set
+# CONFIG_BASE_FULL is not set
+# CONFIG_FUTEX is not set
+# CONFIG_EPOLL is not set
+# CONFIG_SIGNALFD is not set
+# CONFIG_EVENTFD is not set
+# CONFIG_AIO is not set
+CONFIG_EMBEDDED=y
+# CONFIG_VM_EVENT_COUNTERS is not set
+# CONFIG_SLUB_DEBUG is not set
+# CONFIG_LBDAF is not set
+# CONFIG_BLK_DEV_BSG is not set
+# CONFIG_IOSCHED_DEADLINE is not set
+# CONFIG_IOSCHED_CFQ is not set
+# CONFIG_MMU is not set
+CONFIG_ARM_SINGLE_ARMV7M=y
+CONFIG_ARCH_STM32=y
+CONFIG_SET_MEM_PARAM=y
+CONFIG_DRAM_BASE=0x90000000
+CONFIG_FLASH_MEM_BASE=0x08000000
+CONFIG_FLASH_SIZE=0x00200000
+CONFIG_PREEMPT=y
+# CONFIG_ATAGS is not set
+CONFIG_ZBOOT_ROM_TEXT=0x0
+CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_XIP_KERNEL=y
+CONFIG_XIP_PHYS_ADDR=0x08008000
+CONFIG_BINFMT_FLAT=y
+CONFIG_BINFMT_SHARED_FLAT=y
+# CONFIG_COREDUMP is not set
+CONFIG_DEVTMPFS=y
+CONFIG_DEVTMPFS_MOUNT=y
+# CONFIG_FW_LOADER is not set
+# CONFIG_BLK_DEV is not set
+CONFIG_EEPROM_93CX6=y
+# CONFIG_INPUT is not set
+# CONFIG_SERIO is not set
+# CONFIG_VT is not set
+# CONFIG_UNIX98_PTYS is not set
+# CONFIG_LEGACY_PTYS is not set
+CONFIG_SERIAL_NONSTANDARD=y
+# CONFIG_DEVKMEM is not set
+CONFIG_SERIAL_STM32=y
+CONFIG_SERIAL_STM32_CONSOLE=y
+# CONFIG_HW_RANDOM is not set
+# CONFIG_HWMON is not set
+# CONFIG_USB_SUPPORT is not set
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
+CONFIG_LEDS_TRIGGERS=y
+CONFIG_LEDS_TRIGGER_HEARTBEAT=y
+# CONFIG_FILE_LOCKING is not set
+# CONFIG_DNOTIFY is not set
+# CONFIG_INOTIFY_USER is not set
+CONFIG_NLS=y
+CONFIG_PRINTK_TIME=y
+CONFIG_DEBUG_INFO=y
+# CONFIG_ENABLE_WARN_DEPRECATED is not set
+# CONFIG_ENABLE_MUST_CHECK is not set
+CONFIG_MAGIC_SYSRQ=y
+# CONFIG_SCHED_DEBUG is not set
+# CONFIG_DEBUG_BUGVERBOSE is not set
+# CONFIG_FTRACE is not set
+CONFIG_CRC_ITU_T=y
+CONFIG_CRC7=y
index d199eb2491517eaf78c4550ce76104c2aabcfa18..cdf9abb46015c5dbdbcd3839c7b613c6cfa9a021 100644 (file)
@@ -154,6 +154,8 @@ CONFIG_POWER_RESET_AS3722=y
 CONFIG_POWER_RESET_GPIO=y
 CONFIG_SENSORS_LM90=y
 CONFIG_SENSORS_LM95245=y
+CONFIG_WATCHDOG=y
+CONFIG_TEGRA_WATCHDOG=y
 CONFIG_MFD_AS3722=y
 CONFIG_MFD_CROS_EC=y
 CONFIG_MFD_CROS_EC_SPI=y
@@ -194,6 +196,14 @@ CONFIG_SOUND=y
 CONFIG_SND=y
 # CONFIG_SND_SUPPORT_OLD_API is not set
 # CONFIG_SND_DRIVERS is not set
+CONFIG_SND_HDA=y
+CONFIG_SND_HDA_TEGRA=y
+CONFIG_SND_HDA_INPUT_BEEP=y
+CONFIG_SND_HDA_INPUT_JACK=y
+CONFIG_SND_HDA_PATCH_LOADER=y
+CONFIG_SND_HDA_CODEC_REALTEK=y
+CONFIG_SND_HDA_CODEC_HDMI=y
+CONFIG_SND_HDA_GENERIC=y
 # CONFIG_SND_ARM is not set
 # CONFIG_SND_SPI is not set
 # CONFIG_SND_USB is not set
index 6a1c9898fd031e8eef892ab4ccd6e251b3479249..07055eacbb0f24a045b04bf61f923da9c7ebb43c 100644 (file)
@@ -4,6 +4,7 @@ CONFIG_NO_HZ_IDLE=y
 CONFIG_HIGH_RES_TIMERS=y
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_KALLSYMS_ALL=y
+CONFIG_PERF_EVENTS=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 # CONFIG_BLK_DEV_BSG is not set
@@ -134,6 +135,10 @@ CONFIG_DEBUG_KERNEL=y
 # CONFIG_DEBUG_PREEMPT is not set
 # CONFIG_FTRACE is not set
 CONFIG_DEBUG_USER=y
+CONFIG_CORESIGHT=y
+CONFIG_CORESIGHT_SINK_TPIU=y
+CONFIG_CORESIGHT_SINK_ETBV10=y
+CONFIG_CORESIGHT_SOURCE_ETM3X=y
 CONFIG_CRYPTO_DEV_UX500=y
 CONFIG_CRYPTO_DEV_UX500_CRYP=y
 CONFIG_CRYPTO_DEV_UX500_HASH=y
diff --git a/arch/arm/configs/vf610m4_defconfig b/arch/arm/configs/vf610m4_defconfig
new file mode 100644 (file)
index 0000000..aeb2482
--- /dev/null
@@ -0,0 +1,42 @@
+CONFIG_NAMESPACES=y
+CONFIG_BLK_DEV_INITRD=y
+# CONFIG_RD_BZIP2 is not set
+# CONFIG_RD_LZMA is not set
+# CONFIG_RD_XZ is not set
+# CONFIG_RD_LZ4 is not set
+CONFIG_KALLSYMS_ALL=y
+CONFIG_EMBEDDED=y
+# CONFIG_MMU is not set
+CONFIG_ARM_SINGLE_ARMV7M=y
+CONFIG_ARCH_MXC=y
+CONFIG_SOC_VF610=y
+CONFIG_SET_MEM_PARAM=y
+CONFIG_DRAM_BASE=0x8c000000
+CONFIG_FLASH_MEM_BASE=0x8f000000
+CONFIG_FLASH_SIZE=0x01000000
+CONFIG_CMDLINE="console=/dev/ttyLP2"
+CONFIG_XIP_KERNEL=y
+CONFIG_XIP_PHYS_ADDR=0x0f000080
+CONFIG_BINFMT_FLAT=y
+CONFIG_BINFMT_ZFLAT=y
+CONFIG_BINFMT_SHARED_FLAT=y
+# CONFIG_SUSPEND is not set
+# CONFIG_UEVENT_HELPER is not set
+# CONFIG_STANDALONE is not set
+# CONFIG_PREVENT_FIRMWARE_BUILD is not set
+# CONFIG_FIRMWARE_IN_KERNEL is not set
+# CONFIG_ALLOW_DEV_COREDUMP is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=4
+# CONFIG_INPUT_MOUSEDEV is not set
+# CONFIG_KEYBOARD_ATKBD is not set
+# CONFIG_INPUT_MOUSE is not set
+# CONFIG_SERIO is not set
+CONFIG_SERIAL_FSL_LPUART=y
+CONFIG_SERIAL_FSL_LPUART_CONSOLE=y
+# CONFIG_HW_RANDOM is not set
+CONFIG_MFD_SYSCON=y
+# CONFIG_HID is not set
+# CONFIG_USB_SUPPORT is not set
+# CONFIG_MISC_FILESYSTEMS is not set
+# CONFIG_FTRACE is not set
diff --git a/arch/arm/configs/zx_defconfig b/arch/arm/configs/zx_defconfig
new file mode 100644 (file)
index 0000000..b200bb0
--- /dev/null
@@ -0,0 +1,129 @@
+CONFIG_EXPERIMENTAL=y
+CONFIG_SYSVIPC=y
+CONFIG_NO_HZ=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_LOG_BUF_SHIFT=14
+CONFIG_CGROUPS=y
+CONFIG_CGROUP_DEBUG=y
+CONFIG_CGROUP_FREEZER=y
+CONFIG_CGROUP_CPUACCT=y
+CONFIG_RESOURCE_COUNTERS=y
+CONFIG_CGROUP_SCHED=y
+CONFIG_RT_GROUP_SCHED=y
+CONFIG_NAMESPACES=y
+CONFIG_USER_NS=y
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_SYSCTL_SYSCALL=y
+CONFIG_KALLSYMS_ALL=y
+CONFIG_EMBEDDED=y
+CONFIG_PERF_EVENTS=y
+CONFIG_SLAB=y
+# CONFIG_BLK_DEV_BSG is not set
+# CONFIG_IOSCHED_CFQ is not set
+CONFIG_ARCH_ZX=y
+CONFIG_SOC_ZX296702=y
+# CONFIG_SWP_EMULATE is not set
+CONFIG_ARM_ERRATA_754322=y
+CONFIG_ARM_ERRATA_775420=y
+CONFIG_SMP=y
+CONFIG_VMSPLIT_2G=y
+CONFIG_PREEMPT=y
+CONFIG_AEABI=y
+CONFIG_KSM=y
+# CONFIG_IOMMU_SUPPORT is not set
+CONFIG_VFP=y
+CONFIG_NEON=y
+CONFIG_KERNEL_MODE_NEON=y
+# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+CONFIG_HIBERNATION=y
+CONFIG_PM_RUNTIME=y
+CONFIG_PM_DEBUG=y
+CONFIG_SUSPEND_TIME=y
+CONFIG_ZBOOT_ROM_TEXT=0x0
+CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_CMDLINE="console=ttyAMA0,115200 debug earlyprintk root=/dev/ram rw rootwait"
+#CONFIG_NET is not set
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+CONFIG_DEVTMPFS=y
+CONFIG_DEVTMPFS_MOUNT=y
+CONFIG_DMA_CMA=y
+CONFIG_CMA_SIZE_MBYTES=192
+CONFIG_BLK_DEV_LOOP=y
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=1
+CONFIG_BLK_DEV_RAM_SIZE=8192
+CONFIG_UID_STAT=y
+CONFIG_SCSI=y
+CONFIG_BLK_DEV_SD=y
+CONFIG_CHR_DEV_SG=y
+CONFIG_CHR_DEV_SCH=y
+CONFIG_SCSI_MULTI_LUN=y
+CONFIG_MD=y
+CONFIG_BLK_DEV_DM=y
+CONFIG_DM_CRYPT=y
+CONFIG_DM_UEVENT=y
+CONFIG_DM_VERITY=y
+CONFIG_NETDEVICES=y
+# CONFIG_INPUT_MOUSE is not set
+CONFIG_SERIO=y
+CONFIG_SERIO_LIBPS2=y
+CONFIG_SPI=y
+CONFIG_LOGO=y
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_CONSOLE_POLL=y
+CONFIG_SERIAL_AMBA_PL011=y
+CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
+CONFIG_SERIAL_OF_PLATFORM=y
+# CONFIG_LEGACY_PTYS is not set
+# CONFIG_HW_RANDOM is not set
+# CONFIG_HWMON is not set
+# CONFIG_USB_SUPPORT is not set
+CONFIG_MMC=y
+CONFIG_MMC_UNSAFE_RESUME=y
+CONFIG_MMC_BLOCK_MINORS=16
+CONFIG_MMC_DW=y
+CONFIG_MMC_DW_IDMAC=y
+CONFIG_EXT2_FS=y
+CONFIG_EXT4_FS=y
+CONFIG_EXT4_FS_POSIX_ACL=y
+CONFIG_EXT4_FS_SECURITY=y
+CONFIG_EXT4_DEBUG=y
+CONFIG_FUSE_FS=y
+CONFIG_MSDOS_FS=y
+CONFIG_VFAT_FS=y
+CONFIG_FAT_DEFAULT_CODEPAGE=936
+CONFIG_TMPFS=y
+CONFIG_TMPFS_POSIX_ACL=y
+#CONFIG_NFS_FS is not set
+CONFIG_NLS_CODEPAGE_936=y
+CONFIG_NLS_ISO8859_1=y
+CONFIG_NLS_UTF8=y
+CONFIG_PRINTK_TIME=y
+CONFIG_MAGIC_SYSRQ=y
+CONFIG_DEBUG_KERNEL=y
+CONFIG_DEBUG_INFO=y
+CONFIG_FRAME_WARN=4096
+CONFIG_DEBUG_FS=y
+CONFIG_DEBUG_MEMORY_INIT=y
+CONFIG_PANIC_TIMEOUT=5
+# CONFIG_SCHED_DEBUG is not set
+CONFIG_SCHEDSTATS=y
+CONFIG_TIMER_STATS=y
+CONFIG_DEBUG_RT_MUTEXES=y
+CONFIG_DEBUG_SPINLOCK=y
+CONFIG_DEBUG_MUTEXES=y
+CONFIG_RCU_CPU_STALL_TIMEOUT=60
+# CONFIG_FTRACE is not set
+CONFIG_KGDB=y
+CONFIG_KGDB_KDB=y
+# CONFIG_ARM_UNWIND is not set
+CONFIG_DEBUG_PREEMPT=y
+CONFIG_DEBUG_USER=y
+CONFIG_DEBUG_LL=y
+CONFIG_DYNAMIC_DEBUG=y
+CONFIG_STACKTRACE=y
+CONFIG_DEBUG_ZTE_ZX=y
+CONFIG_EARLY_PRINTK=y
+CONFIG_CRYPTO_LZO=y
+CONFIG_GPIOLIB=y
index 89aefe10d66b78102919d05860eb89715d01f85d..34c1d96ef46df68f0f354c111c121f9cee1067ca 100644 (file)
@@ -33,6 +33,10 @@ struct firmware_ops {
         * Sets boot address of specified physical CPU
         */
        int (*set_cpu_boot_addr)(int cpu, unsigned long boot_addr);
+       /*
+        * Gets boot address of specified physical CPU
+        */
+       int (*get_cpu_boot_addr)(int cpu, unsigned long *boot_addr);
        /*
         * Boots specified physical CPU
         */
index cd20029bcd94796ca0f52485ca85efa643b01641..6c7182f32cefeb247068e80af9944b4ff01e3727 100644 (file)
@@ -7,6 +7,7 @@ struct sleep_save_sp {
 };
 
 extern void cpu_resume(void);
+extern void cpu_resume_arm(void);
 extern int cpu_suspend(unsigned long, int (*)(unsigned long));
 
 #endif
index ee5f3084243cfa5c341a8da1320fe5ad21757cde..22e414056a8c253822012c18d389122317fdbfc1 100644 (file)
@@ -5,6 +5,9 @@
  * First, the standard VFP set.
  */
 
+#ifndef __ASM_VFP_H
+#define __ASM_VFP_H
+
 #define FPSID                  cr0
 #define FPSCR                  cr1
 #define MVFR1                  cr6
@@ -87,3 +90,9 @@
 #define VFPOPDESC_UNUSED_BIT   (24)
 #define VFPOPDESC_UNUSED_MASK  (0xFF << VFPOPDESC_UNUSED_BIT)
 #define VFPOPDESC_OPDESC_MASK  (~(VFPOPDESC_LENGTH_MASK | VFPOPDESC_UNUSED_MASK))
+
+#ifndef __ASSEMBLY__
+void vfp_disable(void);
+#endif
+
+#endif /* __ASM_VFP_H */
index 7a2baf913aa0bd669f58b12d028e6c86cb9dcda4..7f7446f6f8060e446c7dc8fe81d3b1a501a04f1f 100644 (file)
 
 #ifdef CONFIG_DEBUG_UART_8250_WORD
                .macro  store, rd, rx:vararg
+        ARM_BE8(rev \rd, \rd)
                str     \rd, \rx
+        ARM_BE8(rev \rd, \rd)
                .endm
 
                .macro  load, rd, rx:vararg
                ldr     \rd, \rx
+       ARM_BE8(rev \rd, \rd)
                .endm
 #else
                .macro  store, rd, rx:vararg
index 2265a199280ca2e40dab1e22d87bb02f7fb66e54..660fa1e4b77beb87bd47b4fc8c4f8fa31d19eaa5 100644 (file)
@@ -16,7 +16,7 @@
 
 #define        UARTn_TXDATA            0x0034
 
-               .macro  addruart, rx, tmp
+               .macro  addruart, rx, tmp, tmp2
                ldr     \rx, =(CONFIG_DEBUG_UART_PHYS)
 
                /*
index 032a316eb802231c7b661e85b9d4d303389d1242..66f736f746841dc6a6ad4fa935647bb7b6173484 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2012 Freescale Semiconductor, Inc.
+ * Copyright (C) 2012-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
 #define IMX6SX_UART_BASE_ADDR(n) IMX6SX_UART##n##_BASE_ADDR
 #define IMX6SX_UART_BASE(n)    IMX6SX_UART_BASE_ADDR(n)
 
+#define IMX7D_UART1_BASE_ADDR  0x30860000
+#define IMX7D_UART2_BASE_ADDR  0x30890000
+#define IMX7D_UART3_BASE_ADDR  0x30880000
+#define IMX7D_UART4_BASE_ADDR  0x30a60000
+#define IMX7D_UART5_BASE_ADDR  0x30a70000
+#define IMX7D_UART6_BASE_ADDR  0x30a80000
+#define IMX7D_UART7_BASE_ADDR  0x30a90000
+#define IMX7D_UART_BASE_ADDR(n) IMX7D_UART##n##_BASE_ADDR
+#define IMX7D_UART_BASE(n)     IMX7D_UART_BASE_ADDR(n)
+
 #define IMX_DEBUG_UART_BASE(soc) soc##_UART_BASE(CONFIG_DEBUG_IMX_UART_PORT)
 
 #ifdef CONFIG_DEBUG_IMX1_UART
 #define UART_PADDR     IMX_DEBUG_UART_BASE(IMX6SL)
 #elif defined(CONFIG_DEBUG_IMX6SX_UART)
 #define UART_PADDR     IMX_DEBUG_UART_BASE(IMX6SX)
+#elif defined(CONFIG_DEBUG_IMX7D_UART)
+#define UART_PADDR     IMX_DEBUG_UART_BASE(IMX7D)
+
 #endif
 
 #endif /* __DEBUG_IMX_UART_H */
index 92ef808a23377275124a59550b6ab86f3e163486..f7d8323cefccf8d7beacc79b9d99805efd967060 100644 (file)
 */
 #include <linux/amba/serial.h>
 
+#ifdef CONFIG_DEBUG_ZTE_ZX
+#undef UART01x_DR
+#undef UART01x_FR
+#define UART01x_DR     0x04
+#define UART01x_FR     0x14
+#endif
+
 #ifdef CONFIG_DEBUG_UART_PHYS
                .macro  addruart, rp, rv, tmp
                ldr     \rp, =CONFIG_DEBUG_UART_PHYS
index 78c91b5f97d4943e896b4d566f71d491f9e17b22..ea9646cc2a0ed7eba2fa4f7f7638c0802642edcc 100644 (file)
@@ -35,7 +35,7 @@
 
 #else /* !CONFIG_MMU */
                .macro  addruart_current, rx, tmp1, tmp2
-               addruart        \rx, \tmp1
+               addruart        \rx, \tmp1, \tmp2
                .endm
 
 #endif /* CONFIG_MMU */
index 7d37bfc508306b52a735f2de8d5c27d795bb6fa3..6060dbc7844e1640ff7148e8a2ef08657c8d7245 100644 (file)
@@ -118,6 +118,16 @@ ENDPROC(cpu_resume_after_mmu)
 
        .text
        .align
+
+#ifdef CONFIG_MMU
+       .arm
+ENTRY(cpu_resume_arm)
+ THUMB(        adr     r9, BSYM(1f)    )       @ Kernel is entered in ARM.
+ THUMB(        bx      r9              )       @ If this is a Thumb-2 kernel,
+ THUMB(        .thumb                  )       @ switch to Thumb now.
+ THUMB(1:                      )
+#endif
+
 ENTRY(cpu_resume)
 ARM_BE8(setend be)                     @ ensure we are in BE mode
 #ifdef CONFIG_ARM_VIRT_EXT
@@ -150,6 +160,10 @@ THUMB(     mov     sp, r2                  )
 THUMB( bx      r3                      )
 ENDPROC(cpu_resume)
 
+#ifdef CONFIG_MMU
+ENDPROC(cpu_resume_arm)
+#endif
+
        .align 2
 _sleep_save_sp:
        .long   sleep_save_sp - .
index 4fa8b4541e64fa06836c29863a574233a97227c8..c5bbf8bb8c0f1653ce54cbd44835eae42a12948a 100644 (file)
@@ -1,13 +1,8 @@
 #
 # Makefile for the linux kernel.
 #
-ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include
-asflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include
-
 obj-y          := soc.o
 
-obj-$(CONFIG_SOC_AT91SAM9)     += sam9_smc.o
-
 # CPU-specific support
 obj-$(CONFIG_SOC_AT91RM9200)   += at91rm9200.o
 obj-$(CONFIG_SOC_AT91SAM9)     += at91sam9.o
diff --git a/arch/arm/mach-at91/Makefile.boot b/arch/arm/mach-at91/Makefile.boot
deleted file mode 100644 (file)
index 29ed0fa..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-# Note: the following conditions must always be true:
-#   ZRELADDR == virt_to_phys(TEXTADDR)
-#   PARAMS_PHYS must be within 4MB of ZRELADDR
-#   INITRD_PHYS must be in RAM
-
-   zreladdr-y  += 0x20008000
-params_phys-y  := 0x20000100
-initrd_phys-y  := 0x20410000
diff --git a/arch/arm/mach-at91/include/mach/at91_ramc.h b/arch/arm/mach-at91/include/mach/at91_ramc.h
deleted file mode 100644 (file)
index 493bc48..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Header file for the Atmel RAM Controller
- *
- * Copyright (C) 2011 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
- *
- * Under GPLv2 only
- */
-
-#ifndef __AT91_RAMC_H__
-#define __AT91_RAMC_H__
-
-#ifndef __ASSEMBLY__
-extern void __iomem *at91_ramc_base[];
-
-#define at91_ramc_read(id, field) \
-       __raw_readl(at91_ramc_base[id] + field)
-
-#define at91_ramc_write(id, field, value) \
-       __raw_writel(value, at91_ramc_base[id] + field)
-#else
-.extern at91_ramc_base
-#endif
-
-#include <soc/at91/at91rm9200_sdramc.h>
-#include <soc/at91/at91sam9_ddrsdr.h>
-#include <soc/at91/at91sam9_sdramc.h>
-
-#endif /* __AT91_RAMC_H__ */
diff --git a/arch/arm/mach-at91/include/mach/at91rm9200_mc.h b/arch/arm/mach-at91/include/mach/at91rm9200_mc.h
deleted file mode 100644 (file)
index aeaadfb..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * arch/arm/mach-at91/include/mach/at91rm9200_mc.h
- *
- * Copyright (C) 2005 Ivan Kokshaysky
- * Copyright (C) SAN People
- *
- * Memory Controllers (MC, EBI, SMC, SDRAMC, BFC) - System peripherals registers.
- * Based on AT91RM9200 datasheet revision E.
- *
- * 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 AT91RM9200_MC_H
-#define AT91RM9200_MC_H
-
-/* Memory Controller */
-#define AT91_MC_RCR            0x00                    /* MC Remap Control Register */
-#define                AT91_MC_RCB             (1 <<  0)               /* Remap Command Bit */
-
-#define AT91_MC_ASR            0x04                    /* MC Abort Status Register */
-#define                AT91_MC_UNADD           (1 <<  0)               /* Undefined Address Abort Status */
-#define                AT91_MC_MISADD          (1 <<  1)               /* Misaligned Address Abort Status */
-#define                AT91_MC_ABTSZ           (3 <<  8)               /* Abort Size Status */
-#define                        AT91_MC_ABTSZ_BYTE              (0 << 8)
-#define                        AT91_MC_ABTSZ_HALFWORD          (1 << 8)
-#define                        AT91_MC_ABTSZ_WORD              (2 << 8)
-#define                AT91_MC_ABTTYP          (3 << 10)               /* Abort Type Status */
-#define                        AT91_MC_ABTTYP_DATAREAD         (0 << 10)
-#define                        AT91_MC_ABTTYP_DATAWRITE        (1 << 10)
-#define                        AT91_MC_ABTTYP_FETCH            (2 << 10)
-#define                AT91_MC_MST0            (1 << 16)               /* ARM920T Abort Source */
-#define                AT91_MC_MST1            (1 << 17)               /* PDC Abort Source */
-#define                AT91_MC_MST2            (1 << 18)               /* UHP Abort Source */
-#define                AT91_MC_MST3            (1 << 19)               /* EMAC Abort Source */
-#define                AT91_MC_SVMST0          (1 << 24)               /* Saved ARM920T Abort Source */
-#define                AT91_MC_SVMST1          (1 << 25)               /* Saved PDC Abort Source */
-#define                AT91_MC_SVMST2          (1 << 26)               /* Saved UHP Abort Source */
-#define                AT91_MC_SVMST3          (1 << 27)               /* Saved EMAC Abort Source */
-
-#define AT91_MC_AASR           0x08                    /* MC Abort Address Status Register */
-
-#define AT91_MC_MPR            0x0c                    /* MC Master Priority Register */
-#define                AT91_MPR_MSTP0          (7 <<  0)               /* ARM920T Priority */
-#define                AT91_MPR_MSTP1          (7 <<  4)               /* PDC Priority */
-#define                AT91_MPR_MSTP2          (7 <<  8)               /* UHP Priority */
-#define                AT91_MPR_MSTP3          (7 << 12)               /* EMAC Priority */
-
-/* External Bus Interface (EBI) registers */
-#define AT91_EBI_CSA           0x60                    /* Chip Select Assignment Register */
-#define                AT91_EBI_CS0A           (1 << 0)                /* Chip Select 0 Assignment */
-#define                        AT91_EBI_CS0A_SMC               (0 << 0)
-#define                        AT91_EBI_CS0A_BFC               (1 << 0)
-#define                AT91_EBI_CS1A           (1 << 1)                /* Chip Select 1 Assignment */
-#define                        AT91_EBI_CS1A_SMC               (0 << 1)
-#define                        AT91_EBI_CS1A_SDRAMC            (1 << 1)
-#define                AT91_EBI_CS3A           (1 << 3)                /* Chip Select 2 Assignment */
-#define                        AT91_EBI_CS3A_SMC               (0 << 3)
-#define                        AT91_EBI_CS3A_SMC_SMARTMEDIA    (1 << 3)
-#define                AT91_EBI_CS4A           (1 << 4)                /* Chip Select 3 Assignment */
-#define                        AT91_EBI_CS4A_SMC               (0 << 4)
-#define                        AT91_EBI_CS4A_SMC_COMPACTFLASH  (1 << 4)
-#define AT91_EBI_CFGR          (AT91_MC + 0x64)        /* Configuration Register */
-#define                AT91_EBI_DBPUC          (1 << 0)                /* Data Bus Pull-Up Configuration */
-
-/* Static Memory Controller (SMC) registers */
-#define        AT91_SMC_CSR(n)         (0x70 + ((n) * 4))      /* SMC Chip Select Register */
-#define                AT91_SMC_NWS            (0x7f <<  0)            /* Number of Wait States */
-#define                        AT91_SMC_NWS_(x)        ((x) << 0)
-#define                AT91_SMC_WSEN           (1    <<  7)            /* Wait State Enable */
-#define                AT91_SMC_TDF            (0xf  <<  8)            /* Data Float Time */
-#define                        AT91_SMC_TDF_(x)        ((x) << 8)
-#define                AT91_SMC_BAT            (1    << 12)            /* Byte Access Type */
-#define                AT91_SMC_DBW            (3    << 13)            /* Data Bus Width */
-#define                        AT91_SMC_DBW_16         (1 << 13)
-#define                        AT91_SMC_DBW_8          (2 << 13)
-#define                AT91_SMC_DPR            (1 << 15)               /* Data Read Protocol */
-#define                AT91_SMC_ACSS           (3 << 16)               /* Address to Chip Select Setup */
-#define                        AT91_SMC_ACSS_STD       (0 << 16)
-#define                        AT91_SMC_ACSS_1         (1 << 16)
-#define                        AT91_SMC_ACSS_2         (2 << 16)
-#define                        AT91_SMC_ACSS_3         (3 << 16)
-#define                AT91_SMC_RWSETUP        (7 << 24)               /* Read & Write Signal Time Setup */
-#define                        AT91_SMC_RWSETUP_(x)    ((x) << 24)
-#define                AT91_SMC_RWHOLD         (7 << 28)               /* Read & Write Signal Hold Time */
-#define                        AT91_SMC_RWHOLD_(x)     ((x) << 28)
-
-/* Burst Flash Controller register */
-#define AT91_BFC_MR            0xc0                    /* Mode Register */
-#define                AT91_BFC_BFCOM          (3   <<  0)             /* Burst Flash Controller Operating Mode */
-#define                        AT91_BFC_BFCOM_DISABLED (0 << 0)
-#define                        AT91_BFC_BFCOM_ASYNC    (1 << 0)
-#define                        AT91_BFC_BFCOM_BURST    (2 << 0)
-#define                AT91_BFC_BFCC           (3   <<  2)             /* Burst Flash Controller Clock */
-#define                        AT91_BFC_BFCC_MCK       (1 << 2)
-#define                        AT91_BFC_BFCC_DIV2      (2 << 2)
-#define                        AT91_BFC_BFCC_DIV4      (3 << 2)
-#define                AT91_BFC_AVL            (0xf <<  4)             /* Address Valid Latency */
-#define                AT91_BFC_PAGES          (7   <<  8)             /* Page Size */
-#define                        AT91_BFC_PAGES_NO_PAGE  (0 << 8)
-#define                        AT91_BFC_PAGES_16       (1 << 8)
-#define                        AT91_BFC_PAGES_32       (2 << 8)
-#define                        AT91_BFC_PAGES_64       (3 << 8)
-#define                        AT91_BFC_PAGES_128      (4 << 8)
-#define                        AT91_BFC_PAGES_256      (5 << 8)
-#define                        AT91_BFC_PAGES_512      (6 << 8)
-#define                        AT91_BFC_PAGES_1024     (7 << 8)
-#define                AT91_BFC_OEL            (3   << 12)             /* Output Enable Latency */
-#define                AT91_BFC_BAAEN          (1   << 16)             /* Burst Address Advance Enable */
-#define                AT91_BFC_BFOEH          (1   << 17)             /* Burst Flash Output Enable Handling */
-#define                AT91_BFC_MUXEN          (1   << 18)             /* Multiplexed Bus Enable */
-#define                AT91_BFC_RDYEN          (1   << 19)             /* Ready Enable Mode */
-
-#endif
diff --git a/arch/arm/mach-at91/include/mach/at91sam9_smc.h b/arch/arm/mach-at91/include/mach/at91sam9_smc.h
deleted file mode 100644 (file)
index ff54a0c..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * arch/arm/mach-at91/include/mach/at91sam9_smc.h
- *
- * Copyright (C) 2007 Andrew Victor
- * Copyright (C) 2007 Atmel Corporation.
- *
- * Static Memory Controllers (SMC) - System peripherals registers.
- * Based on AT91SAM9261 datasheet revision D.
- *
- * 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 AT91SAM9_SMC_H
-#define AT91SAM9_SMC_H
-
-#ifndef __ASSEMBLY__
-struct sam9_smc_config {
-       /* Setup register */
-       u8 ncs_read_setup;
-       u8 nrd_setup;
-       u8 ncs_write_setup;
-       u8 nwe_setup;
-
-       /* Pulse register */
-       u8 ncs_read_pulse;
-       u8 nrd_pulse;
-       u8 ncs_write_pulse;
-       u8 nwe_pulse;
-
-       /* Cycle register */
-       u16 read_cycle;
-       u16 write_cycle;
-
-       /* Mode register */
-       u32 mode;
-       u8 tdf_cycles:4;
-};
-
-extern void sam9_smc_configure(int id, int cs, struct sam9_smc_config *config);
-extern void sam9_smc_read(int id, int cs, struct sam9_smc_config *config);
-extern void sam9_smc_read_mode(int id, int cs, struct sam9_smc_config *config);
-extern void sam9_smc_write_mode(int id, int cs, struct sam9_smc_config *config);
-#endif
-
-#define AT91_SMC_SETUP         0x00                            /* Setup Register for CS n */
-#define                AT91_SMC_NWESETUP       (0x3f << 0)                     /* NWE Setup Length */
-#define                        AT91_SMC_NWESETUP_(x)   ((x) << 0)
-#define                AT91_SMC_NCS_WRSETUP    (0x3f << 8)                     /* NCS Setup Length in Write Access */
-#define                        AT91_SMC_NCS_WRSETUP_(x)        ((x) << 8)
-#define                AT91_SMC_NRDSETUP       (0x3f << 16)                    /* NRD Setup Length */
-#define                        AT91_SMC_NRDSETUP_(x)   ((x) << 16)
-#define                AT91_SMC_NCS_RDSETUP    (0x3f << 24)                    /* NCS Setup Length in Read Access */
-#define                        AT91_SMC_NCS_RDSETUP_(x)        ((x) << 24)
-
-#define AT91_SMC_PULSE         0x04                            /* Pulse Register for CS n */
-#define                AT91_SMC_NWEPULSE       (0x7f <<  0)                    /* NWE Pulse Length */
-#define                        AT91_SMC_NWEPULSE_(x)   ((x) << 0)
-#define                AT91_SMC_NCS_WRPULSE    (0x7f <<  8)                    /* NCS Pulse Length in Write Access */
-#define                        AT91_SMC_NCS_WRPULSE_(x)((x) << 8)
-#define                AT91_SMC_NRDPULSE       (0x7f << 16)                    /* NRD Pulse Length */
-#define                        AT91_SMC_NRDPULSE_(x)   ((x) << 16)
-#define                AT91_SMC_NCS_RDPULSE    (0x7f << 24)                    /* NCS Pulse Length in Read Access */
-#define                        AT91_SMC_NCS_RDPULSE_(x)((x) << 24)
-
-#define AT91_SMC_CYCLE         0x08                            /* Cycle Register for CS n */
-#define                AT91_SMC_NWECYCLE       (0x1ff << 0 )                   /* Total Write Cycle Length */
-#define                        AT91_SMC_NWECYCLE_(x)   ((x) << 0)
-#define                AT91_SMC_NRDCYCLE       (0x1ff << 16)                   /* Total Read Cycle Length */
-#define                        AT91_SMC_NRDCYCLE_(x)   ((x) << 16)
-
-#define AT91_SMC_MODE          0x0c                            /* Mode Register for CS n */
-#define                AT91_SMC_READMODE       (1 <<  0)                       /* Read Mode */
-#define                AT91_SMC_WRITEMODE      (1 <<  1)                       /* Write Mode */
-#define                AT91_SMC_EXNWMODE       (3 <<  4)                       /* NWAIT Mode */
-#define                        AT91_SMC_EXNWMODE_DISABLE       (0 << 4)
-#define                        AT91_SMC_EXNWMODE_FROZEN        (2 << 4)
-#define                        AT91_SMC_EXNWMODE_READY         (3 << 4)
-#define                AT91_SMC_BAT            (1 <<  8)                       /* Byte Access Type */
-#define                        AT91_SMC_BAT_SELECT             (0 << 8)
-#define                        AT91_SMC_BAT_WRITE              (1 << 8)
-#define                AT91_SMC_DBW            (3 << 12)                       /* Data Bus Width */
-#define                        AT91_SMC_DBW_8                  (0 << 12)
-#define                        AT91_SMC_DBW_16                 (1 << 12)
-#define                        AT91_SMC_DBW_32                 (2 << 12)
-#define                AT91_SMC_TDF            (0xf << 16)                     /* Data Float Time. */
-#define                        AT91_SMC_TDF_(x)                ((x) << 16)
-#define                AT91_SMC_TDFMODE        (1 << 20)                       /* TDF Optimization - Enabled */
-#define                AT91_SMC_PMEN           (1 << 24)                       /* Page Mode Enabled */
-#define                AT91_SMC_PS             (3 << 28)                       /* Page Size */
-#define                        AT91_SMC_PS_4                   (0 << 28)
-#define                        AT91_SMC_PS_8                   (1 << 28)
-#define                        AT91_SMC_PS_16                  (2 << 28)
-#define                        AT91_SMC_PS_32                  (3 << 28)
-
-#endif
index 5062699cbb1258697c8f95046f30a125e4e14cae..1e184767c3be5d49f207c17438d078c60896a28b 100644 (file)
@@ -233,7 +233,7 @@ static void at91_pm_set_standby(void (*at91_standby)(void))
  */
 static void at91rm9200_standby(void)
 {
-       u32 lpr = at91_ramc_read(0, AT91RM9200_SDRAMC_LPR);
+       u32 lpr = at91_ramc_read(0, AT91_MC_SDRAMC_LPR);
 
        asm volatile(
                "b    1f\n\t"
@@ -244,8 +244,8 @@ static void at91rm9200_standby(void)
                "    mcr    p15, 0, %0, c7, c0, 4\n\t"
                "    str    %5, [%1, %2]"
                :
-               : "r" (0), "r" (at91_ramc_base[0]), "r" (AT91RM9200_SDRAMC_LPR),
-                 "r" (1), "r" (AT91RM9200_SDRAMC_SRR),
+               : "r" (0), "r" (at91_ramc_base[0]), "r" (AT91_MC_SDRAMC_LPR),
+                 "r" (1), "r" (AT91_MC_SDRAMC_SRR),
                  "r" (lpr));
 }
 
@@ -414,7 +414,7 @@ void __init at91rm9200_pm_init(void)
        /*
         * AT91RM9200 SDRAM low-power mode cannot be used with self-refresh.
         */
-       at91_ramc_write(0, AT91RM9200_SDRAMC_LPR, 0);
+       at91_ramc_write(0, AT91_MC_SDRAMC_LPR, 0);
 
        at91_pm_data.uhp_udp_mask = AT91RM9200_PMC_UHP | AT91RM9200_PMC_UDP;
        at91_pm_data.memctrl = AT91_MEMCTRL_MC;
index ecd875a91d5218281049b6b4b36924ddcc62b1d3..3fcf8810f14e5bdfeb54e41efcd03474aaeaa753 100644 (file)
 
 #include <asm/proc-fns.h>
 
-#include <mach/at91_ramc.h>
+#include <linux/mfd/syscon/atmel-mc.h>
+#include <soc/at91/at91sam9_ddrsdr.h>
+#include <soc/at91/at91sam9_sdramc.h>
+
+#ifndef __ASSEMBLY__
+extern void __iomem *at91_ramc_base[];
+
+#define at91_ramc_read(id, field) \
+       __raw_readl(at91_ramc_base[id] + field)
+
+#define at91_ramc_write(id, field, value) \
+       __raw_writel(value, at91_ramc_base[id] + field)
+#endif
 
 #define AT91_MEMCTRL_MC                0
 #define AT91_MEMCTRL_SDRAMC    1
index bd22b2c8a05190423c84d71ca76b114a88c27571..0d95f488b47a7fa40f7f837083e5b594c329dd65 100644 (file)
@@ -13,7 +13,6 @@
  */
 #include <linux/linkage.h>
 #include <linux/clk/at91_pmc.h>
-#include <mach/at91_ramc.h>
 #include "pm.h"
 
 #define        SRAMC_SELF_FRESH_ACTIVE         0x01
@@ -216,7 +215,7 @@ ENTRY(at91_sramc_self_refresh)
 
        /* Active SDRAM self-refresh mode */
        mov     r3, #1
-       str     r3, [r2, #AT91RM9200_SDRAMC_SRR]
+       str     r3, [r2, #AT91_MC_SDRAMC_SRR]
        b       exit_sramc_sf
 
 ddrc_sf:
diff --git a/arch/arm/mach-at91/sam9_smc.c b/arch/arm/mach-at91/sam9_smc.c
deleted file mode 100644 (file)
index 826315a..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * linux/arch/arm/mach-at91/sam9_smc.c
- *
- * Copyright (C) 2008 Andrew Victor
- * Copyright (C) 2011 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.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 <linux/module.h>
-#include <linux/io.h>
-#include <linux/of.h>
-#include <linux/of_address.h>
-
-#include <mach/at91sam9_smc.h>
-
-#include "sam9_smc.h"
-
-
-#define AT91_SMC_CS(id, n)     (smc_base_addr[id] + ((n) * 0x10))
-
-static void __iomem *smc_base_addr[2];
-
-static void sam9_smc_cs_write_mode(void __iomem *base,
-                                       struct sam9_smc_config *config)
-{
-       __raw_writel(config->mode
-                  | AT91_SMC_TDF_(config->tdf_cycles),
-                  base + AT91_SMC_MODE);
-}
-
-void sam9_smc_write_mode(int id, int cs,
-                                       struct sam9_smc_config *config)
-{
-       sam9_smc_cs_write_mode(AT91_SMC_CS(id, cs), config);
-}
-EXPORT_SYMBOL_GPL(sam9_smc_write_mode);
-
-static void sam9_smc_cs_configure(void __iomem *base,
-                                       struct sam9_smc_config *config)
-{
-
-       /* Setup register */
-       __raw_writel(AT91_SMC_NWESETUP_(config->nwe_setup)
-                  | AT91_SMC_NCS_WRSETUP_(config->ncs_write_setup)
-                  | AT91_SMC_NRDSETUP_(config->nrd_setup)
-                  | AT91_SMC_NCS_RDSETUP_(config->ncs_read_setup),
-                  base + AT91_SMC_SETUP);
-
-       /* Pulse register */
-       __raw_writel(AT91_SMC_NWEPULSE_(config->nwe_pulse)
-                  | AT91_SMC_NCS_WRPULSE_(config->ncs_write_pulse)
-                  | AT91_SMC_NRDPULSE_(config->nrd_pulse)
-                  | AT91_SMC_NCS_RDPULSE_(config->ncs_read_pulse),
-                  base + AT91_SMC_PULSE);
-
-       /* Cycle register */
-       __raw_writel(AT91_SMC_NWECYCLE_(config->write_cycle)
-                  | AT91_SMC_NRDCYCLE_(config->read_cycle),
-                  base + AT91_SMC_CYCLE);
-
-       /* Mode register */
-       sam9_smc_cs_write_mode(base, config);
-}
-
-void sam9_smc_configure(int id, int cs,
-                                       struct sam9_smc_config *config)
-{
-       sam9_smc_cs_configure(AT91_SMC_CS(id, cs), config);
-}
-EXPORT_SYMBOL_GPL(sam9_smc_configure);
-
-static void sam9_smc_cs_read_mode(void __iomem *base,
-                                       struct sam9_smc_config *config)
-{
-       u32 val = __raw_readl(base + AT91_SMC_MODE);
-
-       config->mode = (val & ~AT91_SMC_NWECYCLE);
-       config->tdf_cycles = (val & AT91_SMC_NWECYCLE) >> 16 ;
-}
-
-void sam9_smc_read_mode(int id, int cs,
-                                       struct sam9_smc_config *config)
-{
-       sam9_smc_cs_read_mode(AT91_SMC_CS(id, cs), config);
-}
-EXPORT_SYMBOL_GPL(sam9_smc_read_mode);
-
-static void sam9_smc_cs_read(void __iomem *base,
-                                       struct sam9_smc_config *config)
-{
-       u32 val;
-
-       /* Setup register */
-       val = __raw_readl(base + AT91_SMC_SETUP);
-
-       config->nwe_setup = val & AT91_SMC_NWESETUP;
-       config->ncs_write_setup = (val & AT91_SMC_NCS_WRSETUP) >> 8;
-       config->nrd_setup = (val & AT91_SMC_NRDSETUP) >> 16;
-       config->ncs_read_setup = (val & AT91_SMC_NCS_RDSETUP) >> 24;
-
-       /* Pulse register */
-       val = __raw_readl(base + AT91_SMC_PULSE);
-
-       config->nwe_pulse = val & AT91_SMC_NWEPULSE;
-       config->ncs_write_pulse = (val & AT91_SMC_NCS_WRPULSE) >> 8;
-       config->nrd_pulse = (val & AT91_SMC_NRDPULSE) >> 16;
-       config->ncs_read_pulse = (val & AT91_SMC_NCS_RDPULSE) >> 24;
-
-       /* Cycle register */
-       val = __raw_readl(base + AT91_SMC_CYCLE);
-
-       config->write_cycle = val & AT91_SMC_NWECYCLE;
-       config->read_cycle = (val & AT91_SMC_NRDCYCLE) >> 16;
-
-       /* Mode register */
-       sam9_smc_cs_read_mode(base, config);
-}
-
-void sam9_smc_read(int id, int cs, struct sam9_smc_config *config)
-{
-       sam9_smc_cs_read(AT91_SMC_CS(id, cs), config);
-}
-
-void __init at91sam9_ioremap_smc(int id, u32 addr)
-{
-       if (id > 1) {
-               pr_warn("%s: id > 2\n", __func__);
-               return;
-       }
-       smc_base_addr[id] = ioremap(addr, 512);
-       if (!smc_base_addr[id])
-               pr_warn("Impossible to ioremap smc.%d 0x%x\n", id, addr);
-}
diff --git a/arch/arm/mach-at91/sam9_smc.h b/arch/arm/mach-at91/sam9_smc.h
deleted file mode 100644 (file)
index 3e52dcd..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-/*
- * linux/arch/arm/mach-at91/sam9_smc.
- *
- * Copyright (C) 2008 Andrew Victor
- *
- * 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.
- */
-
-extern void __init at91sam9_ioremap_smc(int id, u32 addr);
index 8b11f44bb36e5a3dcfe59cf331e18730e71c9ec5..e9184feffc4e5b55d46008be3f3587d2756ea6e3 100644 (file)
@@ -19,6 +19,7 @@ config ARCH_BCM_IPROC
        select ARCH_REQUIRE_GPIOLIB
        select ARM_AMBA
        select PINCTRL
+       select MTD_NAND_BRCMNAND
        help
          This enables support for systems based on Broadcom IPROC architected SoCs.
          The IPROC complex contains one or more ARM CPUs along with common
@@ -144,6 +145,7 @@ config ARCH_BRCMSTB
        select BRCMSTB_GISB_ARB
        select BRCMSTB_L2_IRQ
        select BCM7120_L2_IRQ
+       select ARCH_WANT_OPTIONAL_GPIOLIB
        help
          Say Y if you intend to run the kernel on a Broadcom ARM-based STB
          chipset.
index 4c38674c73ecb15d92702ca58b4d0f95bf2888fe..4fb0da458e9171e929f303e40a8ccc114666c8cd 100644 (file)
@@ -38,10 +38,15 @@ obj-$(CONFIG_ARCH_BCM2835)  += board_bcm2835.o
 obj-$(CONFIG_ARCH_BCM_5301X)   += bcm_5301x.o
 
 # BCM63XXx
-obj-$(CONFIG_ARCH_BCM_63XX)    := bcm63xx.o
+ifeq ($(CONFIG_ARCH_BCM_63XX),y)
+CFLAGS_bcm63xx_headsmp.o       += -march=armv7-a
+obj-y                          += bcm63xx.o
+obj-$(CONFIG_SMP)              += bcm63xx_smp.o bcm63xx_headsmp.o \
+                                  bcm63xx_pmb.o
+endif
 
 ifeq ($(CONFIG_ARCH_BRCMSTB),y)
 CFLAGS_platsmp-brcmstb.o       += -march=armv7-a
 obj-y                          += brcmstb.o
-obj-$(CONFIG_SMP)              += headsmp-brcmstb.o platsmp-brcmstb.o
+obj-$(CONFIG_SMP)              += platsmp-brcmstb.o
 endif
diff --git a/arch/arm/mach-bcm/bcm63xx_headsmp.S b/arch/arm/mach-bcm/bcm63xx_headsmp.S
new file mode 100644 (file)
index 0000000..c7af397
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ *  Copyright (C) 2015, Broadcom Corporation
+ *  All Rights Reserved
+ *
+ * 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/linkage.h>
+#include <linux/init.h>
+#include <asm/assembler.h>
+
+ENTRY(bcm63138_secondary_startup)
+ ARM_BE8(setend        be)
+       /*
+        * L1 cache does have unpredictable contents at power-up clean its
+        * contents without flushing
+        */
+       bl      v7_invalidate_l1
+       nop
+
+       b       secondary_startup
+ENDPROC(bcm63138_secondary_startup)
diff --git a/arch/arm/mach-bcm/bcm63xx_pmb.c b/arch/arm/mach-bcm/bcm63xx_pmb.c
new file mode 100644 (file)
index 0000000..de061ec
--- /dev/null
@@ -0,0 +1,221 @@
+/*
+ * Broadcom BCM63138 PMB initialization for secondary CPU(s)
+ *
+ * Copyright (C) 2015 Broadcom Corporation
+ * Author: Florian Fainelli <f.fainelli@gmail.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.
+ */
+#include <linux/kernel.h>
+#include <linux/io.h>
+#include <linux/spinlock.h>
+#include <linux/reset/bcm63xx_pmb.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
+
+#include "bcm63xx_smp.h"
+
+/* ARM Control register definitions */
+#define CORE_PWR_CTRL_SHIFT    0
+#define CORE_PWR_CTRL_MASK     0x3
+#define PLL_PWR_ON             BIT(8)
+#define PLL_LDO_PWR_ON         BIT(9)
+#define PLL_CLAMP_ON           BIT(10)
+#define CPU_RESET_N(x)         BIT(13 + (x))
+#define NEON_RESET_N           BIT(15)
+#define PWR_CTRL_STATUS_SHIFT  28
+#define PWR_CTRL_STATUS_MASK   0x3
+#define PWR_DOWN_SHIFT         30
+#define PWR_DOWN_MASK          0x3
+
+/* CPU Power control register definitions */
+#define MEM_PWR_OK             BIT(0)
+#define MEM_PWR_ON             BIT(1)
+#define MEM_CLAMP_ON           BIT(2)
+#define MEM_PWR_OK_STATUS      BIT(4)
+#define MEM_PWR_ON_STATUS      BIT(5)
+#define MEM_PDA_SHIFT          8
+#define MEM_PDA_MASK           0xf
+#define  MEM_PDA_CPU_MASK      0x1
+#define  MEM_PDA_NEON_MASK     0xf
+#define CLAMP_ON               BIT(15)
+#define PWR_OK_SHIFT           16
+#define PWR_OK_MASK            0xf
+#define PWR_ON_SHIFT           20
+#define  PWR_CPU_MASK          0x03
+#define  PWR_NEON_MASK         0x01
+#define PWR_ON_MASK            0xf
+#define PWR_OK_STATUS_SHIFT    24
+#define PWR_OK_STATUS_MASK     0xf
+#define PWR_ON_STATUS_SHIFT    28
+#define PWR_ON_STATUS_MASK     0xf
+
+#define ARM_CONTROL            0x30
+#define ARM_PWR_CONTROL_BASE   0x34
+#define ARM_PWR_CONTROL(x)     (ARM_PWR_CONTROL_BASE + (x) * 0x4)
+#define ARM_NEON_L2            0x3c
+
+/* Perform a value write, then spin until the value shifted by
+ * shift is seen, masked with mask and is different from cond.
+ */
+static int bpcm_wr_rd_mask(void __iomem *master,
+                          unsigned int addr, u32 off, u32 *val,
+                          u32 shift, u32 mask, u32 cond)
+{
+       int ret;
+
+       ret = bpcm_wr(master, addr, off, *val);
+       if (ret)
+               return ret;
+
+       do {
+               ret = bpcm_rd(master, addr, off, val);
+               if (ret)
+                       return ret;
+
+               cpu_relax();
+       } while (((*val >> shift) & mask) != cond);
+
+       return ret;
+}
+
+/* Global lock to serialize accesses to the PMB registers while we
+ * are bringing up the secondary CPU
+ */
+static DEFINE_SPINLOCK(pmb_lock);
+
+static int bcm63xx_pmb_get_resources(struct device_node *dn,
+                                    void __iomem **base,
+                                    unsigned int *cpu,
+                                    unsigned int *addr)
+{
+       struct device_node *pmb_dn;
+       struct of_phandle_args args;
+       int ret;
+
+       ret = of_property_read_u32(dn, "reg", cpu);
+       if (ret) {
+               pr_err("CPU is missing a reg node\n");
+               return ret;
+       }
+
+       ret = of_parse_phandle_with_args(dn, "resets", "#reset-cells",
+                                        0, &args);
+       if (ret) {
+               pr_err("CPU is missing a resets phandle\n");
+               return ret;
+       }
+
+       pmb_dn = args.np;
+       if (args.args_count != 2) {
+               pr_err("reset-controller does not conform to reset-cells\n");
+               return -EINVAL;
+       }
+
+       *base = of_iomap(args.np, 0);
+       if (!*base) {
+               pr_err("failed remapping PMB register\n");
+               return -ENOMEM;
+       }
+
+       /* We do not need the number of zones */
+       *addr = args.args[0];
+
+       return 0;
+}
+
+int bcm63xx_pmb_power_on_cpu(struct device_node *dn)
+{
+       void __iomem *base;
+       unsigned int cpu, addr;
+       unsigned long flags;
+       u32 val, ctrl;
+       int ret;
+
+       ret = bcm63xx_pmb_get_resources(dn, &base, &cpu, &addr);
+       if (ret)
+               return ret;
+
+       /* We would not know how to enable a third and greater CPU */
+       WARN_ON(cpu > 1);
+
+       spin_lock_irqsave(&pmb_lock, flags);
+
+       /* Check if the CPU is already on and save the ARM_CONTROL register
+        * value since we will use it later for CPU de-assert once done with
+        * the CPU-specific power sequence
+        */
+       ret = bpcm_rd(base, addr, ARM_CONTROL, &ctrl);
+       if (ret)
+               goto out;
+
+       if (ctrl & CPU_RESET_N(cpu)) {
+               pr_info("PMB: CPU%d is already powered on\n", cpu);
+               ret = 0;
+               goto out;
+       }
+
+       /* Power on PLL */
+       ret = bpcm_rd(base, addr, ARM_PWR_CONTROL(cpu), &val);
+       if (ret)
+               goto out;
+
+       val |= (PWR_CPU_MASK << PWR_ON_SHIFT);
+
+       ret = bpcm_wr_rd_mask(base, addr, ARM_PWR_CONTROL(cpu), &val,
+                       PWR_ON_STATUS_SHIFT, PWR_CPU_MASK, PWR_CPU_MASK);
+       if (ret)
+               goto out;
+
+       val |= (PWR_CPU_MASK << PWR_OK_SHIFT);
+
+       ret = bpcm_wr_rd_mask(base, addr, ARM_PWR_CONTROL(cpu), &val,
+                       PWR_OK_STATUS_SHIFT, PWR_CPU_MASK, PWR_CPU_MASK);
+       if (ret)
+               goto out;
+
+       val &= ~CLAMP_ON;
+
+       ret = bpcm_wr(base, addr, ARM_PWR_CONTROL(cpu), val);
+       if (ret)
+               goto out;
+
+       /* Power on CPU<N> RAM */
+       val &= ~(MEM_PDA_MASK << MEM_PDA_SHIFT);
+
+       ret = bpcm_wr(base, addr, ARM_PWR_CONTROL(cpu), val);
+       if (ret)
+               goto out;
+
+       val |= MEM_PWR_ON;
+
+       ret = bpcm_wr_rd_mask(base, addr, ARM_PWR_CONTROL(cpu), &val,
+                       0, MEM_PWR_ON_STATUS, MEM_PWR_ON_STATUS);
+       if (ret)
+               goto out;
+
+       val |= MEM_PWR_OK;
+
+       ret = bpcm_wr_rd_mask(base, addr, ARM_PWR_CONTROL(cpu), &val,
+                       0, MEM_PWR_OK_STATUS, MEM_PWR_OK_STATUS);
+       if (ret)
+               goto out;
+
+       val &= ~MEM_CLAMP_ON;
+
+       ret = bpcm_wr(base, addr, ARM_PWR_CONTROL(cpu), val);
+       if (ret)
+               goto out;
+
+       /* De-assert CPU reset */
+       ctrl |= CPU_RESET_N(cpu);
+
+       ret = bpcm_wr(base, addr, ARM_CONTROL, ctrl);
+out:
+       spin_unlock_irqrestore(&pmb_lock, flags);
+       iounmap(base);
+       return ret;
+}
diff --git a/arch/arm/mach-bcm/bcm63xx_smp.c b/arch/arm/mach-bcm/bcm63xx_smp.c
new file mode 100644 (file)
index 0000000..3f014f1
--- /dev/null
@@ -0,0 +1,169 @@
+/*
+ * Broadcom BCM63138 DSL SoCs SMP support code
+ *
+ * Copyright (C) 2015, Broadcom Corporation
+ *
+ * Licensed under the terms of the GPLv2
+ */
+
+#include <linux/delay.h>
+#include <linux/init.h>
+#include <linux/smp.h>
+#include <linux/io.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
+
+#include <asm/cacheflush.h>
+#include <asm/smp_scu.h>
+#include <asm/smp_plat.h>
+#include <asm/vfp.h>
+
+#include "bcm63xx_smp.h"
+
+/* Size of mapped Cortex A9 SCU address space */
+#define CORTEX_A9_SCU_SIZE     0x58
+
+/*
+ * Enable the Cortex A9 Snoop Control Unit
+ *
+ * By the time this is called we already know there are multiple
+ * cores present.  We assume we're running on a Cortex A9 processor,
+ * so any trouble getting the base address register or getting the
+ * SCU base is a problem.
+ *
+ * Return 0 if successful or an error code otherwise.
+ */
+static int __init scu_a9_enable(void)
+{
+       unsigned long config_base;
+       void __iomem *scu_base;
+       unsigned int i, ncores;
+
+       if (!scu_a9_has_base()) {
+               pr_err("no configuration base address register!\n");
+               return -ENXIO;
+       }
+
+       /* Config base address register value is zero for uniprocessor */
+       config_base = scu_a9_get_base();
+       if (!config_base) {
+               pr_err("hardware reports only one core\n");
+               return -ENOENT;
+       }
+
+       scu_base = ioremap((phys_addr_t)config_base, CORTEX_A9_SCU_SIZE);
+       if (!scu_base) {
+               pr_err("failed to remap config base (%lu/%u) for SCU\n",
+                       config_base, CORTEX_A9_SCU_SIZE);
+               return -ENOMEM;
+       }
+
+       scu_enable(scu_base);
+
+       ncores = scu_base ? scu_get_core_count(scu_base) : 1;
+
+       if (ncores > nr_cpu_ids) {
+               pr_warn("SMP: %u cores greater than maximum (%u), clipping\n",
+                               ncores, nr_cpu_ids);
+               ncores = nr_cpu_ids;
+       }
+
+       /* The BCM63138 SoC has two Cortex-A9 CPUs, CPU0 features a complete
+        * and fully functional VFP unit that can be used, but CPU1 does not.
+        * Since we will not be able to trap kernel-mode NEON to force
+        * migration to CPU0, just do not advertise VFP support at all.
+        *
+        * This will make vfp_init bail out and do not attempt to use VFP at
+        * all, for kernel-mode NEON, we do not want to introduce any
+        * conditionals in hot-paths, so we just restrict the system to UP.
+        */
+#ifdef CONFIG_VFP
+       if (ncores > 1) {
+               pr_warn("SMP: secondary CPUs lack VFP unit, disabling VFP\n");
+               vfp_disable();
+
+#ifdef CONFIG_KERNEL_MODE_NEON
+               WARN(1, "SMP: kernel-mode NEON enabled, restricting to UP\n");
+               ncores = 1;
+#endif
+       }
+#endif
+
+       for (i = 0; i < ncores; i++)
+               set_cpu_possible(i, true);
+
+       iounmap(scu_base);      /* That's the last we'll need of this */
+
+       return 0;
+}
+
+static const struct of_device_id bcm63138_bootlut_ids[] = {
+       { .compatible = "brcm,bcm63138-bootlut", },
+       { /* sentinel */ },
+};
+
+#define BOOTLUT_RESET_VECT     0x20
+
+static int bcm63138_smp_boot_secondary(unsigned int cpu,
+                                      struct task_struct *idle)
+{
+       void __iomem *bootlut_base;
+       struct device_node *dn;
+       int ret = 0;
+       u32 val;
+
+       dn = of_find_matching_node(NULL, bcm63138_bootlut_ids);
+       if (!dn) {
+               pr_err("SMP: unable to find bcm63138 boot LUT node\n");
+               return -ENODEV;
+       }
+
+       bootlut_base = of_iomap(dn, 0);
+       of_node_put(dn);
+
+       if (!bootlut_base) {
+               pr_err("SMP: unable to remap boot LUT base register\n");
+               return -ENOMEM;
+       }
+
+       /* Locate the secondary CPU node */
+       dn = of_get_cpu_node(cpu_logical_map(cpu), NULL);
+       if (!dn) {
+               pr_err("SMP: failed to locate secondary CPU%d node\n", cpu);
+               ret = -ENODEV;
+               goto out;
+       }
+
+       /* Write the secondary init routine to the BootLUT reset vector */
+       val = virt_to_phys(bcm63138_secondary_startup);
+       writel_relaxed(val, bootlut_base + BOOTLUT_RESET_VECT);
+
+       /* Power up the core, will jump straight to its reset vector when we
+        * return
+        */
+       ret = bcm63xx_pmb_power_on_cpu(dn);
+       if (ret)
+               goto out;
+out:
+       iounmap(bootlut_base);
+
+       return ret;
+}
+
+static void __init bcm63138_smp_prepare_cpus(unsigned int max_cpus)
+{
+       int ret;
+
+       ret = scu_a9_enable();
+       if (ret) {
+               pr_warn("SMP: Cortex-A9 SCU setup failed\n");
+               return;
+       }
+}
+
+struct smp_operations bcm63138_smp_ops __initdata = {
+       .smp_prepare_cpus       = bcm63138_smp_prepare_cpus,
+       .smp_boot_secondary     = bcm63138_smp_boot_secondary,
+};
+
+CPU_METHOD_OF_DECLARE(bcm63138_smp, "brcm,bcm63138", &bcm63138_smp_ops);
diff --git a/arch/arm/mach-bcm/bcm63xx_smp.h b/arch/arm/mach-bcm/bcm63xx_smp.h
new file mode 100644 (file)
index 0000000..50b7604
--- /dev/null
@@ -0,0 +1,9 @@
+#ifndef __BCM63XX_SMP_H
+#define __BCM63XX_SMP_H
+
+struct device_node;
+
+extern void bcm63138_secondary_startup(void);
+extern int bcm63xx_pmb_power_on_cpu(struct device_node *dn);
+
+#endif /* __BCM63XX_SMP_H */
index e9bcbdbce55550e04e83a792d55b2eba65f94c32..7aef92720eb4fc126b67b176e0bd3ab79d254957 100644 (file)
@@ -18,15 +18,16 @@ static bool first_fault = true;
 static int bcm5301x_abort_handler(unsigned long addr, unsigned int fsr,
                                 struct pt_regs *regs)
 {
-       if (fsr == 0x1c06 && first_fault) {
+       if ((fsr == 0x1406 || fsr == 0x1c06) && first_fault) {
                first_fault = false;
 
                /*
-                * These faults with code 0x1c06 happens for no good reason,
-                * possibly left over from the CFE boot loader.
+                * These faults with codes 0x1406 (BCM4709) or 0x1c06 happens
+                * for no good reason, possibly left over from the CFE boot
+                * loader.
                 */
                pr_warn("External imprecise Data abort at addr=%#lx, fsr=%#x ignored.\n",
-               addr, fsr);
+                       addr, fsr);
 
                /* Returning non-zero causes fault display and panic */
                return 0;
index 70f2f3925f0e8e08487abb20b55ba580c4026c43..0f7b9eac3d15d23dc7faa78699e119c7faad547c 100644 (file)
@@ -12,7 +12,6 @@
  * GNU General Public License for more details.
  */
 
-#include <linux/delay.h>
 #include <linux/init.h>
 #include <linux/irqchip.h>
 #include <linux/of_address.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 
-#define PM_RSTC                                0x1c
-#define PM_RSTS                                0x20
-#define PM_WDOG                                0x24
-
-#define PM_PASSWORD                    0x5a000000
-#define PM_RSTC_WRCFG_MASK             0x00000030
-#define PM_RSTC_WRCFG_FULL_RESET       0x00000020
-#define PM_RSTS_HADWRH_SET             0x00000040
-
-#define BCM2835_PERIPH_PHYS    0x20000000
-#define BCM2835_PERIPH_VIRT    0xf0000000
-#define BCM2835_PERIPH_SIZE    SZ_16M
-
-static void __iomem *wdt_regs;
-
-/*
- * The machine restart method can be called from an atomic context so we won't
- * be able to ioremap the regs then.
- */
-static void bcm2835_setup_restart(void)
-{
-       struct device_node *np = of_find_compatible_node(NULL, NULL,
-                                               "brcm,bcm2835-pm-wdt");
-       if (WARN(!np, "unable to setup watchdog restart"))
-               return;
-
-       wdt_regs = of_iomap(np, 0);
-       WARN(!wdt_regs, "failed to remap watchdog regs");
-}
-
-static void bcm2835_restart(enum reboot_mode mode, const char *cmd)
-{
-       u32 val;
-
-       if (!wdt_regs)
-               return;
-
-       /* use a timeout of 10 ticks (~150us) */
-       writel_relaxed(10 | PM_PASSWORD, wdt_regs + PM_WDOG);
-       val = readl_relaxed(wdt_regs + PM_RSTC);
-       val &= ~PM_RSTC_WRCFG_MASK;
-       val |= PM_PASSWORD | PM_RSTC_WRCFG_FULL_RESET;
-       writel_relaxed(val, wdt_regs + PM_RSTC);
-
-       /* No sleeping, possibly atomic. */
-       mdelay(1);
-}
-
-/*
- * We can't really power off, but if we do the normal reset scheme, and
- * indicate to bootcode.bin not to reboot, then most of the chip will be
- * powered off.
- */
-static void bcm2835_power_off(void)
-{
-       u32 val;
-
-       /*
-        * We set the watchdog hard reset bit here to distinguish this reset
-        * from the normal (full) reset. bootcode.bin will not reboot after a
-        * hard reset.
-        */
-       val = readl_relaxed(wdt_regs + PM_RSTS);
-       val &= ~PM_RSTC_WRCFG_MASK;
-       val |= PM_PASSWORD | PM_RSTS_HADWRH_SET;
-       writel_relaxed(val, wdt_regs + PM_RSTS);
-
-       /* Continue with normal reset mechanism */
-       bcm2835_restart(REBOOT_HARD, "");
-}
-
-static struct map_desc io_map __initdata = {
-       .virtual = BCM2835_PERIPH_VIRT,
-       .pfn = __phys_to_pfn(BCM2835_PERIPH_PHYS),
-       .length = BCM2835_PERIPH_SIZE,
-       .type = MT_DEVICE
-};
-
-static void __init bcm2835_map_io(void)
-{
-       iotable_init(&io_map, 1);
-}
-
 static void __init bcm2835_init(void)
 {
        int ret;
 
-       bcm2835_setup_restart();
-       if (wdt_regs)
-               pm_power_off = bcm2835_power_off;
-
        bcm2835_init_clocks();
 
        ret = of_platform_populate(NULL, of_default_bus_match_table, NULL,
@@ -129,9 +41,6 @@ static const char * const bcm2835_compat[] = {
 };
 
 DT_MACHINE_START(BCM2835, "BCM2835")
-       .map_io = bcm2835_map_io,
-       .init_irq = irqchip_init,
        .init_machine = bcm2835_init,
-       .restart = bcm2835_restart,
        .dt_compat = bcm2835_compat
 MACHINE_END
diff --git a/arch/arm/mach-bcm/brcmstb.h b/arch/arm/mach-bcm/brcmstb.h
deleted file mode 100644 (file)
index ec0c3d1..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Copyright (C) 2013-2014 Broadcom Corporation
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation version 2.
- *
- * This program is distributed "as is" WITHOUT ANY WARRANTY of any
- * kind, whether express or implied; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- */
-
-#ifndef __BRCMSTB_H__
-#define __BRCMSTB_H__
-
-void brcmstb_secondary_startup(void);
-
-#endif /* __BRCMSTB_H__ */
diff --git a/arch/arm/mach-bcm/headsmp-brcmstb.S b/arch/arm/mach-bcm/headsmp-brcmstb.S
deleted file mode 100644 (file)
index 199c1ea..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * SMP boot code for secondary CPUs
- * Based on arch/arm/mach-tegra/headsmp.S
- *
- * Copyright (C) 2010 NVIDIA, Inc.
- * Copyright (C) 2013-2014 Broadcom Corporation
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation version 2.
- *
- * This program is distributed "as is" WITHOUT ANY WARRANTY of any
- * kind, whether express or implied; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- */
-
-#include <asm/assembler.h>
-#include <linux/linkage.h>
-#include <linux/init.h>
-
-        .section ".text.head", "ax"
-
-ENTRY(brcmstb_secondary_startup)
-        /*
-         * Ensure CPU is in a sane state by disabling all IRQs and switching
-         * into SVC mode.
-         */
-        setmode        PSR_I_BIT | PSR_F_BIT | SVC_MODE, r0
-
-        bl      v7_invalidate_l1
-        b       secondary_startup
-ENDPROC(brcmstb_secondary_startup)
index e209e6fc7cafa553fa56ec5f0f2b845d447a0ff7..44d6bddf7a4e788044da329ce79f4a66ae6b07ed 100644 (file)
@@ -30,8 +30,6 @@
 #include <asm/mach-types.h>
 #include <asm/smp_plat.h>
 
-#include "brcmstb.h"
-
 enum {
        ZONE_MAN_CLKEN_MASK             = BIT(0),
        ZONE_MAN_RESET_CNTL_MASK        = BIT(1),
@@ -153,7 +151,7 @@ static void brcmstb_cpu_boot(u32 cpu)
         * Set the reset vector to point to the secondary_startup
         * routine
         */
-       cpu_set_boot_addr(cpu, virt_to_phys(brcmstb_secondary_startup));
+       cpu_set_boot_addr(cpu, virt_to_phys(secondary_startup));
 
        /* Unhalt the cpu */
        cpu_rst_cfg_set(cpu, 0);
index 3e40a947f3ea4c1552176d6f5e1fe8961de40bb6..742d53a5f7f94fc8ee58ed3fdd69a2e4c49f75b6 100644 (file)
@@ -6,6 +6,7 @@ menuconfig ARCH_BERLIN
        select DW_APB_ICTL
        select DW_APB_TIMER_OF
        select GENERIC_IRQ_CHIP
+       select MFD_SYSCON
        select PINCTRL
 
 if ARCH_BERLIN
index 4a4c56a58ad351f03a935b7e9b9938740ff049bf..dc82a3486b05e6b208c37fe8f93707d9388b06db 100644 (file)
 #include <linux/init.h>
 #include <asm/assembler.h>
 
-ENTRY(berlin_secondary_startup)
- ARM_BE8(setend be)
-       bl      v7_invalidate_l1
-       b       secondary_startup
-ENDPROC(berlin_secondary_startup)
-
 /*
  * If the following instruction is set in the reset exception vector, CPUs
  * will fetch the value of the software reset address vector when being
index 702e7982015abcf81ba68cde339bfa2512ad8abc..34a3753e73564ed99cf92bbaee7c94ed5a869acb 100644 (file)
@@ -22,7 +22,6 @@
 #define RESET_VECT             0x00
 #define SW_RESET_ADDR          0x94
 
-extern void berlin_secondary_startup(void);
 extern u32 boot_inst;
 
 static void __iomem *cpu_ctrl;
@@ -85,7 +84,7 @@ static void __init berlin_smp_prepare_cpus(unsigned int max_cpus)
         * Write the secondary startup address into the SW reset address
         * vector. This is used by boot_inst.
         */
-       writel(virt_to_phys(berlin_secondary_startup), vectors_base + SW_RESET_ADDR);
+       writel(virt_to_phys(secondary_startup), vectors_base + SW_RESET_ADDR);
 
        iounmap(vectors_base);
 unmap_scu:
index 39e58b48e826dc4350f54a0aa170444855723815..f9f9713aacdd605a35c7ca15dc350ded1380cef8 100644 (file)
@@ -36,7 +36,7 @@ extern void __iomem *da8xx_syscfg1_base;
 
 /*
  * If the DA850/OMAP-L138/AM18x SoC on board is of a higher speed grade
- * (than the regular 300Mhz variant), the board code should set this up
+ * (than the regular 300MHz variant), the board code should set this up
  * with the supported speed before calling da850_register_cpufreq().
  */
 extern unsigned int da850_max_speed;
index 36f22c1a31fe596a71c596aa21d4e589435f15ba..3c950f5864f34194b87f39c526ec3ac1b58c0f84 100644 (file)
 #include <linux/platform_device.h>
 #include <linux/i2c.h>
 #include <linux/i2c-gpio.h>
+#include <linux/mmc/host.h>
+#include <linux/spi/spi.h>
+#include <linux/spi/mmc_spi.h>
+#include <linux/platform_data/video-ep93xx.h>
+#include <linux/platform_data/spi-ep93xx.h>
+#include <linux/gpio.h>
 
 #include <mach/hardware.h>
-#include <linux/platform_data/video-ep93xx.h>
 #include <mach/gpio-ep93xx.h>
 
 #include <asm/mach-types.h>
@@ -40,6 +45,132 @@ static struct ep93xxfb_mach_info __initdata simone_fb_info = {
        .flags          = EP93XXFB_USE_SDCSN0 | EP93XXFB_PCLK_FALLING,
 };
 
+/*
+ * GPIO lines used for MMC card detection.
+ */
+#define MMC_CARD_DETECT_GPIO EP93XX_GPIO_LINE_EGPIO0
+
+/*
+ * Up to v1.3, the Sim.One used SFRMOUT as SD card chip select, but this goes
+ * low between multi-message command blocks. From v1.4, it uses a GPIO instead.
+ * v1.3 parts will still work, since the signal on SFRMOUT is automatic.
+ */
+#define MMC_CHIP_SELECT_GPIO EP93XX_GPIO_LINE_EGPIO1
+
+/*
+ * MMC SPI chip select GPIO handling. If you are using SFRMOUT (SFRM1) signal,
+ * you can leave these empty and pass NULL as .controller_data.
+ */
+
+static int simone_mmc_spi_setup(struct spi_device *spi)
+{
+       unsigned int gpio = MMC_CHIP_SELECT_GPIO;
+       int err;
+
+       err = gpio_request(gpio, spi->modalias);
+       if (err)
+               return err;
+
+       err = gpio_direction_output(gpio, 1);
+       if (err) {
+               gpio_free(gpio);
+               return err;
+       }
+
+       return 0;
+}
+
+static void simone_mmc_spi_cleanup(struct spi_device *spi)
+{
+       unsigned int gpio = MMC_CHIP_SELECT_GPIO;
+
+       gpio_set_value(gpio, 1);
+       gpio_direction_input(gpio);
+       gpio_free(gpio);
+}
+
+static void simone_mmc_spi_cs_control(struct spi_device *spi, int value)
+{
+       gpio_set_value(MMC_CHIP_SELECT_GPIO, value);
+}
+
+static struct ep93xx_spi_chip_ops simone_mmc_spi_ops = {
+       .setup          = simone_mmc_spi_setup,
+       .cleanup        = simone_mmc_spi_cleanup,
+       .cs_control     = simone_mmc_spi_cs_control,
+};
+
+/*
+ * MMC card detection GPIO setup.
+ */
+
+static int simone_mmc_spi_init(struct device *dev,
+       irqreturn_t (*irq_handler)(int, void *), void *mmc)
+{
+       unsigned int gpio = MMC_CARD_DETECT_GPIO;
+       int irq, err;
+
+       err = gpio_request(gpio, dev_name(dev));
+       if (err)
+               return err;
+
+       err = gpio_direction_input(gpio);
+       if (err)
+               goto fail;
+
+       irq = gpio_to_irq(gpio);
+       if (irq < 0)
+               goto fail;
+
+       err = request_irq(irq, irq_handler, IRQF_TRIGGER_FALLING,
+                         "MMC card detect", mmc);
+       if (err)
+               goto fail;
+
+       printk(KERN_INFO "%s: using irq %d for MMC card detection\n",
+              dev_name(dev), irq);
+
+       return 0;
+fail:
+       gpio_free(gpio);
+       return err;
+}
+
+static void simone_mmc_spi_exit(struct device *dev, void *mmc)
+{
+       unsigned int gpio = MMC_CARD_DETECT_GPIO;
+
+       free_irq(gpio_to_irq(gpio), mmc);
+       gpio_free(gpio);
+}
+
+static struct mmc_spi_platform_data simone_mmc_spi_data = {
+       .init           = simone_mmc_spi_init,
+       .exit           = simone_mmc_spi_exit,
+       .detect_delay   = 500,
+       .ocr_mask       = MMC_VDD_32_33 | MMC_VDD_33_34,
+};
+
+static struct spi_board_info simone_spi_devices[] __initdata = {
+       {
+               .modalias               = "mmc_spi",
+               .controller_data        = &simone_mmc_spi_ops,
+               .platform_data          = &simone_mmc_spi_data,
+               /*
+                * We use 10 MHz even though the maximum is 3.7 MHz. The driver
+                * will limit it automatically to max. frequency.
+                */
+               .max_speed_hz           = 10 * 1000 * 1000,
+               .bus_num                = 0,
+               .chip_select            = 0,
+               .mode                   = SPI_MODE_3,
+       },
+};
+
+static struct ep93xx_spi_info simone_spi_info __initdata = {
+       .num_chipselect = ARRAY_SIZE(simone_spi_devices),
+};
+
 static struct i2c_gpio_platform_data __initdata simone_i2c_gpio_data = {
        .sda_pin                = EP93XX_GPIO_LINE_EEDAT,
        .sda_is_open_drain      = 0,
@@ -74,6 +205,8 @@ static void __init simone_init_machine(void)
        ep93xx_register_fb(&simone_fb_info);
        ep93xx_register_i2c(&simone_i2c_gpio_data, simone_i2c_board_info,
                            ARRAY_SIZE(simone_i2c_board_info));
+       ep93xx_register_spi(&simone_spi_info, simone_spi_devices,
+                           ARRAY_SIZE(simone_spi_devices));
        simone_register_audio();
 }
 
index 5f5cd562c593ef5f6a9224254c146e7d3d0136a3..e3a9256ed55fecc49e65aea229e74f82e933a91f 100644 (file)
@@ -163,7 +163,9 @@ extern void exynos_set_delayed_reset_assertion(bool enable);
 
 extern void s5p_init_cpu(void __iomem *cpuid_addr);
 extern unsigned int samsung_rev(void);
-extern void __iomem *cpu_boot_reg_base(void);
+extern void exynos_core_restart(u32 core_id);
+extern int exynos_set_boot_addr(u32 core_id, unsigned long boot_addr);
+extern int exynos_get_boot_addr(u32 core_id, unsigned long *boot_addr);
 
 static inline void pmu_raw_writel(u32 val, u32 offset)
 {
index 5917a30eee33f286c80708dfb84cdd610bd2dd9d..4bd8b76538175aa2ba4ab3f58a127b94bda08939 100644 (file)
@@ -234,7 +234,8 @@ static void __init exynos_dt_machine_init(void)
                exynos_sysram_init();
 
 #if defined(CONFIG_SMP) && defined(CONFIG_ARM_EXYNOS_CPUIDLE)
-       if (of_machine_is_compatible("samsung,exynos4210"))
+       if (of_machine_is_compatible("samsung,exynos4210") ||
+           of_machine_is_compatible("samsung,exynos3250"))
                exynos_cpuidle.dev.platform_data = &cpuidle_coupled_exynos_data;
 #endif
        if (of_machine_is_compatible("samsung,exynos4210") ||
index 1bd35763f12ec04d712ace47f0f88bd2f9c95c89..245f6dec1ded11a126b9386203eed4e9572a0157 100644 (file)
@@ -49,6 +49,7 @@ static int exynos_do_idle(unsigned long mode)
                             sysram_ns_base_addr + 0x24);
                __raw_writel(EXYNOS_AFTR_MAGIC, sysram_ns_base_addr + 0x20);
                if (soc_is_exynos3250()) {
+                       flush_cache_all();
                        exynos_smc(SMC_CMD_SAVE, OP_TYPE_CORE,
                                   SMC_POWERSTATE_IDLE, 0);
                        exynos_smc(SMC_CMD_SHUTDOWN, OP_TYPE_CLUSTER,
@@ -104,6 +105,22 @@ static int exynos_set_cpu_boot_addr(int cpu, unsigned long boot_addr)
        return 0;
 }
 
+static int exynos_get_cpu_boot_addr(int cpu, unsigned long *boot_addr)
+{
+       void __iomem *boot_reg;
+
+       if (!sysram_ns_base_addr)
+               return -ENODEV;
+
+       boot_reg = sysram_ns_base_addr + 0x1c;
+
+       if (soc_is_exynos4412())
+               boot_reg += 4 * cpu;
+
+       *boot_addr = __raw_readl(boot_reg);
+       return 0;
+}
+
 static int exynos_cpu_suspend(unsigned long arg)
 {
        flush_cache_all();
@@ -138,6 +155,7 @@ static int exynos_resume(void)
 static const struct firmware_ops exynos_firmware_ops = {
        .do_idle                = IS_ENABLED(CONFIG_EXYNOS_CPU_SUSPEND) ? exynos_do_idle : NULL,
        .set_cpu_boot_addr      = exynos_set_cpu_boot_addr,
+       .get_cpu_boot_addr      = exynos_get_cpu_boot_addr,
        .cpu_boot               = exynos_cpu_boot,
        .suspend                = IS_ENABLED(CONFIG_PM_SLEEP) ? exynos_suspend : NULL,
        .resume                 = IS_ENABLED(CONFIG_EXYNOS_CPU_SUSPEND) ? exynos_resume : NULL,
index a825bca2a2b699490809676cef6f66d4eb86fd21..58e05a2eae5737c1a558c3658e692184b064da34 100644 (file)
@@ -169,7 +169,7 @@ int exynos_cluster_power_state(int cluster)
                S5P_CORE_LOCAL_PWR_EN);
 }
 
-void __iomem *cpu_boot_reg_base(void)
+static void __iomem *cpu_boot_reg_base(void)
 {
        if (soc_is_exynos4210() && samsung_rev() == EXYNOS4210_REV_1_1)
                return pmu_base_addr + S5P_INFORM5;
@@ -195,7 +195,7 @@ static inline void __iomem *cpu_boot_reg(int cpu)
  *
  * Currently this is needed only when booting secondary CPU on Exynos3250.
  */
-static void exynos_core_restart(u32 core_id)
+void exynos_core_restart(u32 core_id)
 {
        u32 val;
 
@@ -210,7 +210,6 @@ static void exynos_core_restart(u32 core_id)
        val |= S5P_CORE_WAKEUP_FROM_LOCAL_CFG;
        pmu_raw_writel(val, EXYNOS_ARM_CORE_STATUS(core_id));
 
-       pr_info("CPU%u: Software reset\n", core_id);
        pmu_raw_writel(EXYNOS_CORE_PO_RESET(core_id), EXYNOS_SWRESET);
 }
 
@@ -248,6 +247,56 @@ static void exynos_secondary_init(unsigned int cpu)
        spin_unlock(&boot_lock);
 }
 
+int exynos_set_boot_addr(u32 core_id, unsigned long boot_addr)
+{
+       int ret;
+
+       /*
+        * Try to set boot address using firmware first
+        * and fall back to boot register if it fails.
+        */
+       ret = call_firmware_op(set_cpu_boot_addr, core_id, boot_addr);
+       if (ret && ret != -ENOSYS)
+               goto fail;
+       if (ret == -ENOSYS) {
+               void __iomem *boot_reg = cpu_boot_reg(core_id);
+
+               if (IS_ERR(boot_reg)) {
+                       ret = PTR_ERR(boot_reg);
+                       goto fail;
+               }
+               __raw_writel(boot_addr, boot_reg);
+               ret = 0;
+       }
+fail:
+       return ret;
+}
+
+int exynos_get_boot_addr(u32 core_id, unsigned long *boot_addr)
+{
+       int ret;
+
+       /*
+        * Try to get boot address using firmware first
+        * and fall back to boot register if it fails.
+        */
+       ret = call_firmware_op(get_cpu_boot_addr, core_id, boot_addr);
+       if (ret && ret != -ENOSYS)
+               goto fail;
+       if (ret == -ENOSYS) {
+               void __iomem *boot_reg = cpu_boot_reg(core_id);
+
+               if (IS_ERR(boot_reg)) {
+                       ret = PTR_ERR(boot_reg);
+                       goto fail;
+               }
+               *boot_addr = __raw_readl(boot_reg);
+               ret = 0;
+       }
+fail:
+       return ret;
+}
+
 static int exynos_boot_secondary(unsigned int cpu, struct task_struct *idle)
 {
        unsigned long timeout;
@@ -307,22 +356,9 @@ static int exynos_boot_secondary(unsigned int cpu, struct task_struct *idle)
 
                boot_addr = virt_to_phys(exynos4_secondary_startup);
 
-               /*
-                * Try to set boot address using firmware first
-                * and fall back to boot register if it fails.
-                */
-               ret = call_firmware_op(set_cpu_boot_addr, core_id, boot_addr);
-               if (ret && ret != -ENOSYS)
+               ret = exynos_set_boot_addr(core_id, boot_addr);
+               if (ret)
                        goto fail;
-               if (ret == -ENOSYS) {
-                       void __iomem *boot_reg = cpu_boot_reg(core_id);
-
-                       if (IS_ERR(boot_reg)) {
-                               ret = PTR_ERR(boot_reg);
-                               goto fail;
-                       }
-                       __raw_writel(boot_addr, boot_reg);
-               }
 
                call_firmware_op(cpu_boot, core_id);
 
@@ -337,6 +373,9 @@ static int exynos_boot_secondary(unsigned int cpu, struct task_struct *idle)
                udelay(10);
        }
 
+       if (pen_release != -1)
+               ret = -ETIMEDOUT;
+
        /*
         * now the secondary core is starting up let it run its
         * calibrations, then wait for it to finish
@@ -407,16 +446,9 @@ static void __init exynos_smp_prepare_cpus(unsigned int max_cpus)
                core_id = MPIDR_AFFINITY_LEVEL(mpidr, 0);
                boot_addr = virt_to_phys(exynos4_secondary_startup);
 
-               ret = call_firmware_op(set_cpu_boot_addr, core_id, boot_addr);
-               if (ret && ret != -ENOSYS)
+               ret = exynos_set_boot_addr(core_id, boot_addr);
+               if (ret)
                        break;
-               if (ret == -ENOSYS) {
-                       void __iomem *boot_reg = cpu_boot_reg(core_id);
-
-                       if (IS_ERR(boot_reg))
-                               break;
-                       __raw_writel(boot_addr, boot_reg);
-               }
        }
 }
 
index cc75ab448be3b4ce9b3c0fc2e626da4ed3d6e6ca..9c1506b499bca6f4599a20ece67494078a95d4d0 100644 (file)
@@ -22,6 +22,7 @@
 #include <asm/firmware.h>
 #include <asm/smp_scu.h>
 #include <asm/suspend.h>
+#include <asm/cacheflush.h>
 
 #include <mach/map.h>
 
@@ -209,6 +210,8 @@ static int exynos_cpu0_enter_aftr(void)
                 * sequence, let's wait for one of these to happen
                 */
                while (exynos_cpu_power_state(1)) {
+                       unsigned long boot_addr;
+
                        /*
                         * The other cpu may skip idle and boot back
                         * up again
@@ -221,7 +224,11 @@ static int exynos_cpu0_enter_aftr(void)
                         * boot back up again, getting stuck in the
                         * boot rom code
                         */
-                       if (__raw_readl(cpu_boot_reg_base()) == 0)
+                       ret = exynos_get_boot_addr(1, &boot_addr);
+                       if (ret)
+                               goto fail;
+                       ret = -1;
+                       if (boot_addr == 0)
                                goto abort;
 
                        cpu_relax();
@@ -233,11 +240,14 @@ static int exynos_cpu0_enter_aftr(void)
 
 abort:
        if (cpu_online(1)) {
+               unsigned long boot_addr = virt_to_phys(exynos_cpu_resume);
+
                /*
                 * Set the boot vector to something non-zero
                 */
-               __raw_writel(virt_to_phys(exynos_cpu_resume),
-                            cpu_boot_reg_base());
+               ret = exynos_set_boot_addr(1, boot_addr);
+               if (ret)
+                       goto fail;
                dsb();
 
                /*
@@ -247,22 +257,42 @@ abort:
                while (exynos_cpu_power_state(1) != S5P_CORE_LOCAL_PWR_EN)
                        cpu_relax();
 
+               if (soc_is_exynos3250()) {
+                       while (!pmu_raw_readl(S5P_PMU_SPARE2) &&
+                              !atomic_read(&cpu1_wakeup))
+                               cpu_relax();
+
+                       if (!atomic_read(&cpu1_wakeup))
+                               exynos_core_restart(1);
+               }
+
                while (!atomic_read(&cpu1_wakeup)) {
+                       smp_rmb();
+
                        /*
                         * Poke cpu1 out of the boot rom
                         */
-                       __raw_writel(virt_to_phys(exynos_cpu_resume),
-                                    cpu_boot_reg_base());
 
-                       arch_send_wakeup_ipi_mask(cpumask_of(1));
+                       ret = exynos_set_boot_addr(1, boot_addr);
+                       if (ret)
+                               goto fail;
+
+                       call_firmware_op(cpu_boot, 1);
+
+                       if (soc_is_exynos3250())
+                               dsb_sev();
+                       else
+                               arch_send_wakeup_ipi_mask(cpumask_of(1));
                }
        }
-
+fail:
        return ret;
 }
 
 static int exynos_wfi_finisher(unsigned long flags)
 {
+       if (soc_is_exynos3250())
+               flush_cache_all();
        cpu_do_idle();
 
        return -1;
@@ -283,6 +313,9 @@ static int exynos_cpu1_powerdown(void)
         */
        exynos_cpu_power_down(1);
 
+       if (soc_is_exynos3250())
+               pmu_raw_writel(0, S5P_PMU_SPARE2);
+
        ret = cpu_suspend(0, exynos_wfi_finisher);
 
        cpu_pm_exit();
@@ -299,7 +332,9 @@ cpu1_aborted:
 
 static void exynos_pre_enter_aftr(void)
 {
-       __raw_writel(virt_to_phys(exynos_cpu_resume), cpu_boot_reg_base());
+       unsigned long boot_addr = virt_to_phys(exynos_cpu_resume);
+
+       (void)exynos_set_boot_addr(1, boot_addr);
 }
 
 static void exynos_post_enter_aftr(void)
index a9686535f9ed460706a41a99dc60d6d4f575ab3b..6001f1c9d136f45fabd7d61e97638855d0beb46a 100644 (file)
@@ -62,6 +62,7 @@ static int exynos_pd_power(struct generic_pm_domain *domain, bool power_on)
                for (i = 0; i < MAX_CLK_PER_DOMAIN; i++) {
                        if (IS_ERR(pd->clk[i]))
                                break;
+                       pd->pclk[i] = clk_get_parent(pd->clk[i]);
                        if (clk_set_parent(pd->clk[i], pd->oscclk))
                                pr_err("%s: error setting oscclk as parent to clock %d\n",
                                                pd->name, i);
@@ -90,6 +91,9 @@ static int exynos_pd_power(struct generic_pm_domain *domain, bool power_on)
                for (i = 0; i < MAX_CLK_PER_DOMAIN; i++) {
                        if (IS_ERR(pd->clk[i]))
                                break;
+
+                       if (IS_ERR(pd->clk[i]))
+                               continue; /* Skip on first power up */
                        if (clk_set_parent(pd->clk[i], pd->pclk[i]))
                                pr_err("%s: error setting parent to clock%d\n",
                                                pd->name, i);
@@ -117,27 +121,37 @@ static int exynos_pd_power_off(struct generic_pm_domain *domain)
 
 static __init int exynos4_pm_init_power_domain(void)
 {
-       struct platform_device *pdev;
        struct device_node *np;
 
        for_each_compatible_node(np, NULL, "samsung,exynos4210-pd") {
                struct exynos_pm_domain *pd;
                int on, i;
-               struct device *dev;
-
-               pdev = of_find_device_by_node(np);
-               dev = &pdev->dev;
 
                pd = kzalloc(sizeof(*pd), GFP_KERNEL);
                if (!pd) {
                        pr_err("%s: failed to allocate memory for domain\n",
                                        __func__);
+                       of_node_put(np);
+                       return -ENOMEM;
+               }
+               pd->pd.name = kstrdup_const(strrchr(np->full_name, '/') + 1,
+                                           GFP_KERNEL);
+               if (!pd->pd.name) {
+                       kfree(pd);
+                       of_node_put(np);
                        return -ENOMEM;
                }
 
-               pd->pd.name = kstrdup(dev_name(dev), GFP_KERNEL);
                pd->name = pd->pd.name;
                pd->base = of_iomap(np, 0);
+               if (!pd->base) {
+                       pr_warn("%s: failed to map memory\n", __func__);
+                       kfree(pd->pd.name);
+                       kfree(pd);
+                       of_node_put(np);
+                       continue;
+               }
+
                pd->pd.power_off = exynos_pd_power_off;
                pd->pd.power_on = exynos_pd_power_on;
 
@@ -145,12 +159,12 @@ static __init int exynos4_pm_init_power_domain(void)
                        char clk_name[8];
 
                        snprintf(clk_name, sizeof(clk_name), "asb%d", i);
-                       pd->asb_clk[i] = clk_get(dev, clk_name);
+                       pd->asb_clk[i] = of_clk_get_by_name(np, clk_name);
                        if (IS_ERR(pd->asb_clk[i]))
                                break;
                }
 
-               pd->oscclk = clk_get(dev, "oscclk");
+               pd->oscclk = of_clk_get_by_name(np, "oscclk");
                if (IS_ERR(pd->oscclk))
                        goto no_clk;
 
@@ -158,16 +172,14 @@ static __init int exynos4_pm_init_power_domain(void)
                        char clk_name[8];
 
                        snprintf(clk_name, sizeof(clk_name), "clk%d", i);
-                       pd->clk[i] = clk_get(dev, clk_name);
+                       pd->clk[i] = of_clk_get_by_name(np, clk_name);
                        if (IS_ERR(pd->clk[i]))
                                break;
-                       snprintf(clk_name, sizeof(clk_name), "pclk%d", i);
-                       pd->pclk[i] = clk_get(dev, clk_name);
-                       if (IS_ERR(pd->pclk[i])) {
-                               clk_put(pd->clk[i]);
-                               pd->clk[i] = ERR_PTR(-EINVAL);
-                               break;
-                       }
+                       /*
+                        * Skip setting parent on first power up.
+                        * The parent at this time may not be useful at all.
+                        */
+                       pd->pclk[i] = ERR_PTR(-EINVAL);
                }
 
                if (IS_ERR(pd->clk[0]))
@@ -189,15 +201,15 @@ no_clk:
                args.args_count = 0;
                child_domain = of_genpd_get_from_provider(&args);
                if (IS_ERR(child_domain))
-                       continue;
+                       goto next_pd;
 
                if (of_parse_phandle_with_args(np, "power-domains",
                                         "#power-domain-cells", 0, &args) != 0)
-                       continue;
+                       goto next_pd;
 
                parent_domain = of_genpd_get_from_provider(&args);
                if (IS_ERR(parent_domain))
-                       continue;
+                       goto next_pd;
 
                if (pm_genpd_add_subdomain(parent_domain, child_domain))
                        pr_warn("%s failed to add subdomain: %s\n",
@@ -205,9 +217,10 @@ no_clk:
                else
                        pr_info("%s has as child subdomain: %s.\n",
                                parent_domain->name, child_domain->name);
+next_pd:
                of_node_put(np);
        }
 
        return 0;
 }
-arch_initcall(exynos4_pm_init_power_domain);
+core_initcall(exynos4_pm_init_power_domain);
index c15761ca2f187faaca0a6950f67a681820040a89..e812c1c85624c5a6c476a1092d2fed15b76649a3 100644 (file)
@@ -681,7 +681,7 @@ static unsigned int const exynos5420_list_disable_pmu_reg[] = {
        EXYNOS5420_CMU_RESET_FSYS_SYS_PWR_REG,
 };
 
-static void exynos5_power_off(void)
+static void exynos_power_off(void)
 {
        unsigned int tmp;
 
@@ -872,8 +872,6 @@ static void exynos5420_pmu_init(void)
                        EXYNOS5420_ARM_INTR_SPREAD_USE_STANDBYWFI);
 
        pmu_raw_writel(0x1, EXYNOS5420_UP_SCHEDULER);
-
-       pm_power_off = exynos5_power_off;
        pr_info("EXYNOS5420 PMU initialized\n");
 }
 
@@ -984,6 +982,8 @@ static int exynos_pmu_probe(struct platform_device *pdev)
        if (ret)
                dev_warn(dev, "can't register restart handler err=%d\n", ret);
 
+       pm_power_off = exynos_power_off;
+
        dev_dbg(dev, "Exynos PMU Driver probe done\n");
        return 0;
 }
index c0b6dccbf7bd5d8d14c05172d11d6ee690bf8fef..96866d03d281da1cc02715f1a1293cf9e79ff097 100644 (file)
@@ -87,8 +87,8 @@ static unsigned int exynos_pmu_spare3;
 static u32 exynos_irqwake_intmask = 0xffffffff;
 
 static const struct exynos_wkup_irq exynos3250_wkup_irq[] = {
-       { 105, BIT(1) }, /* RTC alarm */
-       { 106, BIT(2) }, /* RTC tick */
+       { 73, BIT(1) }, /* RTC alarm */
+       { 74, BIT(2) }, /* RTC tick */
        { /* sentinel */ },
 };
 
@@ -223,7 +223,7 @@ static int exynos_pmu_domain_alloc(struct irq_domain *domain,
        return irq_domain_alloc_irqs_parent(domain, virq, nr_irqs, &parent_args);
 }
 
-static struct irq_domain_ops exynos_pmu_domain_ops = {
+static const struct irq_domain_ops exynos_pmu_domain_ops = {
        .xlate  = exynos_pmu_domain_xlate,
        .alloc  = exynos_pmu_domain_alloc,
        .free   = irq_domain_free_irqs_common,
index 6b7b3033de0bcfa0d22b4b5be681953354fa83d1..659db1933ed3619e987dc8c017ab8ea215762eb3 100644 (file)
@@ -6,4 +6,4 @@ CFLAGS_platmcpm.o       := -march=armv7-a
 
 obj-y  += hisilicon.o
 obj-$(CONFIG_MCPM)             += platmcpm.o
-obj-$(CONFIG_SMP)              += platsmp.o hotplug.o headsmp.o
+obj-$(CONFIG_SMP)              += platsmp.o hotplug.o
index 92a682d8e93943e3b1aa0bb813119b8451737597..c7648ef1825c70283b3a8d1e123176cb71dafd22 100644 (file)
@@ -12,7 +12,6 @@ extern void hi3xxx_cpu_die(unsigned int cpu);
 extern int hi3xxx_cpu_kill(unsigned int cpu);
 extern void hi3xxx_set_cpu(int cpu, bool enable);
 
-extern void hisi_secondary_startup(void);
 extern struct smp_operations hix5hd2_smp_ops;
 extern void hix5hd2_set_cpu(int cpu, bool enable);
 extern void hix5hd2_cpu_die(unsigned int cpu);
diff --git a/arch/arm/mach-hisi/headsmp.S b/arch/arm/mach-hisi/headsmp.S
deleted file mode 100644 (file)
index 81e35b1..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- *  Copyright (c) 2014 Hisilicon Limited.
- *  Copyright (c) 2014 Linaro 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/linkage.h>
-#include <linux/init.h>
-
-       __CPUINIT
-
-ENTRY(hisi_secondary_startup)
-       bl      v7_invalidate_l1
-       b       secondary_startup
index 8880c8e8b296fab3b6695c9505c886843afdac94..51744127db666baee8d140876586bfd5990fb504 100644 (file)
@@ -118,7 +118,7 @@ static int hix5hd2_boot_secondary(unsigned int cpu, struct task_struct *idle)
 {
        phys_addr_t jumpaddr;
 
-       jumpaddr = virt_to_phys(hisi_secondary_startup);
+       jumpaddr = virt_to_phys(secondary_startup);
        hix5hd2_set_scu_boot_addr(HIX5HD2_BOOT_ADDRESS, jumpaddr);
        hix5hd2_set_cpu(cpu, true);
        arch_send_wakeup_ipi_mask(cpumask_of(cpu));
@@ -156,7 +156,7 @@ static int hip01_boot_secondary(unsigned int cpu, struct task_struct *idle)
        struct device_node *node;
 
 
-       jumpaddr = virt_to_phys(hisi_secondary_startup);
+       jumpaddr = virt_to_phys(secondary_startup);
        hip01_set_boot_addr(HIP01_BOOT_ADDRESS, jumpaddr);
 
        node = of_find_compatible_node(NULL, NULL, "hisilicon,hip01-sysctrl");
index 3a3d3e9d7bfd6eb7f781bfa904df5caede06a33c..573536f1bb739200e8a234a3a4844c5b591aa0ff 100644 (file)
@@ -1,8 +1,8 @@
 menuconfig ARCH_MXC
-       bool "Freescale i.MX family" if ARCH_MULTI_V4_V5 || ARCH_MULTI_V6_V7
+       bool "Freescale i.MX family" if ARCH_MULTI_V4_V5 || ARCH_MULTI_V6_V7 || ARM_SINGLE_ARMV7M
        select ARCH_REQUIRE_GPIOLIB
        select ARM_CPU_SUSPEND if PM
-       select CLKSRC_MMIO
+       select CLKSRC_IMX_GPT
        select GENERIC_IRQ_CHIP
        select PINCTRL
        select PM_OPP if PM
@@ -444,40 +444,6 @@ config MACH_MX35_3DS
          Include support for MX35PDK platform. This includes specific
          configurations for the board and its peripherals.
 
-config MACH_EUKREA_CPUIMX35SD
-       bool "Support Eukrea CPUIMX35 Platform"
-       select IMX_HAVE_PLATFORM_FLEXCAN
-       select IMX_HAVE_PLATFORM_FSL_USB2_UDC
-       select IMX_HAVE_PLATFORM_IMX2_WDT
-       select IMX_HAVE_PLATFORM_IMX_I2C
-       select IMX_HAVE_PLATFORM_IMX_UART
-       select IMX_HAVE_PLATFORM_MXC_EHCI
-       select IMX_HAVE_PLATFORM_MXC_NAND
-       select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
-       select USB_ULPI_VIEWPORT if USB_ULPI
-       select SOC_IMX35
-       help
-         Include support for Eukrea CPUIMX35 platform. This includes
-         specific configurations for the board and its peripherals.
-
-choice
-       prompt "Baseboard"
-       depends on MACH_EUKREA_CPUIMX35SD
-       default MACH_EUKREA_MBIMXSD35_BASEBOARD
-
-config MACH_EUKREA_MBIMXSD35_BASEBOARD
-       bool "Eukrea MBIMXSD development board"
-       select IMX_HAVE_PLATFORM_GPIO_KEYS
-       select IMX_HAVE_PLATFORM_IMX_SSI
-       select IMX_HAVE_PLATFORM_IPU_CORE
-       select IMX_HAVE_PLATFORM_SPI_IMX
-       select LEDS_GPIO_REGISTER
-       help
-         This adds board specific devices that can be found on Eukrea's
-         MBIMXSD evaluation board.
-
-endchoice
-
 config MACH_VPR200
        bool "Support VPR200 platform"
        select IMX_HAVE_PLATFORM_FSL_USB2_UDC
@@ -496,10 +462,10 @@ config MACH_VPR200
 
 endif
 
-if ARCH_MULTI_V5
-
 comment "Device tree only"
 
+if ARCH_MULTI_V5
+
 config SOC_IMX25
        bool "i.MX25 support"
        select ARCH_MXC_IOMUX_V3
@@ -512,7 +478,7 @@ endif
 
 if ARCH_MULTI_V7
 
-comment "Device tree only"
+comment "Cortex-A platforms"
 
 config SOC_IMX5
        bool
@@ -582,10 +548,33 @@ config SOC_IMX6SX
        help
          This enables support for Freescale i.MX6 SoloX processor.
 
+config SOC_IMX7D
+       bool "i.MX7 Dual support"
+       select PINCTRL_IMX7D
+       select ARM_GIC
+       select HAVE_IMX_ANATOP
+       select HAVE_IMX_MMDC
+       help
+               This enables support for Freescale i.MX7 Dual processor.
+
+config SOC_LS1021A
+       bool "Freescale LS1021A support"
+       select ARM_GIC
+       select HAVE_ARM_ARCH_TIMER
+       select PCI_DOMAINS if PCI
+       select ZONE_DMA if ARM_LPAE
+       help
+         This enables support for Freescale LS1021A processor.
+
+endif
+
+comment "Cortex-A/Cortex-M asymmetric multiprocessing platforms"
+
+if ARCH_MULTI_V7 || ARM_SINGLE_ARMV7M
+
 config SOC_VF610
        bool "Vybrid Family VF610 support"
-       select IRQ_DOMAIN_HIERARCHY
-       select ARM_GIC
+       select ARM_GIC if ARCH_MULTI_V7
        select PINCTRL_VF610
        select PL310_ERRATA_769419 if CACHE_L2X0
        select SMP_ON_UP if SMP
@@ -599,7 +588,7 @@ choice
        default VF_USE_ARM_GLOBAL_TIMER
 
        config VF_USE_ARM_GLOBAL_TIMER
-               bool "Use ARM Global Timer"
+               bool "Use ARM Global Timer" if ARCH_MULTI_V7
                select ARM_GLOBAL_TIMER
                select CLKSRC_ARM_GLOBAL_TIMER_SCHED_CLOCK
                help
@@ -613,16 +602,6 @@ choice
 
 endchoice
 
-config SOC_LS1021A
-       bool "Freescale LS1021A support"
-       select ARM_GIC
-       select HAVE_ARM_ARCH_TIMER
-       select PCI_DOMAINS if PCI
-       select ZONE_DMA if ARM_LPAE
-
-       help
-         This enables support for Freescale LS1021A processor.
-
 endif
 
 source "arch/arm/mach-imx/devices/Kconfig"
index 3244cf1d2773f1c20836b6b96e60f4d054aa67f0..37c502ac959508cc4b02c36d24c0086f753c2fa0 100644 (file)
@@ -1,23 +1,18 @@
-obj-y := time.o cpu.o system.o irq-common.o
+obj-y := cpu.o system.o irq-common.o
 
-obj-$(CONFIG_SOC_IMX1) += clk-imx1.o mm-imx1.o
-obj-$(CONFIG_SOC_IMX21) += clk-imx21.o mm-imx21.o
+obj-$(CONFIG_SOC_IMX1) += mm-imx1.o
+obj-$(CONFIG_SOC_IMX21) += mm-imx21.o
 
-obj-$(CONFIG_SOC_IMX25) += clk-imx25.o cpu-imx25.o mach-imx25.o
+obj-$(CONFIG_SOC_IMX25) += cpu-imx25.o mach-imx25.o
 
 obj-$(CONFIG_SOC_IMX27) += cpu-imx27.o pm-imx27.o
-obj-$(CONFIG_SOC_IMX27) += clk-imx27.o mm-imx27.o ehci-imx27.o
+obj-$(CONFIG_SOC_IMX27) += mm-imx27.o ehci-imx27.o
 
-obj-$(CONFIG_SOC_IMX31) += mm-imx3.o cpu-imx31.o clk-imx31.o iomux-imx31.o ehci-imx31.o pm-imx3.o
-obj-$(CONFIG_SOC_IMX35) += mm-imx3.o cpu-imx35.o clk-imx35.o ehci-imx35.o pm-imx3.o
+obj-$(CONFIG_SOC_IMX31) += mm-imx3.o cpu-imx31.o iomux-imx31.o ehci-imx31.o pm-imx3.o
+obj-$(CONFIG_SOC_IMX35) += mm-imx3.o cpu-imx35.o ehci-imx35.o pm-imx3.o
 
 imx5-pm-$(CONFIG_PM) += pm-imx5.o
-obj-$(CONFIG_SOC_IMX5) += cpu-imx5.o clk-imx51-imx53.o clk-cpu.o $(imx5-pm-y)
-
-obj-$(CONFIG_COMMON_CLK) += clk-pllv1.o clk-pllv2.o clk-pllv3.o clk-gate2.o \
-                           clk-pfd.o clk-busy.o clk.o \
-                           clk-fixup-div.o clk-fixup-mux.o \
-                           clk-gate-exclusive.o
+obj-$(CONFIG_SOC_IMX5) += cpu-imx5.o $(imx5-pm-y)
 
 obj-$(CONFIG_IMX_HAVE_IOMUX_V1) += iomux-v1.o
 obj-$(CONFIG_ARCH_MXC_IOMUX_V3) += iomux-v3.o
@@ -73,8 +68,6 @@ obj-$(CONFIG_MACH_IMX31_DT) += imx31-dt.o
 # i.MX35 based machines
 obj-$(CONFIG_MACH_PCM043) += mach-pcm043.o
 obj-$(CONFIG_MACH_MX35_3DS) += mach-mx35_3ds.o
-obj-$(CONFIG_MACH_EUKREA_CPUIMX35SD) += mach-cpuimx35.o
-obj-$(CONFIG_MACH_EUKREA_MBIMXSD35_BASEBOARD) += eukrea_mbimxsd35-baseboard.o
 obj-$(CONFIG_MACH_VPR200) += mach-vpr200.o
 obj-$(CONFIG_MACH_IMX35_DT) += imx35-dt.o
 
@@ -87,13 +80,15 @@ AFLAGS_headsmp.o :=-Wa,-march=armv7-a
 obj-$(CONFIG_SMP) += headsmp.o platsmp.o
 obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o
 endif
-obj-$(CONFIG_SOC_IMX6Q) += clk-imx6q.o mach-imx6q.o
-obj-$(CONFIG_SOC_IMX6SL) += clk-imx6sl.o mach-imx6sl.o
-obj-$(CONFIG_SOC_IMX6SX) += clk-imx6sx.o mach-imx6sx.o
+obj-$(CONFIG_SOC_IMX6Q) += mach-imx6q.o
+obj-$(CONFIG_SOC_IMX6SL) += mach-imx6sl.o
+obj-$(CONFIG_SOC_IMX6SX) += mach-imx6sx.o
+obj-$(CONFIG_SOC_IMX7D) += mach-imx7d.o
 
 ifeq ($(CONFIG_SUSPEND),y)
 AFLAGS_suspend-imx6.o :=-Wa,-march=armv7-a
 obj-$(CONFIG_SOC_IMX6) += suspend-imx6.o
+obj-$(CONFIG_SOC_IMX53) += suspend-imx53.o
 endif
 obj-$(CONFIG_SOC_IMX6) += pm-imx6.o
 
@@ -101,7 +96,7 @@ obj-$(CONFIG_SOC_IMX50) += mach-imx50.o
 obj-$(CONFIG_SOC_IMX51) += mach-imx51.o
 obj-$(CONFIG_SOC_IMX53) += mach-imx53.o
 
-obj-$(CONFIG_SOC_VF610) += clk-vf610.o mach-vf610.o
+obj-$(CONFIG_SOC_VF610) += mach-vf610.o
 
 obj-$(CONFIG_SOC_LS1021A) += mach-ls1021a.o
 
diff --git a/arch/arm/mach-imx/Makefile.boot b/arch/arm/mach-imx/Makefile.boot
new file mode 100644 (file)
index 0000000..e69de29
index 7f262fe4ba77d7d28d95aaed8e4d56cf745c83bc..231bb250c5719d21962404a9301765cdcf499924 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2013 Freescale Semiconductor, Inc.
+ * Copyright (C) 2013-2015 Freescale Semiconductor, Inc.
  *
  * The code contained herein is licensed under the GNU General Public
  * License. You may obtain a copy of the GNU General Public License
@@ -28,6 +28,7 @@
 #define ANADIG_USB2_CHRG_DETECT        0x210
 #define ANADIG_DIGPROG         0x260
 #define ANADIG_DIGPROG_IMX6SL  0x280
+#define ANADIG_DIGPROG_IMX7D   0x800
 
 #define BM_ANADIG_REG_2P5_ENABLE_WEAK_LINREG   0x40000
 #define BM_ANADIG_REG_2P5_ENABLE_PULLDOWN      0x8
@@ -121,6 +122,8 @@ void __init imx_init_revision_from_anatop(void)
        WARN_ON(!anatop_base);
        if (of_device_is_compatible(np, "fsl,imx6sl-anatop"))
                offset = ANADIG_DIGPROG_IMX6SL;
+       if (of_device_is_compatible(np, "fsl,imx7d-anatop"))
+               offset = ANADIG_DIGPROG_IMX7D;
        digprog = readl_relaxed(anatop_base + offset);
        iounmap(anatop_base);
 
diff --git a/arch/arm/mach-imx/clk-busy.c b/arch/arm/mach-imx/clk-busy.c
deleted file mode 100644 (file)
index 4bb1bc4..0000000
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
- * Copyright 2012 Freescale Semiconductor, Inc.
- * Copyright 2012 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:
- *
- * http://www.opensource.org/licenses/gpl-license.html
- * http://www.gnu.org/copyleft/gpl.html
- */
-
-#include <linux/clk.h>
-#include <linux/clk-provider.h>
-#include <linux/io.h>
-#include <linux/slab.h>
-#include <linux/jiffies.h>
-#include <linux/err.h>
-#include "clk.h"
-
-static int clk_busy_wait(void __iomem *reg, u8 shift)
-{
-       unsigned long timeout = jiffies + msecs_to_jiffies(10);
-
-       while (readl_relaxed(reg) & (1 << shift))
-               if (time_after(jiffies, timeout))
-                       return -ETIMEDOUT;
-
-       return 0;
-}
-
-struct clk_busy_divider {
-       struct clk_divider div;
-       const struct clk_ops *div_ops;
-       void __iomem *reg;
-       u8 shift;
-};
-
-static inline struct clk_busy_divider *to_clk_busy_divider(struct clk_hw *hw)
-{
-       struct clk_divider *div = container_of(hw, struct clk_divider, hw);
-
-       return container_of(div, struct clk_busy_divider, div);
-}
-
-static unsigned long clk_busy_divider_recalc_rate(struct clk_hw *hw,
-                                                 unsigned long parent_rate)
-{
-       struct clk_busy_divider *busy = to_clk_busy_divider(hw);
-
-       return busy->div_ops->recalc_rate(&busy->div.hw, parent_rate);
-}
-
-static long clk_busy_divider_round_rate(struct clk_hw *hw, unsigned long rate,
-                                       unsigned long *prate)
-{
-       struct clk_busy_divider *busy = to_clk_busy_divider(hw);
-
-       return busy->div_ops->round_rate(&busy->div.hw, rate, prate);
-}
-
-static int clk_busy_divider_set_rate(struct clk_hw *hw, unsigned long rate,
-               unsigned long parent_rate)
-{
-       struct clk_busy_divider *busy = to_clk_busy_divider(hw);
-       int ret;
-
-       ret = busy->div_ops->set_rate(&busy->div.hw, rate, parent_rate);
-       if (!ret)
-               ret = clk_busy_wait(busy->reg, busy->shift);
-
-       return ret;
-}
-
-static struct clk_ops clk_busy_divider_ops = {
-       .recalc_rate = clk_busy_divider_recalc_rate,
-       .round_rate = clk_busy_divider_round_rate,
-       .set_rate = clk_busy_divider_set_rate,
-};
-
-struct clk *imx_clk_busy_divider(const char *name, const char *parent_name,
-                                void __iomem *reg, u8 shift, u8 width,
-                                void __iomem *busy_reg, u8 busy_shift)
-{
-       struct clk_busy_divider *busy;
-       struct clk *clk;
-       struct clk_init_data init;
-
-       busy = kzalloc(sizeof(*busy), GFP_KERNEL);
-       if (!busy)
-               return ERR_PTR(-ENOMEM);
-
-       busy->reg = busy_reg;
-       busy->shift = busy_shift;
-
-       busy->div.reg = reg;
-       busy->div.shift = shift;
-       busy->div.width = width;
-       busy->div.lock = &imx_ccm_lock;
-       busy->div_ops = &clk_divider_ops;
-
-       init.name = name;
-       init.ops = &clk_busy_divider_ops;
-       init.flags = CLK_SET_RATE_PARENT;
-       init.parent_names = &parent_name;
-       init.num_parents = 1;
-
-       busy->div.hw.init = &init;
-
-       clk = clk_register(NULL, &busy->div.hw);
-       if (IS_ERR(clk))
-               kfree(busy);
-
-       return clk;
-}
-
-struct clk_busy_mux {
-       struct clk_mux mux;
-       const struct clk_ops *mux_ops;
-       void __iomem *reg;
-       u8 shift;
-};
-
-static inline struct clk_busy_mux *to_clk_busy_mux(struct clk_hw *hw)
-{
-       struct clk_mux *mux = container_of(hw, struct clk_mux, hw);
-
-       return container_of(mux, struct clk_busy_mux, mux);
-}
-
-static u8 clk_busy_mux_get_parent(struct clk_hw *hw)
-{
-       struct clk_busy_mux *busy = to_clk_busy_mux(hw);
-
-       return busy->mux_ops->get_parent(&busy->mux.hw);
-}
-
-static int clk_busy_mux_set_parent(struct clk_hw *hw, u8 index)
-{
-       struct clk_busy_mux *busy = to_clk_busy_mux(hw);
-       int ret;
-
-       ret = busy->mux_ops->set_parent(&busy->mux.hw, index);
-       if (!ret)
-               ret = clk_busy_wait(busy->reg, busy->shift);
-
-       return ret;
-}
-
-static struct clk_ops clk_busy_mux_ops = {
-       .get_parent = clk_busy_mux_get_parent,
-       .set_parent = clk_busy_mux_set_parent,
-};
-
-struct clk *imx_clk_busy_mux(const char *name, void __iomem *reg, u8 shift,
-                            u8 width, void __iomem *busy_reg, u8 busy_shift,
-                            const char **parent_names, int num_parents)
-{
-       struct clk_busy_mux *busy;
-       struct clk *clk;
-       struct clk_init_data init;
-
-       busy = kzalloc(sizeof(*busy), GFP_KERNEL);
-       if (!busy)
-               return ERR_PTR(-ENOMEM);
-
-       busy->reg = busy_reg;
-       busy->shift = busy_shift;
-
-       busy->mux.reg = reg;
-       busy->mux.shift = shift;
-       busy->mux.mask = BIT(width) - 1;
-       busy->mux.lock = &imx_ccm_lock;
-       busy->mux_ops = &clk_mux_ops;
-
-       init.name = name;
-       init.ops = &clk_busy_mux_ops;
-       init.flags = 0;
-       init.parent_names = parent_names;
-       init.num_parents = num_parents;
-
-       busy->mux.hw.init = &init;
-
-       clk = clk_register(NULL, &busy->mux.hw);
-       if (IS_ERR(clk))
-               kfree(busy);
-
-       return clk;
-}
diff --git a/arch/arm/mach-imx/clk-cpu.c b/arch/arm/mach-imx/clk-cpu.c
deleted file mode 100644 (file)
index aa1c345..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Copyright (c) 2014 Lucas Stach <l.stach@pengutronix.de>, Pengutronix
- *
- * 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.
- *
- * http://www.opensource.org/licenses/gpl-license.html
- * http://www.gnu.org/copyleft/gpl.html
- */
-
-#include <linux/clk.h>
-#include <linux/clk-provider.h>
-#include <linux/slab.h>
-
-struct clk_cpu {
-       struct clk_hw   hw;
-       struct clk      *div;
-       struct clk      *mux;
-       struct clk      *pll;
-       struct clk      *step;
-};
-
-static inline struct clk_cpu *to_clk_cpu(struct clk_hw *hw)
-{
-       return container_of(hw, struct clk_cpu, hw);
-}
-
-static unsigned long clk_cpu_recalc_rate(struct clk_hw *hw,
-                                        unsigned long parent_rate)
-{
-       struct clk_cpu *cpu = to_clk_cpu(hw);
-
-       return clk_get_rate(cpu->div);
-}
-
-static long clk_cpu_round_rate(struct clk_hw *hw, unsigned long rate,
-                              unsigned long *prate)
-{
-       struct clk_cpu *cpu = to_clk_cpu(hw);
-
-       return clk_round_rate(cpu->pll, rate);
-}
-
-static int clk_cpu_set_rate(struct clk_hw *hw, unsigned long rate,
-                           unsigned long parent_rate)
-{
-       struct clk_cpu *cpu = to_clk_cpu(hw);
-       int ret;
-
-       /* switch to PLL bypass clock */
-       ret = clk_set_parent(cpu->mux, cpu->step);
-       if (ret)
-               return ret;
-
-       /* reprogram PLL */
-       ret = clk_set_rate(cpu->pll, rate);
-       if (ret) {
-               clk_set_parent(cpu->mux, cpu->pll);
-               return ret;
-       }
-       /* switch back to PLL clock */
-       clk_set_parent(cpu->mux, cpu->pll);
-
-       /* Ensure the divider is what we expect */
-       clk_set_rate(cpu->div, rate);
-
-       return 0;
-}
-
-static const struct clk_ops clk_cpu_ops = {
-       .recalc_rate    = clk_cpu_recalc_rate,
-       .round_rate     = clk_cpu_round_rate,
-       .set_rate       = clk_cpu_set_rate,
-};
-
-struct clk *imx_clk_cpu(const char *name, const char *parent_name,
-               struct clk *div, struct clk *mux, struct clk *pll,
-               struct clk *step)
-{
-       struct clk_cpu *cpu;
-       struct clk *clk;
-       struct clk_init_data init;
-
-       cpu = kzalloc(sizeof(*cpu), GFP_KERNEL);
-       if (!cpu)
-               return ERR_PTR(-ENOMEM);
-
-       cpu->div = div;
-       cpu->mux = mux;
-       cpu->pll = pll;
-       cpu->step = step;
-
-       init.name = name;
-       init.ops = &clk_cpu_ops;
-       init.flags = 0;
-       init.parent_names = &parent_name;
-       init.num_parents = 1;
-
-       cpu->hw.init = &init;
-
-       clk = clk_register(NULL, &cpu->hw);
-       if (IS_ERR(clk))
-               kfree(cpu);
-
-       return clk;
-}
diff --git a/arch/arm/mach-imx/clk-fixup-div.c b/arch/arm/mach-imx/clk-fixup-div.c
deleted file mode 100644 (file)
index 21db020..0000000
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * Copyright (C) 2013 Freescale Semiconductor, Inc.
- *
- * 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:
- *
- * http://www.opensource.org/licenses/gpl-license.html
- * http://www.gnu.org/copyleft/gpl.html
- */
-
-#include <linux/clk-provider.h>
-#include <linux/err.h>
-#include <linux/io.h>
-#include <linux/slab.h>
-#include "clk.h"
-
-#define to_clk_div(_hw) container_of(_hw, struct clk_divider, hw)
-#define div_mask(d)    ((1 << (d->width)) - 1)
-
-/**
- * struct clk_fixup_div - imx integer fixup divider clock
- * @divider: the parent class
- * @ops: pointer to clk_ops of parent class
- * @fixup: a hook to fixup the write value
- *
- * The imx fixup divider clock is a subclass of basic clk_divider
- * with an addtional fixup hook.
- */
-struct clk_fixup_div {
-       struct clk_divider divider;
-       const struct clk_ops *ops;
-       void (*fixup)(u32 *val);
-};
-
-static inline struct clk_fixup_div *to_clk_fixup_div(struct clk_hw *hw)
-{
-       struct clk_divider *divider = to_clk_div(hw);
-
-       return container_of(divider, struct clk_fixup_div, divider);
-}
-
-static unsigned long clk_fixup_div_recalc_rate(struct clk_hw *hw,
-                                        unsigned long parent_rate)
-{
-       struct clk_fixup_div *fixup_div = to_clk_fixup_div(hw);
-
-       return fixup_div->ops->recalc_rate(&fixup_div->divider.hw, parent_rate);
-}
-
-static long clk_fixup_div_round_rate(struct clk_hw *hw, unsigned long rate,
-                              unsigned long *prate)
-{
-       struct clk_fixup_div *fixup_div = to_clk_fixup_div(hw);
-
-       return fixup_div->ops->round_rate(&fixup_div->divider.hw, rate, prate);
-}
-
-static int clk_fixup_div_set_rate(struct clk_hw *hw, unsigned long rate,
-                           unsigned long parent_rate)
-{
-       struct clk_fixup_div *fixup_div = to_clk_fixup_div(hw);
-       struct clk_divider *div = to_clk_div(hw);
-       unsigned int divider, value;
-       unsigned long flags = 0;
-       u32 val;
-
-       divider = parent_rate / rate;
-
-       /* Zero based divider */
-       value = divider - 1;
-
-       if (value > div_mask(div))
-               value = div_mask(div);
-
-       spin_lock_irqsave(div->lock, flags);
-
-       val = readl(div->reg);
-       val &= ~(div_mask(div) << div->shift);
-       val |= value << div->shift;
-       fixup_div->fixup(&val);
-       writel(val, div->reg);
-
-       spin_unlock_irqrestore(div->lock, flags);
-
-       return 0;
-}
-
-static const struct clk_ops clk_fixup_div_ops = {
-       .recalc_rate = clk_fixup_div_recalc_rate,
-       .round_rate = clk_fixup_div_round_rate,
-       .set_rate = clk_fixup_div_set_rate,
-};
-
-struct clk *imx_clk_fixup_divider(const char *name, const char *parent,
-                                 void __iomem *reg, u8 shift, u8 width,
-                                 void (*fixup)(u32 *val))
-{
-       struct clk_fixup_div *fixup_div;
-       struct clk *clk;
-       struct clk_init_data init;
-
-       if (!fixup)
-               return ERR_PTR(-EINVAL);
-
-       fixup_div = kzalloc(sizeof(*fixup_div), GFP_KERNEL);
-       if (!fixup_div)
-               return ERR_PTR(-ENOMEM);
-
-       init.name = name;
-       init.ops = &clk_fixup_div_ops;
-       init.flags = CLK_SET_RATE_PARENT;
-       init.parent_names = parent ? &parent : NULL;
-       init.num_parents = parent ? 1 : 0;
-
-       fixup_div->divider.reg = reg;
-       fixup_div->divider.shift = shift;
-       fixup_div->divider.width = width;
-       fixup_div->divider.lock = &imx_ccm_lock;
-       fixup_div->divider.hw.init = &init;
-       fixup_div->ops = &clk_divider_ops;
-       fixup_div->fixup = fixup;
-
-       clk = clk_register(NULL, &fixup_div->divider.hw);
-       if (IS_ERR(clk))
-               kfree(fixup_div);
-
-       return clk;
-}
diff --git a/arch/arm/mach-imx/clk-fixup-mux.c b/arch/arm/mach-imx/clk-fixup-mux.c
deleted file mode 100644 (file)
index 0d40b35..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Copyright (C) 2013 Freescale Semiconductor, Inc.
- *
- * 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:
- *
- * http://www.opensource.org/licenses/gpl-license.html
- * http://www.gnu.org/copyleft/gpl.html
- */
-
-#include <linux/clk-provider.h>
-#include <linux/err.h>
-#include <linux/io.h>
-#include <linux/slab.h>
-#include "clk.h"
-
-#define to_clk_mux(_hw) container_of(_hw, struct clk_mux, hw)
-
-/**
- * struct clk_fixup_mux - imx integer fixup multiplexer clock
- * @mux: the parent class
- * @ops: pointer to clk_ops of parent class
- * @fixup: a hook to fixup the write value
- *
- * The imx fixup multiplexer clock is a subclass of basic clk_mux
- * with an addtional fixup hook.
- */
-struct clk_fixup_mux {
-       struct clk_mux mux;
-       const struct clk_ops *ops;
-       void (*fixup)(u32 *val);
-};
-
-static inline struct clk_fixup_mux *to_clk_fixup_mux(struct clk_hw *hw)
-{
-       struct clk_mux *mux = to_clk_mux(hw);
-
-       return container_of(mux, struct clk_fixup_mux, mux);
-}
-
-static u8 clk_fixup_mux_get_parent(struct clk_hw *hw)
-{
-       struct clk_fixup_mux *fixup_mux = to_clk_fixup_mux(hw);
-
-       return fixup_mux->ops->get_parent(&fixup_mux->mux.hw);
-}
-
-static int clk_fixup_mux_set_parent(struct clk_hw *hw, u8 index)
-{
-       struct clk_fixup_mux *fixup_mux = to_clk_fixup_mux(hw);
-       struct clk_mux *mux = to_clk_mux(hw);
-       unsigned long flags = 0;
-       u32 val;
-
-       spin_lock_irqsave(mux->lock, flags);
-
-       val = readl(mux->reg);
-       val &= ~(mux->mask << mux->shift);
-       val |= index << mux->shift;
-       fixup_mux->fixup(&val);
-       writel(val, mux->reg);
-
-       spin_unlock_irqrestore(mux->lock, flags);
-
-       return 0;
-}
-
-static const struct clk_ops clk_fixup_mux_ops = {
-       .get_parent = clk_fixup_mux_get_parent,
-       .set_parent = clk_fixup_mux_set_parent,
-};
-
-struct clk *imx_clk_fixup_mux(const char *name, void __iomem *reg,
-                             u8 shift, u8 width, const char **parents,
-                             int num_parents, void (*fixup)(u32 *val))
-{
-       struct clk_fixup_mux *fixup_mux;
-       struct clk *clk;
-       struct clk_init_data init;
-
-       if (!fixup)
-               return ERR_PTR(-EINVAL);
-
-       fixup_mux = kzalloc(sizeof(*fixup_mux), GFP_KERNEL);
-       if (!fixup_mux)
-               return ERR_PTR(-ENOMEM);
-
-       init.name = name;
-       init.ops = &clk_fixup_mux_ops;
-       init.parent_names = parents;
-       init.num_parents = num_parents;
-       init.flags = 0;
-
-       fixup_mux->mux.reg = reg;
-       fixup_mux->mux.shift = shift;
-       fixup_mux->mux.mask = BIT(width) - 1;
-       fixup_mux->mux.lock = &imx_ccm_lock;
-       fixup_mux->mux.hw.init = &init;
-       fixup_mux->ops = &clk_mux_ops;
-       fixup_mux->fixup = fixup;
-
-       clk = clk_register(NULL, &fixup_mux->mux.hw);
-       if (IS_ERR(clk))
-               kfree(fixup_mux);
-
-       return clk;
-}
diff --git a/arch/arm/mach-imx/clk-gate-exclusive.c b/arch/arm/mach-imx/clk-gate-exclusive.c
deleted file mode 100644 (file)
index c12f5f2..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Copyright 2014 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.
- */
-
-#include <linux/clk-provider.h>
-#include <linux/err.h>
-#include <linux/io.h>
-#include <linux/slab.h>
-#include "clk.h"
-
-/**
- * struct clk_gate_exclusive - i.MX specific gate clock which is mutually
- * exclusive with other gate clocks
- *
- * @gate: the parent class
- * @exclusive_mask: mask of gate bits which are mutually exclusive to this
- *     gate clock
- *
- * The imx exclusive gate clock is a subclass of basic clk_gate
- * with an addtional mask to indicate which other gate bits in the same
- * register is mutually exclusive to this gate clock.
- */
-struct clk_gate_exclusive {
-       struct clk_gate gate;
-       u32 exclusive_mask;
-};
-
-static int clk_gate_exclusive_enable(struct clk_hw *hw)
-{
-       struct clk_gate *gate = container_of(hw, struct clk_gate, hw);
-       struct clk_gate_exclusive *exgate = container_of(gate,
-                                       struct clk_gate_exclusive, gate);
-       u32 val = readl(gate->reg);
-
-       if (val & exgate->exclusive_mask)
-               return -EBUSY;
-
-       return clk_gate_ops.enable(hw);
-}
-
-static void clk_gate_exclusive_disable(struct clk_hw *hw)
-{
-       clk_gate_ops.disable(hw);
-}
-
-static int clk_gate_exclusive_is_enabled(struct clk_hw *hw)
-{
-       return clk_gate_ops.is_enabled(hw);
-}
-
-static const struct clk_ops clk_gate_exclusive_ops = {
-       .enable = clk_gate_exclusive_enable,
-       .disable = clk_gate_exclusive_disable,
-       .is_enabled = clk_gate_exclusive_is_enabled,
-};
-
-struct clk *imx_clk_gate_exclusive(const char *name, const char *parent,
-        void __iomem *reg, u8 shift, u32 exclusive_mask)
-{
-       struct clk_gate_exclusive *exgate;
-       struct clk_gate *gate;
-       struct clk *clk;
-       struct clk_init_data init;
-
-       if (exclusive_mask == 0)
-               return ERR_PTR(-EINVAL);
-
-       exgate = kzalloc(sizeof(*exgate), GFP_KERNEL);
-       if (!exgate)
-               return ERR_PTR(-ENOMEM);
-       gate = &exgate->gate;
-
-       init.name = name;
-       init.ops = &clk_gate_exclusive_ops;
-       init.flags = CLK_SET_RATE_PARENT;
-       init.parent_names = parent ? &parent : NULL;
-       init.num_parents = parent ? 1 : 0;
-
-       gate->reg = reg;
-       gate->bit_idx = shift;
-       gate->lock = &imx_ccm_lock;
-       gate->hw.init = &init;
-       exgate->exclusive_mask = exclusive_mask;
-
-       clk = clk_register(NULL, &gate->hw);
-       if (IS_ERR(clk))
-               kfree(exgate);
-
-       return clk;
-}
diff --git a/arch/arm/mach-imx/clk-gate2.c b/arch/arm/mach-imx/clk-gate2.c
deleted file mode 100644 (file)
index 8935bff..0000000
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * Copyright (C) 2010-2011 Canonical Ltd <jeremy.kerr@canonical.com>
- * Copyright (C) 2011-2012 Mike Turquette, Linaro Ltd <mturquette@linaro.org>
- *
- * 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.
- *
- * Gated clock implementation
- */
-
-#include <linux/clk-provider.h>
-#include <linux/module.h>
-#include <linux/slab.h>
-#include <linux/io.h>
-#include <linux/err.h>
-#include <linux/string.h>
-#include "clk.h"
-
-/**
- * DOC: basic gatable clock which can gate and ungate it's ouput
- *
- * Traits of this clock:
- * prepare - clk_(un)prepare only ensures parent is (un)prepared
- * enable - clk_enable and clk_disable are functional & control gating
- * rate - inherits rate from parent.  No clk_set_rate support
- * parent - fixed parent.  No clk_set_parent support
- */
-
-struct clk_gate2 {
-       struct clk_hw hw;
-       void __iomem    *reg;
-       u8              bit_idx;
-       u8              flags;
-       spinlock_t      *lock;
-       unsigned int    *share_count;
-};
-
-#define to_clk_gate2(_hw) container_of(_hw, struct clk_gate2, hw)
-
-static int clk_gate2_enable(struct clk_hw *hw)
-{
-       struct clk_gate2 *gate = to_clk_gate2(hw);
-       u32 reg;
-       unsigned long flags = 0;
-
-       spin_lock_irqsave(gate->lock, flags);
-
-       if (gate->share_count && (*gate->share_count)++ > 0)
-               goto out;
-
-       reg = readl(gate->reg);
-       reg |= 3 << gate->bit_idx;
-       writel(reg, gate->reg);
-
-out:
-       spin_unlock_irqrestore(gate->lock, flags);
-
-       return 0;
-}
-
-static void clk_gate2_disable(struct clk_hw *hw)
-{
-       struct clk_gate2 *gate = to_clk_gate2(hw);
-       u32 reg;
-       unsigned long flags = 0;
-
-       spin_lock_irqsave(gate->lock, flags);
-
-       if (gate->share_count) {
-               if (WARN_ON(*gate->share_count == 0))
-                       goto out;
-               else if (--(*gate->share_count) > 0)
-                       goto out;
-       }
-
-       reg = readl(gate->reg);
-       reg &= ~(3 << gate->bit_idx);
-       writel(reg, gate->reg);
-
-out:
-       spin_unlock_irqrestore(gate->lock, flags);
-}
-
-static int clk_gate2_reg_is_enabled(void __iomem *reg, u8 bit_idx)
-{
-       u32 val = readl(reg);
-
-       if (((val >> bit_idx) & 1) == 1)
-               return 1;
-
-       return 0;
-}
-
-static int clk_gate2_is_enabled(struct clk_hw *hw)
-{
-       struct clk_gate2 *gate = to_clk_gate2(hw);
-
-       return clk_gate2_reg_is_enabled(gate->reg, gate->bit_idx);
-}
-
-static void clk_gate2_disable_unused(struct clk_hw *hw)
-{
-       struct clk_gate2 *gate = to_clk_gate2(hw);
-       unsigned long flags = 0;
-       u32 reg;
-
-       spin_lock_irqsave(gate->lock, flags);
-
-       if (!gate->share_count || *gate->share_count == 0) {
-               reg = readl(gate->reg);
-               reg &= ~(3 << gate->bit_idx);
-               writel(reg, gate->reg);
-       }
-
-       spin_unlock_irqrestore(gate->lock, flags);
-}
-
-static struct clk_ops clk_gate2_ops = {
-       .enable = clk_gate2_enable,
-       .disable = clk_gate2_disable,
-       .disable_unused = clk_gate2_disable_unused,
-       .is_enabled = clk_gate2_is_enabled,
-};
-
-struct clk *clk_register_gate2(struct device *dev, const char *name,
-               const char *parent_name, unsigned long flags,
-               void __iomem *reg, u8 bit_idx,
-               u8 clk_gate2_flags, spinlock_t *lock,
-               unsigned int *share_count)
-{
-       struct clk_gate2 *gate;
-       struct clk *clk;
-       struct clk_init_data init;
-
-       gate = kzalloc(sizeof(struct clk_gate2), GFP_KERNEL);
-       if (!gate)
-               return ERR_PTR(-ENOMEM);
-
-       /* struct clk_gate2 assignments */
-       gate->reg = reg;
-       gate->bit_idx = bit_idx;
-       gate->flags = clk_gate2_flags;
-       gate->lock = lock;
-       gate->share_count = share_count;
-
-       init.name = name;
-       init.ops = &clk_gate2_ops;
-       init.flags = flags;
-       init.parent_names = parent_name ? &parent_name : NULL;
-       init.num_parents = parent_name ? 1 : 0;
-
-       gate->hw.init = &init;
-
-       clk = clk_register(dev, &gate->hw);
-       if (IS_ERR(clk))
-               kfree(gate);
-
-       return clk;
-}
diff --git a/arch/arm/mach-imx/clk-imx1.c b/arch/arm/mach-imx/clk-imx1.c
deleted file mode 100644 (file)
index 37c307a..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- *  Copyright (C) 2008 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#include <linux/clk.h>
-#include <linux/clkdev.h>
-#include <linux/clk-provider.h>
-#include <linux/err.h>
-#include <linux/init.h>
-#include <linux/of.h>
-#include <linux/of_address.h>
-#include <dt-bindings/clock/imx1-clock.h>
-
-#include "clk.h"
-#include "common.h"
-#include "hardware.h"
-
-static const char *prem_sel_clks[] = { "clk32_premult", "clk16m", };
-static const char *clko_sel_clks[] = { "per1", "hclk", "clk48m", "clk16m",
-                                      "prem", "fclk", };
-
-static struct clk *clk[IMX1_CLK_MAX];
-static struct clk_onecell_data clk_data;
-
-static void __iomem *ccm __initdata;
-#define CCM_CSCR       (ccm + 0x0000)
-#define CCM_MPCTL0     (ccm + 0x0004)
-#define CCM_SPCTL0     (ccm + 0x000c)
-#define CCM_PCDR       (ccm + 0x0020)
-#define SCM_GCCR       (ccm + 0x0810)
-
-static void __init _mx1_clocks_init(unsigned long fref)
-{
-       clk[IMX1_CLK_DUMMY] = imx_clk_fixed("dummy", 0);
-       clk[IMX1_CLK_CLK32] = imx_obtain_fixed_clock("clk32", fref);
-       clk[IMX1_CLK_CLK16M_EXT] = imx_clk_fixed("clk16m_ext", 16000000);
-       clk[IMX1_CLK_CLK16M] = imx_clk_gate("clk16m", "clk16m_ext", CCM_CSCR, 17);
-       clk[IMX1_CLK_CLK32_PREMULT] = imx_clk_fixed_factor("clk32_premult", "clk32", 512, 1);
-       clk[IMX1_CLK_PREM] = imx_clk_mux("prem", CCM_CSCR, 16, 1, prem_sel_clks, ARRAY_SIZE(prem_sel_clks));
-       clk[IMX1_CLK_MPLL] = imx_clk_pllv1("mpll", "clk32_premult", CCM_MPCTL0);
-       clk[IMX1_CLK_MPLL_GATE] = imx_clk_gate("mpll_gate", "mpll", CCM_CSCR, 0);
-       clk[IMX1_CLK_SPLL] = imx_clk_pllv1("spll", "prem", CCM_SPCTL0);
-       clk[IMX1_CLK_SPLL_GATE] = imx_clk_gate("spll_gate", "spll", CCM_CSCR, 1);
-       clk[IMX1_CLK_MCU] = imx_clk_divider("mcu", "clk32_premult", CCM_CSCR, 15, 1);
-       clk[IMX1_CLK_FCLK] = imx_clk_divider("fclk", "mpll_gate", CCM_CSCR, 15, 1);
-       clk[IMX1_CLK_HCLK] = imx_clk_divider("hclk", "spll_gate", CCM_CSCR, 10, 4);
-       clk[IMX1_CLK_CLK48M] = imx_clk_divider("clk48m", "spll_gate", CCM_CSCR, 26, 3);
-       clk[IMX1_CLK_PER1] = imx_clk_divider("per1", "spll_gate", CCM_PCDR, 0, 4);
-       clk[IMX1_CLK_PER2] = imx_clk_divider("per2", "spll_gate", CCM_PCDR, 4, 4);
-       clk[IMX1_CLK_PER3] = imx_clk_divider("per3", "spll_gate", CCM_PCDR, 16, 7);
-       clk[IMX1_CLK_CLKO] = imx_clk_mux("clko", CCM_CSCR, 29, 3, clko_sel_clks, ARRAY_SIZE(clko_sel_clks));
-       clk[IMX1_CLK_UART3_GATE] = imx_clk_gate("uart3_gate", "hclk", SCM_GCCR, 6);
-       clk[IMX1_CLK_SSI2_GATE] = imx_clk_gate("ssi2_gate", "hclk", SCM_GCCR, 5);
-       clk[IMX1_CLK_BROM_GATE] = imx_clk_gate("brom_gate", "hclk", SCM_GCCR, 4);
-       clk[IMX1_CLK_DMA_GATE] = imx_clk_gate("dma_gate", "hclk", SCM_GCCR, 3);
-       clk[IMX1_CLK_CSI_GATE] = imx_clk_gate("csi_gate", "hclk", SCM_GCCR, 2);
-       clk[IMX1_CLK_MMA_GATE] = imx_clk_gate("mma_gate", "hclk", SCM_GCCR, 1);
-       clk[IMX1_CLK_USBD_GATE] = imx_clk_gate("usbd_gate", "clk48m", SCM_GCCR, 0);
-
-       imx_check_clocks(clk, ARRAY_SIZE(clk));
-}
-
-int __init mx1_clocks_init(unsigned long fref)
-{
-       ccm = MX1_IO_ADDRESS(MX1_CCM_BASE_ADDR);
-
-       _mx1_clocks_init(fref);
-
-       clk_register_clkdev(clk[IMX1_CLK_PER1], "per", "imx-gpt.0");
-       clk_register_clkdev(clk[IMX1_CLK_HCLK], "ipg", "imx-gpt.0");
-       clk_register_clkdev(clk[IMX1_CLK_DMA_GATE], "ahb", "imx1-dma");
-       clk_register_clkdev(clk[IMX1_CLK_HCLK], "ipg", "imx1-dma");
-       clk_register_clkdev(clk[IMX1_CLK_PER1], "per", "imx1-uart.0");
-       clk_register_clkdev(clk[IMX1_CLK_HCLK], "ipg", "imx1-uart.0");
-       clk_register_clkdev(clk[IMX1_CLK_PER1], "per", "imx1-uart.1");
-       clk_register_clkdev(clk[IMX1_CLK_HCLK], "ipg", "imx1-uart.1");
-       clk_register_clkdev(clk[IMX1_CLK_PER1], "per", "imx1-uart.2");
-       clk_register_clkdev(clk[IMX1_CLK_UART3_GATE], "ipg", "imx1-uart.2");
-       clk_register_clkdev(clk[IMX1_CLK_HCLK], NULL, "imx1-i2c.0");
-       clk_register_clkdev(clk[IMX1_CLK_PER2], "per", "imx1-cspi.0");
-       clk_register_clkdev(clk[IMX1_CLK_DUMMY], "ipg", "imx1-cspi.0");
-       clk_register_clkdev(clk[IMX1_CLK_PER2], "per", "imx1-cspi.1");
-       clk_register_clkdev(clk[IMX1_CLK_DUMMY], "ipg", "imx1-cspi.1");
-       clk_register_clkdev(clk[IMX1_CLK_PER2], "per", "imx1-fb.0");
-       clk_register_clkdev(clk[IMX1_CLK_DUMMY], "ipg", "imx1-fb.0");
-       clk_register_clkdev(clk[IMX1_CLK_DUMMY], "ahb", "imx1-fb.0");
-
-       mxc_timer_init(MX1_IO_ADDRESS(MX1_TIM1_BASE_ADDR), MX1_TIM1_INT);
-
-       return 0;
-}
-
-static void __init mx1_clocks_init_dt(struct device_node *np)
-{
-       ccm = of_iomap(np, 0);
-       BUG_ON(!ccm);
-
-       _mx1_clocks_init(32768);
-
-       clk_data.clks = clk;
-       clk_data.clk_num = ARRAY_SIZE(clk);
-       of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
-}
-CLK_OF_DECLARE(imx1_ccm, "fsl,imx1-ccm", mx1_clocks_init_dt);
diff --git a/arch/arm/mach-imx/clk-imx21.c b/arch/arm/mach-imx/clk-imx21.c
deleted file mode 100644 (file)
index 4b4c753..0000000
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
- * Copyright 2008 Juergen Beisert, kernel@pengutronix.de
- * Copyright 2008 Martin Fuzzey, mfuzzey@gmail.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.
- */
-
-#include <linux/clk.h>
-#include <linux/clk-provider.h>
-#include <linux/clkdev.h>
-#include <linux/of.h>
-#include <linux/of_address.h>
-#include <dt-bindings/clock/imx21-clock.h>
-
-#include "clk.h"
-#include "common.h"
-#include "hardware.h"
-
-static void __iomem *ccm __initdata;
-
-/* Register offsets */
-#define CCM_CSCR       (ccm + 0x00)
-#define CCM_MPCTL0     (ccm + 0x04)
-#define CCM_SPCTL0     (ccm + 0x0c)
-#define CCM_PCDR0      (ccm + 0x18)
-#define CCM_PCDR1      (ccm + 0x1c)
-#define CCM_PCCR0      (ccm + 0x20)
-#define CCM_PCCR1      (ccm + 0x24)
-
-static const char *mpll_osc_sel_clks[] = { "ckih_gate", "ckih_div1p5", };
-static const char *mpll_sel_clks[] = { "fpm_gate", "mpll_osc_sel", };
-static const char *spll_sel_clks[] = { "fpm_gate", "mpll_osc_sel", };
-static const char *ssi_sel_clks[] = { "spll_gate", "mpll_gate", };
-
-static struct clk *clk[IMX21_CLK_MAX];
-static struct clk_onecell_data clk_data;
-
-static void __init _mx21_clocks_init(unsigned long lref, unsigned long href)
-{
-       BUG_ON(!ccm);
-
-       clk[IMX21_CLK_DUMMY] = imx_clk_fixed("dummy", 0);
-       clk[IMX21_CLK_CKIL] = imx_obtain_fixed_clock("ckil", lref);
-       clk[IMX21_CLK_CKIH] = imx_obtain_fixed_clock("ckih", href);
-       clk[IMX21_CLK_FPM] = imx_clk_fixed_factor("fpm", "ckil", 512, 1);
-       clk[IMX21_CLK_CKIH_DIV1P5] = imx_clk_fixed_factor("ckih_div1p5", "ckih_gate", 2, 3);
-
-       clk[IMX21_CLK_MPLL_GATE] = imx_clk_gate("mpll_gate", "mpll", CCM_CSCR, 0);
-       clk[IMX21_CLK_SPLL_GATE] = imx_clk_gate("spll_gate", "spll", CCM_CSCR, 1);
-       clk[IMX21_CLK_FPM_GATE] = imx_clk_gate("fpm_gate", "fpm", CCM_CSCR, 2);
-       clk[IMX21_CLK_CKIH_GATE] = imx_clk_gate_dis("ckih_gate", "ckih", CCM_CSCR, 3);
-       clk[IMX21_CLK_MPLL_OSC_SEL] = imx_clk_mux("mpll_osc_sel", CCM_CSCR, 4, 1, mpll_osc_sel_clks, ARRAY_SIZE(mpll_osc_sel_clks));
-       clk[IMX21_CLK_IPG] = imx_clk_divider("ipg", "hclk", CCM_CSCR, 9, 1);
-       clk[IMX21_CLK_HCLK] = imx_clk_divider("hclk", "fclk", CCM_CSCR, 10, 4);
-       clk[IMX21_CLK_MPLL_SEL] = imx_clk_mux("mpll_sel", CCM_CSCR, 16, 1, mpll_sel_clks, ARRAY_SIZE(mpll_sel_clks));
-       clk[IMX21_CLK_SPLL_SEL] = imx_clk_mux("spll_sel", CCM_CSCR, 17, 1, spll_sel_clks, ARRAY_SIZE(spll_sel_clks));
-       clk[IMX21_CLK_SSI1_SEL] = imx_clk_mux("ssi1_sel", CCM_CSCR, 19, 1, ssi_sel_clks, ARRAY_SIZE(ssi_sel_clks));
-       clk[IMX21_CLK_SSI2_SEL] = imx_clk_mux("ssi2_sel", CCM_CSCR, 20, 1, ssi_sel_clks, ARRAY_SIZE(ssi_sel_clks));
-       clk[IMX21_CLK_USB_DIV] = imx_clk_divider("usb_div", "spll_gate", CCM_CSCR, 26, 3);
-       clk[IMX21_CLK_FCLK] = imx_clk_divider("fclk", "mpll_gate", CCM_CSCR, 29, 3);
-
-       clk[IMX21_CLK_MPLL] = imx_clk_pllv1("mpll", "mpll_sel", CCM_MPCTL0);
-
-       clk[IMX21_CLK_SPLL] = imx_clk_pllv1("spll", "spll_sel", CCM_SPCTL0);
-
-       clk[IMX21_CLK_NFC_DIV] = imx_clk_divider("nfc_div", "fclk", CCM_PCDR0, 12, 4);
-       clk[IMX21_CLK_SSI1_DIV] = imx_clk_divider("ssi1_div", "ssi1_sel", CCM_PCDR0, 16, 6);
-       clk[IMX21_CLK_SSI2_DIV] = imx_clk_divider("ssi2_div", "ssi2_sel", CCM_PCDR0, 26, 6);
-
-       clk[IMX21_CLK_PER1] = imx_clk_divider("per1", "mpll_gate", CCM_PCDR1, 0, 6);
-       clk[IMX21_CLK_PER2] = imx_clk_divider("per2", "mpll_gate", CCM_PCDR1, 8, 6);
-       clk[IMX21_CLK_PER3] = imx_clk_divider("per3", "mpll_gate", CCM_PCDR1, 16, 6);
-       clk[IMX21_CLK_PER4] = imx_clk_divider("per4", "mpll_gate", CCM_PCDR1, 24, 6);
-
-       clk[IMX21_CLK_UART1_IPG_GATE] = imx_clk_gate("uart1_ipg_gate", "ipg", CCM_PCCR0, 0);
-       clk[IMX21_CLK_UART2_IPG_GATE] = imx_clk_gate("uart2_ipg_gate", "ipg", CCM_PCCR0, 1);
-       clk[IMX21_CLK_UART3_IPG_GATE] = imx_clk_gate("uart3_ipg_gate", "ipg", CCM_PCCR0, 2);
-       clk[IMX21_CLK_UART4_IPG_GATE] = imx_clk_gate("uart4_ipg_gate", "ipg", CCM_PCCR0, 3);
-       clk[IMX21_CLK_CSPI1_IPG_GATE] = imx_clk_gate("cspi1_ipg_gate", "ipg", CCM_PCCR0, 4);
-       clk[IMX21_CLK_CSPI2_IPG_GATE] = imx_clk_gate("cspi2_ipg_gate", "ipg", CCM_PCCR0, 5);
-       clk[IMX21_CLK_SSI1_GATE] = imx_clk_gate("ssi1_gate", "ipg", CCM_PCCR0, 6);
-       clk[IMX21_CLK_SSI2_GATE] = imx_clk_gate("ssi2_gate", "ipg", CCM_PCCR0, 7);
-       clk[IMX21_CLK_SDHC1_IPG_GATE] = imx_clk_gate("sdhc1_ipg_gate", "ipg", CCM_PCCR0, 9);
-       clk[IMX21_CLK_SDHC2_IPG_GATE] = imx_clk_gate("sdhc2_ipg_gate", "ipg", CCM_PCCR0, 10);
-       clk[IMX21_CLK_GPIO_GATE] = imx_clk_gate("gpio_gate", "ipg", CCM_PCCR0, 11);
-       clk[IMX21_CLK_I2C_GATE] = imx_clk_gate("i2c_gate", "ipg", CCM_PCCR0, 12);
-       clk[IMX21_CLK_DMA_GATE] = imx_clk_gate("dma_gate", "ipg", CCM_PCCR0, 13);
-       clk[IMX21_CLK_USB_GATE] = imx_clk_gate("usb_gate", "usb_div", CCM_PCCR0, 14);
-       clk[IMX21_CLK_EMMA_GATE] = imx_clk_gate("emma_gate", "ipg", CCM_PCCR0, 15);
-       clk[IMX21_CLK_SSI2_BAUD_GATE] = imx_clk_gate("ssi2_baud_gate", "ipg", CCM_PCCR0, 16);
-       clk[IMX21_CLK_SSI1_BAUD_GATE] = imx_clk_gate("ssi1_baud_gate", "ipg", CCM_PCCR0, 17);
-       clk[IMX21_CLK_LCDC_IPG_GATE] = imx_clk_gate("lcdc_ipg_gate", "ipg", CCM_PCCR0, 18);
-       clk[IMX21_CLK_NFC_GATE] = imx_clk_gate("nfc_gate", "nfc_div", CCM_PCCR0, 19);
-       clk[IMX21_CLK_SLCDC_HCLK_GATE] = imx_clk_gate("slcdc_hclk_gate", "hclk", CCM_PCCR0, 21);
-       clk[IMX21_CLK_PER4_GATE] = imx_clk_gate("per4_gate", "per4", CCM_PCCR0, 22);
-       clk[IMX21_CLK_BMI_GATE] = imx_clk_gate("bmi_gate", "hclk", CCM_PCCR0, 23);
-       clk[IMX21_CLK_USB_HCLK_GATE] = imx_clk_gate("usb_hclk_gate", "hclk", CCM_PCCR0, 24);
-       clk[IMX21_CLK_SLCDC_GATE] = imx_clk_gate("slcdc_gate", "hclk", CCM_PCCR0, 25);
-       clk[IMX21_CLK_LCDC_HCLK_GATE] = imx_clk_gate("lcdc_hclk_gate", "hclk", CCM_PCCR0, 26);
-       clk[IMX21_CLK_EMMA_HCLK_GATE] = imx_clk_gate("emma_hclk_gate", "hclk", CCM_PCCR0, 27);
-       clk[IMX21_CLK_BROM_GATE] = imx_clk_gate("brom_gate", "hclk", CCM_PCCR0, 28);
-       clk[IMX21_CLK_DMA_HCLK_GATE] = imx_clk_gate("dma_hclk_gate", "hclk", CCM_PCCR0, 30);
-       clk[IMX21_CLK_CSI_HCLK_GATE] = imx_clk_gate("csi_hclk_gate", "hclk", CCM_PCCR0, 31);
-
-       clk[IMX21_CLK_CSPI3_IPG_GATE] = imx_clk_gate("cspi3_ipg_gate", "ipg", CCM_PCCR1, 23);
-       clk[IMX21_CLK_WDOG_GATE] = imx_clk_gate("wdog_gate", "ipg", CCM_PCCR1, 24);
-       clk[IMX21_CLK_GPT1_IPG_GATE] = imx_clk_gate("gpt1_ipg_gate", "ipg", CCM_PCCR1, 25);
-       clk[IMX21_CLK_GPT2_IPG_GATE] = imx_clk_gate("gpt2_ipg_gate", "ipg", CCM_PCCR1, 26);
-       clk[IMX21_CLK_GPT3_IPG_GATE] = imx_clk_gate("gpt3_ipg_gate", "ipg", CCM_PCCR1, 27);
-       clk[IMX21_CLK_PWM_IPG_GATE] = imx_clk_gate("pwm_ipg_gate", "ipg", CCM_PCCR1, 28);
-       clk[IMX21_CLK_RTC_GATE] = imx_clk_gate("rtc_gate", "ipg", CCM_PCCR1, 29);
-       clk[IMX21_CLK_KPP_GATE] = imx_clk_gate("kpp_gate", "ipg", CCM_PCCR1, 30);
-       clk[IMX21_CLK_OWIRE_GATE] = imx_clk_gate("owire_gate", "ipg", CCM_PCCR1, 31);
-
-       imx_check_clocks(clk, ARRAY_SIZE(clk));
-}
-
-int __init mx21_clocks_init(unsigned long lref, unsigned long href)
-{
-       ccm = ioremap(MX21_CCM_BASE_ADDR, SZ_2K);
-
-       _mx21_clocks_init(lref, href);
-
-       clk_register_clkdev(clk[IMX21_CLK_PER1], "per", "imx21-uart.0");
-       clk_register_clkdev(clk[IMX21_CLK_UART1_IPG_GATE], "ipg", "imx21-uart.0");
-       clk_register_clkdev(clk[IMX21_CLK_PER1], "per", "imx21-uart.1");
-       clk_register_clkdev(clk[IMX21_CLK_UART2_IPG_GATE], "ipg", "imx21-uart.1");
-       clk_register_clkdev(clk[IMX21_CLK_PER1], "per", "imx21-uart.2");
-       clk_register_clkdev(clk[IMX21_CLK_UART3_IPG_GATE], "ipg", "imx21-uart.2");
-       clk_register_clkdev(clk[IMX21_CLK_PER1], "per", "imx21-uart.3");
-       clk_register_clkdev(clk[IMX21_CLK_UART4_IPG_GATE], "ipg", "imx21-uart.3");
-       clk_register_clkdev(clk[IMX21_CLK_GPT1_IPG_GATE], "ipg", "imx-gpt.0");
-       clk_register_clkdev(clk[IMX21_CLK_PER1], "per", "imx-gpt.0");
-       clk_register_clkdev(clk[IMX21_CLK_PER2], "per", "imx21-cspi.0");
-       clk_register_clkdev(clk[IMX21_CLK_CSPI1_IPG_GATE], "ipg", "imx21-cspi.0");
-       clk_register_clkdev(clk[IMX21_CLK_PER2], "per", "imx21-cspi.1");
-       clk_register_clkdev(clk[IMX21_CLK_CSPI2_IPG_GATE], "ipg", "imx21-cspi.1");
-       clk_register_clkdev(clk[IMX21_CLK_PER2], "per", "imx21-cspi.2");
-       clk_register_clkdev(clk[IMX21_CLK_CSPI3_IPG_GATE], "ipg", "imx21-cspi.2");
-       clk_register_clkdev(clk[IMX21_CLK_PER3], "per", "imx21-fb.0");
-       clk_register_clkdev(clk[IMX21_CLK_LCDC_IPG_GATE], "ipg", "imx21-fb.0");
-       clk_register_clkdev(clk[IMX21_CLK_LCDC_HCLK_GATE], "ahb", "imx21-fb.0");
-       clk_register_clkdev(clk[IMX21_CLK_USB_GATE], "per", "imx21-hcd.0");
-       clk_register_clkdev(clk[IMX21_CLK_USB_HCLK_GATE], "ahb", "imx21-hcd.0");
-       clk_register_clkdev(clk[IMX21_CLK_NFC_GATE], NULL, "imx21-nand.0");
-       clk_register_clkdev(clk[IMX21_CLK_DMA_HCLK_GATE], "ahb", "imx21-dma");
-       clk_register_clkdev(clk[IMX21_CLK_DMA_GATE], "ipg", "imx21-dma");
-       clk_register_clkdev(clk[IMX21_CLK_WDOG_GATE], NULL, "imx2-wdt.0");
-       clk_register_clkdev(clk[IMX21_CLK_I2C_GATE], NULL, "imx21-i2c.0");
-       clk_register_clkdev(clk[IMX21_CLK_OWIRE_GATE], NULL, "mxc_w1.0");
-
-       mxc_timer_init(MX21_IO_ADDRESS(MX21_GPT1_BASE_ADDR), MX21_INT_GPT1);
-
-       return 0;
-}
-
-static void __init mx21_clocks_init_dt(struct device_node *np)
-{
-       ccm = of_iomap(np, 0);
-
-       _mx21_clocks_init(32768, 26000000);
-
-       clk_data.clks = clk;
-       clk_data.clk_num = ARRAY_SIZE(clk);
-       of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
-}
-CLK_OF_DECLARE(imx27_ccm, "fsl,imx21-ccm", mx21_clocks_init_dt);
diff --git a/arch/arm/mach-imx/clk-imx25.c b/arch/arm/mach-imx/clk-imx25.c
deleted file mode 100644 (file)
index 9c2633a..0000000
+++ /dev/null
@@ -1,264 +0,0 @@
-/*
- * Copyright (C) 2009 by Sascha Hauer, Pengutronix
- *
- * 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., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- */
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/list.h>
-#include <linux/clk.h>
-#include <linux/io.h>
-#include <linux/clkdev.h>
-#include <linux/err.h>
-#include <linux/of.h>
-#include <linux/of_address.h>
-#include <linux/of_irq.h>
-
-#include "clk.h"
-#include "common.h"
-#include "hardware.h"
-
-#define CCM_MPCTL      0x00
-#define CCM_UPCTL      0x04
-#define CCM_CCTL       0x08
-#define CCM_CGCR0      0x0C
-#define CCM_CGCR1      0x10
-#define CCM_CGCR2      0x14
-#define CCM_PCDR0      0x18
-#define CCM_PCDR1      0x1C
-#define CCM_PCDR2      0x20
-#define CCM_PCDR3      0x24
-#define CCM_RCSR       0x28
-#define CCM_CRDR       0x2C
-#define CCM_DCVR0      0x30
-#define CCM_DCVR1      0x34
-#define CCM_DCVR2      0x38
-#define CCM_DCVR3      0x3c
-#define CCM_LTR0       0x40
-#define CCM_LTR1       0x44
-#define CCM_LTR2       0x48
-#define CCM_LTR3       0x4c
-#define CCM_MCR                0x64
-
-#define ccm(x) (ccm_base + (x))
-
-static struct clk_onecell_data clk_data;
-
-static const char *cpu_sel_clks[] = { "mpll", "mpll_cpu_3_4", };
-static const char *per_sel_clks[] = { "ahb", "upll", };
-static const char *cko_sel_clks[] = { "dummy", "osc", "cpu", "ahb",
-                                     "ipg", "dummy", "dummy", "dummy",
-                                     "dummy", "dummy", "per0", "per2",
-                                     "per13", "per14", "usbotg_ahb", "dummy",};
-
-enum mx25_clks {
-       dummy, osc, mpll, upll, mpll_cpu_3_4, cpu_sel, cpu, ahb, usb_div, ipg,
-       per0_sel, per1_sel, per2_sel, per3_sel, per4_sel, per5_sel, per6_sel,
-       per7_sel, per8_sel, per9_sel, per10_sel, per11_sel, per12_sel,
-       per13_sel, per14_sel, per15_sel, per0, per1, per2, per3, per4, per5,
-       per6, per7, per8, per9, per10, per11, per12, per13, per14, per15,
-       csi_ipg_per, epit_ipg_per, esai_ipg_per, esdhc1_ipg_per, esdhc2_ipg_per,
-       gpt_ipg_per, i2c_ipg_per, lcdc_ipg_per, nfc_ipg_per, owire_ipg_per,
-       pwm_ipg_per, sim1_ipg_per, sim2_ipg_per, ssi1_ipg_per, ssi2_ipg_per,
-       uart_ipg_per, ata_ahb, reserved1, csi_ahb, emi_ahb, esai_ahb, esdhc1_ahb,
-       esdhc2_ahb, fec_ahb, lcdc_ahb, rtic_ahb, sdma_ahb, slcdc_ahb, usbotg_ahb,
-       reserved2, reserved3, reserved4, reserved5, can1_ipg, can2_ipg, csi_ipg,
-       cspi1_ipg, cspi2_ipg, cspi3_ipg, dryice_ipg, ect_ipg, epit1_ipg, epit2_ipg,
-       reserved6, esdhc1_ipg, esdhc2_ipg, fec_ipg, reserved7, reserved8, reserved9,
-       gpt1_ipg, gpt2_ipg, gpt3_ipg, gpt4_ipg, reserved10, reserved11, reserved12,
-       iim_ipg, reserved13, reserved14, kpp_ipg, lcdc_ipg, reserved15, pwm1_ipg,
-       pwm2_ipg, pwm3_ipg, pwm4_ipg, rngb_ipg, reserved16, scc_ipg, sdma_ipg,
-       sim1_ipg, sim2_ipg, slcdc_ipg, spba_ipg, ssi1_ipg, ssi2_ipg, tsc_ipg,
-       uart1_ipg, uart2_ipg, uart3_ipg, uart4_ipg, uart5_ipg, reserved17,
-       wdt_ipg, cko_div, cko_sel, cko, clk_max
-};
-
-static struct clk *clk[clk_max];
-
-static int __init __mx25_clocks_init(unsigned long osc_rate,
-                                    void __iomem *ccm_base)
-{
-       BUG_ON(!ccm_base);
-
-       clk[dummy] = imx_clk_fixed("dummy", 0);
-       clk[osc] = imx_clk_fixed("osc", osc_rate);
-       clk[mpll] = imx_clk_pllv1("mpll", "osc", ccm(CCM_MPCTL));
-       clk[upll] = imx_clk_pllv1("upll", "osc", ccm(CCM_UPCTL));
-       clk[mpll_cpu_3_4] = imx_clk_fixed_factor("mpll_cpu_3_4", "mpll", 3, 4);
-       clk[cpu_sel] = imx_clk_mux("cpu_sel", ccm(CCM_CCTL), 14, 1, cpu_sel_clks, ARRAY_SIZE(cpu_sel_clks));
-       clk[cpu] = imx_clk_divider("cpu", "cpu_sel", ccm(CCM_CCTL), 30, 2);
-       clk[ahb] = imx_clk_divider("ahb", "cpu", ccm(CCM_CCTL), 28, 2);
-       clk[usb_div] = imx_clk_divider("usb_div", "upll", ccm(CCM_CCTL), 16, 6); 
-       clk[ipg] = imx_clk_fixed_factor("ipg", "ahb", 1, 2);
-       clk[per0_sel] = imx_clk_mux("per0_sel", ccm(CCM_MCR), 0, 1, per_sel_clks, ARRAY_SIZE(per_sel_clks));
-       clk[per1_sel] = imx_clk_mux("per1_sel", ccm(CCM_MCR), 1, 1, per_sel_clks, ARRAY_SIZE(per_sel_clks));
-       clk[per2_sel] = imx_clk_mux("per2_sel", ccm(CCM_MCR), 2, 1, per_sel_clks, ARRAY_SIZE(per_sel_clks));
-       clk[per3_sel] = imx_clk_mux("per3_sel", ccm(CCM_MCR), 3, 1, per_sel_clks, ARRAY_SIZE(per_sel_clks));
-       clk[per4_sel] = imx_clk_mux("per4_sel", ccm(CCM_MCR), 4, 1, per_sel_clks, ARRAY_SIZE(per_sel_clks));
-       clk[per5_sel] = imx_clk_mux("per5_sel", ccm(CCM_MCR), 5, 1, per_sel_clks, ARRAY_SIZE(per_sel_clks));
-       clk[per6_sel] = imx_clk_mux("per6_sel", ccm(CCM_MCR), 6, 1, per_sel_clks, ARRAY_SIZE(per_sel_clks));
-       clk[per7_sel] = imx_clk_mux("per7_sel", ccm(CCM_MCR), 7, 1, per_sel_clks, ARRAY_SIZE(per_sel_clks));
-       clk[per8_sel] = imx_clk_mux("per8_sel", ccm(CCM_MCR), 8, 1, per_sel_clks, ARRAY_SIZE(per_sel_clks));
-       clk[per9_sel] = imx_clk_mux("per9_sel", ccm(CCM_MCR), 9, 1, per_sel_clks, ARRAY_SIZE(per_sel_clks));
-       clk[per10_sel] = imx_clk_mux("per10_sel", ccm(CCM_MCR), 10, 1, per_sel_clks, ARRAY_SIZE(per_sel_clks));
-       clk[per11_sel] = imx_clk_mux("per11_sel", ccm(CCM_MCR), 11, 1, per_sel_clks, ARRAY_SIZE(per_sel_clks));
-       clk[per12_sel] = imx_clk_mux("per12_sel", ccm(CCM_MCR), 12, 1, per_sel_clks, ARRAY_SIZE(per_sel_clks));
-       clk[per13_sel] = imx_clk_mux("per13_sel", ccm(CCM_MCR), 13, 1, per_sel_clks, ARRAY_SIZE(per_sel_clks));
-       clk[per14_sel] = imx_clk_mux("per14_sel", ccm(CCM_MCR), 14, 1, per_sel_clks, ARRAY_SIZE(per_sel_clks));
-       clk[per15_sel] = imx_clk_mux("per15_sel", ccm(CCM_MCR), 15, 1, per_sel_clks, ARRAY_SIZE(per_sel_clks));
-       clk[cko_div] = imx_clk_divider("cko_div", "cko_sel", ccm(CCM_MCR), 24, 6);
-       clk[cko_sel] = imx_clk_mux("cko_sel", ccm(CCM_MCR), 20, 4, cko_sel_clks, ARRAY_SIZE(cko_sel_clks));
-       clk[cko] = imx_clk_gate("cko", "cko_div", ccm(CCM_MCR),  30);
-       clk[per0] = imx_clk_divider("per0", "per0_sel", ccm(CCM_PCDR0), 0, 6);
-       clk[per1] = imx_clk_divider("per1", "per1_sel", ccm(CCM_PCDR0), 8, 6);
-       clk[per2] = imx_clk_divider("per2", "per2_sel", ccm(CCM_PCDR0), 16, 6);
-       clk[per3] = imx_clk_divider("per3", "per3_sel", ccm(CCM_PCDR0), 24, 6);
-       clk[per4] = imx_clk_divider("per4", "per4_sel", ccm(CCM_PCDR1), 0, 6);
-       clk[per5] = imx_clk_divider("per5", "per5_sel", ccm(CCM_PCDR1), 8, 6);
-       clk[per6] = imx_clk_divider("per6", "per6_sel", ccm(CCM_PCDR1), 16, 6);
-       clk[per7] = imx_clk_divider("per7", "per7_sel", ccm(CCM_PCDR1), 24, 6);
-       clk[per8] = imx_clk_divider("per8", "per8_sel", ccm(CCM_PCDR2), 0, 6);
-       clk[per9] = imx_clk_divider("per9", "per9_sel", ccm(CCM_PCDR2), 8, 6);
-       clk[per10] = imx_clk_divider("per10", "per10_sel", ccm(CCM_PCDR2), 16, 6);
-       clk[per11] = imx_clk_divider("per11", "per11_sel", ccm(CCM_PCDR2), 24, 6);
-       clk[per12] = imx_clk_divider("per12", "per12_sel", ccm(CCM_PCDR3), 0, 6);
-       clk[per13] = imx_clk_divider("per13", "per13_sel", ccm(CCM_PCDR3), 8, 6);
-       clk[per14] = imx_clk_divider("per14", "per14_sel", ccm(CCM_PCDR3), 16, 6);
-       clk[per15] = imx_clk_divider("per15", "per15_sel", ccm(CCM_PCDR3), 24, 6);
-       clk[csi_ipg_per] = imx_clk_gate("csi_ipg_per", "per0", ccm(CCM_CGCR0), 0);
-       clk[epit_ipg_per] = imx_clk_gate("epit_ipg_per", "per1", ccm(CCM_CGCR0),  1);
-       clk[esai_ipg_per] = imx_clk_gate("esai_ipg_per", "per2", ccm(CCM_CGCR0),  2);
-       clk[esdhc1_ipg_per] = imx_clk_gate("esdhc1_ipg_per", "per3", ccm(CCM_CGCR0),  3);
-       clk[esdhc2_ipg_per] = imx_clk_gate("esdhc2_ipg_per", "per4", ccm(CCM_CGCR0),  4);
-       clk[gpt_ipg_per] = imx_clk_gate("gpt_ipg_per", "per5", ccm(CCM_CGCR0),  5);
-       clk[i2c_ipg_per] = imx_clk_gate("i2c_ipg_per", "per6", ccm(CCM_CGCR0),  6);
-       clk[lcdc_ipg_per] = imx_clk_gate("lcdc_ipg_per", "per7", ccm(CCM_CGCR0),  7);
-       clk[nfc_ipg_per] = imx_clk_gate("nfc_ipg_per", "per8", ccm(CCM_CGCR0),  8);
-       clk[owire_ipg_per] = imx_clk_gate("owire_ipg_per", "per9", ccm(CCM_CGCR0),  9);
-       clk[pwm_ipg_per] = imx_clk_gate("pwm_ipg_per", "per10", ccm(CCM_CGCR0),  10);
-       clk[sim1_ipg_per] = imx_clk_gate("sim1_ipg_per", "per11", ccm(CCM_CGCR0),  11);
-       clk[sim2_ipg_per] = imx_clk_gate("sim2_ipg_per", "per12", ccm(CCM_CGCR0),  12);
-       clk[ssi1_ipg_per] = imx_clk_gate("ssi1_ipg_per", "per13", ccm(CCM_CGCR0), 13);
-       clk[ssi2_ipg_per] = imx_clk_gate("ssi2_ipg_per", "per14", ccm(CCM_CGCR0), 14);
-       clk[uart_ipg_per] = imx_clk_gate("uart_ipg_per", "per15", ccm(CCM_CGCR0), 15);
-       clk[ata_ahb] = imx_clk_gate("ata_ahb", "ahb", ccm(CCM_CGCR0), 16);
-       /* CCM_CGCR0(17): reserved */
-       clk[csi_ahb] = imx_clk_gate("csi_ahb", "ahb", ccm(CCM_CGCR0), 18);
-       clk[emi_ahb] = imx_clk_gate("emi_ahb", "ahb", ccm(CCM_CGCR0), 19);
-       clk[esai_ahb] = imx_clk_gate("esai_ahb", "ahb", ccm(CCM_CGCR0), 20);
-       clk[esdhc1_ahb] = imx_clk_gate("esdhc1_ahb", "ahb", ccm(CCM_CGCR0), 21);
-       clk[esdhc2_ahb] = imx_clk_gate("esdhc2_ahb", "ahb", ccm(CCM_CGCR0), 22);
-       clk[fec_ahb] = imx_clk_gate("fec_ahb", "ahb", ccm(CCM_CGCR0), 23);
-       clk[lcdc_ahb] = imx_clk_gate("lcdc_ahb", "ahb", ccm(CCM_CGCR0), 24);
-       clk[rtic_ahb] = imx_clk_gate("rtic_ahb", "ahb", ccm(CCM_CGCR0), 25);
-       clk[sdma_ahb] = imx_clk_gate("sdma_ahb", "ahb", ccm(CCM_CGCR0), 26);
-       clk[slcdc_ahb] = imx_clk_gate("slcdc_ahb", "ahb", ccm(CCM_CGCR0), 27);
-       clk[usbotg_ahb] = imx_clk_gate("usbotg_ahb", "ahb", ccm(CCM_CGCR0), 28);
-       /* CCM_CGCR0(29-31): reserved */
-       /* CCM_CGCR1(0): reserved in datasheet, used as audmux in FSL kernel */
-       clk[can1_ipg] = imx_clk_gate("can1_ipg", "ipg", ccm(CCM_CGCR1),  2);
-       clk[can2_ipg] = imx_clk_gate("can2_ipg", "ipg", ccm(CCM_CGCR1),  3);
-       clk[csi_ipg] = imx_clk_gate("csi_ipg", "ipg", ccm(CCM_CGCR1),  4);
-       clk[cspi1_ipg] = imx_clk_gate("cspi1_ipg", "ipg", ccm(CCM_CGCR1),  5);
-       clk[cspi2_ipg] = imx_clk_gate("cspi2_ipg", "ipg", ccm(CCM_CGCR1),  6);
-       clk[cspi3_ipg] = imx_clk_gate("cspi3_ipg", "ipg", ccm(CCM_CGCR1),  7);
-       clk[dryice_ipg] = imx_clk_gate("dryice_ipg", "ipg", ccm(CCM_CGCR1),  8);
-       clk[ect_ipg] = imx_clk_gate("ect_ipg", "ipg", ccm(CCM_CGCR1),  9);
-       clk[epit1_ipg] = imx_clk_gate("epit1_ipg", "ipg", ccm(CCM_CGCR1),  10);
-       clk[epit2_ipg] = imx_clk_gate("epit2_ipg", "ipg", ccm(CCM_CGCR1),  11);
-       /* CCM_CGCR1(12): reserved in datasheet, used as esai in FSL kernel */
-       clk[esdhc1_ipg] = imx_clk_gate("esdhc1_ipg", "ipg", ccm(CCM_CGCR1), 13);
-       clk[esdhc2_ipg] = imx_clk_gate("esdhc2_ipg", "ipg", ccm(CCM_CGCR1), 14);
-       clk[fec_ipg] = imx_clk_gate("fec_ipg", "ipg", ccm(CCM_CGCR1), 15);
-       /* CCM_CGCR1(16): reserved in datasheet, used as gpio1 in FSL kernel */
-       /* CCM_CGCR1(17): reserved in datasheet, used as gpio2 in FSL kernel */
-       /* CCM_CGCR1(18): reserved in datasheet, used as gpio3 in FSL kernel */
-       clk[gpt1_ipg] = imx_clk_gate("gpt1_ipg", "ipg", ccm(CCM_CGCR1), 19);
-       clk[gpt2_ipg] = imx_clk_gate("gpt2_ipg", "ipg", ccm(CCM_CGCR1), 20);
-       clk[gpt3_ipg] = imx_clk_gate("gpt3_ipg", "ipg", ccm(CCM_CGCR1), 21);
-       clk[gpt4_ipg] = imx_clk_gate("gpt4_ipg", "ipg", ccm(CCM_CGCR1), 22);
-       /* CCM_CGCR1(23): reserved in datasheet, used as i2c1 in FSL kernel */
-       /* CCM_CGCR1(24): reserved in datasheet, used as i2c2 in FSL kernel */
-       /* CCM_CGCR1(25): reserved in datasheet, used as i2c3 in FSL kernel */
-       clk[iim_ipg] = imx_clk_gate("iim_ipg", "ipg", ccm(CCM_CGCR1), 26);
-       /* CCM_CGCR1(27): reserved in datasheet, used as iomuxc in FSL kernel */
-       /* CCM_CGCR1(28): reserved in datasheet, used as kpp in FSL kernel */
-       clk[kpp_ipg] = imx_clk_gate("kpp_ipg", "ipg", ccm(CCM_CGCR1), 28);
-       clk[lcdc_ipg] = imx_clk_gate("lcdc_ipg", "ipg", ccm(CCM_CGCR1), 29);
-       /* CCM_CGCR1(30): reserved in datasheet, used as owire in FSL kernel */
-       clk[pwm1_ipg] = imx_clk_gate("pwm1_ipg", "ipg", ccm(CCM_CGCR1), 31);
-       clk[pwm2_ipg] = imx_clk_gate("pwm2_ipg", "ipg", ccm(CCM_CGCR2),  0);
-       clk[pwm3_ipg] = imx_clk_gate("pwm3_ipg", "ipg", ccm(CCM_CGCR2),  1);
-       clk[pwm4_ipg] = imx_clk_gate("pwm4_ipg", "ipg", ccm(CCM_CGCR2),  2);
-       clk[rngb_ipg] = imx_clk_gate("rngb_ipg", "ipg", ccm(CCM_CGCR2),  3);
-       /* CCM_CGCR2(4): reserved in datasheet, used as rtic in FSL kernel */
-       clk[scc_ipg] = imx_clk_gate("scc_ipg", "ipg", ccm(CCM_CGCR2),  5);
-       clk[sdma_ipg] = imx_clk_gate("sdma_ipg", "ipg", ccm(CCM_CGCR2),  6);
-       clk[sim1_ipg] = imx_clk_gate("sim1_ipg", "ipg", ccm(CCM_CGCR2),  7);
-       clk[sim2_ipg] = imx_clk_gate("sim2_ipg", "ipg", ccm(CCM_CGCR2),  8);
-       clk[slcdc_ipg] = imx_clk_gate("slcdc_ipg", "ipg", ccm(CCM_CGCR2),  9);
-       clk[spba_ipg] = imx_clk_gate("spba_ipg", "ipg", ccm(CCM_CGCR2),  10);
-       clk[ssi1_ipg] = imx_clk_gate("ssi1_ipg", "ipg", ccm(CCM_CGCR2), 11);
-       clk[ssi2_ipg] = imx_clk_gate("ssi2_ipg", "ipg", ccm(CCM_CGCR2), 12);
-       clk[tsc_ipg] = imx_clk_gate("tsc_ipg", "ipg", ccm(CCM_CGCR2), 13);
-       clk[uart1_ipg] = imx_clk_gate("uart1_ipg", "ipg", ccm(CCM_CGCR2), 14);
-       clk[uart2_ipg] = imx_clk_gate("uart2_ipg", "ipg", ccm(CCM_CGCR2), 15);
-       clk[uart3_ipg] = imx_clk_gate("uart3_ipg", "ipg", ccm(CCM_CGCR2), 16);
-       clk[uart4_ipg] = imx_clk_gate("uart4_ipg", "ipg", ccm(CCM_CGCR2), 17);
-       clk[uart5_ipg] = imx_clk_gate("uart5_ipg", "ipg", ccm(CCM_CGCR2), 18);
-       /* CCM_CGCR2(19): reserved in datasheet, but used as wdt in FSL kernel */
-       clk[wdt_ipg] = imx_clk_gate("wdt_ipg", "ipg", ccm(CCM_CGCR2), 19);
-
-       imx_check_clocks(clk, ARRAY_SIZE(clk));
-
-       clk_prepare_enable(clk[emi_ahb]);
-
-       /* Clock source for gpt must be derived from AHB */
-       clk_set_parent(clk[per5_sel], clk[ahb]);
-
-       /*
-        * Let's initially set up CLKO parent as ipg, since this configuration
-        * is used on some imx25 board designs to clock the audio codec.
-        */
-       clk_set_parent(clk[cko_sel], clk[ipg]);
-
-       return 0;
-}
-
-static void __init mx25_clocks_init_dt(struct device_node *np)
-{
-       struct device_node *refnp;
-       unsigned long osc_rate = 24000000;
-       void __iomem *ccm;
-
-       /* retrieve the freqency of fixed clocks from device tree */
-       for_each_compatible_node(refnp, NULL, "fixed-clock") {
-               u32 rate;
-               if (of_property_read_u32(refnp, "clock-frequency", &rate))
-                       continue;
-
-               if (of_device_is_compatible(refnp, "fsl,imx-osc"))
-                       osc_rate = rate;
-       }
-
-       ccm = of_iomap(np, 0);
-       __mx25_clocks_init(osc_rate, ccm);
-
-       clk_data.clks = clk;
-       clk_data.clk_num = ARRAY_SIZE(clk);
-       of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
-}
-CLK_OF_DECLARE(imx25_ccm, "fsl,imx25-ccm", mx25_clocks_init_dt);
diff --git a/arch/arm/mach-imx/clk-imx27.c b/arch/arm/mach-imx/clk-imx27.c
deleted file mode 100644 (file)
index ab6349e..0000000
+++ /dev/null
@@ -1,258 +0,0 @@
-#include <linux/clk.h>
-#include <linux/clk-provider.h>
-#include <linux/clkdev.h>
-#include <linux/err.h>
-#include <linux/of.h>
-#include <linux/of_address.h>
-#include <dt-bindings/clock/imx27-clock.h>
-
-#include "clk.h"
-#include "common.h"
-#include "hardware.h"
-
-static void __iomem *ccm __initdata;
-
-/* Register offsets */
-#define CCM_CSCR               (ccm + 0x00)
-#define CCM_MPCTL0             (ccm + 0x04)
-#define CCM_MPCTL1             (ccm + 0x08)
-#define CCM_SPCTL0             (ccm + 0x0c)
-#define CCM_SPCTL1             (ccm + 0x10)
-#define CCM_PCDR0              (ccm + 0x18)
-#define CCM_PCDR1              (ccm + 0x1c)
-#define CCM_PCCR0              (ccm + 0x20)
-#define CCM_PCCR1              (ccm + 0x24)
-#define CCM_CCSR               (ccm + 0x28)
-
-static const char *vpu_sel_clks[] = { "spll", "mpll_main2", };
-static const char *cpu_sel_clks[] = { "mpll_main2", "mpll", };
-static const char *mpll_sel_clks[] = { "fpm", "mpll_osc_sel", };
-static const char *mpll_osc_sel_clks[] = { "ckih_gate", "ckih_div1p5", };
-static const char *clko_sel_clks[] = {
-       "ckil", "fpm", "ckih_gate", "ckih_gate",
-       "ckih_gate", "mpll", "spll", "cpu_div",
-       "ahb", "ipg", "per1_div", "per2_div",
-       "per3_div", "per4_div", "ssi1_div", "ssi2_div",
-       "nfc_div", "mshc_div", "vpu_div", "60m",
-       "32k", "usb_div", "dptc",
-};
-
-static const char *ssi_sel_clks[] = { "spll_gate", "mpll", };
-
-static struct clk *clk[IMX27_CLK_MAX];
-static struct clk_onecell_data clk_data;
-
-static void __init _mx27_clocks_init(unsigned long fref)
-{
-       BUG_ON(!ccm);
-
-       clk[IMX27_CLK_DUMMY] = imx_clk_fixed("dummy", 0);
-       clk[IMX27_CLK_CKIH] = imx_clk_fixed("ckih", fref);
-       clk[IMX27_CLK_CKIL] = imx_clk_fixed("ckil", 32768);
-       clk[IMX27_CLK_FPM] = imx_clk_fixed_factor("fpm", "ckil", 1024, 1);
-       clk[IMX27_CLK_CKIH_DIV1P5] = imx_clk_fixed_factor("ckih_div1p5", "ckih_gate", 2, 3);
-       clk[IMX27_CLK_CKIH_GATE] = imx_clk_gate_dis("ckih_gate", "ckih", CCM_CSCR, 3);
-       clk[IMX27_CLK_MPLL_OSC_SEL] = imx_clk_mux("mpll_osc_sel", CCM_CSCR, 4, 1, mpll_osc_sel_clks, ARRAY_SIZE(mpll_osc_sel_clks));
-       clk[IMX27_CLK_MPLL_SEL] = imx_clk_mux("mpll_sel", CCM_CSCR, 16, 1, mpll_sel_clks, ARRAY_SIZE(mpll_sel_clks));
-       clk[IMX27_CLK_MPLL] = imx_clk_pllv1("mpll", "mpll_sel", CCM_MPCTL0);
-       clk[IMX27_CLK_SPLL] = imx_clk_pllv1("spll", "ckih_gate", CCM_SPCTL0);
-       clk[IMX27_CLK_SPLL_GATE] = imx_clk_gate("spll_gate", "spll", CCM_CSCR, 1);
-       clk[IMX27_CLK_MPLL_MAIN2] = imx_clk_fixed_factor("mpll_main2", "mpll", 2, 3);
-
-       if (mx27_revision() >= IMX_CHIP_REVISION_2_0) {
-               clk[IMX27_CLK_AHB] = imx_clk_divider("ahb", "mpll_main2", CCM_CSCR, 8, 2);
-               clk[IMX27_CLK_IPG] = imx_clk_fixed_factor("ipg", "ahb", 1, 2);
-       } else {
-               clk[IMX27_CLK_AHB] = imx_clk_divider("ahb", "mpll_main2", CCM_CSCR, 9, 4);
-               clk[IMX27_CLK_IPG] = imx_clk_divider("ipg", "ahb", CCM_CSCR, 8, 1);
-       }
-
-       clk[IMX27_CLK_MSHC_DIV] = imx_clk_divider("mshc_div", "ahb", CCM_PCDR0, 0, 6);
-       clk[IMX27_CLK_NFC_DIV] = imx_clk_divider("nfc_div", "ahb", CCM_PCDR0, 6, 4);
-       clk[IMX27_CLK_PER1_DIV] = imx_clk_divider("per1_div", "mpll_main2", CCM_PCDR1, 0, 6);
-       clk[IMX27_CLK_PER2_DIV] = imx_clk_divider("per2_div", "mpll_main2", CCM_PCDR1, 8, 6);
-       clk[IMX27_CLK_PER3_DIV] = imx_clk_divider("per3_div", "mpll_main2", CCM_PCDR1, 16, 6);
-       clk[IMX27_CLK_PER4_DIV] = imx_clk_divider("per4_div", "mpll_main2", CCM_PCDR1, 24, 6);
-       clk[IMX27_CLK_VPU_SEL] = imx_clk_mux("vpu_sel", CCM_CSCR, 21, 1, vpu_sel_clks, ARRAY_SIZE(vpu_sel_clks));
-       clk[IMX27_CLK_VPU_DIV] = imx_clk_divider("vpu_div", "vpu_sel", CCM_PCDR0, 10, 6);
-       clk[IMX27_CLK_USB_DIV] = imx_clk_divider("usb_div", "spll_gate", CCM_CSCR, 28, 3);
-       clk[IMX27_CLK_CPU_SEL] = imx_clk_mux("cpu_sel", CCM_CSCR, 15, 1, cpu_sel_clks, ARRAY_SIZE(cpu_sel_clks));
-       clk[IMX27_CLK_CLKO_SEL] = imx_clk_mux("clko_sel", CCM_CCSR, 0, 5, clko_sel_clks, ARRAY_SIZE(clko_sel_clks));
-
-       if (mx27_revision() >= IMX_CHIP_REVISION_2_0)
-               clk[IMX27_CLK_CPU_DIV] = imx_clk_divider("cpu_div", "cpu_sel", CCM_CSCR, 12, 2);
-       else
-               clk[IMX27_CLK_CPU_DIV] = imx_clk_divider("cpu_div", "cpu_sel", CCM_CSCR, 13, 3);
-
-       clk[IMX27_CLK_CLKO_DIV] = imx_clk_divider("clko_div", "clko_sel", CCM_PCDR0, 22, 3);
-       clk[IMX27_CLK_SSI1_SEL] = imx_clk_mux("ssi1_sel", CCM_CSCR, 22, 1, ssi_sel_clks, ARRAY_SIZE(ssi_sel_clks));
-       clk[IMX27_CLK_SSI2_SEL] = imx_clk_mux("ssi2_sel", CCM_CSCR, 23, 1, ssi_sel_clks, ARRAY_SIZE(ssi_sel_clks));
-       clk[IMX27_CLK_SSI1_DIV] = imx_clk_divider("ssi1_div", "ssi1_sel", CCM_PCDR0, 16, 6);
-       clk[IMX27_CLK_SSI2_DIV] = imx_clk_divider("ssi2_div", "ssi2_sel", CCM_PCDR0, 26, 6);
-       clk[IMX27_CLK_CLKO_EN] = imx_clk_gate("clko_en", "clko_div", CCM_PCCR0, 0);
-       clk[IMX27_CLK_SSI2_IPG_GATE] = imx_clk_gate("ssi2_ipg_gate", "ipg", CCM_PCCR0, 0);
-       clk[IMX27_CLK_SSI1_IPG_GATE] = imx_clk_gate("ssi1_ipg_gate", "ipg", CCM_PCCR0, 1);
-       clk[IMX27_CLK_SLCDC_IPG_GATE] = imx_clk_gate("slcdc_ipg_gate", "ipg", CCM_PCCR0, 2);
-       clk[IMX27_CLK_SDHC3_IPG_GATE] = imx_clk_gate("sdhc3_ipg_gate", "ipg", CCM_PCCR0, 3);
-       clk[IMX27_CLK_SDHC2_IPG_GATE] = imx_clk_gate("sdhc2_ipg_gate", "ipg", CCM_PCCR0, 4);
-       clk[IMX27_CLK_SDHC1_IPG_GATE] = imx_clk_gate("sdhc1_ipg_gate", "ipg", CCM_PCCR0, 5);
-       clk[IMX27_CLK_SCC_IPG_GATE] = imx_clk_gate("scc_ipg_gate", "ipg", CCM_PCCR0, 6);
-       clk[IMX27_CLK_SAHARA_IPG_GATE] = imx_clk_gate("sahara_ipg_gate", "ipg", CCM_PCCR0, 7);
-       clk[IMX27_CLK_RTIC_IPG_GATE] = imx_clk_gate("rtic_ipg_gate", "ipg", CCM_PCCR0, 8);
-       clk[IMX27_CLK_RTC_IPG_GATE] = imx_clk_gate("rtc_ipg_gate", "ipg", CCM_PCCR0, 9);
-       clk[IMX27_CLK_PWM_IPG_GATE] = imx_clk_gate("pwm_ipg_gate", "ipg", CCM_PCCR0, 11);
-       clk[IMX27_CLK_OWIRE_IPG_GATE] = imx_clk_gate("owire_ipg_gate", "ipg", CCM_PCCR0, 12);
-       clk[IMX27_CLK_MSHC_IPG_GATE] = imx_clk_gate("mshc_ipg_gate", "ipg", CCM_PCCR0, 13);
-       clk[IMX27_CLK_LCDC_IPG_GATE] = imx_clk_gate("lcdc_ipg_gate", "ipg", CCM_PCCR0, 14);
-       clk[IMX27_CLK_KPP_IPG_GATE] = imx_clk_gate("kpp_ipg_gate", "ipg", CCM_PCCR0, 15);
-       clk[IMX27_CLK_IIM_IPG_GATE] = imx_clk_gate("iim_ipg_gate", "ipg", CCM_PCCR0, 16);
-       clk[IMX27_CLK_I2C2_IPG_GATE] = imx_clk_gate("i2c2_ipg_gate", "ipg", CCM_PCCR0, 17);
-       clk[IMX27_CLK_I2C1_IPG_GATE] = imx_clk_gate("i2c1_ipg_gate", "ipg", CCM_PCCR0, 18);
-       clk[IMX27_CLK_GPT6_IPG_GATE] = imx_clk_gate("gpt6_ipg_gate", "ipg", CCM_PCCR0, 19);
-       clk[IMX27_CLK_GPT5_IPG_GATE] = imx_clk_gate("gpt5_ipg_gate", "ipg", CCM_PCCR0, 20);
-       clk[IMX27_CLK_GPT4_IPG_GATE] = imx_clk_gate("gpt4_ipg_gate", "ipg", CCM_PCCR0, 21);
-       clk[IMX27_CLK_GPT3_IPG_GATE] = imx_clk_gate("gpt3_ipg_gate", "ipg", CCM_PCCR0, 22);
-       clk[IMX27_CLK_GPT2_IPG_GATE] = imx_clk_gate("gpt2_ipg_gate", "ipg", CCM_PCCR0, 23);
-       clk[IMX27_CLK_GPT1_IPG_GATE] = imx_clk_gate("gpt1_ipg_gate", "ipg", CCM_PCCR0, 24);
-       clk[IMX27_CLK_GPIO_IPG_GATE] = imx_clk_gate("gpio_ipg_gate", "ipg", CCM_PCCR0, 25);
-       clk[IMX27_CLK_FEC_IPG_GATE] = imx_clk_gate("fec_ipg_gate", "ipg", CCM_PCCR0, 26);
-       clk[IMX27_CLK_EMMA_IPG_GATE] = imx_clk_gate("emma_ipg_gate", "ipg", CCM_PCCR0, 27);
-       clk[IMX27_CLK_DMA_IPG_GATE] = imx_clk_gate("dma_ipg_gate", "ipg", CCM_PCCR0, 28);
-       clk[IMX27_CLK_CSPI3_IPG_GATE] = imx_clk_gate("cspi3_ipg_gate", "ipg", CCM_PCCR0, 29);
-       clk[IMX27_CLK_CSPI2_IPG_GATE] = imx_clk_gate("cspi2_ipg_gate", "ipg", CCM_PCCR0, 30);
-       clk[IMX27_CLK_CSPI1_IPG_GATE] = imx_clk_gate("cspi1_ipg_gate", "ipg", CCM_PCCR0, 31);
-       clk[IMX27_CLK_MSHC_BAUD_GATE] = imx_clk_gate("mshc_baud_gate", "mshc_div", CCM_PCCR1, 2);
-       clk[IMX27_CLK_NFC_BAUD_GATE] = imx_clk_gate("nfc_baud_gate", "nfc_div", CCM_PCCR1,  3);
-       clk[IMX27_CLK_SSI2_BAUD_GATE] = imx_clk_gate("ssi2_baud_gate", "ssi2_div", CCM_PCCR1,  4);
-       clk[IMX27_CLK_SSI1_BAUD_GATE] = imx_clk_gate("ssi1_baud_gate", "ssi1_div", CCM_PCCR1,  5);
-       clk[IMX27_CLK_VPU_BAUD_GATE] = imx_clk_gate("vpu_baud_gate", "vpu_div", CCM_PCCR1,  6);
-       clk[IMX27_CLK_PER4_GATE] = imx_clk_gate("per4_gate", "per4_div", CCM_PCCR1,  7);
-       clk[IMX27_CLK_PER3_GATE] = imx_clk_gate("per3_gate", "per3_div", CCM_PCCR1,  8);
-       clk[IMX27_CLK_PER2_GATE] = imx_clk_gate("per2_gate", "per2_div", CCM_PCCR1,  9);
-       clk[IMX27_CLK_PER1_GATE] = imx_clk_gate("per1_gate", "per1_div", CCM_PCCR1, 10);
-       clk[IMX27_CLK_USB_AHB_GATE] = imx_clk_gate("usb_ahb_gate", "ahb", CCM_PCCR1, 11);
-       clk[IMX27_CLK_SLCDC_AHB_GATE] = imx_clk_gate("slcdc_ahb_gate", "ahb", CCM_PCCR1, 12);
-       clk[IMX27_CLK_SAHARA_AHB_GATE] = imx_clk_gate("sahara_ahb_gate", "ahb", CCM_PCCR1, 13);
-       clk[IMX27_CLK_RTIC_AHB_GATE] = imx_clk_gate("rtic_ahb_gate", "ahb", CCM_PCCR1, 14);
-       clk[IMX27_CLK_LCDC_AHB_GATE] = imx_clk_gate("lcdc_ahb_gate", "ahb", CCM_PCCR1, 15);
-       clk[IMX27_CLK_VPU_AHB_GATE] = imx_clk_gate("vpu_ahb_gate", "ahb", CCM_PCCR1, 16);
-       clk[IMX27_CLK_FEC_AHB_GATE] = imx_clk_gate("fec_ahb_gate", "ahb", CCM_PCCR1, 17);
-       clk[IMX27_CLK_EMMA_AHB_GATE] = imx_clk_gate("emma_ahb_gate", "ahb", CCM_PCCR1, 18);
-       clk[IMX27_CLK_EMI_AHB_GATE] = imx_clk_gate("emi_ahb_gate", "ahb", CCM_PCCR1, 19);
-       clk[IMX27_CLK_DMA_AHB_GATE] = imx_clk_gate("dma_ahb_gate", "ahb", CCM_PCCR1, 20);
-       clk[IMX27_CLK_CSI_AHB_GATE] = imx_clk_gate("csi_ahb_gate", "ahb", CCM_PCCR1, 21);
-       clk[IMX27_CLK_BROM_AHB_GATE] = imx_clk_gate("brom_ahb_gate", "ahb", CCM_PCCR1, 22);
-       clk[IMX27_CLK_ATA_AHB_GATE] = imx_clk_gate("ata_ahb_gate", "ahb", CCM_PCCR1, 23);
-       clk[IMX27_CLK_WDOG_IPG_GATE] = imx_clk_gate("wdog_ipg_gate", "ipg", CCM_PCCR1, 24);
-       clk[IMX27_CLK_USB_IPG_GATE] = imx_clk_gate("usb_ipg_gate", "ipg", CCM_PCCR1, 25);
-       clk[IMX27_CLK_UART6_IPG_GATE] = imx_clk_gate("uart6_ipg_gate", "ipg", CCM_PCCR1, 26);
-       clk[IMX27_CLK_UART5_IPG_GATE] = imx_clk_gate("uart5_ipg_gate", "ipg", CCM_PCCR1, 27);
-       clk[IMX27_CLK_UART4_IPG_GATE] = imx_clk_gate("uart4_ipg_gate", "ipg", CCM_PCCR1, 28);
-       clk[IMX27_CLK_UART3_IPG_GATE] = imx_clk_gate("uart3_ipg_gate", "ipg", CCM_PCCR1, 29);
-       clk[IMX27_CLK_UART2_IPG_GATE] = imx_clk_gate("uart2_ipg_gate", "ipg", CCM_PCCR1, 30);
-       clk[IMX27_CLK_UART1_IPG_GATE] = imx_clk_gate("uart1_ipg_gate", "ipg", CCM_PCCR1, 31);
-
-       imx_check_clocks(clk, ARRAY_SIZE(clk));
-
-       clk_register_clkdev(clk[IMX27_CLK_CPU_DIV], NULL, "cpu0");
-
-       clk_prepare_enable(clk[IMX27_CLK_EMI_AHB_GATE]);
-
-       imx_print_silicon_rev("i.MX27", mx27_revision());
-}
-
-int __init mx27_clocks_init(unsigned long fref)
-{
-       ccm = ioremap(MX27_CCM_BASE_ADDR, SZ_4K);
-
-       _mx27_clocks_init(fref);
-
-       clk_register_clkdev(clk[IMX27_CLK_UART1_IPG_GATE], "ipg", "imx21-uart.0");
-       clk_register_clkdev(clk[IMX27_CLK_PER1_GATE], "per", "imx21-uart.0");
-       clk_register_clkdev(clk[IMX27_CLK_UART2_IPG_GATE], "ipg", "imx21-uart.1");
-       clk_register_clkdev(clk[IMX27_CLK_PER1_GATE], "per", "imx21-uart.1");
-       clk_register_clkdev(clk[IMX27_CLK_UART3_IPG_GATE], "ipg", "imx21-uart.2");
-       clk_register_clkdev(clk[IMX27_CLK_PER1_GATE], "per", "imx21-uart.2");
-       clk_register_clkdev(clk[IMX27_CLK_UART4_IPG_GATE], "ipg", "imx21-uart.3");
-       clk_register_clkdev(clk[IMX27_CLK_PER1_GATE], "per", "imx21-uart.3");
-       clk_register_clkdev(clk[IMX27_CLK_UART5_IPG_GATE], "ipg", "imx21-uart.4");
-       clk_register_clkdev(clk[IMX27_CLK_PER1_GATE], "per", "imx21-uart.4");
-       clk_register_clkdev(clk[IMX27_CLK_UART6_IPG_GATE], "ipg", "imx21-uart.5");
-       clk_register_clkdev(clk[IMX27_CLK_PER1_GATE], "per", "imx21-uart.5");
-       clk_register_clkdev(clk[IMX27_CLK_GPT1_IPG_GATE], "ipg", "imx-gpt.0");
-       clk_register_clkdev(clk[IMX27_CLK_PER1_GATE], "per", "imx-gpt.0");
-       clk_register_clkdev(clk[IMX27_CLK_PER2_GATE], "per", "imx21-mmc.0");
-       clk_register_clkdev(clk[IMX27_CLK_SDHC1_IPG_GATE], "ipg", "imx21-mmc.0");
-       clk_register_clkdev(clk[IMX27_CLK_PER2_GATE], "per", "imx21-mmc.1");
-       clk_register_clkdev(clk[IMX27_CLK_SDHC2_IPG_GATE], "ipg", "imx21-mmc.1");
-       clk_register_clkdev(clk[IMX27_CLK_PER2_GATE], "per", "imx21-mmc.2");
-       clk_register_clkdev(clk[IMX27_CLK_SDHC2_IPG_GATE], "ipg", "imx21-mmc.2");
-       clk_register_clkdev(clk[IMX27_CLK_PER2_GATE], "per", "imx27-cspi.0");
-       clk_register_clkdev(clk[IMX27_CLK_CSPI1_IPG_GATE], "ipg", "imx27-cspi.0");
-       clk_register_clkdev(clk[IMX27_CLK_PER2_GATE], "per", "imx27-cspi.1");
-       clk_register_clkdev(clk[IMX27_CLK_CSPI2_IPG_GATE], "ipg", "imx27-cspi.1");
-       clk_register_clkdev(clk[IMX27_CLK_PER2_GATE], "per", "imx27-cspi.2");
-       clk_register_clkdev(clk[IMX27_CLK_CSPI3_IPG_GATE], "ipg", "imx27-cspi.2");
-       clk_register_clkdev(clk[IMX27_CLK_PER3_GATE], "per", "imx21-fb.0");
-       clk_register_clkdev(clk[IMX27_CLK_LCDC_IPG_GATE], "ipg", "imx21-fb.0");
-       clk_register_clkdev(clk[IMX27_CLK_LCDC_AHB_GATE], "ahb", "imx21-fb.0");
-       clk_register_clkdev(clk[IMX27_CLK_CSI_AHB_GATE], "ahb", "imx27-camera.0");
-       clk_register_clkdev(clk[IMX27_CLK_PER4_GATE], "per", "imx27-camera.0");
-       clk_register_clkdev(clk[IMX27_CLK_USB_DIV], "per", "imx-udc-mx27");
-       clk_register_clkdev(clk[IMX27_CLK_USB_IPG_GATE], "ipg", "imx-udc-mx27");
-       clk_register_clkdev(clk[IMX27_CLK_USB_AHB_GATE], "ahb", "imx-udc-mx27");
-       clk_register_clkdev(clk[IMX27_CLK_USB_DIV], "per", "mxc-ehci.0");
-       clk_register_clkdev(clk[IMX27_CLK_USB_IPG_GATE], "ipg", "mxc-ehci.0");
-       clk_register_clkdev(clk[IMX27_CLK_USB_AHB_GATE], "ahb", "mxc-ehci.0");
-       clk_register_clkdev(clk[IMX27_CLK_USB_DIV], "per", "mxc-ehci.1");
-       clk_register_clkdev(clk[IMX27_CLK_USB_IPG_GATE], "ipg", "mxc-ehci.1");
-       clk_register_clkdev(clk[IMX27_CLK_USB_AHB_GATE], "ahb", "mxc-ehci.1");
-       clk_register_clkdev(clk[IMX27_CLK_USB_DIV], "per", "mxc-ehci.2");
-       clk_register_clkdev(clk[IMX27_CLK_USB_IPG_GATE], "ipg", "mxc-ehci.2");
-       clk_register_clkdev(clk[IMX27_CLK_USB_AHB_GATE], "ahb", "mxc-ehci.2");
-       clk_register_clkdev(clk[IMX27_CLK_SSI1_IPG_GATE], NULL, "imx-ssi.0");
-       clk_register_clkdev(clk[IMX27_CLK_SSI2_IPG_GATE], NULL, "imx-ssi.1");
-       clk_register_clkdev(clk[IMX27_CLK_NFC_BAUD_GATE], NULL, "imx27-nand.0");
-       clk_register_clkdev(clk[IMX27_CLK_VPU_BAUD_GATE], "per", "coda-imx27.0");
-       clk_register_clkdev(clk[IMX27_CLK_VPU_AHB_GATE], "ahb", "coda-imx27.0");
-       clk_register_clkdev(clk[IMX27_CLK_DMA_AHB_GATE], "ahb", "imx27-dma");
-       clk_register_clkdev(clk[IMX27_CLK_DMA_IPG_GATE], "ipg", "imx27-dma");
-       clk_register_clkdev(clk[IMX27_CLK_FEC_IPG_GATE], "ipg", "imx27-fec.0");
-       clk_register_clkdev(clk[IMX27_CLK_FEC_AHB_GATE], "ahb", "imx27-fec.0");
-       clk_register_clkdev(clk[IMX27_CLK_WDOG_IPG_GATE], NULL, "imx2-wdt.0");
-       clk_register_clkdev(clk[IMX27_CLK_I2C1_IPG_GATE], NULL, "imx21-i2c.0");
-       clk_register_clkdev(clk[IMX27_CLK_I2C2_IPG_GATE], NULL, "imx21-i2c.1");
-       clk_register_clkdev(clk[IMX27_CLK_OWIRE_IPG_GATE], NULL, "mxc_w1.0");
-       clk_register_clkdev(clk[IMX27_CLK_KPP_IPG_GATE], NULL, "imx-keypad");
-       clk_register_clkdev(clk[IMX27_CLK_EMMA_AHB_GATE], "emma-ahb", "imx27-camera.0");
-       clk_register_clkdev(clk[IMX27_CLK_EMMA_IPG_GATE], "emma-ipg", "imx27-camera.0");
-       clk_register_clkdev(clk[IMX27_CLK_EMMA_AHB_GATE], "ahb", "m2m-emmaprp.0");
-       clk_register_clkdev(clk[IMX27_CLK_EMMA_IPG_GATE], "ipg", "m2m-emmaprp.0");
-
-       mxc_timer_init(MX27_IO_ADDRESS(MX27_GPT1_BASE_ADDR), MX27_INT_GPT1);
-
-       return 0;
-}
-
-static void __init mx27_clocks_init_dt(struct device_node *np)
-{
-       struct device_node *refnp;
-       u32 fref = 26000000; /* default */
-
-       for_each_compatible_node(refnp, NULL, "fixed-clock") {
-               if (!of_device_is_compatible(refnp, "fsl,imx-osc26m"))
-                       continue;
-
-               if (!of_property_read_u32(refnp, "clock-frequency", &fref))
-                       break;
-       }
-
-       ccm = of_iomap(np, 0);
-
-       _mx27_clocks_init(fref);
-
-       clk_data.clks = clk;
-       clk_data.clk_num = ARRAY_SIZE(clk);
-       of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
-}
-CLK_OF_DECLARE(imx27_ccm, "fsl,imx27-ccm", mx27_clocks_init_dt);
diff --git a/arch/arm/mach-imx/clk-imx31.c b/arch/arm/mach-imx/clk-imx31.c
deleted file mode 100644 (file)
index 286ef42..0000000
+++ /dev/null
@@ -1,204 +0,0 @@
-/*
- * Copyright (C) 2012 Sascha Hauer <kernel@pengutronix.de>
- *
- * 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.
- */
-
-#include <linux/module.h>
-#include <linux/clk.h>
-#include <linux/clkdev.h>
-#include <linux/io.h>
-#include <linux/err.h>
-#include <linux/of.h>
-
-#include "clk.h"
-#include "common.h"
-#include "crmregs-imx3.h"
-#include "hardware.h"
-#include "mx31.h"
-
-static const char *mcu_main_sel[] = { "spll", "mpll", };
-static const char *per_sel[] = { "per_div", "ipg", };
-static const char *csi_sel[] = { "upll", "spll", };
-static const char *fir_sel[] = { "mcu_main", "upll", "spll" };
-
-enum mx31_clks {
-       dummy, ckih, ckil, mpll, spll, upll, mcu_main, hsp, ahb, nfc, ipg,
-       per_div, per, csi, fir, csi_div, usb_div_pre, usb_div_post, fir_div_pre,
-       fir_div_post, sdhc1_gate, sdhc2_gate, gpt_gate, epit1_gate, epit2_gate,
-       iim_gate, ata_gate, sdma_gate, cspi3_gate, rng_gate, uart1_gate,
-       uart2_gate, ssi1_gate, i2c1_gate, i2c2_gate, i2c3_gate, hantro_gate,
-       mstick1_gate, mstick2_gate, csi_gate, rtc_gate, wdog_gate, pwm_gate,
-       sim_gate, ect_gate, usb_gate, kpp_gate, ipu_gate, uart3_gate,
-       uart4_gate, uart5_gate, owire_gate, ssi2_gate, cspi1_gate, cspi2_gate,
-       gacc_gate, emi_gate, rtic_gate, firi_gate, clk_max
-};
-
-static struct clk *clk[clk_max];
-static struct clk_onecell_data clk_data;
-
-int __init mx31_clocks_init(unsigned long fref)
-{
-       void __iomem *base = MX31_IO_ADDRESS(MX31_CCM_BASE_ADDR);
-       struct device_node *np;
-
-       clk[dummy] = imx_clk_fixed("dummy", 0);
-       clk[ckih] = imx_clk_fixed("ckih", fref);
-       clk[ckil] = imx_clk_fixed("ckil", 32768);
-       clk[mpll] = imx_clk_pllv1("mpll", "ckih", base + MXC_CCM_MPCTL);
-       clk[spll] = imx_clk_pllv1("spll", "ckih", base + MXC_CCM_SRPCTL);
-       clk[upll] = imx_clk_pllv1("upll", "ckih", base + MXC_CCM_UPCTL);
-       clk[mcu_main] = imx_clk_mux("mcu_main", base + MXC_CCM_PMCR0, 31, 1, mcu_main_sel, ARRAY_SIZE(mcu_main_sel));
-       clk[hsp] = imx_clk_divider("hsp", "mcu_main", base + MXC_CCM_PDR0, 11, 3);
-       clk[ahb] = imx_clk_divider("ahb", "mcu_main", base + MXC_CCM_PDR0, 3, 3);
-       clk[nfc] = imx_clk_divider("nfc", "ahb", base + MXC_CCM_PDR0, 8, 3);
-       clk[ipg] = imx_clk_divider("ipg", "ahb", base + MXC_CCM_PDR0, 6, 2);
-       clk[per_div] = imx_clk_divider("per_div", "upll", base + MXC_CCM_PDR0, 16, 5);
-       clk[per] = imx_clk_mux("per", base + MXC_CCM_CCMR, 24, 1, per_sel, ARRAY_SIZE(per_sel));
-       clk[csi] = imx_clk_mux("csi_sel", base + MXC_CCM_CCMR, 25, 1, csi_sel, ARRAY_SIZE(csi_sel));
-       clk[fir] = imx_clk_mux("fir_sel", base + MXC_CCM_CCMR, 11, 2, fir_sel, ARRAY_SIZE(fir_sel));
-       clk[csi_div] = imx_clk_divider("csi_div", "csi_sel", base + MXC_CCM_PDR0, 23, 9);
-       clk[usb_div_pre] = imx_clk_divider("usb_div_pre", "upll", base + MXC_CCM_PDR1, 30, 2);
-       clk[usb_div_post] = imx_clk_divider("usb_div_post", "usb_div_pre", base + MXC_CCM_PDR1, 27, 3);
-       clk[fir_div_pre] = imx_clk_divider("fir_div_pre", "fir_sel", base + MXC_CCM_PDR1, 24, 3);
-       clk[fir_div_post] = imx_clk_divider("fir_div_post", "fir_div_pre", base + MXC_CCM_PDR1, 23, 6);
-       clk[sdhc1_gate] = imx_clk_gate2("sdhc1_gate", "per", base + MXC_CCM_CGR0, 0);
-       clk[sdhc2_gate] = imx_clk_gate2("sdhc2_gate", "per", base + MXC_CCM_CGR0, 2);
-       clk[gpt_gate] = imx_clk_gate2("gpt_gate", "per", base + MXC_CCM_CGR0, 4);
-       clk[epit1_gate] = imx_clk_gate2("epit1_gate", "per", base + MXC_CCM_CGR0, 6);
-       clk[epit2_gate] = imx_clk_gate2("epit2_gate", "per", base + MXC_CCM_CGR0, 8);
-       clk[iim_gate] = imx_clk_gate2("iim_gate", "ipg", base + MXC_CCM_CGR0, 10);
-       clk[ata_gate] = imx_clk_gate2("ata_gate", "ipg", base + MXC_CCM_CGR0, 12);
-       clk[sdma_gate] = imx_clk_gate2("sdma_gate", "ahb", base + MXC_CCM_CGR0, 14);
-       clk[cspi3_gate] = imx_clk_gate2("cspi3_gate", "ipg", base + MXC_CCM_CGR0, 16);
-       clk[rng_gate] = imx_clk_gate2("rng_gate", "ipg", base + MXC_CCM_CGR0, 18);
-       clk[uart1_gate] = imx_clk_gate2("uart1_gate", "per", base + MXC_CCM_CGR0, 20);
-       clk[uart2_gate] = imx_clk_gate2("uart2_gate", "per", base + MXC_CCM_CGR0, 22);
-       clk[ssi1_gate] = imx_clk_gate2("ssi1_gate", "spll", base + MXC_CCM_CGR0, 24);
-       clk[i2c1_gate] = imx_clk_gate2("i2c1_gate", "per", base + MXC_CCM_CGR0, 26);
-       clk[i2c2_gate] = imx_clk_gate2("i2c2_gate", "per", base + MXC_CCM_CGR0, 28);
-       clk[i2c3_gate] = imx_clk_gate2("i2c3_gate", "per", base + MXC_CCM_CGR0, 30);
-       clk[hantro_gate] = imx_clk_gate2("hantro_gate", "per", base + MXC_CCM_CGR1, 0);
-       clk[mstick1_gate] = imx_clk_gate2("mstick1_gate", "per", base + MXC_CCM_CGR1, 2);
-       clk[mstick2_gate] = imx_clk_gate2("mstick2_gate", "per", base + MXC_CCM_CGR1, 4);
-       clk[csi_gate] = imx_clk_gate2("csi_gate", "csi_div", base + MXC_CCM_CGR1, 6);
-       clk[rtc_gate] = imx_clk_gate2("rtc_gate", "ipg", base + MXC_CCM_CGR1, 8);
-       clk[wdog_gate] = imx_clk_gate2("wdog_gate", "ipg", base + MXC_CCM_CGR1, 10);
-       clk[pwm_gate] = imx_clk_gate2("pwm_gate", "per", base + MXC_CCM_CGR1, 12);
-       clk[sim_gate] = imx_clk_gate2("sim_gate", "per", base + MXC_CCM_CGR1, 14);
-       clk[ect_gate] = imx_clk_gate2("ect_gate", "per", base + MXC_CCM_CGR1, 16);
-       clk[usb_gate] = imx_clk_gate2("usb_gate", "ahb", base + MXC_CCM_CGR1, 18);
-       clk[kpp_gate] = imx_clk_gate2("kpp_gate", "ipg", base + MXC_CCM_CGR1, 20);
-       clk[ipu_gate] = imx_clk_gate2("ipu_gate", "hsp", base + MXC_CCM_CGR1, 22);
-       clk[uart3_gate] = imx_clk_gate2("uart3_gate", "per", base + MXC_CCM_CGR1, 24);
-       clk[uart4_gate] = imx_clk_gate2("uart4_gate", "per", base + MXC_CCM_CGR1, 26);
-       clk[uart5_gate] = imx_clk_gate2("uart5_gate", "per", base + MXC_CCM_CGR1, 28);
-       clk[owire_gate] = imx_clk_gate2("owire_gate", "per", base + MXC_CCM_CGR1, 30);
-       clk[ssi2_gate] = imx_clk_gate2("ssi2_gate", "spll", base + MXC_CCM_CGR2, 0);
-       clk[cspi1_gate] = imx_clk_gate2("cspi1_gate", "ipg", base + MXC_CCM_CGR2, 2);
-       clk[cspi2_gate] = imx_clk_gate2("cspi2_gate", "ipg", base + MXC_CCM_CGR2, 4);
-       clk[gacc_gate] = imx_clk_gate2("gacc_gate", "per", base + MXC_CCM_CGR2, 6);
-       clk[emi_gate] = imx_clk_gate2("emi_gate", "ahb", base + MXC_CCM_CGR2, 8);
-       clk[rtic_gate] = imx_clk_gate2("rtic_gate", "ahb", base + MXC_CCM_CGR2, 10);
-       clk[firi_gate] = imx_clk_gate2("firi_gate", "upll", base+MXC_CCM_CGR2, 12);
-
-       imx_check_clocks(clk, ARRAY_SIZE(clk));
-
-       np = of_find_compatible_node(NULL, NULL, "fsl,imx31-ccm");
-
-       if (np) {
-               clk_data.clks = clk;
-               clk_data.clk_num = ARRAY_SIZE(clk);
-               of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
-       }
-
-       clk_register_clkdev(clk[gpt_gate], "per", "imx-gpt.0");
-       clk_register_clkdev(clk[ipg], "ipg", "imx-gpt.0");
-       clk_register_clkdev(clk[cspi1_gate], NULL, "imx31-cspi.0");
-       clk_register_clkdev(clk[cspi2_gate], NULL, "imx31-cspi.1");
-       clk_register_clkdev(clk[cspi3_gate], NULL, "imx31-cspi.2");
-       clk_register_clkdev(clk[pwm_gate], "pwm", NULL);
-       clk_register_clkdev(clk[wdog_gate], NULL, "imx2-wdt.0");
-       clk_register_clkdev(clk[rtc_gate], NULL, "imx21-rtc");
-       clk_register_clkdev(clk[epit1_gate], "epit", NULL);
-       clk_register_clkdev(clk[epit2_gate], "epit", NULL);
-       clk_register_clkdev(clk[nfc], NULL, "imx27-nand.0");
-       clk_register_clkdev(clk[ipu_gate], NULL, "ipu-core");
-       clk_register_clkdev(clk[ipu_gate], NULL, "mx3_sdc_fb");
-       clk_register_clkdev(clk[kpp_gate], NULL, "imx-keypad");
-       clk_register_clkdev(clk[usb_div_post], "per", "mxc-ehci.0");
-       clk_register_clkdev(clk[usb_gate], "ahb", "mxc-ehci.0");
-       clk_register_clkdev(clk[ipg], "ipg", "mxc-ehci.0");
-       clk_register_clkdev(clk[usb_div_post], "per", "mxc-ehci.1");
-       clk_register_clkdev(clk[usb_gate], "ahb", "mxc-ehci.1");
-       clk_register_clkdev(clk[ipg], "ipg", "mxc-ehci.1");
-       clk_register_clkdev(clk[usb_div_post], "per", "mxc-ehci.2");
-       clk_register_clkdev(clk[usb_gate], "ahb", "mxc-ehci.2");
-       clk_register_clkdev(clk[ipg], "ipg", "mxc-ehci.2");
-       clk_register_clkdev(clk[usb_div_post], "per", "imx-udc-mx27");
-       clk_register_clkdev(clk[usb_gate], "ahb", "imx-udc-mx27");
-       clk_register_clkdev(clk[ipg], "ipg", "imx-udc-mx27");
-       clk_register_clkdev(clk[csi_gate], NULL, "mx3-camera.0");
-       /* i.mx31 has the i.mx21 type uart */
-       clk_register_clkdev(clk[uart1_gate], "per", "imx21-uart.0");
-       clk_register_clkdev(clk[ipg], "ipg", "imx21-uart.0");
-       clk_register_clkdev(clk[uart2_gate], "per", "imx21-uart.1");
-       clk_register_clkdev(clk[ipg], "ipg", "imx21-uart.1");
-       clk_register_clkdev(clk[uart3_gate], "per", "imx21-uart.2");
-       clk_register_clkdev(clk[ipg], "ipg", "imx21-uart.2");
-       clk_register_clkdev(clk[uart4_gate], "per", "imx21-uart.3");
-       clk_register_clkdev(clk[ipg], "ipg", "imx21-uart.3");
-       clk_register_clkdev(clk[uart5_gate], "per", "imx21-uart.4");
-       clk_register_clkdev(clk[ipg], "ipg", "imx21-uart.4");
-       clk_register_clkdev(clk[i2c1_gate], NULL, "imx21-i2c.0");
-       clk_register_clkdev(clk[i2c2_gate], NULL, "imx21-i2c.1");
-       clk_register_clkdev(clk[i2c3_gate], NULL, "imx21-i2c.2");
-       clk_register_clkdev(clk[owire_gate], NULL, "mxc_w1.0");
-       clk_register_clkdev(clk[sdhc1_gate], NULL, "imx31-mmc.0");
-       clk_register_clkdev(clk[sdhc2_gate], NULL, "imx31-mmc.1");
-       clk_register_clkdev(clk[ssi1_gate], NULL, "imx-ssi.0");
-       clk_register_clkdev(clk[ssi2_gate], NULL, "imx-ssi.1");
-       clk_register_clkdev(clk[firi_gate], "firi", NULL);
-       clk_register_clkdev(clk[ata_gate], NULL, "pata_imx");
-       clk_register_clkdev(clk[rtic_gate], "rtic", NULL);
-       clk_register_clkdev(clk[rng_gate], NULL, "mxc_rnga");
-       clk_register_clkdev(clk[sdma_gate], NULL, "imx31-sdma");
-       clk_register_clkdev(clk[iim_gate], "iim", NULL);
-
-       clk_set_parent(clk[csi], clk[upll]);
-       clk_prepare_enable(clk[emi_gate]);
-       clk_prepare_enable(clk[iim_gate]);
-       mx31_revision();
-       clk_disable_unprepare(clk[iim_gate]);
-
-       mxc_timer_init(MX31_IO_ADDRESS(MX31_GPT1_BASE_ADDR), MX31_INT_GPT);
-
-       return 0;
-}
-
-int __init mx31_clocks_init_dt(void)
-{
-       struct device_node *np;
-       u32 fref = 26000000; /* default */
-
-       for_each_compatible_node(np, NULL, "fixed-clock") {
-               if (!of_device_is_compatible(np, "fsl,imx-osc26m"))
-                       continue;
-
-               if (!of_property_read_u32(np, "clock-frequency", &fref))
-                       break;
-       }
-
-       return mx31_clocks_init(fref);
-}
diff --git a/arch/arm/mach-imx/clk-imx35.c b/arch/arm/mach-imx/clk-imx35.c
deleted file mode 100644 (file)
index a0d2b57..0000000
+++ /dev/null
@@ -1,296 +0,0 @@
-/*
- * Copyright (C) 2012 Sascha Hauer, Pengutronix <s.hauer@pengutronix.de>
- *
- * 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/mm.h>
-#include <linux/delay.h>
-#include <linux/clk.h>
-#include <linux/io.h>
-#include <linux/clkdev.h>
-#include <linux/of.h>
-#include <linux/err.h>
-
-#include "crmregs-imx3.h"
-#include "clk.h"
-#include "common.h"
-#include "hardware.h"
-
-struct arm_ahb_div {
-       unsigned char arm, ahb, sel;
-};
-
-static struct arm_ahb_div clk_consumer[] = {
-       { .arm = 1, .ahb = 4, .sel = 0},
-       { .arm = 1, .ahb = 3, .sel = 1},
-       { .arm = 2, .ahb = 2, .sel = 0},
-       { .arm = 0, .ahb = 0, .sel = 0},
-       { .arm = 0, .ahb = 0, .sel = 0},
-       { .arm = 0, .ahb = 0, .sel = 0},
-       { .arm = 4, .ahb = 1, .sel = 0},
-       { .arm = 1, .ahb = 5, .sel = 0},
-       { .arm = 1, .ahb = 8, .sel = 0},
-       { .arm = 1, .ahb = 6, .sel = 1},
-       { .arm = 2, .ahb = 4, .sel = 0},
-       { .arm = 0, .ahb = 0, .sel = 0},
-       { .arm = 0, .ahb = 0, .sel = 0},
-       { .arm = 0, .ahb = 0, .sel = 0},
-       { .arm = 4, .ahb = 2, .sel = 0},
-       { .arm = 0, .ahb = 0, .sel = 0},
-};
-
-static char hsp_div_532[] = { 4, 8, 3, 0 };
-static char hsp_div_400[] = { 3, 6, 3, 0 };
-
-static struct clk_onecell_data clk_data;
-
-static const char *std_sel[] = {"ppll", "arm"};
-static const char *ipg_per_sel[] = {"ahb_per_div", "arm_per_div"};
-
-enum mx35_clks {
-       ckih, mpll, ppll, mpll_075, arm, hsp, hsp_div, hsp_sel, ahb, ipg,
-       arm_per_div, ahb_per_div, ipg_per, uart_sel, uart_div, esdhc_sel,
-       esdhc1_div, esdhc2_div, esdhc3_div, spdif_sel, spdif_div_pre,
-       spdif_div_post, ssi_sel, ssi1_div_pre, ssi1_div_post, ssi2_div_pre,
-       ssi2_div_post, usb_sel, usb_div, nfc_div, asrc_gate, pata_gate,
-       audmux_gate, can1_gate, can2_gate, cspi1_gate, cspi2_gate, ect_gate,
-       edio_gate, emi_gate, epit1_gate, epit2_gate, esai_gate, esdhc1_gate,
-       esdhc2_gate, esdhc3_gate, fec_gate, gpio1_gate, gpio2_gate, gpio3_gate,
-       gpt_gate, i2c1_gate, i2c2_gate, i2c3_gate, iomuxc_gate, ipu_gate,
-       kpp_gate, mlb_gate, mshc_gate, owire_gate, pwm_gate, rngc_gate,
-       rtc_gate, rtic_gate, scc_gate, sdma_gate, spba_gate, spdif_gate,
-       ssi1_gate, ssi2_gate, uart1_gate, uart2_gate, uart3_gate, usbotg_gate,
-       wdog_gate, max_gate, admux_gate, csi_gate, csi_div, csi_sel, iim_gate,
-       gpu2d_gate, clk_max
-};
-
-static struct clk *clk[clk_max];
-
-int __init mx35_clocks_init(void)
-{
-       void __iomem *base = MX35_IO_ADDRESS(MX35_CCM_BASE_ADDR);
-       u32 pdr0, consumer_sel, hsp_sel;
-       struct arm_ahb_div *aad;
-       unsigned char *hsp_div;
-
-       pdr0 = __raw_readl(base + MXC_CCM_PDR0);
-       consumer_sel = (pdr0 >> 16) & 0xf;
-       aad = &clk_consumer[consumer_sel];
-       if (!aad->arm) {
-               pr_err("i.MX35 clk: illegal consumer mux selection 0x%x\n", consumer_sel);
-               /*
-                * We are basically stuck. Continue with a default entry and hope we
-                * get far enough to actually show the above message
-                */
-               aad = &clk_consumer[0];
-       }
-
-       clk[ckih] = imx_clk_fixed("ckih", 24000000);
-       clk[mpll] = imx_clk_pllv1("mpll", "ckih", base + MX35_CCM_MPCTL);
-       clk[ppll] = imx_clk_pllv1("ppll", "ckih", base + MX35_CCM_PPCTL);
-
-       clk[mpll] = imx_clk_fixed_factor("mpll_075", "mpll", 3, 4);
-
-       if (aad->sel)
-               clk[arm] = imx_clk_fixed_factor("arm", "mpll_075", 1, aad->arm);
-       else
-               clk[arm] = imx_clk_fixed_factor("arm", "mpll", 1, aad->arm);
-
-       if (clk_get_rate(clk[arm]) > 400000000)
-               hsp_div = hsp_div_532;
-       else
-               hsp_div = hsp_div_400;
-
-       hsp_sel = (pdr0 >> 20) & 0x3;
-       if (!hsp_div[hsp_sel]) {
-               pr_err("i.MX35 clk: illegal hsp clk selection 0x%x\n", hsp_sel);
-               hsp_sel = 0;
-       }
-
-       clk[hsp] = imx_clk_fixed_factor("hsp", "arm", 1, hsp_div[hsp_sel]);
-
-       clk[ahb] = imx_clk_fixed_factor("ahb", "arm", 1, aad->ahb);
-       clk[ipg] = imx_clk_fixed_factor("ipg", "ahb", 1, 2);
-
-       clk[arm_per_div] = imx_clk_divider("arm_per_div", "arm", base + MX35_CCM_PDR4, 16, 6);
-       clk[ahb_per_div] = imx_clk_divider("ahb_per_div", "ahb", base + MXC_CCM_PDR0, 12, 3);
-       clk[ipg_per] = imx_clk_mux("ipg_per", base + MXC_CCM_PDR0, 26, 1, ipg_per_sel, ARRAY_SIZE(ipg_per_sel));
-
-       clk[uart_sel] = imx_clk_mux("uart_sel", base + MX35_CCM_PDR3, 14, 1, std_sel, ARRAY_SIZE(std_sel));
-       clk[uart_div] = imx_clk_divider("uart_div", "uart_sel", base + MX35_CCM_PDR4, 10, 6);
-
-       clk[esdhc_sel] = imx_clk_mux("esdhc_sel", base + MX35_CCM_PDR4, 9, 1, std_sel, ARRAY_SIZE(std_sel));
-       clk[esdhc1_div] = imx_clk_divider("esdhc1_div", "esdhc_sel", base + MX35_CCM_PDR3, 0, 6);
-       clk[esdhc2_div] = imx_clk_divider("esdhc2_div", "esdhc_sel", base + MX35_CCM_PDR3, 8, 6);
-       clk[esdhc3_div] = imx_clk_divider("esdhc3_div", "esdhc_sel", base + MX35_CCM_PDR3, 16, 6);
-
-       clk[spdif_sel] = imx_clk_mux("spdif_sel", base + MX35_CCM_PDR3, 22, 1, std_sel, ARRAY_SIZE(std_sel));
-       clk[spdif_div_pre] = imx_clk_divider("spdif_div_pre", "spdif_sel", base + MX35_CCM_PDR3, 29, 3); /* divide by 1 not allowed */ 
-       clk[spdif_div_post] = imx_clk_divider("spdif_div_post", "spdif_div_pre", base + MX35_CCM_PDR3, 23, 6);
-
-       clk[ssi_sel] = imx_clk_mux("ssi_sel", base + MX35_CCM_PDR2, 6, 1, std_sel, ARRAY_SIZE(std_sel));
-       clk[ssi1_div_pre] = imx_clk_divider("ssi1_div_pre", "ssi_sel", base + MX35_CCM_PDR2, 24, 3);
-       clk[ssi1_div_post] = imx_clk_divider("ssi1_div_post", "ssi1_div_pre", base + MX35_CCM_PDR2, 0, 6);
-       clk[ssi2_div_pre] = imx_clk_divider("ssi2_div_pre", "ssi_sel", base + MX35_CCM_PDR2, 27, 3);
-       clk[ssi2_div_post] = imx_clk_divider("ssi2_div_post", "ssi2_div_pre", base + MX35_CCM_PDR2, 8, 6);
-
-       clk[usb_sel] = imx_clk_mux("usb_sel", base + MX35_CCM_PDR4, 9, 1, std_sel, ARRAY_SIZE(std_sel));
-       clk[usb_div] = imx_clk_divider("usb_div", "usb_sel", base + MX35_CCM_PDR4, 22, 6);
-
-       clk[nfc_div] = imx_clk_divider("nfc_div", "ahb", base + MX35_CCM_PDR4, 28, 4);
-
-       clk[csi_sel] = imx_clk_mux("csi_sel", base + MX35_CCM_PDR2, 7, 1, std_sel, ARRAY_SIZE(std_sel));
-       clk[csi_div] = imx_clk_divider("csi_div", "csi_sel", base + MX35_CCM_PDR2, 16, 6);
-
-       clk[asrc_gate] = imx_clk_gate2("asrc_gate", "ipg", base + MX35_CCM_CGR0,  0);
-       clk[pata_gate] = imx_clk_gate2("pata_gate", "ipg", base + MX35_CCM_CGR0,  2);
-       clk[audmux_gate] = imx_clk_gate2("audmux_gate", "ipg", base + MX35_CCM_CGR0,  4);
-       clk[can1_gate] = imx_clk_gate2("can1_gate", "ipg", base + MX35_CCM_CGR0,  6);
-       clk[can2_gate] = imx_clk_gate2("can2_gate", "ipg", base + MX35_CCM_CGR0,  8);
-       clk[cspi1_gate] = imx_clk_gate2("cspi1_gate", "ipg", base + MX35_CCM_CGR0, 10);
-       clk[cspi2_gate] = imx_clk_gate2("cspi2_gate", "ipg", base + MX35_CCM_CGR0, 12);
-       clk[ect_gate] = imx_clk_gate2("ect_gate", "ipg", base + MX35_CCM_CGR0, 14);
-       clk[edio_gate] = imx_clk_gate2("edio_gate",   "ipg", base + MX35_CCM_CGR0, 16);
-       clk[emi_gate] = imx_clk_gate2("emi_gate", "ipg", base + MX35_CCM_CGR0, 18);
-       clk[epit1_gate] = imx_clk_gate2("epit1_gate", "ipg", base + MX35_CCM_CGR0, 20);
-       clk[epit2_gate] = imx_clk_gate2("epit2_gate", "ipg", base + MX35_CCM_CGR0, 22);
-       clk[esai_gate] = imx_clk_gate2("esai_gate",   "ipg", base + MX35_CCM_CGR0, 24);
-       clk[esdhc1_gate] = imx_clk_gate2("esdhc1_gate", "esdhc1_div", base + MX35_CCM_CGR0, 26);
-       clk[esdhc2_gate] = imx_clk_gate2("esdhc2_gate", "esdhc2_div", base + MX35_CCM_CGR0, 28);
-       clk[esdhc3_gate] = imx_clk_gate2("esdhc3_gate", "esdhc3_div", base + MX35_CCM_CGR0, 30);
-
-       clk[fec_gate] = imx_clk_gate2("fec_gate", "ipg", base + MX35_CCM_CGR1,  0);
-       clk[gpio1_gate] = imx_clk_gate2("gpio1_gate", "ipg", base + MX35_CCM_CGR1,  2);
-       clk[gpio2_gate] = imx_clk_gate2("gpio2_gate", "ipg", base + MX35_CCM_CGR1,  4);
-       clk[gpio3_gate] = imx_clk_gate2("gpio3_gate", "ipg", base + MX35_CCM_CGR1,  6);
-       clk[gpt_gate] = imx_clk_gate2("gpt_gate", "ipg", base + MX35_CCM_CGR1,  8);
-       clk[i2c1_gate] = imx_clk_gate2("i2c1_gate", "ipg_per", base + MX35_CCM_CGR1, 10);
-       clk[i2c2_gate] = imx_clk_gate2("i2c2_gate", "ipg_per", base + MX35_CCM_CGR1, 12);
-       clk[i2c3_gate] = imx_clk_gate2("i2c3_gate", "ipg_per", base + MX35_CCM_CGR1, 14);
-       clk[iomuxc_gate] = imx_clk_gate2("iomuxc_gate", "ipg", base + MX35_CCM_CGR1, 16);
-       clk[ipu_gate] = imx_clk_gate2("ipu_gate", "hsp", base + MX35_CCM_CGR1, 18);
-       clk[kpp_gate] = imx_clk_gate2("kpp_gate", "ipg", base + MX35_CCM_CGR1, 20);
-       clk[mlb_gate] = imx_clk_gate2("mlb_gate", "ahb", base + MX35_CCM_CGR1, 22);
-       clk[mshc_gate] = imx_clk_gate2("mshc_gate", "dummy", base + MX35_CCM_CGR1, 24);
-       clk[owire_gate] = imx_clk_gate2("owire_gate", "ipg_per", base + MX35_CCM_CGR1, 26);
-       clk[pwm_gate] = imx_clk_gate2("pwm_gate", "ipg_per", base + MX35_CCM_CGR1, 28);
-       clk[rngc_gate] = imx_clk_gate2("rngc_gate", "ipg", base + MX35_CCM_CGR1, 30);
-
-       clk[rtc_gate] = imx_clk_gate2("rtc_gate", "ipg", base + MX35_CCM_CGR2,  0);
-       clk[rtic_gate] = imx_clk_gate2("rtic_gate", "ahb", base + MX35_CCM_CGR2,  2);
-       clk[scc_gate] = imx_clk_gate2("scc_gate", "ipg", base + MX35_CCM_CGR2,  4);
-       clk[sdma_gate] = imx_clk_gate2("sdma_gate", "ahb", base + MX35_CCM_CGR2,  6);
-       clk[spba_gate] = imx_clk_gate2("spba_gate", "ipg", base + MX35_CCM_CGR2,  8);
-       clk[spdif_gate] = imx_clk_gate2("spdif_gate", "spdif_div_post", base + MX35_CCM_CGR2, 10);
-       clk[ssi1_gate] = imx_clk_gate2("ssi1_gate", "ssi1_div_post", base + MX35_CCM_CGR2, 12);
-       clk[ssi2_gate] = imx_clk_gate2("ssi2_gate", "ssi2_div_post", base + MX35_CCM_CGR2, 14);
-       clk[uart1_gate] = imx_clk_gate2("uart1_gate", "uart_div", base + MX35_CCM_CGR2, 16);
-       clk[uart2_gate] = imx_clk_gate2("uart2_gate", "uart_div", base + MX35_CCM_CGR2, 18);
-       clk[uart3_gate] = imx_clk_gate2("uart3_gate", "uart_div", base + MX35_CCM_CGR2, 20);
-       clk[usbotg_gate] = imx_clk_gate2("usbotg_gate", "ahb", base + MX35_CCM_CGR2, 22);
-       clk[wdog_gate] = imx_clk_gate2("wdog_gate", "ipg", base + MX35_CCM_CGR2, 24);
-       clk[max_gate] = imx_clk_gate2("max_gate", "dummy", base + MX35_CCM_CGR2, 26);
-       clk[admux_gate] = imx_clk_gate2("admux_gate", "ipg", base + MX35_CCM_CGR2, 30);
-
-       clk[csi_gate] = imx_clk_gate2("csi_gate", "csi_div", base + MX35_CCM_CGR3,  0);
-       clk[iim_gate] = imx_clk_gate2("iim_gate", "ipg", base + MX35_CCM_CGR3,  2);
-       clk[gpu2d_gate] = imx_clk_gate2("gpu2d_gate", "ahb", base + MX35_CCM_CGR3,  4);
-
-       imx_check_clocks(clk, ARRAY_SIZE(clk));
-
-       clk_register_clkdev(clk[pata_gate], NULL, "pata_imx");
-       clk_register_clkdev(clk[can1_gate], NULL, "flexcan.0");
-       clk_register_clkdev(clk[can2_gate], NULL, "flexcan.1");
-       clk_register_clkdev(clk[cspi1_gate], "per", "imx35-cspi.0");
-       clk_register_clkdev(clk[cspi1_gate], "ipg", "imx35-cspi.0");
-       clk_register_clkdev(clk[cspi2_gate], "per", "imx35-cspi.1");
-       clk_register_clkdev(clk[cspi2_gate], "ipg", "imx35-cspi.1");
-       clk_register_clkdev(clk[epit1_gate], NULL, "imx-epit.0");
-       clk_register_clkdev(clk[epit2_gate], NULL, "imx-epit.1");
-       clk_register_clkdev(clk[esdhc1_gate], "per", "sdhci-esdhc-imx35.0");
-       clk_register_clkdev(clk[ipg], "ipg", "sdhci-esdhc-imx35.0");
-       clk_register_clkdev(clk[ahb], "ahb", "sdhci-esdhc-imx35.0");
-       clk_register_clkdev(clk[esdhc2_gate], "per", "sdhci-esdhc-imx35.1");
-       clk_register_clkdev(clk[ipg], "ipg", "sdhci-esdhc-imx35.1");
-       clk_register_clkdev(clk[ahb], "ahb", "sdhci-esdhc-imx35.1");
-       clk_register_clkdev(clk[esdhc3_gate], "per", "sdhci-esdhc-imx35.2");
-       clk_register_clkdev(clk[ipg], "ipg", "sdhci-esdhc-imx35.2");
-       clk_register_clkdev(clk[ahb], "ahb", "sdhci-esdhc-imx35.2");
-       /* i.mx35 has the i.mx27 type fec */
-       clk_register_clkdev(clk[fec_gate], NULL, "imx27-fec.0");
-       clk_register_clkdev(clk[gpt_gate], "per", "imx-gpt.0");
-       clk_register_clkdev(clk[ipg], "ipg", "imx-gpt.0");
-       clk_register_clkdev(clk[i2c1_gate], NULL, "imx21-i2c.0");
-       clk_register_clkdev(clk[i2c2_gate], NULL, "imx21-i2c.1");
-       clk_register_clkdev(clk[i2c3_gate], NULL, "imx21-i2c.2");
-       clk_register_clkdev(clk[ipu_gate], NULL, "ipu-core");
-       clk_register_clkdev(clk[ipu_gate], NULL, "mx3_sdc_fb");
-       clk_register_clkdev(clk[kpp_gate], NULL, "imx-keypad");
-       clk_register_clkdev(clk[owire_gate], NULL, "mxc_w1");
-       clk_register_clkdev(clk[sdma_gate], NULL, "imx35-sdma");
-       clk_register_clkdev(clk[ssi1_gate], NULL, "imx-ssi.0");
-       clk_register_clkdev(clk[ssi2_gate], NULL, "imx-ssi.1");
-       /* i.mx35 has the i.mx21 type uart */
-       clk_register_clkdev(clk[uart1_gate], "per", "imx21-uart.0");
-       clk_register_clkdev(clk[ipg], "ipg", "imx21-uart.0");
-       clk_register_clkdev(clk[uart2_gate], "per", "imx21-uart.1");
-       clk_register_clkdev(clk[ipg], "ipg", "imx21-uart.1");
-       clk_register_clkdev(clk[uart3_gate], "per", "imx21-uart.2");
-       clk_register_clkdev(clk[ipg], "ipg", "imx21-uart.2");
-       clk_register_clkdev(clk[usb_div], "per", "mxc-ehci.0");
-       clk_register_clkdev(clk[ipg], "ipg", "mxc-ehci.0");
-       clk_register_clkdev(clk[usbotg_gate], "ahb", "mxc-ehci.0");
-       clk_register_clkdev(clk[usb_div], "per", "mxc-ehci.1");
-       clk_register_clkdev(clk[ipg], "ipg", "mxc-ehci.1");
-       clk_register_clkdev(clk[usbotg_gate], "ahb", "mxc-ehci.1");
-       clk_register_clkdev(clk[usb_div], "per", "mxc-ehci.2");
-       clk_register_clkdev(clk[ipg], "ipg", "mxc-ehci.2");
-       clk_register_clkdev(clk[usbotg_gate], "ahb", "mxc-ehci.2");
-       clk_register_clkdev(clk[usb_div], "per", "imx-udc-mx27");
-       clk_register_clkdev(clk[ipg], "ipg", "imx-udc-mx27");
-       clk_register_clkdev(clk[usbotg_gate], "ahb", "imx-udc-mx27");
-       clk_register_clkdev(clk[wdog_gate], NULL, "imx2-wdt.0");
-       clk_register_clkdev(clk[nfc_div], NULL, "imx25-nand.0");
-       clk_register_clkdev(clk[csi_gate], NULL, "mx3-camera.0");
-       clk_register_clkdev(clk[admux_gate], "audmux", NULL);
-
-       clk_prepare_enable(clk[spba_gate]);
-       clk_prepare_enable(clk[gpio1_gate]);
-       clk_prepare_enable(clk[gpio2_gate]);
-       clk_prepare_enable(clk[gpio3_gate]);
-       clk_prepare_enable(clk[iim_gate]);
-       clk_prepare_enable(clk[emi_gate]);
-       clk_prepare_enable(clk[max_gate]);
-       clk_prepare_enable(clk[iomuxc_gate]);
-
-       /*
-        * SCC is needed to boot via mmc after a watchdog reset. The clock code
-        * before conversion to common clk also enabled UART1 (which isn't
-        * handled here and not needed for mmc) and IIM (which is enabled
-        * unconditionally above).
-        */
-       clk_prepare_enable(clk[scc_gate]);
-
-       imx_print_silicon_rev("i.MX35", mx35_revision());
-
-#ifdef CONFIG_MXC_USE_EPIT
-       epit_timer_init(MX35_IO_ADDRESS(MX35_EPIT1_BASE_ADDR), MX35_INT_EPIT1);
-#else
-       mxc_timer_init(MX35_IO_ADDRESS(MX35_GPT1_BASE_ADDR), MX35_INT_GPT);
-#endif
-
-       return 0;
-}
-
-static void __init mx35_clocks_init_dt(struct device_node *ccm_node)
-{
-       clk_data.clks = clk;
-       clk_data.clk_num = ARRAY_SIZE(clk);
-       of_clk_add_provider(ccm_node, of_clk_src_onecell_get, &clk_data);
-
-       mx35_clocks_init();
-}
-CLK_OF_DECLARE(imx35, "fsl,imx35-ccm", mx35_clocks_init_dt);
diff --git a/arch/arm/mach-imx/clk-imx51-imx53.c b/arch/arm/mach-imx/clk-imx51-imx53.c
deleted file mode 100644 (file)
index 0f7e536..0000000
+++ /dev/null
@@ -1,573 +0,0 @@
-/*
- * Copyright (C) 2011 Sascha Hauer, Pengutronix <s.hauer@pengutronix.de>
- *
- * 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/mm.h>
-#include <linux/delay.h>
-#include <linux/clk.h>
-#include <linux/io.h>
-#include <linux/clkdev.h>
-#include <linux/clk-provider.h>
-#include <linux/err.h>
-#include <linux/of.h>
-#include <linux/of_address.h>
-#include <linux/of_irq.h>
-#include <dt-bindings/clock/imx5-clock.h>
-
-#include "clk.h"
-#include "common.h"
-#include "hardware.h"
-
-#define MX51_DPLL1_BASE                0x83f80000
-#define MX51_DPLL2_BASE                0x83f84000
-#define MX51_DPLL3_BASE                0x83f88000
-
-#define MX53_DPLL1_BASE                0x63f80000
-#define MX53_DPLL2_BASE                0x63f84000
-#define MX53_DPLL3_BASE                0x63f88000
-#define MX53_DPLL4_BASE                0x63f8c000
-
-#define MXC_CCM_CCR            (ccm_base + 0x00)
-#define MXC_CCM_CCDR           (ccm_base + 0x04)
-#define MXC_CCM_CSR            (ccm_base + 0x08)
-#define MXC_CCM_CCSR           (ccm_base + 0x0c)
-#define MXC_CCM_CACRR          (ccm_base + 0x10)
-#define MXC_CCM_CBCDR          (ccm_base + 0x14)
-#define MXC_CCM_CBCMR          (ccm_base + 0x18)
-#define MXC_CCM_CSCMR1         (ccm_base + 0x1c)
-#define MXC_CCM_CSCMR2         (ccm_base + 0x20)
-#define MXC_CCM_CSCDR1         (ccm_base + 0x24)
-#define MXC_CCM_CS1CDR         (ccm_base + 0x28)
-#define MXC_CCM_CS2CDR         (ccm_base + 0x2c)
-#define MXC_CCM_CDCDR          (ccm_base + 0x30)
-#define MXC_CCM_CHSCDR         (ccm_base + 0x34)
-#define MXC_CCM_CSCDR2         (ccm_base + 0x38)
-#define MXC_CCM_CSCDR3         (ccm_base + 0x3c)
-#define MXC_CCM_CSCDR4         (ccm_base + 0x40)
-#define MXC_CCM_CWDR           (ccm_base + 0x44)
-#define MXC_CCM_CDHIPR         (ccm_base + 0x48)
-#define MXC_CCM_CDCR           (ccm_base + 0x4c)
-#define MXC_CCM_CTOR           (ccm_base + 0x50)
-#define MXC_CCM_CLPCR          (ccm_base + 0x54)
-#define MXC_CCM_CISR           (ccm_base + 0x58)
-#define MXC_CCM_CIMR           (ccm_base + 0x5c)
-#define MXC_CCM_CCOSR          (ccm_base + 0x60)
-#define MXC_CCM_CGPR           (ccm_base + 0x64)
-#define MXC_CCM_CCGR0          (ccm_base + 0x68)
-#define MXC_CCM_CCGR1          (ccm_base + 0x6c)
-#define MXC_CCM_CCGR2          (ccm_base + 0x70)
-#define MXC_CCM_CCGR3          (ccm_base + 0x74)
-#define MXC_CCM_CCGR4          (ccm_base + 0x78)
-#define MXC_CCM_CCGR5          (ccm_base + 0x7c)
-#define MXC_CCM_CCGR6          (ccm_base + 0x80)
-#define MXC_CCM_CCGR7          (ccm_base + 0x84)
-
-/* Low-power Audio Playback Mode clock */
-static const char *lp_apm_sel[] = { "osc", };
-
-/* This is used multiple times */
-static const char *standard_pll_sel[] = { "pll1_sw", "pll2_sw", "pll3_sw", "lp_apm", };
-static const char *periph_apm_sel[] = { "pll1_sw", "pll3_sw", "lp_apm", };
-static const char *main_bus_sel[] = { "pll2_sw", "periph_apm", };
-static const char *per_lp_apm_sel[] = { "main_bus", "lp_apm", };
-static const char *per_root_sel[] = { "per_podf", "ipg", };
-static const char *esdhc_c_sel[] = { "esdhc_a_podf", "esdhc_b_podf", };
-static const char *esdhc_d_sel[] = { "esdhc_a_podf", "esdhc_b_podf", };
-static const char *ssi_apm_sels[] = { "ckih1", "lp_amp", "ckih2", };
-static const char *ssi_clk_sels[] = { "pll1_sw", "pll2_sw", "pll3_sw", "ssi_apm", };
-static const char *ssi3_clk_sels[] = { "ssi1_root_gate", "ssi2_root_gate", };
-static const char *ssi_ext1_com_sels[] = { "ssi_ext1_podf", "ssi1_root_gate", };
-static const char *ssi_ext2_com_sels[] = { "ssi_ext2_podf", "ssi2_root_gate", };
-static const char *emi_slow_sel[] = { "main_bus", "ahb", };
-static const char *usb_phy_sel_str[] = { "osc", "usb_phy_podf", };
-static const char *mx51_ipu_di0_sel[] = { "di_pred", "osc", "ckih1", "tve_di", };
-static const char *mx53_ipu_di0_sel[] = { "di_pred", "osc", "ckih1", "di_pll4_podf", "dummy", "ldb_di0_gate", };
-static const char *mx53_ldb_di0_sel[] = { "pll3_sw", "pll4_sw", };
-static const char *mx51_ipu_di1_sel[] = { "di_pred", "osc", "ckih1", "tve_di", "ipp_di1", };
-static const char *mx53_ipu_di1_sel[] = { "di_pred", "osc", "ckih1", "tve_di", "ipp_di1", "ldb_di1_gate", };
-static const char *mx53_ldb_di1_sel[] = { "pll3_sw", "pll4_sw", };
-static const char *mx51_tve_ext_sel[] = { "osc", "ckih1", };
-static const char *mx53_tve_ext_sel[] = { "pll4_sw", "ckih1", };
-static const char *mx51_tve_sel[] = { "tve_pred", "tve_ext_sel", };
-static const char *ipu_sel[] = { "axi_a", "axi_b", "emi_slow_gate", "ahb", };
-static const char *gpu3d_sel[] = { "axi_a", "axi_b", "emi_slow_gate", "ahb" };
-static const char *gpu2d_sel[] = { "axi_a", "axi_b", "emi_slow_gate", "ahb" };
-static const char *vpu_sel[] = { "axi_a", "axi_b", "emi_slow_gate", "ahb", };
-static const char *mx53_can_sel[] = { "ipg", "ckih1", "ckih2", "lp_apm", };
-static const char *mx53_cko1_sel[] = {
-       "cpu_podf", "pll1_sw", "pll2_sw", "pll3_sw",
-       "emi_slow_podf", "pll4_sw", "nfc_podf", "dummy",
-       "di_pred", "dummy", "dummy", "ahb",
-       "ipg", "per_root", "ckil", "dummy",};
-static const char *mx53_cko2_sel[] = {
-       "dummy"/* dptc_core */, "dummy"/* dptc_perich */,
-       "dummy", "esdhc_a_podf",
-       "usboh3_podf", "dummy"/* wrck_clk_root */,
-       "ecspi_podf", "dummy"/* pll1_ref_clk */,
-       "esdhc_b_podf", "dummy"/* ddr_clk_root */,
-       "dummy"/* arm_axi_clk_root */, "dummy"/* usb_phy_out */,
-       "vpu_sel", "ipu_sel",
-       "osc", "ckih1",
-       "dummy", "esdhc_c_sel",
-       "ssi1_root_podf", "ssi2_root_podf",
-       "dummy", "dummy",
-       "dummy"/* lpsr_clk_root */, "dummy"/* pgc_clk_root */,
-       "dummy"/* tve_out */, "usb_phy_sel",
-       "tve_sel", "lp_apm",
-       "uart_root", "dummy"/* spdif0_clk_root */,
-       "dummy", "dummy", };
-static const char *mx51_spdif_xtal_sel[] = { "osc", "ckih", "ckih2", };
-static const char *mx53_spdif_xtal_sel[] = { "osc", "ckih", "ckih2", "pll4_sw", };
-static const char *spdif_sel[] = { "pll1_sw", "pll2_sw", "pll3_sw", "spdif_xtal_sel", };
-static const char *spdif0_com_sel[] = { "spdif0_podf", "ssi1_root_gate", };
-static const char *mx51_spdif1_com_sel[] = { "spdif1_podf", "ssi2_root_gate", };
-static const char *step_sels[] = { "lp_apm", };
-static const char *cpu_podf_sels[] = { "pll1_sw", "step_sel" };
-
-static struct clk *clk[IMX5_CLK_END];
-static struct clk_onecell_data clk_data;
-
-static void __init mx5_clocks_common_init(void __iomem *ccm_base)
-{
-       imx5_pm_set_ccm_base(ccm_base);
-
-       clk[IMX5_CLK_DUMMY]             = imx_clk_fixed("dummy", 0);
-       clk[IMX5_CLK_CKIL]              = imx_obtain_fixed_clock("ckil", 0);
-       clk[IMX5_CLK_OSC]               = imx_obtain_fixed_clock("osc", 0);
-       clk[IMX5_CLK_CKIH1]             = imx_obtain_fixed_clock("ckih1", 0);
-       clk[IMX5_CLK_CKIH2]             = imx_obtain_fixed_clock("ckih2", 0);
-
-       clk[IMX5_CLK_PERIPH_APM]        = imx_clk_mux("periph_apm", MXC_CCM_CBCMR, 12, 2,
-                                               periph_apm_sel, ARRAY_SIZE(periph_apm_sel));
-       clk[IMX5_CLK_MAIN_BUS]          = imx_clk_mux("main_bus", MXC_CCM_CBCDR, 25, 1,
-                                               main_bus_sel, ARRAY_SIZE(main_bus_sel));
-       clk[IMX5_CLK_PER_LP_APM]        = imx_clk_mux("per_lp_apm", MXC_CCM_CBCMR, 1, 1,
-                                               per_lp_apm_sel, ARRAY_SIZE(per_lp_apm_sel));
-       clk[IMX5_CLK_PER_PRED1]         = imx_clk_divider("per_pred1", "per_lp_apm", MXC_CCM_CBCDR, 6, 2);
-       clk[IMX5_CLK_PER_PRED2]         = imx_clk_divider("per_pred2", "per_pred1", MXC_CCM_CBCDR, 3, 3);
-       clk[IMX5_CLK_PER_PODF]          = imx_clk_divider("per_podf", "per_pred2", MXC_CCM_CBCDR, 0, 3);
-       clk[IMX5_CLK_PER_ROOT]          = imx_clk_mux("per_root", MXC_CCM_CBCMR, 0, 1,
-                                               per_root_sel, ARRAY_SIZE(per_root_sel));
-       clk[IMX5_CLK_AHB]               = imx_clk_divider("ahb", "main_bus", MXC_CCM_CBCDR, 10, 3);
-       clk[IMX5_CLK_AHB_MAX]           = imx_clk_gate2("ahb_max", "ahb", MXC_CCM_CCGR0, 28);
-       clk[IMX5_CLK_AIPS_TZ1]          = imx_clk_gate2("aips_tz1", "ahb", MXC_CCM_CCGR0, 24);
-       clk[IMX5_CLK_AIPS_TZ2]          = imx_clk_gate2("aips_tz2", "ahb", MXC_CCM_CCGR0, 26);
-       clk[IMX5_CLK_TMAX1]             = imx_clk_gate2("tmax1", "ahb", MXC_CCM_CCGR1, 0);
-       clk[IMX5_CLK_TMAX2]             = imx_clk_gate2("tmax2", "ahb", MXC_CCM_CCGR1, 2);
-       clk[IMX5_CLK_TMAX3]             = imx_clk_gate2("tmax3", "ahb", MXC_CCM_CCGR1, 4);
-       clk[IMX5_CLK_SPBA]              = imx_clk_gate2("spba", "ipg", MXC_CCM_CCGR5, 0);
-       clk[IMX5_CLK_IPG]               = imx_clk_divider("ipg", "ahb", MXC_CCM_CBCDR, 8, 2);
-       clk[IMX5_CLK_AXI_A]             = imx_clk_divider("axi_a", "main_bus", MXC_CCM_CBCDR, 16, 3);
-       clk[IMX5_CLK_AXI_B]             = imx_clk_divider("axi_b", "main_bus", MXC_CCM_CBCDR, 19, 3);
-       clk[IMX5_CLK_UART_SEL]          = imx_clk_mux("uart_sel", MXC_CCM_CSCMR1, 24, 2,
-                                               standard_pll_sel, ARRAY_SIZE(standard_pll_sel));
-       clk[IMX5_CLK_UART_PRED]         = imx_clk_divider("uart_pred", "uart_sel", MXC_CCM_CSCDR1, 3, 3);
-       clk[IMX5_CLK_UART_ROOT]         = imx_clk_divider("uart_root", "uart_pred", MXC_CCM_CSCDR1, 0, 3);
-
-       clk[IMX5_CLK_ESDHC_A_SEL]       = imx_clk_mux("esdhc_a_sel", MXC_CCM_CSCMR1, 20, 2,
-                                               standard_pll_sel, ARRAY_SIZE(standard_pll_sel));
-       clk[IMX5_CLK_ESDHC_B_SEL]       = imx_clk_mux("esdhc_b_sel", MXC_CCM_CSCMR1, 16, 2,
-                                               standard_pll_sel, ARRAY_SIZE(standard_pll_sel));
-       clk[IMX5_CLK_ESDHC_A_PRED]      = imx_clk_divider("esdhc_a_pred", "esdhc_a_sel", MXC_CCM_CSCDR1, 16, 3);
-       clk[IMX5_CLK_ESDHC_A_PODF]      = imx_clk_divider("esdhc_a_podf", "esdhc_a_pred", MXC_CCM_CSCDR1, 11, 3);
-       clk[IMX5_CLK_ESDHC_B_PRED]      = imx_clk_divider("esdhc_b_pred", "esdhc_b_sel", MXC_CCM_CSCDR1, 22, 3);
-       clk[IMX5_CLK_ESDHC_B_PODF]      = imx_clk_divider("esdhc_b_podf", "esdhc_b_pred", MXC_CCM_CSCDR1, 19, 3);
-       clk[IMX5_CLK_ESDHC_C_SEL]       = imx_clk_mux("esdhc_c_sel", MXC_CCM_CSCMR1, 19, 1, esdhc_c_sel, ARRAY_SIZE(esdhc_c_sel));
-       clk[IMX5_CLK_ESDHC_D_SEL]       = imx_clk_mux("esdhc_d_sel", MXC_CCM_CSCMR1, 18, 1, esdhc_d_sel, ARRAY_SIZE(esdhc_d_sel));
-
-       clk[IMX5_CLK_EMI_SEL]           = imx_clk_mux("emi_sel", MXC_CCM_CBCDR, 26, 1,
-                                               emi_slow_sel, ARRAY_SIZE(emi_slow_sel));
-       clk[IMX5_CLK_EMI_SLOW_PODF]     = imx_clk_divider("emi_slow_podf", "emi_sel", MXC_CCM_CBCDR, 22, 3);
-       clk[IMX5_CLK_NFC_PODF]          = imx_clk_divider("nfc_podf", "emi_slow_podf", MXC_CCM_CBCDR, 13, 3);
-       clk[IMX5_CLK_ECSPI_SEL]         = imx_clk_mux("ecspi_sel", MXC_CCM_CSCMR1, 4, 2,
-                                               standard_pll_sel, ARRAY_SIZE(standard_pll_sel));
-       clk[IMX5_CLK_ECSPI_PRED]        = imx_clk_divider("ecspi_pred", "ecspi_sel", MXC_CCM_CSCDR2, 25, 3);
-       clk[IMX5_CLK_ECSPI_PODF]        = imx_clk_divider("ecspi_podf", "ecspi_pred", MXC_CCM_CSCDR2, 19, 6);
-       clk[IMX5_CLK_USBOH3_SEL]        = imx_clk_mux("usboh3_sel", MXC_CCM_CSCMR1, 22, 2,
-                                               standard_pll_sel, ARRAY_SIZE(standard_pll_sel));
-       clk[IMX5_CLK_USBOH3_PRED]       = imx_clk_divider("usboh3_pred", "usboh3_sel", MXC_CCM_CSCDR1, 8, 3);
-       clk[IMX5_CLK_USBOH3_PODF]       = imx_clk_divider("usboh3_podf", "usboh3_pred", MXC_CCM_CSCDR1, 6, 2);
-       clk[IMX5_CLK_USB_PHY_PRED]      = imx_clk_divider("usb_phy_pred", "pll3_sw", MXC_CCM_CDCDR, 3, 3);
-       clk[IMX5_CLK_USB_PHY_PODF]      = imx_clk_divider("usb_phy_podf", "usb_phy_pred", MXC_CCM_CDCDR, 0, 3);
-       clk[IMX5_CLK_USB_PHY_SEL]       = imx_clk_mux("usb_phy_sel", MXC_CCM_CSCMR1, 26, 1,
-                                               usb_phy_sel_str, ARRAY_SIZE(usb_phy_sel_str));
-       clk[IMX5_CLK_STEP_SEL]          = imx_clk_mux("step_sel", MXC_CCM_CCSR, 7, 2, step_sels, ARRAY_SIZE(step_sels));
-       clk[IMX5_CLK_CPU_PODF_SEL]      = imx_clk_mux("cpu_podf_sel", MXC_CCM_CCSR, 2, 1, cpu_podf_sels, ARRAY_SIZE(cpu_podf_sels));
-       clk[IMX5_CLK_CPU_PODF]          = imx_clk_divider("cpu_podf", "cpu_podf_sel", MXC_CCM_CACRR, 0, 3);
-       clk[IMX5_CLK_DI_PRED]           = imx_clk_divider("di_pred", "pll3_sw", MXC_CCM_CDCDR, 6, 3);
-       clk[IMX5_CLK_IIM_GATE]          = imx_clk_gate2("iim_gate", "ipg", MXC_CCM_CCGR0, 30);
-       clk[IMX5_CLK_UART1_IPG_GATE]    = imx_clk_gate2("uart1_ipg_gate", "ipg", MXC_CCM_CCGR1, 6);
-       clk[IMX5_CLK_UART1_PER_GATE]    = imx_clk_gate2("uart1_per_gate", "uart_root", MXC_CCM_CCGR1, 8);
-       clk[IMX5_CLK_UART2_IPG_GATE]    = imx_clk_gate2("uart2_ipg_gate", "ipg", MXC_CCM_CCGR1, 10);
-       clk[IMX5_CLK_UART2_PER_GATE]    = imx_clk_gate2("uart2_per_gate", "uart_root", MXC_CCM_CCGR1, 12);
-       clk[IMX5_CLK_UART3_IPG_GATE]    = imx_clk_gate2("uart3_ipg_gate", "ipg", MXC_CCM_CCGR1, 14);
-       clk[IMX5_CLK_UART3_PER_GATE]    = imx_clk_gate2("uart3_per_gate", "uart_root", MXC_CCM_CCGR1, 16);
-       clk[IMX5_CLK_I2C1_GATE]         = imx_clk_gate2("i2c1_gate", "per_root", MXC_CCM_CCGR1, 18);
-       clk[IMX5_CLK_I2C2_GATE]         = imx_clk_gate2("i2c2_gate", "per_root", MXC_CCM_CCGR1, 20);
-       clk[IMX5_CLK_PWM1_IPG_GATE]     = imx_clk_gate2("pwm1_ipg_gate", "ipg", MXC_CCM_CCGR2, 10);
-       clk[IMX5_CLK_PWM1_HF_GATE]      = imx_clk_gate2("pwm1_hf_gate", "per_root", MXC_CCM_CCGR2, 12);
-       clk[IMX5_CLK_PWM2_IPG_GATE]     = imx_clk_gate2("pwm2_ipg_gate", "ipg", MXC_CCM_CCGR2, 14);
-       clk[IMX5_CLK_PWM2_HF_GATE]      = imx_clk_gate2("pwm2_hf_gate", "per_root", MXC_CCM_CCGR2, 16);
-       clk[IMX5_CLK_GPT_IPG_GATE]      = imx_clk_gate2("gpt_ipg_gate", "ipg", MXC_CCM_CCGR2, 18);
-       clk[IMX5_CLK_GPT_HF_GATE]       = imx_clk_gate2("gpt_hf_gate", "per_root", MXC_CCM_CCGR2, 20);
-       clk[IMX5_CLK_FEC_GATE]          = imx_clk_gate2("fec_gate", "ipg", MXC_CCM_CCGR2, 24);
-       clk[IMX5_CLK_USBOH3_GATE]       = imx_clk_gate2("usboh3_gate", "ipg", MXC_CCM_CCGR2, 26);
-       clk[IMX5_CLK_USBOH3_PER_GATE]   = imx_clk_gate2("usboh3_per_gate", "usboh3_podf", MXC_CCM_CCGR2, 28);
-       clk[IMX5_CLK_ESDHC1_IPG_GATE]   = imx_clk_gate2("esdhc1_ipg_gate", "ipg", MXC_CCM_CCGR3, 0);
-       clk[IMX5_CLK_ESDHC2_IPG_GATE]   = imx_clk_gate2("esdhc2_ipg_gate", "ipg", MXC_CCM_CCGR3, 4);
-       clk[IMX5_CLK_ESDHC3_IPG_GATE]   = imx_clk_gate2("esdhc3_ipg_gate", "ipg", MXC_CCM_CCGR3, 8);
-       clk[IMX5_CLK_ESDHC4_IPG_GATE]   = imx_clk_gate2("esdhc4_ipg_gate", "ipg", MXC_CCM_CCGR3, 12);
-       clk[IMX5_CLK_SSI1_IPG_GATE]     = imx_clk_gate2("ssi1_ipg_gate", "ipg", MXC_CCM_CCGR3, 16);
-       clk[IMX5_CLK_SSI2_IPG_GATE]     = imx_clk_gate2("ssi2_ipg_gate", "ipg", MXC_CCM_CCGR3, 20);
-       clk[IMX5_CLK_SSI3_IPG_GATE]     = imx_clk_gate2("ssi3_ipg_gate", "ipg", MXC_CCM_CCGR3, 24);
-       clk[IMX5_CLK_ECSPI1_IPG_GATE]   = imx_clk_gate2("ecspi1_ipg_gate", "ipg", MXC_CCM_CCGR4, 18);
-       clk[IMX5_CLK_ECSPI1_PER_GATE]   = imx_clk_gate2("ecspi1_per_gate", "ecspi_podf", MXC_CCM_CCGR4, 20);
-       clk[IMX5_CLK_ECSPI2_IPG_GATE]   = imx_clk_gate2("ecspi2_ipg_gate", "ipg", MXC_CCM_CCGR4, 22);
-       clk[IMX5_CLK_ECSPI2_PER_GATE]   = imx_clk_gate2("ecspi2_per_gate", "ecspi_podf", MXC_CCM_CCGR4, 24);
-       clk[IMX5_CLK_CSPI_IPG_GATE]     = imx_clk_gate2("cspi_ipg_gate", "ipg", MXC_CCM_CCGR4, 26);
-       clk[IMX5_CLK_SDMA_GATE]         = imx_clk_gate2("sdma_gate", "ipg", MXC_CCM_CCGR4, 30);
-       clk[IMX5_CLK_EMI_FAST_GATE]     = imx_clk_gate2("emi_fast_gate", "dummy", MXC_CCM_CCGR5, 14);
-       clk[IMX5_CLK_EMI_SLOW_GATE]     = imx_clk_gate2("emi_slow_gate", "emi_slow_podf", MXC_CCM_CCGR5, 16);
-       clk[IMX5_CLK_IPU_SEL]           = imx_clk_mux("ipu_sel", MXC_CCM_CBCMR, 6, 2, ipu_sel, ARRAY_SIZE(ipu_sel));
-       clk[IMX5_CLK_IPU_GATE]          = imx_clk_gate2("ipu_gate", "ipu_sel", MXC_CCM_CCGR5, 10);
-       clk[IMX5_CLK_NFC_GATE]          = imx_clk_gate2("nfc_gate", "nfc_podf", MXC_CCM_CCGR5, 20);
-       clk[IMX5_CLK_IPU_DI0_GATE]      = imx_clk_gate2("ipu_di0_gate", "ipu_di0_sel", MXC_CCM_CCGR6, 10);
-       clk[IMX5_CLK_IPU_DI1_GATE]      = imx_clk_gate2("ipu_di1_gate", "ipu_di1_sel", MXC_CCM_CCGR6, 12);
-       clk[IMX5_CLK_GPU3D_SEL]         = imx_clk_mux("gpu3d_sel", MXC_CCM_CBCMR, 4, 2, gpu3d_sel, ARRAY_SIZE(gpu3d_sel));
-       clk[IMX5_CLK_GPU2D_SEL]         = imx_clk_mux("gpu2d_sel", MXC_CCM_CBCMR, 16, 2, gpu2d_sel, ARRAY_SIZE(gpu2d_sel));
-       clk[IMX5_CLK_GPU3D_GATE]        = imx_clk_gate2("gpu3d_gate", "gpu3d_sel", MXC_CCM_CCGR5, 2);
-       clk[IMX5_CLK_GARB_GATE]         = imx_clk_gate2("garb_gate", "axi_a", MXC_CCM_CCGR5, 4);
-       clk[IMX5_CLK_GPU2D_GATE]        = imx_clk_gate2("gpu2d_gate", "gpu2d_sel", MXC_CCM_CCGR6, 14);
-       clk[IMX5_CLK_VPU_SEL]           = imx_clk_mux("vpu_sel", MXC_CCM_CBCMR, 14, 2, vpu_sel, ARRAY_SIZE(vpu_sel));
-       clk[IMX5_CLK_VPU_GATE]          = imx_clk_gate2("vpu_gate", "vpu_sel", MXC_CCM_CCGR5, 6);
-       clk[IMX5_CLK_VPU_REFERENCE_GATE] = imx_clk_gate2("vpu_reference_gate", "osc", MXC_CCM_CCGR5, 8);
-       clk[IMX5_CLK_UART4_IPG_GATE]    = imx_clk_gate2("uart4_ipg_gate", "ipg", MXC_CCM_CCGR7, 8);
-       clk[IMX5_CLK_UART4_PER_GATE]    = imx_clk_gate2("uart4_per_gate", "uart_root", MXC_CCM_CCGR7, 10);
-       clk[IMX5_CLK_UART5_IPG_GATE]    = imx_clk_gate2("uart5_ipg_gate", "ipg", MXC_CCM_CCGR7, 12);
-       clk[IMX5_CLK_UART5_PER_GATE]    = imx_clk_gate2("uart5_per_gate", "uart_root", MXC_CCM_CCGR7, 14);
-       clk[IMX5_CLK_GPC_DVFS]          = imx_clk_gate2("gpc_dvfs", "dummy", MXC_CCM_CCGR5, 24);
-
-       clk[IMX5_CLK_SSI_APM]           = imx_clk_mux("ssi_apm", MXC_CCM_CSCMR1, 8, 2, ssi_apm_sels, ARRAY_SIZE(ssi_apm_sels));
-       clk[IMX5_CLK_SSI1_ROOT_SEL]     = imx_clk_mux("ssi1_root_sel", MXC_CCM_CSCMR1, 14, 2, ssi_clk_sels, ARRAY_SIZE(ssi_clk_sels));
-       clk[IMX5_CLK_SSI2_ROOT_SEL]     = imx_clk_mux("ssi2_root_sel", MXC_CCM_CSCMR1, 12, 2, ssi_clk_sels, ARRAY_SIZE(ssi_clk_sels));
-       clk[IMX5_CLK_SSI3_ROOT_SEL]     = imx_clk_mux("ssi3_root_sel", MXC_CCM_CSCMR1, 11, 1, ssi3_clk_sels, ARRAY_SIZE(ssi3_clk_sels));
-       clk[IMX5_CLK_SSI_EXT1_SEL]      = imx_clk_mux("ssi_ext1_sel", MXC_CCM_CSCMR1, 28, 2, ssi_clk_sels, ARRAY_SIZE(ssi_clk_sels));
-       clk[IMX5_CLK_SSI_EXT2_SEL]      = imx_clk_mux("ssi_ext2_sel", MXC_CCM_CSCMR1, 30, 2, ssi_clk_sels, ARRAY_SIZE(ssi_clk_sels));
-       clk[IMX5_CLK_SSI_EXT1_COM_SEL]  = imx_clk_mux("ssi_ext1_com_sel", MXC_CCM_CSCMR1, 0, 1, ssi_ext1_com_sels, ARRAY_SIZE(ssi_ext1_com_sels));
-       clk[IMX5_CLK_SSI_EXT2_COM_SEL]  = imx_clk_mux("ssi_ext2_com_sel", MXC_CCM_CSCMR1, 1, 1, ssi_ext2_com_sels, ARRAY_SIZE(ssi_ext2_com_sels));
-       clk[IMX5_CLK_SSI1_ROOT_PRED]    = imx_clk_divider("ssi1_root_pred", "ssi1_root_sel", MXC_CCM_CS1CDR, 6, 3);
-       clk[IMX5_CLK_SSI1_ROOT_PODF]    = imx_clk_divider("ssi1_root_podf", "ssi1_root_pred", MXC_CCM_CS1CDR, 0, 6);
-       clk[IMX5_CLK_SSI2_ROOT_PRED]    = imx_clk_divider("ssi2_root_pred", "ssi2_root_sel", MXC_CCM_CS2CDR, 6, 3);
-       clk[IMX5_CLK_SSI2_ROOT_PODF]    = imx_clk_divider("ssi2_root_podf", "ssi2_root_pred", MXC_CCM_CS2CDR, 0, 6);
-       clk[IMX5_CLK_SSI_EXT1_PRED]     = imx_clk_divider("ssi_ext1_pred", "ssi_ext1_sel", MXC_CCM_CS1CDR, 22, 3);
-       clk[IMX5_CLK_SSI_EXT1_PODF]     = imx_clk_divider("ssi_ext1_podf", "ssi_ext1_pred", MXC_CCM_CS1CDR, 16, 6);
-       clk[IMX5_CLK_SSI_EXT2_PRED]     = imx_clk_divider("ssi_ext2_pred", "ssi_ext2_sel", MXC_CCM_CS2CDR, 22, 3);
-       clk[IMX5_CLK_SSI_EXT2_PODF]     = imx_clk_divider("ssi_ext2_podf", "ssi_ext2_pred", MXC_CCM_CS2CDR, 16, 6);
-       clk[IMX5_CLK_SSI1_ROOT_GATE]    = imx_clk_gate2("ssi1_root_gate", "ssi1_root_podf", MXC_CCM_CCGR3, 18);
-       clk[IMX5_CLK_SSI2_ROOT_GATE]    = imx_clk_gate2("ssi2_root_gate", "ssi2_root_podf", MXC_CCM_CCGR3, 22);
-       clk[IMX5_CLK_SSI3_ROOT_GATE]    = imx_clk_gate2("ssi3_root_gate", "ssi3_root_sel", MXC_CCM_CCGR3, 26);
-       clk[IMX5_CLK_SSI_EXT1_GATE]     = imx_clk_gate2("ssi_ext1_gate", "ssi_ext1_com_sel", MXC_CCM_CCGR3, 28);
-       clk[IMX5_CLK_SSI_EXT2_GATE]     = imx_clk_gate2("ssi_ext2_gate", "ssi_ext2_com_sel", MXC_CCM_CCGR3, 30);
-       clk[IMX5_CLK_EPIT1_IPG_GATE]    = imx_clk_gate2("epit1_ipg_gate", "ipg", MXC_CCM_CCGR2, 2);
-       clk[IMX5_CLK_EPIT1_HF_GATE]     = imx_clk_gate2("epit1_hf_gate", "per_root", MXC_CCM_CCGR2, 4);
-       clk[IMX5_CLK_EPIT2_IPG_GATE]    = imx_clk_gate2("epit2_ipg_gate", "ipg", MXC_CCM_CCGR2, 6);
-       clk[IMX5_CLK_EPIT2_HF_GATE]     = imx_clk_gate2("epit2_hf_gate", "per_root", MXC_CCM_CCGR2, 8);
-       clk[IMX5_CLK_OWIRE_GATE]        = imx_clk_gate2("owire_gate", "per_root", MXC_CCM_CCGR2, 22);
-       clk[IMX5_CLK_SRTC_GATE]         = imx_clk_gate2("srtc_gate", "per_root", MXC_CCM_CCGR4, 28);
-       clk[IMX5_CLK_PATA_GATE]         = imx_clk_gate2("pata_gate", "ipg", MXC_CCM_CCGR4, 0);
-       clk[IMX5_CLK_SPDIF0_SEL]        = imx_clk_mux("spdif0_sel", MXC_CCM_CSCMR2, 0, 2, spdif_sel, ARRAY_SIZE(spdif_sel));
-       clk[IMX5_CLK_SPDIF0_PRED]       = imx_clk_divider("spdif0_pred", "spdif0_sel", MXC_CCM_CDCDR, 25, 3);
-       clk[IMX5_CLK_SPDIF0_PODF]       = imx_clk_divider("spdif0_podf", "spdif0_pred", MXC_CCM_CDCDR, 19, 6);
-       clk[IMX5_CLK_SPDIF0_COM_SEL]    = imx_clk_mux_flags("spdif0_com_sel", MXC_CCM_CSCMR2, 4, 1,
-                                               spdif0_com_sel, ARRAY_SIZE(spdif0_com_sel), CLK_SET_RATE_PARENT);
-       clk[IMX5_CLK_SPDIF0_GATE]       = imx_clk_gate2("spdif0_gate", "spdif0_com_sel", MXC_CCM_CCGR5, 26);
-       clk[IMX5_CLK_SPDIF_IPG_GATE]    = imx_clk_gate2("spdif_ipg_gate", "ipg", MXC_CCM_CCGR5, 30);
-       clk[IMX5_CLK_SAHARA_IPG_GATE]   = imx_clk_gate2("sahara_ipg_gate", "ipg", MXC_CCM_CCGR4, 14);
-       clk[IMX5_CLK_SATA_REF]          = imx_clk_fixed_factor("sata_ref", "usb_phy1_gate", 1, 1);
-
-       clk_register_clkdev(clk[IMX5_CLK_CPU_PODF], NULL, "cpu0");
-       clk_register_clkdev(clk[IMX5_CLK_GPC_DVFS], "gpc_dvfs", NULL);
-
-       /* Set SDHC parents to be PLL2 */
-       clk_set_parent(clk[IMX5_CLK_ESDHC_A_SEL], clk[IMX5_CLK_PLL2_SW]);
-       clk_set_parent(clk[IMX5_CLK_ESDHC_B_SEL], clk[IMX5_CLK_PLL2_SW]);
-
-       /* move usb phy clk to 24MHz */
-       clk_set_parent(clk[IMX5_CLK_USB_PHY_SEL], clk[IMX5_CLK_OSC]);
-
-       clk_prepare_enable(clk[IMX5_CLK_GPC_DVFS]);
-       clk_prepare_enable(clk[IMX5_CLK_AHB_MAX]); /* esdhc3 */
-       clk_prepare_enable(clk[IMX5_CLK_AIPS_TZ1]);
-       clk_prepare_enable(clk[IMX5_CLK_AIPS_TZ2]); /* fec */
-       clk_prepare_enable(clk[IMX5_CLK_SPBA]);
-       clk_prepare_enable(clk[IMX5_CLK_EMI_FAST_GATE]); /* fec */
-       clk_prepare_enable(clk[IMX5_CLK_EMI_SLOW_GATE]); /* eim */
-       clk_prepare_enable(clk[IMX5_CLK_MIPI_HSC1_GATE]);
-       clk_prepare_enable(clk[IMX5_CLK_MIPI_HSC2_GATE]);
-       clk_prepare_enable(clk[IMX5_CLK_MIPI_ESC_GATE]);
-       clk_prepare_enable(clk[IMX5_CLK_MIPI_HSP_GATE]);
-       clk_prepare_enable(clk[IMX5_CLK_TMAX1]);
-       clk_prepare_enable(clk[IMX5_CLK_TMAX2]); /* esdhc2, fec */
-       clk_prepare_enable(clk[IMX5_CLK_TMAX3]); /* esdhc1, esdhc4 */
-}
-
-static void __init mx50_clocks_init(struct device_node *np)
-{
-       void __iomem *ccm_base;
-       void __iomem *pll_base;
-       unsigned long r;
-
-       pll_base = ioremap(MX53_DPLL1_BASE, SZ_16K);
-       WARN_ON(!pll_base);
-       clk[IMX5_CLK_PLL1_SW]           = imx_clk_pllv2("pll1_sw", "osc", pll_base);
-
-       pll_base = ioremap(MX53_DPLL2_BASE, SZ_16K);
-       WARN_ON(!pll_base);
-       clk[IMX5_CLK_PLL2_SW]           = imx_clk_pllv2("pll2_sw", "osc", pll_base);
-
-       pll_base = ioremap(MX53_DPLL3_BASE, SZ_16K);
-       WARN_ON(!pll_base);
-       clk[IMX5_CLK_PLL3_SW]           = imx_clk_pllv2("pll3_sw", "osc", pll_base);
-
-       ccm_base = of_iomap(np, 0);
-       WARN_ON(!ccm_base);
-
-       mx5_clocks_common_init(ccm_base);
-
-       clk[IMX5_CLK_LP_APM]            = imx_clk_mux("lp_apm", MXC_CCM_CCSR, 10, 1,
-                                               lp_apm_sel, ARRAY_SIZE(lp_apm_sel));
-       clk[IMX5_CLK_ESDHC1_PER_GATE]   = imx_clk_gate2("esdhc1_per_gate", "esdhc_a_podf", MXC_CCM_CCGR3, 2);
-       clk[IMX5_CLK_ESDHC2_PER_GATE]   = imx_clk_gate2("esdhc2_per_gate", "esdhc_c_sel", MXC_CCM_CCGR3, 6);
-       clk[IMX5_CLK_ESDHC3_PER_GATE]   = imx_clk_gate2("esdhc3_per_gate", "esdhc_b_podf", MXC_CCM_CCGR3, 10);
-       clk[IMX5_CLK_ESDHC4_PER_GATE]   = imx_clk_gate2("esdhc4_per_gate", "esdhc_d_sel", MXC_CCM_CCGR3, 14);
-       clk[IMX5_CLK_USB_PHY1_GATE]     = imx_clk_gate2("usb_phy1_gate", "usb_phy_sel", MXC_CCM_CCGR4, 10);
-       clk[IMX5_CLK_USB_PHY2_GATE]     = imx_clk_gate2("usb_phy2_gate", "usb_phy_sel", MXC_CCM_CCGR4, 12);
-       clk[IMX5_CLK_I2C3_GATE]         = imx_clk_gate2("i2c3_gate", "per_root", MXC_CCM_CCGR1, 22);
-
-       clk[IMX5_CLK_CKO1_SEL]          = imx_clk_mux("cko1_sel", MXC_CCM_CCOSR, 0, 4,
-                                               mx53_cko1_sel, ARRAY_SIZE(mx53_cko1_sel));
-       clk[IMX5_CLK_CKO1_PODF]         = imx_clk_divider("cko1_podf", "cko1_sel", MXC_CCM_CCOSR, 4, 3);
-       clk[IMX5_CLK_CKO1]              = imx_clk_gate2("cko1", "cko1_podf", MXC_CCM_CCOSR, 7);
-
-       clk[IMX5_CLK_CKO2_SEL]          = imx_clk_mux("cko2_sel", MXC_CCM_CCOSR, 16, 5,
-                                               mx53_cko2_sel, ARRAY_SIZE(mx53_cko2_sel));
-       clk[IMX5_CLK_CKO2_PODF]         = imx_clk_divider("cko2_podf", "cko2_sel", MXC_CCM_CCOSR, 21, 3);
-       clk[IMX5_CLK_CKO2]              = imx_clk_gate2("cko2", "cko2_podf", MXC_CCM_CCOSR, 24);
-
-       imx_check_clocks(clk, ARRAY_SIZE(clk));
-
-       clk_data.clks = clk;
-       clk_data.clk_num = ARRAY_SIZE(clk);
-       of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
-
-       /* set SDHC root clock to 200MHZ*/
-       clk_set_rate(clk[IMX5_CLK_ESDHC_A_PODF], 200000000);
-       clk_set_rate(clk[IMX5_CLK_ESDHC_B_PODF], 200000000);
-
-       clk_prepare_enable(clk[IMX5_CLK_IIM_GATE]);
-       imx_print_silicon_rev("i.MX50", IMX_CHIP_REVISION_1_1);
-       clk_disable_unprepare(clk[IMX5_CLK_IIM_GATE]);
-
-       r = clk_round_rate(clk[IMX5_CLK_USBOH3_PER_GATE], 54000000);
-       clk_set_rate(clk[IMX5_CLK_USBOH3_PER_GATE], r);
-}
-CLK_OF_DECLARE(imx50_ccm, "fsl,imx50-ccm", mx50_clocks_init);
-
-static void __init mx51_clocks_init(struct device_node *np)
-{
-       void __iomem *ccm_base;
-       void __iomem *pll_base;
-       u32 val;
-
-       pll_base = ioremap(MX51_DPLL1_BASE, SZ_16K);
-       WARN_ON(!pll_base);
-       clk[IMX5_CLK_PLL1_SW]           = imx_clk_pllv2("pll1_sw", "osc", pll_base);
-
-       pll_base = ioremap(MX51_DPLL2_BASE, SZ_16K);
-       WARN_ON(!pll_base);
-       clk[IMX5_CLK_PLL2_SW]           = imx_clk_pllv2("pll2_sw", "osc", pll_base);
-
-       pll_base = ioremap(MX51_DPLL3_BASE, SZ_16K);
-       WARN_ON(!pll_base);
-       clk[IMX5_CLK_PLL3_SW]           = imx_clk_pllv2("pll3_sw", "osc", pll_base);
-
-       ccm_base = of_iomap(np, 0);
-       WARN_ON(!ccm_base);
-
-       mx5_clocks_common_init(ccm_base);
-
-       clk[IMX5_CLK_LP_APM]            = imx_clk_mux("lp_apm", MXC_CCM_CCSR, 9, 1,
-                                               lp_apm_sel, ARRAY_SIZE(lp_apm_sel));
-       clk[IMX5_CLK_IPU_DI0_SEL]       = imx_clk_mux("ipu_di0_sel", MXC_CCM_CSCMR2, 26, 3,
-                                               mx51_ipu_di0_sel, ARRAY_SIZE(mx51_ipu_di0_sel));
-       clk[IMX5_CLK_IPU_DI1_SEL]       = imx_clk_mux("ipu_di1_sel", MXC_CCM_CSCMR2, 29, 3,
-                                               mx51_ipu_di1_sel, ARRAY_SIZE(mx51_ipu_di1_sel));
-       clk[IMX5_CLK_TVE_EXT_SEL]       = imx_clk_mux_flags("tve_ext_sel", MXC_CCM_CSCMR1, 6, 1,
-                                               mx51_tve_ext_sel, ARRAY_SIZE(mx51_tve_ext_sel), CLK_SET_RATE_PARENT);
-       clk[IMX5_CLK_TVE_SEL]           = imx_clk_mux("tve_sel", MXC_CCM_CSCMR1, 7, 1,
-                                               mx51_tve_sel, ARRAY_SIZE(mx51_tve_sel));
-       clk[IMX5_CLK_TVE_GATE]          = imx_clk_gate2("tve_gate", "tve_sel", MXC_CCM_CCGR2, 30);
-       clk[IMX5_CLK_TVE_PRED]          = imx_clk_divider("tve_pred", "pll3_sw", MXC_CCM_CDCDR, 28, 3);
-       clk[IMX5_CLK_ESDHC1_PER_GATE]   = imx_clk_gate2("esdhc1_per_gate", "esdhc_a_podf", MXC_CCM_CCGR3, 2);
-       clk[IMX5_CLK_ESDHC2_PER_GATE]   = imx_clk_gate2("esdhc2_per_gate", "esdhc_b_podf", MXC_CCM_CCGR3, 6);
-       clk[IMX5_CLK_ESDHC3_PER_GATE]   = imx_clk_gate2("esdhc3_per_gate", "esdhc_c_sel", MXC_CCM_CCGR3, 10);
-       clk[IMX5_CLK_ESDHC4_PER_GATE]   = imx_clk_gate2("esdhc4_per_gate", "esdhc_d_sel", MXC_CCM_CCGR3, 14);
-       clk[IMX5_CLK_USB_PHY_GATE]      = imx_clk_gate2("usb_phy_gate", "usb_phy_sel", MXC_CCM_CCGR2, 0);
-       clk[IMX5_CLK_HSI2C_GATE]        = imx_clk_gate2("hsi2c_gate", "ipg", MXC_CCM_CCGR1, 22);
-       clk[IMX5_CLK_MIPI_HSC1_GATE]    = imx_clk_gate2("mipi_hsc1_gate", "ipg", MXC_CCM_CCGR4, 6);
-       clk[IMX5_CLK_MIPI_HSC2_GATE]    = imx_clk_gate2("mipi_hsc2_gate", "ipg", MXC_CCM_CCGR4, 8);
-       clk[IMX5_CLK_MIPI_ESC_GATE]     = imx_clk_gate2("mipi_esc_gate", "ipg", MXC_CCM_CCGR4, 10);
-       clk[IMX5_CLK_MIPI_HSP_GATE]     = imx_clk_gate2("mipi_hsp_gate", "ipg", MXC_CCM_CCGR4, 12);
-       clk[IMX5_CLK_SPDIF_XTAL_SEL]    = imx_clk_mux("spdif_xtal_sel", MXC_CCM_CSCMR1, 2, 2,
-                                               mx51_spdif_xtal_sel, ARRAY_SIZE(mx51_spdif_xtal_sel));
-       clk[IMX5_CLK_SPDIF1_SEL]        = imx_clk_mux("spdif1_sel", MXC_CCM_CSCMR2, 2, 2,
-                                               spdif_sel, ARRAY_SIZE(spdif_sel));
-       clk[IMX5_CLK_SPDIF1_PRED]       = imx_clk_divider("spdif1_pred", "spdif1_sel", MXC_CCM_CDCDR, 16, 3);
-       clk[IMX5_CLK_SPDIF1_PODF]       = imx_clk_divider("spdif1_podf", "spdif1_pred", MXC_CCM_CDCDR, 9, 6);
-       clk[IMX5_CLK_SPDIF1_COM_SEL]    = imx_clk_mux("spdif1_com_sel", MXC_CCM_CSCMR2, 5, 1,
-                                               mx51_spdif1_com_sel, ARRAY_SIZE(mx51_spdif1_com_sel));
-       clk[IMX5_CLK_SPDIF1_GATE]       = imx_clk_gate2("spdif1_gate", "spdif1_com_sel", MXC_CCM_CCGR5, 28);
-
-       imx_check_clocks(clk, ARRAY_SIZE(clk));
-
-       clk_data.clks = clk;
-       clk_data.clk_num = ARRAY_SIZE(clk);
-       of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
-
-       /* set the usboh3 parent to pll2_sw */
-       clk_set_parent(clk[IMX5_CLK_USBOH3_SEL], clk[IMX5_CLK_PLL2_SW]);
-
-       /* set SDHC root clock to 166.25MHZ*/
-       clk_set_rate(clk[IMX5_CLK_ESDHC_A_PODF], 166250000);
-       clk_set_rate(clk[IMX5_CLK_ESDHC_B_PODF], 166250000);
-
-       clk_prepare_enable(clk[IMX5_CLK_IIM_GATE]);
-       imx_print_silicon_rev("i.MX51", mx51_revision());
-       clk_disable_unprepare(clk[IMX5_CLK_IIM_GATE]);
-
-       /*
-        * Reference Manual says: Functionality of CCDR[18] and CLPCR[23] is no
-        * longer supported. Set to one for better power saving.
-        *
-        * The effect of not setting these bits is that MIPI clocks can't be
-        * enabled without the IPU clock being enabled aswell.
-        */
-       val = readl(MXC_CCM_CCDR);
-       val |= 1 << 18;
-       writel(val, MXC_CCM_CCDR);
-
-       val = readl(MXC_CCM_CLPCR);
-       val |= 1 << 23;
-       writel(val, MXC_CCM_CLPCR);
-}
-CLK_OF_DECLARE(imx51_ccm, "fsl,imx51-ccm", mx51_clocks_init);
-
-static void __init mx53_clocks_init(struct device_node *np)
-{
-       void __iomem *ccm_base;
-       void __iomem *pll_base;
-       unsigned long r;
-
-       pll_base = ioremap(MX53_DPLL1_BASE, SZ_16K);
-       WARN_ON(!pll_base);
-       clk[IMX5_CLK_PLL1_SW]           = imx_clk_pllv2("pll1_sw", "osc", pll_base);
-
-       pll_base = ioremap(MX53_DPLL2_BASE, SZ_16K);
-       WARN_ON(!pll_base);
-       clk[IMX5_CLK_PLL2_SW]           = imx_clk_pllv2("pll2_sw", "osc", pll_base);
-
-       pll_base = ioremap(MX53_DPLL3_BASE, SZ_16K);
-       WARN_ON(!pll_base);
-       clk[IMX5_CLK_PLL3_SW]           = imx_clk_pllv2("pll3_sw", "osc", pll_base);
-
-       pll_base = ioremap(MX53_DPLL4_BASE, SZ_16K);
-       WARN_ON(!pll_base);
-       clk[IMX5_CLK_PLL4_SW]           = imx_clk_pllv2("pll4_sw", "osc", pll_base);
-
-       ccm_base = of_iomap(np, 0);
-       WARN_ON(!ccm_base);
-
-       mx5_clocks_common_init(ccm_base);
-
-       clk[IMX5_CLK_LP_APM]            = imx_clk_mux("lp_apm", MXC_CCM_CCSR, 10, 1,
-                                               lp_apm_sel, ARRAY_SIZE(lp_apm_sel));
-       clk[IMX5_CLK_LDB_DI1_DIV_3_5]   = imx_clk_fixed_factor("ldb_di1_div_3_5", "ldb_di1_sel", 2, 7);
-       clk[IMX5_CLK_LDB_DI1_DIV]       = imx_clk_divider_flags("ldb_di1_div", "ldb_di1_div_3_5", MXC_CCM_CSCMR2, 11, 1, 0);
-       clk[IMX5_CLK_LDB_DI1_SEL]       = imx_clk_mux_flags("ldb_di1_sel", MXC_CCM_CSCMR2, 9, 1,
-                                               mx53_ldb_di1_sel, ARRAY_SIZE(mx53_ldb_di1_sel), CLK_SET_RATE_PARENT);
-       clk[IMX5_CLK_DI_PLL4_PODF]      = imx_clk_divider("di_pll4_podf", "pll4_sw", MXC_CCM_CDCDR, 16, 3);
-       clk[IMX5_CLK_LDB_DI0_DIV_3_5]   = imx_clk_fixed_factor("ldb_di0_div_3_5", "ldb_di0_sel", 2, 7);
-       clk[IMX5_CLK_LDB_DI0_DIV]       = imx_clk_divider_flags("ldb_di0_div", "ldb_di0_div_3_5", MXC_CCM_CSCMR2, 10, 1, 0);
-       clk[IMX5_CLK_LDB_DI0_SEL]       = imx_clk_mux_flags("ldb_di0_sel", MXC_CCM_CSCMR2, 8, 1,
-                                               mx53_ldb_di0_sel, ARRAY_SIZE(mx53_ldb_di0_sel), CLK_SET_RATE_PARENT);
-       clk[IMX5_CLK_LDB_DI0_GATE]      = imx_clk_gate2("ldb_di0_gate", "ldb_di0_div", MXC_CCM_CCGR6, 28);
-       clk[IMX5_CLK_LDB_DI1_GATE]      = imx_clk_gate2("ldb_di1_gate", "ldb_di1_div", MXC_CCM_CCGR6, 30);
-       clk[IMX5_CLK_IPU_DI0_SEL]       = imx_clk_mux("ipu_di0_sel", MXC_CCM_CSCMR2, 26, 3,
-                                               mx53_ipu_di0_sel, ARRAY_SIZE(mx53_ipu_di0_sel));
-       clk[IMX5_CLK_IPU_DI1_SEL]       = imx_clk_mux("ipu_di1_sel", MXC_CCM_CSCMR2, 29, 3,
-                                               mx53_ipu_di1_sel, ARRAY_SIZE(mx53_ipu_di1_sel));
-       clk[IMX5_CLK_TVE_EXT_SEL]       = imx_clk_mux_flags("tve_ext_sel", MXC_CCM_CSCMR1, 6, 1,
-                                               mx53_tve_ext_sel, ARRAY_SIZE(mx53_tve_ext_sel), CLK_SET_RATE_PARENT);
-       clk[IMX5_CLK_TVE_GATE]          = imx_clk_gate2("tve_gate", "tve_pred", MXC_CCM_CCGR2, 30);
-       clk[IMX5_CLK_TVE_PRED]          = imx_clk_divider("tve_pred", "tve_ext_sel", MXC_CCM_CDCDR, 28, 3);
-       clk[IMX5_CLK_ESDHC1_PER_GATE]   = imx_clk_gate2("esdhc1_per_gate", "esdhc_a_podf", MXC_CCM_CCGR3, 2);
-       clk[IMX5_CLK_ESDHC2_PER_GATE]   = imx_clk_gate2("esdhc2_per_gate", "esdhc_c_sel", MXC_CCM_CCGR3, 6);
-       clk[IMX5_CLK_ESDHC3_PER_GATE]   = imx_clk_gate2("esdhc3_per_gate", "esdhc_b_podf", MXC_CCM_CCGR3, 10);
-       clk[IMX5_CLK_ESDHC4_PER_GATE]   = imx_clk_gate2("esdhc4_per_gate", "esdhc_d_sel", MXC_CCM_CCGR3, 14);
-       clk[IMX5_CLK_USB_PHY1_GATE]     = imx_clk_gate2("usb_phy1_gate", "usb_phy_sel", MXC_CCM_CCGR4, 10);
-       clk[IMX5_CLK_USB_PHY2_GATE]     = imx_clk_gate2("usb_phy2_gate", "usb_phy_sel", MXC_CCM_CCGR4, 12);
-       clk[IMX5_CLK_CAN_SEL]           = imx_clk_mux("can_sel", MXC_CCM_CSCMR2, 6, 2,
-                                               mx53_can_sel, ARRAY_SIZE(mx53_can_sel));
-       clk[IMX5_CLK_CAN1_SERIAL_GATE]  = imx_clk_gate2("can1_serial_gate", "can_sel", MXC_CCM_CCGR6, 22);
-       clk[IMX5_CLK_CAN1_IPG_GATE]     = imx_clk_gate2("can1_ipg_gate", "ipg", MXC_CCM_CCGR6, 20);
-       clk[IMX5_CLK_OCRAM]             = imx_clk_gate2("ocram", "ahb", MXC_CCM_CCGR6, 2);
-       clk[IMX5_CLK_CAN2_SERIAL_GATE]  = imx_clk_gate2("can2_serial_gate", "can_sel", MXC_CCM_CCGR4, 8);
-       clk[IMX5_CLK_CAN2_IPG_GATE]     = imx_clk_gate2("can2_ipg_gate", "ipg", MXC_CCM_CCGR4, 6);
-       clk[IMX5_CLK_I2C3_GATE]         = imx_clk_gate2("i2c3_gate", "per_root", MXC_CCM_CCGR1, 22);
-       clk[IMX5_CLK_SATA_GATE]         = imx_clk_gate2("sata_gate", "ipg", MXC_CCM_CCGR4, 2);
-
-       clk[IMX5_CLK_CKO1_SEL]          = imx_clk_mux("cko1_sel", MXC_CCM_CCOSR, 0, 4,
-                                               mx53_cko1_sel, ARRAY_SIZE(mx53_cko1_sel));
-       clk[IMX5_CLK_CKO1_PODF]         = imx_clk_divider("cko1_podf", "cko1_sel", MXC_CCM_CCOSR, 4, 3);
-       clk[IMX5_CLK_CKO1]              = imx_clk_gate2("cko1", "cko1_podf", MXC_CCM_CCOSR, 7);
-
-       clk[IMX5_CLK_CKO2_SEL]          = imx_clk_mux("cko2_sel", MXC_CCM_CCOSR, 16, 5,
-                                               mx53_cko2_sel, ARRAY_SIZE(mx53_cko2_sel));
-       clk[IMX5_CLK_CKO2_PODF]         = imx_clk_divider("cko2_podf", "cko2_sel", MXC_CCM_CCOSR, 21, 3);
-       clk[IMX5_CLK_CKO2]              = imx_clk_gate2("cko2", "cko2_podf", MXC_CCM_CCOSR, 24);
-       clk[IMX5_CLK_SPDIF_XTAL_SEL]    = imx_clk_mux("spdif_xtal_sel", MXC_CCM_CSCMR1, 2, 2,
-                                               mx53_spdif_xtal_sel, ARRAY_SIZE(mx53_spdif_xtal_sel));
-       clk[IMX5_CLK_ARM]               = imx_clk_cpu("arm", "cpu_podf",
-                                               clk[IMX5_CLK_CPU_PODF],
-                                               clk[IMX5_CLK_CPU_PODF_SEL],
-                                               clk[IMX5_CLK_PLL1_SW],
-                                               clk[IMX5_CLK_STEP_SEL]);
-
-       imx_check_clocks(clk, ARRAY_SIZE(clk));
-
-       clk_data.clks = clk;
-       clk_data.clk_num = ARRAY_SIZE(clk);
-       of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
-
-       /* set SDHC root clock to 200MHZ*/
-       clk_set_rate(clk[IMX5_CLK_ESDHC_A_PODF], 200000000);
-       clk_set_rate(clk[IMX5_CLK_ESDHC_B_PODF], 200000000);
-
-       /* move can bus clk to 24MHz */
-       clk_set_parent(clk[IMX5_CLK_CAN_SEL], clk[IMX5_CLK_LP_APM]);
-
-       /* make sure step clock is running from 24MHz */
-       clk_set_parent(clk[IMX5_CLK_STEP_SEL], clk[IMX5_CLK_LP_APM]);
-
-       clk_prepare_enable(clk[IMX5_CLK_IIM_GATE]);
-       imx_print_silicon_rev("i.MX53", mx53_revision());
-       clk_disable_unprepare(clk[IMX5_CLK_IIM_GATE]);
-
-       r = clk_round_rate(clk[IMX5_CLK_USBOH3_PER_GATE], 54000000);
-       clk_set_rate(clk[IMX5_CLK_USBOH3_PER_GATE], r);
-}
-CLK_OF_DECLARE(imx53_ccm, "fsl,imx53-ccm", mx53_clocks_init);
diff --git a/arch/arm/mach-imx/clk-imx6q.c b/arch/arm/mach-imx/clk-imx6q.c
deleted file mode 100644 (file)
index 469a150..0000000
+++ /dev/null
@@ -1,534 +0,0 @@
-/*
- * Copyright 2011-2013 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:
- *
- * http://www.opensource.org/licenses/gpl-license.html
- * http://www.gnu.org/copyleft/gpl.html
- */
-
-#include <linux/init.h>
-#include <linux/types.h>
-#include <linux/clk.h>
-#include <linux/clkdev.h>
-#include <linux/err.h>
-#include <linux/io.h>
-#include <linux/of.h>
-#include <linux/of_address.h>
-#include <linux/of_irq.h>
-#include <dt-bindings/clock/imx6qdl-clock.h>
-
-#include "clk.h"
-#include "common.h"
-#include "hardware.h"
-
-static const char *step_sels[] = { "osc", "pll2_pfd2_396m", };
-static const char *pll1_sw_sels[]      = { "pll1_sys", "step", };
-static const char *periph_pre_sels[]   = { "pll2_bus", "pll2_pfd2_396m", "pll2_pfd0_352m", "pll2_198m", };
-static const char *periph_clk2_sels[]  = { "pll3_usb_otg", "osc", "osc", "dummy", };
-static const char *periph2_clk2_sels[] = { "pll3_usb_otg", "pll2_bus", };
-static const char *periph_sels[]       = { "periph_pre", "periph_clk2", };
-static const char *periph2_sels[]      = { "periph2_pre", "periph2_clk2", };
-static const char *axi_sels[]          = { "periph", "pll2_pfd2_396m", "periph", "pll3_pfd1_540m", };
-static const char *audio_sels[]        = { "pll4_audio_div", "pll3_pfd2_508m", "pll3_pfd3_454m", "pll3_usb_otg", };
-static const char *gpu_axi_sels[]      = { "axi", "ahb", };
-static const char *gpu2d_core_sels[]   = { "axi", "pll3_usb_otg", "pll2_pfd0_352m", "pll2_pfd2_396m", };
-static const char *gpu3d_core_sels[]   = { "mmdc_ch0_axi", "pll3_usb_otg", "pll2_pfd1_594m", "pll2_pfd2_396m", };
-static const char *gpu3d_shader_sels[] = { "mmdc_ch0_axi", "pll3_usb_otg", "pll2_pfd1_594m", "pll3_pfd0_720m", };
-static const char *ipu_sels[]          = { "mmdc_ch0_axi", "pll2_pfd2_396m", "pll3_120m", "pll3_pfd1_540m", };
-static const char *ldb_di_sels[]       = { "pll5_video_div", "pll2_pfd0_352m", "pll2_pfd2_396m", "mmdc_ch1_axi", "pll3_usb_otg", };
-static const char *ipu_di_pre_sels[]   = { "mmdc_ch0_axi", "pll3_usb_otg", "pll5_video_div", "pll2_pfd0_352m", "pll2_pfd2_396m", "pll3_pfd1_540m", };
-static const char *ipu1_di0_sels[]     = { "ipu1_di0_pre", "dummy", "dummy", "ldb_di0", "ldb_di1", };
-static const char *ipu1_di1_sels[]     = { "ipu1_di1_pre", "dummy", "dummy", "ldb_di0", "ldb_di1", };
-static const char *ipu2_di0_sels[]     = { "ipu2_di0_pre", "dummy", "dummy", "ldb_di0", "ldb_di1", };
-static const char *ipu2_di1_sels[]     = { "ipu2_di1_pre", "dummy", "dummy", "ldb_di0", "ldb_di1", };
-static const char *hsi_tx_sels[]       = { "pll3_120m", "pll2_pfd2_396m", };
-static const char *pcie_axi_sels[]     = { "axi", "ahb", };
-static const char *ssi_sels[]          = { "pll3_pfd2_508m", "pll3_pfd3_454m", "pll4_audio_div", };
-static const char *usdhc_sels[]        = { "pll2_pfd2_396m", "pll2_pfd0_352m", };
-static const char *enfc_sels[] = { "pll2_pfd0_352m", "pll2_bus", "pll3_usb_otg", "pll2_pfd2_396m", };
-static const char *eim_sels[]          = { "pll2_pfd2_396m", "pll3_usb_otg", "axi", "pll2_pfd0_352m", };
-static const char *eim_slow_sels[]      = { "axi", "pll3_usb_otg", "pll2_pfd2_396m", "pll2_pfd0_352m", };
-static const char *vdo_axi_sels[]      = { "axi", "ahb", };
-static const char *vpu_axi_sels[]      = { "axi", "pll2_pfd2_396m", "pll2_pfd0_352m", };
-static const char *cko1_sels[] = { "pll3_usb_otg", "pll2_bus", "pll1_sys", "pll5_video_div",
-                                   "dummy", "axi", "enfc", "ipu1_di0", "ipu1_di1", "ipu2_di0",
-                                   "ipu2_di1", "ahb", "ipg", "ipg_per", "ckil", "pll4_audio_div", };
-static const char *cko2_sels[] = {
-       "mmdc_ch0_axi", "mmdc_ch1_axi", "usdhc4", "usdhc1",
-       "gpu2d_axi", "dummy", "ecspi_root", "gpu3d_axi",
-       "usdhc3", "dummy", "arm", "ipu1",
-       "ipu2", "vdo_axi", "osc", "gpu2d_core",
-       "gpu3d_core", "usdhc2", "ssi1", "ssi2",
-       "ssi3", "gpu3d_shader", "vpu_axi", "can_root",
-       "ldb_di0", "ldb_di1", "esai_extal", "eim_slow",
-       "uart_serial", "spdif", "asrc", "hsi_tx",
-};
-static const char *cko_sels[] = { "cko1", "cko2", };
-static const char *lvds_sels[] = {
-       "dummy", "dummy", "dummy", "dummy", "dummy", "dummy",
-       "pll4_audio", "pll5_video", "pll8_mlb", "enet_ref",
-       "pcie_ref_125m", "sata_ref_100m",
-};
-static const char *pll_bypass_src_sels[] = { "osc", "lvds1_in", "lvds2_in", "dummy", };
-static const char *pll1_bypass_sels[] = { "pll1", "pll1_bypass_src", };
-static const char *pll2_bypass_sels[] = { "pll2", "pll2_bypass_src", };
-static const char *pll3_bypass_sels[] = { "pll3", "pll3_bypass_src", };
-static const char *pll4_bypass_sels[] = { "pll4", "pll4_bypass_src", };
-static const char *pll5_bypass_sels[] = { "pll5", "pll5_bypass_src", };
-static const char *pll6_bypass_sels[] = { "pll6", "pll6_bypass_src", };
-static const char *pll7_bypass_sels[] = { "pll7", "pll7_bypass_src", };
-
-static struct clk *clk[IMX6QDL_CLK_END];
-static struct clk_onecell_data clk_data;
-
-static unsigned int const clks_init_on[] __initconst = {
-       IMX6QDL_CLK_MMDC_CH0_AXI,
-       IMX6QDL_CLK_ROM,
-       IMX6QDL_CLK_ARM,
-};
-
-static struct clk_div_table clk_enet_ref_table[] = {
-       { .val = 0, .div = 20, },
-       { .val = 1, .div = 10, },
-       { .val = 2, .div = 5, },
-       { .val = 3, .div = 4, },
-       { /* sentinel */ }
-};
-
-static struct clk_div_table post_div_table[] = {
-       { .val = 2, .div = 1, },
-       { .val = 1, .div = 2, },
-       { .val = 0, .div = 4, },
-       { /* sentinel */ }
-};
-
-static struct clk_div_table video_div_table[] = {
-       { .val = 0, .div = 1, },
-       { .val = 1, .div = 2, },
-       { .val = 2, .div = 1, },
-       { .val = 3, .div = 4, },
-       { /* sentinel */ }
-};
-
-static unsigned int share_count_esai;
-static unsigned int share_count_asrc;
-static unsigned int share_count_ssi1;
-static unsigned int share_count_ssi2;
-static unsigned int share_count_ssi3;
-static unsigned int share_count_mipi_core_cfg;
-
-static void __init imx6q_clocks_init(struct device_node *ccm_node)
-{
-       struct device_node *np;
-       void __iomem *base;
-       int i;
-       int ret;
-
-       clk[IMX6QDL_CLK_DUMMY] = imx_clk_fixed("dummy", 0);
-       clk[IMX6QDL_CLK_CKIL] = imx_obtain_fixed_clock("ckil", 0);
-       clk[IMX6QDL_CLK_CKIH] = imx_obtain_fixed_clock("ckih1", 0);
-       clk[IMX6QDL_CLK_OSC] = imx_obtain_fixed_clock("osc", 0);
-       /* Clock source from external clock via CLK1/2 PADs */
-       clk[IMX6QDL_CLK_ANACLK1] = imx_obtain_fixed_clock("anaclk1", 0);
-       clk[IMX6QDL_CLK_ANACLK2] = imx_obtain_fixed_clock("anaclk2", 0);
-
-       np = of_find_compatible_node(NULL, NULL, "fsl,imx6q-anatop");
-       base = of_iomap(np, 0);
-       WARN_ON(!base);
-
-       /* Audio/video PLL post dividers do not work on i.MX6q revision 1.0 */
-       if (cpu_is_imx6q() && imx_get_soc_revision() == IMX_CHIP_REVISION_1_0) {
-               post_div_table[1].div = 1;
-               post_div_table[2].div = 1;
-               video_div_table[1].div = 1;
-               video_div_table[3].div = 1;
-       }
-
-       clk[IMX6QDL_PLL1_BYPASS_SRC] = imx_clk_mux("pll1_bypass_src", base + 0x00, 14, 2, pll_bypass_src_sels, ARRAY_SIZE(pll_bypass_src_sels));
-       clk[IMX6QDL_PLL2_BYPASS_SRC] = imx_clk_mux("pll2_bypass_src", base + 0x30, 14, 2, pll_bypass_src_sels, ARRAY_SIZE(pll_bypass_src_sels));
-       clk[IMX6QDL_PLL3_BYPASS_SRC] = imx_clk_mux("pll3_bypass_src", base + 0x10, 14, 2, pll_bypass_src_sels, ARRAY_SIZE(pll_bypass_src_sels));
-       clk[IMX6QDL_PLL4_BYPASS_SRC] = imx_clk_mux("pll4_bypass_src", base + 0x70, 14, 2, pll_bypass_src_sels, ARRAY_SIZE(pll_bypass_src_sels));
-       clk[IMX6QDL_PLL5_BYPASS_SRC] = imx_clk_mux("pll5_bypass_src", base + 0xa0, 14, 2, pll_bypass_src_sels, ARRAY_SIZE(pll_bypass_src_sels));
-       clk[IMX6QDL_PLL6_BYPASS_SRC] = imx_clk_mux("pll6_bypass_src", base + 0xe0, 14, 2, pll_bypass_src_sels, ARRAY_SIZE(pll_bypass_src_sels));
-       clk[IMX6QDL_PLL7_BYPASS_SRC] = imx_clk_mux("pll7_bypass_src", base + 0x20, 14, 2, pll_bypass_src_sels, ARRAY_SIZE(pll_bypass_src_sels));
-
-       /*                                    type               name    parent_name        base         div_mask */
-       clk[IMX6QDL_CLK_PLL1] = imx_clk_pllv3(IMX_PLLV3_SYS,     "pll1", "pll1_bypass_src", base + 0x00, 0x7f);
-       clk[IMX6QDL_CLK_PLL2] = imx_clk_pllv3(IMX_PLLV3_GENERIC, "pll2", "pll2_bypass_src", base + 0x30, 0x1);
-       clk[IMX6QDL_CLK_PLL3] = imx_clk_pllv3(IMX_PLLV3_USB,     "pll3", "pll3_bypass_src", base + 0x10, 0x3);
-       clk[IMX6QDL_CLK_PLL4] = imx_clk_pllv3(IMX_PLLV3_AV,      "pll4", "pll4_bypass_src", base + 0x70, 0x7f);
-       clk[IMX6QDL_CLK_PLL5] = imx_clk_pllv3(IMX_PLLV3_AV,      "pll5", "pll5_bypass_src", base + 0xa0, 0x7f);
-       clk[IMX6QDL_CLK_PLL6] = imx_clk_pllv3(IMX_PLLV3_ENET,    "pll6", "pll6_bypass_src", base + 0xe0, 0x3);
-       clk[IMX6QDL_CLK_PLL7] = imx_clk_pllv3(IMX_PLLV3_USB,     "pll7", "pll7_bypass_src", base + 0x20, 0x3);
-
-       clk[IMX6QDL_PLL1_BYPASS] = imx_clk_mux_flags("pll1_bypass", base + 0x00, 16, 1, pll1_bypass_sels, ARRAY_SIZE(pll1_bypass_sels), CLK_SET_RATE_PARENT);
-       clk[IMX6QDL_PLL2_BYPASS] = imx_clk_mux_flags("pll2_bypass", base + 0x30, 16, 1, pll2_bypass_sels, ARRAY_SIZE(pll2_bypass_sels), CLK_SET_RATE_PARENT);
-       clk[IMX6QDL_PLL3_BYPASS] = imx_clk_mux_flags("pll3_bypass", base + 0x10, 16, 1, pll3_bypass_sels, ARRAY_SIZE(pll3_bypass_sels), CLK_SET_RATE_PARENT);
-       clk[IMX6QDL_PLL4_BYPASS] = imx_clk_mux_flags("pll4_bypass", base + 0x70, 16, 1, pll4_bypass_sels, ARRAY_SIZE(pll4_bypass_sels), CLK_SET_RATE_PARENT);
-       clk[IMX6QDL_PLL5_BYPASS] = imx_clk_mux_flags("pll5_bypass", base + 0xa0, 16, 1, pll5_bypass_sels, ARRAY_SIZE(pll5_bypass_sels), CLK_SET_RATE_PARENT);
-       clk[IMX6QDL_PLL6_BYPASS] = imx_clk_mux_flags("pll6_bypass", base + 0xe0, 16, 1, pll6_bypass_sels, ARRAY_SIZE(pll6_bypass_sels), CLK_SET_RATE_PARENT);
-       clk[IMX6QDL_PLL7_BYPASS] = imx_clk_mux_flags("pll7_bypass", base + 0x20, 16, 1, pll7_bypass_sels, ARRAY_SIZE(pll7_bypass_sels), CLK_SET_RATE_PARENT);
-
-       /* Do not bypass PLLs initially */
-       clk_set_parent(clk[IMX6QDL_PLL1_BYPASS], clk[IMX6QDL_CLK_PLL1]);
-       clk_set_parent(clk[IMX6QDL_PLL2_BYPASS], clk[IMX6QDL_CLK_PLL2]);
-       clk_set_parent(clk[IMX6QDL_PLL3_BYPASS], clk[IMX6QDL_CLK_PLL3]);
-       clk_set_parent(clk[IMX6QDL_PLL4_BYPASS], clk[IMX6QDL_CLK_PLL4]);
-       clk_set_parent(clk[IMX6QDL_PLL5_BYPASS], clk[IMX6QDL_CLK_PLL5]);
-       clk_set_parent(clk[IMX6QDL_PLL6_BYPASS], clk[IMX6QDL_CLK_PLL6]);
-       clk_set_parent(clk[IMX6QDL_PLL7_BYPASS], clk[IMX6QDL_CLK_PLL7]);
-
-       clk[IMX6QDL_CLK_PLL1_SYS]      = imx_clk_gate("pll1_sys",      "pll1_bypass", base + 0x00, 13);
-       clk[IMX6QDL_CLK_PLL2_BUS]      = imx_clk_gate("pll2_bus",      "pll2_bypass", base + 0x30, 13);
-       clk[IMX6QDL_CLK_PLL3_USB_OTG]  = imx_clk_gate("pll3_usb_otg",  "pll3_bypass", base + 0x10, 13);
-       clk[IMX6QDL_CLK_PLL4_AUDIO]    = imx_clk_gate("pll4_audio",    "pll4_bypass", base + 0x70, 13);
-       clk[IMX6QDL_CLK_PLL5_VIDEO]    = imx_clk_gate("pll5_video",    "pll5_bypass", base + 0xa0, 13);
-       clk[IMX6QDL_CLK_PLL6_ENET]     = imx_clk_gate("pll6_enet",     "pll6_bypass", base + 0xe0, 13);
-       clk[IMX6QDL_CLK_PLL7_USB_HOST] = imx_clk_gate("pll7_usb_host", "pll7_bypass", base + 0x20, 13);
-
-       /*
-        * Bit 20 is the reserved and read-only bit, we do this only for:
-        * - Do nothing for usbphy clk_enable/disable
-        * - Keep refcount when do usbphy clk_enable/disable, in that case,
-        * the clk framework may need to enable/disable usbphy's parent
-        */
-       clk[IMX6QDL_CLK_USBPHY1] = imx_clk_gate("usbphy1", "pll3_usb_otg", base + 0x10, 20);
-       clk[IMX6QDL_CLK_USBPHY2] = imx_clk_gate("usbphy2", "pll7_usb_host", base + 0x20, 20);
-
-       /*
-        * usbphy*_gate needs to be on after system boots up, and software
-        * never needs to control it anymore.
-        */
-       clk[IMX6QDL_CLK_USBPHY1_GATE] = imx_clk_gate("usbphy1_gate", "dummy", base + 0x10, 6);
-       clk[IMX6QDL_CLK_USBPHY2_GATE] = imx_clk_gate("usbphy2_gate", "dummy", base + 0x20, 6);
-
-       clk[IMX6QDL_CLK_SATA_REF] = imx_clk_fixed_factor("sata_ref", "pll6_enet", 1, 5);
-       clk[IMX6QDL_CLK_PCIE_REF] = imx_clk_fixed_factor("pcie_ref", "pll6_enet", 1, 4);
-
-       clk[IMX6QDL_CLK_SATA_REF_100M] = imx_clk_gate("sata_ref_100m", "sata_ref", base + 0xe0, 20);
-       clk[IMX6QDL_CLK_PCIE_REF_125M] = imx_clk_gate("pcie_ref_125m", "pcie_ref", base + 0xe0, 19);
-
-       clk[IMX6QDL_CLK_ENET_REF] = clk_register_divider_table(NULL, "enet_ref", "pll6_enet", 0,
-                       base + 0xe0, 0, 2, 0, clk_enet_ref_table,
-                       &imx_ccm_lock);
-
-       clk[IMX6QDL_CLK_LVDS1_SEL] = imx_clk_mux("lvds1_sel", base + 0x160, 0, 5, lvds_sels, ARRAY_SIZE(lvds_sels));
-       clk[IMX6QDL_CLK_LVDS2_SEL] = imx_clk_mux("lvds2_sel", base + 0x160, 5, 5, lvds_sels, ARRAY_SIZE(lvds_sels));
-
-       /*
-        * lvds1_gate and lvds2_gate are pseudo-gates.  Both can be
-        * independently configured as clock inputs or outputs.  We treat
-        * the "output_enable" bit as a gate, even though it's really just
-        * enabling clock output.
-        */
-       clk[IMX6QDL_CLK_LVDS1_GATE] = imx_clk_gate_exclusive("lvds1_gate", "lvds1_sel", base + 0x160, 10, BIT(12));
-       clk[IMX6QDL_CLK_LVDS2_GATE] = imx_clk_gate_exclusive("lvds2_gate", "lvds2_sel", base + 0x160, 11, BIT(13));
-
-       clk[IMX6QDL_CLK_LVDS1_IN] = imx_clk_gate_exclusive("lvds1_in", "anaclk1", base + 0x160, 12, BIT(10));
-       clk[IMX6QDL_CLK_LVDS2_IN] = imx_clk_gate_exclusive("lvds2_in", "anaclk2", base + 0x160, 13, BIT(11));
-
-       /*                                            name              parent_name        reg       idx */
-       clk[IMX6QDL_CLK_PLL2_PFD0_352M] = imx_clk_pfd("pll2_pfd0_352m", "pll2_bus",     base + 0x100, 0);
-       clk[IMX6QDL_CLK_PLL2_PFD1_594M] = imx_clk_pfd("pll2_pfd1_594m", "pll2_bus",     base + 0x100, 1);
-       clk[IMX6QDL_CLK_PLL2_PFD2_396M] = imx_clk_pfd("pll2_pfd2_396m", "pll2_bus",     base + 0x100, 2);
-       clk[IMX6QDL_CLK_PLL3_PFD0_720M] = imx_clk_pfd("pll3_pfd0_720m", "pll3_usb_otg", base + 0xf0,  0);
-       clk[IMX6QDL_CLK_PLL3_PFD1_540M] = imx_clk_pfd("pll3_pfd1_540m", "pll3_usb_otg", base + 0xf0,  1);
-       clk[IMX6QDL_CLK_PLL3_PFD2_508M] = imx_clk_pfd("pll3_pfd2_508m", "pll3_usb_otg", base + 0xf0,  2);
-       clk[IMX6QDL_CLK_PLL3_PFD3_454M] = imx_clk_pfd("pll3_pfd3_454m", "pll3_usb_otg", base + 0xf0,  3);
-
-       /*                                                name         parent_name     mult div */
-       clk[IMX6QDL_CLK_PLL2_198M] = imx_clk_fixed_factor("pll2_198m", "pll2_pfd2_396m", 1, 2);
-       clk[IMX6QDL_CLK_PLL3_120M] = imx_clk_fixed_factor("pll3_120m", "pll3_usb_otg",   1, 4);
-       clk[IMX6QDL_CLK_PLL3_80M]  = imx_clk_fixed_factor("pll3_80m",  "pll3_usb_otg",   1, 6);
-       clk[IMX6QDL_CLK_PLL3_60M]  = imx_clk_fixed_factor("pll3_60m",  "pll3_usb_otg",   1, 8);
-       clk[IMX6QDL_CLK_TWD]       = imx_clk_fixed_factor("twd",       "arm",            1, 2);
-       clk[IMX6QDL_CLK_GPT_3M]    = imx_clk_fixed_factor("gpt_3m",    "osc",            1, 8);
-       clk[IMX6QDL_CLK_VIDEO_27M] = imx_clk_fixed_factor("video_27m", "pll3_pfd1_540m", 1, 20);
-       if (cpu_is_imx6dl()) {
-               clk[IMX6QDL_CLK_GPU2D_AXI] = imx_clk_fixed_factor("gpu2d_axi", "mmdc_ch0_axi_podf", 1, 1);
-               clk[IMX6QDL_CLK_GPU3D_AXI] = imx_clk_fixed_factor("gpu3d_axi", "mmdc_ch0_axi_podf", 1, 1);
-       }
-
-       clk[IMX6QDL_CLK_PLL4_POST_DIV] = clk_register_divider_table(NULL, "pll4_post_div", "pll4_audio", CLK_SET_RATE_PARENT, base + 0x70, 19, 2, 0, post_div_table, &imx_ccm_lock);
-       clk[IMX6QDL_CLK_PLL4_AUDIO_DIV] = clk_register_divider(NULL, "pll4_audio_div", "pll4_post_div", CLK_SET_RATE_PARENT, base + 0x170, 15, 1, 0, &imx_ccm_lock);
-       clk[IMX6QDL_CLK_PLL5_POST_DIV] = clk_register_divider_table(NULL, "pll5_post_div", "pll5_video", CLK_SET_RATE_PARENT, base + 0xa0, 19, 2, 0, post_div_table, &imx_ccm_lock);
-       clk[IMX6QDL_CLK_PLL5_VIDEO_DIV] = clk_register_divider_table(NULL, "pll5_video_div", "pll5_post_div", CLK_SET_RATE_PARENT, base + 0x170, 30, 2, 0, video_div_table, &imx_ccm_lock);
-
-       np = ccm_node;
-       base = of_iomap(np, 0);
-       WARN_ON(!base);
-
-       imx6q_pm_set_ccm_base(base);
-
-       /*                                              name                reg       shift width parent_names     num_parents */
-       clk[IMX6QDL_CLK_STEP]             = imx_clk_mux("step",             base + 0xc,  8,  1, step_sels,         ARRAY_SIZE(step_sels));
-       clk[IMX6QDL_CLK_PLL1_SW]          = imx_clk_mux("pll1_sw",          base + 0xc,  2,  1, pll1_sw_sels,      ARRAY_SIZE(pll1_sw_sels));
-       clk[IMX6QDL_CLK_PERIPH_PRE]       = imx_clk_mux("periph_pre",       base + 0x18, 18, 2, periph_pre_sels,   ARRAY_SIZE(periph_pre_sels));
-       clk[IMX6QDL_CLK_PERIPH2_PRE]      = imx_clk_mux("periph2_pre",      base + 0x18, 21, 2, periph_pre_sels,   ARRAY_SIZE(periph_pre_sels));
-       clk[IMX6QDL_CLK_PERIPH_CLK2_SEL]  = imx_clk_mux("periph_clk2_sel",  base + 0x18, 12, 2, periph_clk2_sels,  ARRAY_SIZE(periph_clk2_sels));
-       clk[IMX6QDL_CLK_PERIPH2_CLK2_SEL] = imx_clk_mux("periph2_clk2_sel", base + 0x18, 20, 1, periph2_clk2_sels, ARRAY_SIZE(periph2_clk2_sels));
-       clk[IMX6QDL_CLK_AXI_SEL]          = imx_clk_mux("axi_sel",          base + 0x14, 6,  2, axi_sels,          ARRAY_SIZE(axi_sels));
-       clk[IMX6QDL_CLK_ESAI_SEL]         = imx_clk_mux("esai_sel",         base + 0x20, 19, 2, audio_sels,        ARRAY_SIZE(audio_sels));
-       clk[IMX6QDL_CLK_ASRC_SEL]         = imx_clk_mux("asrc_sel",         base + 0x30, 7,  2, audio_sels,        ARRAY_SIZE(audio_sels));
-       clk[IMX6QDL_CLK_SPDIF_SEL]        = imx_clk_mux("spdif_sel",        base + 0x30, 20, 2, audio_sels,        ARRAY_SIZE(audio_sels));
-       if (cpu_is_imx6q()) {
-               clk[IMX6QDL_CLK_GPU2D_AXI]        = imx_clk_mux("gpu2d_axi",        base + 0x18, 0,  1, gpu_axi_sels,      ARRAY_SIZE(gpu_axi_sels));
-               clk[IMX6QDL_CLK_GPU3D_AXI]        = imx_clk_mux("gpu3d_axi",        base + 0x18, 1,  1, gpu_axi_sels,      ARRAY_SIZE(gpu_axi_sels));
-       }
-       clk[IMX6QDL_CLK_GPU2D_CORE_SEL]   = imx_clk_mux("gpu2d_core_sel",   base + 0x18, 16, 2, gpu2d_core_sels,   ARRAY_SIZE(gpu2d_core_sels));
-       clk[IMX6QDL_CLK_GPU3D_CORE_SEL]   = imx_clk_mux("gpu3d_core_sel",   base + 0x18, 4,  2, gpu3d_core_sels,   ARRAY_SIZE(gpu3d_core_sels));
-       clk[IMX6QDL_CLK_GPU3D_SHADER_SEL] = imx_clk_mux("gpu3d_shader_sel", base + 0x18, 8,  2, gpu3d_shader_sels, ARRAY_SIZE(gpu3d_shader_sels));
-       clk[IMX6QDL_CLK_IPU1_SEL]         = imx_clk_mux("ipu1_sel",         base + 0x3c, 9,  2, ipu_sels,          ARRAY_SIZE(ipu_sels));
-       clk[IMX6QDL_CLK_IPU2_SEL]         = imx_clk_mux("ipu2_sel",         base + 0x3c, 14, 2, ipu_sels,          ARRAY_SIZE(ipu_sels));
-       clk[IMX6QDL_CLK_LDB_DI0_SEL]      = imx_clk_mux_flags("ldb_di0_sel", base + 0x2c, 9,  3, ldb_di_sels,      ARRAY_SIZE(ldb_di_sels), CLK_SET_RATE_PARENT);
-       clk[IMX6QDL_CLK_LDB_DI1_SEL]      = imx_clk_mux_flags("ldb_di1_sel", base + 0x2c, 12, 3, ldb_di_sels,      ARRAY_SIZE(ldb_di_sels), CLK_SET_RATE_PARENT);
-       clk[IMX6QDL_CLK_IPU1_DI0_PRE_SEL] = imx_clk_mux_flags("ipu1_di0_pre_sel", base + 0x34, 6,  3, ipu_di_pre_sels,   ARRAY_SIZE(ipu_di_pre_sels), CLK_SET_RATE_PARENT);
-       clk[IMX6QDL_CLK_IPU1_DI1_PRE_SEL] = imx_clk_mux_flags("ipu1_di1_pre_sel", base + 0x34, 15, 3, ipu_di_pre_sels,   ARRAY_SIZE(ipu_di_pre_sels), CLK_SET_RATE_PARENT);
-       clk[IMX6QDL_CLK_IPU2_DI0_PRE_SEL] = imx_clk_mux_flags("ipu2_di0_pre_sel", base + 0x38, 6,  3, ipu_di_pre_sels,   ARRAY_SIZE(ipu_di_pre_sels), CLK_SET_RATE_PARENT);
-       clk[IMX6QDL_CLK_IPU2_DI1_PRE_SEL] = imx_clk_mux_flags("ipu2_di1_pre_sel", base + 0x38, 15, 3, ipu_di_pre_sels,   ARRAY_SIZE(ipu_di_pre_sels), CLK_SET_RATE_PARENT);
-       clk[IMX6QDL_CLK_IPU1_DI0_SEL]     = imx_clk_mux_flags("ipu1_di0_sel",     base + 0x34, 0,  3, ipu1_di0_sels,     ARRAY_SIZE(ipu1_di0_sels), CLK_SET_RATE_PARENT);
-       clk[IMX6QDL_CLK_IPU1_DI1_SEL]     = imx_clk_mux_flags("ipu1_di1_sel",     base + 0x34, 9,  3, ipu1_di1_sels,     ARRAY_SIZE(ipu1_di1_sels), CLK_SET_RATE_PARENT);
-       clk[IMX6QDL_CLK_IPU2_DI0_SEL]     = imx_clk_mux_flags("ipu2_di0_sel",     base + 0x38, 0,  3, ipu2_di0_sels,     ARRAY_SIZE(ipu2_di0_sels), CLK_SET_RATE_PARENT);
-       clk[IMX6QDL_CLK_IPU2_DI1_SEL]     = imx_clk_mux_flags("ipu2_di1_sel",     base + 0x38, 9,  3, ipu2_di1_sels,     ARRAY_SIZE(ipu2_di1_sels), CLK_SET_RATE_PARENT);
-       clk[IMX6QDL_CLK_HSI_TX_SEL]       = imx_clk_mux("hsi_tx_sel",       base + 0x30, 28, 1, hsi_tx_sels,       ARRAY_SIZE(hsi_tx_sels));
-       clk[IMX6QDL_CLK_PCIE_AXI_SEL]     = imx_clk_mux("pcie_axi_sel",     base + 0x18, 10, 1, pcie_axi_sels,     ARRAY_SIZE(pcie_axi_sels));
-       clk[IMX6QDL_CLK_SSI1_SEL]         = imx_clk_fixup_mux("ssi1_sel",   base + 0x1c, 10, 2, ssi_sels,          ARRAY_SIZE(ssi_sels), imx_cscmr1_fixup);
-       clk[IMX6QDL_CLK_SSI2_SEL]         = imx_clk_fixup_mux("ssi2_sel",   base + 0x1c, 12, 2, ssi_sels,          ARRAY_SIZE(ssi_sels), imx_cscmr1_fixup);
-       clk[IMX6QDL_CLK_SSI3_SEL]         = imx_clk_fixup_mux("ssi3_sel",   base + 0x1c, 14, 2, ssi_sels,          ARRAY_SIZE(ssi_sels), imx_cscmr1_fixup);
-       clk[IMX6QDL_CLK_USDHC1_SEL]       = imx_clk_fixup_mux("usdhc1_sel", base + 0x1c, 16, 1, usdhc_sels,        ARRAY_SIZE(usdhc_sels), imx_cscmr1_fixup);
-       clk[IMX6QDL_CLK_USDHC2_SEL]       = imx_clk_fixup_mux("usdhc2_sel", base + 0x1c, 17, 1, usdhc_sels,        ARRAY_SIZE(usdhc_sels), imx_cscmr1_fixup);
-       clk[IMX6QDL_CLK_USDHC3_SEL]       = imx_clk_fixup_mux("usdhc3_sel", base + 0x1c, 18, 1, usdhc_sels,        ARRAY_SIZE(usdhc_sels), imx_cscmr1_fixup);
-       clk[IMX6QDL_CLK_USDHC4_SEL]       = imx_clk_fixup_mux("usdhc4_sel", base + 0x1c, 19, 1, usdhc_sels,        ARRAY_SIZE(usdhc_sels), imx_cscmr1_fixup);
-       clk[IMX6QDL_CLK_ENFC_SEL]         = imx_clk_mux("enfc_sel",         base + 0x2c, 16, 2, enfc_sels,         ARRAY_SIZE(enfc_sels));
-       clk[IMX6QDL_CLK_EIM_SEL]          = imx_clk_fixup_mux("eim_sel",      base + 0x1c, 27, 2, eim_sels,        ARRAY_SIZE(eim_sels), imx_cscmr1_fixup);
-       clk[IMX6QDL_CLK_EIM_SLOW_SEL]     = imx_clk_fixup_mux("eim_slow_sel", base + 0x1c, 29, 2, eim_slow_sels,   ARRAY_SIZE(eim_slow_sels), imx_cscmr1_fixup);
-       clk[IMX6QDL_CLK_VDO_AXI_SEL]      = imx_clk_mux("vdo_axi_sel",      base + 0x18, 11, 1, vdo_axi_sels,      ARRAY_SIZE(vdo_axi_sels));
-       clk[IMX6QDL_CLK_VPU_AXI_SEL]      = imx_clk_mux("vpu_axi_sel",      base + 0x18, 14, 2, vpu_axi_sels,      ARRAY_SIZE(vpu_axi_sels));
-       clk[IMX6QDL_CLK_CKO1_SEL]         = imx_clk_mux("cko1_sel",         base + 0x60, 0,  4, cko1_sels,         ARRAY_SIZE(cko1_sels));
-       clk[IMX6QDL_CLK_CKO2_SEL]         = imx_clk_mux("cko2_sel",         base + 0x60, 16, 5, cko2_sels,         ARRAY_SIZE(cko2_sels));
-       clk[IMX6QDL_CLK_CKO]              = imx_clk_mux("cko",              base + 0x60, 8, 1,  cko_sels,          ARRAY_SIZE(cko_sels));
-
-       /*                                          name         reg      shift width busy: reg, shift parent_names  num_parents */
-       clk[IMX6QDL_CLK_PERIPH]  = imx_clk_busy_mux("periph",  base + 0x14, 25,  1,   base + 0x48, 5,  periph_sels,  ARRAY_SIZE(periph_sels));
-       clk[IMX6QDL_CLK_PERIPH2] = imx_clk_busy_mux("periph2", base + 0x14, 26,  1,   base + 0x48, 3,  periph2_sels, ARRAY_SIZE(periph2_sels));
-
-       /*                                                  name                parent_name          reg       shift width */
-       clk[IMX6QDL_CLK_PERIPH_CLK2]      = imx_clk_divider("periph_clk2",      "periph_clk2_sel",   base + 0x14, 27, 3);
-       clk[IMX6QDL_CLK_PERIPH2_CLK2]     = imx_clk_divider("periph2_clk2",     "periph2_clk2_sel",  base + 0x14, 0,  3);
-       clk[IMX6QDL_CLK_IPG]              = imx_clk_divider("ipg",              "ahb",               base + 0x14, 8,  2);
-       clk[IMX6QDL_CLK_IPG_PER]          = imx_clk_fixup_divider("ipg_per",    "ipg",               base + 0x1c, 0,  6, imx_cscmr1_fixup);
-       clk[IMX6QDL_CLK_ESAI_PRED]        = imx_clk_divider("esai_pred",        "esai_sel",          base + 0x28, 9,  3);
-       clk[IMX6QDL_CLK_ESAI_PODF]        = imx_clk_divider("esai_podf",        "esai_pred",         base + 0x28, 25, 3);
-       clk[IMX6QDL_CLK_ASRC_PRED]        = imx_clk_divider("asrc_pred",        "asrc_sel",          base + 0x30, 12, 3);
-       clk[IMX6QDL_CLK_ASRC_PODF]        = imx_clk_divider("asrc_podf",        "asrc_pred",         base + 0x30, 9,  3);
-       clk[IMX6QDL_CLK_SPDIF_PRED]       = imx_clk_divider("spdif_pred",       "spdif_sel",         base + 0x30, 25, 3);
-       clk[IMX6QDL_CLK_SPDIF_PODF]       = imx_clk_divider("spdif_podf",       "spdif_pred",        base + 0x30, 22, 3);
-       clk[IMX6QDL_CLK_CAN_ROOT]         = imx_clk_divider("can_root",         "pll3_60m",          base + 0x20, 2,  6);
-       clk[IMX6QDL_CLK_ECSPI_ROOT]       = imx_clk_divider("ecspi_root",       "pll3_60m",          base + 0x38, 19, 6);
-       clk[IMX6QDL_CLK_GPU2D_CORE_PODF]  = imx_clk_divider("gpu2d_core_podf",  "gpu2d_core_sel",    base + 0x18, 23, 3);
-       clk[IMX6QDL_CLK_GPU3D_CORE_PODF]  = imx_clk_divider("gpu3d_core_podf",  "gpu3d_core_sel",    base + 0x18, 26, 3);
-       clk[IMX6QDL_CLK_GPU3D_SHADER]     = imx_clk_divider("gpu3d_shader",     "gpu3d_shader_sel",  base + 0x18, 29, 3);
-       clk[IMX6QDL_CLK_IPU1_PODF]        = imx_clk_divider("ipu1_podf",        "ipu1_sel",          base + 0x3c, 11, 3);
-       clk[IMX6QDL_CLK_IPU2_PODF]        = imx_clk_divider("ipu2_podf",        "ipu2_sel",          base + 0x3c, 16, 3);
-       clk[IMX6QDL_CLK_LDB_DI0_DIV_3_5]  = imx_clk_fixed_factor("ldb_di0_div_3_5", "ldb_di0_sel", 2, 7);
-       clk[IMX6QDL_CLK_LDB_DI0_PODF]     = imx_clk_divider_flags("ldb_di0_podf", "ldb_di0_div_3_5", base + 0x20, 10, 1, 0);
-       clk[IMX6QDL_CLK_LDB_DI1_DIV_3_5]  = imx_clk_fixed_factor("ldb_di1_div_3_5", "ldb_di1_sel", 2, 7);
-       clk[IMX6QDL_CLK_LDB_DI1_PODF]     = imx_clk_divider_flags("ldb_di1_podf", "ldb_di1_div_3_5", base + 0x20, 11, 1, 0);
-       clk[IMX6QDL_CLK_IPU1_DI0_PRE]     = imx_clk_divider("ipu1_di0_pre",     "ipu1_di0_pre_sel",  base + 0x34, 3,  3);
-       clk[IMX6QDL_CLK_IPU1_DI1_PRE]     = imx_clk_divider("ipu1_di1_pre",     "ipu1_di1_pre_sel",  base + 0x34, 12, 3);
-       clk[IMX6QDL_CLK_IPU2_DI0_PRE]     = imx_clk_divider("ipu2_di0_pre",     "ipu2_di0_pre_sel",  base + 0x38, 3,  3);
-       clk[IMX6QDL_CLK_IPU2_DI1_PRE]     = imx_clk_divider("ipu2_di1_pre",     "ipu2_di1_pre_sel",  base + 0x38, 12, 3);
-       clk[IMX6QDL_CLK_HSI_TX_PODF]      = imx_clk_divider("hsi_tx_podf",      "hsi_tx_sel",        base + 0x30, 29, 3);
-       clk[IMX6QDL_CLK_SSI1_PRED]        = imx_clk_divider("ssi1_pred",        "ssi1_sel",          base + 0x28, 6,  3);
-       clk[IMX6QDL_CLK_SSI1_PODF]        = imx_clk_divider("ssi1_podf",        "ssi1_pred",         base + 0x28, 0,  6);
-       clk[IMX6QDL_CLK_SSI2_PRED]        = imx_clk_divider("ssi2_pred",        "ssi2_sel",          base + 0x2c, 6,  3);
-       clk[IMX6QDL_CLK_SSI2_PODF]        = imx_clk_divider("ssi2_podf",        "ssi2_pred",         base + 0x2c, 0,  6);
-       clk[IMX6QDL_CLK_SSI3_PRED]        = imx_clk_divider("ssi3_pred",        "ssi3_sel",          base + 0x28, 22, 3);
-       clk[IMX6QDL_CLK_SSI3_PODF]        = imx_clk_divider("ssi3_podf",        "ssi3_pred",         base + 0x28, 16, 6);
-       clk[IMX6QDL_CLK_UART_SERIAL_PODF] = imx_clk_divider("uart_serial_podf", "pll3_80m",          base + 0x24, 0,  6);
-       clk[IMX6QDL_CLK_USDHC1_PODF]      = imx_clk_divider("usdhc1_podf",      "usdhc1_sel",        base + 0x24, 11, 3);
-       clk[IMX6QDL_CLK_USDHC2_PODF]      = imx_clk_divider("usdhc2_podf",      "usdhc2_sel",        base + 0x24, 16, 3);
-       clk[IMX6QDL_CLK_USDHC3_PODF]      = imx_clk_divider("usdhc3_podf",      "usdhc3_sel",        base + 0x24, 19, 3);
-       clk[IMX6QDL_CLK_USDHC4_PODF]      = imx_clk_divider("usdhc4_podf",      "usdhc4_sel",        base + 0x24, 22, 3);
-       clk[IMX6QDL_CLK_ENFC_PRED]        = imx_clk_divider("enfc_pred",        "enfc_sel",          base + 0x2c, 18, 3);
-       clk[IMX6QDL_CLK_ENFC_PODF]        = imx_clk_divider("enfc_podf",        "enfc_pred",         base + 0x2c, 21, 6);
-       clk[IMX6QDL_CLK_EIM_PODF]         = imx_clk_fixup_divider("eim_podf",   "eim_sel",           base + 0x1c, 20, 3, imx_cscmr1_fixup);
-       clk[IMX6QDL_CLK_EIM_SLOW_PODF]    = imx_clk_fixup_divider("eim_slow_podf", "eim_slow_sel",   base + 0x1c, 23, 3, imx_cscmr1_fixup);
-       clk[IMX6QDL_CLK_VPU_AXI_PODF]     = imx_clk_divider("vpu_axi_podf",     "vpu_axi_sel",       base + 0x24, 25, 3);
-       clk[IMX6QDL_CLK_CKO1_PODF]        = imx_clk_divider("cko1_podf",        "cko1_sel",          base + 0x60, 4,  3);
-       clk[IMX6QDL_CLK_CKO2_PODF]        = imx_clk_divider("cko2_podf",        "cko2_sel",          base + 0x60, 21, 3);
-
-       /*                                                        name                 parent_name    reg        shift width busy: reg, shift */
-       clk[IMX6QDL_CLK_AXI]               = imx_clk_busy_divider("axi",               "axi_sel",     base + 0x14, 16,  3,   base + 0x48, 0);
-       clk[IMX6QDL_CLK_MMDC_CH0_AXI_PODF] = imx_clk_busy_divider("mmdc_ch0_axi_podf", "periph",      base + 0x14, 19,  3,   base + 0x48, 4);
-       clk[IMX6QDL_CLK_MMDC_CH1_AXI_PODF] = imx_clk_busy_divider("mmdc_ch1_axi_podf", "periph2",     base + 0x14, 3,   3,   base + 0x48, 2);
-       clk[IMX6QDL_CLK_ARM]               = imx_clk_busy_divider("arm",               "pll1_sw",     base + 0x10, 0,   3,   base + 0x48, 16);
-       clk[IMX6QDL_CLK_AHB]               = imx_clk_busy_divider("ahb",               "periph",      base + 0x14, 10,  3,   base + 0x48, 1);
-
-       /*                                            name             parent_name          reg         shift */
-       clk[IMX6QDL_CLK_APBH_DMA]     = imx_clk_gate2("apbh_dma",      "usdhc3",            base + 0x68, 4);
-       clk[IMX6QDL_CLK_ASRC]         = imx_clk_gate2_shared("asrc",         "asrc_podf",   base + 0x68, 6, &share_count_asrc);
-       clk[IMX6QDL_CLK_ASRC_IPG]     = imx_clk_gate2_shared("asrc_ipg",     "ahb",         base + 0x68, 6, &share_count_asrc);
-       clk[IMX6QDL_CLK_ASRC_MEM]     = imx_clk_gate2_shared("asrc_mem",     "ahb",         base + 0x68, 6, &share_count_asrc);
-       clk[IMX6QDL_CLK_CAN1_IPG]     = imx_clk_gate2("can1_ipg",      "ipg",               base + 0x68, 14);
-       clk[IMX6QDL_CLK_CAN1_SERIAL]  = imx_clk_gate2("can1_serial",   "can_root",          base + 0x68, 16);
-       clk[IMX6QDL_CLK_CAN2_IPG]     = imx_clk_gate2("can2_ipg",      "ipg",               base + 0x68, 18);
-       clk[IMX6QDL_CLK_CAN2_SERIAL]  = imx_clk_gate2("can2_serial",   "can_root",          base + 0x68, 20);
-       clk[IMX6QDL_CLK_ECSPI1]       = imx_clk_gate2("ecspi1",        "ecspi_root",        base + 0x6c, 0);
-       clk[IMX6QDL_CLK_ECSPI2]       = imx_clk_gate2("ecspi2",        "ecspi_root",        base + 0x6c, 2);
-       clk[IMX6QDL_CLK_ECSPI3]       = imx_clk_gate2("ecspi3",        "ecspi_root",        base + 0x6c, 4);
-       clk[IMX6QDL_CLK_ECSPI4]       = imx_clk_gate2("ecspi4",        "ecspi_root",        base + 0x6c, 6);
-       if (cpu_is_imx6dl())
-               clk[IMX6DL_CLK_I2C4]  = imx_clk_gate2("i2c4",          "ipg_per",           base + 0x6c, 8);
-       else
-               clk[IMX6Q_CLK_ECSPI5] = imx_clk_gate2("ecspi5",        "ecspi_root",        base + 0x6c, 8);
-       clk[IMX6QDL_CLK_ENET]         = imx_clk_gate2("enet",          "ipg",               base + 0x6c, 10);
-       clk[IMX6QDL_CLK_ESAI_EXTAL]   = imx_clk_gate2_shared("esai_extal",   "esai_podf",   base + 0x6c, 16, &share_count_esai);
-       clk[IMX6QDL_CLK_ESAI_IPG]     = imx_clk_gate2_shared("esai_ipg",   "ahb",           base + 0x6c, 16, &share_count_esai);
-       clk[IMX6QDL_CLK_ESAI_MEM]     = imx_clk_gate2_shared("esai_mem", "ahb",             base + 0x6c, 16, &share_count_esai);
-       clk[IMX6QDL_CLK_GPT_IPG]      = imx_clk_gate2("gpt_ipg",       "ipg",               base + 0x6c, 20);
-       clk[IMX6QDL_CLK_GPT_IPG_PER]  = imx_clk_gate2("gpt_ipg_per",   "ipg_per",           base + 0x6c, 22);
-       if (cpu_is_imx6dl())
-               /*
-                * The multiplexer and divider of imx6q clock gpu3d_shader get
-                * redefined/reused as gpu2d_core_sel and gpu2d_core_podf on imx6dl.
-                */
-               clk[IMX6QDL_CLK_GPU2D_CORE] = imx_clk_gate2("gpu2d_core", "gpu3d_shader", base + 0x6c, 24);
-       else
-               clk[IMX6QDL_CLK_GPU2D_CORE] = imx_clk_gate2("gpu2d_core", "gpu2d_core_podf", base + 0x6c, 24);
-       clk[IMX6QDL_CLK_GPU3D_CORE]   = imx_clk_gate2("gpu3d_core",    "gpu3d_core_podf",   base + 0x6c, 26);
-       clk[IMX6QDL_CLK_HDMI_IAHB]    = imx_clk_gate2("hdmi_iahb",     "ahb",               base + 0x70, 0);
-       clk[IMX6QDL_CLK_HDMI_ISFR]    = imx_clk_gate2("hdmi_isfr",     "video_27m",         base + 0x70, 4);
-       clk[IMX6QDL_CLK_I2C1]         = imx_clk_gate2("i2c1",          "ipg_per",           base + 0x70, 6);
-       clk[IMX6QDL_CLK_I2C2]         = imx_clk_gate2("i2c2",          "ipg_per",           base + 0x70, 8);
-       clk[IMX6QDL_CLK_I2C3]         = imx_clk_gate2("i2c3",          "ipg_per",           base + 0x70, 10);
-       clk[IMX6QDL_CLK_IIM]          = imx_clk_gate2("iim",           "ipg",               base + 0x70, 12);
-       clk[IMX6QDL_CLK_ENFC]         = imx_clk_gate2("enfc",          "enfc_podf",         base + 0x70, 14);
-       clk[IMX6QDL_CLK_VDOA]         = imx_clk_gate2("vdoa",          "vdo_axi",           base + 0x70, 26);
-       clk[IMX6QDL_CLK_IPU1]         = imx_clk_gate2("ipu1",          "ipu1_podf",         base + 0x74, 0);
-       clk[IMX6QDL_CLK_IPU1_DI0]     = imx_clk_gate2("ipu1_di0",      "ipu1_di0_sel",      base + 0x74, 2);
-       clk[IMX6QDL_CLK_IPU1_DI1]     = imx_clk_gate2("ipu1_di1",      "ipu1_di1_sel",      base + 0x74, 4);
-       clk[IMX6QDL_CLK_IPU2]         = imx_clk_gate2("ipu2",          "ipu2_podf",         base + 0x74, 6);
-       clk[IMX6QDL_CLK_IPU2_DI0]     = imx_clk_gate2("ipu2_di0",      "ipu2_di0_sel",      base + 0x74, 8);
-       clk[IMX6QDL_CLK_LDB_DI0]      = imx_clk_gate2("ldb_di0",       "ldb_di0_podf",      base + 0x74, 12);
-       clk[IMX6QDL_CLK_LDB_DI1]      = imx_clk_gate2("ldb_di1",       "ldb_di1_podf",      base + 0x74, 14);
-       clk[IMX6QDL_CLK_IPU2_DI1]     = imx_clk_gate2("ipu2_di1",      "ipu2_di1_sel",      base + 0x74, 10);
-       clk[IMX6QDL_CLK_HSI_TX]       = imx_clk_gate2_shared("hsi_tx", "hsi_tx_podf",       base + 0x74, 16, &share_count_mipi_core_cfg);
-       clk[IMX6QDL_CLK_MIPI_CORE_CFG] = imx_clk_gate2_shared("mipi_core_cfg", "video_27m", base + 0x74, 16, &share_count_mipi_core_cfg);
-       clk[IMX6QDL_CLK_MIPI_IPG]     = imx_clk_gate2_shared("mipi_ipg", "ipg",             base + 0x74, 16, &share_count_mipi_core_cfg);
-       if (cpu_is_imx6dl())
-               /*
-                * The multiplexer and divider of the imx6q clock gpu2d get
-                * redefined/reused as mlb_sys_sel and mlb_sys_clk_podf on imx6dl.
-                */
-               clk[IMX6QDL_CLK_MLB] = imx_clk_gate2("mlb",            "gpu2d_core_podf",   base + 0x74, 18);
-       else
-               clk[IMX6QDL_CLK_MLB] = imx_clk_gate2("mlb",            "axi",               base + 0x74, 18);
-       clk[IMX6QDL_CLK_MMDC_CH0_AXI] = imx_clk_gate2("mmdc_ch0_axi",  "mmdc_ch0_axi_podf", base + 0x74, 20);
-       clk[IMX6QDL_CLK_MMDC_CH1_AXI] = imx_clk_gate2("mmdc_ch1_axi",  "mmdc_ch1_axi_podf", base + 0x74, 22);
-       clk[IMX6QDL_CLK_OCRAM]        = imx_clk_gate2("ocram",         "ahb",               base + 0x74, 28);
-       clk[IMX6QDL_CLK_OPENVG_AXI]   = imx_clk_gate2("openvg_axi",    "axi",               base + 0x74, 30);
-       clk[IMX6QDL_CLK_PCIE_AXI]     = imx_clk_gate2("pcie_axi",      "pcie_axi_sel",      base + 0x78, 0);
-       clk[IMX6QDL_CLK_PER1_BCH]     = imx_clk_gate2("per1_bch",      "usdhc3",            base + 0x78, 12);
-       clk[IMX6QDL_CLK_PWM1]         = imx_clk_gate2("pwm1",          "ipg_per",           base + 0x78, 16);
-       clk[IMX6QDL_CLK_PWM2]         = imx_clk_gate2("pwm2",          "ipg_per",           base + 0x78, 18);
-       clk[IMX6QDL_CLK_PWM3]         = imx_clk_gate2("pwm3",          "ipg_per",           base + 0x78, 20);
-       clk[IMX6QDL_CLK_PWM4]         = imx_clk_gate2("pwm4",          "ipg_per",           base + 0x78, 22);
-       clk[IMX6QDL_CLK_GPMI_BCH_APB] = imx_clk_gate2("gpmi_bch_apb",  "usdhc3",            base + 0x78, 24);
-       clk[IMX6QDL_CLK_GPMI_BCH]     = imx_clk_gate2("gpmi_bch",      "usdhc4",            base + 0x78, 26);
-       clk[IMX6QDL_CLK_GPMI_IO]      = imx_clk_gate2("gpmi_io",       "enfc",              base + 0x78, 28);
-       clk[IMX6QDL_CLK_GPMI_APB]     = imx_clk_gate2("gpmi_apb",      "usdhc3",            base + 0x78, 30);
-       clk[IMX6QDL_CLK_ROM]          = imx_clk_gate2("rom",           "ahb",               base + 0x7c, 0);
-       clk[IMX6QDL_CLK_SATA]         = imx_clk_gate2("sata",          "ipg",               base + 0x7c, 4);
-       clk[IMX6QDL_CLK_SDMA]         = imx_clk_gate2("sdma",          "ahb",               base + 0x7c, 6);
-       clk[IMX6QDL_CLK_SPBA]         = imx_clk_gate2("spba",          "ipg",               base + 0x7c, 12);
-       clk[IMX6QDL_CLK_SPDIF]        = imx_clk_gate2("spdif",         "spdif_podf",        base + 0x7c, 14);
-       clk[IMX6QDL_CLK_SSI1_IPG]     = imx_clk_gate2_shared("ssi1_ipg",      "ipg",        base + 0x7c, 18, &share_count_ssi1);
-       clk[IMX6QDL_CLK_SSI2_IPG]     = imx_clk_gate2_shared("ssi2_ipg",      "ipg",        base + 0x7c, 20, &share_count_ssi2);
-       clk[IMX6QDL_CLK_SSI3_IPG]     = imx_clk_gate2_shared("ssi3_ipg",      "ipg",        base + 0x7c, 22, &share_count_ssi3);
-       clk[IMX6QDL_CLK_SSI1]         = imx_clk_gate2_shared("ssi1",          "ssi1_podf",  base + 0x7c, 18, &share_count_ssi1);
-       clk[IMX6QDL_CLK_SSI2]         = imx_clk_gate2_shared("ssi2",          "ssi2_podf",  base + 0x7c, 20, &share_count_ssi2);
-       clk[IMX6QDL_CLK_SSI3]         = imx_clk_gate2_shared("ssi3",          "ssi3_podf",  base + 0x7c, 22, &share_count_ssi3);
-       clk[IMX6QDL_CLK_UART_IPG]     = imx_clk_gate2("uart_ipg",      "ipg",               base + 0x7c, 24);
-       clk[IMX6QDL_CLK_UART_SERIAL]  = imx_clk_gate2("uart_serial",   "uart_serial_podf",  base + 0x7c, 26);
-       clk[IMX6QDL_CLK_USBOH3]       = imx_clk_gate2("usboh3",        "ipg",               base + 0x80, 0);
-       clk[IMX6QDL_CLK_USDHC1]       = imx_clk_gate2("usdhc1",        "usdhc1_podf",       base + 0x80, 2);
-       clk[IMX6QDL_CLK_USDHC2]       = imx_clk_gate2("usdhc2",        "usdhc2_podf",       base + 0x80, 4);
-       clk[IMX6QDL_CLK_USDHC3]       = imx_clk_gate2("usdhc3",        "usdhc3_podf",       base + 0x80, 6);
-       clk[IMX6QDL_CLK_USDHC4]       = imx_clk_gate2("usdhc4",        "usdhc4_podf",       base + 0x80, 8);
-       clk[IMX6QDL_CLK_EIM_SLOW]     = imx_clk_gate2("eim_slow",      "eim_slow_podf",     base + 0x80, 10);
-       clk[IMX6QDL_CLK_VDO_AXI]      = imx_clk_gate2("vdo_axi",       "vdo_axi_sel",       base + 0x80, 12);
-       clk[IMX6QDL_CLK_VPU_AXI]      = imx_clk_gate2("vpu_axi",       "vpu_axi_podf",      base + 0x80, 14);
-       clk[IMX6QDL_CLK_CKO1]         = imx_clk_gate("cko1",           "cko1_podf",         base + 0x60, 7);
-       clk[IMX6QDL_CLK_CKO2]         = imx_clk_gate("cko2",           "cko2_podf",         base + 0x60, 24);
-
-       /*
-        * The gpt_3m clock is not available on i.MX6Q TO1.0.  Let's point it
-        * to clock gpt_ipg_per to ease the gpt driver code.
-        */
-       if (cpu_is_imx6q() && imx_get_soc_revision() == IMX_CHIP_REVISION_1_0)
-               clk[IMX6QDL_CLK_GPT_3M] = clk[IMX6QDL_CLK_GPT_IPG_PER];
-
-       imx_check_clocks(clk, ARRAY_SIZE(clk));
-
-       clk_data.clks = clk;
-       clk_data.clk_num = ARRAY_SIZE(clk);
-       of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
-
-       clk_register_clkdev(clk[IMX6QDL_CLK_ENET_REF], "enet_ref", NULL);
-
-       if ((imx_get_soc_revision() != IMX_CHIP_REVISION_1_0) ||
-           cpu_is_imx6dl()) {
-               clk_set_parent(clk[IMX6QDL_CLK_LDB_DI0_SEL], clk[IMX6QDL_CLK_PLL5_VIDEO_DIV]);
-               clk_set_parent(clk[IMX6QDL_CLK_LDB_DI1_SEL], clk[IMX6QDL_CLK_PLL5_VIDEO_DIV]);
-       }
-
-       clk_set_parent(clk[IMX6QDL_CLK_IPU1_DI0_PRE_SEL], clk[IMX6QDL_CLK_PLL5_VIDEO_DIV]);
-       clk_set_parent(clk[IMX6QDL_CLK_IPU1_DI1_PRE_SEL], clk[IMX6QDL_CLK_PLL5_VIDEO_DIV]);
-       clk_set_parent(clk[IMX6QDL_CLK_IPU2_DI0_PRE_SEL], clk[IMX6QDL_CLK_PLL5_VIDEO_DIV]);
-       clk_set_parent(clk[IMX6QDL_CLK_IPU2_DI1_PRE_SEL], clk[IMX6QDL_CLK_PLL5_VIDEO_DIV]);
-       clk_set_parent(clk[IMX6QDL_CLK_IPU1_DI0_SEL], clk[IMX6QDL_CLK_IPU1_DI0_PRE]);
-       clk_set_parent(clk[IMX6QDL_CLK_IPU1_DI1_SEL], clk[IMX6QDL_CLK_IPU1_DI1_PRE]);
-       clk_set_parent(clk[IMX6QDL_CLK_IPU2_DI0_SEL], clk[IMX6QDL_CLK_IPU2_DI0_PRE]);
-       clk_set_parent(clk[IMX6QDL_CLK_IPU2_DI1_SEL], clk[IMX6QDL_CLK_IPU2_DI1_PRE]);
-
-       /*
-        * The gpmi needs 100MHz frequency in the EDO/Sync mode,
-        * We can not get the 100MHz from the pll2_pfd0_352m.
-        * So choose pll2_pfd2_396m as enfc_sel's parent.
-        */
-       clk_set_parent(clk[IMX6QDL_CLK_ENFC_SEL], clk[IMX6QDL_CLK_PLL2_PFD2_396M]);
-
-       for (i = 0; i < ARRAY_SIZE(clks_init_on); i++)
-               clk_prepare_enable(clk[clks_init_on[i]]);
-
-       if (IS_ENABLED(CONFIG_USB_MXS_PHY)) {
-               clk_prepare_enable(clk[IMX6QDL_CLK_USBPHY1_GATE]);
-               clk_prepare_enable(clk[IMX6QDL_CLK_USBPHY2_GATE]);
-       }
-
-       /*
-        * Let's initially set up CLKO with OSC24M, since this configuration
-        * is widely used by imx6q board designs to clock audio codec.
-        */
-       ret = clk_set_parent(clk[IMX6QDL_CLK_CKO2_SEL], clk[IMX6QDL_CLK_OSC]);
-       if (!ret)
-               ret = clk_set_parent(clk[IMX6QDL_CLK_CKO], clk[IMX6QDL_CLK_CKO2]);
-       if (ret)
-               pr_warn("failed to set up CLKO: %d\n", ret);
-
-       /* Audio-related clocks configuration */
-       clk_set_parent(clk[IMX6QDL_CLK_SPDIF_SEL], clk[IMX6QDL_CLK_PLL3_PFD3_454M]);
-
-       /* All existing boards with PCIe use LVDS1 */
-       if (IS_ENABLED(CONFIG_PCI_IMX6))
-               clk_set_parent(clk[IMX6QDL_CLK_LVDS1_SEL], clk[IMX6QDL_CLK_SATA_REF_100M]);
-
-       /* Set initial power mode */
-       imx6q_set_lpm(WAIT_CLOCKED);
-}
-CLK_OF_DECLARE(imx6q, "fsl,imx6q-ccm", imx6q_clocks_init);
diff --git a/arch/arm/mach-imx/clk-imx6sl.c b/arch/arm/mach-imx/clk-imx6sl.c
deleted file mode 100644 (file)
index e982ebe..0000000
+++ /dev/null
@@ -1,450 +0,0 @@
-/*
- * Copyright 2013-2014 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.
- *
- */
-
-#include <linux/clk.h>
-#include <linux/clkdev.h>
-#include <linux/err.h>
-#include <linux/of.h>
-#include <linux/of_address.h>
-#include <linux/of_irq.h>
-#include <dt-bindings/clock/imx6sl-clock.h>
-
-#include "clk.h"
-#include "common.h"
-
-#define CCSR                   0xc
-#define BM_CCSR_PLL1_SW_CLK_SEL        (1 << 2)
-#define CACRR                  0x10
-#define CDHIPR                 0x48
-#define BM_CDHIPR_ARM_PODF_BUSY        (1 << 16)
-#define ARM_WAIT_DIV_396M      2
-#define ARM_WAIT_DIV_792M      4
-#define ARM_WAIT_DIV_996M      6
-
-#define PLL_ARM                        0x0
-#define BM_PLL_ARM_DIV_SELECT  (0x7f << 0)
-#define BM_PLL_ARM_POWERDOWN   (1 << 12)
-#define BM_PLL_ARM_ENABLE      (1 << 13)
-#define BM_PLL_ARM_LOCK                (1 << 31)
-#define PLL_ARM_DIV_792M       66
-
-static const char *step_sels[]         = { "osc", "pll2_pfd2", };
-static const char *pll1_sw_sels[]      = { "pll1_sys", "step", };
-static const char *ocram_alt_sels[]    = { "pll2_pfd2", "pll3_pfd1", };
-static const char *ocram_sels[]                = { "periph", "ocram_alt_sels", };
-static const char *pre_periph_sels[]   = { "pll2_bus", "pll2_pfd2", "pll2_pfd0", "pll2_198m", };
-static const char *periph_clk2_sels[]  = { "pll3_usb_otg", "osc", "osc", "dummy", };
-static const char *periph2_clk2_sels[] = { "pll3_usb_otg", "pll2_bus", };
-static const char *periph_sels[]       = { "pre_periph_sel", "periph_clk2_podf", };
-static const char *periph2_sels[]      = { "pre_periph2_sel", "periph2_clk2_podf", };
-static const char *csi_sels[]          = { "osc", "pll2_pfd2", "pll3_120m", "pll3_pfd1", };
-static const char *lcdif_axi_sels[]    = { "pll2_bus", "pll2_pfd2", "pll3_usb_otg", "pll3_pfd1", };
-static const char *usdhc_sels[]                = { "pll2_pfd2", "pll2_pfd0", };
-static const char *ssi_sels[]          = { "pll3_pfd2", "pll3_pfd3", "pll4_audio_div", "dummy", };
-static const char *perclk_sels[]       = { "ipg", "osc", };
-static const char *pxp_axi_sels[]      = { "pll2_bus", "pll3_usb_otg", "pll5_video_div", "pll2_pfd0", "pll2_pfd2", "pll3_pfd3", };
-static const char *epdc_axi_sels[]     = { "pll2_bus", "pll3_usb_otg", "pll5_video_div", "pll2_pfd0", "pll2_pfd2", "pll3_pfd2", };
-static const char *gpu2d_ovg_sels[]    = { "pll3_pfd1", "pll3_usb_otg", "pll2_bus", "pll2_pfd2", };
-static const char *gpu2d_sels[]                = { "pll2_pfd2", "pll3_usb_otg", "pll3_pfd1", "pll2_bus", };
-static const char *lcdif_pix_sels[]    = { "pll2_bus", "pll3_usb_otg", "pll5_video_div", "pll2_pfd0", "pll3_pfd0", "pll3_pfd1", };
-static const char *epdc_pix_sels[]     = { "pll2_bus", "pll3_usb_otg", "pll5_video_div", "pll2_pfd0", "pll2_pfd1", "pll3_pfd1", };
-static const char *audio_sels[]                = { "pll4_audio_div", "pll3_pfd2", "pll3_pfd3", "pll3_usb_otg", };
-static const char *ecspi_sels[]                = { "pll3_60m", "osc", };
-static const char *uart_sels[]         = { "pll3_80m", "osc", };
-static const char *lvds_sels[]         = {
-       "pll1_sys", "pll2_bus", "pll2_pfd0", "pll2_pfd1", "pll2_pfd2", "dummy", "pll4_audio", "pll5_video",
-       "dummy", "enet_ref", "dummy", "dummy", "pll3_usb_otg", "pll7_usb_host", "pll3_pfd0", "pll3_pfd1",
-       "pll3_pfd2", "pll3_pfd3", "osc", "dummy", "dummy", "dummy", "dummy", "dummy",
-        "dummy", "dummy", "dummy", "dummy", "dummy", "dummy", "dummy", "dummy",
-};
-static const char *pll_bypass_src_sels[] = { "osc", "lvds1_in", };
-static const char *pll1_bypass_sels[]  = { "pll1", "pll1_bypass_src", };
-static const char *pll2_bypass_sels[]  = { "pll2", "pll2_bypass_src", };
-static const char *pll3_bypass_sels[]  = { "pll3", "pll3_bypass_src", };
-static const char *pll4_bypass_sels[]  = { "pll4", "pll4_bypass_src", };
-static const char *pll5_bypass_sels[]  = { "pll5", "pll5_bypass_src", };
-static const char *pll6_bypass_sels[]  = { "pll6", "pll6_bypass_src", };
-static const char *pll7_bypass_sels[]  = { "pll7", "pll7_bypass_src", };
-
-static struct clk_div_table clk_enet_ref_table[] = {
-       { .val = 0, .div = 20, },
-       { .val = 1, .div = 10, },
-       { .val = 2, .div = 5, },
-       { .val = 3, .div = 4, },
-       { }
-};
-
-static struct clk_div_table post_div_table[] = {
-       { .val = 2, .div = 1, },
-       { .val = 1, .div = 2, },
-       { .val = 0, .div = 4, },
-       { }
-};
-
-static struct clk_div_table video_div_table[] = {
-       { .val = 0, .div = 1, },
-       { .val = 1, .div = 2, },
-       { .val = 2, .div = 1, },
-       { .val = 3, .div = 4, },
-       { }
-};
-
-static unsigned int share_count_ssi1;
-static unsigned int share_count_ssi2;
-static unsigned int share_count_ssi3;
-
-static struct clk *clks[IMX6SL_CLK_END];
-static struct clk_onecell_data clk_data;
-static void __iomem *ccm_base;
-static void __iomem *anatop_base;
-
-static const u32 clks_init_on[] __initconst = {
-       IMX6SL_CLK_IPG, IMX6SL_CLK_ARM, IMX6SL_CLK_MMDC_ROOT,
-};
-
-/*
- * ERR005311 CCM: After exit from WAIT mode, unwanted interrupt(s) taken
- *           during WAIT mode entry process could cause cache memory
- *           corruption.
- *
- * Software workaround:
- *     To prevent this issue from occurring, software should ensure that the
- * ARM to IPG clock ratio is less than 12:5 (that is < 2.4x), before
- * entering WAIT mode.
- *
- * This function will set the ARM clk to max value within the 12:5 limit.
- * As IPG clock is fixed at 66MHz(so ARM freq must not exceed 158.4MHz),
- * ARM freq are one of below setpoints: 396MHz, 792MHz and 996MHz, since
- * the clk APIs can NOT be called in idle thread(may cause kernel schedule
- * as there is sleep function in PLL wait function), so here we just slow
- * down ARM to below freq according to previous freq:
- *
- * run mode      wait mode
- * 396MHz   ->   132MHz;
- * 792MHz   ->   158.4MHz;
- * 996MHz   ->   142.3MHz;
- */
-static int imx6sl_get_arm_divider_for_wait(void)
-{
-       if (readl_relaxed(ccm_base + CCSR) & BM_CCSR_PLL1_SW_CLK_SEL) {
-               return ARM_WAIT_DIV_396M;
-       } else {
-               if ((readl_relaxed(anatop_base + PLL_ARM) &
-                       BM_PLL_ARM_DIV_SELECT) == PLL_ARM_DIV_792M)
-                       return ARM_WAIT_DIV_792M;
-               else
-                       return ARM_WAIT_DIV_996M;
-       }
-}
-
-static void imx6sl_enable_pll_arm(bool enable)
-{
-       static u32 saved_pll_arm;
-       u32 val;
-
-       if (enable) {
-               saved_pll_arm = val = readl_relaxed(anatop_base + PLL_ARM);
-               val |= BM_PLL_ARM_ENABLE;
-               val &= ~BM_PLL_ARM_POWERDOWN;
-               writel_relaxed(val, anatop_base + PLL_ARM);
-               while (!(__raw_readl(anatop_base + PLL_ARM) & BM_PLL_ARM_LOCK))
-                       ;
-       } else {
-                writel_relaxed(saved_pll_arm, anatop_base + PLL_ARM);
-       }
-}
-
-void imx6sl_set_wait_clk(bool enter)
-{
-       static unsigned long saved_arm_div;
-       int arm_div_for_wait = imx6sl_get_arm_divider_for_wait();
-
-       /*
-        * According to hardware design, arm podf change need
-        * PLL1 clock enabled.
-        */
-       if (arm_div_for_wait == ARM_WAIT_DIV_396M)
-               imx6sl_enable_pll_arm(true);
-
-       if (enter) {
-               saved_arm_div = readl_relaxed(ccm_base + CACRR);
-               writel_relaxed(arm_div_for_wait, ccm_base + CACRR);
-       } else {
-               writel_relaxed(saved_arm_div, ccm_base + CACRR);
-       }
-       while (__raw_readl(ccm_base + CDHIPR) & BM_CDHIPR_ARM_PODF_BUSY)
-               ;
-
-       if (arm_div_for_wait == ARM_WAIT_DIV_396M)
-               imx6sl_enable_pll_arm(false);
-}
-
-static void __init imx6sl_clocks_init(struct device_node *ccm_node)
-{
-       struct device_node *np;
-       void __iomem *base;
-       int i;
-       int ret;
-
-       clks[IMX6SL_CLK_DUMMY] = imx_clk_fixed("dummy", 0);
-       clks[IMX6SL_CLK_CKIL] = imx_obtain_fixed_clock("ckil", 0);
-       clks[IMX6SL_CLK_OSC] = imx_obtain_fixed_clock("osc", 0);
-       /* Clock source from external clock via CLK1 PAD */
-       clks[IMX6SL_CLK_ANACLK1] = imx_obtain_fixed_clock("anaclk1", 0);
-
-       np = of_find_compatible_node(NULL, NULL, "fsl,imx6sl-anatop");
-       base = of_iomap(np, 0);
-       WARN_ON(!base);
-       anatop_base = base;
-
-       clks[IMX6SL_PLL1_BYPASS_SRC] = imx_clk_mux("pll1_bypass_src", base + 0x00, 14, 1, pll_bypass_src_sels, ARRAY_SIZE(pll_bypass_src_sels));
-       clks[IMX6SL_PLL2_BYPASS_SRC] = imx_clk_mux("pll2_bypass_src", base + 0x30, 14, 1, pll_bypass_src_sels, ARRAY_SIZE(pll_bypass_src_sels));
-       clks[IMX6SL_PLL3_BYPASS_SRC] = imx_clk_mux("pll3_bypass_src", base + 0x10, 14, 1, pll_bypass_src_sels, ARRAY_SIZE(pll_bypass_src_sels));
-       clks[IMX6SL_PLL4_BYPASS_SRC] = imx_clk_mux("pll4_bypass_src", base + 0x70, 14, 1, pll_bypass_src_sels, ARRAY_SIZE(pll_bypass_src_sels));
-       clks[IMX6SL_PLL5_BYPASS_SRC] = imx_clk_mux("pll5_bypass_src", base + 0xa0, 14, 1, pll_bypass_src_sels, ARRAY_SIZE(pll_bypass_src_sels));
-       clks[IMX6SL_PLL6_BYPASS_SRC] = imx_clk_mux("pll6_bypass_src", base + 0xe0, 14, 1, pll_bypass_src_sels, ARRAY_SIZE(pll_bypass_src_sels));
-       clks[IMX6SL_PLL7_BYPASS_SRC] = imx_clk_mux("pll7_bypass_src", base + 0x20, 14, 1, pll_bypass_src_sels, ARRAY_SIZE(pll_bypass_src_sels));
-
-       /*                                    type               name    parent_name        base         div_mask */
-       clks[IMX6SL_CLK_PLL1] = imx_clk_pllv3(IMX_PLLV3_SYS,     "pll1", "pll1_bypass_src", base + 0x00, 0x7f);
-       clks[IMX6SL_CLK_PLL2] = imx_clk_pllv3(IMX_PLLV3_GENERIC, "pll2", "pll2_bypass_src", base + 0x30, 0x1);
-       clks[IMX6SL_CLK_PLL3] = imx_clk_pllv3(IMX_PLLV3_USB,     "pll3", "pll3_bypass_src", base + 0x10, 0x3);
-       clks[IMX6SL_CLK_PLL4] = imx_clk_pllv3(IMX_PLLV3_AV,      "pll4", "pll4_bypass_src", base + 0x70, 0x7f);
-       clks[IMX6SL_CLK_PLL5] = imx_clk_pllv3(IMX_PLLV3_AV,      "pll5", "pll5_bypass_src", base + 0xa0, 0x7f);
-       clks[IMX6SL_CLK_PLL6] = imx_clk_pllv3(IMX_PLLV3_ENET,    "pll6", "pll6_bypass_src", base + 0xe0, 0x3);
-       clks[IMX6SL_CLK_PLL7] = imx_clk_pllv3(IMX_PLLV3_USB,     "pll7", "pll7_bypass_src", base + 0x20, 0x3);
-
-       clks[IMX6SL_PLL1_BYPASS] = imx_clk_mux_flags("pll1_bypass", base + 0x00, 16, 1, pll1_bypass_sels, ARRAY_SIZE(pll1_bypass_sels), CLK_SET_RATE_PARENT);
-       clks[IMX6SL_PLL2_BYPASS] = imx_clk_mux_flags("pll2_bypass", base + 0x30, 16, 1, pll2_bypass_sels, ARRAY_SIZE(pll2_bypass_sels), CLK_SET_RATE_PARENT);
-       clks[IMX6SL_PLL3_BYPASS] = imx_clk_mux_flags("pll3_bypass", base + 0x10, 16, 1, pll3_bypass_sels, ARRAY_SIZE(pll3_bypass_sels), CLK_SET_RATE_PARENT);
-       clks[IMX6SL_PLL4_BYPASS] = imx_clk_mux_flags("pll4_bypass", base + 0x70, 16, 1, pll4_bypass_sels, ARRAY_SIZE(pll4_bypass_sels), CLK_SET_RATE_PARENT);
-       clks[IMX6SL_PLL5_BYPASS] = imx_clk_mux_flags("pll5_bypass", base + 0xa0, 16, 1, pll5_bypass_sels, ARRAY_SIZE(pll5_bypass_sels), CLK_SET_RATE_PARENT);
-       clks[IMX6SL_PLL6_BYPASS] = imx_clk_mux_flags("pll6_bypass", base + 0xe0, 16, 1, pll6_bypass_sels, ARRAY_SIZE(pll6_bypass_sels), CLK_SET_RATE_PARENT);
-       clks[IMX6SL_PLL7_BYPASS] = imx_clk_mux_flags("pll7_bypass", base + 0x20, 16, 1, pll7_bypass_sels, ARRAY_SIZE(pll7_bypass_sels), CLK_SET_RATE_PARENT);
-
-       /* Do not bypass PLLs initially */
-       clk_set_parent(clks[IMX6SL_PLL1_BYPASS], clks[IMX6SL_CLK_PLL1]);
-       clk_set_parent(clks[IMX6SL_PLL2_BYPASS], clks[IMX6SL_CLK_PLL2]);
-       clk_set_parent(clks[IMX6SL_PLL3_BYPASS], clks[IMX6SL_CLK_PLL3]);
-       clk_set_parent(clks[IMX6SL_PLL4_BYPASS], clks[IMX6SL_CLK_PLL4]);
-       clk_set_parent(clks[IMX6SL_PLL5_BYPASS], clks[IMX6SL_CLK_PLL5]);
-       clk_set_parent(clks[IMX6SL_PLL6_BYPASS], clks[IMX6SL_CLK_PLL6]);
-       clk_set_parent(clks[IMX6SL_PLL7_BYPASS], clks[IMX6SL_CLK_PLL7]);
-
-       clks[IMX6SL_CLK_PLL1_SYS]      = imx_clk_gate("pll1_sys",      "pll1_bypass", base + 0x00, 13);
-       clks[IMX6SL_CLK_PLL2_BUS]      = imx_clk_gate("pll2_bus",      "pll2_bypass", base + 0x30, 13);
-       clks[IMX6SL_CLK_PLL3_USB_OTG]  = imx_clk_gate("pll3_usb_otg",  "pll3_bypass", base + 0x10, 13);
-       clks[IMX6SL_CLK_PLL4_AUDIO]    = imx_clk_gate("pll4_audio",    "pll4_bypass", base + 0x70, 13);
-       clks[IMX6SL_CLK_PLL5_VIDEO]    = imx_clk_gate("pll5_video",    "pll5_bypass", base + 0xa0, 13);
-       clks[IMX6SL_CLK_PLL6_ENET]     = imx_clk_gate("pll6_enet",     "pll6_bypass", base + 0xe0, 13);
-       clks[IMX6SL_CLK_PLL7_USB_HOST] = imx_clk_gate("pll7_usb_host", "pll7_bypass", base + 0x20, 13);
-
-       clks[IMX6SL_CLK_LVDS1_SEL] = imx_clk_mux("lvds1_sel", base + 0x160, 0, 5, lvds_sels, ARRAY_SIZE(lvds_sels));
-       clks[IMX6SL_CLK_LVDS1_OUT] = imx_clk_gate_exclusive("lvds1_out", "lvds1_sel", base + 0x160, 10, BIT(12));
-       clks[IMX6SL_CLK_LVDS1_IN] = imx_clk_gate_exclusive("lvds1_in", "anaclk1", base + 0x160, 12, BIT(10));
-
-       /*
-        * usbphy1 and usbphy2 are implemented as dummy gates using reserve
-        * bit 20.  They are used by phy driver to keep the refcount of
-        * parent PLL correct. usbphy1_gate and usbphy2_gate only needs to be
-        * turned on during boot, and software will not need to control it
-        * anymore after that.
-        */
-       clks[IMX6SL_CLK_USBPHY1]      = imx_clk_gate("usbphy1",      "pll3_usb_otg",  base + 0x10, 20);
-       clks[IMX6SL_CLK_USBPHY2]      = imx_clk_gate("usbphy2",      "pll7_usb_host", base + 0x20, 20);
-       clks[IMX6SL_CLK_USBPHY1_GATE] = imx_clk_gate("usbphy1_gate", "dummy",         base + 0x10, 6);
-       clks[IMX6SL_CLK_USBPHY2_GATE] = imx_clk_gate("usbphy2_gate", "dummy",         base + 0x20, 6);
-
-       /*                                                           dev   name              parent_name      flags                reg        shift width div: flags, div_table lock */
-       clks[IMX6SL_CLK_PLL4_POST_DIV]  = clk_register_divider_table(NULL, "pll4_post_div",  "pll4_audio",    CLK_SET_RATE_PARENT, base + 0x70,  19, 2,   0, post_div_table, &imx_ccm_lock);
-       clks[IMX6SL_CLK_PLL4_AUDIO_DIV] =       clk_register_divider(NULL, "pll4_audio_div", "pll4_post_div", CLK_SET_RATE_PARENT, base + 0x170, 15, 1,   0, &imx_ccm_lock);
-       clks[IMX6SL_CLK_PLL5_POST_DIV]  = clk_register_divider_table(NULL, "pll5_post_div",  "pll5_video",    CLK_SET_RATE_PARENT, base + 0xa0,  19, 2,   0, post_div_table, &imx_ccm_lock);
-       clks[IMX6SL_CLK_PLL5_VIDEO_DIV] = clk_register_divider_table(NULL, "pll5_video_div", "pll5_post_div", CLK_SET_RATE_PARENT, base + 0x170, 30, 2,   0, video_div_table, &imx_ccm_lock);
-       clks[IMX6SL_CLK_ENET_REF]       = clk_register_divider_table(NULL, "enet_ref",       "pll6_enet",     0,                   base + 0xe0,  0,  2,   0, clk_enet_ref_table, &imx_ccm_lock);
-
-       /*                                       name         parent_name     reg           idx */
-       clks[IMX6SL_CLK_PLL2_PFD0] = imx_clk_pfd("pll2_pfd0", "pll2_bus",     base + 0x100, 0);
-       clks[IMX6SL_CLK_PLL2_PFD1] = imx_clk_pfd("pll2_pfd1", "pll2_bus",     base + 0x100, 1);
-       clks[IMX6SL_CLK_PLL2_PFD2] = imx_clk_pfd("pll2_pfd2", "pll2_bus",     base + 0x100, 2);
-       clks[IMX6SL_CLK_PLL3_PFD0] = imx_clk_pfd("pll3_pfd0", "pll3_usb_otg", base + 0xf0,  0);
-       clks[IMX6SL_CLK_PLL3_PFD1] = imx_clk_pfd("pll3_pfd1", "pll3_usb_otg", base + 0xf0,  1);
-       clks[IMX6SL_CLK_PLL3_PFD2] = imx_clk_pfd("pll3_pfd2", "pll3_usb_otg", base + 0xf0,  2);
-       clks[IMX6SL_CLK_PLL3_PFD3] = imx_clk_pfd("pll3_pfd3", "pll3_usb_otg", base + 0xf0,  3);
-
-       /*                                                name         parent_name     mult div */
-       clks[IMX6SL_CLK_PLL2_198M] = imx_clk_fixed_factor("pll2_198m", "pll2_pfd2",      1, 2);
-       clks[IMX6SL_CLK_PLL3_120M] = imx_clk_fixed_factor("pll3_120m", "pll3_usb_otg",   1, 4);
-       clks[IMX6SL_CLK_PLL3_80M]  = imx_clk_fixed_factor("pll3_80m",  "pll3_usb_otg",   1, 6);
-       clks[IMX6SL_CLK_PLL3_60M]  = imx_clk_fixed_factor("pll3_60m",  "pll3_usb_otg",   1, 8);
-
-       np = ccm_node;
-       base = of_iomap(np, 0);
-       WARN_ON(!base);
-       ccm_base = base;
-
-       /* Reuse imx6q pm code */
-       imx6q_pm_set_ccm_base(base);
-
-       /*                                              name                reg       shift width parent_names     num_parents */
-       clks[IMX6SL_CLK_STEP]             = imx_clk_mux("step",             base + 0xc,  8,  1, step_sels,         ARRAY_SIZE(step_sels));
-       clks[IMX6SL_CLK_PLL1_SW]          = imx_clk_mux("pll1_sw",          base + 0xc,  2,  1, pll1_sw_sels,      ARRAY_SIZE(pll1_sw_sels));
-       clks[IMX6SL_CLK_OCRAM_ALT_SEL]    = imx_clk_mux("ocram_alt_sel",    base + 0x14, 7,  1, ocram_alt_sels,    ARRAY_SIZE(ocram_alt_sels));
-       clks[IMX6SL_CLK_OCRAM_SEL]        = imx_clk_mux("ocram_sel",        base + 0x14, 6,  1, ocram_sels,        ARRAY_SIZE(ocram_sels));
-       clks[IMX6SL_CLK_PRE_PERIPH2_SEL]  = imx_clk_mux("pre_periph2_sel",  base + 0x18, 21, 2, pre_periph_sels,   ARRAY_SIZE(pre_periph_sels));
-       clks[IMX6SL_CLK_PRE_PERIPH_SEL]   = imx_clk_mux("pre_periph_sel",   base + 0x18, 18, 2, pre_periph_sels,   ARRAY_SIZE(pre_periph_sels));
-       clks[IMX6SL_CLK_PERIPH2_CLK2_SEL] = imx_clk_mux("periph2_clk2_sel", base + 0x18, 20, 1, periph2_clk2_sels, ARRAY_SIZE(periph2_clk2_sels));
-       clks[IMX6SL_CLK_PERIPH_CLK2_SEL]  = imx_clk_mux("periph_clk2_sel",  base + 0x18, 12, 2, periph_clk2_sels,  ARRAY_SIZE(periph_clk2_sels));
-       clks[IMX6SL_CLK_CSI_SEL]          = imx_clk_mux("csi_sel",          base + 0x3c, 9,  2, csi_sels,          ARRAY_SIZE(csi_sels));
-       clks[IMX6SL_CLK_LCDIF_AXI_SEL]    = imx_clk_mux("lcdif_axi_sel",    base + 0x3c, 14, 2, lcdif_axi_sels,    ARRAY_SIZE(lcdif_axi_sels));
-       clks[IMX6SL_CLK_USDHC1_SEL]       = imx_clk_fixup_mux("usdhc1_sel", base + 0x1c, 16, 1, usdhc_sels,        ARRAY_SIZE(usdhc_sels),  imx_cscmr1_fixup);
-       clks[IMX6SL_CLK_USDHC2_SEL]       = imx_clk_fixup_mux("usdhc2_sel", base + 0x1c, 17, 1, usdhc_sels,        ARRAY_SIZE(usdhc_sels),  imx_cscmr1_fixup);
-       clks[IMX6SL_CLK_USDHC3_SEL]       = imx_clk_fixup_mux("usdhc3_sel", base + 0x1c, 18, 1, usdhc_sels,        ARRAY_SIZE(usdhc_sels),  imx_cscmr1_fixup);
-       clks[IMX6SL_CLK_USDHC4_SEL]       = imx_clk_fixup_mux("usdhc4_sel", base + 0x1c, 19, 1, usdhc_sels,        ARRAY_SIZE(usdhc_sels),  imx_cscmr1_fixup);
-       clks[IMX6SL_CLK_SSI1_SEL]         = imx_clk_fixup_mux("ssi1_sel",   base + 0x1c, 10, 2, ssi_sels,          ARRAY_SIZE(ssi_sels),    imx_cscmr1_fixup);
-       clks[IMX6SL_CLK_SSI2_SEL]         = imx_clk_fixup_mux("ssi2_sel",   base + 0x1c, 12, 2, ssi_sels,          ARRAY_SIZE(ssi_sels),    imx_cscmr1_fixup);
-       clks[IMX6SL_CLK_SSI3_SEL]         = imx_clk_fixup_mux("ssi3_sel",   base + 0x1c, 14, 2, ssi_sels,          ARRAY_SIZE(ssi_sels),    imx_cscmr1_fixup);
-       clks[IMX6SL_CLK_PERCLK_SEL]       = imx_clk_fixup_mux("perclk_sel", base + 0x1c, 6,  1, perclk_sels,       ARRAY_SIZE(perclk_sels), imx_cscmr1_fixup);
-       clks[IMX6SL_CLK_PXP_AXI_SEL]      = imx_clk_mux("pxp_axi_sel",      base + 0x34, 6,  3, pxp_axi_sels,      ARRAY_SIZE(pxp_axi_sels));
-       clks[IMX6SL_CLK_EPDC_AXI_SEL]     = imx_clk_mux("epdc_axi_sel",     base + 0x34, 15, 3, epdc_axi_sels,     ARRAY_SIZE(epdc_axi_sels));
-       clks[IMX6SL_CLK_GPU2D_OVG_SEL]    = imx_clk_mux("gpu2d_ovg_sel",    base + 0x18, 4,  2, gpu2d_ovg_sels,    ARRAY_SIZE(gpu2d_ovg_sels));
-       clks[IMX6SL_CLK_GPU2D_SEL]        = imx_clk_mux("gpu2d_sel",        base + 0x18, 8,  2, gpu2d_sels,        ARRAY_SIZE(gpu2d_sels));
-       clks[IMX6SL_CLK_LCDIF_PIX_SEL]    = imx_clk_mux("lcdif_pix_sel",    base + 0x38, 6,  3, lcdif_pix_sels,    ARRAY_SIZE(lcdif_pix_sels));
-       clks[IMX6SL_CLK_EPDC_PIX_SEL]     = imx_clk_mux("epdc_pix_sel",     base + 0x38, 15, 3, epdc_pix_sels,     ARRAY_SIZE(epdc_pix_sels));
-       clks[IMX6SL_CLK_SPDIF0_SEL]       = imx_clk_mux("spdif0_sel",       base + 0x30, 20, 2, audio_sels,        ARRAY_SIZE(audio_sels));
-       clks[IMX6SL_CLK_SPDIF1_SEL]       = imx_clk_mux("spdif1_sel",       base + 0x30, 7,  2, audio_sels,        ARRAY_SIZE(audio_sels));
-       clks[IMX6SL_CLK_EXTERN_AUDIO_SEL] = imx_clk_mux("extern_audio_sel", base + 0x20, 19, 2, audio_sels,        ARRAY_SIZE(audio_sels));
-       clks[IMX6SL_CLK_ECSPI_SEL]        = imx_clk_mux("ecspi_sel",        base + 0x38, 18, 1, ecspi_sels,        ARRAY_SIZE(ecspi_sels));
-       clks[IMX6SL_CLK_UART_SEL]         = imx_clk_mux("uart_sel",         base + 0x24, 6,  1, uart_sels,         ARRAY_SIZE(uart_sels));
-
-       /*                                          name       reg        shift width busy: reg, shift parent_names  num_parents */
-       clks[IMX6SL_CLK_PERIPH]  = imx_clk_busy_mux("periph",  base + 0x14, 25,  1,   base + 0x48, 5,  periph_sels,  ARRAY_SIZE(periph_sels));
-       clks[IMX6SL_CLK_PERIPH2] = imx_clk_busy_mux("periph2", base + 0x14, 26,  1,   base + 0x48, 3,  periph2_sels, ARRAY_SIZE(periph2_sels));
-
-       /*                                                   name                 parent_name          reg       shift width */
-       clks[IMX6SL_CLK_OCRAM_PODF]        = imx_clk_divider("ocram_podf",        "ocram_sel",         base + 0x14, 16, 3);
-       clks[IMX6SL_CLK_PERIPH_CLK2_PODF]  = imx_clk_divider("periph_clk2_podf",  "periph_clk2_sel",   base + 0x14, 27, 3);
-       clks[IMX6SL_CLK_PERIPH2_CLK2_PODF] = imx_clk_divider("periph2_clk2_podf", "periph2_clk2_sel",  base + 0x14, 0,  3);
-       clks[IMX6SL_CLK_IPG]               = imx_clk_divider("ipg",               "ahb",               base + 0x14, 8,  2);
-       clks[IMX6SL_CLK_CSI_PODF]          = imx_clk_divider("csi_podf",          "csi_sel",           base + 0x3c, 11, 3);
-       clks[IMX6SL_CLK_LCDIF_AXI_PODF]    = imx_clk_divider("lcdif_axi_podf",    "lcdif_axi_sel",     base + 0x3c, 16, 3);
-       clks[IMX6SL_CLK_USDHC1_PODF]       = imx_clk_divider("usdhc1_podf",       "usdhc1_sel",        base + 0x24, 11, 3);
-       clks[IMX6SL_CLK_USDHC2_PODF]       = imx_clk_divider("usdhc2_podf",       "usdhc2_sel",        base + 0x24, 16, 3);
-       clks[IMX6SL_CLK_USDHC3_PODF]       = imx_clk_divider("usdhc3_podf",       "usdhc3_sel",        base + 0x24, 19, 3);
-       clks[IMX6SL_CLK_USDHC4_PODF]       = imx_clk_divider("usdhc4_podf",       "usdhc4_sel",        base + 0x24, 22, 3);
-       clks[IMX6SL_CLK_SSI1_PRED]         = imx_clk_divider("ssi1_pred",         "ssi1_sel",          base + 0x28, 6,  3);
-       clks[IMX6SL_CLK_SSI1_PODF]         = imx_clk_divider("ssi1_podf",         "ssi1_pred",         base + 0x28, 0,  6);
-       clks[IMX6SL_CLK_SSI2_PRED]         = imx_clk_divider("ssi2_pred",         "ssi2_sel",          base + 0x2c, 6,  3);
-       clks[IMX6SL_CLK_SSI2_PODF]         = imx_clk_divider("ssi2_podf",         "ssi2_pred",         base + 0x2c, 0,  6);
-       clks[IMX6SL_CLK_SSI3_PRED]         = imx_clk_divider("ssi3_pred",         "ssi3_sel",          base + 0x28, 22, 3);
-       clks[IMX6SL_CLK_SSI3_PODF]         = imx_clk_divider("ssi3_podf",         "ssi3_pred",         base + 0x28, 16, 6);
-       clks[IMX6SL_CLK_PERCLK]            = imx_clk_fixup_divider("perclk",      "perclk_sel",        base + 0x1c, 0,  6, imx_cscmr1_fixup);
-       clks[IMX6SL_CLK_PXP_AXI_PODF]      = imx_clk_divider("pxp_axi_podf",      "pxp_axi_sel",       base + 0x34, 3,  3);
-       clks[IMX6SL_CLK_EPDC_AXI_PODF]     = imx_clk_divider("epdc_axi_podf",     "epdc_axi_sel",      base + 0x34, 12, 3);
-       clks[IMX6SL_CLK_GPU2D_OVG_PODF]    = imx_clk_divider("gpu2d_ovg_podf",    "gpu2d_ovg_sel",     base + 0x18, 26, 3);
-       clks[IMX6SL_CLK_GPU2D_PODF]        = imx_clk_divider("gpu2d_podf",        "gpu2d_sel",         base + 0x18, 29, 3);
-       clks[IMX6SL_CLK_LCDIF_PIX_PRED]    = imx_clk_divider("lcdif_pix_pred",    "lcdif_pix_sel",     base + 0x38, 3,  3);
-       clks[IMX6SL_CLK_EPDC_PIX_PRED]     = imx_clk_divider("epdc_pix_pred",     "epdc_pix_sel",      base + 0x38, 12, 3);
-       clks[IMX6SL_CLK_LCDIF_PIX_PODF]    = imx_clk_fixup_divider("lcdif_pix_podf", "lcdif_pix_pred", base + 0x1c, 20, 3, imx_cscmr1_fixup);
-       clks[IMX6SL_CLK_EPDC_PIX_PODF]     = imx_clk_divider("epdc_pix_podf",     "epdc_pix_pred",     base + 0x18, 23, 3);
-       clks[IMX6SL_CLK_SPDIF0_PRED]       = imx_clk_divider("spdif0_pred",       "spdif0_sel",        base + 0x30, 25, 3);
-       clks[IMX6SL_CLK_SPDIF0_PODF]       = imx_clk_divider("spdif0_podf",       "spdif0_pred",       base + 0x30, 22, 3);
-       clks[IMX6SL_CLK_SPDIF1_PRED]       = imx_clk_divider("spdif1_pred",       "spdif1_sel",        base + 0x30, 12, 3);
-       clks[IMX6SL_CLK_SPDIF1_PODF]       = imx_clk_divider("spdif1_podf",       "spdif1_pred",       base + 0x30, 9,  3);
-       clks[IMX6SL_CLK_EXTERN_AUDIO_PRED] = imx_clk_divider("extern_audio_pred", "extern_audio_sel",  base + 0x28, 9,  3);
-       clks[IMX6SL_CLK_EXTERN_AUDIO_PODF] = imx_clk_divider("extern_audio_podf", "extern_audio_pred", base + 0x28, 25, 3);
-       clks[IMX6SL_CLK_ECSPI_ROOT]        = imx_clk_divider("ecspi_root",        "ecspi_sel",         base + 0x38, 19, 6);
-       clks[IMX6SL_CLK_UART_ROOT]         = imx_clk_divider("uart_root",         "uart_sel",          base + 0x24, 0,  6);
-
-       /*                                                name         parent_name reg       shift width busy: reg, shift */
-       clks[IMX6SL_CLK_AHB]       = imx_clk_busy_divider("ahb",       "periph",  base + 0x14, 10, 3,    base + 0x48, 1);
-       clks[IMX6SL_CLK_MMDC_ROOT] = imx_clk_busy_divider("mmdc",      "periph2", base + 0x14, 3,  3,    base + 0x48, 2);
-       clks[IMX6SL_CLK_ARM]       = imx_clk_busy_divider("arm",       "pll1_sw", base + 0x10, 0,  3,    base + 0x48, 16);
-
-       /*                                            name            parent_name          reg         shift */
-       clks[IMX6SL_CLK_ECSPI1]       = imx_clk_gate2("ecspi1",       "ecspi_root",        base + 0x6c, 0);
-       clks[IMX6SL_CLK_ECSPI2]       = imx_clk_gate2("ecspi2",       "ecspi_root",        base + 0x6c, 2);
-       clks[IMX6SL_CLK_ECSPI3]       = imx_clk_gate2("ecspi3",       "ecspi_root",        base + 0x6c, 4);
-       clks[IMX6SL_CLK_ECSPI4]       = imx_clk_gate2("ecspi4",       "ecspi_root",        base + 0x6c, 6);
-       clks[IMX6SL_CLK_ENET]         = imx_clk_gate2("enet",         "ipg",               base + 0x6c, 10);
-       clks[IMX6SL_CLK_EPIT1]        = imx_clk_gate2("epit1",        "perclk",            base + 0x6c, 12);
-       clks[IMX6SL_CLK_EPIT2]        = imx_clk_gate2("epit2",        "perclk",            base + 0x6c, 14);
-       clks[IMX6SL_CLK_EXTERN_AUDIO] = imx_clk_gate2("extern_audio", "extern_audio_podf", base + 0x6c, 16);
-       clks[IMX6SL_CLK_GPT]          = imx_clk_gate2("gpt",          "perclk",            base + 0x6c, 20);
-       clks[IMX6SL_CLK_GPT_SERIAL]   = imx_clk_gate2("gpt_serial",   "perclk",            base + 0x6c, 22);
-       clks[IMX6SL_CLK_GPU2D_OVG]    = imx_clk_gate2("gpu2d_ovg",    "gpu2d_ovg_podf",    base + 0x6c, 26);
-       clks[IMX6SL_CLK_I2C1]         = imx_clk_gate2("i2c1",         "perclk",            base + 0x70, 6);
-       clks[IMX6SL_CLK_I2C2]         = imx_clk_gate2("i2c2",         "perclk",            base + 0x70, 8);
-       clks[IMX6SL_CLK_I2C3]         = imx_clk_gate2("i2c3",         "perclk",            base + 0x70, 10);
-       clks[IMX6SL_CLK_OCOTP]        = imx_clk_gate2("ocotp",        "ipg",               base + 0x70, 12);
-       clks[IMX6SL_CLK_CSI]          = imx_clk_gate2("csi",          "csi_podf",          base + 0x74, 0);
-       clks[IMX6SL_CLK_PXP_AXI]      = imx_clk_gate2("pxp_axi",      "pxp_axi_podf",      base + 0x74, 2);
-       clks[IMX6SL_CLK_EPDC_AXI]     = imx_clk_gate2("epdc_axi",     "epdc_axi_podf",     base + 0x74, 4);
-       clks[IMX6SL_CLK_LCDIF_AXI]    = imx_clk_gate2("lcdif_axi",    "lcdif_axi_podf",    base + 0x74, 6);
-       clks[IMX6SL_CLK_LCDIF_PIX]    = imx_clk_gate2("lcdif_pix",    "lcdif_pix_podf",    base + 0x74, 8);
-       clks[IMX6SL_CLK_EPDC_PIX]     = imx_clk_gate2("epdc_pix",     "epdc_pix_podf",     base + 0x74, 10);
-       clks[IMX6SL_CLK_OCRAM]        = imx_clk_gate2("ocram",        "ocram_podf",        base + 0x74, 28);
-       clks[IMX6SL_CLK_PWM1]         = imx_clk_gate2("pwm1",         "perclk",            base + 0x78, 16);
-       clks[IMX6SL_CLK_PWM2]         = imx_clk_gate2("pwm2",         "perclk",            base + 0x78, 18);
-       clks[IMX6SL_CLK_PWM3]         = imx_clk_gate2("pwm3",         "perclk",            base + 0x78, 20);
-       clks[IMX6SL_CLK_PWM4]         = imx_clk_gate2("pwm4",         "perclk",            base + 0x78, 22);
-       clks[IMX6SL_CLK_SDMA]         = imx_clk_gate2("sdma",         "ipg",               base + 0x7c, 6);
-       clks[IMX6SL_CLK_SPBA]         = imx_clk_gate2("spba",         "ipg",               base + 0x7c, 12);
-       clks[IMX6SL_CLK_SPDIF]        = imx_clk_gate2("spdif",        "spdif0_podf",       base + 0x7c, 14);
-       clks[IMX6SL_CLK_SSI1_IPG]     = imx_clk_gate2_shared("ssi1_ipg",     "ipg",        base + 0x7c, 18, &share_count_ssi1);
-       clks[IMX6SL_CLK_SSI2_IPG]     = imx_clk_gate2_shared("ssi2_ipg",     "ipg",        base + 0x7c, 20, &share_count_ssi2);
-       clks[IMX6SL_CLK_SSI3_IPG]     = imx_clk_gate2_shared("ssi3_ipg",     "ipg",        base + 0x7c, 22, &share_count_ssi3);
-       clks[IMX6SL_CLK_SSI1]         = imx_clk_gate2_shared("ssi1",         "ssi1_podf",  base + 0x7c, 18, &share_count_ssi1);
-       clks[IMX6SL_CLK_SSI2]         = imx_clk_gate2_shared("ssi2",         "ssi2_podf",  base + 0x7c, 20, &share_count_ssi2);
-       clks[IMX6SL_CLK_SSI3]         = imx_clk_gate2_shared("ssi3",         "ssi3_podf",  base + 0x7c, 22, &share_count_ssi3);
-       clks[IMX6SL_CLK_UART]         = imx_clk_gate2("uart",         "ipg",               base + 0x7c, 24);
-       clks[IMX6SL_CLK_UART_SERIAL]  = imx_clk_gate2("uart_serial",  "uart_root",         base + 0x7c, 26);
-       clks[IMX6SL_CLK_USBOH3]       = imx_clk_gate2("usboh3",       "ipg",               base + 0x80, 0);
-       clks[IMX6SL_CLK_USDHC1]       = imx_clk_gate2("usdhc1",       "usdhc1_podf",       base + 0x80, 2);
-       clks[IMX6SL_CLK_USDHC2]       = imx_clk_gate2("usdhc2",       "usdhc2_podf",       base + 0x80, 4);
-       clks[IMX6SL_CLK_USDHC3]       = imx_clk_gate2("usdhc3",       "usdhc3_podf",       base + 0x80, 6);
-       clks[IMX6SL_CLK_USDHC4]       = imx_clk_gate2("usdhc4",       "usdhc4_podf",       base + 0x80, 8);
-
-       imx_check_clocks(clks, ARRAY_SIZE(clks));
-
-       clk_data.clks = clks;
-       clk_data.clk_num = ARRAY_SIZE(clks);
-       of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
-
-       /* Ensure the AHB clk is at 132MHz. */
-       ret = clk_set_rate(clks[IMX6SL_CLK_AHB], 132000000);
-       if (ret)
-               pr_warn("%s: failed to set AHB clock rate %d!\n",
-                       __func__, ret);
-
-       /*
-        * Make sure those always on clocks are enabled to maintain the correct
-        * usecount and enabling/disabling of parent PLLs.
-        */
-       for (i = 0; i < ARRAY_SIZE(clks_init_on); i++)
-               clk_prepare_enable(clks[clks_init_on[i]]);
-
-       if (IS_ENABLED(CONFIG_USB_MXS_PHY)) {
-               clk_prepare_enable(clks[IMX6SL_CLK_USBPHY1_GATE]);
-               clk_prepare_enable(clks[IMX6SL_CLK_USBPHY2_GATE]);
-       }
-
-       /* Audio-related clocks configuration */
-       clk_set_parent(clks[IMX6SL_CLK_SPDIF0_SEL], clks[IMX6SL_CLK_PLL3_PFD3]);
-
-       /* set PLL5 video as lcdif pix parent clock */
-       clk_set_parent(clks[IMX6SL_CLK_LCDIF_PIX_SEL],
-                       clks[IMX6SL_CLK_PLL5_VIDEO_DIV]);
-
-       clk_set_parent(clks[IMX6SL_CLK_LCDIF_AXI_SEL],
-                      clks[IMX6SL_CLK_PLL2_PFD2]);
-
-       /* Set initial power mode */
-       imx6q_set_lpm(WAIT_CLOCKED);
-}
-CLK_OF_DECLARE(imx6sl, "fsl,imx6sl-ccm", imx6sl_clocks_init);
diff --git a/arch/arm/mach-imx/clk-imx6sx.c b/arch/arm/mach-imx/clk-imx6sx.c
deleted file mode 100644 (file)
index 5a3e5a1..0000000
+++ /dev/null
@@ -1,567 +0,0 @@
-/*
- * Copyright (C) 2014 Freescale Semiconductor, Inc.
- *
- * 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:
- *
- * http://www.opensource.org/licenses/gpl-license.html
- * http://www.gnu.org/copyleft/gpl.html
- */
-
-#include <dt-bindings/clock/imx6sx-clock.h>
-#include <linux/clk.h>
-#include <linux/clkdev.h>
-#include <linux/err.h>
-#include <linux/init.h>
-#include <linux/io.h>
-#include <linux/of.h>
-#include <linux/of_address.h>
-#include <linux/of_irq.h>
-#include <linux/types.h>
-
-#include "clk.h"
-#include "common.h"
-
-#define CCDR    0x4
-#define BM_CCM_CCDR_MMDC_CH0_MASK       (0x2 << 16)
-
-static const char *step_sels[]         = { "osc", "pll2_pfd2_396m", };
-static const char *pll1_sw_sels[]      = { "pll1_sys", "step", };
-static const char *periph_pre_sels[]   = { "pll2_bus", "pll2_pfd2_396m", "pll2_pfd0_352m", "pll2_198m", };
-static const char *periph2_pre_sels[]  = { "pll2_bus", "pll2_pfd2_396m", "pll2_pfd0_352m", "pll4_audio_div", };
-static const char *periph_clk2_sels[]  = { "pll3_usb_otg", "osc", "osc", };
-static const char *periph2_clk2_sels[] = { "pll3_usb_otg", "osc", };
-static const char *periph_sels[]       = { "periph_pre", "periph_clk2", };
-static const char *periph2_sels[]      = { "periph2_pre", "periph2_clk2", };
-static const char *ocram_sels[]                = { "periph", "pll2_pfd2_396m", "periph", "pll3_pfd1_540m", };
-static const char *audio_sels[]                = { "pll4_audio_div", "pll3_pfd2_508m", "pll5_video_div", "pll3_usb_otg", };
-static const char *gpu_axi_sels[]      = { "pll2_pfd2_396m", "pll3_pfd0_720m", "pll3_pfd1_540m", "pll2_bus", };
-static const char *gpu_core_sels[]     = { "pll3_pfd1_540m", "pll3_pfd0_720m", "pll2_bus", "pll2_pfd2_396m", };
-static const char *ldb_di0_div_sels[]  = { "ldb_di0_div_3_5", "ldb_di0_div_7", };
-static const char *ldb_di1_div_sels[]  = { "ldb_di1_div_3_5", "ldb_di1_div_7", };
-static const char *ldb_di0_sels[]      = { "pll5_video_div", "pll2_pfd0_352m", "pll2_pfd2_396m", "pll2_pfd3_594m", "pll2_pfd1_594m", "pll3_pfd3_454m", };
-static const char *ldb_di1_sels[]      = { "pll3_usb_otg", "pll2_pfd0_352m", "pll2_pfd2_396m", "pll2_bus", "pll3_pfd3_454m", "pll3_pfd2_508m", };
-static const char *pcie_axi_sels[]     = { "axi", "ahb", };
-static const char *ssi_sels[]          = { "pll3_pfd2_508m", "pll5_video_div", "pll4_audio_div", };
-static const char *qspi1_sels[]                = { "pll3_usb_otg", "pll2_pfd0_352m", "pll2_pfd2_396m", "pll2_bus", "pll3_pfd3_454m", "pll3_pfd2_508m", };
-static const char *perclk_sels[]       = { "ipg", "osc", };
-static const char *usdhc_sels[]                = { "pll2_pfd2_396m", "pll2_pfd0_352m", };
-static const char *vid_sels[]          = { "pll3_pfd1_540m", "pll3_usb_otg", "pll3_pfd3_454m", "pll4_audio_div", "pll5_video_div", };
-static const char *can_sels[]          = { "pll3_60m", "osc", "pll3_80m", "dummy", };
-static const char *uart_sels[]         = { "pll3_80m", "osc", };
-static const char *qspi2_sels[]                = { "pll2_pfd0_352m", "pll2_bus", "pll3_usb_otg", "pll2_pfd2_396m", "pll3_pfd3_454m", "dummy", "dummy", "dummy", };
-static const char *enet_pre_sels[]     = { "pll2_bus", "pll3_usb_otg", "pll5_video_div", "pll2_pfd0_352m", "pll2_pfd2_396m", "pll3_pfd2_508m", };
-static const char *enet_sels[]         = { "enet_podf", "ipp_di0", "ipp_di1", "ldb_di0", "ldb_di1", };
-static const char *m4_pre_sels[]       = { "pll2_bus", "pll3_usb_otg", "osc", "pll2_pfd0_352m", "pll2_pfd2_396m", "pll3_pfd3_454m", };
-static const char *m4_sels[]           = { "m4_pre_sel", "ipp_di0", "ipp_di1", "ldb_di0", "ldb_di1", };
-static const char *eim_slow_sels[]     = { "ocram", "pll3_usb_otg", "pll2_pfd2_396m", "pll2_pfd0_352m", };
-static const char *ecspi_sels[]                = { "pll3_60m", "osc", };
-static const char *lcdif1_pre_sels[]   = { "pll2_bus", "pll3_pfd3_454m", "pll5_video_div", "pll2_pfd0_352m", "pll2_pfd1_594m", "pll3_pfd1_540m", };
-static const char *lcdif1_sels[]       = { "lcdif1_podf", "ipp_di0", "ipp_di1", "ldb_di0", "ldb_di1", };
-static const char *lcdif2_pre_sels[]   = { "pll2_bus", "pll3_pfd3_454m", "pll5_video_div", "pll2_pfd0_352m", "pll2_pfd3_594m", "pll3_pfd1_540m", };
-static const char *lcdif2_sels[]       = { "lcdif2_podf", "ipp_di0", "ipp_di1", "ldb_di0", "ldb_di1", };
-static const char *display_sels[]      = { "pll2_bus", "pll2_pfd2_396m", "pll3_usb_otg", "pll3_pfd1_540m", };
-static const char *csi_sels[]          = { "osc", "pll2_pfd2_396m", "pll3_120m", "pll3_pfd1_540m", };
-static const char *cko1_sels[]         = {
-       "pll3_usb_otg", "pll2_bus", "pll1_sys", "pll5_video_div",
-       "dummy", "ocram", "dummy", "pxp_axi", "epdc_axi", "lcdif_pix",
-       "epdc_pix", "ahb", "ipg", "perclk", "ckil", "pll4_audio_div",
-};
-static const char *cko2_sels[]         = {
-       "dummy", "mmdc_p0_fast", "usdhc4", "usdhc1", "dummy", "wrck",
-       "ecspi_root", "dummy", "usdhc3", "pcie", "arm", "csi_core",
-       "lcdif_axi", "dummy", "osc", "dummy", "gpu2d_ovg_core",
-       "usdhc2", "ssi1", "ssi2", "ssi3", "gpu2d_core", "dummy",
-       "dummy", "dummy", "dummy", "esai_extal", "eim_slow", "uart_serial",
-       "spdif", "asrc", "dummy",
-};
-static const char *cko_sels[] = { "cko1", "cko2", };
-static const char *lvds_sels[] = {
-       "arm", "pll1_sys", "dummy", "dummy", "dummy", "dummy", "dummy", "pll5_video_div",
-       "dummy", "dummy", "pcie_ref_125m", "dummy", "usbphy1", "usbphy2",
-};
-static const char *pll_bypass_src_sels[] = { "osc", "lvds1_in", };
-static const char *pll1_bypass_sels[] = { "pll1", "pll1_bypass_src", };
-static const char *pll2_bypass_sels[] = { "pll2", "pll2_bypass_src", };
-static const char *pll3_bypass_sels[] = { "pll3", "pll3_bypass_src", };
-static const char *pll4_bypass_sels[] = { "pll4", "pll4_bypass_src", };
-static const char *pll5_bypass_sels[] = { "pll5", "pll5_bypass_src", };
-static const char *pll6_bypass_sels[] = { "pll6", "pll6_bypass_src", };
-static const char *pll7_bypass_sels[] = { "pll7", "pll7_bypass_src", };
-
-static struct clk *clks[IMX6SX_CLK_CLK_END];
-static struct clk_onecell_data clk_data;
-
-static int const clks_init_on[] __initconst = {
-       IMX6SX_CLK_AIPS_TZ1, IMX6SX_CLK_AIPS_TZ2, IMX6SX_CLK_AIPS_TZ3,
-       IMX6SX_CLK_IPMUX1, IMX6SX_CLK_IPMUX2, IMX6SX_CLK_IPMUX3,
-       IMX6SX_CLK_WAKEUP, IMX6SX_CLK_MMDC_P0_FAST, IMX6SX_CLK_MMDC_P0_IPG,
-       IMX6SX_CLK_ROM, IMX6SX_CLK_ARM, IMX6SX_CLK_IPG, IMX6SX_CLK_OCRAM,
-       IMX6SX_CLK_PER2_MAIN, IMX6SX_CLK_PERCLK, IMX6SX_CLK_M4,
-       IMX6SX_CLK_QSPI1, IMX6SX_CLK_QSPI2, IMX6SX_CLK_UART_IPG,
-       IMX6SX_CLK_UART_SERIAL, IMX6SX_CLK_I2C3, IMX6SX_CLK_ECSPI5,
-       IMX6SX_CLK_CAN1_IPG, IMX6SX_CLK_CAN1_SERIAL, IMX6SX_CLK_CAN2_IPG,
-       IMX6SX_CLK_CAN2_SERIAL, IMX6SX_CLK_CANFD, IMX6SX_CLK_EPIT1,
-       IMX6SX_CLK_EPIT2,
-};
-
-static struct clk_div_table clk_enet_ref_table[] = {
-       { .val = 0, .div = 20, },
-       { .val = 1, .div = 10, },
-       { .val = 2, .div = 5, },
-       { .val = 3, .div = 4, },
-       { }
-};
-
-static struct clk_div_table post_div_table[] = {
-       { .val = 2, .div = 1, },
-       { .val = 1, .div = 2, },
-       { .val = 0, .div = 4, },
-       { }
-};
-
-static struct clk_div_table video_div_table[] = {
-       { .val = 0, .div = 1, },
-       { .val = 1, .div = 2, },
-       { .val = 2, .div = 1, },
-       { .val = 3, .div = 4, },
-       { }
-};
-
-static u32 share_count_asrc;
-static u32 share_count_audio;
-static u32 share_count_esai;
-static u32 share_count_ssi1;
-static u32 share_count_ssi2;
-static u32 share_count_ssi3;
-
-static void __init imx6sx_clocks_init(struct device_node *ccm_node)
-{
-       struct device_node *np;
-       void __iomem *base;
-       int i;
-
-       clks[IMX6SX_CLK_DUMMY] = imx_clk_fixed("dummy", 0);
-
-       clks[IMX6SX_CLK_CKIL] = of_clk_get_by_name(ccm_node, "ckil");
-       clks[IMX6SX_CLK_OSC] = of_clk_get_by_name(ccm_node, "osc");
-
-       /* ipp_di clock is external input */
-       clks[IMX6SX_CLK_IPP_DI0] = of_clk_get_by_name(ccm_node, "ipp_di0");
-       clks[IMX6SX_CLK_IPP_DI1] = of_clk_get_by_name(ccm_node, "ipp_di1");
-
-       /* Clock source from external clock via CLK1 PAD */
-       clks[IMX6SX_CLK_ANACLK1] = imx_obtain_fixed_clock("anaclk1", 0);
-
-       np = of_find_compatible_node(NULL, NULL, "fsl,imx6sx-anatop");
-       base = of_iomap(np, 0);
-       WARN_ON(!base);
-
-       clks[IMX6SX_PLL1_BYPASS_SRC] = imx_clk_mux("pll1_bypass_src", base + 0x00, 14, 1, pll_bypass_src_sels, ARRAY_SIZE(pll_bypass_src_sels));
-       clks[IMX6SX_PLL2_BYPASS_SRC] = imx_clk_mux("pll2_bypass_src", base + 0x30, 14, 1, pll_bypass_src_sels, ARRAY_SIZE(pll_bypass_src_sels));
-       clks[IMX6SX_PLL3_BYPASS_SRC] = imx_clk_mux("pll3_bypass_src", base + 0x10, 14, 1, pll_bypass_src_sels, ARRAY_SIZE(pll_bypass_src_sels));
-       clks[IMX6SX_PLL4_BYPASS_SRC] = imx_clk_mux("pll4_bypass_src", base + 0x70, 14, 1, pll_bypass_src_sels, ARRAY_SIZE(pll_bypass_src_sels));
-       clks[IMX6SX_PLL5_BYPASS_SRC] = imx_clk_mux("pll5_bypass_src", base + 0xa0, 14, 1, pll_bypass_src_sels, ARRAY_SIZE(pll_bypass_src_sels));
-       clks[IMX6SX_PLL6_BYPASS_SRC] = imx_clk_mux("pll6_bypass_src", base + 0xe0, 14, 1, pll_bypass_src_sels, ARRAY_SIZE(pll_bypass_src_sels));
-       clks[IMX6SX_PLL7_BYPASS_SRC] = imx_clk_mux("pll7_bypass_src", base + 0x20, 14, 1, pll_bypass_src_sels, ARRAY_SIZE(pll_bypass_src_sels));
-
-       /*                                    type               name    parent_name        base         div_mask */
-       clks[IMX6SX_CLK_PLL1] = imx_clk_pllv3(IMX_PLLV3_SYS,     "pll1", "pll1_bypass_src", base + 0x00, 0x7f);
-       clks[IMX6SX_CLK_PLL2] = imx_clk_pllv3(IMX_PLLV3_GENERIC, "pll2", "pll2_bypass_src", base + 0x30, 0x1);
-       clks[IMX6SX_CLK_PLL3] = imx_clk_pllv3(IMX_PLLV3_USB,     "pll3", "pll3_bypass_src", base + 0x10, 0x3);
-       clks[IMX6SX_CLK_PLL4] = imx_clk_pllv3(IMX_PLLV3_AV,      "pll4", "pll4_bypass_src", base + 0x70, 0x7f);
-       clks[IMX6SX_CLK_PLL5] = imx_clk_pllv3(IMX_PLLV3_AV,      "pll5", "pll5_bypass_src", base + 0xa0, 0x7f);
-       clks[IMX6SX_CLK_PLL6] = imx_clk_pllv3(IMX_PLLV3_ENET,    "pll6", "pll6_bypass_src", base + 0xe0, 0x3);
-       clks[IMX6SX_CLK_PLL7] = imx_clk_pllv3(IMX_PLLV3_USB,     "pll7", "pll7_bypass_src", base + 0x20, 0x3);
-
-       clks[IMX6SX_PLL1_BYPASS] = imx_clk_mux_flags("pll1_bypass", base + 0x00, 16, 1, pll1_bypass_sels, ARRAY_SIZE(pll1_bypass_sels), CLK_SET_RATE_PARENT);
-       clks[IMX6SX_PLL2_BYPASS] = imx_clk_mux_flags("pll2_bypass", base + 0x30, 16, 1, pll2_bypass_sels, ARRAY_SIZE(pll2_bypass_sels), CLK_SET_RATE_PARENT);
-       clks[IMX6SX_PLL3_BYPASS] = imx_clk_mux_flags("pll3_bypass", base + 0x10, 16, 1, pll3_bypass_sels, ARRAY_SIZE(pll3_bypass_sels), CLK_SET_RATE_PARENT);
-       clks[IMX6SX_PLL4_BYPASS] = imx_clk_mux_flags("pll4_bypass", base + 0x70, 16, 1, pll4_bypass_sels, ARRAY_SIZE(pll4_bypass_sels), CLK_SET_RATE_PARENT);
-       clks[IMX6SX_PLL5_BYPASS] = imx_clk_mux_flags("pll5_bypass", base + 0xa0, 16, 1, pll5_bypass_sels, ARRAY_SIZE(pll5_bypass_sels), CLK_SET_RATE_PARENT);
-       clks[IMX6SX_PLL6_BYPASS] = imx_clk_mux_flags("pll6_bypass", base + 0xe0, 16, 1, pll6_bypass_sels, ARRAY_SIZE(pll6_bypass_sels), CLK_SET_RATE_PARENT);
-       clks[IMX6SX_PLL7_BYPASS] = imx_clk_mux_flags("pll7_bypass", base + 0x20, 16, 1, pll7_bypass_sels, ARRAY_SIZE(pll7_bypass_sels), CLK_SET_RATE_PARENT);
-
-       /* Do not bypass PLLs initially */
-       clk_set_parent(clks[IMX6SX_PLL1_BYPASS], clks[IMX6SX_CLK_PLL1]);
-       clk_set_parent(clks[IMX6SX_PLL2_BYPASS], clks[IMX6SX_CLK_PLL2]);
-       clk_set_parent(clks[IMX6SX_PLL3_BYPASS], clks[IMX6SX_CLK_PLL3]);
-       clk_set_parent(clks[IMX6SX_PLL4_BYPASS], clks[IMX6SX_CLK_PLL4]);
-       clk_set_parent(clks[IMX6SX_PLL5_BYPASS], clks[IMX6SX_CLK_PLL5]);
-       clk_set_parent(clks[IMX6SX_PLL6_BYPASS], clks[IMX6SX_CLK_PLL6]);
-       clk_set_parent(clks[IMX6SX_PLL7_BYPASS], clks[IMX6SX_CLK_PLL7]);
-
-       clks[IMX6SX_CLK_PLL1_SYS]      = imx_clk_gate("pll1_sys",      "pll1_bypass", base + 0x00, 13);
-       clks[IMX6SX_CLK_PLL2_BUS]      = imx_clk_gate("pll2_bus",      "pll2_bypass", base + 0x30, 13);
-       clks[IMX6SX_CLK_PLL3_USB_OTG]  = imx_clk_gate("pll3_usb_otg",  "pll3_bypass", base + 0x10, 13);
-       clks[IMX6SX_CLK_PLL4_AUDIO]    = imx_clk_gate("pll4_audio",    "pll4_bypass", base + 0x70, 13);
-       clks[IMX6SX_CLK_PLL5_VIDEO]    = imx_clk_gate("pll5_video",    "pll5_bypass", base + 0xa0, 13);
-       clks[IMX6SX_CLK_PLL6_ENET]     = imx_clk_gate("pll6_enet",     "pll6_bypass", base + 0xe0, 13);
-       clks[IMX6SX_CLK_PLL7_USB_HOST] = imx_clk_gate("pll7_usb_host", "pll7_bypass", base + 0x20, 13);
-
-       /*
-        * Bit 20 is the reserved and read-only bit, we do this only for:
-        * - Do nothing for usbphy clk_enable/disable
-        * - Keep refcount when do usbphy clk_enable/disable, in that case,
-        * the clk framework may need to enable/disable usbphy's parent
-        */
-       clks[IMX6SX_CLK_USBPHY1] = imx_clk_gate("usbphy1", "pll3_usb_otg",  base + 0x10, 20);
-       clks[IMX6SX_CLK_USBPHY2] = imx_clk_gate("usbphy2", "pll7_usb_host", base + 0x20, 20);
-
-       /*
-        * usbphy*_gate needs to be on after system boots up, and software
-        * never needs to control it anymore.
-        */
-       clks[IMX6SX_CLK_USBPHY1_GATE] = imx_clk_gate("usbphy1_gate", "dummy", base + 0x10, 6);
-       clks[IMX6SX_CLK_USBPHY2_GATE] = imx_clk_gate("usbphy2_gate", "dummy", base + 0x20, 6);
-
-       /* FIXME 100Mhz is used for pcie ref for all imx6 pcie, excepted imx6q */
-       clks[IMX6SX_CLK_PCIE_REF] = imx_clk_fixed_factor("pcie_ref", "pll6_enet", 1, 5);
-       clks[IMX6SX_CLK_PCIE_REF_125M] = imx_clk_gate("pcie_ref_125m", "pcie_ref", base + 0xe0, 19);
-
-       clks[IMX6SX_CLK_LVDS1_OUT] = imx_clk_gate_exclusive("lvds1_out", "lvds1_sel", base + 0x160, 10, BIT(12));
-       clks[IMX6SX_CLK_LVDS1_IN]  = imx_clk_gate_exclusive("lvds1_in",  "anaclk1",   base + 0x160, 12, BIT(10));
-
-       clks[IMX6SX_CLK_ENET_REF] = clk_register_divider_table(NULL, "enet_ref", "pll6_enet", 0,
-                       base + 0xe0, 0, 2, 0, clk_enet_ref_table,
-                       &imx_ccm_lock);
-       clks[IMX6SX_CLK_ENET2_REF] = clk_register_divider_table(NULL, "enet2_ref", "pll6_enet", 0,
-                       base + 0xe0, 2, 2, 0, clk_enet_ref_table,
-                       &imx_ccm_lock);
-       clks[IMX6SX_CLK_ENET2_REF_125M] = imx_clk_gate("enet2_ref_125m", "enet2_ref", base + 0xe0, 20);
-
-       clks[IMX6SX_CLK_ENET_PTP_REF] = imx_clk_fixed_factor("enet_ptp_ref", "pll6_enet", 1, 20);
-       clks[IMX6SX_CLK_ENET_PTP] = imx_clk_gate("enet_ptp_25m", "enet_ptp_ref", base + 0xe0, 21);
-
-       /*                                       name              parent_name     reg           idx */
-       clks[IMX6SX_CLK_PLL2_PFD0] = imx_clk_pfd("pll2_pfd0_352m", "pll2_bus",     base + 0x100, 0);
-       clks[IMX6SX_CLK_PLL2_PFD1] = imx_clk_pfd("pll2_pfd1_594m", "pll2_bus",     base + 0x100, 1);
-       clks[IMX6SX_CLK_PLL2_PFD2] = imx_clk_pfd("pll2_pfd2_396m", "pll2_bus",     base + 0x100, 2);
-       clks[IMX6SX_CLK_PLL2_PFD3] = imx_clk_pfd("pll2_pfd3_594m", "pll2_bus",     base + 0x100, 3);
-       clks[IMX6SX_CLK_PLL3_PFD0] = imx_clk_pfd("pll3_pfd0_720m", "pll3_usb_otg", base + 0xf0,  0);
-       clks[IMX6SX_CLK_PLL3_PFD1] = imx_clk_pfd("pll3_pfd1_540m", "pll3_usb_otg", base + 0xf0,  1);
-       clks[IMX6SX_CLK_PLL3_PFD2] = imx_clk_pfd("pll3_pfd2_508m", "pll3_usb_otg", base + 0xf0,  2);
-       clks[IMX6SX_CLK_PLL3_PFD3] = imx_clk_pfd("pll3_pfd3_454m", "pll3_usb_otg", base + 0xf0,  3);
-
-       /*                                                name         parent_name       mult div */
-       clks[IMX6SX_CLK_PLL2_198M] = imx_clk_fixed_factor("pll2_198m", "pll2_pfd2_396m", 1,   2);
-       clks[IMX6SX_CLK_PLL3_120M] = imx_clk_fixed_factor("pll3_120m", "pll3_usb_otg",   1,   4);
-       clks[IMX6SX_CLK_PLL3_80M]  = imx_clk_fixed_factor("pll3_80m",  "pll3_usb_otg",   1,   6);
-       clks[IMX6SX_CLK_PLL3_60M]  = imx_clk_fixed_factor("pll3_60m",  "pll3_usb_otg",   1,   8);
-       clks[IMX6SX_CLK_TWD]       = imx_clk_fixed_factor("twd",       "arm",            1,   2);
-       clks[IMX6SX_CLK_GPT_3M]    = imx_clk_fixed_factor("gpt_3m",    "osc",            1,   8);
-
-       clks[IMX6SX_CLK_PLL4_POST_DIV]  = clk_register_divider_table(NULL, "pll4_post_div", "pll4_audio",
-                               CLK_SET_RATE_PARENT, base + 0x70, 19, 2, 0, post_div_table, &imx_ccm_lock);
-       clks[IMX6SX_CLK_PLL4_AUDIO_DIV] = clk_register_divider(NULL, "pll4_audio_div", "pll4_post_div",
-                               CLK_SET_RATE_PARENT, base + 0x170, 15, 1, 0, &imx_ccm_lock);
-       clks[IMX6SX_CLK_PLL5_POST_DIV]  = clk_register_divider_table(NULL, "pll5_post_div", "pll5_video",
-                               CLK_SET_RATE_PARENT, base + 0xa0, 19, 2, 0, post_div_table, &imx_ccm_lock);
-       clks[IMX6SX_CLK_PLL5_VIDEO_DIV] = clk_register_divider_table(NULL, "pll5_video_div", "pll5_post_div",
-                               CLK_SET_RATE_PARENT, base + 0x170, 30, 2, 0, video_div_table, &imx_ccm_lock);
-
-       /*                                                name                reg           shift   width   parent_names       num_parents */
-       clks[IMX6SX_CLK_LVDS1_SEL]          = imx_clk_mux("lvds1_sel",        base + 0x160, 0,      5,      lvds_sels,         ARRAY_SIZE(lvds_sels));
-
-       np = ccm_node;
-       base = of_iomap(np, 0);
-       WARN_ON(!base);
-
-       imx6q_pm_set_ccm_base(base);
-
-       /*                                                name                reg           shift   width   parent_names       num_parents */
-       clks[IMX6SX_CLK_STEP]               = imx_clk_mux("step",             base + 0xc,   8,      1,      step_sels,         ARRAY_SIZE(step_sels));
-       clks[IMX6SX_CLK_PLL1_SW]            = imx_clk_mux("pll1_sw",          base + 0xc,   2,      1,      pll1_sw_sels,      ARRAY_SIZE(pll1_sw_sels));
-       clks[IMX6SX_CLK_OCRAM_SEL]          = imx_clk_mux("ocram_sel",        base + 0x14,  6,      2,      ocram_sels,        ARRAY_SIZE(ocram_sels));
-       clks[IMX6SX_CLK_PERIPH_PRE]         = imx_clk_mux("periph_pre",       base + 0x18,  18,     2,      periph_pre_sels,   ARRAY_SIZE(periph_pre_sels));
-       clks[IMX6SX_CLK_PERIPH2_PRE]        = imx_clk_mux("periph2_pre",      base + 0x18,  21,     2,      periph2_pre_sels,   ARRAY_SIZE(periph2_pre_sels));
-       clks[IMX6SX_CLK_PERIPH_CLK2_SEL]    = imx_clk_mux("periph_clk2_sel",  base + 0x18,  12,     2,      periph_clk2_sels,  ARRAY_SIZE(periph_clk2_sels));
-       clks[IMX6SX_CLK_PERIPH2_CLK2_SEL]   = imx_clk_mux("periph2_clk2_sel", base + 0x18,  20,     1,      periph2_clk2_sels, ARRAY_SIZE(periph2_clk2_sels));
-       clks[IMX6SX_CLK_PCIE_AXI_SEL]       = imx_clk_mux("pcie_axi_sel",     base + 0x18,  10,     1,      pcie_axi_sels,     ARRAY_SIZE(pcie_axi_sels));
-       clks[IMX6SX_CLK_GPU_AXI_SEL]        = imx_clk_mux("gpu_axi_sel",      base + 0x18,  8,      2,      gpu_axi_sels,      ARRAY_SIZE(gpu_axi_sels));
-       clks[IMX6SX_CLK_GPU_CORE_SEL]       = imx_clk_mux("gpu_core_sel",     base + 0x18,  4,      2,      gpu_core_sels,     ARRAY_SIZE(gpu_core_sels));
-       clks[IMX6SX_CLK_EIM_SLOW_SEL]       = imx_clk_mux("eim_slow_sel",     base + 0x1c,  29,     2,      eim_slow_sels,     ARRAY_SIZE(eim_slow_sels));
-       clks[IMX6SX_CLK_USDHC1_SEL]         = imx_clk_mux("usdhc1_sel",       base + 0x1c,  16,     1,      usdhc_sels,        ARRAY_SIZE(usdhc_sels));
-       clks[IMX6SX_CLK_USDHC2_SEL]         = imx_clk_mux("usdhc2_sel",       base + 0x1c,  17,     1,      usdhc_sels,        ARRAY_SIZE(usdhc_sels));
-       clks[IMX6SX_CLK_USDHC3_SEL]         = imx_clk_mux("usdhc3_sel",       base + 0x1c,  18,     1,      usdhc_sels,        ARRAY_SIZE(usdhc_sels));
-       clks[IMX6SX_CLK_USDHC4_SEL]         = imx_clk_mux("usdhc4_sel",       base + 0x1c,  19,     1,      usdhc_sels,        ARRAY_SIZE(usdhc_sels));
-       clks[IMX6SX_CLK_SSI3_SEL]           = imx_clk_mux("ssi3_sel",         base + 0x1c,  14,     2,      ssi_sels,          ARRAY_SIZE(ssi_sels));
-       clks[IMX6SX_CLK_SSI2_SEL]           = imx_clk_mux("ssi2_sel",         base + 0x1c,  12,     2,      ssi_sels,          ARRAY_SIZE(ssi_sels));
-       clks[IMX6SX_CLK_SSI1_SEL]           = imx_clk_mux("ssi1_sel",         base + 0x1c,  10,     2,      ssi_sels,          ARRAY_SIZE(ssi_sels));
-       clks[IMX6SX_CLK_QSPI1_SEL]          = imx_clk_mux_flags("qspi1_sel", base + 0x1c,  7, 3, qspi1_sels, ARRAY_SIZE(qspi1_sels), CLK_SET_RATE_PARENT);
-       clks[IMX6SX_CLK_PERCLK_SEL]         = imx_clk_mux("perclk_sel",       base + 0x1c,  6,      1,      perclk_sels,       ARRAY_SIZE(perclk_sels));
-       clks[IMX6SX_CLK_VID_SEL]            = imx_clk_mux("vid_sel",          base + 0x20,  21,     3,      vid_sels,          ARRAY_SIZE(vid_sels));
-       clks[IMX6SX_CLK_ESAI_SEL]           = imx_clk_mux("esai_sel",         base + 0x20,  19,     2,      audio_sels,        ARRAY_SIZE(audio_sels));
-       clks[IMX6SX_CLK_CAN_SEL]            = imx_clk_mux("can_sel",          base + 0x20,  8,      2,      can_sels,          ARRAY_SIZE(can_sels));
-       clks[IMX6SX_CLK_UART_SEL]           = imx_clk_mux("uart_sel",         base + 0x24,  6,      1,      uart_sels,         ARRAY_SIZE(uart_sels));
-       clks[IMX6SX_CLK_QSPI2_SEL]          = imx_clk_mux_flags("qspi2_sel", base + 0x2c, 15, 3, qspi2_sels, ARRAY_SIZE(qspi2_sels), CLK_SET_RATE_PARENT);
-       clks[IMX6SX_CLK_SPDIF_SEL]          = imx_clk_mux("spdif_sel",        base + 0x30,  20,     2,      audio_sels,        ARRAY_SIZE(audio_sels));
-       clks[IMX6SX_CLK_AUDIO_SEL]          = imx_clk_mux("audio_sel",        base + 0x30,  7,      2,      audio_sels,        ARRAY_SIZE(audio_sels));
-       clks[IMX6SX_CLK_ENET_PRE_SEL]       = imx_clk_mux("enet_pre_sel",     base + 0x34,  15,     3,      enet_pre_sels,     ARRAY_SIZE(enet_pre_sels));
-       clks[IMX6SX_CLK_ENET_SEL]           = imx_clk_mux("enet_sel",         base + 0x34,  9,      3,      enet_sels,         ARRAY_SIZE(enet_sels));
-       clks[IMX6SX_CLK_M4_PRE_SEL]         = imx_clk_mux("m4_pre_sel",       base + 0x34,  6,      3,      m4_pre_sels,       ARRAY_SIZE(m4_pre_sels));
-       clks[IMX6SX_CLK_M4_SEL]             = imx_clk_mux("m4_sel",           base + 0x34,  0,      3,      m4_sels,           ARRAY_SIZE(m4_sels));
-       clks[IMX6SX_CLK_ECSPI_SEL]          = imx_clk_mux("ecspi_sel",        base + 0x38,  18,     1,      ecspi_sels,        ARRAY_SIZE(ecspi_sels));
-       clks[IMX6SX_CLK_LCDIF2_PRE_SEL]     = imx_clk_mux("lcdif2_pre_sel",   base + 0x38,  6,      3,      lcdif2_pre_sels,   ARRAY_SIZE(lcdif2_pre_sels));
-       clks[IMX6SX_CLK_LCDIF2_SEL]         = imx_clk_mux("lcdif2_sel",       base + 0x38,  0,      3,      lcdif2_sels,       ARRAY_SIZE(lcdif2_sels));
-       clks[IMX6SX_CLK_DISPLAY_SEL]        = imx_clk_mux("display_sel",      base + 0x3c,  14,     2,      display_sels,      ARRAY_SIZE(display_sels));
-       clks[IMX6SX_CLK_CSI_SEL]            = imx_clk_mux("csi_sel",          base + 0x3c,  9,      2,      csi_sels,          ARRAY_SIZE(csi_sels));
-       clks[IMX6SX_CLK_CKO1_SEL]           = imx_clk_mux("cko1_sel",         base + 0x60,  0,      4,      cko1_sels,         ARRAY_SIZE(cko1_sels));
-       clks[IMX6SX_CLK_CKO2_SEL]           = imx_clk_mux("cko2_sel",         base + 0x60,  16,     5,      cko2_sels,         ARRAY_SIZE(cko2_sels));
-       clks[IMX6SX_CLK_CKO]                = imx_clk_mux("cko",              base + 0x60,  8,      1,      cko_sels,          ARRAY_SIZE(cko_sels));
-
-       clks[IMX6SX_CLK_LDB_DI1_DIV_SEL]    = imx_clk_mux_flags("ldb_di1_div_sel", base + 0x20, 11, 1, ldb_di1_div_sels, ARRAY_SIZE(ldb_di1_div_sels), CLK_SET_RATE_PARENT);
-       clks[IMX6SX_CLK_LDB_DI0_DIV_SEL]    = imx_clk_mux_flags("ldb_di0_div_sel", base + 0x20, 10, 1, ldb_di0_div_sels, ARRAY_SIZE(ldb_di0_div_sels), CLK_SET_RATE_PARENT);
-       clks[IMX6SX_CLK_LDB_DI1_SEL]        = imx_clk_mux_flags("ldb_di1_sel",     base + 0x2c, 12, 3, ldb_di1_sels,      ARRAY_SIZE(ldb_di1_sels),    CLK_SET_RATE_PARENT);
-       clks[IMX6SX_CLK_LDB_DI0_SEL]        = imx_clk_mux_flags("ldb_di0_sel",     base + 0x2c, 9,  3, ldb_di0_sels,      ARRAY_SIZE(ldb_di0_sels),    CLK_SET_RATE_PARENT);
-       clks[IMX6SX_CLK_LCDIF1_PRE_SEL]     = imx_clk_mux_flags("lcdif1_pre_sel",  base + 0x38, 15, 3, lcdif1_pre_sels,   ARRAY_SIZE(lcdif1_pre_sels), CLK_SET_RATE_PARENT);
-       clks[IMX6SX_CLK_LCDIF1_SEL]         = imx_clk_mux_flags("lcdif1_sel",      base + 0x38, 9,  3, lcdif1_sels,       ARRAY_SIZE(lcdif1_sels),     CLK_SET_RATE_PARENT);
-
-       /*                                                    name              parent_name          reg          shift width */
-       clks[IMX6SX_CLK_PERIPH_CLK2]        = imx_clk_divider("periph_clk2",    "periph_clk2_sel",   base + 0x14, 27,   3);
-       clks[IMX6SX_CLK_PERIPH2_CLK2]       = imx_clk_divider("periph2_clk2",   "periph2_clk2_sel",  base + 0x14, 0,    3);
-       clks[IMX6SX_CLK_IPG]                = imx_clk_divider("ipg",            "ahb",               base + 0x14, 8,    2);
-       clks[IMX6SX_CLK_GPU_CORE_PODF]      = imx_clk_divider("gpu_core_podf",  "gpu_core_sel",      base + 0x18, 29,   3);
-       clks[IMX6SX_CLK_GPU_AXI_PODF]       = imx_clk_divider("gpu_axi_podf",   "gpu_axi_sel",       base + 0x18, 26,   3);
-       clks[IMX6SX_CLK_LCDIF1_PODF]        = imx_clk_divider("lcdif1_podf",    "lcdif1_pred",       base + 0x18, 23,   3);
-       clks[IMX6SX_CLK_QSPI1_PODF]         = imx_clk_divider("qspi1_podf",     "qspi1_sel",         base + 0x1c, 26,   3);
-       clks[IMX6SX_CLK_EIM_SLOW_PODF]      = imx_clk_divider("eim_slow_podf",  "eim_slow_sel",      base + 0x1c, 23,   3);
-       clks[IMX6SX_CLK_LCDIF2_PODF]        = imx_clk_divider("lcdif2_podf",    "lcdif2_pred",       base + 0x1c, 20,   3);
-       clks[IMX6SX_CLK_PERCLK]             = imx_clk_divider("perclk",         "perclk_sel",        base + 0x1c, 0,    6);
-       clks[IMX6SX_CLK_VID_PODF]           = imx_clk_divider("vid_podf",       "vid_sel",           base + 0x20, 24,   2);
-       clks[IMX6SX_CLK_CAN_PODF]           = imx_clk_divider("can_podf",       "can_sel",           base + 0x20, 2,    6);
-       clks[IMX6SX_CLK_USDHC4_PODF]        = imx_clk_divider("usdhc4_podf",    "usdhc4_sel",        base + 0x24, 22,   3);
-       clks[IMX6SX_CLK_USDHC3_PODF]        = imx_clk_divider("usdhc3_podf",    "usdhc3_sel",        base + 0x24, 19,   3);
-       clks[IMX6SX_CLK_USDHC2_PODF]        = imx_clk_divider("usdhc2_podf",    "usdhc2_sel",        base + 0x24, 16,   3);
-       clks[IMX6SX_CLK_USDHC1_PODF]        = imx_clk_divider("usdhc1_podf",    "usdhc1_sel",        base + 0x24, 11,   3);
-       clks[IMX6SX_CLK_UART_PODF]          = imx_clk_divider("uart_podf",      "uart_sel",          base + 0x24, 0,    6);
-       clks[IMX6SX_CLK_ESAI_PRED]          = imx_clk_divider("esai_pred",      "esai_sel",          base + 0x28, 9,    3);
-       clks[IMX6SX_CLK_ESAI_PODF]          = imx_clk_divider("esai_podf",      "esai_pred",         base + 0x28, 25,   3);
-       clks[IMX6SX_CLK_SSI3_PRED]          = imx_clk_divider("ssi3_pred",      "ssi3_sel",          base + 0x28, 22,   3);
-       clks[IMX6SX_CLK_SSI3_PODF]          = imx_clk_divider("ssi3_podf",      "ssi3_pred",         base + 0x28, 16,   6);
-       clks[IMX6SX_CLK_SSI1_PRED]          = imx_clk_divider("ssi1_pred",      "ssi1_sel",          base + 0x28, 6,    3);
-       clks[IMX6SX_CLK_SSI1_PODF]          = imx_clk_divider("ssi1_podf",      "ssi1_pred",         base + 0x28, 0,    6);
-       clks[IMX6SX_CLK_QSPI2_PRED]         = imx_clk_divider("qspi2_pred",     "qspi2_sel",         base + 0x2c, 18,   3);
-       clks[IMX6SX_CLK_QSPI2_PODF]         = imx_clk_divider("qspi2_podf",     "qspi2_pred",        base + 0x2c, 21,   6);
-       clks[IMX6SX_CLK_SSI2_PRED]          = imx_clk_divider("ssi2_pred",      "ssi2_sel",          base + 0x2c, 6,    3);
-       clks[IMX6SX_CLK_SSI2_PODF]          = imx_clk_divider("ssi2_podf",      "ssi2_pred",         base + 0x2c, 0,    6);
-       clks[IMX6SX_CLK_SPDIF_PRED]         = imx_clk_divider("spdif_pred",     "spdif_sel",         base + 0x30, 25,   3);
-       clks[IMX6SX_CLK_SPDIF_PODF]         = imx_clk_divider("spdif_podf",     "spdif_pred",        base + 0x30, 22,   3);
-       clks[IMX6SX_CLK_AUDIO_PRED]         = imx_clk_divider("audio_pred",     "audio_sel",         base + 0x30, 12,   3);
-       clks[IMX6SX_CLK_AUDIO_PODF]         = imx_clk_divider("audio_podf",     "audio_pred",        base + 0x30, 9,    3);
-       clks[IMX6SX_CLK_ENET_PODF]          = imx_clk_divider("enet_podf",      "enet_pre_sel",      base + 0x34, 12,   3);
-       clks[IMX6SX_CLK_M4_PODF]            = imx_clk_divider("m4_podf",        "m4_sel",            base + 0x34, 3,    3);
-       clks[IMX6SX_CLK_ECSPI_PODF]         = imx_clk_divider("ecspi_podf",     "ecspi_sel",         base + 0x38, 19,   6);
-       clks[IMX6SX_CLK_LCDIF1_PRED]        = imx_clk_divider("lcdif1_pred",    "lcdif1_pre_sel",    base + 0x38, 12,   3);
-       clks[IMX6SX_CLK_LCDIF2_PRED]        = imx_clk_divider("lcdif2_pred",    "lcdif2_pre_sel",    base + 0x38, 3,    3);
-       clks[IMX6SX_CLK_DISPLAY_PODF]       = imx_clk_divider("display_podf",   "display_sel",       base + 0x3c, 16,   3);
-       clks[IMX6SX_CLK_CSI_PODF]           = imx_clk_divider("csi_podf",       "csi_sel",           base + 0x3c, 11,   3);
-       clks[IMX6SX_CLK_CKO1_PODF]          = imx_clk_divider("cko1_podf",      "cko1_sel",          base + 0x60, 4,    3);
-       clks[IMX6SX_CLK_CKO2_PODF]          = imx_clk_divider("cko2_podf",      "cko2_sel",          base + 0x60, 21,   3);
-
-       clks[IMX6SX_CLK_LDB_DI0_DIV_3_5]    = imx_clk_fixed_factor("ldb_di0_div_3_5", "ldb_di0_sel", 2, 7);
-       clks[IMX6SX_CLK_LDB_DI0_DIV_7]      = imx_clk_fixed_factor("ldb_di0_div_7",   "ldb_di0_sel", 1, 7);
-       clks[IMX6SX_CLK_LDB_DI1_DIV_3_5]    = imx_clk_fixed_factor("ldb_di1_div_3_5", "ldb_di1_sel", 2, 7);
-       clks[IMX6SX_CLK_LDB_DI1_DIV_7]      = imx_clk_fixed_factor("ldb_di1_div_7",   "ldb_di1_sel", 1, 7);
-
-       /*                                               name        reg          shift width busy: reg,   shift parent_names       num_parents */
-       clks[IMX6SX_CLK_PERIPH]       = imx_clk_busy_mux("periph",   base + 0x14, 25,   1,    base + 0x48, 5,    periph_sels,       ARRAY_SIZE(periph_sels));
-       clks[IMX6SX_CLK_PERIPH2]      = imx_clk_busy_mux("periph2",  base + 0x14, 26,   1,    base + 0x48, 3,    periph2_sels,      ARRAY_SIZE(periph2_sels));
-       /*                                                   name             parent_name    reg          shift width busy: reg,   shift */
-       clks[IMX6SX_CLK_OCRAM_PODF]   = imx_clk_busy_divider("ocram_podf",    "ocram_sel",   base + 0x14, 16,   3,    base + 0x48, 0);
-       clks[IMX6SX_CLK_AHB]          = imx_clk_busy_divider("ahb",           "periph",      base + 0x14, 10,   3,    base + 0x48, 1);
-       clks[IMX6SX_CLK_MMDC_PODF]    = imx_clk_busy_divider("mmdc_podf",     "periph2",     base + 0x14, 3,    3,    base + 0x48, 2);
-       clks[IMX6SX_CLK_ARM]          = imx_clk_busy_divider("arm",           "pll1_sw",     base + 0x10, 0,    3,    base + 0x48, 16);
-
-       /*                                            name             parent_name          reg         shift */
-       /* CCGR0 */
-       clks[IMX6SX_CLK_AIPS_TZ1]     = imx_clk_gate2("aips_tz1",      "ahb",               base + 0x68, 0);
-       clks[IMX6SX_CLK_AIPS_TZ2]     = imx_clk_gate2("aips_tz2",      "ahb",               base + 0x68, 2);
-       clks[IMX6SX_CLK_APBH_DMA]     = imx_clk_gate2("apbh_dma",      "usdhc3",            base + 0x68, 4);
-       clks[IMX6SX_CLK_ASRC_MEM]     = imx_clk_gate2_shared("asrc_mem", "ahb",             base + 0x68, 6, &share_count_asrc);
-       clks[IMX6SX_CLK_ASRC_IPG]     = imx_clk_gate2_shared("asrc_ipg", "ahb",             base + 0x68, 6, &share_count_asrc);
-       clks[IMX6SX_CLK_CAAM_MEM]     = imx_clk_gate2("caam_mem",      "ahb",               base + 0x68, 8);
-       clks[IMX6SX_CLK_CAAM_ACLK]    = imx_clk_gate2("caam_aclk",     "ahb",               base + 0x68, 10);
-       clks[IMX6SX_CLK_CAAM_IPG]     = imx_clk_gate2("caam_ipg",      "ipg",               base + 0x68, 12);
-       clks[IMX6SX_CLK_CAN1_IPG]     = imx_clk_gate2("can1_ipg",      "ipg",               base + 0x68, 14);
-       clks[IMX6SX_CLK_CAN1_SERIAL]  = imx_clk_gate2("can1_serial",   "can_podf",          base + 0x68, 16);
-       clks[IMX6SX_CLK_CAN2_IPG]     = imx_clk_gate2("can2_ipg",      "ipg",               base + 0x68, 18);
-       clks[IMX6SX_CLK_CAN2_SERIAL]  = imx_clk_gate2("can2_serial",   "can_podf",          base + 0x68, 20);
-       clks[IMX6SX_CLK_DCIC1]        = imx_clk_gate2("dcic1",         "display_podf",      base + 0x68, 24);
-       clks[IMX6SX_CLK_DCIC2]        = imx_clk_gate2("dcic2",         "display_podf",      base + 0x68, 26);
-       clks[IMX6SX_CLK_AIPS_TZ3]     = imx_clk_gate2("aips_tz3",      "ahb",               base + 0x68, 30);
-
-       /* CCGR1 */
-       clks[IMX6SX_CLK_ECSPI1]       = imx_clk_gate2("ecspi1",        "ecspi_podf",        base + 0x6c, 0);
-       clks[IMX6SX_CLK_ECSPI2]       = imx_clk_gate2("ecspi2",        "ecspi_podf",        base + 0x6c, 2);
-       clks[IMX6SX_CLK_ECSPI3]       = imx_clk_gate2("ecspi3",        "ecspi_podf",        base + 0x6c, 4);
-       clks[IMX6SX_CLK_ECSPI4]       = imx_clk_gate2("ecspi4",        "ecspi_podf",        base + 0x6c, 6);
-       clks[IMX6SX_CLK_ECSPI5]       = imx_clk_gate2("ecspi5",        "ecspi_podf",        base + 0x6c, 8);
-       clks[IMX6SX_CLK_EPIT1]        = imx_clk_gate2("epit1",         "perclk",            base + 0x6c, 12);
-       clks[IMX6SX_CLK_EPIT2]        = imx_clk_gate2("epit2",         "perclk",            base + 0x6c, 14);
-       clks[IMX6SX_CLK_ESAI_EXTAL]   = imx_clk_gate2_shared("esai_extal", "esai_podf",     base + 0x6c, 16, &share_count_esai);
-       clks[IMX6SX_CLK_ESAI_IPG]     = imx_clk_gate2_shared("esai_ipg",   "ahb",           base + 0x6c, 16, &share_count_esai);
-       clks[IMX6SX_CLK_ESAI_MEM]     = imx_clk_gate2_shared("esai_mem",   "ahb",           base + 0x6c, 16, &share_count_esai);
-       clks[IMX6SX_CLK_WAKEUP]       = imx_clk_gate2("wakeup",        "ipg",               base + 0x6c, 18);
-       clks[IMX6SX_CLK_GPT_BUS]      = imx_clk_gate2("gpt_bus",       "perclk",            base + 0x6c, 20);
-       clks[IMX6SX_CLK_GPT_SERIAL]   = imx_clk_gate2("gpt_serial",    "perclk",            base + 0x6c, 22);
-       clks[IMX6SX_CLK_GPU]          = imx_clk_gate2("gpu",           "gpu_core_podf",     base + 0x6c, 26);
-       clks[IMX6SX_CLK_CANFD]        = imx_clk_gate2("canfd",         "can_podf",          base + 0x6c, 30);
-
-       /* CCGR2 */
-       clks[IMX6SX_CLK_CSI]          = imx_clk_gate2("csi",           "csi_podf",          base + 0x70, 2);
-       clks[IMX6SX_CLK_I2C1]         = imx_clk_gate2("i2c1",          "perclk",            base + 0x70, 6);
-       clks[IMX6SX_CLK_I2C2]         = imx_clk_gate2("i2c2",          "perclk",            base + 0x70, 8);
-       clks[IMX6SX_CLK_I2C3]         = imx_clk_gate2("i2c3",          "perclk",            base + 0x70, 10);
-       clks[IMX6SX_CLK_OCOTP]        = imx_clk_gate2("ocotp",         "ipg",               base + 0x70, 12);
-       clks[IMX6SX_CLK_IOMUXC]       = imx_clk_gate2("iomuxc",        "lcdif1_podf",       base + 0x70, 14);
-       clks[IMX6SX_CLK_IPMUX1]       = imx_clk_gate2("ipmux1",        "ahb",               base + 0x70, 16);
-       clks[IMX6SX_CLK_IPMUX2]       = imx_clk_gate2("ipmux2",        "ahb",               base + 0x70, 18);
-       clks[IMX6SX_CLK_IPMUX3]       = imx_clk_gate2("ipmux3",        "ahb",               base + 0x70, 20);
-       clks[IMX6SX_CLK_TZASC1]       = imx_clk_gate2("tzasc1",        "mmdc_podf",         base + 0x70, 22);
-       clks[IMX6SX_CLK_LCDIF_APB]    = imx_clk_gate2("lcdif_apb",     "display_podf",      base + 0x70, 28);
-       clks[IMX6SX_CLK_PXP_AXI]      = imx_clk_gate2("pxp_axi",       "display_podf",      base + 0x70, 30);
-
-       /* CCGR3 */
-       clks[IMX6SX_CLK_M4]           = imx_clk_gate2("m4",            "m4_podf",           base + 0x74, 2);
-       clks[IMX6SX_CLK_ENET]         = imx_clk_gate2("enet",          "ipg",               base + 0x74, 4);
-       clks[IMX6SX_CLK_ENET_AHB]     = imx_clk_gate2("enet_ahb",      "enet_sel",          base + 0x74, 4);
-       clks[IMX6SX_CLK_DISPLAY_AXI]  = imx_clk_gate2("display_axi",   "display_podf",      base + 0x74, 6);
-       clks[IMX6SX_CLK_LCDIF2_PIX]   = imx_clk_gate2("lcdif2_pix",    "lcdif2_sel",        base + 0x74, 8);
-       clks[IMX6SX_CLK_LCDIF1_PIX]   = imx_clk_gate2("lcdif1_pix",    "lcdif1_sel",        base + 0x74, 10);
-       clks[IMX6SX_CLK_LDB_DI0]      = imx_clk_gate2("ldb_di0",       "ldb_di0_div_sel",   base + 0x74, 12);
-       clks[IMX6SX_CLK_QSPI1]        = imx_clk_gate2("qspi1",         "qspi1_podf",        base + 0x74, 14);
-       clks[IMX6SX_CLK_MLB]          = imx_clk_gate2("mlb",           "ahb",               base + 0x74, 18);
-       clks[IMX6SX_CLK_MMDC_P0_FAST] = imx_clk_gate2("mmdc_p0_fast",  "mmdc_podf",         base + 0x74, 20);
-       clks[IMX6SX_CLK_MMDC_P0_IPG]  = imx_clk_gate2("mmdc_p0_ipg",   "ipg",               base + 0x74, 24);
-       clks[IMX6SX_CLK_OCRAM]        = imx_clk_gate2("ocram",         "ocram_podf",        base + 0x74, 28);
-
-       /* CCGR4 */
-       clks[IMX6SX_CLK_PCIE_AXI]     = imx_clk_gate2("pcie_axi",      "display_podf",      base + 0x78, 0);
-       clks[IMX6SX_CLK_QSPI2]        = imx_clk_gate2("qspi2",         "qspi2_podf",        base + 0x78, 10);
-       clks[IMX6SX_CLK_PER1_BCH]     = imx_clk_gate2("per1_bch",      "usdhc3",            base + 0x78, 12);
-       clks[IMX6SX_CLK_PER2_MAIN]    = imx_clk_gate2("per2_main",     "ahb",               base + 0x78, 14);
-       clks[IMX6SX_CLK_PWM1]         = imx_clk_gate2("pwm1",          "perclk",            base + 0x78, 16);
-       clks[IMX6SX_CLK_PWM2]         = imx_clk_gate2("pwm2",          "perclk",            base + 0x78, 18);
-       clks[IMX6SX_CLK_PWM3]         = imx_clk_gate2("pwm3",          "perclk",            base + 0x78, 20);
-       clks[IMX6SX_CLK_PWM4]         = imx_clk_gate2("pwm4",          "perclk",            base + 0x78, 22);
-       clks[IMX6SX_CLK_GPMI_BCH_APB] = imx_clk_gate2("gpmi_bch_apb",  "usdhc3",            base + 0x78, 24);
-       clks[IMX6SX_CLK_GPMI_BCH]     = imx_clk_gate2("gpmi_bch",      "usdhc4",            base + 0x78, 26);
-       clks[IMX6SX_CLK_GPMI_IO]      = imx_clk_gate2("gpmi_io",       "qspi2_podf",        base + 0x78, 28);
-       clks[IMX6SX_CLK_GPMI_APB]     = imx_clk_gate2("gpmi_apb",      "usdhc3",            base + 0x78, 30);
-
-       /* CCGR5 */
-       clks[IMX6SX_CLK_ROM]          = imx_clk_gate2("rom",           "ahb",               base + 0x7c, 0);
-       clks[IMX6SX_CLK_SDMA]         = imx_clk_gate2("sdma",          "ahb",               base + 0x7c, 6);
-       clks[IMX6SX_CLK_SPBA]         = imx_clk_gate2("spba",          "ipg",               base + 0x7c, 12);
-       clks[IMX6SX_CLK_AUDIO]        = imx_clk_gate2_shared("audio",  "audio_podf",        base + 0x7c, 14, &share_count_audio);
-       clks[IMX6SX_CLK_SPDIF]        = imx_clk_gate2_shared("spdif",  "spdif_podf",        base + 0x7c, 14, &share_count_audio);
-       clks[IMX6SX_CLK_SSI1_IPG]     = imx_clk_gate2_shared("ssi1_ipg",      "ipg",        base + 0x7c, 18, &share_count_ssi1);
-       clks[IMX6SX_CLK_SSI2_IPG]     = imx_clk_gate2_shared("ssi2_ipg",      "ipg",        base + 0x7c, 20, &share_count_ssi2);
-       clks[IMX6SX_CLK_SSI3_IPG]     = imx_clk_gate2_shared("ssi3_ipg",      "ipg",        base + 0x7c, 22, &share_count_ssi3);
-       clks[IMX6SX_CLK_SSI1]         = imx_clk_gate2_shared("ssi1",          "ssi1_podf",  base + 0x7c, 18, &share_count_ssi1);
-       clks[IMX6SX_CLK_SSI2]         = imx_clk_gate2_shared("ssi2",          "ssi2_podf",  base + 0x7c, 20, &share_count_ssi2);
-       clks[IMX6SX_CLK_SSI3]         = imx_clk_gate2_shared("ssi3",          "ssi3_podf",  base + 0x7c, 22, &share_count_ssi3);
-       clks[IMX6SX_CLK_UART_IPG]     = imx_clk_gate2("uart_ipg",      "ipg",               base + 0x7c, 24);
-       clks[IMX6SX_CLK_UART_SERIAL]  = imx_clk_gate2("uart_serial",   "uart_podf",         base + 0x7c, 26);
-       clks[IMX6SX_CLK_SAI1_IPG]     = imx_clk_gate2("sai1_ipg",      "ipg",               base + 0x7c, 28);
-       clks[IMX6SX_CLK_SAI2_IPG]     = imx_clk_gate2("sai2_ipg",      "ipg",               base + 0x7c, 30);
-       clks[IMX6SX_CLK_SAI1]         = imx_clk_gate2("sai1",          "ssi1_podf",         base + 0x7c, 28);
-       clks[IMX6SX_CLK_SAI2]         = imx_clk_gate2("sai2",          "ssi2_podf",         base + 0x7c, 30);
-
-       /* CCGR6 */
-       clks[IMX6SX_CLK_USBOH3]       = imx_clk_gate2("usboh3",        "ipg",               base + 0x80, 0);
-       clks[IMX6SX_CLK_USDHC1]       = imx_clk_gate2("usdhc1",        "usdhc1_podf",       base + 0x80, 2);
-       clks[IMX6SX_CLK_USDHC2]       = imx_clk_gate2("usdhc2",        "usdhc2_podf",       base + 0x80, 4);
-       clks[IMX6SX_CLK_USDHC3]       = imx_clk_gate2("usdhc3",        "usdhc3_podf",       base + 0x80, 6);
-       clks[IMX6SX_CLK_USDHC4]       = imx_clk_gate2("usdhc4",        "usdhc4_podf",       base + 0x80, 8);
-       clks[IMX6SX_CLK_EIM_SLOW]     = imx_clk_gate2("eim_slow",      "eim_slow_podf",     base + 0x80, 10);
-       clks[IMX6SX_CLK_PWM8]         = imx_clk_gate2("pwm8",          "perclk",            base + 0x80, 16);
-       clks[IMX6SX_CLK_VADC]         = imx_clk_gate2("vadc",          "vid_podf",          base + 0x80, 20);
-       clks[IMX6SX_CLK_GIS]          = imx_clk_gate2("gis",           "display_podf",      base + 0x80, 22);
-       clks[IMX6SX_CLK_I2C4]         = imx_clk_gate2("i2c4",          "perclk",            base + 0x80, 24);
-       clks[IMX6SX_CLK_PWM5]         = imx_clk_gate2("pwm5",          "perclk",            base + 0x80, 26);
-       clks[IMX6SX_CLK_PWM6]         = imx_clk_gate2("pwm6",          "perclk",            base + 0x80, 28);
-       clks[IMX6SX_CLK_PWM7]         = imx_clk_gate2("pwm7",          "perclk",            base + 0x80, 30);
-
-       clks[IMX6SX_CLK_CKO1]         = imx_clk_gate("cko1",           "cko1_podf",         base + 0x60, 7);
-       clks[IMX6SX_CLK_CKO2]         = imx_clk_gate("cko2",           "cko2_podf",         base + 0x60, 24);
-
-       /* mask handshake of mmdc */
-       writel_relaxed(BM_CCM_CCDR_MMDC_CH0_MASK, base + CCDR);
-
-       imx_check_clocks(clks, ARRAY_SIZE(clks));
-
-       clk_data.clks = clks;
-       clk_data.clk_num = ARRAY_SIZE(clks);
-       of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
-
-       for (i = 0; i < ARRAY_SIZE(clks_init_on); i++)
-               clk_prepare_enable(clks[clks_init_on[i]]);
-
-       if (IS_ENABLED(CONFIG_USB_MXS_PHY)) {
-               clk_prepare_enable(clks[IMX6SX_CLK_USBPHY1_GATE]);
-               clk_prepare_enable(clks[IMX6SX_CLK_USBPHY2_GATE]);
-       }
-
-       /* Set the default 132MHz for EIM module */
-       clk_set_parent(clks[IMX6SX_CLK_EIM_SLOW_SEL], clks[IMX6SX_CLK_PLL2_PFD2]);
-       clk_set_rate(clks[IMX6SX_CLK_EIM_SLOW], 132000000);
-
-       /* set parent clock for LCDIF1 pixel clock */
-       clk_set_parent(clks[IMX6SX_CLK_LCDIF1_PRE_SEL], clks[IMX6SX_CLK_PLL5_VIDEO_DIV]);
-       clk_set_parent(clks[IMX6SX_CLK_LCDIF1_SEL], clks[IMX6SX_CLK_LCDIF1_PODF]);
-
-       /* Set the parent clks of PCIe lvds1 and pcie_axi to be pcie ref, axi */
-       if (clk_set_parent(clks[IMX6SX_CLK_LVDS1_SEL], clks[IMX6SX_CLK_PCIE_REF_125M]))
-               pr_err("Failed to set pcie bus parent clk.\n");
-       if (clk_set_parent(clks[IMX6SX_CLK_PCIE_AXI_SEL], clks[IMX6SX_CLK_AXI]))
-               pr_err("Failed to set pcie parent clk.\n");
-
-       /*
-        * Init enet system AHB clock, set to 200Mhz
-        * pll2_pfd2_396m-> ENET_PODF-> ENET_AHB
-        */
-       clk_set_parent(clks[IMX6SX_CLK_ENET_PRE_SEL], clks[IMX6SX_CLK_PLL2_PFD2]);
-       clk_set_parent(clks[IMX6SX_CLK_ENET_SEL], clks[IMX6SX_CLK_ENET_PODF]);
-       clk_set_rate(clks[IMX6SX_CLK_ENET_PODF], 200000000);
-       clk_set_rate(clks[IMX6SX_CLK_ENET_REF], 125000000);
-       clk_set_rate(clks[IMX6SX_CLK_ENET2_REF], 125000000);
-
-       /* Audio clocks */
-       clk_set_rate(clks[IMX6SX_CLK_PLL4_AUDIO_DIV], 393216000);
-
-       clk_set_parent(clks[IMX6SX_CLK_SPDIF_SEL], clks[IMX6SX_CLK_PLL4_AUDIO_DIV]);
-       clk_set_rate(clks[IMX6SX_CLK_SPDIF_PODF], 98304000);
-
-       clk_set_parent(clks[IMX6SX_CLK_AUDIO_SEL], clks[IMX6SX_CLK_PLL3_USB_OTG]);
-       clk_set_rate(clks[IMX6SX_CLK_AUDIO_PODF], 24000000);
-
-       clk_set_parent(clks[IMX6SX_CLK_SSI1_SEL], clks[IMX6SX_CLK_PLL4_AUDIO_DIV]);
-       clk_set_parent(clks[IMX6SX_CLK_SSI2_SEL], clks[IMX6SX_CLK_PLL4_AUDIO_DIV]);
-       clk_set_parent(clks[IMX6SX_CLK_SSI3_SEL], clks[IMX6SX_CLK_PLL4_AUDIO_DIV]);
-       clk_set_rate(clks[IMX6SX_CLK_SSI1_PODF], 24576000);
-       clk_set_rate(clks[IMX6SX_CLK_SSI2_PODF], 24576000);
-       clk_set_rate(clks[IMX6SX_CLK_SSI3_PODF], 24576000);
-
-       clk_set_parent(clks[IMX6SX_CLK_ESAI_SEL], clks[IMX6SX_CLK_PLL4_AUDIO_DIV]);
-       clk_set_rate(clks[IMX6SX_CLK_ESAI_PODF], 24576000);
-
-       /* Set parent clock for vadc */
-       clk_set_parent(clks[IMX6SX_CLK_VID_SEL], clks[IMX6SX_CLK_PLL3_USB_OTG]);
-
-       /* default parent of can_sel clock is invalid, manually set it here */
-       clk_set_parent(clks[IMX6SX_CLK_CAN_SEL], clks[IMX6SX_CLK_PLL3_60M]);
-
-       /* Update gpu clock from default 528M to 720M */
-       clk_set_parent(clks[IMX6SX_CLK_GPU_CORE_SEL], clks[IMX6SX_CLK_PLL3_PFD0]);
-       clk_set_parent(clks[IMX6SX_CLK_GPU_AXI_SEL], clks[IMX6SX_CLK_PLL3_PFD0]);
-
-       clk_set_parent(clks[IMX6SX_CLK_QSPI1_SEL], clks[IMX6SX_CLK_PLL2_BUS]);
-       clk_set_parent(clks[IMX6SX_CLK_QSPI2_SEL], clks[IMX6SX_CLK_PLL2_BUS]);
-
-       /* Set initial power mode */
-       imx6q_set_lpm(WAIT_CLOCKED);
-}
-CLK_OF_DECLARE(imx6sx, "fsl,imx6sx-ccm", imx6sx_clocks_init);
diff --git a/arch/arm/mach-imx/clk-pfd.c b/arch/arm/mach-imx/clk-pfd.c
deleted file mode 100644 (file)
index 0b0f6f6..0000000
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * Copyright 2012 Freescale Semiconductor, Inc.
- * Copyright 2012 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:
- *
- * http://www.opensource.org/licenses/gpl-license.html
- * http://www.gnu.org/copyleft/gpl.html
- */
-
-#include <linux/clk.h>
-#include <linux/clk-provider.h>
-#include <linux/io.h>
-#include <linux/slab.h>
-#include <linux/err.h>
-#include "clk.h"
-
-/**
- * struct clk_pfd - IMX PFD clock
- * @clk_hw:    clock source
- * @reg:       PFD register address
- * @idx:       the index of PFD encoded in the register
- *
- * PFD clock found on i.MX6 series.  Each register for PFD has 4 clk_pfd
- * data encoded, and member idx is used to specify the one.  And each
- * register has SET, CLR and TOG registers at offset 0x4 0x8 and 0xc.
- */
-struct clk_pfd {
-       struct clk_hw   hw;
-       void __iomem    *reg;
-       u8              idx;
-};
-
-#define to_clk_pfd(_hw) container_of(_hw, struct clk_pfd, hw)
-
-#define SET    0x4
-#define CLR    0x8
-#define OTG    0xc
-
-static int clk_pfd_enable(struct clk_hw *hw)
-{
-       struct clk_pfd *pfd = to_clk_pfd(hw);
-
-       writel_relaxed(1 << ((pfd->idx + 1) * 8 - 1), pfd->reg + CLR);
-
-       return 0;
-}
-
-static void clk_pfd_disable(struct clk_hw *hw)
-{
-       struct clk_pfd *pfd = to_clk_pfd(hw);
-
-       writel_relaxed(1 << ((pfd->idx + 1) * 8 - 1), pfd->reg + SET);
-}
-
-static unsigned long clk_pfd_recalc_rate(struct clk_hw *hw,
-                                        unsigned long parent_rate)
-{
-       struct clk_pfd *pfd = to_clk_pfd(hw);
-       u64 tmp = parent_rate;
-       u8 frac = (readl_relaxed(pfd->reg) >> (pfd->idx * 8)) & 0x3f;
-
-       tmp *= 18;
-       do_div(tmp, frac);
-
-       return tmp;
-}
-
-static long clk_pfd_round_rate(struct clk_hw *hw, unsigned long rate,
-                              unsigned long *prate)
-{
-       u64 tmp = *prate;
-       u8 frac;
-
-       tmp = tmp * 18 + rate / 2;
-       do_div(tmp, rate);
-       frac = tmp;
-       if (frac < 12)
-               frac = 12;
-       else if (frac > 35)
-               frac = 35;
-       tmp = *prate;
-       tmp *= 18;
-       do_div(tmp, frac);
-
-       return tmp;
-}
-
-static int clk_pfd_set_rate(struct clk_hw *hw, unsigned long rate,
-               unsigned long parent_rate)
-{
-       struct clk_pfd *pfd = to_clk_pfd(hw);
-       u64 tmp = parent_rate;
-       u8 frac;
-
-       tmp = tmp * 18 + rate / 2;
-       do_div(tmp, rate);
-       frac = tmp;
-       if (frac < 12)
-               frac = 12;
-       else if (frac > 35)
-               frac = 35;
-
-       writel_relaxed(0x3f << (pfd->idx * 8), pfd->reg + CLR);
-       writel_relaxed(frac << (pfd->idx * 8), pfd->reg + SET);
-
-       return 0;
-}
-
-static int clk_pfd_is_enabled(struct clk_hw *hw)
-{
-       struct clk_pfd *pfd = to_clk_pfd(hw);
-
-       if (readl_relaxed(pfd->reg) & (1 << ((pfd->idx + 1) * 8 - 1)))
-               return 0;
-
-       return 1;
-}
-
-static const struct clk_ops clk_pfd_ops = {
-       .enable         = clk_pfd_enable,
-       .disable        = clk_pfd_disable,
-       .recalc_rate    = clk_pfd_recalc_rate,
-       .round_rate     = clk_pfd_round_rate,
-       .set_rate       = clk_pfd_set_rate,
-       .is_enabled     = clk_pfd_is_enabled,
-};
-
-struct clk *imx_clk_pfd(const char *name, const char *parent_name,
-                       void __iomem *reg, u8 idx)
-{
-       struct clk_pfd *pfd;
-       struct clk *clk;
-       struct clk_init_data init;
-
-       pfd = kzalloc(sizeof(*pfd), GFP_KERNEL);
-       if (!pfd)
-               return ERR_PTR(-ENOMEM);
-
-       pfd->reg = reg;
-       pfd->idx = idx;
-
-       init.name = name;
-       init.ops = &clk_pfd_ops;
-       init.flags = 0;
-       init.parent_names = &parent_name;
-       init.num_parents = 1;
-
-       pfd->hw.init = &init;
-
-       clk = clk_register(NULL, &pfd->hw);
-       if (IS_ERR(clk))
-               kfree(pfd);
-
-       return clk;
-}
diff --git a/arch/arm/mach-imx/clk-pllv1.c b/arch/arm/mach-imx/clk-pllv1.c
deleted file mode 100644 (file)
index d21d14c..0000000
+++ /dev/null
@@ -1,126 +0,0 @@
-#include <linux/clk.h>
-#include <linux/clk-provider.h>
-#include <linux/io.h>
-#include <linux/slab.h>
-#include <linux/kernel.h>
-#include <linux/err.h>
-
-#include "clk.h"
-#include "common.h"
-#include "hardware.h"
-
-/**
- * pll v1
- *
- * @clk_hw     clock source
- * @parent     the parent clock name
- * @base       base address of pll registers
- *
- * PLL clock version 1, found on i.MX1/21/25/27/31/35
- */
-
-#define MFN_BITS       (10)
-#define MFN_SIGN       (BIT(MFN_BITS - 1))
-#define MFN_MASK       (MFN_SIGN - 1)
-
-struct clk_pllv1 {
-       struct clk_hw   hw;
-       void __iomem    *base;
-};
-
-#define to_clk_pllv1(clk) (container_of(clk, struct clk_pllv1, clk))
-
-static inline bool mfn_is_negative(unsigned int mfn)
-{
-       return !cpu_is_mx1() && !cpu_is_mx21() && (mfn & MFN_SIGN);
-}
-
-static unsigned long clk_pllv1_recalc_rate(struct clk_hw *hw,
-               unsigned long parent_rate)
-{
-       struct clk_pllv1 *pll = to_clk_pllv1(hw);
-       long long ll;
-       int mfn_abs;
-       unsigned int mfi, mfn, mfd, pd;
-       u32 reg;
-       unsigned long rate;
-
-       reg = readl(pll->base);
-
-       /*
-        * Get the resulting clock rate from a PLL register value and the input
-        * frequency. PLLs with this register layout can be found on i.MX1,
-        * i.MX21, i.MX27 and i,MX31
-        *
-        *                  mfi + mfn / (mfd + 1)
-        *  f = 2 * f_ref * --------------------
-        *                        pd + 1
-        */
-
-       mfi = (reg >> 10) & 0xf;
-       mfn = reg & 0x3ff;
-       mfd = (reg >> 16) & 0x3ff;
-       pd =  (reg >> 26) & 0xf;
-
-       mfi = mfi <= 5 ? 5 : mfi;
-
-       mfn_abs = mfn;
-
-       /*
-        * On all i.MXs except i.MX1 and i.MX21 mfn is a 10bit
-        * 2's complements number.
-        * On i.MX27 the bit 9 is the sign bit.
-        */
-       if (mfn_is_negative(mfn)) {
-               if (cpu_is_mx27())
-                       mfn_abs = mfn & MFN_MASK;
-               else
-                       mfn_abs = BIT(MFN_BITS) - mfn;
-       }
-
-       rate = parent_rate * 2;
-       rate /= pd + 1;
-
-       ll = (unsigned long long)rate * mfn_abs;
-
-       do_div(ll, mfd + 1);
-
-       if (mfn_is_negative(mfn))
-               ll = -ll;
-
-       ll = (rate * mfi) + ll;
-
-       return ll;
-}
-
-static struct clk_ops clk_pllv1_ops = {
-       .recalc_rate = clk_pllv1_recalc_rate,
-};
-
-struct clk *imx_clk_pllv1(const char *name, const char *parent,
-               void __iomem *base)
-{
-       struct clk_pllv1 *pll;
-       struct clk *clk;
-       struct clk_init_data init;
-
-       pll = kmalloc(sizeof(*pll), GFP_KERNEL);
-       if (!pll)
-               return ERR_PTR(-ENOMEM);
-
-       pll->base = base;
-
-       init.name = name;
-       init.ops = &clk_pllv1_ops;
-       init.flags = 0;
-       init.parent_names = &parent;
-       init.num_parents = 1;
-
-       pll->hw.init = &init;
-
-       clk = clk_register(NULL, &pll->hw);
-       if (IS_ERR(clk))
-               kfree(pll);
-
-       return clk;
-}
diff --git a/arch/arm/mach-imx/clk-pllv2.c b/arch/arm/mach-imx/clk-pllv2.c
deleted file mode 100644 (file)
index 20889d5..0000000
+++ /dev/null
@@ -1,266 +0,0 @@
-#include <linux/kernel.h>
-#include <linux/clk.h>
-#include <linux/io.h>
-#include <linux/errno.h>
-#include <linux/delay.h>
-#include <linux/slab.h>
-#include <linux/err.h>
-
-#include <asm/div64.h>
-
-#include "clk.h"
-
-#define to_clk_pllv2(clk) (container_of(clk, struct clk_pllv2, clk))
-
-/* PLL Register Offsets */
-#define MXC_PLL_DP_CTL                 0x00
-#define MXC_PLL_DP_CONFIG              0x04
-#define MXC_PLL_DP_OP                  0x08
-#define MXC_PLL_DP_MFD                 0x0C
-#define MXC_PLL_DP_MFN                 0x10
-#define MXC_PLL_DP_MFNMINUS            0x14
-#define MXC_PLL_DP_MFNPLUS             0x18
-#define MXC_PLL_DP_HFS_OP              0x1C
-#define MXC_PLL_DP_HFS_MFD             0x20
-#define MXC_PLL_DP_HFS_MFN             0x24
-#define MXC_PLL_DP_MFN_TOGC            0x28
-#define MXC_PLL_DP_DESTAT              0x2c
-
-/* PLL Register Bit definitions */
-#define MXC_PLL_DP_CTL_MUL_CTRL                0x2000
-#define MXC_PLL_DP_CTL_DPDCK0_2_EN     0x1000
-#define MXC_PLL_DP_CTL_DPDCK0_2_OFFSET 12
-#define MXC_PLL_DP_CTL_ADE             0x800
-#define MXC_PLL_DP_CTL_REF_CLK_DIV     0x400
-#define MXC_PLL_DP_CTL_REF_CLK_SEL_MASK        (3 << 8)
-#define MXC_PLL_DP_CTL_REF_CLK_SEL_OFFSET      8
-#define MXC_PLL_DP_CTL_HFSM            0x80
-#define MXC_PLL_DP_CTL_PRE             0x40
-#define MXC_PLL_DP_CTL_UPEN            0x20
-#define MXC_PLL_DP_CTL_RST             0x10
-#define MXC_PLL_DP_CTL_RCP             0x8
-#define MXC_PLL_DP_CTL_PLM             0x4
-#define MXC_PLL_DP_CTL_BRM0            0x2
-#define MXC_PLL_DP_CTL_LRF             0x1
-
-#define MXC_PLL_DP_CONFIG_BIST         0x8
-#define MXC_PLL_DP_CONFIG_SJC_CE       0x4
-#define MXC_PLL_DP_CONFIG_AREN         0x2
-#define MXC_PLL_DP_CONFIG_LDREQ                0x1
-
-#define MXC_PLL_DP_OP_MFI_OFFSET       4
-#define MXC_PLL_DP_OP_MFI_MASK         (0xF << 4)
-#define MXC_PLL_DP_OP_PDF_OFFSET       0
-#define MXC_PLL_DP_OP_PDF_MASK         0xF
-
-#define MXC_PLL_DP_MFD_OFFSET          0
-#define MXC_PLL_DP_MFD_MASK            0x07FFFFFF
-
-#define MXC_PLL_DP_MFN_OFFSET          0x0
-#define MXC_PLL_DP_MFN_MASK            0x07FFFFFF
-
-#define MXC_PLL_DP_MFN_TOGC_TOG_DIS    (1 << 17)
-#define MXC_PLL_DP_MFN_TOGC_TOG_EN     (1 << 16)
-#define MXC_PLL_DP_MFN_TOGC_CNT_OFFSET 0x0
-#define MXC_PLL_DP_MFN_TOGC_CNT_MASK   0xFFFF
-
-#define MXC_PLL_DP_DESTAT_TOG_SEL      (1 << 31)
-#define MXC_PLL_DP_DESTAT_MFN          0x07FFFFFF
-
-#define MAX_DPLL_WAIT_TRIES    1000 /* 1000 * udelay(1) = 1ms */
-
-struct clk_pllv2 {
-       struct clk_hw   hw;
-       void __iomem    *base;
-};
-
-static unsigned long __clk_pllv2_recalc_rate(unsigned long parent_rate,
-               u32 dp_ctl, u32 dp_op, u32 dp_mfd, u32 dp_mfn)
-{
-       long mfi, mfn, mfd, pdf, ref_clk, mfn_abs;
-       unsigned long dbl;
-       s64 temp;
-
-       dbl = dp_ctl & MXC_PLL_DP_CTL_DPDCK0_2_EN;
-
-       pdf = dp_op & MXC_PLL_DP_OP_PDF_MASK;
-       mfi = (dp_op & MXC_PLL_DP_OP_MFI_MASK) >> MXC_PLL_DP_OP_MFI_OFFSET;
-       mfi = (mfi <= 5) ? 5 : mfi;
-       mfd = dp_mfd & MXC_PLL_DP_MFD_MASK;
-       mfn = mfn_abs = dp_mfn & MXC_PLL_DP_MFN_MASK;
-       /* Sign extend to 32-bits */
-       if (mfn >= 0x04000000) {
-               mfn |= 0xFC000000;
-               mfn_abs = -mfn;
-       }
-
-       ref_clk = 2 * parent_rate;
-       if (dbl != 0)
-               ref_clk *= 2;
-
-       ref_clk /= (pdf + 1);
-       temp = (u64) ref_clk * mfn_abs;
-       do_div(temp, mfd + 1);
-       if (mfn < 0)
-               temp = -temp;
-       temp = (ref_clk * mfi) + temp;
-
-       return temp;
-}
-
-static unsigned long clk_pllv2_recalc_rate(struct clk_hw *hw,
-               unsigned long parent_rate)
-{
-       u32 dp_op, dp_mfd, dp_mfn, dp_ctl;
-       void __iomem *pllbase;
-       struct clk_pllv2 *pll = to_clk_pllv2(hw);
-
-       pllbase = pll->base;
-
-       dp_ctl = __raw_readl(pllbase + MXC_PLL_DP_CTL);
-       dp_op = __raw_readl(pllbase + MXC_PLL_DP_OP);
-       dp_mfd = __raw_readl(pllbase + MXC_PLL_DP_MFD);
-       dp_mfn = __raw_readl(pllbase + MXC_PLL_DP_MFN);
-
-       return __clk_pllv2_recalc_rate(parent_rate, dp_ctl, dp_op, dp_mfd, dp_mfn);
-}
-
-static int __clk_pllv2_set_rate(unsigned long rate, unsigned long parent_rate,
-               u32 *dp_op, u32 *dp_mfd, u32 *dp_mfn)
-{
-       u32 reg;
-       long mfi, pdf, mfn, mfd = 999999;
-       s64 temp64;
-       unsigned long quad_parent_rate;
-
-       quad_parent_rate = 4 * parent_rate;
-       pdf = mfi = -1;
-       while (++pdf < 16 && mfi < 5)
-               mfi = rate * (pdf+1) / quad_parent_rate;
-       if (mfi > 15)
-               return -EINVAL;
-       pdf--;
-
-       temp64 = rate * (pdf + 1) - quad_parent_rate * mfi;
-       do_div(temp64, quad_parent_rate / 1000000);
-       mfn = (long)temp64;
-
-       reg = mfi << 4 | pdf;
-
-       *dp_op = reg;
-       *dp_mfd = mfd;
-       *dp_mfn = mfn;
-
-       return 0;
-}
-
-static int clk_pllv2_set_rate(struct clk_hw *hw, unsigned long rate,
-               unsigned long parent_rate)
-{
-       struct clk_pllv2 *pll = to_clk_pllv2(hw);
-       void __iomem *pllbase;
-       u32 dp_ctl, dp_op, dp_mfd, dp_mfn;
-       int ret;
-
-       pllbase = pll->base;
-
-
-       ret = __clk_pllv2_set_rate(rate, parent_rate, &dp_op, &dp_mfd, &dp_mfn);
-       if (ret)
-               return ret;
-
-       dp_ctl = __raw_readl(pllbase + MXC_PLL_DP_CTL);
-       /* use dpdck0_2 */
-       __raw_writel(dp_ctl | 0x1000L, pllbase + MXC_PLL_DP_CTL);
-
-       __raw_writel(dp_op, pllbase + MXC_PLL_DP_OP);
-       __raw_writel(dp_mfd, pllbase + MXC_PLL_DP_MFD);
-       __raw_writel(dp_mfn, pllbase + MXC_PLL_DP_MFN);
-
-       return 0;
-}
-
-static long clk_pllv2_round_rate(struct clk_hw *hw, unsigned long rate,
-               unsigned long *prate)
-{
-       u32 dp_op, dp_mfd, dp_mfn;
-
-       __clk_pllv2_set_rate(rate, *prate, &dp_op, &dp_mfd, &dp_mfn);
-       return __clk_pllv2_recalc_rate(*prate, MXC_PLL_DP_CTL_DPDCK0_2_EN,
-                       dp_op, dp_mfd, dp_mfn);
-}
-
-static int clk_pllv2_prepare(struct clk_hw *hw)
-{
-       struct clk_pllv2 *pll = to_clk_pllv2(hw);
-       u32 reg;
-       void __iomem *pllbase;
-       int i = 0;
-
-       pllbase = pll->base;
-       reg = __raw_readl(pllbase + MXC_PLL_DP_CTL) | MXC_PLL_DP_CTL_UPEN;
-       __raw_writel(reg, pllbase + MXC_PLL_DP_CTL);
-
-       /* Wait for lock */
-       do {
-               reg = __raw_readl(pllbase + MXC_PLL_DP_CTL);
-               if (reg & MXC_PLL_DP_CTL_LRF)
-                       break;
-
-               udelay(1);
-       } while (++i < MAX_DPLL_WAIT_TRIES);
-
-       if (i == MAX_DPLL_WAIT_TRIES) {
-               pr_err("MX5: pll locking failed\n");
-               return -EINVAL;
-       }
-
-       return 0;
-}
-
-static void clk_pllv2_unprepare(struct clk_hw *hw)
-{
-       struct clk_pllv2 *pll = to_clk_pllv2(hw);
-       u32 reg;
-       void __iomem *pllbase;
-
-       pllbase = pll->base;
-       reg = __raw_readl(pllbase + MXC_PLL_DP_CTL) & ~MXC_PLL_DP_CTL_UPEN;
-       __raw_writel(reg, pllbase + MXC_PLL_DP_CTL);
-}
-
-static struct clk_ops clk_pllv2_ops = {
-       .prepare = clk_pllv2_prepare,
-       .unprepare = clk_pllv2_unprepare,
-       .recalc_rate = clk_pllv2_recalc_rate,
-       .round_rate = clk_pllv2_round_rate,
-       .set_rate = clk_pllv2_set_rate,
-};
-
-struct clk *imx_clk_pllv2(const char *name, const char *parent,
-               void __iomem *base)
-{
-       struct clk_pllv2 *pll;
-       struct clk *clk;
-       struct clk_init_data init;
-
-       pll = kzalloc(sizeof(*pll), GFP_KERNEL);
-       if (!pll)
-               return ERR_PTR(-ENOMEM);
-
-       pll->base = base;
-
-       init.name = name;
-       init.ops = &clk_pllv2_ops;
-       init.flags = 0;
-       init.parent_names = &parent;
-       init.num_parents = 1;
-
-       pll->hw.init = &init;
-
-       clk = clk_register(NULL, &pll->hw);
-       if (IS_ERR(clk))
-               kfree(pll);
-
-       return clk;
-}
diff --git a/arch/arm/mach-imx/clk-pllv3.c b/arch/arm/mach-imx/clk-pllv3.c
deleted file mode 100644 (file)
index 641ebc5..0000000
+++ /dev/null
@@ -1,331 +0,0 @@
-/*
- * Copyright 2012 Freescale Semiconductor, Inc.
- * Copyright 2012 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:
- *
- * http://www.opensource.org/licenses/gpl-license.html
- * http://www.gnu.org/copyleft/gpl.html
- */
-
-#include <linux/clk.h>
-#include <linux/clk-provider.h>
-#include <linux/delay.h>
-#include <linux/io.h>
-#include <linux/slab.h>
-#include <linux/jiffies.h>
-#include <linux/err.h>
-#include "clk.h"
-
-#define PLL_NUM_OFFSET         0x10
-#define PLL_DENOM_OFFSET       0x20
-
-#define BM_PLL_POWER           (0x1 << 12)
-#define BM_PLL_LOCK            (0x1 << 31)
-
-/**
- * struct clk_pllv3 - IMX PLL clock version 3
- * @clk_hw:     clock source
- * @base:       base address of PLL registers
- * @powerup_set: set POWER bit to power up the PLL
- * @div_mask:   mask of divider bits
- * @div_shift:  shift of divider bits
- *
- * IMX PLL clock version 3, found on i.MX6 series.  Divider for pllv3
- * is actually a multiplier, and always sits at bit 0.
- */
-struct clk_pllv3 {
-       struct clk_hw   hw;
-       void __iomem    *base;
-       bool            powerup_set;
-       u32             div_mask;
-       u32             div_shift;
-};
-
-#define to_clk_pllv3(_hw) container_of(_hw, struct clk_pllv3, hw)
-
-static int clk_pllv3_wait_lock(struct clk_pllv3 *pll)
-{
-       unsigned long timeout = jiffies + msecs_to_jiffies(10);
-       u32 val = readl_relaxed(pll->base) & BM_PLL_POWER;
-
-       /* No need to wait for lock when pll is not powered up */
-       if ((pll->powerup_set && !val) || (!pll->powerup_set && val))
-               return 0;
-
-       /* Wait for PLL to lock */
-       do {
-               if (readl_relaxed(pll->base) & BM_PLL_LOCK)
-                       break;
-               if (time_after(jiffies, timeout))
-                       break;
-               usleep_range(50, 500);
-       } while (1);
-
-       return readl_relaxed(pll->base) & BM_PLL_LOCK ? 0 : -ETIMEDOUT;
-}
-
-static int clk_pllv3_prepare(struct clk_hw *hw)
-{
-       struct clk_pllv3 *pll = to_clk_pllv3(hw);
-       u32 val;
-
-       val = readl_relaxed(pll->base);
-       if (pll->powerup_set)
-               val |= BM_PLL_POWER;
-       else
-               val &= ~BM_PLL_POWER;
-       writel_relaxed(val, pll->base);
-
-       return clk_pllv3_wait_lock(pll);
-}
-
-static void clk_pllv3_unprepare(struct clk_hw *hw)
-{
-       struct clk_pllv3 *pll = to_clk_pllv3(hw);
-       u32 val;
-
-       val = readl_relaxed(pll->base);
-       if (pll->powerup_set)
-               val &= ~BM_PLL_POWER;
-       else
-               val |= BM_PLL_POWER;
-       writel_relaxed(val, pll->base);
-}
-
-static unsigned long clk_pllv3_recalc_rate(struct clk_hw *hw,
-                                          unsigned long parent_rate)
-{
-       struct clk_pllv3 *pll = to_clk_pllv3(hw);
-       u32 div = (readl_relaxed(pll->base) >> pll->div_shift)  & pll->div_mask;
-
-       return (div == 1) ? parent_rate * 22 : parent_rate * 20;
-}
-
-static long clk_pllv3_round_rate(struct clk_hw *hw, unsigned long rate,
-                                unsigned long *prate)
-{
-       unsigned long parent_rate = *prate;
-
-       return (rate >= parent_rate * 22) ? parent_rate * 22 :
-                                           parent_rate * 20;
-}
-
-static int clk_pllv3_set_rate(struct clk_hw *hw, unsigned long rate,
-               unsigned long parent_rate)
-{
-       struct clk_pllv3 *pll = to_clk_pllv3(hw);
-       u32 val, div;
-
-       if (rate == parent_rate * 22)
-               div = 1;
-       else if (rate == parent_rate * 20)
-               div = 0;
-       else
-               return -EINVAL;
-
-       val = readl_relaxed(pll->base);
-       val &= ~(pll->div_mask << pll->div_shift);
-       val |= (div << pll->div_shift);
-       writel_relaxed(val, pll->base);
-
-       return clk_pllv3_wait_lock(pll);
-}
-
-static const struct clk_ops clk_pllv3_ops = {
-       .prepare        = clk_pllv3_prepare,
-       .unprepare      = clk_pllv3_unprepare,
-       .recalc_rate    = clk_pllv3_recalc_rate,
-       .round_rate     = clk_pllv3_round_rate,
-       .set_rate       = clk_pllv3_set_rate,
-};
-
-static unsigned long clk_pllv3_sys_recalc_rate(struct clk_hw *hw,
-                                              unsigned long parent_rate)
-{
-       struct clk_pllv3 *pll = to_clk_pllv3(hw);
-       u32 div = readl_relaxed(pll->base) & pll->div_mask;
-
-       return parent_rate * div / 2;
-}
-
-static long clk_pllv3_sys_round_rate(struct clk_hw *hw, unsigned long rate,
-                                    unsigned long *prate)
-{
-       unsigned long parent_rate = *prate;
-       unsigned long min_rate = parent_rate * 54 / 2;
-       unsigned long max_rate = parent_rate * 108 / 2;
-       u32 div;
-
-       if (rate > max_rate)
-               rate = max_rate;
-       else if (rate < min_rate)
-               rate = min_rate;
-       div = rate * 2 / parent_rate;
-
-       return parent_rate * div / 2;
-}
-
-static int clk_pllv3_sys_set_rate(struct clk_hw *hw, unsigned long rate,
-               unsigned long parent_rate)
-{
-       struct clk_pllv3 *pll = to_clk_pllv3(hw);
-       unsigned long min_rate = parent_rate * 54 / 2;
-       unsigned long max_rate = parent_rate * 108 / 2;
-       u32 val, div;
-
-       if (rate < min_rate || rate > max_rate)
-               return -EINVAL;
-
-       div = rate * 2 / parent_rate;
-       val = readl_relaxed(pll->base);
-       val &= ~pll->div_mask;
-       val |= div;
-       writel_relaxed(val, pll->base);
-
-       return clk_pllv3_wait_lock(pll);
-}
-
-static const struct clk_ops clk_pllv3_sys_ops = {
-       .prepare        = clk_pllv3_prepare,
-       .unprepare      = clk_pllv3_unprepare,
-       .recalc_rate    = clk_pllv3_sys_recalc_rate,
-       .round_rate     = clk_pllv3_sys_round_rate,
-       .set_rate       = clk_pllv3_sys_set_rate,
-};
-
-static unsigned long clk_pllv3_av_recalc_rate(struct clk_hw *hw,
-                                             unsigned long parent_rate)
-{
-       struct clk_pllv3 *pll = to_clk_pllv3(hw);
-       u32 mfn = readl_relaxed(pll->base + PLL_NUM_OFFSET);
-       u32 mfd = readl_relaxed(pll->base + PLL_DENOM_OFFSET);
-       u32 div = readl_relaxed(pll->base) & pll->div_mask;
-
-       return (parent_rate * div) + ((parent_rate / mfd) * mfn);
-}
-
-static long clk_pllv3_av_round_rate(struct clk_hw *hw, unsigned long rate,
-                                   unsigned long *prate)
-{
-       unsigned long parent_rate = *prate;
-       unsigned long min_rate = parent_rate * 27;
-       unsigned long max_rate = parent_rate * 54;
-       u32 div;
-       u32 mfn, mfd = 1000000;
-       s64 temp64;
-
-       if (rate > max_rate)
-               rate = max_rate;
-       else if (rate < min_rate)
-               rate = min_rate;
-
-       div = rate / parent_rate;
-       temp64 = (u64) (rate - div * parent_rate);
-       temp64 *= mfd;
-       do_div(temp64, parent_rate);
-       mfn = temp64;
-
-       return parent_rate * div + parent_rate / mfd * mfn;
-}
-
-static int clk_pllv3_av_set_rate(struct clk_hw *hw, unsigned long rate,
-               unsigned long parent_rate)
-{
-       struct clk_pllv3 *pll = to_clk_pllv3(hw);
-       unsigned long min_rate = parent_rate * 27;
-       unsigned long max_rate = parent_rate * 54;
-       u32 val, div;
-       u32 mfn, mfd = 1000000;
-       s64 temp64;
-
-       if (rate < min_rate || rate > max_rate)
-               return -EINVAL;
-
-       div = rate / parent_rate;
-       temp64 = (u64) (rate - div * parent_rate);
-       temp64 *= mfd;
-       do_div(temp64, parent_rate);
-       mfn = temp64;
-
-       val = readl_relaxed(pll->base);
-       val &= ~pll->div_mask;
-       val |= div;
-       writel_relaxed(val, pll->base);
-       writel_relaxed(mfn, pll->base + PLL_NUM_OFFSET);
-       writel_relaxed(mfd, pll->base + PLL_DENOM_OFFSET);
-
-       return clk_pllv3_wait_lock(pll);
-}
-
-static const struct clk_ops clk_pllv3_av_ops = {
-       .prepare        = clk_pllv3_prepare,
-       .unprepare      = clk_pllv3_unprepare,
-       .recalc_rate    = clk_pllv3_av_recalc_rate,
-       .round_rate     = clk_pllv3_av_round_rate,
-       .set_rate       = clk_pllv3_av_set_rate,
-};
-
-static unsigned long clk_pllv3_enet_recalc_rate(struct clk_hw *hw,
-                                               unsigned long parent_rate)
-{
-       return 500000000;
-}
-
-static const struct clk_ops clk_pllv3_enet_ops = {
-       .prepare        = clk_pllv3_prepare,
-       .unprepare      = clk_pllv3_unprepare,
-       .recalc_rate    = clk_pllv3_enet_recalc_rate,
-};
-
-struct clk *imx_clk_pllv3(enum imx_pllv3_type type, const char *name,
-                         const char *parent_name, void __iomem *base,
-                         u32 div_mask)
-{
-       struct clk_pllv3 *pll;
-       const struct clk_ops *ops;
-       struct clk *clk;
-       struct clk_init_data init;
-
-       pll = kzalloc(sizeof(*pll), GFP_KERNEL);
-       if (!pll)
-               return ERR_PTR(-ENOMEM);
-
-       switch (type) {
-       case IMX_PLLV3_SYS:
-               ops = &clk_pllv3_sys_ops;
-               break;
-       case IMX_PLLV3_USB_VF610:
-               pll->div_shift = 1;
-       case IMX_PLLV3_USB:
-               ops = &clk_pllv3_ops;
-               pll->powerup_set = true;
-               break;
-       case IMX_PLLV3_AV:
-               ops = &clk_pllv3_av_ops;
-               break;
-       case IMX_PLLV3_ENET:
-               ops = &clk_pllv3_enet_ops;
-               break;
-       default:
-               ops = &clk_pllv3_ops;
-       }
-       pll->base = base;
-       pll->div_mask = div_mask;
-
-       init.name = name;
-       init.ops = ops;
-       init.flags = 0;
-       init.parent_names = &parent_name;
-       init.num_parents = 1;
-
-       pll->hw.init = &init;
-
-       clk = clk_register(NULL, &pll->hw);
-       if (IS_ERR(clk))
-               kfree(pll);
-
-       return clk;
-}
diff --git a/arch/arm/mach-imx/clk-vf610.c b/arch/arm/mach-imx/clk-vf610.c
deleted file mode 100644 (file)
index 61876ed..0000000
+++ /dev/null
@@ -1,412 +0,0 @@
-/*
- * Copyright 2012-2013 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 as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- */
-
-#include <linux/of_address.h>
-#include <linux/clk.h>
-#include <dt-bindings/clock/vf610-clock.h>
-
-#include "clk.h"
-
-#define CCM_CCR                        (ccm_base + 0x00)
-#define CCM_CSR                        (ccm_base + 0x04)
-#define CCM_CCSR               (ccm_base + 0x08)
-#define CCM_CACRR              (ccm_base + 0x0c)
-#define CCM_CSCMR1             (ccm_base + 0x10)
-#define CCM_CSCDR1             (ccm_base + 0x14)
-#define CCM_CSCDR2             (ccm_base + 0x18)
-#define CCM_CSCDR3             (ccm_base + 0x1c)
-#define CCM_CSCMR2             (ccm_base + 0x20)
-#define CCM_CSCDR4             (ccm_base + 0x24)
-#define CCM_CLPCR              (ccm_base + 0x2c)
-#define CCM_CISR               (ccm_base + 0x30)
-#define CCM_CIMR               (ccm_base + 0x34)
-#define CCM_CGPR               (ccm_base + 0x3c)
-#define CCM_CCGR0              (ccm_base + 0x40)
-#define CCM_CCGR1              (ccm_base + 0x44)
-#define CCM_CCGR2              (ccm_base + 0x48)
-#define CCM_CCGR3              (ccm_base + 0x4c)
-#define CCM_CCGR4              (ccm_base + 0x50)
-#define CCM_CCGR5              (ccm_base + 0x54)
-#define CCM_CCGR6              (ccm_base + 0x58)
-#define CCM_CCGR7              (ccm_base + 0x5c)
-#define CCM_CCGR8              (ccm_base + 0x60)
-#define CCM_CCGR9              (ccm_base + 0x64)
-#define CCM_CCGR10             (ccm_base + 0x68)
-#define CCM_CCGR11             (ccm_base + 0x6c)
-#define CCM_CMEOR0             (ccm_base + 0x70)
-#define CCM_CMEOR1             (ccm_base + 0x74)
-#define CCM_CMEOR2             (ccm_base + 0x78)
-#define CCM_CMEOR3             (ccm_base + 0x7c)
-#define CCM_CMEOR4             (ccm_base + 0x80)
-#define CCM_CMEOR5             (ccm_base + 0x84)
-#define CCM_CPPDSR             (ccm_base + 0x88)
-#define CCM_CCOWR              (ccm_base + 0x8c)
-#define CCM_CCPGR0             (ccm_base + 0x90)
-#define CCM_CCPGR1             (ccm_base + 0x94)
-#define CCM_CCPGR2             (ccm_base + 0x98)
-#define CCM_CCPGR3             (ccm_base + 0x9c)
-
-#define CCM_CCGRx_CGn(n)       ((n) * 2)
-
-#define PFD_PLL1_BASE          (anatop_base + 0x2b0)
-#define PFD_PLL2_BASE          (anatop_base + 0x100)
-#define PFD_PLL3_BASE          (anatop_base + 0xf0)
-#define PLL1_CTRL              (anatop_base + 0x270)
-#define PLL2_CTRL              (anatop_base + 0x30)
-#define PLL3_CTRL              (anatop_base + 0x10)
-#define PLL4_CTRL              (anatop_base + 0x70)
-#define PLL5_CTRL              (anatop_base + 0xe0)
-#define PLL6_CTRL              (anatop_base + 0xa0)
-#define PLL7_CTRL              (anatop_base + 0x20)
-#define ANA_MISC1              (anatop_base + 0x160)
-
-static void __iomem *anatop_base;
-static void __iomem *ccm_base;
-
-/* sources for multiplexer clocks, this is used multiple times */
-static const char *fast_sels[] = { "firc", "fxosc", };
-static const char *slow_sels[] = { "sirc_32k", "sxosc", };
-static const char *pll1_sels[] = { "pll1_sys", "pll1_pfd1", "pll1_pfd2", "pll1_pfd3", "pll1_pfd4", };
-static const char *pll2_sels[] = { "pll2_bus", "pll2_pfd1", "pll2_pfd2", "pll2_pfd3", "pll2_pfd4", };
-static const char *pll_bypass_src_sels[] = { "fast_clk_sel", "lvds1_in", };
-static const char *pll1_bypass_sels[] = { "pll1", "pll1_bypass_src", };
-static const char *pll2_bypass_sels[] = { "pll2", "pll2_bypass_src", };
-static const char *pll3_bypass_sels[] = { "pll3", "pll3_bypass_src", };
-static const char *pll4_bypass_sels[] = { "pll4", "pll4_bypass_src", };
-static const char *pll5_bypass_sels[] = { "pll5", "pll5_bypass_src", };
-static const char *pll6_bypass_sels[] = { "pll6", "pll6_bypass_src", };
-static const char *pll7_bypass_sels[] = { "pll7", "pll7_bypass_src", };
-static const char *sys_sels[]  = { "fast_clk_sel", "slow_clk_sel", "pll2_pfd_sel", "pll2_bus", "pll1_pfd_sel", "pll3_usb_otg", };
-static const char *ddr_sels[]  = { "pll2_pfd2", "sys_sel", };
-static const char *rmii_sels[] = { "enet_ext", "audio_ext", "enet_50m", "enet_25m", };
-static const char *enet_ts_sels[]      = { "enet_ext", "fxosc", "audio_ext", "usb", "enet_ts", "enet_25m", "enet_50m", };
-static const char *esai_sels[] = { "audio_ext", "mlb", "spdif_rx", "pll4_audio_div", };
-static const char *sai_sels[]  = { "audio_ext", "mlb", "spdif_rx", "pll4_audio_div", };
-static const char *nfc_sels[]  = { "platform_bus", "pll1_pfd1", "pll3_pfd1", "pll3_pfd3", };
-static const char *qspi_sels[] = { "pll3_usb_otg", "pll3_pfd4", "pll2_pfd4", "pll1_pfd4", };
-static const char *esdhc_sels[]        = { "pll3_usb_otg", "pll3_pfd3", "pll1_pfd3", "platform_bus", };
-static const char *dcu_sels[]  = { "pll1_pfd2", "pll3_usb_otg", };
-static const char *gpu_sels[]  = { "pll2_pfd2", "pll3_pfd2", };
-static const char *vadc_sels[] = { "pll6_video_div", "pll3_usb_otg_div", "pll3_usb_otg", };
-/* FTM counter clock source, not module clock */
-static const char *ftm_ext_sels[]      = {"sirc_128k", "sxosc", "fxosc_half", "audio_ext", };
-static const char *ftm_fix_sels[]      = { "sxosc", "ipg_bus", };
-
-
-static struct clk_div_table pll4_audio_div_table[] = {
-       { .val = 0, .div = 1 },
-       { .val = 1, .div = 2 },
-       { .val = 2, .div = 6 },
-       { .val = 3, .div = 8 },
-       { .val = 4, .div = 10 },
-       { .val = 5, .div = 12 },
-       { .val = 6, .div = 14 },
-       { .val = 7, .div = 16 },
-       { }
-};
-
-static struct clk *clk[VF610_CLK_END];
-static struct clk_onecell_data clk_data;
-
-static unsigned int const clks_init_on[] __initconst = {
-       VF610_CLK_SYS_BUS,
-       VF610_CLK_DDR_SEL,
-};
-
-static struct clk * __init vf610_get_fixed_clock(
-                               struct device_node *ccm_node, const char *name)
-{
-       struct clk *clk = of_clk_get_by_name(ccm_node, name);
-
-       /* Backward compatibility if device tree is missing clks assignments */
-       if (IS_ERR(clk))
-               clk = imx_obtain_fixed_clock(name, 0);
-       return clk;
-};
-
-static void __init vf610_clocks_init(struct device_node *ccm_node)
-{
-       struct device_node *np;
-       int i;
-
-       clk[VF610_CLK_DUMMY] = imx_clk_fixed("dummy", 0);
-       clk[VF610_CLK_SIRC_128K] = imx_clk_fixed("sirc_128k", 128000);
-       clk[VF610_CLK_SIRC_32K] = imx_clk_fixed("sirc_32k", 32000);
-       clk[VF610_CLK_FIRC] = imx_clk_fixed("firc", 24000000);
-
-       clk[VF610_CLK_SXOSC] = vf610_get_fixed_clock(ccm_node, "sxosc");
-       clk[VF610_CLK_FXOSC] = vf610_get_fixed_clock(ccm_node, "fxosc");
-       clk[VF610_CLK_AUDIO_EXT] = vf610_get_fixed_clock(ccm_node, "audio_ext");
-       clk[VF610_CLK_ENET_EXT] = vf610_get_fixed_clock(ccm_node, "enet_ext");
-
-       /* Clock source from external clock via LVDs PAD */
-       clk[VF610_CLK_ANACLK1] = vf610_get_fixed_clock(ccm_node, "anaclk1");
-
-       clk[VF610_CLK_FXOSC_HALF] = imx_clk_fixed_factor("fxosc_half", "fxosc", 1, 2);
-
-       np = of_find_compatible_node(NULL, NULL, "fsl,vf610-anatop");
-       anatop_base = of_iomap(np, 0);
-       BUG_ON(!anatop_base);
-
-       np = ccm_node;
-       ccm_base = of_iomap(np, 0);
-       BUG_ON(!ccm_base);
-
-       clk[VF610_CLK_SLOW_CLK_SEL] = imx_clk_mux("slow_clk_sel", CCM_CCSR, 4, 1, slow_sels, ARRAY_SIZE(slow_sels));
-       clk[VF610_CLK_FASK_CLK_SEL] = imx_clk_mux("fast_clk_sel", CCM_CCSR, 5, 1, fast_sels, ARRAY_SIZE(fast_sels));
-
-       clk[VF610_CLK_PLL1_BYPASS_SRC] = imx_clk_mux("pll1_bypass_src", PLL1_CTRL, 14, 1, pll_bypass_src_sels, ARRAY_SIZE(pll_bypass_src_sels));
-       clk[VF610_CLK_PLL2_BYPASS_SRC] = imx_clk_mux("pll2_bypass_src", PLL2_CTRL, 14, 1, pll_bypass_src_sels, ARRAY_SIZE(pll_bypass_src_sels));
-       clk[VF610_CLK_PLL3_BYPASS_SRC] = imx_clk_mux("pll3_bypass_src", PLL3_CTRL, 14, 1, pll_bypass_src_sels, ARRAY_SIZE(pll_bypass_src_sels));
-       clk[VF610_CLK_PLL4_BYPASS_SRC] = imx_clk_mux("pll4_bypass_src", PLL4_CTRL, 14, 1, pll_bypass_src_sels, ARRAY_SIZE(pll_bypass_src_sels));
-       clk[VF610_CLK_PLL5_BYPASS_SRC] = imx_clk_mux("pll5_bypass_src", PLL5_CTRL, 14, 1, pll_bypass_src_sels, ARRAY_SIZE(pll_bypass_src_sels));
-       clk[VF610_CLK_PLL6_BYPASS_SRC] = imx_clk_mux("pll6_bypass_src", PLL6_CTRL, 14, 1, pll_bypass_src_sels, ARRAY_SIZE(pll_bypass_src_sels));
-       clk[VF610_CLK_PLL7_BYPASS_SRC] = imx_clk_mux("pll7_bypass_src", PLL7_CTRL, 14, 1, pll_bypass_src_sels, ARRAY_SIZE(pll_bypass_src_sels));
-
-       clk[VF610_CLK_PLL1] = imx_clk_pllv3(IMX_PLLV3_GENERIC, "pll1", "pll1_bypass_src", PLL1_CTRL, 0x1);
-       clk[VF610_CLK_PLL2] = imx_clk_pllv3(IMX_PLLV3_GENERIC, "pll2", "pll2_bypass_src", PLL2_CTRL, 0x1);
-       clk[VF610_CLK_PLL3] = imx_clk_pllv3(IMX_PLLV3_USB_VF610,     "pll3", "pll3_bypass_src", PLL3_CTRL, 0x2);
-       clk[VF610_CLK_PLL4] = imx_clk_pllv3(IMX_PLLV3_AV,      "pll4", "pll4_bypass_src", PLL4_CTRL, 0x7f);
-       clk[VF610_CLK_PLL5] = imx_clk_pllv3(IMX_PLLV3_ENET,    "pll5", "pll5_bypass_src", PLL5_CTRL, 0x3);
-       clk[VF610_CLK_PLL6] = imx_clk_pllv3(IMX_PLLV3_AV,      "pll6", "pll6_bypass_src", PLL6_CTRL, 0x7f);
-       clk[VF610_CLK_PLL7] = imx_clk_pllv3(IMX_PLLV3_USB_VF610,     "pll7", "pll7_bypass_src", PLL7_CTRL, 0x2);
-
-       clk[VF610_PLL1_BYPASS] = imx_clk_mux_flags("pll1_bypass", PLL1_CTRL, 16, 1, pll1_bypass_sels, ARRAY_SIZE(pll1_bypass_sels), CLK_SET_RATE_PARENT);
-       clk[VF610_PLL2_BYPASS] = imx_clk_mux_flags("pll2_bypass", PLL2_CTRL, 16, 1, pll2_bypass_sels, ARRAY_SIZE(pll2_bypass_sels), CLK_SET_RATE_PARENT);
-       clk[VF610_PLL3_BYPASS] = imx_clk_mux_flags("pll3_bypass", PLL3_CTRL, 16, 1, pll3_bypass_sels, ARRAY_SIZE(pll3_bypass_sels), CLK_SET_RATE_PARENT);
-       clk[VF610_PLL4_BYPASS] = imx_clk_mux_flags("pll4_bypass", PLL4_CTRL, 16, 1, pll4_bypass_sels, ARRAY_SIZE(pll4_bypass_sels), CLK_SET_RATE_PARENT);
-       clk[VF610_PLL5_BYPASS] = imx_clk_mux_flags("pll5_bypass", PLL5_CTRL, 16, 1, pll5_bypass_sels, ARRAY_SIZE(pll5_bypass_sels), CLK_SET_RATE_PARENT);
-       clk[VF610_PLL6_BYPASS] = imx_clk_mux_flags("pll6_bypass", PLL6_CTRL, 16, 1, pll6_bypass_sels, ARRAY_SIZE(pll6_bypass_sels), CLK_SET_RATE_PARENT);
-       clk[VF610_PLL7_BYPASS] = imx_clk_mux_flags("pll7_bypass", PLL7_CTRL, 16, 1, pll7_bypass_sels, ARRAY_SIZE(pll7_bypass_sels), CLK_SET_RATE_PARENT);
-
-       /* Do not bypass PLLs initially */
-       clk_set_parent(clk[VF610_PLL1_BYPASS], clk[VF610_CLK_PLL1]);
-       clk_set_parent(clk[VF610_PLL2_BYPASS], clk[VF610_CLK_PLL2]);
-       clk_set_parent(clk[VF610_PLL3_BYPASS], clk[VF610_CLK_PLL3]);
-       clk_set_parent(clk[VF610_PLL4_BYPASS], clk[VF610_CLK_PLL4]);
-       clk_set_parent(clk[VF610_PLL5_BYPASS], clk[VF610_CLK_PLL5]);
-       clk_set_parent(clk[VF610_PLL6_BYPASS], clk[VF610_CLK_PLL6]);
-       clk_set_parent(clk[VF610_PLL7_BYPASS], clk[VF610_CLK_PLL7]);
-
-       clk[VF610_CLK_PLL1_SYS]      = imx_clk_gate("pll1_sys",      "pll1_bypass", PLL1_CTRL, 13);
-       clk[VF610_CLK_PLL2_BUS]      = imx_clk_gate("pll2_bus",      "pll2_bypass", PLL2_CTRL, 13);
-       clk[VF610_CLK_PLL3_USB_OTG]  = imx_clk_gate("pll3_usb_otg",  "pll3_bypass", PLL3_CTRL, 13);
-       clk[VF610_CLK_PLL4_AUDIO]    = imx_clk_gate("pll4_audio",    "pll4_bypass", PLL4_CTRL, 13);
-       clk[VF610_CLK_PLL5_ENET]     = imx_clk_gate("pll5_enet",     "pll5_bypass", PLL5_CTRL, 13);
-       clk[VF610_CLK_PLL6_VIDEO]    = imx_clk_gate("pll6_video",    "pll6_bypass", PLL6_CTRL, 13);
-       clk[VF610_CLK_PLL7_USB_HOST] = imx_clk_gate("pll7_usb_host", "pll7_bypass", PLL7_CTRL, 13);
-
-       clk[VF610_CLK_LVDS1_IN]  = imx_clk_gate_exclusive("lvds1_in", "anaclk1", ANA_MISC1, 12, BIT(10));
-
-       clk[VF610_CLK_PLL1_PFD1] = imx_clk_pfd("pll1_pfd1", "pll1_sys", PFD_PLL1_BASE, 0);
-       clk[VF610_CLK_PLL1_PFD2] = imx_clk_pfd("pll1_pfd2", "pll1_sys", PFD_PLL1_BASE, 1);
-       clk[VF610_CLK_PLL1_PFD3] = imx_clk_pfd("pll1_pfd3", "pll1_sys", PFD_PLL1_BASE, 2);
-       clk[VF610_CLK_PLL1_PFD4] = imx_clk_pfd("pll1_pfd4", "pll1_sys", PFD_PLL1_BASE, 3);
-
-       clk[VF610_CLK_PLL2_PFD1] = imx_clk_pfd("pll2_pfd1", "pll2_bus", PFD_PLL2_BASE, 0);
-       clk[VF610_CLK_PLL2_PFD2] = imx_clk_pfd("pll2_pfd2", "pll2_bus", PFD_PLL2_BASE, 1);
-       clk[VF610_CLK_PLL2_PFD3] = imx_clk_pfd("pll2_pfd3", "pll2_bus", PFD_PLL2_BASE, 2);
-       clk[VF610_CLK_PLL2_PFD4] = imx_clk_pfd("pll2_pfd4", "pll2_bus", PFD_PLL2_BASE, 3);
-
-       clk[VF610_CLK_PLL3_PFD1] = imx_clk_pfd("pll3_pfd1", "pll3_usb_otg", PFD_PLL3_BASE, 0);
-       clk[VF610_CLK_PLL3_PFD2] = imx_clk_pfd("pll3_pfd2", "pll3_usb_otg", PFD_PLL3_BASE, 1);
-       clk[VF610_CLK_PLL3_PFD3] = imx_clk_pfd("pll3_pfd3", "pll3_usb_otg", PFD_PLL3_BASE, 2);
-       clk[VF610_CLK_PLL3_PFD4] = imx_clk_pfd("pll3_pfd4", "pll3_usb_otg", PFD_PLL3_BASE, 3);
-
-       clk[VF610_CLK_PLL1_PFD_SEL] = imx_clk_mux("pll1_pfd_sel", CCM_CCSR, 16, 3, pll1_sels, 5);
-       clk[VF610_CLK_PLL2_PFD_SEL] = imx_clk_mux("pll2_pfd_sel", CCM_CCSR, 19, 3, pll2_sels, 5);
-       clk[VF610_CLK_SYS_SEL] = imx_clk_mux("sys_sel", CCM_CCSR, 0, 3, sys_sels, ARRAY_SIZE(sys_sels));
-       clk[VF610_CLK_DDR_SEL] = imx_clk_mux("ddr_sel", CCM_CCSR, 6, 1, ddr_sels, ARRAY_SIZE(ddr_sels));
-       clk[VF610_CLK_SYS_BUS] = imx_clk_divider("sys_bus", "sys_sel", CCM_CACRR, 0, 3);
-       clk[VF610_CLK_PLATFORM_BUS] = imx_clk_divider("platform_bus", "sys_bus", CCM_CACRR, 3, 3);
-       clk[VF610_CLK_IPG_BUS] = imx_clk_divider("ipg_bus", "platform_bus", CCM_CACRR, 11, 2);
-
-       clk[VF610_CLK_PLL3_MAIN_DIV] = imx_clk_divider("pll3_usb_otg_div", "pll3_usb_otg", CCM_CACRR, 20, 1);
-       clk[VF610_CLK_PLL4_MAIN_DIV] = clk_register_divider_table(NULL, "pll4_audio_div", "pll4_audio", 0, CCM_CACRR, 6, 3, 0, pll4_audio_div_table, &imx_ccm_lock);
-       clk[VF610_CLK_PLL6_MAIN_DIV] = imx_clk_divider("pll6_video_div", "pll6_video", CCM_CACRR, 21, 1);
-
-       clk[VF610_CLK_USBPHY0] = imx_clk_gate("usbphy0", "pll3_usb_otg", PLL3_CTRL, 6);
-       clk[VF610_CLK_USBPHY1] = imx_clk_gate("usbphy1", "pll7_usb_host", PLL7_CTRL, 6);
-
-       clk[VF610_CLK_USBC0] = imx_clk_gate2("usbc0", "ipg_bus", CCM_CCGR1, CCM_CCGRx_CGn(4));
-       clk[VF610_CLK_USBC1] = imx_clk_gate2("usbc1", "ipg_bus", CCM_CCGR7, CCM_CCGRx_CGn(4));
-
-       clk[VF610_CLK_QSPI0_SEL] = imx_clk_mux("qspi0_sel", CCM_CSCMR1, 22, 2, qspi_sels, 4);
-       clk[VF610_CLK_QSPI0_EN] = imx_clk_gate("qspi0_en", "qspi0_sel", CCM_CSCDR3, 4);
-       clk[VF610_CLK_QSPI0_X4_DIV] = imx_clk_divider("qspi0_x4", "qspi0_en", CCM_CSCDR3, 0, 2);
-       clk[VF610_CLK_QSPI0_X2_DIV] = imx_clk_divider("qspi0_x2", "qspi0_x4", CCM_CSCDR3, 2, 1);
-       clk[VF610_CLK_QSPI0_X1_DIV] = imx_clk_divider("qspi0_x1", "qspi0_x2", CCM_CSCDR3, 3, 1);
-       clk[VF610_CLK_QSPI0] = imx_clk_gate2("qspi0", "qspi0_x1", CCM_CCGR2, CCM_CCGRx_CGn(4));
-
-       clk[VF610_CLK_QSPI1_SEL] = imx_clk_mux("qspi1_sel", CCM_CSCMR1, 24, 2, qspi_sels, 4);
-       clk[VF610_CLK_QSPI1_EN] = imx_clk_gate("qspi1_en", "qspi1_sel", CCM_CSCDR3, 12);
-       clk[VF610_CLK_QSPI1_X4_DIV] = imx_clk_divider("qspi1_x4", "qspi1_en", CCM_CSCDR3, 8, 2);
-       clk[VF610_CLK_QSPI1_X2_DIV] = imx_clk_divider("qspi1_x2", "qspi1_x4", CCM_CSCDR3, 10, 1);
-       clk[VF610_CLK_QSPI1_X1_DIV] = imx_clk_divider("qspi1_x1", "qspi1_x2", CCM_CSCDR3, 11, 1);
-       clk[VF610_CLK_QSPI1] = imx_clk_gate2("qspi1", "qspi1_x1", CCM_CCGR8, CCM_CCGRx_CGn(4));
-
-       clk[VF610_CLK_ENET_50M] = imx_clk_fixed_factor("enet_50m", "pll5_enet", 1, 10);
-       clk[VF610_CLK_ENET_25M] = imx_clk_fixed_factor("enet_25m", "pll5_enet", 1, 20);
-       clk[VF610_CLK_ENET_SEL] = imx_clk_mux("enet_sel", CCM_CSCMR2, 4, 2, rmii_sels, 4);
-       clk[VF610_CLK_ENET_TS_SEL] = imx_clk_mux("enet_ts_sel", CCM_CSCMR2, 0, 3, enet_ts_sels, 7);
-       clk[VF610_CLK_ENET] = imx_clk_gate("enet", "enet_sel", CCM_CSCDR1, 24);
-       clk[VF610_CLK_ENET_TS] = imx_clk_gate("enet_ts", "enet_ts_sel", CCM_CSCDR1, 23);
-       clk[VF610_CLK_ENET0] = imx_clk_gate2("enet0", "ipg_bus", CCM_CCGR9, CCM_CCGRx_CGn(0));
-       clk[VF610_CLK_ENET1] = imx_clk_gate2("enet1", "ipg_bus", CCM_CCGR9, CCM_CCGRx_CGn(1));
-
-       clk[VF610_CLK_PIT] = imx_clk_gate2("pit", "ipg_bus", CCM_CCGR1, CCM_CCGRx_CGn(7));
-
-       clk[VF610_CLK_UART0] = imx_clk_gate2("uart0", "ipg_bus", CCM_CCGR0, CCM_CCGRx_CGn(7));
-       clk[VF610_CLK_UART1] = imx_clk_gate2("uart1", "ipg_bus", CCM_CCGR0, CCM_CCGRx_CGn(8));
-       clk[VF610_CLK_UART2] = imx_clk_gate2("uart2", "ipg_bus", CCM_CCGR0, CCM_CCGRx_CGn(9));
-       clk[VF610_CLK_UART3] = imx_clk_gate2("uart3", "ipg_bus", CCM_CCGR0, CCM_CCGRx_CGn(10));
-       clk[VF610_CLK_UART4] = imx_clk_gate2("uart4", "ipg_bus", CCM_CCGR6, CCM_CCGRx_CGn(9));
-       clk[VF610_CLK_UART5] = imx_clk_gate2("uart5", "ipg_bus", CCM_CCGR6, CCM_CCGRx_CGn(10));
-
-       clk[VF610_CLK_I2C0] = imx_clk_gate2("i2c0", "ipg_bus", CCM_CCGR4, CCM_CCGRx_CGn(6));
-       clk[VF610_CLK_I2C1] = imx_clk_gate2("i2c1", "ipg_bus", CCM_CCGR4, CCM_CCGRx_CGn(7));
-
-       clk[VF610_CLK_DSPI0] = imx_clk_gate2("dspi0", "ipg_bus", CCM_CCGR0, CCM_CCGRx_CGn(12));
-       clk[VF610_CLK_DSPI1] = imx_clk_gate2("dspi1", "ipg_bus", CCM_CCGR0, CCM_CCGRx_CGn(13));
-       clk[VF610_CLK_DSPI2] = imx_clk_gate2("dspi2", "ipg_bus", CCM_CCGR6, CCM_CCGRx_CGn(12));
-       clk[VF610_CLK_DSPI3] = imx_clk_gate2("dspi3", "ipg_bus", CCM_CCGR6, CCM_CCGRx_CGn(13));
-
-       clk[VF610_CLK_WDT] = imx_clk_gate2("wdt", "ipg_bus", CCM_CCGR1, CCM_CCGRx_CGn(14));
-
-       clk[VF610_CLK_ESDHC0_SEL] = imx_clk_mux("esdhc0_sel", CCM_CSCMR1, 16, 2, esdhc_sels, 4);
-       clk[VF610_CLK_ESDHC0_EN] = imx_clk_gate("esdhc0_en", "esdhc0_sel", CCM_CSCDR2, 28);
-       clk[VF610_CLK_ESDHC0_DIV] = imx_clk_divider("esdhc0_div", "esdhc0_en", CCM_CSCDR2, 16, 4);
-       clk[VF610_CLK_ESDHC0] = imx_clk_gate2("eshc0", "esdhc0_div", CCM_CCGR7, CCM_CCGRx_CGn(1));
-
-       clk[VF610_CLK_ESDHC1_SEL] = imx_clk_mux("esdhc1_sel", CCM_CSCMR1, 18, 2, esdhc_sels, 4);
-       clk[VF610_CLK_ESDHC1_EN] = imx_clk_gate("esdhc1_en", "esdhc1_sel", CCM_CSCDR2, 29);
-       clk[VF610_CLK_ESDHC1_DIV] = imx_clk_divider("esdhc1_div", "esdhc1_en", CCM_CSCDR2, 20, 4);
-       clk[VF610_CLK_ESDHC1] = imx_clk_gate2("eshc1", "esdhc1_div", CCM_CCGR7, CCM_CCGRx_CGn(2));
-
-       /*
-        * ftm_ext_clk and ftm_fix_clk are FTM timer counter's
-        * selectable clock sources, both use a common enable bit
-        * in CCM_CSCDR1, selecting "dummy" clock as parent of
-        * "ftm0_ext_fix" make it serve only for enable/disable.
-        */
-       clk[VF610_CLK_FTM0_EXT_SEL] = imx_clk_mux("ftm0_ext_sel", CCM_CSCMR2, 6, 2, ftm_ext_sels, 4);
-       clk[VF610_CLK_FTM0_FIX_SEL] = imx_clk_mux("ftm0_fix_sel", CCM_CSCMR2, 14, 1, ftm_fix_sels, 2);
-       clk[VF610_CLK_FTM0_EXT_FIX_EN] = imx_clk_gate("ftm0_ext_fix_en", "dummy", CCM_CSCDR1, 25);
-       clk[VF610_CLK_FTM1_EXT_SEL] = imx_clk_mux("ftm1_ext_sel", CCM_CSCMR2, 8, 2, ftm_ext_sels, 4);
-       clk[VF610_CLK_FTM1_FIX_SEL] = imx_clk_mux("ftm1_fix_sel", CCM_CSCMR2, 15, 1, ftm_fix_sels, 2);
-       clk[VF610_CLK_FTM1_EXT_FIX_EN] = imx_clk_gate("ftm1_ext_fix_en", "dummy", CCM_CSCDR1, 26);
-       clk[VF610_CLK_FTM2_EXT_SEL] = imx_clk_mux("ftm2_ext_sel", CCM_CSCMR2, 10, 2, ftm_ext_sels, 4);
-       clk[VF610_CLK_FTM2_FIX_SEL] = imx_clk_mux("ftm2_fix_sel", CCM_CSCMR2, 16, 1, ftm_fix_sels, 2);
-       clk[VF610_CLK_FTM2_EXT_FIX_EN] = imx_clk_gate("ftm2_ext_fix_en", "dummy", CCM_CSCDR1, 27);
-       clk[VF610_CLK_FTM3_EXT_SEL] = imx_clk_mux("ftm3_ext_sel", CCM_CSCMR2, 12, 2, ftm_ext_sels, 4);
-       clk[VF610_CLK_FTM3_FIX_SEL] = imx_clk_mux("ftm3_fix_sel", CCM_CSCMR2, 17, 1, ftm_fix_sels, 2);
-       clk[VF610_CLK_FTM3_EXT_FIX_EN] = imx_clk_gate("ftm3_ext_fix_en", "dummy", CCM_CSCDR1, 28);
-
-       /* ftm(n)_clk are FTM module operation clock */
-       clk[VF610_CLK_FTM0] = imx_clk_gate2("ftm0", "ipg_bus", CCM_CCGR1, CCM_CCGRx_CGn(8));
-       clk[VF610_CLK_FTM1] = imx_clk_gate2("ftm1", "ipg_bus", CCM_CCGR1, CCM_CCGRx_CGn(9));
-       clk[VF610_CLK_FTM2] = imx_clk_gate2("ftm2", "ipg_bus", CCM_CCGR7, CCM_CCGRx_CGn(8));
-       clk[VF610_CLK_FTM3] = imx_clk_gate2("ftm3", "ipg_bus", CCM_CCGR7, CCM_CCGRx_CGn(9));
-
-       clk[VF610_CLK_DCU0_SEL] = imx_clk_mux("dcu0_sel", CCM_CSCMR1, 28, 1, dcu_sels, 2);
-       clk[VF610_CLK_DCU0_EN] = imx_clk_gate("dcu0_en", "dcu0_sel", CCM_CSCDR3, 19);
-       clk[VF610_CLK_DCU0_DIV] = imx_clk_divider("dcu0_div", "dcu0_en", CCM_CSCDR3, 16, 3);
-       clk[VF610_CLK_DCU0] = imx_clk_gate2("dcu0", "dcu0_div", CCM_CCGR3, CCM_CCGRx_CGn(8));
-       clk[VF610_CLK_DCU1_SEL] = imx_clk_mux("dcu1_sel", CCM_CSCMR1, 29, 1, dcu_sels, 2);
-       clk[VF610_CLK_DCU1_EN] = imx_clk_gate("dcu1_en", "dcu1_sel", CCM_CSCDR3, 23);
-       clk[VF610_CLK_DCU1_DIV] = imx_clk_divider("dcu1_div", "dcu1_en", CCM_CSCDR3, 20, 3);
-       clk[VF610_CLK_DCU1] = imx_clk_gate2("dcu1", "dcu1_div", CCM_CCGR9, CCM_CCGRx_CGn(8));
-
-       clk[VF610_CLK_ESAI_SEL] = imx_clk_mux("esai_sel", CCM_CSCMR1, 20, 2, esai_sels, 4);
-       clk[VF610_CLK_ESAI_EN] = imx_clk_gate("esai_en", "esai_sel", CCM_CSCDR2, 30);
-       clk[VF610_CLK_ESAI_DIV] = imx_clk_divider("esai_div", "esai_en", CCM_CSCDR2, 24, 4);
-       clk[VF610_CLK_ESAI] = imx_clk_gate2("esai", "esai_div", CCM_CCGR4, CCM_CCGRx_CGn(2));
-
-       clk[VF610_CLK_SAI0_SEL] = imx_clk_mux("sai0_sel", CCM_CSCMR1, 0, 2, sai_sels, 4);
-       clk[VF610_CLK_SAI0_EN] = imx_clk_gate("sai0_en", "sai0_sel", CCM_CSCDR1, 16);
-       clk[VF610_CLK_SAI0_DIV] = imx_clk_divider("sai0_div", "sai0_en", CCM_CSCDR1, 0, 4);
-       clk[VF610_CLK_SAI0] = imx_clk_gate2("sai0", "sai0_div", CCM_CCGR0, CCM_CCGRx_CGn(15));
-
-       clk[VF610_CLK_SAI1_SEL] = imx_clk_mux("sai1_sel", CCM_CSCMR1, 2, 2, sai_sels, 4);
-       clk[VF610_CLK_SAI1_EN] = imx_clk_gate("sai1_en", "sai1_sel", CCM_CSCDR1, 17);
-       clk[VF610_CLK_SAI1_DIV] = imx_clk_divider("sai1_div", "sai1_en", CCM_CSCDR1, 4, 4);
-       clk[VF610_CLK_SAI1] = imx_clk_gate2("sai1", "sai1_div", CCM_CCGR1, CCM_CCGRx_CGn(0));
-
-       clk[VF610_CLK_SAI2_SEL] = imx_clk_mux("sai2_sel", CCM_CSCMR1, 4, 2, sai_sels, 4);
-       clk[VF610_CLK_SAI2_EN] = imx_clk_gate("sai2_en", "sai2_sel", CCM_CSCDR1, 18);
-       clk[VF610_CLK_SAI2_DIV] = imx_clk_divider("sai2_div", "sai2_en", CCM_CSCDR1, 8, 4);
-       clk[VF610_CLK_SAI2] = imx_clk_gate2("sai2", "sai2_div", CCM_CCGR1, CCM_CCGRx_CGn(1));
-
-       clk[VF610_CLK_SAI3_SEL] = imx_clk_mux("sai3_sel", CCM_CSCMR1, 6, 2, sai_sels, 4);
-       clk[VF610_CLK_SAI3_EN] = imx_clk_gate("sai3_en", "sai3_sel", CCM_CSCDR1, 19);
-       clk[VF610_CLK_SAI3_DIV] = imx_clk_divider("sai3_div", "sai3_en", CCM_CSCDR1, 12, 4);
-       clk[VF610_CLK_SAI3] = imx_clk_gate2("sai3", "sai3_div", CCM_CCGR1, CCM_CCGRx_CGn(2));
-
-       clk[VF610_CLK_NFC_SEL] = imx_clk_mux("nfc_sel", CCM_CSCMR1, 12, 2, nfc_sels, 4);
-       clk[VF610_CLK_NFC_EN] = imx_clk_gate("nfc_en", "nfc_sel", CCM_CSCDR2, 9);
-       clk[VF610_CLK_NFC_PRE_DIV] = imx_clk_divider("nfc_pre_div", "nfc_en", CCM_CSCDR3, 13, 3);
-       clk[VF610_CLK_NFC_FRAC_DIV] = imx_clk_divider("nfc_frac_div", "nfc_pre_div", CCM_CSCDR2, 4, 4);
-       clk[VF610_CLK_NFC] = imx_clk_gate2("nfc", "nfc_frac_div", CCM_CCGR10, CCM_CCGRx_CGn(0));
-
-       clk[VF610_CLK_GPU_SEL] = imx_clk_mux("gpu_sel", CCM_CSCMR1, 14, 1, gpu_sels, 2);
-       clk[VF610_CLK_GPU_EN] = imx_clk_gate("gpu_en", "gpu_sel", CCM_CSCDR2, 10);
-       clk[VF610_CLK_GPU2D] = imx_clk_gate2("gpu", "gpu_en", CCM_CCGR8, CCM_CCGRx_CGn(15));
-
-       clk[VF610_CLK_VADC_SEL] = imx_clk_mux("vadc_sel", CCM_CSCMR1, 8, 2, vadc_sels, 3);
-       clk[VF610_CLK_VADC_EN] = imx_clk_gate("vadc_en", "vadc_sel", CCM_CSCDR1, 22);
-       clk[VF610_CLK_VADC_DIV] = imx_clk_divider("vadc_div", "vadc_en", CCM_CSCDR1, 20, 2);
-       clk[VF610_CLK_VADC_DIV_HALF] = imx_clk_fixed_factor("vadc_div_half", "vadc_div", 1, 2);
-       clk[VF610_CLK_VADC] = imx_clk_gate2("vadc", "vadc_div", CCM_CCGR8, CCM_CCGRx_CGn(7));
-
-       clk[VF610_CLK_ADC0] = imx_clk_gate2("adc0", "ipg_bus", CCM_CCGR1, CCM_CCGRx_CGn(11));
-       clk[VF610_CLK_ADC1] = imx_clk_gate2("adc1", "ipg_bus", CCM_CCGR7, CCM_CCGRx_CGn(11));
-       clk[VF610_CLK_DAC0] = imx_clk_gate2("dac0", "ipg_bus", CCM_CCGR8, CCM_CCGRx_CGn(12));
-       clk[VF610_CLK_DAC1] = imx_clk_gate2("dac1", "ipg_bus", CCM_CCGR8, CCM_CCGRx_CGn(13));
-
-       clk[VF610_CLK_ASRC] = imx_clk_gate2("asrc", "ipg_bus", CCM_CCGR4, CCM_CCGRx_CGn(1));
-
-       clk[VF610_CLK_FLEXCAN0_EN] = imx_clk_gate("flexcan0_en", "ipg_bus", CCM_CSCDR2, 11);
-       clk[VF610_CLK_FLEXCAN0] = imx_clk_gate2("flexcan0", "flexcan0_en", CCM_CCGR0, CCM_CCGRx_CGn(0));
-       clk[VF610_CLK_FLEXCAN1_EN] = imx_clk_gate("flexcan1_en", "ipg_bus", CCM_CSCDR2, 12);
-       clk[VF610_CLK_FLEXCAN1] = imx_clk_gate2("flexcan1", "flexcan1_en", CCM_CCGR9, CCM_CCGRx_CGn(4));
-
-       clk[VF610_CLK_DMAMUX0] = imx_clk_gate2("dmamux0", "platform_bus", CCM_CCGR0, CCM_CCGRx_CGn(4));
-       clk[VF610_CLK_DMAMUX1] = imx_clk_gate2("dmamux1", "platform_bus", CCM_CCGR0, CCM_CCGRx_CGn(5));
-       clk[VF610_CLK_DMAMUX2] = imx_clk_gate2("dmamux2", "platform_bus", CCM_CCGR6, CCM_CCGRx_CGn(1));
-       clk[VF610_CLK_DMAMUX3] = imx_clk_gate2("dmamux3", "platform_bus", CCM_CCGR6, CCM_CCGRx_CGn(2));
-
-       clk[VF610_CLK_SNVS] = imx_clk_gate2("snvs-rtc", "ipg_bus", CCM_CCGR6, CCM_CCGRx_CGn(7));
-
-       imx_check_clocks(clk, ARRAY_SIZE(clk));
-
-       clk_set_parent(clk[VF610_CLK_QSPI0_SEL], clk[VF610_CLK_PLL1_PFD4]);
-       clk_set_rate(clk[VF610_CLK_QSPI0_X4_DIV], clk_get_rate(clk[VF610_CLK_QSPI0_SEL]) / 2);
-       clk_set_rate(clk[VF610_CLK_QSPI0_X2_DIV], clk_get_rate(clk[VF610_CLK_QSPI0_X4_DIV]) / 2);
-       clk_set_rate(clk[VF610_CLK_QSPI0_X1_DIV], clk_get_rate(clk[VF610_CLK_QSPI0_X2_DIV]) / 2);
-
-       clk_set_parent(clk[VF610_CLK_QSPI1_SEL], clk[VF610_CLK_PLL1_PFD4]);
-       clk_set_rate(clk[VF610_CLK_QSPI1_X4_DIV], clk_get_rate(clk[VF610_CLK_QSPI1_SEL]) / 2);
-       clk_set_rate(clk[VF610_CLK_QSPI1_X2_DIV], clk_get_rate(clk[VF610_CLK_QSPI1_X4_DIV]) / 2);
-       clk_set_rate(clk[VF610_CLK_QSPI1_X1_DIV], clk_get_rate(clk[VF610_CLK_QSPI1_X2_DIV]) / 2);
-
-       clk_set_parent(clk[VF610_CLK_SAI0_SEL], clk[VF610_CLK_AUDIO_EXT]);
-       clk_set_parent(clk[VF610_CLK_SAI1_SEL], clk[VF610_CLK_AUDIO_EXT]);
-       clk_set_parent(clk[VF610_CLK_SAI2_SEL], clk[VF610_CLK_AUDIO_EXT]);
-       clk_set_parent(clk[VF610_CLK_SAI3_SEL], clk[VF610_CLK_AUDIO_EXT]);
-
-       for (i = 0; i < ARRAY_SIZE(clks_init_on); i++)
-               clk_prepare_enable(clk[clks_init_on[i]]);
-
-       /* Add the clocks to provider list */
-       clk_data.clks = clk;
-       clk_data.clk_num = ARRAY_SIZE(clk);
-       of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
-}
-CLK_OF_DECLARE(vf610, "fsl,vf610-ccm", vf610_clocks_init);
diff --git a/arch/arm/mach-imx/clk.c b/arch/arm/mach-imx/clk.c
deleted file mode 100644 (file)
index df12b53..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-#include <linux/clk.h>
-#include <linux/err.h>
-#include <linux/of.h>
-#include <linux/slab.h>
-#include <linux/spinlock.h>
-#include "clk.h"
-
-DEFINE_SPINLOCK(imx_ccm_lock);
-
-void __init imx_check_clocks(struct clk *clks[], unsigned int count)
-{
-       unsigned i;
-
-       for (i = 0; i < count; i++)
-               if (IS_ERR(clks[i]))
-                       pr_err("i.MX clk %u: register failed with %ld\n",
-                              i, PTR_ERR(clks[i]));
-}
-
-static struct clk * __init imx_obtain_fixed_clock_from_dt(const char *name)
-{
-       struct of_phandle_args phandle;
-       struct clk *clk = ERR_PTR(-ENODEV);
-       char *path;
-
-       path = kasprintf(GFP_KERNEL, "/clocks/%s", name);
-       if (!path)
-               return ERR_PTR(-ENOMEM);
-
-       phandle.np = of_find_node_by_path(path);
-       kfree(path);
-
-       if (phandle.np) {
-               clk = of_clk_get_from_provider(&phandle);
-               of_node_put(phandle.np);
-       }
-       return clk;
-}
-
-struct clk * __init imx_obtain_fixed_clock(
-                       const char *name, unsigned long rate)
-{
-       struct clk *clk;
-
-       clk = imx_obtain_fixed_clock_from_dt(name);
-       if (IS_ERR(clk))
-               clk = imx_clk_fixed(name, rate);
-       return clk;
-}
-
-/*
- * This fixups the register CCM_CSCMR1 write value.
- * The write/read/divider values of the aclk_podf field
- * of that register have the relationship described by
- * the following table:
- *
- * write value       read value        divider
- * 3b'000            3b'110            7
- * 3b'001            3b'111            8
- * 3b'010            3b'100            5
- * 3b'011            3b'101            6
- * 3b'100            3b'010            3
- * 3b'101            3b'011            4
- * 3b'110            3b'000            1
- * 3b'111            3b'001            2(default)
- *
- * That's why we do the xor operation below.
- */
-#define CSCMR1_FIXUP   0x00600000
-
-void imx_cscmr1_fixup(u32 *val)
-{
-       *val ^= CSCMR1_FIXUP;
-       return;
-}
diff --git a/arch/arm/mach-imx/clk.h b/arch/arm/mach-imx/clk.h
deleted file mode 100644 (file)
index 6a07903..0000000
+++ /dev/null
@@ -1,139 +0,0 @@
-#ifndef __MACH_IMX_CLK_H
-#define __MACH_IMX_CLK_H
-
-#include <linux/spinlock.h>
-#include <linux/clk-provider.h>
-
-extern spinlock_t imx_ccm_lock;
-
-void imx_check_clocks(struct clk *clks[], unsigned int count);
-
-extern void imx_cscmr1_fixup(u32 *val);
-
-struct clk *imx_clk_pllv1(const char *name, const char *parent,
-               void __iomem *base);
-
-struct clk *imx_clk_pllv2(const char *name, const char *parent,
-               void __iomem *base);
-
-enum imx_pllv3_type {
-       IMX_PLLV3_GENERIC,
-       IMX_PLLV3_SYS,
-       IMX_PLLV3_USB,
-       IMX_PLLV3_USB_VF610,
-       IMX_PLLV3_AV,
-       IMX_PLLV3_ENET,
-};
-
-struct clk *imx_clk_pllv3(enum imx_pllv3_type type, const char *name,
-               const char *parent_name, void __iomem *base, u32 div_mask);
-
-struct clk *clk_register_gate2(struct device *dev, const char *name,
-               const char *parent_name, unsigned long flags,
-               void __iomem *reg, u8 bit_idx,
-               u8 clk_gate_flags, spinlock_t *lock,
-               unsigned int *share_count);
-
-struct clk * imx_obtain_fixed_clock(
-                       const char *name, unsigned long rate);
-
-struct clk *imx_clk_gate_exclusive(const char *name, const char *parent,
-        void __iomem *reg, u8 shift, u32 exclusive_mask);
-
-static inline struct clk *imx_clk_gate2(const char *name, const char *parent,
-               void __iomem *reg, u8 shift)
-{
-       return clk_register_gate2(NULL, name, parent, CLK_SET_RATE_PARENT, reg,
-                       shift, 0, &imx_ccm_lock, NULL);
-}
-
-static inline struct clk *imx_clk_gate2_shared(const char *name,
-               const char *parent, void __iomem *reg, u8 shift,
-               unsigned int *share_count)
-{
-       return clk_register_gate2(NULL, name, parent, CLK_SET_RATE_PARENT, reg,
-                       shift, 0, &imx_ccm_lock, share_count);
-}
-
-struct clk *imx_clk_pfd(const char *name, const char *parent_name,
-               void __iomem *reg, u8 idx);
-
-struct clk *imx_clk_busy_divider(const char *name, const char *parent_name,
-                                void __iomem *reg, u8 shift, u8 width,
-                                void __iomem *busy_reg, u8 busy_shift);
-
-struct clk *imx_clk_busy_mux(const char *name, void __iomem *reg, u8 shift,
-                            u8 width, void __iomem *busy_reg, u8 busy_shift,
-                            const char **parent_names, int num_parents);
-
-struct clk *imx_clk_fixup_divider(const char *name, const char *parent,
-                                 void __iomem *reg, u8 shift, u8 width,
-                                 void (*fixup)(u32 *val));
-
-struct clk *imx_clk_fixup_mux(const char *name, void __iomem *reg,
-                             u8 shift, u8 width, const char **parents,
-                             int num_parents, void (*fixup)(u32 *val));
-
-static inline struct clk *imx_clk_fixed(const char *name, int rate)
-{
-       return clk_register_fixed_rate(NULL, name, NULL, CLK_IS_ROOT, rate);
-}
-
-static inline struct clk *imx_clk_divider(const char *name, const char *parent,
-               void __iomem *reg, u8 shift, u8 width)
-{
-       return clk_register_divider(NULL, name, parent, CLK_SET_RATE_PARENT,
-                       reg, shift, width, 0, &imx_ccm_lock);
-}
-
-static inline struct clk *imx_clk_divider_flags(const char *name,
-               const char *parent, void __iomem *reg, u8 shift, u8 width,
-               unsigned long flags)
-{
-       return clk_register_divider(NULL, name, parent, flags,
-                       reg, shift, width, 0, &imx_ccm_lock);
-}
-
-static inline struct clk *imx_clk_gate(const char *name, const char *parent,
-               void __iomem *reg, u8 shift)
-{
-       return clk_register_gate(NULL, name, parent, CLK_SET_RATE_PARENT, reg,
-                       shift, 0, &imx_ccm_lock);
-}
-
-static inline struct clk *imx_clk_gate_dis(const char *name, const char *parent,
-               void __iomem *reg, u8 shift)
-{
-       return clk_register_gate(NULL, name, parent, CLK_SET_RATE_PARENT, reg,
-                       shift, CLK_GATE_SET_TO_DISABLE, &imx_ccm_lock);
-}
-
-static inline struct clk *imx_clk_mux(const char *name, void __iomem *reg,
-               u8 shift, u8 width, const char **parents, int num_parents)
-{
-       return clk_register_mux(NULL, name, parents, num_parents,
-                       CLK_SET_RATE_NO_REPARENT, reg, shift,
-                       width, 0, &imx_ccm_lock);
-}
-
-static inline struct clk *imx_clk_mux_flags(const char *name,
-               void __iomem *reg, u8 shift, u8 width, const char **parents,
-               int num_parents, unsigned long flags)
-{
-       return clk_register_mux(NULL, name, parents, num_parents,
-                       flags | CLK_SET_RATE_NO_REPARENT, reg, shift, width, 0,
-                       &imx_ccm_lock);
-}
-
-static inline struct clk *imx_clk_fixed_factor(const char *name,
-               const char *parent, unsigned int mult, unsigned int div)
-{
-       return clk_register_fixed_factor(NULL, name, parent,
-                       CLK_SET_RATE_PARENT, mult, div);
-}
-
-struct clk *imx_clk_cpu(const char *name, const char *parent_name,
-               struct clk *div, struct clk *mux, struct clk *pll,
-               struct clk *step);
-
-#endif
index 0f04e30b726d22e43ad725427bf2731295a705e7..21e4e8697a58f7d020d155277caabf85c5a0934e 100644 (file)
@@ -44,7 +44,6 @@ void imx27_soc_init(void);
 void imx31_soc_init(void);
 void imx35_soc_init(void);
 void epit_timer_init(void __iomem *base, int irq);
-void mxc_timer_init(void __iomem *, int);
 int mx1_clocks_init(unsigned long fref);
 int mx21_clocks_init(unsigned long lref, unsigned long fref);
 int mx27_clocks_init(unsigned long fref);
@@ -56,13 +55,10 @@ struct platform_device *mxc_register_gpio(char *name, int id,
 void mxc_set_cpu_type(unsigned int type);
 void mxc_restart(enum reboot_mode, const char *);
 void mxc_arch_reset_init(void __iomem *);
-int mx51_revision(void);
-int mx53_revision(void);
 void imx_set_aips(void __iomem *);
 void imx_aips_allow_unprivileged_access(const char *compat);
 int mxc_device_init(void);
 void imx_set_soc_revision(unsigned int rev);
-unsigned int imx_get_soc_revision(void);
 void imx_init_revision_from_anatop(void);
 struct device *imx_soc_device_init(void);
 void imx6_enable_rbc(bool enable);
@@ -87,7 +83,6 @@ enum mx3_cpu_pwr_mode {
 };
 
 void mx3_cpu_lp_set(enum mx3_cpu_pwr_mode mode);
-void imx_print_silicon_rev(const char *cpu, int srev);
 
 void imx_enable_cpu(int cpu, bool enable);
 void imx_set_cpu_jump(int cpu, void *jump_addr);
@@ -111,7 +106,7 @@ void imx_gpc_hwirq_unmask(unsigned int hwirq);
 void imx_anatop_init(void);
 void imx_anatop_pre_suspend(void);
 void imx_anatop_post_resume(void);
-int imx6q_set_lpm(enum mxc_cpu_pwr_mode mode);
+int imx6_set_lpm(enum mxc_cpu_pwr_mode mode);
 void imx6q_set_int_mem_clk_lpm(bool enable);
 void imx6sl_set_wait_clk(bool enter);
 int imx_mmdc_get_ddr_type(void);
@@ -121,26 +116,28 @@ int imx_cpu_kill(unsigned int cpu);
 
 #ifdef CONFIG_SUSPEND
 void v7_cpu_resume(void);
+void imx53_suspend(void __iomem *ocram_vbase);
+extern const u32 imx53_suspend_sz;
 void imx6_suspend(void __iomem *ocram_vbase);
 #else
 static inline void v7_cpu_resume(void) {}
+static inline void imx53_suspend(void __iomem *ocram_vbase) {}
+static const u32 imx53_suspend_sz;
 static inline void imx6_suspend(void __iomem *ocram_vbase) {}
 #endif
 
+void imx6_pm_ccm_init(const char *ccm_compat);
 void imx6q_pm_init(void);
 void imx6dl_pm_init(void);
 void imx6sl_pm_init(void);
 void imx6sx_pm_init(void);
-void imx6q_pm_set_ccm_base(void __iomem *base);
 
 #ifdef CONFIG_PM
 void imx51_pm_init(void);
 void imx53_pm_init(void);
-void imx5_pm_set_ccm_base(void __iomem *base);
 #else
 static inline void imx51_pm_init(void) {}
 static inline void imx53_pm_init(void) {}
-static inline void imx5_pm_set_ccm_base(void __iomem *base) {}
 #endif
 
 #ifdef CONFIG_NEON
index df42c14ff7497fb0c1dbd89153c88b46a86748cd..a7fa92a7b1d7122e5edfda24247b3b1afb52bc18 100644 (file)
@@ -130,6 +130,9 @@ struct device * __init imx_soc_device_init(void)
        case MXC_CPU_IMX6Q:
                soc_id = "i.MX6Q";
                break;
+       case MXC_CPU_IMX7D:
+               soc_id = "i.MX7D";
+               break;
        default:
                soc_id = "Unknown";
        }
index 8e21ccc1eda25a0c45109e2b20c5d63f02bf99f8..353bb8774112d8068a072d0afe8f8f32a61683ae 100644 (file)
@@ -27,9 +27,9 @@ static int imx6q_enter_wait(struct cpuidle_device *dev,
                 */
                if (!spin_trylock(&master_lock))
                        goto idle;
-               imx6q_set_lpm(WAIT_UNCLOCKED);
+               imx6_set_lpm(WAIT_UNCLOCKED);
                cpu_do_idle();
-               imx6q_set_lpm(WAIT_CLOCKED);
+               imx6_set_lpm(WAIT_CLOCKED);
                spin_unlock(&master_lock);
                goto done;
        }
index 5742a9fd1ef29c5d367924115ccb5fe859051633..8d866fb674a85af738422ab0a6fc055a5ee0f191 100644 (file)
@@ -16,7 +16,7 @@
 static int imx6sl_enter_wait(struct cpuidle_device *dev,
                            struct cpuidle_driver *drv, int index)
 {
-       imx6q_set_lpm(WAIT_UNCLOCKED);
+       imx6_set_lpm(WAIT_UNCLOCKED);
        /*
         * Software workaround for ERR005311, see function
         * description for details.
@@ -24,7 +24,7 @@ static int imx6sl_enter_wait(struct cpuidle_device *dev,
        imx6sl_set_wait_clk(true);
        cpu_do_idle();
        imx6sl_set_wait_clk(false);
-       imx6q_set_lpm(WAIT_CLOCKED);
+       imx6_set_lpm(WAIT_CLOCKED);
 
        return index;
 }
index 2c9f1a8bf24590cf21b6d8aea80938d1f966e77e..3c6672b3796b24b2ffebb3ad7166688697ba980f 100644 (file)
@@ -25,7 +25,7 @@ static int imx6sx_idle_finish(unsigned long val)
 static int imx6sx_enter_wait(struct cpuidle_device *dev,
                            struct cpuidle_driver *drv, int index)
 {
-       imx6q_set_lpm(WAIT_UNCLOCKED);
+       imx6_set_lpm(WAIT_UNCLOCKED);
 
        switch (index) {
        case 1:
@@ -50,7 +50,7 @@ static int imx6sx_enter_wait(struct cpuidle_device *dev,
                break;
        }
 
-       imx6q_set_lpm(WAIT_CLOCKED);
+       imx6_set_lpm(WAIT_CLOCKED);
 
        return index;
 }
diff --git a/arch/arm/mach-imx/eukrea_mbimxsd35-baseboard.c b/arch/arm/mach-imx/eukrea_mbimxsd35-baseboard.c
deleted file mode 100644 (file)
index 6edc940..0000000
+++ /dev/null
@@ -1,318 +0,0 @@
-/*
- * Copyright (C) 2010 Eric Benard - eric@eukrea.com
- *
- * Based on pcm970-baseboard.c which is :
- * Copyright (C) 2008 Juergen Beisert (kernel@pengutronix.de)
- *
- * 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., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- */
-
-#include <linux/types.h>
-#include <linux/init.h>
-
-#include <linux/gpio.h>
-#include <linux/interrupt.h>
-#include <linux/leds.h>
-#include <linux/platform_device.h>
-#include <linux/input.h>
-#include <linux/spi/spi.h>
-#include <video/platform_lcd.h>
-#include <linux/i2c.h>
-
-#include <asm/mach-types.h>
-#include <asm/mach/arch.h>
-#include <asm/mach/time.h>
-#include <asm/mach/map.h>
-
-#include "common.h"
-#include "devices-imx35.h"
-#include "hardware.h"
-#include "iomux-mx35.h"
-
-static const struct fb_videomode fb_modedb[] = {
-       {
-               .name           = "CMO-QVGA",
-               .refresh        = 60,
-               .xres           = 320,
-               .yres           = 240,
-               .pixclock       = KHZ2PICOS(6500),
-               .left_margin    = 68,
-               .right_margin   = 20,
-               .upper_margin   = 15,
-               .lower_margin   = 4,
-               .hsync_len      = 30,
-               .vsync_len      = 3,
-               .sync           = 0,
-               .vmode          = FB_VMODE_NONINTERLACED,
-               .flag           = 0,
-       },
-       {
-               .name           = "DVI-VGA",
-               .refresh        = 60,
-               .xres           = 640,
-               .yres           = 480,
-               .pixclock       = 32000,
-               .left_margin    = 100,
-               .right_margin   = 100,
-               .upper_margin   = 7,
-               .lower_margin   = 100,
-               .hsync_len      = 7,
-               .vsync_len      = 7,
-               .sync           = FB_SYNC_VERT_HIGH_ACT | FB_SYNC_HOR_HIGH_ACT |
-                                 FB_SYNC_OE_ACT_HIGH | FB_SYNC_CLK_INVERT,
-               .vmode          = FB_VMODE_NONINTERLACED,
-               .flag           = 0,
-       },
-       {
-               .name           = "DVI-SVGA",
-               .refresh        = 60,
-               .xres           = 800,
-               .yres           = 600,
-               .pixclock       = 25000,
-               .left_margin    = 75,
-               .right_margin   = 75,
-               .upper_margin   = 7,
-               .lower_margin   = 75,
-               .hsync_len      = 7,
-               .vsync_len      = 7,
-               .sync           = FB_SYNC_VERT_HIGH_ACT | FB_SYNC_HOR_HIGH_ACT |
-                                 FB_SYNC_OE_ACT_HIGH | FB_SYNC_CLK_INVERT,
-               .vmode          = FB_VMODE_NONINTERLACED,
-               .flag           = 0,
-       },
-};
-
-static struct mx3fb_platform_data mx3fb_pdata __initdata = {
-       .name           = "CMO-QVGA",
-       .mode           = fb_modedb,
-       .num_modes      = ARRAY_SIZE(fb_modedb),
-};
-
-static const iomux_v3_cfg_t eukrea_mbimxsd_pads[] __initconst = {
-       /* LCD */
-       MX35_PAD_LD0__IPU_DISPB_DAT_0,
-       MX35_PAD_LD1__IPU_DISPB_DAT_1,
-       MX35_PAD_LD2__IPU_DISPB_DAT_2,
-       MX35_PAD_LD3__IPU_DISPB_DAT_3,
-       MX35_PAD_LD4__IPU_DISPB_DAT_4,
-       MX35_PAD_LD5__IPU_DISPB_DAT_5,
-       MX35_PAD_LD6__IPU_DISPB_DAT_6,
-       MX35_PAD_LD7__IPU_DISPB_DAT_7,
-       MX35_PAD_LD8__IPU_DISPB_DAT_8,
-       MX35_PAD_LD9__IPU_DISPB_DAT_9,
-       MX35_PAD_LD10__IPU_DISPB_DAT_10,
-       MX35_PAD_LD11__IPU_DISPB_DAT_11,
-       MX35_PAD_LD12__IPU_DISPB_DAT_12,
-       MX35_PAD_LD13__IPU_DISPB_DAT_13,
-       MX35_PAD_LD14__IPU_DISPB_DAT_14,
-       MX35_PAD_LD15__IPU_DISPB_DAT_15,
-       MX35_PAD_LD16__IPU_DISPB_DAT_16,
-       MX35_PAD_LD17__IPU_DISPB_DAT_17,
-       MX35_PAD_D3_HSYNC__IPU_DISPB_D3_HSYNC,
-       MX35_PAD_D3_FPSHIFT__IPU_DISPB_D3_CLK,
-       MX35_PAD_D3_DRDY__IPU_DISPB_D3_DRDY,
-       MX35_PAD_D3_VSYNC__IPU_DISPB_D3_VSYNC,
-       /* Backlight */
-       MX35_PAD_CONTRAST__IPU_DISPB_CONTR,
-       /* LCD_PWR */
-       MX35_PAD_D3_CLS__GPIO1_4,
-       /* LED */
-       MX35_PAD_LD23__GPIO3_29,
-       /* SWITCH */
-       MX35_PAD_LD19__GPIO3_25,
-       /* UART2 */
-       MX35_PAD_CTS2__UART2_CTS,
-       MX35_PAD_RTS2__UART2_RTS,
-       MX35_PAD_TXD2__UART2_TXD_MUX,
-       MX35_PAD_RXD2__UART2_RXD_MUX,
-       /* I2S */
-       MX35_PAD_STXFS4__AUDMUX_AUD4_TXFS,
-       MX35_PAD_STXD4__AUDMUX_AUD4_TXD,
-       MX35_PAD_SRXD4__AUDMUX_AUD4_RXD,
-       MX35_PAD_SCK4__AUDMUX_AUD4_TXC,
-       /* CAN2 */
-       MX35_PAD_TX5_RX0__CAN2_TXCAN,
-       MX35_PAD_TX4_RX1__CAN2_RXCAN,
-       /* SDCARD */
-       MX35_PAD_SD1_CMD__ESDHC1_CMD,
-       MX35_PAD_SD1_CLK__ESDHC1_CLK,
-       MX35_PAD_SD1_DATA0__ESDHC1_DAT0,
-       MX35_PAD_SD1_DATA1__ESDHC1_DAT1,
-       MX35_PAD_SD1_DATA2__ESDHC1_DAT2,
-       MX35_PAD_SD1_DATA3__ESDHC1_DAT3,
-       /* SD1 CD */
-       MX35_PAD_LD18__GPIO3_24,
-       /* SPI */
-       MX35_PAD_CSPI1_MOSI__CSPI1_MOSI,
-       MX35_PAD_CSPI1_MISO__CSPI1_MISO,
-       MX35_PAD_CSPI1_SS0__GPIO1_18,
-       MX35_PAD_CSPI1_SS1__GPIO1_19,
-       MX35_PAD_CSPI1_SCLK__CSPI1_SCLK,
-       MX35_PAD_CSPI1_SPI_RDY__GPIO3_5,
-};
-
-#define GPIO_LED1      IMX_GPIO_NR(3, 29)
-#define GPIO_SWITCH1   IMX_GPIO_NR(3, 25)
-#define GPIO_LCDPWR    IMX_GPIO_NR(1, 4)
-#define GPIO_SD1CD     IMX_GPIO_NR(3, 24)
-#define        GPIO_SPI1_SS0   IMX_GPIO_NR(1, 18)
-#define        GPIO_SPI1_SS1   IMX_GPIO_NR(1, 19)
-#define        GPIO_SPI1_IRQ   IMX_GPIO_NR(3, 5)
-
-static void eukrea_mbimxsd_lcd_power_set(struct plat_lcd_data *pd,
-                                  unsigned int power)
-{
-       if (power)
-               gpio_direction_output(GPIO_LCDPWR, 1);
-       else
-               gpio_direction_output(GPIO_LCDPWR, 0);
-}
-
-static struct plat_lcd_data eukrea_mbimxsd_lcd_power_data = {
-       .set_power              = eukrea_mbimxsd_lcd_power_set,
-};
-
-static struct platform_device eukrea_mbimxsd_lcd_powerdev = {
-       .name                   = "platform-lcd",
-       .dev.platform_data      = &eukrea_mbimxsd_lcd_power_data,
-};
-
-static struct gpio_led eukrea_mbimxsd_leds[] = {
-       {
-               .name                   = "led1",
-               .default_trigger        = "heartbeat",
-               .active_low             = 1,
-               .gpio                   = GPIO_LED1,
-       },
-};
-
-static const struct gpio_led_platform_data
-               eukrea_mbimxsd_led_info __initconst = {
-       .leds           = eukrea_mbimxsd_leds,
-       .num_leds       = ARRAY_SIZE(eukrea_mbimxsd_leds),
-};
-
-static struct gpio_keys_button eukrea_mbimxsd_gpio_buttons[] = {
-       {
-               .gpio           = GPIO_SWITCH1,
-               .code           = BTN_0,
-               .desc           = "BP1",
-               .active_low     = 1,
-               .wakeup         = 1,
-       },
-};
-
-static const struct gpio_keys_platform_data
-               eukrea_mbimxsd_button_data __initconst = {
-       .buttons        = eukrea_mbimxsd_gpio_buttons,
-       .nbuttons       = ARRAY_SIZE(eukrea_mbimxsd_gpio_buttons),
-};
-
-static struct platform_device *platform_devices[] __initdata = {
-       &eukrea_mbimxsd_lcd_powerdev,
-};
-
-static const struct imxuart_platform_data uart_pdata __initconst = {
-       .flags = IMXUART_HAVE_RTSCTS,
-};
-
-static struct i2c_board_info eukrea_mbimxsd_i2c_devices[] = {
-       {
-               I2C_BOARD_INFO("tlv320aic23", 0x1a),
-       },
-};
-
-static const
-struct imx_ssi_platform_data eukrea_mbimxsd_ssi_pdata __initconst = {
-       .flags = IMX_SSI_SYN | IMX_SSI_NET | IMX_SSI_USE_I2S_SLAVE,
-};
-
-static struct esdhc_platform_data sd1_pdata = {
-       .cd_gpio = GPIO_SD1CD,
-       .cd_type = ESDHC_CD_GPIO,
-       .wp_type = ESDHC_WP_NONE,
-};
-
-static struct spi_board_info eukrea_mbimxsd35_spi_board_info[] __initdata = {
-       {
-               .modalias = "spidev",
-               .max_speed_hz = 20000000,
-               .bus_num = 0,
-               .chip_select = 0,
-               .mode = SPI_MODE_0,
-       },
-       {
-               .modalias = "spidev",
-               .max_speed_hz = 20000000,
-               .bus_num = 0,
-               .chip_select = 1,
-               .mode = SPI_MODE_0,
-       },
-};
-
-static int eukrea_mbimxsd35_spi_cs[] = {GPIO_SPI1_SS0, GPIO_SPI1_SS1};
-
-static const struct spi_imx_master eukrea_mbimxsd35_spi0_data __initconst = {
-       .chipselect     = eukrea_mbimxsd35_spi_cs,
-       .num_chipselect = ARRAY_SIZE(eukrea_mbimxsd35_spi_cs),
-};
-
-/*
- * system init for baseboard usage. Will be called by cpuimx35 init.
- *
- * Add platform devices present on this baseboard and init
- * them from CPU side as far as required to use them later on
- */
-void __init eukrea_mbimxsd35_baseboard_init(void)
-{
-       if (mxc_iomux_v3_setup_multiple_pads(eukrea_mbimxsd_pads,
-                       ARRAY_SIZE(eukrea_mbimxsd_pads)))
-               printk(KERN_ERR "error setting mbimxsd pads !\n");
-
-       imx35_add_imx_uart1(&uart_pdata);
-       imx35_add_ipu_core();
-       imx35_add_mx3_sdc_fb(&mx3fb_pdata);
-
-       imx35_add_imx_ssi(0, &eukrea_mbimxsd_ssi_pdata);
-
-       imx35_add_flexcan1();
-       imx35_add_sdhci_esdhc_imx(0, &sd1_pdata);
-
-       gpio_request(GPIO_LED1, "LED1");
-       gpio_direction_output(GPIO_LED1, 1);
-       gpio_free(GPIO_LED1);
-
-       gpio_request(GPIO_SWITCH1, "SWITCH1");
-       gpio_direction_input(GPIO_SWITCH1);
-       gpio_free(GPIO_SWITCH1);
-
-       gpio_request(GPIO_LCDPWR, "LCDPWR");
-       gpio_direction_output(GPIO_LCDPWR, 1);
-
-       i2c_register_board_info(0, eukrea_mbimxsd_i2c_devices,
-                               ARRAY_SIZE(eukrea_mbimxsd_i2c_devices));
-
-       gpio_request(GPIO_SPI1_IRQ, "SPI1_IRQ");
-       gpio_direction_input(GPIO_SPI1_IRQ);
-       gpio_free(GPIO_SPI1_IRQ);
-       imx35_add_spi_imx0(&eukrea_mbimxsd35_spi0_data);
-       spi_register_board_info(eukrea_mbimxsd35_spi_board_info,
-               ARRAY_SIZE(eukrea_mbimxsd35_spi_board_info));
-
-       platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
-       gpio_led_register_device(-1, &eukrea_mbimxsd_led_info);
-       imx_add_gpio_keys(&eukrea_mbimxsd_button_data);
-       imx_add_platform_device("eukrea_tlv320", 0, NULL, 0, NULL, 0);
-}
index 6d0893a3828eb6b57322ddd0e0df26ac7e32bd85..80bad29d609ac2bf2be07f4de20d3650d8ea28d9 100644 (file)
@@ -227,7 +227,7 @@ static int imx_gpc_domain_alloc(struct irq_domain *domain,
        return irq_domain_alloc_irqs_parent(domain, irq, nr_irqs, &parent_args);
 }
 
-static struct irq_domain_ops imx_gpc_domain_ops = {
+static const struct irq_domain_ops imx_gpc_domain_ops = {
        .xlate  = imx_gpc_domain_xlate,
        .alloc  = imx_gpc_domain_alloc,
        .free   = irq_domain_free_irqs_common,
@@ -474,7 +474,6 @@ static const struct of_device_id imx_gpc_dt_ids[] = {
 static struct platform_driver imx_gpc_driver = {
        .driver = {
                .name = "imx-gpc",
-               .owner = THIS_MODULE,
                .of_match_table = imx_gpc_dt_ids,
        },
        .probe = imx_gpc_probe,
index 76af2c03c241eff9509e6cdf6b1129763537824b..d737f95ebb0773a78c4cb77da0b3490c7f4e1d7e 100644 (file)
@@ -22,6 +22,7 @@
 
 #ifndef __ASSEMBLY__
 #include <asm/io.h>
+#include <soc/imx/revision.h>
 #endif
 #include <asm/sizes.h>
 
index de5047c8a6c87ab2fc957ed09e51897780e287fc..b5e976816b63cf3cd81926dd8378036d21b2888e 100644 (file)
@@ -25,7 +25,6 @@ diag_reg_offset:
        .endm
 
 ENTRY(v7_secondary_startup)
-       bl      v7_invalidate_l1
        set_diag_reg
        b       secondary_startup
 ENDPROC(v7_secondary_startup)
index d6a30753ca7cb27c9d5c5704e417102d065a2d60..6dd22cabf4d345e8d6bcfb6f77dc333cd53ea45e 100644 (file)
@@ -40,7 +40,7 @@ static DEFINE_SPINLOCK(gpio_mux_lock);
 
 #define IOMUX_REG_MASK (IOMUX_PADNUM_MASK & ~0x3)
 
-static unsigned long mxc_pin_alloc_map[NB_PORTS * 32 / BITS_PER_LONG];
+static DECLARE_BITMAP(mxc_pin_alloc_map, NB_PORTS * 32);
 /*
  * set the mode for a IOMUX pin.
  */
diff --git a/arch/arm/mach-imx/mach-cpuimx35.c b/arch/arm/mach-imx/mach-cpuimx35.c
deleted file mode 100644 (file)
index 922ffd6..0000000
+++ /dev/null
@@ -1,206 +0,0 @@
-/*
- * Copyright (C) 2010 Eric Benard - eric@eukrea.com
- * Copyright (C) 2009 Sascha Hauer, Pengutronix
- *
- * 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/types.h>
-#include <linux/init.h>
-
-#include <linux/platform_device.h>
-#include <linux/mtd/physmap.h>
-#include <linux/memory.h>
-#include <linux/gpio.h>
-#include <linux/interrupt.h>
-#include <linux/delay.h>
-#include <linux/i2c.h>
-#include <linux/i2c/tsc2007.h>
-#include <linux/usb/otg.h>
-#include <linux/usb/ulpi.h>
-#include <linux/i2c-gpio.h>
-
-#include <asm/mach-types.h>
-#include <asm/mach/arch.h>
-#include <asm/mach/time.h>
-#include <asm/mach/map.h>
-
-#include "common.h"
-#include "devices-imx35.h"
-#include "ehci.h"
-#include "eukrea-baseboards.h"
-#include "hardware.h"
-#include "iomux-mx35.h"
-
-static const struct imxuart_platform_data uart_pdata __initconst = {
-       .flags = IMXUART_HAVE_RTSCTS,
-};
-
-static const struct imxi2c_platform_data
-               eukrea_cpuimx35_i2c0_data __initconst = {
-       .bitrate =              100000,
-};
-
-#define TSC2007_IRQGPIO                IMX_GPIO_NR(3, 2)
-static int tsc2007_get_pendown_state(struct device *dev)
-{
-       return !gpio_get_value(TSC2007_IRQGPIO);
-}
-
-static struct tsc2007_platform_data tsc2007_info = {
-       .model                  = 2007,
-       .x_plate_ohms           = 180,
-       .get_pendown_state = tsc2007_get_pendown_state,
-};
-
-static struct i2c_board_info eukrea_cpuimx35_i2c_devices[] = {
-       {
-               I2C_BOARD_INFO("pcf8563", 0x51),
-       }, {
-               I2C_BOARD_INFO("tsc2007", 0x48),
-               .platform_data  = &tsc2007_info,
-               /* irq number is run-time assigned */
-       },
-};
-
-static const iomux_v3_cfg_t eukrea_cpuimx35_pads[] __initconst = {
-       /* UART1 */
-       MX35_PAD_CTS1__UART1_CTS,
-       MX35_PAD_RTS1__UART1_RTS,
-       MX35_PAD_TXD1__UART1_TXD_MUX,
-       MX35_PAD_RXD1__UART1_RXD_MUX,
-       /* FEC */
-       MX35_PAD_FEC_TX_CLK__FEC_TX_CLK,
-       MX35_PAD_FEC_RX_CLK__FEC_RX_CLK,
-       MX35_PAD_FEC_RX_DV__FEC_RX_DV,
-       MX35_PAD_FEC_COL__FEC_COL,
-       MX35_PAD_FEC_RDATA0__FEC_RDATA_0,
-       MX35_PAD_FEC_TDATA0__FEC_TDATA_0,
-       MX35_PAD_FEC_TX_EN__FEC_TX_EN,
-       MX35_PAD_FEC_MDC__FEC_MDC,
-       MX35_PAD_FEC_MDIO__FEC_MDIO,
-       MX35_PAD_FEC_TX_ERR__FEC_TX_ERR,
-       MX35_PAD_FEC_RX_ERR__FEC_RX_ERR,
-       MX35_PAD_FEC_CRS__FEC_CRS,
-       MX35_PAD_FEC_RDATA1__FEC_RDATA_1,
-       MX35_PAD_FEC_TDATA1__FEC_TDATA_1,
-       MX35_PAD_FEC_RDATA2__FEC_RDATA_2,
-       MX35_PAD_FEC_TDATA2__FEC_TDATA_2,
-       MX35_PAD_FEC_RDATA3__FEC_RDATA_3,
-       MX35_PAD_FEC_TDATA3__FEC_TDATA_3,
-       /* I2C1 */
-       MX35_PAD_I2C1_CLK__I2C1_SCL,
-       MX35_PAD_I2C1_DAT__I2C1_SDA,
-       /* TSC2007 IRQ */
-       MX35_PAD_ATA_DA2__GPIO3_2,
-};
-
-static const struct mxc_nand_platform_data
-               eukrea_cpuimx35_nand_board_info __initconst = {
-       .width          = 1,
-       .hw_ecc         = 1,
-       .flash_bbt      = 1,
-};
-
-static int eukrea_cpuimx35_otg_init(struct platform_device *pdev)
-{
-       return mx35_initialize_usb_hw(pdev->id, MXC_EHCI_INTERFACE_DIFF_UNI);
-}
-
-static const struct mxc_usbh_platform_data otg_pdata __initconst = {
-       .init   = eukrea_cpuimx35_otg_init,
-       .portsc = MXC_EHCI_MODE_UTMI,
-};
-
-static int eukrea_cpuimx35_usbh1_init(struct platform_device *pdev)
-{
-       return mx35_initialize_usb_hw(pdev->id, MXC_EHCI_INTERFACE_SINGLE_UNI |
-                       MXC_EHCI_INTERNAL_PHY | MXC_EHCI_IPPUE_DOWN);
-}
-
-static const struct mxc_usbh_platform_data usbh1_pdata __initconst = {
-       .init   = eukrea_cpuimx35_usbh1_init,
-       .portsc = MXC_EHCI_MODE_SERIAL,
-};
-
-static const struct fsl_usb2_platform_data otg_device_pdata __initconst = {
-       .operating_mode = FSL_USB2_DR_DEVICE,
-       .phy_mode       = FSL_USB2_PHY_UTMI,
-       .workaround     = FLS_USB2_WORKAROUND_ENGCM09152,
-};
-
-static bool otg_mode_host __initdata;
-
-static int __init eukrea_cpuimx35_otg_mode(char *options)
-{
-       if (!strcmp(options, "host"))
-               otg_mode_host = true;
-       else if (!strcmp(options, "device"))
-               otg_mode_host = false;
-       else
-               pr_info("otg_mode neither \"host\" nor \"device\". "
-                       "Defaulting to device\n");
-       return 1;
-}
-__setup("otg_mode=", eukrea_cpuimx35_otg_mode);
-
-/*
- * Board specific initialization.
- */
-static void __init eukrea_cpuimx35_init(void)
-{
-       imx35_soc_init();
-
-       mxc_iomux_v3_setup_multiple_pads(eukrea_cpuimx35_pads,
-                       ARRAY_SIZE(eukrea_cpuimx35_pads));
-
-       imx35_add_fec(NULL);
-       imx35_add_imx2_wdt();
-
-       imx35_add_imx_uart0(&uart_pdata);
-       imx35_add_mxc_nand(&eukrea_cpuimx35_nand_board_info);
-
-       eukrea_cpuimx35_i2c_devices[1].irq = gpio_to_irq(TSC2007_IRQGPIO);
-       i2c_register_board_info(0, eukrea_cpuimx35_i2c_devices,
-                       ARRAY_SIZE(eukrea_cpuimx35_i2c_devices));
-       imx35_add_imx_i2c0(&eukrea_cpuimx35_i2c0_data);
-
-       if (otg_mode_host)
-               imx35_add_mxc_ehci_otg(&otg_pdata);
-       else
-               imx35_add_fsl_usb2_udc(&otg_device_pdata);
-
-       imx35_add_mxc_ehci_hs(&usbh1_pdata);
-
-#ifdef CONFIG_MACH_EUKREA_MBIMXSD35_BASEBOARD
-       eukrea_mbimxsd35_baseboard_init();
-#endif
-}
-
-static void __init eukrea_cpuimx35_timer_init(void)
-{
-       mx35_clocks_init();
-}
-
-MACHINE_START(EUKREA_CPUIMX35SD, "Eukrea CPUIMX35")
-       /* Maintainer: Eukrea Electromatique */
-       .atag_offset = 0x100,
-       .map_io = mx35_map_io,
-       .init_early = imx35_init_early,
-       .init_irq = mx35_init_irq,
-       .init_time      = eukrea_cpuimx35_timer_init,
-       .init_machine = eukrea_cpuimx35_init,
-       .restart        = mxc_restart,
-MACHINE_END
index 3ab61549ce0fb8939c8f0a04b5a4c528fe64fbd1..9602cc12d2f1014efbac3887dc49278191745c67 100644 (file)
@@ -393,6 +393,7 @@ static void __init imx6q_init_irq(void)
        imx_init_l2cache();
        imx_src_init();
        irqchip_init();
+       imx6_pm_ccm_init("fsl,imx6q-ccm");
 }
 
 static const char * const imx6q_dt_compat[] __initconst = {
index 12a1b098fc6a98bd80de68161b94ae6377f04e37..300326373166bc85c84470b6939ba0180fef1358 100644 (file)
@@ -66,6 +66,7 @@ static void __init imx6sl_init_irq(void)
        imx_init_l2cache();
        imx_src_init();
        irqchip_init();
+       imx6_pm_ccm_init("fsl,imx6sl-ccm");
 }
 
 static const char * const imx6sl_dt_compat[] __initconst = {
index f17b7004c24ba809caf27186c56cded060682586..6a0b0614de293b197742c613587d3fd0593ccae1 100644 (file)
@@ -86,6 +86,7 @@ static void __init imx6sx_init_irq(void)
        imx_init_l2cache();
        imx_src_init();
        irqchip_init();
+       imx6_pm_ccm_init("fsl,imx6sx-ccm");
 }
 
 static void __init imx6sx_init_late(void)
diff --git a/arch/arm/mach-imx/mach-imx7d.c b/arch/arm/mach-imx/mach-imx7d.c
new file mode 100644 (file)
index 0000000..4d4a190
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ * 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.
+ */
+#include <linux/irqchip.h>
+#include <linux/of_platform.h>
+#include <asm/mach/arch.h>
+#include <asm/mach/map.h>
+
+#include "common.h"
+
+static void __init imx7d_init_machine(void)
+{
+       struct device *parent;
+
+       parent = imx_soc_device_init();
+       if (parent == NULL)
+               pr_warn("failed to initialize soc device\n");
+
+       of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
+       imx_anatop_init();
+}
+
+static void __init imx7d_init_irq(void)
+{
+       imx_init_revision_from_anatop();
+       imx_src_init();
+       irqchip_init();
+}
+
+static const char *imx7d_dt_compat[] __initconst = {
+       "fsl,imx7d",
+       NULL,
+};
+
+DT_MACHINE_START(IMX7D, "Freescale i.MX7 Dual (Device Tree)")
+       .init_irq       = imx7d_init_irq,
+       .init_machine   = imx7d_init_machine,
+       .dt_compat      = imx7d_dt_compat,
+MACHINE_END
index 2e7c75b66fe03420ef5fad642fdaf968cc95c441..b20f6c14eda527cd71be2a4445901ca96e6fcd4a 100644 (file)
@@ -17,6 +17,7 @@ static const char * const vf610_dt_compat[] __initconst = {
        "fsl,vf510",
        "fsl,vf600",
        "fsl,vf610",
+       "fsl,vf610m4",
        NULL,
 };
 
index 0411f0664c15c0bce0469b9cd073205834ba366a..db9621c718ecae1ff2567f596f4d71ecd6428c4a 100644 (file)
@@ -17,6 +17,8 @@
 #include <linux/of_address.h>
 #include <linux/of_device.h>
 
+#include "common.h"
+
 #define MMDC_MAPSR             0x404
 #define BP_MMDC_MAPSR_PSD      0
 #define BP_MMDC_MAPSR_PSS      4
index 8a65f192e7f31fb82b998b9e094ae9e1f69441a7..f96bb2642677a1870863c97c3f1b8afd619aa261 100644 (file)
 #define MX27_DMA_REQ_SDHC3     36
 #define MX27_DMA_REQ_NFC       37
 
-#ifndef __ASSEMBLY__
-extern int mx27_revision(void);
-#endif
-
 #endif /* ifndef __MACH_MX27_H__ */
index 96fb4fbc8ad7c34dd4ea9d9324a655470db58318..6fec6114c2f12001cf9db1969ae27e638616b9e7 100644 (file)
 
 #define MX3x_PROD_SIGNATURE            0x1     /* For MX31 */
 
-/* Mandatory defines used globally */
-
-#if !defined(__ASSEMBLY__) && !defined(__MXC_BOOT_UNCOMPRESS)
-extern int mx35_revision(void);
-extern int mx31_revision(void);
-#endif
-
 #endif /* ifndef __MACH_MX3x_H__ */
index 4c1343df2ba495b511ecdbf064c8da11f91310ab..c4436d4fd6fdb6be76ca1613027ee424b752113a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2004-2007, 2010 Freescale Semiconductor, Inc. All Rights Reserved.
+ * Copyright 2004-2007, 2010-2015 Freescale Semiconductor, Inc.
  * Copyright (C) 2008 Juergen Beisert (kernel@pengutronix.de)
  *
  * This program is free software; you can redistribute it and/or
 #define MXC_CPU_IMX6DL         0x61
 #define MXC_CPU_IMX6SX         0x62
 #define MXC_CPU_IMX6Q          0x63
-
-#define IMX_CHIP_REVISION_1_0          0x10
-#define IMX_CHIP_REVISION_1_1          0x11
-#define IMX_CHIP_REVISION_1_2          0x12
-#define IMX_CHIP_REVISION_1_3          0x13
-#define IMX_CHIP_REVISION_1_4          0x14
-#define IMX_CHIP_REVISION_1_5          0x15
-#define IMX_CHIP_REVISION_2_0          0x20
-#define IMX_CHIP_REVISION_2_1          0x21
-#define IMX_CHIP_REVISION_2_2          0x22
-#define IMX_CHIP_REVISION_2_3          0x23
-#define IMX_CHIP_REVISION_3_0          0x30
-#define IMX_CHIP_REVISION_3_1          0x31
-#define IMX_CHIP_REVISION_3_2          0x32
-#define IMX_CHIP_REVISION_3_3          0x33
-#define IMX_CHIP_REVISION_UNKNOWN      0xff
+#define MXC_CPU_IMX7D          0x72
 
 #define IMX_DDR_TYPE_LPDDR2            1
 
@@ -185,6 +170,11 @@ static inline bool cpu_is_imx6q(void)
        return __mxc_cpu_type == MXC_CPU_IMX6Q;
 }
 
+static inline bool cpu_is_imx7d(void)
+{
+       return __mxc_cpu_type == MXC_CPU_IMX7D;
+}
+
 struct cpu_op {
        u32 cpu_rate;
 };
index f1f80ab73e692ea70e95044eb016e92c9eddc28f..0309ccda36a91704e3aa4a395cebce66aa9eaa21 100644 (file)
 #include <linux/io.h>
 #include <linux/err.h>
 #include <linux/export.h>
+
+#include <linux/genalloc.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/of_platform.h>
+
 #include <asm/cacheflush.h>
+#include <asm/fncpy.h>
 #include <asm/system_misc.h>
 #include <asm/tlbflush.h>
 
  */
 #define IMX5_DEFAULT_CPU_IDLE_STATE WAIT_UNCLOCKED_POWER_OFF
 
+struct imx5_suspend_io_state {
+       u32     offset;
+       u32     clear;
+       u32     set;
+       u32     saved_value;
+};
+
 struct imx5_pm_data {
+       phys_addr_t ccm_addr;
        phys_addr_t cortex_addr;
        phys_addr_t gpc_addr;
+       phys_addr_t m4if_addr;
+       phys_addr_t iomuxc_addr;
+       void (*suspend_asm)(void __iomem *ocram_vbase);
+       const u32 *suspend_asm_sz;
+       const struct imx5_suspend_io_state *suspend_io_config;
+       int suspend_io_count;
+};
+
+static const struct imx5_suspend_io_state imx53_suspend_io_config[] = {
+#define MX53_DSE_HIGHZ_MASK (0x7 << 19)
+       {.offset = 0x584, .clear = MX53_DSE_HIGHZ_MASK}, /* DQM0 */
+       {.offset = 0x594, .clear = MX53_DSE_HIGHZ_MASK}, /* DQM1 */
+       {.offset = 0x560, .clear = MX53_DSE_HIGHZ_MASK}, /* DQM2 */
+       {.offset = 0x554, .clear = MX53_DSE_HIGHZ_MASK}, /* DQM3 */
+       {.offset = 0x574, .clear = MX53_DSE_HIGHZ_MASK}, /* CAS */
+       {.offset = 0x588, .clear = MX53_DSE_HIGHZ_MASK}, /* RAS */
+       {.offset = 0x578, .clear = MX53_DSE_HIGHZ_MASK}, /* SDCLK_0 */
+       {.offset = 0x570, .clear = MX53_DSE_HIGHZ_MASK}, /* SDCLK_1 */
+
+       {.offset = 0x580, .clear = MX53_DSE_HIGHZ_MASK}, /* SDODT0 */
+       {.offset = 0x564, .clear = MX53_DSE_HIGHZ_MASK}, /* SDODT1 */
+       {.offset = 0x57c, .clear = MX53_DSE_HIGHZ_MASK}, /* SDQS0 */
+       {.offset = 0x590, .clear = MX53_DSE_HIGHZ_MASK}, /* SDQS1 */
+       {.offset = 0x568, .clear = MX53_DSE_HIGHZ_MASK}, /* SDQS2 */
+       {.offset = 0x558, .clear = MX53_DSE_HIGHZ_MASK}, /* SDSQ3 */
+       {.offset = 0x6f0, .clear = MX53_DSE_HIGHZ_MASK}, /* GRP_ADDS */
+       {.offset = 0x718, .clear = MX53_DSE_HIGHZ_MASK}, /* GRP_BODS */
+       {.offset = 0x71c, .clear = MX53_DSE_HIGHZ_MASK}, /* GRP_B1DS */
+       {.offset = 0x728, .clear = MX53_DSE_HIGHZ_MASK}, /* GRP_B2DS */
+       {.offset = 0x72c, .clear = MX53_DSE_HIGHZ_MASK}, /* GRP_B3DS */
+
+       /* Controls the CKE signal which is required to leave self refresh */
+       {.offset = 0x720, .clear = MX53_DSE_HIGHZ_MASK, .set = 1 << 19}, /* CTLDS */
 };
 
 static const struct imx5_pm_data imx51_pm_data __initconst = {
+       .ccm_addr = 0x73fd4000,
        .cortex_addr = 0x83fa0000,
        .gpc_addr = 0x73fd8000,
 };
 
 static const struct imx5_pm_data imx53_pm_data __initconst = {
+       .ccm_addr = 0x53fd4000,
        .cortex_addr = 0x63fa0000,
        .gpc_addr = 0x53fd8000,
+       .m4if_addr = 0x63fd8000,
+       .iomuxc_addr = 0x53fa8000,
+       .suspend_asm = &imx53_suspend,
+       .suspend_asm_sz = &imx53_suspend_sz,
+       .suspend_io_config = imx53_suspend_io_config,
+       .suspend_io_count = ARRAY_SIZE(imx53_suspend_io_config),
 };
 
+#define MX5_MAX_SUSPEND_IOSTATE ARRAY_SIZE(imx53_suspend_io_config)
+
+/*
+ * This structure is for passing necessary data for low level ocram
+ * suspend code(arch/arm/mach-imx/suspend-imx53.S), if this struct
+ * definition is changed, the offset definition in that file
+ * must be also changed accordingly otherwise, the suspend to ocram
+ * function will be broken!
+ */
+struct imx5_cpu_suspend_info {
+       void __iomem    *m4if_base;
+       void __iomem    *iomuxc_base;
+       u32             io_count;
+       struct imx5_suspend_io_state io_state[MX5_MAX_SUSPEND_IOSTATE];
+} __aligned(8);
+
 static void __iomem *ccm_base;
 static void __iomem *cortex_base;
 static void __iomem *gpc_base;
-
-void __init imx5_pm_set_ccm_base(void __iomem *base)
-{
-       ccm_base = base;
-}
+static void __iomem *suspend_ocram_base;
+static void (*imx5_suspend_in_ocram_fn)(void __iomem *ocram_vbase);
 
 /*
  * set cpu low power mode before WFI instruction. This function is called
@@ -161,8 +230,15 @@ static int mx5_suspend_enter(suspend_state_t state)
                /*clear the EMPGC0/1 bits */
                __raw_writel(0, gpc_base + MXC_SRPG_EMPGC0_SRPGCR);
                __raw_writel(0, gpc_base + MXC_SRPG_EMPGC1_SRPGCR);
+
+               if (imx5_suspend_in_ocram_fn)
+                       imx5_suspend_in_ocram_fn(suspend_ocram_base);
+               else
+                       cpu_do_idle();
+
+       } else {
+               cpu_do_idle();
        }
-       cpu_do_idle();
 
        /* return registers to default idle state */
        mx5_cpu_lp_set(IMX5_DEFAULT_CPU_IDLE_STATE);
@@ -194,6 +270,111 @@ static void imx5_pm_idle(void)
        imx5_cpu_do_idle();
 }
 
+static int __init imx_suspend_alloc_ocram(
+                               size_t size,
+                               void __iomem **virt_out,
+                               phys_addr_t *phys_out)
+{
+       struct device_node *node;
+       struct platform_device *pdev;
+       struct gen_pool *ocram_pool;
+       unsigned long ocram_base;
+       void __iomem *virt;
+       phys_addr_t phys;
+       int ret = 0;
+
+       /* Copied from imx6: TODO factorize */
+       node = of_find_compatible_node(NULL, NULL, "mmio-sram");
+       if (!node) {
+               pr_warn("%s: failed to find ocram node!\n", __func__);
+               return -ENODEV;
+       }
+
+       pdev = of_find_device_by_node(node);
+       if (!pdev) {
+               pr_warn("%s: failed to find ocram device!\n", __func__);
+               ret = -ENODEV;
+               goto put_node;
+       }
+
+       ocram_pool = dev_get_gen_pool(&pdev->dev);
+       if (!ocram_pool) {
+               pr_warn("%s: ocram pool unavailable!\n", __func__);
+               ret = -ENODEV;
+               goto put_node;
+       }
+
+       ocram_base = gen_pool_alloc(ocram_pool, size);
+       if (!ocram_base) {
+               pr_warn("%s: unable to alloc ocram!\n", __func__);
+               ret = -ENOMEM;
+               goto put_node;
+       }
+
+       phys = gen_pool_virt_to_phys(ocram_pool, ocram_base);
+       virt = __arm_ioremap_exec(phys, size, false);
+       if (phys_out)
+               *phys_out = phys;
+       if (virt_out)
+               *virt_out = virt;
+
+put_node:
+       of_node_put(node);
+
+       return ret;
+}
+
+static int __init imx5_suspend_init(const struct imx5_pm_data *soc_data)
+{
+       struct imx5_cpu_suspend_info *suspend_info;
+       int ret;
+       /* Need this to avoid compile error due to const typeof in fncpy.h */
+       void (*suspend_asm)(void __iomem *) = soc_data->suspend_asm;
+
+       if (!suspend_asm)
+               return 0;
+
+       if (!soc_data->suspend_asm_sz || !*soc_data->suspend_asm_sz)
+               return -EINVAL;
+
+       ret = imx_suspend_alloc_ocram(
+               *soc_data->suspend_asm_sz + sizeof(*suspend_info),
+               &suspend_ocram_base, NULL);
+       if (ret)
+               return ret;
+
+       suspend_info = suspend_ocram_base;
+
+       suspend_info->io_count = soc_data->suspend_io_count;
+       memcpy(suspend_info->io_state, soc_data->suspend_io_config,
+              sizeof(*suspend_info->io_state) * soc_data->suspend_io_count);
+
+       suspend_info->m4if_base = ioremap(soc_data->m4if_addr, SZ_16K);
+       if (!suspend_info->m4if_base) {
+               ret = -ENOMEM;
+               goto failed_map_m4if;
+       }
+
+       suspend_info->iomuxc_base = ioremap(soc_data->iomuxc_addr, SZ_16K);
+       if (!suspend_info->iomuxc_base) {
+               ret = -ENOMEM;
+               goto failed_map_iomuxc;
+       }
+
+       imx5_suspend_in_ocram_fn = fncpy(
+               suspend_ocram_base + sizeof(*suspend_info),
+               suspend_asm,
+               *soc_data->suspend_asm_sz);
+
+       return 0;
+
+failed_map_iomuxc:
+       iounmap(suspend_info->m4if_base);
+
+failed_map_m4if:
+       return ret;
+}
+
 static int __init imx5_pm_common_init(const struct imx5_pm_data *data)
 {
        int ret;
@@ -208,6 +389,7 @@ static int __init imx5_pm_common_init(const struct imx5_pm_data *data)
 
        arm_pm_idle = imx5_pm_idle;
 
+       ccm_base = ioremap(data->ccm_addr, SZ_16K);
        cortex_base = ioremap(data->cortex_addr, SZ_16K);
        gpc_base = ioremap(data->gpc_addr, SZ_16K);
        WARN_ON(!ccm_base || !cortex_base || !gpc_base);
@@ -219,6 +401,11 @@ static int __init imx5_pm_common_init(const struct imx5_pm_data *data)
        if (ret)
                pr_warn("%s: cpuidle init failed %d\n", __func__, ret);
 
+       ret = imx5_suspend_init(data);
+       if (ret)
+               pr_warn("%s: No DDR LPM support with suspend %d!\n",
+                       __func__, ret);
+
        suspend_set_ops(&mx5_suspend_ops);
 
        return 0;
@@ -226,10 +413,12 @@ static int __init imx5_pm_common_init(const struct imx5_pm_data *data)
 
 void __init imx51_pm_init(void)
 {
-       imx5_pm_common_init(&imx51_pm_data);
+       if (IS_ENABLED(CONFIG_SOC_IMX51))
+               imx5_pm_common_init(&imx51_pm_data);
 }
 
 void __init imx53_pm_init(void)
 {
-       imx5_pm_common_init(&imx53_pm_data);
+       if (IS_ENABLED(CONFIG_SOC_IMX53))
+               imx5_pm_common_init(&imx53_pm_data);
 }
index 6a7c6fc780cce686650ea684d2965c30de3746df..b01650d94f910111d04628dfc87a21cac4b6b9bf 100644 (file)
@@ -255,7 +255,7 @@ static void imx6q_enable_wb(bool enable)
        writel_relaxed(val, ccm_base + CCR);
 }
 
-int imx6q_set_lpm(enum mxc_cpu_pwr_mode mode)
+int imx6_set_lpm(enum mxc_cpu_pwr_mode mode)
 {
        u32 val = readl_relaxed(ccm_base + CLPCR);
 
@@ -340,7 +340,7 @@ static int imx6q_pm_enter(suspend_state_t state)
 {
        switch (state) {
        case PM_SUSPEND_STANDBY:
-               imx6q_set_lpm(STOP_POWER_ON);
+               imx6_set_lpm(STOP_POWER_ON);
                imx6q_set_int_mem_clk_lpm(true);
                imx_gpc_pre_suspend(false);
                if (cpu_is_imx6sl())
@@ -350,10 +350,10 @@ static int imx6q_pm_enter(suspend_state_t state)
                if (cpu_is_imx6sl())
                        imx6sl_set_wait_clk(false);
                imx_gpc_post_resume();
-               imx6q_set_lpm(WAIT_CLOCKED);
+               imx6_set_lpm(WAIT_CLOCKED);
                break;
        case PM_SUSPEND_MEM:
-               imx6q_set_lpm(STOP_POWER_OFF);
+               imx6_set_lpm(STOP_POWER_OFF);
                imx6q_set_int_mem_clk_lpm(false);
                imx6q_enable_wb(true);
                /*
@@ -373,7 +373,7 @@ static int imx6q_pm_enter(suspend_state_t state)
                imx6_enable_rbc(false);
                imx6q_enable_wb(false);
                imx6q_set_int_mem_clk_lpm(true);
-               imx6q_set_lpm(WAIT_CLOCKED);
+               imx6_set_lpm(WAIT_CLOCKED);
                break;
        default:
                return -EINVAL;
@@ -392,11 +392,6 @@ static const struct platform_suspend_ops imx6q_pm_ops = {
        .valid = imx6q_pm_valid,
 };
 
-void __init imx6q_pm_set_ccm_base(void __iomem *base)
-{
-       ccm_base = base;
-}
-
 static int __init imx6_pm_get_base(struct imx6_pm_base *base,
                                const char *compat)
 {
@@ -482,8 +477,7 @@ static int __init imx6q_suspend_init(const struct imx6_pm_socdata *socdata)
 
        /*
         * ccm physical address is not used by asm code currently,
-        * so get ccm virtual address directly, as we already have
-        * it from ccm driver.
+        * so get ccm virtual address directly.
         */
        pm_info->ccm_base.vbase = ccm_base;
 
@@ -568,7 +562,7 @@ static void __init imx6_pm_common_init(const struct imx6_pm_socdata
 
        /*
         * This is for SW workaround step #1 of ERR007265, see comments
-        * in imx6q_set_lpm for details of this errata.
+        * in imx6_set_lpm for details of this errata.
         * Force IOMUXC irq pending, so that the interrupt to GPC can be
         * used to deassert dsm_request signal when the signal gets
         * asserted unexpectedly.
@@ -579,6 +573,24 @@ static void __init imx6_pm_common_init(const struct imx6_pm_socdata
                                   IMX6Q_GPR1_GINT);
 }
 
+void __init imx6_pm_ccm_init(const char *ccm_compat)
+{
+       struct device_node *np;
+       u32 val;
+
+       np = of_find_compatible_node(NULL, NULL, ccm_compat);
+       ccm_base = of_iomap(np, 0);
+       BUG_ON(!ccm_base);
+
+       /*
+        * Initialize CCM_CLPCR_LPM into RUN mode to avoid ARM core
+        * clock being shut down unexpectedly by WAIT mode.
+        */
+       val = readl_relaxed(ccm_base + CLPCR);
+       val &= ~BM_CLPCR_LPM;
+       writel_relaxed(val, ccm_base + CLPCR);
+}
+
 void __init imx6q_pm_init(void)
 {
        imx6_pm_common_init(&imx6q_pm_data);
diff --git a/arch/arm/mach-imx/suspend-imx53.S b/arch/arm/mach-imx/suspend-imx53.S
new file mode 100644 (file)
index 0000000..5ed078a
--- /dev/null
@@ -0,0 +1,139 @@
+/*
+ * Copyright (C) 2008-2011 Freescale Semiconductor, Inc.
+ */
+/*
+ * 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:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+#include <linux/linkage.h>
+
+#define M4IF_MCR0_OFFSET                       (0x008C)
+#define M4IF_MCR0_FDVFS                                (0x1 << 11)
+#define M4IF_MCR0_FDVACK                       (0x1 << 27)
+
+       .align 3
+
+/*
+ * ==================== low level suspend ====================
+ *
+ * On entry
+ * r0: pm_info structure address;
+ *
+ * suspend ocram space layout:
+ * ======================== high address ======================
+ *                              .
+ *                              .
+ *                              .
+ *                              ^
+ *                              ^
+ *                              ^
+ *                      imx53_suspend code
+ *              PM_INFO structure(imx53_suspend_info)
+ * ======================== low address =======================
+ */
+
+/* Offsets of members of struct imx53_suspend_info */
+#define SUSPEND_INFO_MX53_M4IF_V_OFFSET                0x0
+#define SUSPEND_INFO_MX53_IOMUXC_V_OFFSET      0x4
+#define SUSPEND_INFO_MX53_IO_COUNT_OFFSET      0x8
+#define SUSPEND_INFO_MX53_IO_STATE_OFFSET      0xc
+
+ENTRY(imx53_suspend)
+       stmfd   sp!, {r4,r5,r6,r7}
+
+       /* Save pad config */
+       ldr     r1, [r0, #SUSPEND_INFO_MX53_IO_COUNT_OFFSET]
+       cmp     r1, #0
+       beq     skip_pad_conf_1
+
+       add     r2, r0, #SUSPEND_INFO_MX53_IO_STATE_OFFSET
+       ldr     r3, [r0, #SUSPEND_INFO_MX53_IOMUXC_V_OFFSET]
+
+1:
+       ldr     r5, [r2], #12   /* IOMUXC register offset */
+       ldr     r6, [r3, r5]    /* current value */
+       str     r6, [r2], #4    /* save area */
+       subs    r1, r1, #1
+       bne     1b
+
+skip_pad_conf_1:
+       /* Set FDVFS bit of M4IF_MCR0 to request DDR to enter self-refresh */
+       ldr     r1, [r0, #SUSPEND_INFO_MX53_M4IF_V_OFFSET]
+       ldr     r2,[r1, #M4IF_MCR0_OFFSET]
+       orr     r2, r2, #M4IF_MCR0_FDVFS
+       str     r2,[r1, #M4IF_MCR0_OFFSET]
+
+       /* Poll FDVACK bit of M4IF_MCR to wait for DDR to enter self-refresh */
+wait_sr_ack:
+       ldr     r2,[r1, #M4IF_MCR0_OFFSET]
+       ands    r2, r2, #M4IF_MCR0_FDVACK
+       beq     wait_sr_ack
+
+       /* Set pad config */
+       ldr     r1, [r0, #SUSPEND_INFO_MX53_IO_COUNT_OFFSET]
+       cmp     r1, #0
+       beq     skip_pad_conf_2
+
+       add     r2, r0, #SUSPEND_INFO_MX53_IO_STATE_OFFSET
+       ldr     r3, [r0, #SUSPEND_INFO_MX53_IOMUXC_V_OFFSET]
+
+2:
+       ldr     r5, [r2], #4    /* IOMUXC register offset */
+       ldr     r6, [r2], #4    /* clear */
+       ldr     r7, [r3, r5]
+       bic     r7, r7, r6
+       ldr     r6, [r2], #8    /* set */
+       orr     r7, r7, r6
+       str     r7, [r3, r5]
+       subs    r1, r1, #1
+       bne     2b
+
+skip_pad_conf_2:
+       /* Zzz, enter stop mode */
+       wfi
+       nop
+       nop
+       nop
+       nop
+
+       /* Restore pad config */
+       ldr     r1, [r0, #SUSPEND_INFO_MX53_IO_COUNT_OFFSET]
+       cmp     r1, #0
+       beq     skip_pad_conf_3
+
+       add     r2, r0, #SUSPEND_INFO_MX53_IO_STATE_OFFSET
+       ldr     r3, [r0, #SUSPEND_INFO_MX53_IOMUXC_V_OFFSET]
+
+3:
+       ldr     r5, [r2], #12   /* IOMUXC register offset */
+       ldr     r6, [r2], #4    /* saved value */
+       str     r6, [r3, r5]
+       subs    r1, r1, #1
+       bne     3b
+
+skip_pad_conf_3:
+       /* Clear FDVFS bit of M4IF_MCR0 to request DDR to exit self-refresh */
+       ldr     r1, [r0, #SUSPEND_INFO_MX53_M4IF_V_OFFSET]
+       ldr     r2,[r1, #M4IF_MCR0_OFFSET]
+       bic     r2, r2, #M4IF_MCR0_FDVFS
+       str     r2,[r1, #M4IF_MCR0_OFFSET]
+
+       /* Poll FDVACK bit of M4IF_MCR to wait for DDR to exit self-refresh */
+wait_ar_ack:
+       ldr     r2,[r1, #M4IF_MCR0_OFFSET]
+       ands    r2, r2, #M4IF_MCR0_FDVACK
+       bne     wait_ar_ack
+
+       /* Restore registers */
+       ldmfd   sp!, {r4,r5,r6,r7}
+       mov     pc, lr
+
+ENDPROC(imx53_suspend)
+
+ENTRY(imx53_suspend_sz)
+        .word   . - imx53_suspend
diff --git a/arch/arm/mach-imx/time.c b/arch/arm/mach-imx/time.c
deleted file mode 100644 (file)
index 15d18e1..0000000
+++ /dev/null
@@ -1,385 +0,0 @@
-/*
- *  linux/arch/arm/plat-mxc/time.c
- *
- *  Copyright (C) 2000-2001 Deep Blue Solutions
- *  Copyright (C) 2002 Shane Nay (shane@minirl.com)
- *  Copyright (C) 2006-2007 Pavel Pisa (ppisa@pikron.com)
- *  Copyright (C) 2008 Juergen Beisert (kernel@pengutronix.de)
- *
- * 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., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- */
-
-#include <linux/interrupt.h>
-#include <linux/irq.h>
-#include <linux/clockchips.h>
-#include <linux/clk.h>
-#include <linux/delay.h>
-#include <linux/err.h>
-#include <linux/sched_clock.h>
-#include <linux/of.h>
-#include <linux/of_address.h>
-#include <linux/of_irq.h>
-
-#include <asm/mach/time.h>
-
-#include "common.h"
-#include "hardware.h"
-
-/*
- * There are 2 versions of the timer hardware on Freescale MXC hardware.
- * Version 1: MX1/MXL, MX21, MX27.
- * Version 2: MX25, MX31, MX35, MX37, MX51
- */
-
-/* defines common for all i.MX */
-#define MXC_TCTL               0x00
-#define MXC_TCTL_TEN           (1 << 0) /* Enable module */
-#define MXC_TPRER              0x04
-
-/* MX1, MX21, MX27 */
-#define MX1_2_TCTL_CLK_PCLK1   (1 << 1)
-#define MX1_2_TCTL_IRQEN       (1 << 4)
-#define MX1_2_TCTL_FRR         (1 << 8)
-#define MX1_2_TCMP             0x08
-#define MX1_2_TCN              0x10
-#define MX1_2_TSTAT            0x14
-
-/* MX21, MX27 */
-#define MX2_TSTAT_CAPT         (1 << 1)
-#define MX2_TSTAT_COMP         (1 << 0)
-
-/* MX31, MX35, MX25, MX5, MX6 */
-#define V2_TCTL_WAITEN         (1 << 3) /* Wait enable mode */
-#define V2_TCTL_CLK_IPG                (1 << 6)
-#define V2_TCTL_CLK_PER                (2 << 6)
-#define V2_TCTL_CLK_OSC_DIV8   (5 << 6)
-#define V2_TCTL_FRR            (1 << 9)
-#define V2_TCTL_24MEN          (1 << 10)
-#define V2_TPRER_PRE24M                12
-#define V2_IR                  0x0c
-#define V2_TSTAT               0x08
-#define V2_TSTAT_OF1           (1 << 0)
-#define V2_TCN                 0x24
-#define V2_TCMP                        0x10
-
-#define V2_TIMER_RATE_OSC_DIV8 3000000
-
-#define timer_is_v1()  (cpu_is_mx1() || cpu_is_mx21() || cpu_is_mx27())
-#define timer_is_v2()  (!timer_is_v1())
-
-static struct clock_event_device clockevent_mxc;
-static enum clock_event_mode clockevent_mode = CLOCK_EVT_MODE_UNUSED;
-
-static void __iomem *timer_base;
-
-static inline void gpt_irq_disable(void)
-{
-       unsigned int tmp;
-
-       if (timer_is_v2())
-               __raw_writel(0, timer_base + V2_IR);
-       else {
-               tmp = __raw_readl(timer_base + MXC_TCTL);
-               __raw_writel(tmp & ~MX1_2_TCTL_IRQEN, timer_base + MXC_TCTL);
-       }
-}
-
-static inline void gpt_irq_enable(void)
-{
-       if (timer_is_v2())
-               __raw_writel(1<<0, timer_base + V2_IR);
-       else {
-               __raw_writel(__raw_readl(timer_base + MXC_TCTL) | MX1_2_TCTL_IRQEN,
-                       timer_base + MXC_TCTL);
-       }
-}
-
-static void gpt_irq_acknowledge(void)
-{
-       if (timer_is_v1()) {
-               if (cpu_is_mx1())
-                       __raw_writel(0, timer_base + MX1_2_TSTAT);
-               else
-                       __raw_writel(MX2_TSTAT_CAPT | MX2_TSTAT_COMP,
-                               timer_base + MX1_2_TSTAT);
-       } else if (timer_is_v2())
-               __raw_writel(V2_TSTAT_OF1, timer_base + V2_TSTAT);
-}
-
-static void __iomem *sched_clock_reg;
-
-static u64 notrace mxc_read_sched_clock(void)
-{
-       return sched_clock_reg ? __raw_readl(sched_clock_reg) : 0;
-}
-
-static struct delay_timer imx_delay_timer;
-
-static unsigned long imx_read_current_timer(void)
-{
-       return __raw_readl(sched_clock_reg);
-}
-
-static int __init mxc_clocksource_init(struct clk *timer_clk)
-{
-       unsigned int c = clk_get_rate(timer_clk);
-       void __iomem *reg = timer_base + (timer_is_v2() ? V2_TCN : MX1_2_TCN);
-
-       imx_delay_timer.read_current_timer = &imx_read_current_timer;
-       imx_delay_timer.freq = c;
-       register_current_timer_delay(&imx_delay_timer);
-
-       sched_clock_reg = reg;
-
-       sched_clock_register(mxc_read_sched_clock, 32, c);
-       return clocksource_mmio_init(reg, "mxc_timer1", c, 200, 32,
-                       clocksource_mmio_readl_up);
-}
-
-/* clock event */
-
-static int mx1_2_set_next_event(unsigned long evt,
-                             struct clock_event_device *unused)
-{
-       unsigned long tcmp;
-
-       tcmp = __raw_readl(timer_base + MX1_2_TCN) + evt;
-
-       __raw_writel(tcmp, timer_base + MX1_2_TCMP);
-
-       return (int)(tcmp - __raw_readl(timer_base + MX1_2_TCN)) < 0 ?
-                               -ETIME : 0;
-}
-
-static int v2_set_next_event(unsigned long evt,
-                             struct clock_event_device *unused)
-{
-       unsigned long tcmp;
-
-       tcmp = __raw_readl(timer_base + V2_TCN) + evt;
-
-       __raw_writel(tcmp, timer_base + V2_TCMP);
-
-       return evt < 0x7fffffff &&
-               (int)(tcmp - __raw_readl(timer_base + V2_TCN)) < 0 ?
-                               -ETIME : 0;
-}
-
-#ifdef DEBUG
-static const char *clock_event_mode_label[] = {
-       [CLOCK_EVT_MODE_PERIODIC] = "CLOCK_EVT_MODE_PERIODIC",
-       [CLOCK_EVT_MODE_ONESHOT]  = "CLOCK_EVT_MODE_ONESHOT",
-       [CLOCK_EVT_MODE_SHUTDOWN] = "CLOCK_EVT_MODE_SHUTDOWN",
-       [CLOCK_EVT_MODE_UNUSED]   = "CLOCK_EVT_MODE_UNUSED",
-       [CLOCK_EVT_MODE_RESUME]   = "CLOCK_EVT_MODE_RESUME",
-};
-#endif /* DEBUG */
-
-static void mxc_set_mode(enum clock_event_mode mode,
-                               struct clock_event_device *evt)
-{
-       unsigned long flags;
-
-       /*
-        * The timer interrupt generation is disabled at least
-        * for enough time to call mxc_set_next_event()
-        */
-       local_irq_save(flags);
-
-       /* Disable interrupt in GPT module */
-       gpt_irq_disable();
-
-       if (mode != clockevent_mode) {
-               /* Set event time into far-far future */
-               if (timer_is_v2())
-                       __raw_writel(__raw_readl(timer_base + V2_TCN) - 3,
-                                       timer_base + V2_TCMP);
-               else
-                       __raw_writel(__raw_readl(timer_base + MX1_2_TCN) - 3,
-                                       timer_base + MX1_2_TCMP);
-
-               /* Clear pending interrupt */
-               gpt_irq_acknowledge();
-       }
-
-#ifdef DEBUG
-       printk(KERN_INFO "mxc_set_mode: changing mode from %s to %s\n",
-               clock_event_mode_label[clockevent_mode],
-               clock_event_mode_label[mode]);
-#endif /* DEBUG */
-
-       /* Remember timer mode */
-       clockevent_mode = mode;
-       local_irq_restore(flags);
-
-       switch (mode) {
-       case CLOCK_EVT_MODE_PERIODIC:
-               printk(KERN_ERR"mxc_set_mode: Periodic mode is not "
-                               "supported for i.MX\n");
-               break;
-       case CLOCK_EVT_MODE_ONESHOT:
-       /*
-        * Do not put overhead of interrupt enable/disable into
-        * mxc_set_next_event(), the core has about 4 minutes
-        * to call mxc_set_next_event() or shutdown clock after
-        * mode switching
-        */
-               local_irq_save(flags);
-               gpt_irq_enable();
-               local_irq_restore(flags);
-               break;
-       case CLOCK_EVT_MODE_SHUTDOWN:
-       case CLOCK_EVT_MODE_UNUSED:
-       case CLOCK_EVT_MODE_RESUME:
-               /* Left event sources disabled, no more interrupts appear */
-               break;
-       }
-}
-
-/*
- * IRQ handler for the timer
- */
-static irqreturn_t mxc_timer_interrupt(int irq, void *dev_id)
-{
-       struct clock_event_device *evt = &clockevent_mxc;
-       uint32_t tstat;
-
-       if (timer_is_v2())
-               tstat = __raw_readl(timer_base + V2_TSTAT);
-       else
-               tstat = __raw_readl(timer_base + MX1_2_TSTAT);
-
-       gpt_irq_acknowledge();
-
-       evt->event_handler(evt);
-
-       return IRQ_HANDLED;
-}
-
-static struct irqaction mxc_timer_irq = {
-       .name           = "i.MX Timer Tick",
-       .flags          = IRQF_TIMER | IRQF_IRQPOLL,
-       .handler        = mxc_timer_interrupt,
-};
-
-static struct clock_event_device clockevent_mxc = {
-       .name           = "mxc_timer1",
-       .features       = CLOCK_EVT_FEAT_ONESHOT,
-       .set_mode       = mxc_set_mode,
-       .set_next_event = mx1_2_set_next_event,
-       .rating         = 200,
-};
-
-static int __init mxc_clockevent_init(struct clk *timer_clk)
-{
-       if (timer_is_v2())
-               clockevent_mxc.set_next_event = v2_set_next_event;
-
-       clockevent_mxc.cpumask = cpumask_of(0);
-       clockevents_config_and_register(&clockevent_mxc,
-                                       clk_get_rate(timer_clk),
-                                       0xff, 0xfffffffe);
-
-       return 0;
-}
-
-static void __init _mxc_timer_init(int irq,
-                                  struct clk *clk_per, struct clk *clk_ipg)
-{
-       uint32_t tctl_val;
-
-       if (IS_ERR(clk_per)) {
-               pr_err("i.MX timer: unable to get clk\n");
-               return;
-       }
-
-       if (!IS_ERR(clk_ipg))
-               clk_prepare_enable(clk_ipg);
-
-       clk_prepare_enable(clk_per);
-
-       /*
-        * Initialise to a known state (all timers off, and timing reset)
-        */
-
-       __raw_writel(0, timer_base + MXC_TCTL);
-       __raw_writel(0, timer_base + MXC_TPRER); /* see datasheet note */
-
-       if (timer_is_v2()) {
-               tctl_val = V2_TCTL_FRR | V2_TCTL_WAITEN | MXC_TCTL_TEN;
-               if (clk_get_rate(clk_per) == V2_TIMER_RATE_OSC_DIV8) {
-                       tctl_val |= V2_TCTL_CLK_OSC_DIV8;
-                       if (cpu_is_imx6dl() || cpu_is_imx6sx()) {
-                               /* 24 / 8 = 3 MHz */
-                               __raw_writel(7 << V2_TPRER_PRE24M,
-                                       timer_base + MXC_TPRER);
-                               tctl_val |= V2_TCTL_24MEN;
-                       }
-               } else {
-                       tctl_val |= V2_TCTL_CLK_PER;
-               }
-       } else {
-               tctl_val = MX1_2_TCTL_FRR | MX1_2_TCTL_CLK_PCLK1 | MXC_TCTL_TEN;
-       }
-
-       __raw_writel(tctl_val, timer_base + MXC_TCTL);
-
-       /* init and register the timer to the framework */
-       mxc_clocksource_init(clk_per);
-       mxc_clockevent_init(clk_per);
-
-       /* Make irqs happen */
-       setup_irq(irq, &mxc_timer_irq);
-}
-
-void __init mxc_timer_init(void __iomem *base, int irq)
-{
-       struct clk *clk_per = clk_get_sys("imx-gpt.0", "per");
-       struct clk *clk_ipg = clk_get_sys("imx-gpt.0", "ipg");
-
-       timer_base = base;
-
-       _mxc_timer_init(irq, clk_per, clk_ipg);
-}
-
-static void __init mxc_timer_init_dt(struct device_node *np)
-{
-       struct clk *clk_per, *clk_ipg;
-       int irq;
-
-       if (timer_base)
-               return;
-
-       timer_base = of_iomap(np, 0);
-       WARN_ON(!timer_base);
-       irq = irq_of_parse_and_map(np, 0);
-
-       clk_ipg = of_clk_get_by_name(np, "ipg");
-
-       /* Try osc_per first, and fall back to per otherwise */
-       clk_per = of_clk_get_by_name(np, "osc_per");
-       if (IS_ERR(clk_per))
-               clk_per = of_clk_get_by_name(np, "per");
-
-       _mxc_timer_init(irq, clk_per, clk_ipg);
-}
-CLOCKSOURCE_OF_DECLARE(mx1_timer, "fsl,imx1-gpt", mxc_timer_init_dt);
-CLOCKSOURCE_OF_DECLARE(mx25_timer, "fsl,imx25-gpt", mxc_timer_init_dt);
-CLOCKSOURCE_OF_DECLARE(mx50_timer, "fsl,imx50-gpt", mxc_timer_init_dt);
-CLOCKSOURCE_OF_DECLARE(mx51_timer, "fsl,imx51-gpt", mxc_timer_init_dt);
-CLOCKSOURCE_OF_DECLARE(mx53_timer, "fsl,imx53-gpt", mxc_timer_init_dt);
-CLOCKSOURCE_OF_DECLARE(mx6q_timer, "fsl,imx6q-gpt", mxc_timer_init_dt);
-CLOCKSOURCE_OF_DECLARE(mx6sl_timer, "fsl,imx6sl-gpt", mxc_timer_init_dt);
-CLOCKSOURCE_OF_DECLARE(mx6sx_timer, "fsl,imx6sx-gpt", mxc_timer_init_dt);
index 15bc9bb78a6b616f7361e9f5c9cbed255bb03f87..c871e6874594cc25f178baf9ff8ce5abe0dfd80d 100644 (file)
@@ -42,7 +42,7 @@ static inline unsigned long iop13xx_core_freq(void)
        case IOP13XX_CORE_FREQ_1200:
                return 1200000000;
        default:
-               printk("%s: warning unknown frequency, defaulting to 800Mhz\n",
+               printk("%s: warning unknown frequency, defaulting to 800MHz\n",
                        __func__);
        }
 
index 75c4c6572ad04e5d1907f5b40bb6a34413b7d781..34b3d3f3f1310350697ec066bdc730525cce81e3 100644 (file)
@@ -74,7 +74,7 @@ extern unsigned long ixp4xx_exp_bus_size;
 /*
  * Clock Speed Definitions.
  */
-#define IXP4XX_PERIPHERAL_BUS_CLOCK    (66) /* 66Mhzi APB BUS   */ 
+#define IXP4XX_PERIPHERAL_BUS_CLOCK    (66) /* 66MHzi APB BUS   */ 
 #define IXP4XX_UART_XTAL               14745600
 
 /*
index 5090338c0db2d927543096f5f5ad303e1f5e24d2..959c748ee8bbe27b179c237a2445aedf8288f20d 100644 (file)
@@ -17,7 +17,7 @@
 #include <asm/sizes.h>
 
 /*
- * Clocks are derived from MCLK, which is 25Mhz
+ * Clocks are derived from MCLK, which is 25MHz
  */
 #define KS8695_CLOCK_RATE      25000000
 
diff --git a/arch/arm/mach-lpc18xx/Makefile b/arch/arm/mach-lpc18xx/Makefile
new file mode 100644 (file)
index 0000000..bd0b7b5
--- /dev/null
@@ -0,0 +1 @@
+obj-y += board-dt.o
diff --git a/arch/arm/mach-lpc18xx/Makefile.boot b/arch/arm/mach-lpc18xx/Makefile.boot
new file mode 100644 (file)
index 0000000..eacfc3f
--- /dev/null
@@ -0,0 +1,3 @@
+# Empty file waiting for deletion once Makefile.boot isn't needed any more.
+# Patch waits for application at
+# http://www.arm.linux.org.uk/developer/patches/viewpatch.php?id=7889/1 .
diff --git a/arch/arm/mach-lpc18xx/board-dt.c b/arch/arm/mach-lpc18xx/board-dt.c
new file mode 100644 (file)
index 0000000..fdcee78
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ * Device Tree board file for NXP LPC18xx/43xx
+ *
+ * Copyright (C) 2015 Joachim Eastwood <manabian@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.
+ */
+
+#include <asm/mach/arch.h>
+
+static const char *const lpc18xx_43xx_compat[] __initconst = {
+       "nxp,lpc1850",
+       "nxp,lpc4350",
+       "nxp,lpc4370",
+       NULL
+};
+
+DT_MACHINE_START(LPC18XXDT, "NXP LPC18xx/43xx (Device Tree)")
+       .dt_compat = lpc18xx_43xx_compat,
+MACHINE_END
index 08d5ed46b996be2d36ad44285008ab801c90b479..48e4c4b3cd1c9a52f6e5580c531088e10aac8662 100644 (file)
@@ -21,7 +21,6 @@
 
 ENTRY(mvebu_cortex_a9_secondary_startup)
 ARM_BE8(setend be)
-       bl      v7_invalidate_l1
        bl      armada_38x_scu_power_up
        b       secondary_startup
 ENDPROC(mvebu_cortex_a9_secondary_startup)
index 3d1e1c250a1ab4b5e4eb25b52ed4eae3da0b0aef..5d7fb596bf4afb6d14b7c835cad0cbc38b827869 100644 (file)
 #include <asm/assembler.h>
 
 #include <mach/board-ams-delta.h>
-
-#include <mach/irqs.h>
 #include <mach/ams-delta-fiq.h>
 
 #include "iomap.h"
+#include "soc.h"
 
 /*
  * GPIO related definitions, copied from arch/arm/plat-omap/gpio.c.
index 2aab761ee68db7ae8fee7fd5eaf84e82f9c80572..a95499ea87064d4f886b234f2a8eafba922fe573 100644 (file)
@@ -626,6 +626,7 @@ MACHINE_START(AMS_DELTA, "Amstrad E3 (Delta)")
        .map_io         = ams_delta_map_io,
        .init_early     = omap1_init_early,
        .init_irq       = omap1_init_irq,
+       .handle_irq     = omap1_handle_irq,
        .init_machine   = ams_delta_init,
        .init_late      = ams_delta_init_late,
        .init_time      = omap1_timer_init,
index 702d58039cc1a90820232615224d2015bf7a6329..0fb51d22c8b57fd8b4de7aa5a04fdae2f8499d4b 100644 (file)
@@ -362,6 +362,7 @@ MACHINE_START(OMAP_FSAMPLE, "OMAP730 F-Sample")
        .map_io         = omap_fsample_map_io,
        .init_early     = omap1_init_early,
        .init_irq       = omap1_init_irq,
+       .handle_irq     = omap1_handle_irq,
        .init_machine   = omap_fsample_init,
        .init_late      = omap1_init_late,
        .init_time      = omap1_timer_init,
index e1d9171774bca91eec6f2a4802c7153208822743..9708629f8c5f9c83e3db2161e7d56e1cac02b7b4 100644 (file)
@@ -82,6 +82,7 @@ MACHINE_START(OMAP_GENERIC, "Generic OMAP1510/1610/1710")
        .map_io         = omap16xx_map_io,
        .init_early     = omap1_init_early,
        .init_irq       = omap1_init_irq,
+       .handle_irq     = omap1_handle_irq,
        .init_machine   = omap_generic_init,
        .init_late      = omap1_init_late,
        .init_time      = omap1_timer_init,
index 5b45d266d83e0de774c3bdea376c3f29d5193aea..8340d684d8b6003fd8da9c4b801d35f82e7c15ca 100644 (file)
@@ -426,6 +426,7 @@ MACHINE_START(OMAP_H2, "TI-H2")
        .map_io         = omap16xx_map_io,
        .init_early     = omap1_init_early,
        .init_irq       = omap1_init_irq,
+       .handle_irq     = omap1_handle_irq,
        .init_machine   = h2_init,
        .init_late      = omap1_init_late,
        .init_time      = omap1_timer_init,
index 17d77914d769233d4c1360ef5159a3df98cda596..43aab63cbc39da2903fc600faf0fbdbbfbb9d8d6 100644 (file)
@@ -16,6 +16,7 @@
 
 #include <linux/i2c/tps65010.h>
 
+#include "common.h"
 #include "board-h3.h"
 #include "mmc.h"
 
index bfed4f928663a52b3643a7518f35e3c8c0537800..086ff34e072b6e5e4a489a84b00f9ca2f35cc189 100644 (file)
@@ -452,6 +452,7 @@ MACHINE_START(OMAP_H3, "TI OMAP1710 H3 board")
        .map_io         = omap16xx_map_io,
        .init_early     = omap1_init_early,
        .init_irq       = omap1_init_irq,
+       .handle_irq     = omap1_handle_irq,
        .init_machine   = h3_init,
        .init_late      = omap1_init_late,
        .init_time      = omap1_timer_init,
index 35a2379b986f676618a49991dcd621cbe3e6e51b..9525ef9bc6c0db1b3e706a58b4348980b8843712 100644 (file)
@@ -601,6 +601,7 @@ MACHINE_START(HERALD, "HTC Herald")
        .map_io         = htcherald_map_io,
        .init_early     = omap1_init_early,
        .init_irq       = omap1_init_irq,
+       .handle_irq     = omap1_handle_irq,
        .init_machine   = htcherald_init,
        .init_late      = omap1_init_late,
        .init_time      = omap1_timer_init,
index c49ce83cc1ebd066abcc4200f78cd9e008dda61a..ed4e045c2ad8278b360c7b5ebba8bd0ed75f48bb 100644 (file)
@@ -456,6 +456,7 @@ MACHINE_START(OMAP_INNOVATOR, "TI-Innovator")
        .map_io         = innovator_map_io,
        .init_early     = omap1_init_early,
        .init_irq       = omap1_init_irq,
+       .handle_irq     = omap1_handle_irq,
        .init_machine   = innovator_init,
        .init_late      = omap1_init_late,
        .init_time      = omap1_timer_init,
index 85089d821982193b2e2d79f5f5fbf050eefad464..9f6c7af3a4e71158d25f72e0cecb8fdfc59fec57 100644 (file)
@@ -294,6 +294,7 @@ MACHINE_START(NOKIA770, "Nokia 770")
        .map_io         = omap16xx_map_io,
        .init_early     = omap1_init_early,
        .init_irq       = omap1_init_irq,
+       .handle_irq     = omap1_handle_irq,
        .init_machine   = omap_nokia770_init,
        .init_late      = omap1_init_late,
        .init_time      = omap1_timer_init,
index 7436d4cf659640731acaaca4a0bc352561bfd769..0efd165b82278f52626c3cf2fd2a8af230020aa4 100644 (file)
@@ -610,6 +610,7 @@ MACHINE_START(OMAP_OSK, "TI-OSK")
        .map_io         = omap16xx_map_io,
        .init_early     = omap1_init_early,
        .init_irq       = omap1_init_irq,
+       .handle_irq     = omap1_handle_irq,
        .init_machine   = osk_init,
        .init_late      = omap1_init_late,
        .init_time      = omap1_timer_init,
index 3b8e98f4353c465675bef171a19580c1987e35ae..1142ae431fe0dc2999a85da6847c4478e8ee2ee5 100644 (file)
@@ -235,6 +235,7 @@ MACHINE_START(OMAP_PALMTE, "OMAP310 based Palm Tungsten E")
        .map_io         = omap15xx_map_io,
        .init_early     = omap1_init_early,
        .init_irq       = omap1_init_irq,
+       .handle_irq     = omap1_handle_irq,
        .init_machine   = omap_palmte_init,
        .init_late      = omap1_init_late,
        .init_time      = omap1_timer_init,
index ca501208825fc5fb62d49701e09aaf057b44d635..54a547a96950651733677ba66ba05b58a1435aa2 100644 (file)
@@ -282,6 +282,7 @@ MACHINE_START(OMAP_PALMTT, "OMAP1510 based Palm Tungsten|T")
        .map_io         = omap15xx_map_io,
        .init_early     = omap1_init_early,
        .init_irq       = omap1_init_irq,
+       .handle_irq     = omap1_handle_irq,
        .init_machine   = omap_palmtt_init,
        .init_late      = omap1_init_late,
        .init_time      = omap1_timer_init,
index 470e12d67360cd351ae41b9467dfaf406b679c64..87ec04ae40dd691f29aa3f014f3fbe4269b5a394 100644 (file)
@@ -297,6 +297,7 @@ MACHINE_START(OMAP_PALMZ71, "OMAP310 based Palm Zire71")
        .map_io         = omap15xx_map_io,
        .init_early     = omap1_init_early,
        .init_irq       = omap1_init_irq,
+       .handle_irq     = omap1_handle_irq,
        .init_machine   = omap_palmz71_init,
        .init_late      = omap1_init_late,
        .init_time      = omap1_timer_init,
index 8b2f7127f716ae583fb1ba05adc2976fb0905dd9..3d76f05407f0cbe87d16f514b4b6b4c3fab1f3af 100644 (file)
@@ -324,6 +324,7 @@ MACHINE_START(OMAP_PERSEUS2, "OMAP730 Perseus2")
        .map_io         = omap_perseus2_map_io,
        .init_early     = omap1_init_early,
        .init_irq       = omap1_init_irq,
+       .handle_irq     = omap1_handle_irq,
        .init_machine   = omap_perseus2_init,
        .init_late      = omap1_init_late,
        .init_time      = omap1_timer_init,
index 29e526235dc2e06e964e2f54631b08d01a0a5f23..939991ea33d5cab3f31713ea427cd38325618fda 100644 (file)
@@ -343,6 +343,7 @@ MACHINE_START(SX1, "OMAP310 based Siemens SX1")
        .map_io         = omap15xx_map_io,
        .init_early     = omap1_init_early,
        .init_irq       = omap1_init_irq,
+       .handle_irq     = omap1_handle_irq,
        .init_machine   = omap_sx1_init,
        .init_late      = omap1_init_late,
        .init_time      = omap1_timer_init,
index 4677a9ccb3cbbb222bc50c2a59e3b66b81d73e18..e960687d0cb155465efe41ed34dcf4ca36e5d932 100644 (file)
@@ -288,6 +288,7 @@ MACHINE_START(VOICEBLUE, "VoiceBlue OMAP5910")
        .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,
index 732f8ee2fcd2ce544a28eabda14f5fdde8250e7a..65bb6e8085de1fd8b81a335be4dc9117a352f892 100644 (file)
 #include <linux/i2c-omap.h>
 #include <linux/reboot.h>
 
+#include <asm/exception.h>
+
 #include <plat/i2c.h>
 
 #include <mach/irqs.h>
 
+#include "soc.h"
+
 #if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850)
 void omap7xx_map_io(void);
 #else
@@ -73,6 +77,7 @@ static inline int omap_serial_wakeup_init(void)
 
 void omap1_init_early(void);
 void omap1_init_irq(void);
+void __exception_irq_entry omap1_handle_irq(struct pt_regs *regs);
 void omap1_init_late(void);
 void omap1_restart(enum reboot_mode, const char *);
 
@@ -91,8 +96,6 @@ static inline int __init omap_32k_timer_init(void)
 }
 #endif
 
-extern u32 omap_irq_flags;
-
 #ifdef CONFIG_ARCH_OMAP16XX
 extern int ocpi_enable(void);
 #else
index 4be601b638d7aa8c0d35b7fa5924eb54aa6e2534..7b02ed218a42f693a7347c58488d026f11b5b113 100644 (file)
@@ -28,7 +28,7 @@
 #include <linux/omap-dma.h>
 #include <mach/tc.h>
 
-#include <mach/irqs.h>
+#include "soc.h"
 
 #define OMAP1_DMA_BASE                 (0xfffed800)
 #define OMAP1_LOGICAL_DMA_CH_COUNT     17
index 6e6ec93dcbb3fd4a4f0d889b2e871737a38f028e..5b7a29b294d47991f4d66e87ca535ea9c4ea5f99 100644 (file)
@@ -21,6 +21,8 @@
 
 #include <mach/irqs.h>
 
+#include "soc.h"
+
 #define OMAP1610_GPIO1_BASE            0xfffbe400
 #define OMAP1610_GPIO2_BASE            0xfffbec00
 #define OMAP1610_GPIO3_BASE            0xfffbb400
index 4612d2506a2db5a6e7e22d06a643e6beb6747409..0e5f68de23bfb4484b578dee72979559e959ba0e 100644 (file)
@@ -21,6 +21,8 @@
 
 #include <mach/irqs.h>
 
+#include "soc.h"
+
 #define OMAP7XX_GPIO1_BASE             0xfffbc000
 #define OMAP7XX_GPIO2_BASE             0xfffbc800
 #define OMAP7XX_GPIO3_BASE             0xfffbd000
index 7f5761cffd2eaf75561b3b77112b4c8553b020f4..82887d645a6acb38462089da235d5aeb446181e5 100644 (file)
@@ -27,7 +27,6 @@
 
 #define OMAP_I2C_SIZE          0x3f
 #define OMAP1_I2C_BASE         0xfffb3800
-#define OMAP1_INT_I2C          (32 + 4)
 
 static const char name[] = "omap_i2c";
 
@@ -67,7 +66,7 @@ int __init omap_i2c_add_bus(struct omap_i2c_bus_platform_data *pdata,
        res[0].start = OMAP1_I2C_BASE;
        res[0].end = res[0].start + OMAP_I2C_SIZE;
        res[0].flags = IORESOURCE_MEM;
-       res[1].start = OMAP1_INT_I2C;
+       res[1].start = INT_I2C;
        res[1].flags = IORESOURCE_IRQ;
        pdev->resource = res;
 
diff --git a/arch/arm/mach-omap1/include/mach/entry-macro.S b/arch/arm/mach-omap1/include/mach/entry-macro.S
deleted file mode 100644 (file)
index 78a8c6c..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * arch/arm/mach-omap1/include/mach/entry-macro.S
- *
- * Low-level IRQ helper macros for OMAP-based platforms
- *
- * Copyright (C) 2009 Texas Instruments
- *
- * This file is licensed under  the terms of the GNU General Public
- * License version 2. This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#include <mach/hardware.h>
-#include <mach/irqs.h>
-
-               .macro  get_irqnr_preamble, base, tmp
-               .endm
-
-               .macro  get_irqnr_and_base, irqnr, irqstat, base, tmp
-               ldr     \base, =OMAP1_IO_ADDRESS(OMAP_IH1_BASE)
-               ldr     \irqnr, [\base, #IRQ_ITR_REG_OFFSET]
-               ldr     \tmp, [\base, #IRQ_MIR_REG_OFFSET]
-               mov     \irqstat, #0xffffffff
-               bic     \tmp, \irqstat, \tmp
-               tst     \irqnr, \tmp
-               beq     1510f
-
-               ldr     \irqnr, [\base, #IRQ_SIR_FIQ_REG_OFFSET]
-               ldr     \tmp, =omap_irq_flags   @ irq flags address
-               ldr     \tmp, [\tmp, #0]        @ irq flags value
-               cmp     \irqnr, #0
-               ldreq   \irqnr, [\base, #IRQ_SIR_IRQ_REG_OFFSET]
-               cmpeq   \irqnr, \tmp
-               ldreq   \base, =OMAP1_IO_ADDRESS(OMAP_IH2_BASE)
-               ldreq   \irqnr, [\base, #IRQ_SIR_IRQ_REG_OFFSET]
-               addeqs  \irqnr, \irqnr, #32
-1510:
-               .endm
-
index 729992d7d26a871cf237d08378d13ff383f102c2..9050085271bc794ef9639da55fbff3c39db3495d 100644 (file)
  * NOTE: See also the OMAP-1510 and 1610 specific IRQ numbers below
  *
  */
-#define INT_CAMERA             1
-#define INT_FIQ                        3
-#define INT_RTDX               6
-#define INT_DSP_MMU_ABORT      7
-#define INT_HOST               8
-#define INT_ABORT              9
-#define INT_BRIDGE_PRIV                13
-#define INT_GPIO_BANK1         14
-#define INT_UART3              15
-#define INT_TIMER3             16
-#define INT_DMA_CH0_6          19
-#define INT_DMA_CH1_7          20
-#define INT_DMA_CH2_8          21
-#define INT_DMA_CH3            22
-#define INT_DMA_CH4            23
-#define INT_DMA_CH5            24
-#define INT_TIMER1             26
-#define INT_WD_TIMER           27
-#define INT_BRIDGE_PUB         28
-#define INT_TIMER2             30
-#define INT_LCD_CTRL           31
+#define INT_CAMERA             (NR_IRQS_LEGACY + 1)
+#define INT_FIQ                        (NR_IRQS_LEGACY + 3)
+#define INT_RTDX               (NR_IRQS_LEGACY + 6)
+#define INT_DSP_MMU_ABORT      (NR_IRQS_LEGACY + 7)
+#define INT_HOST               (NR_IRQS_LEGACY + 8)
+#define INT_ABORT              (NR_IRQS_LEGACY + 9)
+#define INT_BRIDGE_PRIV                (NR_IRQS_LEGACY + 13)
+#define INT_GPIO_BANK1         (NR_IRQS_LEGACY + 14)
+#define INT_UART3              (NR_IRQS_LEGACY + 15)
+#define INT_TIMER3             (NR_IRQS_LEGACY + 16)
+#define INT_DMA_CH0_6          (NR_IRQS_LEGACY + 19)
+#define INT_DMA_CH1_7          (NR_IRQS_LEGACY + 20)
+#define INT_DMA_CH2_8          (NR_IRQS_LEGACY + 21)
+#define INT_DMA_CH3            (NR_IRQS_LEGACY + 22)
+#define INT_DMA_CH4            (NR_IRQS_LEGACY + 23)
+#define INT_DMA_CH5            (NR_IRQS_LEGACY + 24)
+#define INT_TIMER1             (NR_IRQS_LEGACY + 26)
+#define INT_WD_TIMER           (NR_IRQS_LEGACY + 27)
+#define INT_BRIDGE_PUB         (NR_IRQS_LEGACY + 28)
+#define INT_TIMER2             (NR_IRQS_LEGACY + 30)
+#define INT_LCD_CTRL           (NR_IRQS_LEGACY + 31)
 
 /*
  * OMAP-1510 specific IRQ numbers for interrupt handler 1
  */
-#define INT_1510_IH2_IRQ       0
-#define INT_1510_RES2          2
-#define INT_1510_SPI_TX                4
-#define INT_1510_SPI_RX                5
-#define INT_1510_DSP_MAILBOX1  10
-#define INT_1510_DSP_MAILBOX2  11
-#define INT_1510_RES12         12
-#define INT_1510_LB_MMU                17
-#define INT_1510_RES18         18
-#define INT_1510_LOCAL_BUS     29
+#define INT_1510_IH2_IRQ       (NR_IRQS_LEGACY + 0)
+#define INT_1510_RES2          (NR_IRQS_LEGACY + 2)
+#define INT_1510_SPI_TX                (NR_IRQS_LEGACY + 4)
+#define INT_1510_SPI_RX                (NR_IRQS_LEGACY + 5)
+#define INT_1510_DSP_MAILBOX1  (NR_IRQS_LEGACY + 10)
+#define INT_1510_DSP_MAILBOX2  (NR_IRQS_LEGACY + 11)
+#define INT_1510_RES12         (NR_IRQS_LEGACY + 12)
+#define INT_1510_LB_MMU                (NR_IRQS_LEGACY + 17)
+#define INT_1510_RES18         (NR_IRQS_LEGACY + 18)
+#define INT_1510_LOCAL_BUS     (NR_IRQS_LEGACY + 29)
 
 /*
  * OMAP-1610 specific IRQ numbers for interrupt handler 1
  */
 #define INT_1610_IH2_IRQ       INT_1510_IH2_IRQ
-#define INT_1610_IH2_FIQ       2
-#define INT_1610_McBSP2_TX     4
-#define INT_1610_McBSP2_RX     5
-#define INT_1610_DSP_MAILBOX1  10
-#define INT_1610_DSP_MAILBOX2  11
-#define INT_1610_LCD_LINE      12
-#define INT_1610_GPTIMER1      17
-#define INT_1610_GPTIMER2      18
-#define INT_1610_SSR_FIFO_0    29
+#define INT_1610_IH2_FIQ       (NR_IRQS_LEGACY + 2)
+#define INT_1610_McBSP2_TX     (NR_IRQS_LEGACY + 4)
+#define INT_1610_McBSP2_RX     (NR_IRQS_LEGACY + 5)
+#define INT_1610_DSP_MAILBOX1  (NR_IRQS_LEGACY + 10)
+#define INT_1610_DSP_MAILBOX2  (NR_IRQS_LEGACY + 11)
+#define INT_1610_LCD_LINE      (NR_IRQS_LEGACY + 12)
+#define INT_1610_GPTIMER1      (NR_IRQS_LEGACY + 17)
+#define INT_1610_GPTIMER2      (NR_IRQS_LEGACY + 18)
+#define INT_1610_SSR_FIFO_0    (NR_IRQS_LEGACY + 29)
 
 /*
  * OMAP-7xx specific IRQ numbers for interrupt handler 1
  */
-#define INT_7XX_IH2_FIQ                0
-#define INT_7XX_IH2_IRQ                1
-#define INT_7XX_USB_NON_ISO    2
-#define INT_7XX_USB_ISO                3
-#define INT_7XX_ICR            4
-#define INT_7XX_EAC            5
-#define INT_7XX_GPIO_BANK1     6
-#define INT_7XX_GPIO_BANK2     7
-#define INT_7XX_GPIO_BANK3     8
-#define INT_7XX_McBSP2TX       10
-#define INT_7XX_McBSP2RX       11
-#define INT_7XX_McBSP2RX_OVF   12
-#define INT_7XX_LCD_LINE       14
-#define INT_7XX_GSM_PROTECT    15
-#define INT_7XX_TIMER3         16
-#define INT_7XX_GPIO_BANK5     17
-#define INT_7XX_GPIO_BANK6     18
-#define INT_7XX_SPGIO_WR       29
+#define INT_7XX_IH2_FIQ                (NR_IRQS_LEGACY + 0)
+#define INT_7XX_IH2_IRQ                (NR_IRQS_LEGACY + 1)
+#define INT_7XX_USB_NON_ISO    (NR_IRQS_LEGACY + 2)
+#define INT_7XX_USB_ISO                (NR_IRQS_LEGACY + 3)
+#define INT_7XX_ICR            (NR_IRQS_LEGACY + 4)
+#define INT_7XX_EAC            (NR_IRQS_LEGACY + 5)
+#define INT_7XX_GPIO_BANK1     (NR_IRQS_LEGACY + 6)
+#define INT_7XX_GPIO_BANK2     (NR_IRQS_LEGACY + 7)
+#define INT_7XX_GPIO_BANK3     (NR_IRQS_LEGACY + 8)
+#define INT_7XX_McBSP2TX       (NR_IRQS_LEGACY + 10)
+#define INT_7XX_McBSP2RX       (NR_IRQS_LEGACY + 11)
+#define INT_7XX_McBSP2RX_OVF   (NR_IRQS_LEGACY + 12)
+#define INT_7XX_LCD_LINE       (NR_IRQS_LEGACY + 14)
+#define INT_7XX_GSM_PROTECT    (NR_IRQS_LEGACY + 15)
+#define INT_7XX_TIMER3         (NR_IRQS_LEGACY + 16)
+#define INT_7XX_GPIO_BANK5     (NR_IRQS_LEGACY + 17)
+#define INT_7XX_GPIO_BANK6     (NR_IRQS_LEGACY + 18)
+#define INT_7XX_SPGIO_WR       (NR_IRQS_LEGACY + 29)
 
 /*
  * IRQ numbers for interrupt handler 2
  *
  * NOTE: See also the OMAP-1510 and 1610 specific IRQ numbers below
  */
-#define IH2_BASE               32
+#define IH2_BASE               (NR_IRQS_LEGACY + 32)
 
 #define INT_KEYBOARD           (1 + IH2_BASE)
 #define INT_uWireTX            (2 + IH2_BASE)
 #endif
 #define OMAP_FPGA_IRQ_END      (OMAP_FPGA_IRQ_BASE + OMAP_FPGA_NR_IRQS)
 
-#define NR_IRQS                        OMAP_FPGA_IRQ_END
-
-#define OMAP_IRQ_BIT(irq)      (1 << ((irq) % 32))
-
-#include <mach/hardware.h>
+#define OMAP_IRQ_BIT(irq)      (1 << ((irq - NR_IRQS_LEGACY) % 32))
 
 #ifdef CONFIG_FIQ
 #define FIQ_START              1024
index 058a4f7d44c59fc9535ed6e79f353007238f012f..d43ff0f1cbf8d339525415d65e249abff3e2fc61 100644 (file)
@@ -5,6 +5,9 @@
 #ifndef __ASM_ARCH_MEMORY_H
 #define __ASM_ARCH_MEMORY_H
 
+/* REVISIT: omap1 legacy drivers still rely on this */
+#include <mach/soc.h>
+
 /*
  * Bus address is physical address, except for OMAP-1510 Local Bus.
  * OMAP-1510 bus address is translated into a Local Bus address if the
@@ -14,7 +17,6 @@
  * because of the strncmp().
  */
 #if defined(CONFIG_ARCH_OMAP15XX) && !defined(__ASSEMBLER__)
-#include <mach/soc.h>
 
 /*
  * OMAP-1510 Local Bus address offset
index 2ce6a2db470b43006e3e961b5b3fd18f12dd9c72..4700e384c3d9cf690c6191fad83ca62a50afc1b8 100644 (file)
  */
 #define OMAP_UART_INFO_OFS     0x3ffc
 
-/* OMAP1 serial ports */
-#define OMAP1_UART1_BASE       0xfffb0000
-#define OMAP1_UART2_BASE       0xfffb0800
-#define OMAP1_UART3_BASE       0xfffb9800
-
 #define OMAP_PORT_SHIFT                2
 #define OMAP7XX_PORT_SHIFT     0
 
index 612bd1cc257c147255eb9baefb86ff6d0a6a2497..3d935570eb3b45a84da004ce1ad61e719e3dff1f 100644 (file)
 #ifndef __ASM_ARCH_OMAP_CPU_H
 #define __ASM_ARCH_OMAP_CPU_H
 
+#include <asm/irq.h>
+#include <mach/hardware.h>
+#include <mach/irqs.h>
+
 #ifndef __ASSEMBLY__
 
 #include <linux/bitops.h>
index a8a533df24e102a12a01f6b0897209b014a0bc60..f4d346fda9da8c44bc201f328df4293420168fab 100644 (file)
@@ -43,6 +43,7 @@
 #include <linux/io.h>
 
 #include <asm/irq.h>
+#include <asm/exception.h>
 #include <asm/mach/irq.h>
 
 #include "soc.h"
 
 struct omap_irq_bank {
        unsigned long base_reg;
+       void __iomem *va;
        unsigned long trigger_map;
        unsigned long wake_enable;
 };
 
-u32 omap_irq_flags;
+static u32 omap_l2_irq;
 static unsigned int irq_bank_count;
 static struct omap_irq_bank *irq_banks;
+static struct irq_domain *domain;
 
-static inline void irq_bank_writel(unsigned long value, int bank, int offset)
-{
-       omap_writel(value, irq_banks[bank].base_reg + offset);
-}
-
-static void omap_ack_irq(struct irq_data *d)
+static inline unsigned int irq_bank_readl(int bank, int offset)
 {
-       if (d->irq > 31)
-               omap_writel(0x1, OMAP_IH2_BASE + IRQ_CONTROL_REG_OFFSET);
-
-       omap_writel(0x1, OMAP_IH1_BASE + IRQ_CONTROL_REG_OFFSET);
+       return readl_relaxed(irq_banks[bank].va + offset);
 }
-
-static void omap_mask_irq(struct irq_data *d)
+static inline void irq_bank_writel(unsigned long value, int bank, int offset)
 {
-       int bank = IRQ_BANK(d->irq);
-       u32 l;
-
-       l = omap_readl(irq_banks[bank].base_reg + IRQ_MIR_REG_OFFSET);
-       l |= 1 << IRQ_BIT(d->irq);
-       omap_writel(l, irq_banks[bank].base_reg + IRQ_MIR_REG_OFFSET);
+       writel_relaxed(value, irq_banks[bank].va + offset);
 }
 
-static void omap_unmask_irq(struct irq_data *d)
+static void omap_ack_irq(int irq)
 {
-       int bank = IRQ_BANK(d->irq);
-       u32 l;
+       if (irq > 31)
+               writel_relaxed(0x1, irq_banks[1].va + IRQ_CONTROL_REG_OFFSET);
 
-       l = omap_readl(irq_banks[bank].base_reg + IRQ_MIR_REG_OFFSET);
-       l &= ~(1 << IRQ_BIT(d->irq));
-       omap_writel(l, irq_banks[bank].base_reg + IRQ_MIR_REG_OFFSET);
+       writel_relaxed(0x1, irq_banks[0].va + IRQ_CONTROL_REG_OFFSET);
 }
 
 static void omap_mask_ack_irq(struct irq_data *d)
 {
-       omap_mask_irq(d);
-       omap_ack_irq(d);
-}
-
-static int omap_wake_irq(struct irq_data *d, unsigned int enable)
-{
-       int bank = IRQ_BANK(d->irq);
-
-       if (enable)
-               irq_banks[bank].wake_enable |= IRQ_BIT(d->irq);
-       else
-               irq_banks[bank].wake_enable &= ~IRQ_BIT(d->irq);
+       struct irq_chip_type *ct = irq_data_get_chip_type(d);
 
-       return 0;
+       ct->chip.irq_mask(d);
+       omap_ack_irq(d->irq);
 }
 
-
 /*
  * Allows tuning the IRQ type and priority
  *
@@ -165,46 +141,105 @@ static struct omap_irq_bank omap1610_irq_banks[] = {
 };
 #endif
 
-static struct irq_chip omap_irq_chip = {
-       .name           = "MPU",
-       .irq_ack        = omap_mask_ack_irq,
-       .irq_mask       = omap_mask_irq,
-       .irq_unmask     = omap_unmask_irq,
-       .irq_set_wake   = omap_wake_irq,
-};
+asmlinkage void __exception_irq_entry omap1_handle_irq(struct pt_regs *regs)
+{
+       void __iomem *l1 = irq_banks[0].va;
+       void __iomem *l2 = irq_banks[1].va;
+       u32 irqnr;
+
+       do {
+               irqnr = readl_relaxed(l1 + IRQ_ITR_REG_OFFSET);
+               irqnr &= ~(readl_relaxed(l1 + IRQ_MIR_REG_OFFSET) & 0xffffffff);
+               if (!irqnr)
+                       break;
+
+               irqnr = readl_relaxed(l1 + IRQ_SIR_FIQ_REG_OFFSET);
+               if (irqnr)
+                       goto irq;
+
+               irqnr = readl_relaxed(l1 + IRQ_SIR_IRQ_REG_OFFSET);
+               if (irqnr == omap_l2_irq) {
+                       irqnr = readl_relaxed(l2 + IRQ_SIR_IRQ_REG_OFFSET);
+                       if (irqnr)
+                               irqnr += 32;
+               }
+irq:
+               if (irqnr)
+                       handle_domain_irq(domain, irqnr, regs);
+               else
+                       break;
+       } while (irqnr);
+}
+
+static __init void
+omap_alloc_gc(void __iomem *base, unsigned int irq_start, unsigned int num)
+{
+       struct irq_chip_generic *gc;
+       struct irq_chip_type *ct;
+
+       gc = irq_alloc_generic_chip("MPU", 1, irq_start, base,
+                                   handle_level_irq);
+       ct = gc->chip_types;
+       ct->chip.irq_ack = omap_mask_ack_irq;
+       ct->chip.irq_mask = irq_gc_mask_set_bit;
+       ct->chip.irq_unmask = irq_gc_mask_clr_bit;
+       ct->chip.irq_set_wake = irq_gc_set_wake;
+       ct->regs.mask = IRQ_MIR_REG_OFFSET;
+       irq_setup_generic_chip(gc, IRQ_MSK(num), IRQ_GC_INIT_MASK_CACHE,
+                              IRQ_NOREQUEST | IRQ_NOPROBE, 0);
+}
 
 void __init omap1_init_irq(void)
 {
-       int i, j;
+       struct irq_chip_type *ct;
+       struct irq_data *d = NULL;
+       int i, j, irq_base;
+       unsigned long nr_irqs;
 
 #if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850)
        if (cpu_is_omap7xx()) {
-               omap_irq_flags = INT_7XX_IH2_IRQ;
                irq_banks = omap7xx_irq_banks;
                irq_bank_count = ARRAY_SIZE(omap7xx_irq_banks);
        }
 #endif
 #ifdef CONFIG_ARCH_OMAP15XX
        if (cpu_is_omap1510()) {
-               omap_irq_flags = INT_1510_IH2_IRQ;
                irq_banks = omap1510_irq_banks;
                irq_bank_count = ARRAY_SIZE(omap1510_irq_banks);
        }
        if (cpu_is_omap310()) {
-               omap_irq_flags = INT_1510_IH2_IRQ;
                irq_banks = omap310_irq_banks;
                irq_bank_count = ARRAY_SIZE(omap310_irq_banks);
        }
 #endif
 #if defined(CONFIG_ARCH_OMAP16XX)
        if (cpu_is_omap16xx()) {
-               omap_irq_flags = INT_1510_IH2_IRQ;
                irq_banks = omap1610_irq_banks;
                irq_bank_count = ARRAY_SIZE(omap1610_irq_banks);
        }
 #endif
-       printk("Total of %i interrupts in %i interrupt banks\n",
-              irq_bank_count * 32, irq_bank_count);
+
+       for (i = 0; i < irq_bank_count; i++) {
+               irq_banks[i].va = ioremap(irq_banks[i].base_reg, 0xff);
+               if (WARN_ON(!irq_banks[i].va))
+                       return;
+       }
+
+       nr_irqs = irq_bank_count * 32;
+
+       irq_base = irq_alloc_descs(-1, 0, nr_irqs, 0);
+       if (irq_base < 0) {
+               pr_warn("Couldn't allocate IRQ numbers\n");
+               irq_base = 0;
+       }
+       omap_l2_irq = cpu_is_omap7xx() ? irq_base + 1 : irq_base;
+       omap_l2_irq -= NR_IRQS_LEGACY;
+
+       domain = irq_domain_add_legacy(NULL, nr_irqs, irq_base, 0,
+                                      &irq_domain_simple_ops, NULL);
+
+       pr_info("Total of %lu interrupts in %i interrupt banks\n",
+               nr_irqs, irq_bank_count);
 
        /* Mask and clear all interrupts */
        for (i = 0; i < irq_bank_count; i++) {
@@ -227,19 +262,15 @@ void __init omap1_init_irq(void)
 
                        irq_trigger = irq_banks[i].trigger_map >> IRQ_BIT(j);
                        omap_irq_set_cfg(j, 0, 0, irq_trigger);
-
-                       irq_set_chip_and_handler(j, &omap_irq_chip,
-                                                handle_level_irq);
                        set_irq_flags(j, IRQF_VALID);
                }
+               omap_alloc_gc(irq_banks[i].va, irq_base + i * 32, 32);
        }
 
        /* Unmask level 2 handler */
-
-       if (cpu_is_omap7xx())
-               omap_unmask_irq(irq_get_irq_data(INT_7XX_IH2_IRQ));
-       else if (cpu_is_omap15xx())
-               omap_unmask_irq(irq_get_irq_data(INT_1510_IH2_IRQ));
-       else if (cpu_is_omap16xx())
-               omap_unmask_irq(irq_get_irq_data(INT_1610_IH2_IRQ));
+       d = irq_get_irq_data(irq_find_mapping(domain, omap_l2_irq));
+       if (d) {
+               ct = irq_data_get_chip_type(d);
+               ct->chip.irq_unmask(d);
+       }
 }
index 667ce5027f6332cffd81a47435cbce6945f1b2b9..599490a596a776e11aa2127298153b2455d0cd55 100644 (file)
@@ -36,7 +36,7 @@
 static struct omap_mux_cfg arch_mux_cfg;
 
 #if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850)
-static struct pin_config __initdata_or_module omap7xx_pins[] = {
+static struct pin_config omap7xx_pins[] = {
 MUX_CFG_7XX("E2_7XX_KBR0",        12,   21,    0,   20,   1, 0)
 MUX_CFG_7XX("J7_7XX_KBR1",        12,   25,    0,   24,   1, 0)
 MUX_CFG_7XX("E1_7XX_KBR2",        12,   29,    0,   28,   1, 0)
@@ -82,7 +82,7 @@ MUX_CFG_7XX("UART_7XX_2",          8,    1,    6,    0,   0, 0)
 #endif /* CONFIG_ARCH_OMAP730 || CONFIG_ARCH_OMAP850 */
 
 #if defined(CONFIG_ARCH_OMAP15XX) || defined(CONFIG_ARCH_OMAP16XX)
-static struct pin_config __initdata_or_module omap1xxx_pins[] = {
+static struct pin_config omap1xxx_pins[] = {
 /*
  *      description            mux  mode   mux  pull pull  pull  pu_pd  pu  dbg
  *                             reg  offset mode reg  bit   ena   reg
@@ -343,7 +343,7 @@ MUX_CFG("Y14_1610_CCP_DATAM",        9,   21,    6,   2,   3,   1,    2,     0,  0)
 #define OMAP1XXX_PINS_SZ       0
 #endif /* CONFIG_ARCH_OMAP15XX || CONFIG_ARCH_OMAP16XX */
 
-static int __init_or_module omap1_cfg_reg(const struct pin_config *cfg)
+static int omap1_cfg_reg(const struct pin_config *cfg)
 {
        static DEFINE_SPINLOCK(mux_spin_lock);
        unsigned long flags;
@@ -469,7 +469,7 @@ int __init omap_mux_register(struct omap_mux_cfg *arch_mux_cfg)
 /*
  * Sets the Omap MUX and PULL_DWN registers based on the table
  */
-int __init_or_module omap_cfg_reg(const unsigned long index)
+int omap_cfg_reg(const unsigned long index)
 {
        struct pin_config *reg;
 
index dd94567c36289c16303a267a86cde69cfba82e75..ee5460b8ec2ee6e93c06ab60c10bac27c03774c3 100644 (file)
@@ -62,6 +62,7 @@
 #include "iomap.h"
 #include "clock.h"
 #include "pm.h"
+#include "soc.h"
 #include "sram.h"
 
 static unsigned int arm_sleep_save[ARM_SLEEP_SAVE_SIZE];
index d1ac08016f0bbaa99d9c6a99f38b4d38869b9675..a65bd0c4429607b3c7f2090ab876aed062348311 100644 (file)
@@ -25,6 +25,7 @@
 #include <mach/mux.h>
 
 #include "pm.h"
+#include "soc.h"
 
 static struct clk * uart1_ck;
 static struct clk * uart2_ck;
index bde7a35e5000227990f9fdbdb9b04e9449e0080e..06c5ba7574a534b73531c000d6cd0948704206c3 100644 (file)
 #include <linux/platform_device.h>
 #include <linux/platform_data/dmtimer-omap.h>
 
-#include <mach/irqs.h>
-
 #include <plat/dmtimer.h>
 
+#include "soc.h"
+
 #define OMAP1610_GPTIMER1_BASE         0xfffb1400
 #define OMAP1610_GPTIMER2_BASE         0xfffb1c00
 #define OMAP1610_GPTIMER3_BASE         0xfffb2400
index 6468f15f060ca78f25b8664f5d95894b45268c03..ecc04ff13e9595213aa57178bb7b0c40183c77c9 100644 (file)
@@ -171,12 +171,6 @@ config MACH_OMAP2_TUSB6010
        depends on ARCH_OMAP2 && SOC_OMAP2420
        default y if MACH_NOKIA_N8X0
 
-config MACH_OMAP3_BEAGLE
-       bool "OMAP3 BEAGLE board"
-       depends on ARCH_OMAP3
-       default y
-       select OMAP_PACKAGE_CBB
-
 config MACH_OMAP_LDP
        bool "OMAP3 LDP board"
        depends on ARCH_OMAP3
@@ -203,12 +197,6 @@ config MACH_OMAP3_TORPEDO
         for full description please see the products webpage at
         http://www.logicpd.com/products/development-kits/zoom-omap35x-torpedo-development-kit
 
-config MACH_OVERO
-       bool "Gumstix Overo board"
-       depends on ARCH_OMAP3
-       default y
-       select OMAP_PACKAGE_CBB
-
 config MACH_OMAP3517EVM
        bool "OMAP3517/ AM3517 EVM board"
        depends on ARCH_OMAP3
@@ -240,16 +228,6 @@ config MACH_NOKIA_RX51
        default y
        select OMAP_PACKAGE_CBB
 
-config MACH_CM_T35
-       bool "CompuLab CM-T35/CM-T3730 modules"
-       depends on ARCH_OMAP3
-       default y
-       select MACH_CM_T3730
-       select OMAP_PACKAGE_CUS
-
-config MACH_CM_T3730
-       bool
-
 config OMAP3_SDRC_AC_TIMING
        bool "Enable SDRC AC timing register changes"
        depends on ARCH_OMAP3
index ec002bd4af771508e712bf7b93ec373d18323620..f1a68c63dc9933c8be7c2bcd2f30fb1973db5f65 100644 (file)
@@ -242,17 +242,14 @@ obj-$(CONFIG_SOC_OMAP2420)                += msdi.o
 
 # Specific board support
 obj-$(CONFIG_MACH_OMAP_GENERIC)                += board-generic.o pdata-quirks.o
-obj-$(CONFIG_MACH_OMAP3_BEAGLE)                += board-omap3beagle.o
 obj-$(CONFIG_MACH_OMAP_LDP)            += board-ldp.o
 obj-$(CONFIG_MACH_OMAP3530_LV_SOM)      += board-omap3logic.o
 obj-$(CONFIG_MACH_OMAP3_TORPEDO)        += board-omap3logic.o
-obj-$(CONFIG_MACH_OVERO)               += board-overo.o
 obj-$(CONFIG_MACH_OMAP3_PANDORA)       += board-omap3pandora.o
 obj-$(CONFIG_MACH_NOKIA_N8X0)          += board-n8x0.o
 obj-$(CONFIG_MACH_NOKIA_RX51)          += board-rx51.o sdram-nokia.o
 obj-$(CONFIG_MACH_NOKIA_RX51)          += board-rx51-peripherals.o
 obj-$(CONFIG_MACH_NOKIA_RX51)          += board-rx51-video.o
-obj-$(CONFIG_MACH_CM_T35)              += board-cm-t35.o
 
 # Platform specific device init code
 
diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c
deleted file mode 100644 (file)
index b5dfbc1..0000000
+++ /dev/null
@@ -1,769 +0,0 @@
-/*
- * CompuLab CM-T35/CM-T3730 modules support
- *
- * Copyright (C) 2009-2011 CompuLab, Ltd.
- * Authors: Mike Rapoport <mike@compulab.co.il>
- *         Igor Grinberg <grinberg@compulab.co.il>
- *
- * 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/clk-provider.h>
-#include <linux/clkdev.h>
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/input.h>
-#include <linux/input/matrix_keypad.h>
-#include <linux/delay.h>
-#include <linux/gpio.h>
-#include <linux/omap-gpmc.h>
-#include <linux/platform_data/gpio-omap.h>
-
-#include <linux/platform_data/at24.h>
-#include <linux/i2c/twl.h>
-#include <linux/regulator/fixed.h>
-#include <linux/regulator/machine.h>
-#include <linux/mmc/host.h>
-#include <linux/usb/phy.h>
-
-#include <linux/spi/spi.h>
-#include <linux/spi/tdo24m.h>
-
-#include <asm/mach-types.h>
-#include <asm/mach/arch.h>
-#include <asm/mach/map.h>
-
-#include <linux/platform_data/mtd-nand-omap2.h>
-#include <video/omapdss.h>
-#include <video/omap-panel-data.h>
-#include <linux/platform_data/spi-omap2-mcspi.h>
-
-#include "common.h"
-#include "mux.h"
-#include "sdram-micron-mt46h32m32lf-6.h"
-#include "hsmmc.h"
-#include "common-board-devices.h"
-
-#define CM_T35_GPIO_PENDOWN            57
-#define SB_T35_USB_HUB_RESET_GPIO      167
-
-#define CM_T35_SMSC911X_CS     5
-#define CM_T35_SMSC911X_GPIO   163
-#define SB_T35_SMSC911X_CS     4
-#define SB_T35_SMSC911X_GPIO   65
-
-#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
-#include <linux/smsc911x.h>
-#include "gpmc-smsc911x.h"
-
-static struct omap_smsc911x_platform_data cm_t35_smsc911x_cfg = {
-       .id             = 0,
-       .cs             = CM_T35_SMSC911X_CS,
-       .gpio_irq       = CM_T35_SMSC911X_GPIO,
-       .gpio_reset     = -EINVAL,
-       .flags          = SMSC911X_USE_32BIT | SMSC911X_SAVE_MAC_ADDRESS,
-};
-
-static struct omap_smsc911x_platform_data sb_t35_smsc911x_cfg = {
-       .id             = 1,
-       .cs             = SB_T35_SMSC911X_CS,
-       .gpio_irq       = SB_T35_SMSC911X_GPIO,
-       .gpio_reset     = -EINVAL,
-       .flags          = SMSC911X_USE_32BIT | SMSC911X_SAVE_MAC_ADDRESS,
-};
-
-static struct regulator_consumer_supply cm_t35_smsc911x_supplies[] = {
-       REGULATOR_SUPPLY("vddvario", "smsc911x.0"),
-       REGULATOR_SUPPLY("vdd33a", "smsc911x.0"),
-};
-
-static struct regulator_consumer_supply sb_t35_smsc911x_supplies[] = {
-       REGULATOR_SUPPLY("vddvario", "smsc911x.1"),
-       REGULATOR_SUPPLY("vdd33a", "smsc911x.1"),
-};
-
-static void __init cm_t35_init_ethernet(void)
-{
-       regulator_register_fixed(0, cm_t35_smsc911x_supplies,
-                                ARRAY_SIZE(cm_t35_smsc911x_supplies));
-       regulator_register_fixed(1, sb_t35_smsc911x_supplies,
-                                ARRAY_SIZE(sb_t35_smsc911x_supplies));
-
-       gpmc_smsc911x_init(&cm_t35_smsc911x_cfg);
-       gpmc_smsc911x_init(&sb_t35_smsc911x_cfg);
-}
-#else
-static inline void __init cm_t35_init_ethernet(void) { return; }
-#endif
-
-#if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE)
-#include <linux/leds.h>
-
-static struct gpio_led cm_t35_leds[] = {
-       [0] = {
-               .gpio                   = 186,
-               .name                   = "cm-t35:green",
-               .default_trigger        = "heartbeat",
-               .active_low             = 0,
-       },
-};
-
-static struct gpio_led_platform_data cm_t35_led_pdata = {
-       .num_leds       = ARRAY_SIZE(cm_t35_leds),
-       .leds           = cm_t35_leds,
-};
-
-static struct platform_device cm_t35_led_device = {
-       .name           = "leds-gpio",
-       .id             = -1,
-       .dev            = {
-               .platform_data  = &cm_t35_led_pdata,
-       },
-};
-
-static void __init cm_t35_init_led(void)
-{
-       platform_device_register(&cm_t35_led_device);
-}
-#else
-static inline void cm_t35_init_led(void) {}
-#endif
-
-#if defined(CONFIG_MTD_NAND_OMAP2) || defined(CONFIG_MTD_NAND_OMAP2_MODULE)
-#include <linux/mtd/mtd.h>
-#include <linux/mtd/nand.h>
-#include <linux/mtd/partitions.h>
-
-static struct mtd_partition cm_t35_nand_partitions[] = {
-       {
-               .name           = "xloader",
-               .offset         = 0,                    /* Offset = 0x00000 */
-               .size           = 4 * NAND_BLOCK_SIZE,
-               .mask_flags     = MTD_WRITEABLE
-       },
-       {
-               .name           = "uboot",
-               .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x80000 */
-               .size           = 15 * NAND_BLOCK_SIZE,
-       },
-       {
-               .name           = "uboot environment",
-               .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x260000 */
-               .size           = 2 * NAND_BLOCK_SIZE,
-       },
-       {
-               .name           = "linux",
-               .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x2A0000 */
-               .size           = 32 * NAND_BLOCK_SIZE,
-       },
-       {
-               .name           = "rootfs",
-               .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x6A0000 */
-               .size           = MTDPART_SIZ_FULL,
-       },
-};
-
-static struct omap_nand_platform_data cm_t35_nand_data = {
-       .parts                  = cm_t35_nand_partitions,
-       .nr_parts               = ARRAY_SIZE(cm_t35_nand_partitions),
-       .cs                     = 0,
-};
-
-static void __init cm_t35_init_nand(void)
-{
-       if (gpmc_nand_init(&cm_t35_nand_data, NULL) < 0)
-               pr_err("CM-T35: Unable to register NAND device\n");
-}
-#else
-static inline void cm_t35_init_nand(void) {}
-#endif
-
-#define CM_T35_LCD_EN_GPIO 157
-#define CM_T35_LCD_BL_GPIO 58
-#define CM_T35_DVI_EN_GPIO 54
-
-static const struct display_timing cm_t35_lcd_videomode = {
-       .pixelclock     = { 0, 26000000, 0 },
-
-       .hactive = { 0, 480, 0 },
-       .hfront_porch = { 0, 104, 0 },
-       .hback_porch = { 0, 8, 0 },
-       .hsync_len = { 0, 8, 0 },
-
-       .vactive = { 0, 640, 0 },
-       .vfront_porch = { 0, 4, 0 },
-       .vback_porch = { 0, 2, 0 },
-       .vsync_len = { 0, 2, 0 },
-
-       .flags = DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW |
-               DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_PIXDATA_NEGEDGE,
-};
-
-static struct panel_dpi_platform_data cm_t35_lcd_pdata = {
-       .name                   = "lcd",
-       .source                 = "dpi.0",
-
-       .data_lines             = 18,
-
-       .display_timing         = &cm_t35_lcd_videomode,
-
-       .enable_gpio            = -1,
-       .backlight_gpio         = CM_T35_LCD_BL_GPIO,
-};
-
-static struct platform_device cm_t35_lcd_device = {
-       .name                   = "panel-dpi",
-       .id                     = 0,
-       .dev.platform_data      = &cm_t35_lcd_pdata,
-};
-
-static struct connector_dvi_platform_data cm_t35_dvi_connector_pdata = {
-       .name                   = "dvi",
-       .source                 = "tfp410.0",
-       .i2c_bus_num            = -1,
-};
-
-static struct platform_device cm_t35_dvi_connector_device = {
-       .name                   = "connector-dvi",
-       .id                     = 0,
-       .dev.platform_data      = &cm_t35_dvi_connector_pdata,
-};
-
-static struct encoder_tfp410_platform_data cm_t35_tfp410_pdata = {
-       .name                   = "tfp410.0",
-       .source                 = "dpi.0",
-       .data_lines             = 24,
-       .power_down_gpio        = CM_T35_DVI_EN_GPIO,
-};
-
-static struct platform_device cm_t35_tfp410_device = {
-       .name                   = "tfp410",
-       .id                     = 0,
-       .dev.platform_data      = &cm_t35_tfp410_pdata,
-};
-
-static struct connector_atv_platform_data cm_t35_tv_pdata = {
-       .name = "tv",
-       .source = "venc.0",
-       .connector_type = OMAP_DSS_VENC_TYPE_SVIDEO,
-       .invert_polarity = false,
-};
-
-static struct platform_device cm_t35_tv_connector_device = {
-       .name                   = "connector-analog-tv",
-       .id                     = 0,
-       .dev.platform_data      = &cm_t35_tv_pdata,
-};
-
-static struct omap_dss_board_info cm_t35_dss_data = {
-       .default_display_name = "dvi",
-};
-
-static struct omap2_mcspi_device_config tdo24m_mcspi_config = {
-       .turbo_mode     = 0,
-};
-
-static struct tdo24m_platform_data tdo24m_config = {
-       .model = TDO35S,
-};
-
-static struct spi_board_info cm_t35_lcd_spi_board_info[] __initdata = {
-       {
-               .modalias               = "tdo24m",
-               .bus_num                = 4,
-               .chip_select            = 0,
-               .max_speed_hz           = 1000000,
-               .controller_data        = &tdo24m_mcspi_config,
-               .platform_data          = &tdo24m_config,
-       },
-};
-
-static void __init cm_t35_init_display(void)
-{
-       int err;
-
-       spi_register_board_info(cm_t35_lcd_spi_board_info,
-                               ARRAY_SIZE(cm_t35_lcd_spi_board_info));
-
-
-       err = gpio_request_one(CM_T35_LCD_EN_GPIO, GPIOF_OUT_INIT_LOW,
-                       "lcd bl enable");
-       if (err) {
-               pr_err("CM-T35: failed to request LCD EN GPIO\n");
-               return;
-       }
-
-       msleep(50);
-       gpio_set_value(CM_T35_LCD_EN_GPIO, 1);
-
-       err = omap_display_init(&cm_t35_dss_data);
-       if (err) {
-               pr_err("CM-T35: failed to register DSS device\n");
-               gpio_free(CM_T35_LCD_EN_GPIO);
-       }
-
-       platform_device_register(&cm_t35_tfp410_device);
-       platform_device_register(&cm_t35_dvi_connector_device);
-       platform_device_register(&cm_t35_lcd_device);
-       platform_device_register(&cm_t35_tv_connector_device);
-}
-
-static struct regulator_consumer_supply cm_t35_vmmc1_supply[] = {
-       REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"),
-};
-
-static struct regulator_consumer_supply cm_t35_vsim_supply[] = {
-       REGULATOR_SUPPLY("vmmc_aux", "omap_hsmmc.0"),
-};
-
-static struct regulator_consumer_supply cm_t35_vio_supplies[] = {
-       REGULATOR_SUPPLY("vcc", "spi1.0"),
-       REGULATOR_SUPPLY("vdds_dsi", "omapdss"),
-       REGULATOR_SUPPLY("vdds_dsi", "omapdss_dpi.0"),
-       REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi.0"),
-};
-
-/* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */
-static struct regulator_init_data cm_t35_vmmc1 = {
-       .constraints = {
-               .min_uV                 = 1850000,
-               .max_uV                 = 3150000,
-               .valid_modes_mask       = REGULATOR_MODE_NORMAL
-                                       | REGULATOR_MODE_STANDBY,
-               .valid_ops_mask         = REGULATOR_CHANGE_VOLTAGE
-                                       | REGULATOR_CHANGE_MODE
-                                       | REGULATOR_CHANGE_STATUS,
-       },
-       .num_consumer_supplies  = ARRAY_SIZE(cm_t35_vmmc1_supply),
-       .consumer_supplies      = cm_t35_vmmc1_supply,
-};
-
-/* VSIM for MMC1 pins DAT4..DAT7 (2 mA, plus card == max 50 mA) */
-static struct regulator_init_data cm_t35_vsim = {
-       .constraints = {
-               .min_uV                 = 1800000,
-               .max_uV                 = 3000000,
-               .valid_modes_mask       = REGULATOR_MODE_NORMAL
-                                       | REGULATOR_MODE_STANDBY,
-               .valid_ops_mask         = REGULATOR_CHANGE_VOLTAGE
-                                       | REGULATOR_CHANGE_MODE
-                                       | REGULATOR_CHANGE_STATUS,
-       },
-       .num_consumer_supplies  = ARRAY_SIZE(cm_t35_vsim_supply),
-       .consumer_supplies      = cm_t35_vsim_supply,
-};
-
-static struct regulator_init_data cm_t35_vio = {
-       .constraints = {
-               .min_uV                 = 1800000,
-               .max_uV                 = 1800000,
-               .apply_uV               = true,
-               .valid_modes_mask       = REGULATOR_MODE_NORMAL
-                                       | REGULATOR_MODE_STANDBY,
-               .valid_ops_mask         = REGULATOR_CHANGE_MODE,
-       },
-       .num_consumer_supplies  = ARRAY_SIZE(cm_t35_vio_supplies),
-       .consumer_supplies      = cm_t35_vio_supplies,
-};
-
-static uint32_t cm_t35_keymap[] = {
-       KEY(0, 0, KEY_A),       KEY(0, 1, KEY_B),       KEY(0, 2, KEY_LEFT),
-       KEY(1, 0, KEY_UP),      KEY(1, 1, KEY_ENTER),   KEY(1, 2, KEY_DOWN),
-       KEY(2, 0, KEY_RIGHT),   KEY(2, 1, KEY_C),       KEY(2, 2, KEY_D),
-};
-
-static struct matrix_keymap_data cm_t35_keymap_data = {
-       .keymap                 = cm_t35_keymap,
-       .keymap_size            = ARRAY_SIZE(cm_t35_keymap),
-};
-
-static struct twl4030_keypad_data cm_t35_kp_data = {
-       .keymap_data    = &cm_t35_keymap_data,
-       .rows           = 3,
-       .cols           = 3,
-       .rep            = 1,
-};
-
-static struct omap2_hsmmc_info mmc[] = {
-       {
-               .mmc            = 1,
-               .caps           = MMC_CAP_4_BIT_DATA,
-               .gpio_cd        = -EINVAL,
-               .gpio_wp        = -EINVAL,
-               .deferred       = true,
-       },
-       {
-               .mmc            = 2,
-               .caps           = MMC_CAP_4_BIT_DATA,
-               .transceiver    = 1,
-               .gpio_cd        = -EINVAL,
-               .gpio_wp        = -EINVAL,
-               .ocr_mask       = 0x00100000,   /* 3.3V */
-       },
-       {}      /* Terminator */
-};
-
-static struct usbhs_phy_data phy_data[] __initdata = {
-       {
-               .port = 1,
-               .reset_gpio = OMAP_MAX_GPIO_LINES + 6,
-               .vcc_gpio = -EINVAL,
-       },
-       {
-               .port = 2,
-               .reset_gpio = OMAP_MAX_GPIO_LINES + 7,
-               .vcc_gpio = -EINVAL,
-       },
-};
-
-static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
-       .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
-       .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
-};
-
-static void  __init cm_t35_init_usbh(void)
-{
-       int err;
-
-       err = gpio_request_one(SB_T35_USB_HUB_RESET_GPIO,
-                              GPIOF_OUT_INIT_LOW, "usb hub rst");
-       if (err) {
-               pr_err("SB-T35: usb hub rst gpio request failed: %d\n", err);
-       } else {
-               udelay(10);
-               gpio_set_value(SB_T35_USB_HUB_RESET_GPIO, 1);
-               msleep(1);
-       }
-
-       usbhs_init_phys(phy_data, ARRAY_SIZE(phy_data));
-       usbhs_init(&usbhs_bdata);
-}
-
-static int cm_t35_twl_gpio_setup(struct device *dev, unsigned gpio,
-                                unsigned ngpio)
-{
-       int wlan_rst = gpio + 2;
-
-       if (gpio_request_one(wlan_rst, GPIOF_OUT_INIT_HIGH, "WLAN RST") == 0) {
-               gpio_export(wlan_rst, 0);
-               udelay(10);
-               gpio_set_value_cansleep(wlan_rst, 0);
-               udelay(10);
-               gpio_set_value_cansleep(wlan_rst, 1);
-       } else {
-               pr_err("CM-T35: could not obtain gpio for WiFi reset\n");
-       }
-
-       /* gpio + 0 is "mmc0_cd" (input/IRQ) */
-       mmc[0].gpio_cd = gpio + 0;
-       omap_hsmmc_late_init(mmc);
-
-       return 0;
-}
-
-static struct twl4030_gpio_platform_data cm_t35_gpio_data = {
-       .setup          = cm_t35_twl_gpio_setup,
-};
-
-static struct twl4030_power_data cm_t35_power_data = {
-       .use_poweroff   = true,
-};
-
-static struct twl4030_platform_data cm_t35_twldata = {
-       /* platform_data for children goes here */
-       .keypad         = &cm_t35_kp_data,
-       .gpio           = &cm_t35_gpio_data,
-       .vmmc1          = &cm_t35_vmmc1,
-       .vsim           = &cm_t35_vsim,
-       .vio            = &cm_t35_vio,
-       .power          = &cm_t35_power_data,
-};
-
-#if defined(CONFIG_VIDEO_OMAP3) || defined(CONFIG_VIDEO_OMAP3_MODULE)
-#include <media/omap3isp.h>
-#include "devices.h"
-
-static struct isp_platform_subdev cm_t35_isp_subdevs[] = {
-       {
-               .board_info = &(struct i2c_board_info){
-                       I2C_BOARD_INFO("mt9t001", 0x5d)
-               },
-               .i2c_adapter_id = 3,
-               .bus = &(struct isp_bus_cfg){
-                       .interface = ISP_INTERFACE_PARALLEL,
-                       .bus = {
-                               .parallel = {
-                                       .clk_pol = 1,
-                               },
-                       },
-               },
-       },
-       {
-               .board_info = &(struct i2c_board_info){
-                       I2C_BOARD_INFO("tvp5150", 0x5c),
-               },
-               .i2c_adapter_id = 3,
-               .bus = &(struct isp_bus_cfg){
-                       .interface = ISP_INTERFACE_PARALLEL,
-                       .bus = {
-                               .parallel = {
-                                       .clk_pol = 0,
-                               },
-                       },
-               },
-       },
-       { 0 },
-};
-
-static struct isp_platform_data cm_t35_isp_pdata = {
-       .subdevs = cm_t35_isp_subdevs,
-};
-
-static struct regulator_consumer_supply cm_t35_camera_supplies[] = {
-       REGULATOR_SUPPLY("vaa", "3-005d"),
-       REGULATOR_SUPPLY("vdd", "3-005d"),
-};
-
-static void __init cm_t35_init_camera(void)
-{
-       struct clk *clk;
-
-       clk = clk_register_fixed_rate(NULL, "mt9t001-clkin", NULL, CLK_IS_ROOT,
-                                     48000000);
-       clk_register_clkdev(clk, NULL, "3-005d");
-
-       regulator_register_fixed(2, cm_t35_camera_supplies,
-                                ARRAY_SIZE(cm_t35_camera_supplies));
-
-       if (omap3_init_camera(&cm_t35_isp_pdata) < 0)
-               pr_warn("CM-T3x: Failed registering camera device!\n");
-}
-
-#else
-static inline void cm_t35_init_camera(void) {}
-#endif /* CONFIG_VIDEO_OMAP3 */
-
-static void __init cm_t35_init_i2c(void)
-{
-       omap3_pmic_get_config(&cm_t35_twldata, TWL_COMMON_PDATA_USB,
-                             TWL_COMMON_REGULATOR_VDAC |
-                             TWL_COMMON_PDATA_AUDIO);
-
-       omap3_pmic_init("tps65930", &cm_t35_twldata);
-
-       omap_register_i2c_bus(3, 400, NULL, 0);
-}
-
-#ifdef CONFIG_OMAP_MUX
-static struct omap_board_mux board_mux[] __initdata = {
-       /* nCS and IRQ for CM-T35 ethernet */
-       OMAP3_MUX(GPMC_NCS5, OMAP_MUX_MODE0),
-       OMAP3_MUX(UART3_CTS_RCTX, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP),
-
-       /* nCS and IRQ for SB-T35 ethernet */
-       OMAP3_MUX(GPMC_NCS4, OMAP_MUX_MODE0),
-       OMAP3_MUX(GPMC_WAIT3, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP),
-
-       /* PENDOWN GPIO */
-       OMAP3_MUX(GPMC_NCS6, OMAP_MUX_MODE4 | OMAP_PIN_INPUT),
-
-       /* mUSB */
-       OMAP3_MUX(HSUSB0_CLK, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
-       OMAP3_MUX(HSUSB0_STP, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
-       OMAP3_MUX(HSUSB0_DIR, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
-       OMAP3_MUX(HSUSB0_NXT, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
-       OMAP3_MUX(HSUSB0_DATA0, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
-       OMAP3_MUX(HSUSB0_DATA1, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
-       OMAP3_MUX(HSUSB0_DATA2, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
-       OMAP3_MUX(HSUSB0_DATA3, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
-       OMAP3_MUX(HSUSB0_DATA4, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
-       OMAP3_MUX(HSUSB0_DATA5, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
-       OMAP3_MUX(HSUSB0_DATA6, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
-       OMAP3_MUX(HSUSB0_DATA7, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
-
-       /* MMC 2 */
-       OMAP3_MUX(SDMMC2_DAT4, OMAP_MUX_MODE1 | OMAP_PIN_OUTPUT),
-       OMAP3_MUX(SDMMC2_DAT5, OMAP_MUX_MODE1 | OMAP_PIN_OUTPUT),
-       OMAP3_MUX(SDMMC2_DAT6, OMAP_MUX_MODE1 | OMAP_PIN_OUTPUT),
-       OMAP3_MUX(SDMMC2_DAT7, OMAP_MUX_MODE1 | OMAP_PIN_INPUT),
-
-       /* McSPI 1 */
-       OMAP3_MUX(MCSPI1_CLK, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
-       OMAP3_MUX(MCSPI1_SIMO, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
-       OMAP3_MUX(MCSPI1_SOMI, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
-       OMAP3_MUX(MCSPI1_CS0, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLDOWN),
-
-       /* McSPI 4 */
-       OMAP3_MUX(MCBSP1_CLKR, OMAP_MUX_MODE1 | OMAP_PIN_INPUT),
-       OMAP3_MUX(MCBSP1_DX, OMAP_MUX_MODE1 | OMAP_PIN_INPUT),
-       OMAP3_MUX(MCBSP1_DR, OMAP_MUX_MODE1 | OMAP_PIN_INPUT),
-       OMAP3_MUX(MCBSP1_FSX, OMAP_MUX_MODE1 | OMAP_PIN_INPUT_PULLUP),
-
-       /* McBSP 2 */
-       OMAP3_MUX(MCBSP2_FSX, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
-       OMAP3_MUX(MCBSP2_CLKX, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
-       OMAP3_MUX(MCBSP2_DR, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
-       OMAP3_MUX(MCBSP2_DX, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
-
-       /* serial ports */
-       OMAP3_MUX(MCBSP3_CLKX, OMAP_MUX_MODE1 | OMAP_PIN_OUTPUT),
-       OMAP3_MUX(MCBSP3_FSX, OMAP_MUX_MODE1 | OMAP_PIN_INPUT),
-       OMAP3_MUX(UART1_TX, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
-       OMAP3_MUX(UART1_RX, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
-
-       /* common DSS */
-       OMAP3_MUX(DSS_PCLK, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
-       OMAP3_MUX(DSS_HSYNC, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
-       OMAP3_MUX(DSS_VSYNC, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
-       OMAP3_MUX(DSS_ACBIAS, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
-       OMAP3_MUX(DSS_DATA6, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
-       OMAP3_MUX(DSS_DATA7, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
-       OMAP3_MUX(DSS_DATA8, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
-       OMAP3_MUX(DSS_DATA9, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
-       OMAP3_MUX(DSS_DATA10, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
-       OMAP3_MUX(DSS_DATA11, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
-       OMAP3_MUX(DSS_DATA12, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
-       OMAP3_MUX(DSS_DATA13, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
-       OMAP3_MUX(DSS_DATA14, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
-       OMAP3_MUX(DSS_DATA15, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
-       OMAP3_MUX(DSS_DATA16, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
-       OMAP3_MUX(DSS_DATA17, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
-
-       /* Camera */
-       OMAP3_MUX(CAM_HS, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
-       OMAP3_MUX(CAM_VS, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
-       OMAP3_MUX(CAM_XCLKA, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
-       OMAP3_MUX(CAM_PCLK, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
-       OMAP3_MUX(CAM_FLD, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
-       OMAP3_MUX(CAM_D0, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
-       OMAP3_MUX(CAM_D1, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
-       OMAP3_MUX(CAM_D2, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
-       OMAP3_MUX(CAM_D3, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
-       OMAP3_MUX(CAM_D4, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
-       OMAP3_MUX(CAM_D5, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
-       OMAP3_MUX(CAM_D6, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
-       OMAP3_MUX(CAM_D7, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
-       OMAP3_MUX(CAM_D8, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLDOWN),
-       OMAP3_MUX(CAM_D9, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLDOWN),
-       OMAP3_MUX(CAM_STROBE, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
-
-       OMAP3_MUX(CAM_D10, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLDOWN),
-       OMAP3_MUX(CAM_D11, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLDOWN),
-
-       /* display controls */
-       OMAP3_MUX(MCBSP1_FSR, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT),
-       OMAP3_MUX(GPMC_NCS7, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT),
-       OMAP3_MUX(GPMC_NCS3, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT),
-
-       /* TPS IRQ */
-       OMAP3_MUX(SYS_NIRQ, OMAP_MUX_MODE0 | OMAP_WAKEUP_EN | \
-                 OMAP_PIN_INPUT_PULLUP),
-
-       { .reg_offset = OMAP_MUX_TERMINATOR },
-};
-
-static void __init cm_t3x_common_dss_mux_init(int mux_mode)
-{
-       omap_mux_init_signal("dss_data18", mux_mode);
-       omap_mux_init_signal("dss_data19", mux_mode);
-       omap_mux_init_signal("dss_data20", mux_mode);
-       omap_mux_init_signal("dss_data21", mux_mode);
-       omap_mux_init_signal("dss_data22", mux_mode);
-       omap_mux_init_signal("dss_data23", mux_mode);
-}
-
-static void __init cm_t35_init_mux(void)
-{
-       int mux_mode = OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT;
-
-       omap_mux_init_signal("dss_data0.dss_data0", mux_mode);
-       omap_mux_init_signal("dss_data1.dss_data1", mux_mode);
-       omap_mux_init_signal("dss_data2.dss_data2", mux_mode);
-       omap_mux_init_signal("dss_data3.dss_data3", mux_mode);
-       omap_mux_init_signal("dss_data4.dss_data4", mux_mode);
-       omap_mux_init_signal("dss_data5.dss_data5", mux_mode);
-       cm_t3x_common_dss_mux_init(mux_mode);
-}
-
-static void __init cm_t3730_init_mux(void)
-{
-       int mux_mode = OMAP_MUX_MODE3 | OMAP_PIN_OUTPUT;
-
-       omap_mux_init_signal("sys_boot0", mux_mode);
-       omap_mux_init_signal("sys_boot1", mux_mode);
-       omap_mux_init_signal("sys_boot3", mux_mode);
-       omap_mux_init_signal("sys_boot4", mux_mode);
-       omap_mux_init_signal("sys_boot5", mux_mode);
-       omap_mux_init_signal("sys_boot6", mux_mode);
-       cm_t3x_common_dss_mux_init(mux_mode);
-}
-#else
-static inline void cm_t35_init_mux(void) {}
-static inline void cm_t3730_init_mux(void) {}
-#endif
-
-static void __init cm_t3x_common_init(void)
-{
-       omap3_mux_init(board_mux, OMAP_PACKAGE_CUS);
-       omap_serial_init();
-       omap_sdrc_init(mt46h32m32lf6_sdrc_params,
-                            mt46h32m32lf6_sdrc_params);
-       omap_hsmmc_init(mmc);
-       cm_t35_init_i2c();
-       omap_ads7846_init(1, CM_T35_GPIO_PENDOWN, 0, NULL);
-       cm_t35_init_ethernet();
-       cm_t35_init_led();
-       cm_t35_init_display();
-       omap_twl4030_audio_init("cm-t3x", NULL);
-
-       usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
-       usb_musb_init(NULL);
-       cm_t35_init_usbh();
-       cm_t35_init_camera();
-}
-
-static void __init cm_t35_init(void)
-{
-       cm_t3x_common_init();
-       cm_t35_init_mux();
-       cm_t35_init_nand();
-}
-
-static void __init cm_t3730_init(void)
-{
-       cm_t3x_common_init();
-       cm_t3730_init_mux();
-}
-
-MACHINE_START(CM_T35, "Compulab CM-T35")
-       .atag_offset    = 0x100,
-       .reserve        = omap_reserve,
-       .map_io         = omap3_map_io,
-       .init_early     = omap35xx_init_early,
-       .init_irq       = omap3_init_irq,
-       .init_machine   = cm_t35_init,
-       .init_late      = omap35xx_init_late,
-       .init_time      = omap3_sync32k_timer_init,
-       .restart        = omap3xxx_restart,
-MACHINE_END
-
-MACHINE_START(CM_T3730, "Compulab CM-T3730")
-       .atag_offset    = 0x100,
-       .reserve        = omap_reserve,
-       .map_io         = omap3_map_io,
-       .init_early     = omap3630_init_early,
-       .init_irq       = omap3_init_irq,
-       .init_machine   = cm_t3730_init,
-       .init_late     = omap3630_init_late,
-       .init_time      = omap3_sync32k_timer_init,
-       .restart        = omap3xxx_restart,
-MACHINE_END
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
deleted file mode 100644 (file)
index 81de1c6..0000000
+++ /dev/null
@@ -1,595 +0,0 @@
-/*
- * linux/arch/arm/mach-omap2/board-omap3beagle.c
- *
- * Copyright (C) 2008 Texas Instruments
- *
- * Modified from mach-omap2/board-3430sdp.c
- *
- * Initial code: Syed Mohammed Khasim
- *
- * 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/kernel.h>
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/delay.h>
-#include <linux/err.h>
-#include <linux/clk.h>
-#include <linux/io.h>
-#include <linux/leds.h>
-#include <linux/pwm.h>
-#include <linux/leds_pwm.h>
-#include <linux/gpio.h>
-#include <linux/input.h>
-#include <linux/gpio_keys.h>
-#include <linux/pm_opp.h>
-#include <linux/cpu.h>
-
-#include <linux/mtd/mtd.h>
-#include <linux/mtd/partitions.h>
-#include <linux/mtd/nand.h>
-#include <linux/mmc/host.h>
-#include <linux/usb/phy.h>
-
-#include <linux/regulator/machine.h>
-#include <linux/i2c/twl.h>
-
-#include <asm/mach-types.h>
-#include <asm/mach/arch.h>
-#include <asm/mach/map.h>
-#include <asm/mach/flash.h>
-
-#include <video/omapdss.h>
-#include <video/omap-panel-data.h>
-#include <linux/platform_data/mtd-nand-omap2.h>
-
-#include "common.h"
-#include "omap_device.h"
-#include "gpmc.h"
-#include "soc.h"
-#include "mux.h"
-#include "hsmmc.h"
-#include "pm.h"
-#include "board-flash.h"
-#include "common-board-devices.h"
-
-#define        NAND_CS 0
-
-static struct pwm_lookup pwm_lookup[] = {
-       /* LEDB -> PMU_STAT */
-       PWM_LOOKUP("twl-pwmled", 1, "leds_pwm", "beagleboard::pmu_stat",
-                  7812500, PWM_POLARITY_NORMAL),
-};
-
-static struct led_pwm pwm_leds[] = {
-       {
-               .name           = "beagleboard::pmu_stat",
-               .max_brightness = 127,
-               .pwm_period_ns  = 7812500,
-       },
-};
-
-static struct led_pwm_platform_data pwm_data = {
-       .num_leds       = ARRAY_SIZE(pwm_leds),
-       .leds           = pwm_leds,
-};
-
-static struct platform_device leds_pwm = {
-       .name   = "leds_pwm",
-       .id     = -1,
-       .dev    = {
-               .platform_data = &pwm_data,
-       },
-};
-
-/*
- * OMAP3 Beagle revision
- * Run time detection of Beagle revision is done by reading GPIO.
- * GPIO ID -
- *     AXBX    = GPIO173, GPIO172, GPIO171: 1 1 1
- *     C1_3    = GPIO173, GPIO172, GPIO171: 1 1 0
- *     C4      = GPIO173, GPIO172, GPIO171: 1 0 1
- *     XMA/XMB = GPIO173, GPIO172, GPIO171: 0 0 0
- *     XMC = GPIO173, GPIO172, GPIO171: 0 1 0
- */
-enum {
-       OMAP3BEAGLE_BOARD_UNKN = 0,
-       OMAP3BEAGLE_BOARD_AXBX,
-       OMAP3BEAGLE_BOARD_C1_3,
-       OMAP3BEAGLE_BOARD_C4,
-       OMAP3BEAGLE_BOARD_XM,
-       OMAP3BEAGLE_BOARD_XMC,
-};
-
-static u8 omap3_beagle_version;
-
-/*
- * Board-specific configuration
- * Defaults to BeagleBoard-xMC
- */
-static struct {
-       int mmc1_gpio_wp;
-       bool usb_pwr_level;     /* 0 - Active Low, 1 - Active High */
-       int dvi_pd_gpio;
-       int usr_button_gpio;
-       int mmc_caps;
-} beagle_config = {
-       .mmc1_gpio_wp = -EINVAL,
-       .usb_pwr_level = 0,
-       .dvi_pd_gpio = -EINVAL,
-       .usr_button_gpio = 4,
-       .mmc_caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA,
-};
-
-static struct gpio omap3_beagle_rev_gpios[] __initdata = {
-       { 171, GPIOF_IN, "rev_id_0"    },
-       { 172, GPIOF_IN, "rev_id_1" },
-       { 173, GPIOF_IN, "rev_id_2"    },
-};
-
-static void __init omap3_beagle_init_rev(void)
-{
-       int ret;
-       u16 beagle_rev = 0;
-
-       omap_mux_init_gpio(171, OMAP_PIN_INPUT_PULLUP);
-       omap_mux_init_gpio(172, OMAP_PIN_INPUT_PULLUP);
-       omap_mux_init_gpio(173, OMAP_PIN_INPUT_PULLUP);
-
-       ret = gpio_request_array(omap3_beagle_rev_gpios,
-                                ARRAY_SIZE(omap3_beagle_rev_gpios));
-       if (ret < 0) {
-               printk(KERN_ERR "Unable to get revision detection GPIO pins\n");
-               omap3_beagle_version = OMAP3BEAGLE_BOARD_UNKN;
-               return;
-       }
-
-       beagle_rev = gpio_get_value(171) | (gpio_get_value(172) << 1)
-                       | (gpio_get_value(173) << 2);
-
-       gpio_free_array(omap3_beagle_rev_gpios,
-                       ARRAY_SIZE(omap3_beagle_rev_gpios));
-
-       switch (beagle_rev) {
-       case 7:
-               printk(KERN_INFO "OMAP3 Beagle Rev: Ax/Bx\n");
-               omap3_beagle_version = OMAP3BEAGLE_BOARD_AXBX;
-               beagle_config.mmc1_gpio_wp = 29;
-               beagle_config.dvi_pd_gpio = 170;
-               beagle_config.usr_button_gpio = 7;
-               break;
-       case 6:
-               printk(KERN_INFO "OMAP3 Beagle Rev: C1/C2/C3\n");
-               omap3_beagle_version = OMAP3BEAGLE_BOARD_C1_3;
-               beagle_config.mmc1_gpio_wp = 23;
-               beagle_config.dvi_pd_gpio = 170;
-               beagle_config.usr_button_gpio = 7;
-               break;
-       case 5:
-               printk(KERN_INFO "OMAP3 Beagle Rev: C4\n");
-               omap3_beagle_version = OMAP3BEAGLE_BOARD_C4;
-               beagle_config.mmc1_gpio_wp = 23;
-               beagle_config.dvi_pd_gpio = 170;
-               beagle_config.usr_button_gpio = 7;
-               break;
-       case 0:
-               printk(KERN_INFO "OMAP3 Beagle Rev: xM Ax/Bx\n");
-               omap3_beagle_version = OMAP3BEAGLE_BOARD_XM;
-               beagle_config.usb_pwr_level = 1;
-               beagle_config.mmc_caps &= ~MMC_CAP_8_BIT_DATA;
-               break;
-       case 2:
-               printk(KERN_INFO "OMAP3 Beagle Rev: xM C\n");
-               omap3_beagle_version = OMAP3BEAGLE_BOARD_XMC;
-               beagle_config.mmc_caps &= ~MMC_CAP_8_BIT_DATA;
-               break;
-       default:
-               printk(KERN_INFO "OMAP3 Beagle Rev: unknown %hd\n", beagle_rev);
-               omap3_beagle_version = OMAP3BEAGLE_BOARD_UNKN;
-       }
-}
-
-static struct mtd_partition omap3beagle_nand_partitions[] = {
-       /* All the partition sizes are listed in terms of NAND block size */
-       {
-               .name           = "X-Loader",
-               .offset         = 0,
-               .size           = 4 * NAND_BLOCK_SIZE,
-               .mask_flags     = MTD_WRITEABLE,        /* force read-only */
-       },
-       {
-               .name           = "U-Boot",
-               .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x80000 */
-               .size           = 15 * NAND_BLOCK_SIZE,
-               .mask_flags     = MTD_WRITEABLE,        /* force read-only */
-       },
-       {
-               .name           = "U-Boot Env",
-               .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x260000 */
-               .size           = 1 * NAND_BLOCK_SIZE,
-       },
-       {
-               .name           = "Kernel",
-               .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x280000 */
-               .size           = 32 * NAND_BLOCK_SIZE,
-       },
-       {
-               .name           = "File System",
-               .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x680000 */
-               .size           = MTDPART_SIZ_FULL,
-       },
-};
-
-/* DSS */
-
-static struct connector_dvi_platform_data beagle_dvi_connector_pdata = {
-       .name                   = "dvi",
-       .source                 = "tfp410.0",
-       .i2c_bus_num            = 3,
-};
-
-static struct platform_device beagle_dvi_connector_device = {
-       .name                   = "connector-dvi",
-       .id                     = 0,
-       .dev.platform_data      = &beagle_dvi_connector_pdata,
-};
-
-static struct encoder_tfp410_platform_data beagle_tfp410_pdata = {
-       .name                   = "tfp410.0",
-       .source                 = "dpi.0",
-       .data_lines             = 24,
-       .power_down_gpio        = -1,
-};
-
-static struct platform_device beagle_tfp410_device = {
-       .name                   = "tfp410",
-       .id                     = 0,
-       .dev.platform_data      = &beagle_tfp410_pdata,
-};
-
-static struct connector_atv_platform_data beagle_tv_pdata = {
-       .name = "tv",
-       .source = "venc.0",
-       .connector_type = OMAP_DSS_VENC_TYPE_SVIDEO,
-       .invert_polarity = false,
-};
-
-static struct platform_device beagle_tv_connector_device = {
-       .name                   = "connector-analog-tv",
-       .id                     = 0,
-       .dev.platform_data      = &beagle_tv_pdata,
-};
-
-static struct omap_dss_board_info beagle_dss_data = {
-       .default_display_name = "dvi",
-};
-
-#include "sdram-micron-mt46h32m32lf-6.h"
-
-static struct omap2_hsmmc_info mmc[] = {
-       {
-               .mmc            = 1,
-               .caps           = MMC_CAP_4_BIT_DATA,
-               .gpio_wp        = -EINVAL,
-               .deferred       = true,
-       },
-       {}      /* Terminator */
-};
-
-static struct regulator_consumer_supply beagle_vmmc1_supply[] = {
-       REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"),
-};
-
-static struct regulator_consumer_supply beagle_vsim_supply[] = {
-       REGULATOR_SUPPLY("vmmc_aux", "omap_hsmmc.0"),
-};
-
-static struct gpio_led gpio_leds[];
-
-static struct usbhs_phy_data phy_data[] = {
-       {
-               .port = 2,
-               .reset_gpio = 147,
-               .vcc_gpio = -1,         /* updated in beagle_twl_gpio_setup */
-               .vcc_polarity = 1,      /* updated in beagle_twl_gpio_setup */
-       },
-};
-
-static int beagle_twl_gpio_setup(struct device *dev,
-               unsigned gpio, unsigned ngpio)
-{
-       int r;
-
-       mmc[0].gpio_wp = beagle_config.mmc1_gpio_wp;
-       /* gpio + 0 is "mmc0_cd" (input/IRQ) */
-       mmc[0].gpio_cd = gpio + 0;
-       omap_hsmmc_late_init(mmc);
-
-       /*
-        * TWL4030_GPIO_MAX + 0 == ledA, EHCI nEN_USB_PWR (out, XM active
-        * high / others active low)
-        * DVI reset GPIO is different between beagle revisions
-        */
-       /* Valid for all -xM revisions */
-       if (cpu_is_omap3630()) {
-               /*
-                * gpio + 1 on Xm controls the TFP410's enable line (active low)
-                * gpio + 2 control varies depending on the board rev as below:
-                * P7/P8 revisions(prototype): Camera EN
-                * A2+ revisions (production): LDO (DVI, serial, led blocks)
-                */
-               r = gpio_request_one(gpio + 1, GPIOF_OUT_INIT_LOW,
-                                    "nDVI_PWR_EN");
-               if (r)
-                       pr_err("%s: unable to configure nDVI_PWR_EN\n",
-                               __func__);
-
-               beagle_config.dvi_pd_gpio = gpio + 2;
-
-       } else {
-               /*
-                * REVISIT: need ehci-omap hooks for external VBUS
-                * power switch and overcurrent detect
-                */
-               if (gpio_request_one(gpio + 1, GPIOF_IN, "EHCI_nOC"))
-                       pr_err("%s: unable to configure EHCI_nOC\n", __func__);
-       }
-       beagle_tfp410_pdata.power_down_gpio = beagle_config.dvi_pd_gpio;
-
-       platform_device_register(&beagle_tfp410_device);
-       platform_device_register(&beagle_dvi_connector_device);
-       platform_device_register(&beagle_tv_connector_device);
-
-       /* TWL4030_GPIO_MAX i.e. LED_GPO controls HS USB Port 2 power */
-       phy_data[0].vcc_gpio = gpio + TWL4030_GPIO_MAX;
-       phy_data[0].vcc_polarity = beagle_config.usb_pwr_level;
-
-       usbhs_init_phys(phy_data, ARRAY_SIZE(phy_data));
-       return 0;
-}
-
-static struct twl4030_gpio_platform_data beagle_gpio_data = {
-       .use_leds       = true,
-       .pullups        = BIT(1),
-       .pulldowns      = BIT(2) | BIT(6) | BIT(7) | BIT(8) | BIT(13)
-                               | BIT(15) | BIT(16) | BIT(17),
-       .setup          = beagle_twl_gpio_setup,
-};
-
-/* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */
-static struct regulator_init_data beagle_vmmc1 = {
-       .constraints = {
-               .min_uV                 = 1850000,
-               .max_uV                 = 3150000,
-               .valid_modes_mask       = REGULATOR_MODE_NORMAL
-                                       | REGULATOR_MODE_STANDBY,
-               .valid_ops_mask         = REGULATOR_CHANGE_VOLTAGE
-                                       | REGULATOR_CHANGE_MODE
-                                       | REGULATOR_CHANGE_STATUS,
-       },
-       .num_consumer_supplies  = ARRAY_SIZE(beagle_vmmc1_supply),
-       .consumer_supplies      = beagle_vmmc1_supply,
-};
-
-/* VSIM for MMC1 pins DAT4..DAT7 (2 mA, plus card == max 50 mA) */
-static struct regulator_init_data beagle_vsim = {
-       .constraints = {
-               .min_uV                 = 1800000,
-               .max_uV                 = 3000000,
-               .valid_modes_mask       = REGULATOR_MODE_NORMAL
-                                       | REGULATOR_MODE_STANDBY,
-               .valid_ops_mask         = REGULATOR_CHANGE_VOLTAGE
-                                       | REGULATOR_CHANGE_MODE
-                                       | REGULATOR_CHANGE_STATUS,
-       },
-       .num_consumer_supplies  = ARRAY_SIZE(beagle_vsim_supply),
-       .consumer_supplies      = beagle_vsim_supply,
-};
-
-static struct twl4030_platform_data beagle_twldata = {
-       /* platform_data for children goes here */
-       .gpio           = &beagle_gpio_data,
-       .vmmc1          = &beagle_vmmc1,
-       .vsim           = &beagle_vsim,
-};
-
-static struct i2c_board_info __initdata beagle_i2c_eeprom[] = {
-       {
-               I2C_BOARD_INFO("eeprom", 0x50),
-       },
-};
-
-static int __init omap3_beagle_i2c_init(void)
-{
-       omap3_pmic_get_config(&beagle_twldata,
-                       TWL_COMMON_PDATA_USB | TWL_COMMON_PDATA_MADC |
-                       TWL_COMMON_PDATA_AUDIO,
-                       TWL_COMMON_REGULATOR_VDAC | TWL_COMMON_REGULATOR_VPLL2);
-
-       beagle_twldata.vpll2->constraints.name = "VDVI";
-
-       omap3_pmic_init("twl4030", &beagle_twldata);
-       /* Bus 3 is attached to the DVI port where devices like the pico DLP
-        * projector don't work reliably with 400kHz */
-       omap_register_i2c_bus(3, 100, beagle_i2c_eeprom, ARRAY_SIZE(beagle_i2c_eeprom));
-       return 0;
-}
-
-static struct gpio_led gpio_leds[] = {
-       {
-               .name                   = "beagleboard::usr0",
-               .default_trigger        = "heartbeat",
-               .gpio                   = 150,
-       },
-       {
-               .name                   = "beagleboard::usr1",
-               .default_trigger        = "mmc0",
-               .gpio                   = 149,
-       },
-};
-
-static struct gpio_led_platform_data gpio_led_info = {
-       .leds           = gpio_leds,
-       .num_leds       = ARRAY_SIZE(gpio_leds),
-};
-
-static struct platform_device leds_gpio = {
-       .name   = "leds-gpio",
-       .id     = -1,
-       .dev    = {
-               .platform_data  = &gpio_led_info,
-       },
-};
-
-static struct gpio_keys_button gpio_buttons[] = {
-       {
-               .code                   = BTN_EXTRA,
-               /* Dynamically assigned depending on board */
-               .gpio                   = -EINVAL,
-               .desc                   = "user",
-               .wakeup                 = 1,
-       },
-};
-
-static struct gpio_keys_platform_data gpio_key_info = {
-       .buttons        = gpio_buttons,
-       .nbuttons       = ARRAY_SIZE(gpio_buttons),
-};
-
-static struct platform_device keys_gpio = {
-       .name   = "gpio-keys",
-       .id     = -1,
-       .dev    = {
-               .platform_data  = &gpio_key_info,
-       },
-};
-
-static struct platform_device madc_hwmon = {
-       .name   = "twl4030_madc_hwmon",
-       .id     = -1,
-};
-
-static struct platform_device *omap3_beagle_devices[] __initdata = {
-       &leds_gpio,
-       &keys_gpio,
-       &madc_hwmon,
-       &leds_pwm,
-};
-
-static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
-       .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
-};
-
-#ifdef CONFIG_OMAP_MUX
-static struct omap_board_mux board_mux[] __initdata = {
-       { .reg_offset = OMAP_MUX_TERMINATOR },
-};
-#endif
-
-static int __init beagle_opp_init(void)
-{
-       int r = 0;
-
-       if (!machine_is_omap3_beagle())
-               return 0;
-
-       /* Initialize the omap3 opp table if not already created. */
-       r = omap3_opp_init();
-       if (r < 0 && (r != -EEXIST)) {
-               pr_err("%s: opp default init failed\n", __func__);
-               return r;
-       }
-
-       /* Custom OPP enabled for all xM versions */
-       if (cpu_is_omap3630()) {
-               struct device *mpu_dev, *iva_dev;
-
-               mpu_dev = get_cpu_device(0);
-               iva_dev = omap_device_get_by_hwmod_name("iva");
-
-               if (!mpu_dev || IS_ERR(iva_dev)) {
-                       pr_err("%s: Aiee.. no mpu/dsp devices? %p %p\n",
-                               __func__, mpu_dev, iva_dev);
-                       return -ENODEV;
-               }
-               /* Enable MPU 1GHz and lower opps */
-               r = dev_pm_opp_enable(mpu_dev, 800000000);
-               /* TODO: MPU 1GHz needs SR and ABB */
-
-               /* Enable IVA 800MHz and lower opps */
-               r |= dev_pm_opp_enable(iva_dev, 660000000);
-               /* TODO: DSP 800MHz needs SR and ABB */
-               if (r) {
-                       pr_err("%s: failed to enable higher opp %d\n",
-                               __func__, r);
-                       /*
-                        * Cleanup - disable the higher freqs - we dont care
-                        * about the results
-                        */
-                       dev_pm_opp_disable(mpu_dev, 800000000);
-                       dev_pm_opp_disable(iva_dev, 660000000);
-               }
-       }
-       return 0;
-}
-omap_device_initcall(beagle_opp_init);
-
-static void __init omap3_beagle_init(void)
-{
-       omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
-       omap3_beagle_init_rev();
-
-       if (gpio_is_valid(beagle_config.mmc1_gpio_wp))
-               omap_mux_init_gpio(beagle_config.mmc1_gpio_wp, OMAP_PIN_INPUT);
-       mmc[0].caps = beagle_config.mmc_caps;
-       omap_hsmmc_init(mmc);
-
-       omap3_beagle_i2c_init();
-
-       gpio_buttons[0].gpio = beagle_config.usr_button_gpio;
-
-       platform_add_devices(omap3_beagle_devices,
-                       ARRAY_SIZE(omap3_beagle_devices));
-       if (gpio_is_valid(beagle_config.dvi_pd_gpio))
-               omap_mux_init_gpio(beagle_config.dvi_pd_gpio, OMAP_PIN_OUTPUT);
-       omap_display_init(&beagle_dss_data);
-
-       omap_serial_init();
-       omap_sdrc_init(mt46h32m32lf6_sdrc_params,
-                                 mt46h32m32lf6_sdrc_params);
-
-       usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
-       usb_musb_init(NULL);
-
-       usbhs_init(&usbhs_bdata);
-
-       board_nand_init(omap3beagle_nand_partitions,
-                       ARRAY_SIZE(omap3beagle_nand_partitions), NAND_CS,
-                       NAND_BUSWIDTH_16, NULL);
-       omap_twl4030_audio_init("omap3beagle", NULL);
-
-       /* Ensure msecure is mux'd to be able to set the RTC. */
-       omap_mux_init_signal("sys_drm_msecure", OMAP_PIN_OFF_OUTPUT_HIGH);
-
-       /* Ensure SDRC pins are mux'd for self-refresh */
-       omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT);
-       omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT);
-
-       pwm_add_table(pwm_lookup, ARRAY_SIZE(pwm_lookup));
-}
-
-MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board")
-       /* Maintainer: Syed Mohammed Khasim - http://beagleboard.org */
-       .atag_offset    = 0x100,
-       .reserve        = omap_reserve,
-       .map_io         = omap3_map_io,
-       .init_early     = omap3_init_early,
-       .init_irq       = omap3_init_irq,
-       .init_machine   = omap3_beagle_init,
-       .init_late      = omap3_init_late,
-       .init_time      = omap3_secure_sync32k_timer_init,
-       .restart        = omap3xxx_restart,
-MACHINE_END
diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c
deleted file mode 100644 (file)
index 2dae6cc..0000000
+++ /dev/null
@@ -1,571 +0,0 @@
-/*
- * board-overo.c (Gumstix Overo)
- *
- * Initial code: Steve Sakoman <steve@sakoman.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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#include <linux/clk.h>
-#include <linux/delay.h>
-#include <linux/err.h>
-#include <linux/init.h>
-#include <linux/io.h>
-#include <linux/gpio.h>
-#include <linux/kernel.h>
-#include <linux/platform_device.h>
-#include <linux/i2c/twl.h>
-#include <linux/regulator/machine.h>
-#include <linux/regulator/fixed.h>
-#include <linux/spi/spi.h>
-
-#include <linux/mtd/mtd.h>
-#include <linux/mtd/nand.h>
-#include <linux/mtd/partitions.h>
-#include <linux/mmc/host.h>
-#include <linux/usb/phy.h>
-
-#include <linux/platform_data/mtd-nand-omap2.h>
-#include <linux/platform_data/spi-omap2-mcspi.h>
-
-#include <asm/mach-types.h>
-#include <asm/mach/arch.h>
-#include <asm/mach/flash.h>
-#include <asm/mach/map.h>
-
-#include <video/omapdss.h>
-#include <video/omap-panel-data.h>
-
-#include "common.h"
-#include "mux.h"
-#include "sdram-micron-mt46h32m32lf-6.h"
-#include "gpmc.h"
-#include "hsmmc.h"
-#include "board-flash.h"
-#include "common-board-devices.h"
-
-#define        NAND_CS                 0
-
-#define OVERO_GPIO_BT_XGATE    15
-#define OVERO_GPIO_W2W_NRESET  16
-#define OVERO_GPIO_PENDOWN     114
-#define OVERO_GPIO_BT_NRESET   164
-#define OVERO_GPIO_USBH_CPEN   168
-#define OVERO_GPIO_USBH_NRESET 183
-
-#define OVERO_SMSC911X_CS      5
-#define OVERO_SMSC911X_GPIO    176
-#define OVERO_SMSC911X_NRESET  64
-#define OVERO_SMSC911X2_CS     4
-#define OVERO_SMSC911X2_GPIO   65
-
-/* whether to register LCD35 instead of LCD43 */
-static bool overo_use_lcd35;
-
-#if defined(CONFIG_TOUCHSCREEN_ADS7846) || \
-       defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
-
-/* fixed regulator for ads7846 */
-static struct regulator_consumer_supply ads7846_supply[] = {
-       REGULATOR_SUPPLY("vcc", "spi1.0"),
-};
-
-static struct regulator_init_data vads7846_regulator = {
-       .constraints = {
-               .valid_ops_mask         = REGULATOR_CHANGE_STATUS,
-       },
-       .num_consumer_supplies  = ARRAY_SIZE(ads7846_supply),
-       .consumer_supplies      = ads7846_supply,
-};
-
-static struct fixed_voltage_config vads7846 = {
-       .supply_name            = "vads7846",
-       .microvolts             = 3300000, /* 3.3V */
-       .gpio                   = -EINVAL,
-       .startup_delay          = 0,
-       .init_data              = &vads7846_regulator,
-};
-
-static struct platform_device vads7846_device = {
-       .name           = "reg-fixed-voltage",
-       .id             = 1,
-       .dev = {
-               .platform_data = &vads7846,
-       },
-};
-
-static void __init overo_ads7846_init(void)
-{
-       omap_ads7846_init(1, OVERO_GPIO_PENDOWN, 0, NULL);
-       platform_device_register(&vads7846_device);
-}
-
-#else
-static inline void __init overo_ads7846_init(void) { return; }
-#endif
-
-#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
-
-#include <linux/smsc911x.h>
-#include "gpmc-smsc911x.h"
-
-static struct omap_smsc911x_platform_data smsc911x_cfg = {
-       .id             = 0,
-       .cs             = OVERO_SMSC911X_CS,
-       .gpio_irq       = OVERO_SMSC911X_GPIO,
-       .gpio_reset     = OVERO_SMSC911X_NRESET,
-       .flags          = SMSC911X_USE_32BIT,
-};
-
-static struct omap_smsc911x_platform_data smsc911x2_cfg = {
-       .id             = 1,
-       .cs             = OVERO_SMSC911X2_CS,
-       .gpio_irq       = OVERO_SMSC911X2_GPIO,
-       .gpio_reset     = -EINVAL,
-       .flags          = SMSC911X_USE_32BIT,
-};
-
-static void __init overo_init_smsc911x(void)
-{
-       gpmc_smsc911x_init(&smsc911x_cfg);
-       gpmc_smsc911x_init(&smsc911x2_cfg);
-}
-
-#else
-static inline void __init overo_init_smsc911x(void) { return; }
-#endif
-
-/* DSS */
-#define OVERO_GPIO_LCD_EN 144
-#define OVERO_GPIO_LCD_BL 145
-
-static struct connector_atv_platform_data overo_tv_pdata = {
-       .name = "tv",
-       .source = "venc.0",
-       .connector_type = OMAP_DSS_VENC_TYPE_SVIDEO,
-       .invert_polarity = false,
-};
-
-static struct platform_device overo_tv_connector_device = {
-       .name                   = "connector-analog-tv",
-       .id                     = 0,
-       .dev.platform_data      = &overo_tv_pdata,
-};
-
-static const struct display_timing overo_lcd43_videomode = {
-       .pixelclock     = { 0, 9200000, 0 },
-
-       .hactive = { 0, 480, 0 },
-       .hfront_porch = { 0, 8, 0 },
-       .hback_porch = { 0, 4, 0 },
-       .hsync_len = { 0, 41, 0 },
-
-       .vactive = { 0, 272, 0 },
-       .vfront_porch = { 0, 4, 0 },
-       .vback_porch = { 0, 2, 0 },
-       .vsync_len = { 0, 10, 0 },
-
-       .flags = DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW |
-               DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_PIXDATA_POSEDGE,
-};
-
-static struct panel_dpi_platform_data overo_lcd43_pdata = {
-       .name                   = "lcd43",
-       .source                 = "dpi.0",
-
-       .data_lines             = 24,
-
-       .display_timing         = &overo_lcd43_videomode,
-
-       .enable_gpio            = OVERO_GPIO_LCD_EN,
-       .backlight_gpio         = OVERO_GPIO_LCD_BL,
-};
-
-static struct platform_device overo_lcd43_device = {
-       .name                   = "panel-dpi",
-       .id                     = 0,
-       .dev.platform_data      = &overo_lcd43_pdata,
-};
-
-static struct connector_dvi_platform_data overo_dvi_connector_pdata = {
-       .name                   = "dvi",
-       .source                 = "tfp410.0",
-       .i2c_bus_num            = 3,
-};
-
-static struct platform_device overo_dvi_connector_device = {
-       .name                   = "connector-dvi",
-       .id                     = 0,
-       .dev.platform_data      = &overo_dvi_connector_pdata,
-};
-
-static struct encoder_tfp410_platform_data overo_tfp410_pdata = {
-       .name                   = "tfp410.0",
-       .source                 = "dpi.0",
-       .data_lines             = 24,
-       .power_down_gpio        = -1,
-};
-
-static struct platform_device overo_tfp410_device = {
-       .name                   = "tfp410",
-       .id                     = 0,
-       .dev.platform_data      = &overo_tfp410_pdata,
-};
-
-static struct omap_dss_board_info overo_dss_data = {
-       .default_display_name = "lcd43",
-};
-
-static void __init overo_display_init(void)
-{
-       omap_display_init(&overo_dss_data);
-
-       if (!overo_use_lcd35)
-               platform_device_register(&overo_lcd43_device);
-       platform_device_register(&overo_tfp410_device);
-       platform_device_register(&overo_dvi_connector_device);
-       platform_device_register(&overo_tv_connector_device);
-}
-
-static struct mtd_partition overo_nand_partitions[] = {
-       {
-               .name           = "xloader",
-               .offset         = 0,                    /* Offset = 0x00000 */
-               .size           = 4 * NAND_BLOCK_SIZE,
-               .mask_flags     = MTD_WRITEABLE
-       },
-       {
-               .name           = "uboot",
-               .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x80000 */
-               .size           = 14 * NAND_BLOCK_SIZE,
-       },
-       {
-               .name           = "uboot environment",
-               .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x240000 */
-               .size           = 2 * NAND_BLOCK_SIZE,
-       },
-       {
-               .name           = "linux",
-               .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x280000 */
-               .size           = 32 * NAND_BLOCK_SIZE,
-       },
-       {
-               .name           = "rootfs",
-               .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x680000 */
-               .size           = MTDPART_SIZ_FULL,
-       },
-};
-
-static struct omap2_hsmmc_info mmc[] = {
-       {
-               .mmc            = 1,
-               .caps           = MMC_CAP_4_BIT_DATA,
-               .gpio_cd        = -EINVAL,
-               .gpio_wp        = -EINVAL,
-       },
-       {
-               .mmc            = 2,
-               .caps           = MMC_CAP_4_BIT_DATA,
-               .gpio_cd        = -EINVAL,
-               .gpio_wp        = -EINVAL,
-               .transceiver    = true,
-               .ocr_mask       = 0x00100000,   /* 3.3V */
-       },
-       {}      /* Terminator */
-};
-
-static struct regulator_consumer_supply overo_vmmc1_supply[] = {
-       REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"),
-};
-
-#if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE)
-#include <linux/leds.h>
-
-static struct gpio_led gpio_leds[] = {
-       {
-               .name                   = "overo:red:gpio21",
-               .default_trigger        = "heartbeat",
-               .gpio                   = 21,
-               .active_low             = true,
-       },
-       {
-               .name                   = "overo:blue:gpio22",
-               .default_trigger        = "none",
-               .gpio                   = 22,
-               .active_low             = true,
-       },
-       {
-               .name                   = "overo:blue:COM",
-               .default_trigger        = "mmc0",
-               .gpio                   = -EINVAL,      /* gets replaced */
-               .active_low             = true,
-       },
-};
-
-static struct gpio_led_platform_data gpio_leds_pdata = {
-       .leds           = gpio_leds,
-       .num_leds       = ARRAY_SIZE(gpio_leds),
-};
-
-static struct platform_device gpio_leds_device = {
-       .name   = "leds-gpio",
-       .id     = -1,
-       .dev    = {
-               .platform_data  = &gpio_leds_pdata,
-       },
-};
-
-static void __init overo_init_led(void)
-{
-       platform_device_register(&gpio_leds_device);
-}
-
-#else
-static inline void __init overo_init_led(void) { return; }
-#endif
-
-#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
-#include <linux/input.h>
-#include <linux/gpio_keys.h>
-
-static struct gpio_keys_button gpio_buttons[] = {
-       {
-               .code                   = BTN_0,
-               .gpio                   = 23,
-               .desc                   = "button0",
-               .wakeup                 = 1,
-       },
-       {
-               .code                   = BTN_1,
-               .gpio                   = 14,
-               .desc                   = "button1",
-               .wakeup                 = 1,
-       },
-};
-
-static struct gpio_keys_platform_data gpio_keys_pdata = {
-       .buttons        = gpio_buttons,
-       .nbuttons       = ARRAY_SIZE(gpio_buttons),
-};
-
-static struct platform_device gpio_keys_device = {
-       .name   = "gpio-keys",
-       .id     = -1,
-       .dev    = {
-               .platform_data  = &gpio_keys_pdata,
-       },
-};
-
-static void __init overo_init_keys(void)
-{
-       platform_device_register(&gpio_keys_device);
-}
-
-#else
-static inline void __init overo_init_keys(void) { return; }
-#endif
-
-static int overo_twl_gpio_setup(struct device *dev,
-               unsigned gpio, unsigned ngpio)
-{
-#if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE)
-       /* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */
-       gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1;
-#endif
-
-       return 0;
-}
-
-static struct twl4030_gpio_platform_data overo_gpio_data = {
-       .use_leds       = true,
-       .setup          = overo_twl_gpio_setup,
-};
-
-static struct regulator_init_data overo_vmmc1 = {
-       .constraints = {
-               .min_uV                 = 1850000,
-               .max_uV                 = 3150000,
-               .valid_modes_mask       = REGULATOR_MODE_NORMAL
-                                       | REGULATOR_MODE_STANDBY,
-               .valid_ops_mask         = REGULATOR_CHANGE_VOLTAGE
-                                       | REGULATOR_CHANGE_MODE
-                                       | REGULATOR_CHANGE_STATUS,
-       },
-       .num_consumer_supplies  = ARRAY_SIZE(overo_vmmc1_supply),
-       .consumer_supplies      = overo_vmmc1_supply,
-};
-
-static struct twl4030_platform_data overo_twldata = {
-       .gpio           = &overo_gpio_data,
-       .vmmc1          = &overo_vmmc1,
-};
-
-static int __init overo_i2c_init(void)
-{
-       omap3_pmic_get_config(&overo_twldata,
-                       TWL_COMMON_PDATA_USB | TWL_COMMON_PDATA_AUDIO,
-                       TWL_COMMON_REGULATOR_VDAC | TWL_COMMON_REGULATOR_VPLL2);
-
-       overo_twldata.vpll2->constraints.name = "VDVI";
-
-       omap3_pmic_init("tps65950", &overo_twldata);
-       /* i2c2 pins are used for gpio */
-       omap_register_i2c_bus(3, 400, NULL, 0);
-       return 0;
-}
-
-static struct panel_lb035q02_platform_data overo_lcd35_pdata = {
-       .name                   = "lcd35",
-       .source                 = "dpi.0",
-
-       .data_lines             = 24,
-
-       .enable_gpio            = OVERO_GPIO_LCD_EN,
-       .backlight_gpio         = OVERO_GPIO_LCD_BL,
-};
-
-/*
- * NOTE: We need to add either the lgphilips panel, or the lcd43 panel. The
- * selection is done based on the overo_use_lcd35 field. If new SPI
- * devices are added here, extra work is needed to make only the lgphilips panel
- * affected by the overo_use_lcd35 field.
- */
-static struct spi_board_info overo_spi_board_info[] __initdata = {
-       {
-               .modalias               = "panel_lgphilips_lb035q02",
-               .bus_num                = 1,
-               .chip_select            = 1,
-               .max_speed_hz           = 500000,
-               .mode                   = SPI_MODE_3,
-               .platform_data          = &overo_lcd35_pdata,
-       },
-};
-
-static int __init overo_spi_init(void)
-{
-       overo_ads7846_init();
-
-       if (overo_use_lcd35) {
-               spi_register_board_info(overo_spi_board_info,
-                               ARRAY_SIZE(overo_spi_board_info));
-       }
-       return 0;
-}
-
-static struct usbhs_phy_data phy_data[] __initdata = {
-       {
-               .port = 2,
-               .reset_gpio = OVERO_GPIO_USBH_NRESET,
-               .vcc_gpio = -EINVAL,
-       },
-};
-
-static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
-       .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
-};
-
-#ifdef CONFIG_OMAP_MUX
-static struct omap_board_mux board_mux[] __initdata = {
-       { .reg_offset = OMAP_MUX_TERMINATOR },
-};
-#endif
-
-static struct gpio overo_bt_gpios[] __initdata = {
-       { OVERO_GPIO_BT_XGATE,  GPIOF_OUT_INIT_LOW,     "lcd enable"    },
-       { OVERO_GPIO_BT_NRESET, GPIOF_OUT_INIT_HIGH,    "lcd bl enable" },
-};
-
-static struct regulator_consumer_supply dummy_supplies[] = {
-       REGULATOR_SUPPLY("vddvario", "smsc911x.0"),
-       REGULATOR_SUPPLY("vdd33a", "smsc911x.0"),
-       REGULATOR_SUPPLY("vddvario", "smsc911x.1"),
-       REGULATOR_SUPPLY("vdd33a", "smsc911x.1"),
-};
-
-static void __init overo_init(void)
-{
-       int ret;
-
-       if (strstr(boot_command_line, "omapdss.def_disp=lcd35"))
-               overo_use_lcd35 = true;
-
-       regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies));
-       omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
-       overo_i2c_init();
-       omap_hsmmc_init(mmc);
-       omap_serial_init();
-       omap_sdrc_init(mt46h32m32lf6_sdrc_params,
-                                 mt46h32m32lf6_sdrc_params);
-       board_nand_init(overo_nand_partitions,
-                       ARRAY_SIZE(overo_nand_partitions), NAND_CS, 0, NULL);
-       usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
-       usb_musb_init(NULL);
-
-       usbhs_init_phys(phy_data, ARRAY_SIZE(phy_data));
-       usbhs_init(&usbhs_bdata);
-       overo_spi_init();
-       overo_init_smsc911x();
-       overo_init_led();
-       overo_init_keys();
-       omap_twl4030_audio_init("overo", NULL);
-
-       overo_display_init();
-
-       /* Ensure SDRC pins are mux'd for self-refresh */
-       omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT);
-       omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT);
-
-       ret = gpio_request_one(OVERO_GPIO_W2W_NRESET, GPIOF_OUT_INIT_HIGH,
-                              "OVERO_GPIO_W2W_NRESET");
-       if (ret == 0) {
-               gpio_export(OVERO_GPIO_W2W_NRESET, 0);
-               gpio_set_value(OVERO_GPIO_W2W_NRESET, 0);
-               udelay(10);
-               gpio_set_value(OVERO_GPIO_W2W_NRESET, 1);
-       } else {
-               pr_err("could not obtain gpio for OVERO_GPIO_W2W_NRESET\n");
-       }
-
-       ret = gpio_request_array(overo_bt_gpios, ARRAY_SIZE(overo_bt_gpios));
-       if (ret) {
-               pr_err("%s: could not obtain BT gpios\n", __func__);
-       } else {
-               gpio_export(OVERO_GPIO_BT_XGATE, 0);
-               gpio_export(OVERO_GPIO_BT_NRESET, 0);
-               gpio_set_value(OVERO_GPIO_BT_NRESET, 0);
-               mdelay(6);
-               gpio_set_value(OVERO_GPIO_BT_NRESET, 1);
-       }
-
-       ret = gpio_request_one(OVERO_GPIO_USBH_CPEN, GPIOF_OUT_INIT_HIGH,
-                              "OVERO_GPIO_USBH_CPEN");
-       if (ret == 0)
-               gpio_export(OVERO_GPIO_USBH_CPEN, 0);
-       else
-               pr_err("could not obtain gpio for OVERO_GPIO_USBH_CPEN\n");
-}
-
-MACHINE_START(OVERO, "Gumstix Overo")
-       .atag_offset    = 0x100,
-       .reserve        = omap_reserve,
-       .map_io         = omap3_map_io,
-       .init_early     = omap35xx_init_early,
-       .init_irq       = omap3_init_irq,
-       .init_machine   = overo_init,
-       .init_late      = omap35xx_init_late,
-       .init_time      = omap3_sync32k_timer_init,
-       .restart        = omap3xxx_restart,
-MACHINE_END
index af95a624fe71ea2a6d4f56f2ee11b2d2d51230c6..f008930277edeb4b43c1be595d4571120ad8b0eb 100644 (file)
@@ -112,6 +112,7 @@ struct omap3_control_regs {
        u32 csirxfe;
        u32 iva2_bootaddr;
        u32 iva2_bootmod;
+       u32 wkup_ctrl;
        u32 debobs_0;
        u32 debobs_1;
        u32 debobs_2;
@@ -455,6 +456,7 @@ void omap3_control_save_context(void)
                        omap_ctrl_readl(OMAP343X_CONTROL_IVA2_BOOTADDR);
        control_context.iva2_bootmod =
                        omap_ctrl_readl(OMAP343X_CONTROL_IVA2_BOOTMOD);
+       control_context.wkup_ctrl = omap_ctrl_readl(OMAP34XX_CONTROL_WKUP_CTRL);
        control_context.debobs_0 = omap_ctrl_readl(OMAP343X_CONTROL_DEBOBS(0));
        control_context.debobs_1 = omap_ctrl_readl(OMAP343X_CONTROL_DEBOBS(1));
        control_context.debobs_2 = omap_ctrl_readl(OMAP343X_CONTROL_DEBOBS(2));
@@ -512,6 +514,7 @@ void omap3_control_restore_context(void)
                                        OMAP343X_CONTROL_IVA2_BOOTADDR);
        omap_ctrl_writel(control_context.iva2_bootmod,
                                        OMAP343X_CONTROL_IVA2_BOOTMOD);
+       omap_ctrl_writel(control_context.wkup_ctrl, OMAP34XX_CONTROL_WKUP_CTRL);
        omap_ctrl_writel(control_context.debobs_0, OMAP343X_CONTROL_DEBOBS(0));
        omap_ctrl_writel(control_context.debobs_1, OMAP343X_CONTROL_DEBOBS(1));
        omap_ctrl_writel(control_context.debobs_2, OMAP343X_CONTROL_DEBOBS(2));
index 80d2b7d8e36ed56e76dfb585fb04995e5b04a18b..ec406bc2c6d4a4524b329415fcbe361c9ca88c0a 100644 (file)
 #define OMAP343X_PADCONF_ETK_D15       OMAP343X_PADCONF_ETK(17)
 
 /* 34xx GENERAL_WKUP register offsets */
+#define OMAP34XX_CONTROL_WKUP_CTRL     (OMAP343X_CONTROL_GENERAL_WKUP - 0x4)
+#define OMAP36XX_GPIO_IO_PWRDNZ                BIT(6)
+
 #define OMAP343X_CONTROL_WKUP_DEBOBSMUX(i) (OMAP343X_CONTROL_GENERAL_WKUP + \
                                                0x008 + (i))
 #define OMAP343X_CONTROL_WKUP_DEBOBS0 (OMAP343X_CONTROL_GENERAL_WKUP + 0x008)
index 990338fbaa591274c6a5ade9bbbf055e633decac..a69bd67e9028030372309ee6c80d2265493c4967 100644 (file)
@@ -63,7 +63,7 @@ static int __init omap3_l3_init(void)
 
        WARN(IS_ERR(pdev), "could not build omap_device for %s\n", oh_name);
 
-       return PTR_RET(pdev);
+       return PTR_ERR_OR_ZERO(pdev);
 }
 omap_postcore_initcall(omap3_l3_init);
 
@@ -333,6 +333,6 @@ static int __init omap_gpmc_init(void)
        pdev = omap_device_build("omap-gpmc", -1, oh, NULL, 0);
        WARN(IS_ERR(pdev), "could not build omap_device for %s\n", oh_name);
 
-       return PTR_RET(pdev);
+       return PTR_ERR_OR_ZERO(pdev);
 }
 omap_postcore_initcall(omap_gpmc_init);
index 26e28e94f62582d09b77134aca1ec2533b148856..1f1ecf8807eb9ad8d2e86250d51204491d923f89 100644 (file)
@@ -84,7 +84,7 @@ int __init omap_init_vrfb(void)
        pdev = platform_device_register_resndata(NULL, "omapvrfb", -1,
                        res, num_res, NULL, 0);
 
-       return PTR_RET(pdev);
+       return PTR_ERR_OR_ZERO(pdev);
 }
 #else
 int __init omap_init_vrfb(void) { return 0; }
index f899e77ff5e6e37eca7d131533f3526a13b5d20c..17a6f752a43631c59eb5fd65371672bb26757b00 100644 (file)
@@ -216,11 +216,11 @@ static void omap2_onenand_calc_sync_timings(struct gpmc_timings *t,
 
        div = gpmc_calc_divider(min_gpmc_clk_period);
        gpmc_clk_ns = gpmc_ticks_to_ns(div);
-       if (gpmc_clk_ns < 15) /* >66Mhz */
+       if (gpmc_clk_ns < 15) /* >66MHz */
                onenand_flags |= ONENAND_FLAG_HF;
        else
                onenand_flags &= ~ONENAND_FLAG_HF;
-       if (gpmc_clk_ns < 12) /* >83Mhz */
+       if (gpmc_clk_ns < 12) /* >83MHz */
                onenand_flags |= ONENAND_FLAG_VHF;
        else
                onenand_flags &= ~ONENAND_FLAG_VHF;
index 9a8611ab5dfa60d3bf5e23d6118779db3495ee80..cff079e563f43d3fc3da85933ebe7361f7a17322 100644 (file)
@@ -70,7 +70,7 @@ static void omap_hsmmc1_before_set_reg(struct device *dev,
 
                reg = omap_ctrl_readl(control_pbias_offset);
                if (cpu_is_omap3630()) {
-                       /* Set MMC I/O to 52Mhz */
+                       /* Set MMC I/O to 52MHz */
                        prog_io = omap_ctrl_readl(OMAP343X_CONTROL_PROG_IO1);
                        prog_io |= OMAP3630_PRG_SDMMC1_SPEEDCTRL;
                        omap_ctrl_writel(prog_io, OMAP343X_CONTROL_PROG_IO1);
index 3b56722dfd8a975c77da8e1599207c8b447e290c..8e52621b5a6bf3ab42ddef8a5c3db79c3391fcf1 100644 (file)
@@ -444,7 +444,7 @@ static int wakeupgen_domain_alloc(struct irq_domain *domain,
        return irq_domain_alloc_irqs_parent(domain, virq, nr_irqs, &parent_args);
 }
 
-static struct irq_domain_ops wakeupgen_domain_ops = {
+static const struct irq_domain_ops wakeupgen_domain_ops = {
        .xlate  = wakeupgen_domain_xlate,
        .alloc  = wakeupgen_domain_alloc,
        .free   = irq_domain_free_irqs_common,
index 166b18f515a206ab3747d4eb51d4d1677c3879a2..4a7303cf563e09baeb0ecf473f8aa87cbfc06106 100644 (file)
@@ -224,13 +224,13 @@ static int _omap_device_notifier_call(struct notifier_block *nb,
  */
 static int _omap_device_enable_hwmods(struct omap_device *od)
 {
+       int ret = 0;
        int i;
 
        for (i = 0; i < od->hwmods_cnt; i++)
-               omap_hwmod_enable(od->hwmods[i]);
+               ret |= omap_hwmod_enable(od->hwmods[i]);
 
-       /* XXX pass along return value here? */
-       return 0;
+       return ret;
 }
 
 /**
@@ -241,13 +241,13 @@ static int _omap_device_enable_hwmods(struct omap_device *od)
  */
 static int _omap_device_idle_hwmods(struct omap_device *od)
 {
+       int ret = 0;
        int i;
 
        for (i = 0; i < od->hwmods_cnt; i++)
-               omap_hwmod_idle(od->hwmods[i]);
+               ret |= omap_hwmod_idle(od->hwmods[i]);
 
-       /* XXX pass along return value here? */
-       return 0;
+       return ret;
 }
 
 /* Public functions for use by core code */
@@ -595,18 +595,20 @@ static int _od_runtime_suspend(struct device *dev)
        int ret;
 
        ret = pm_generic_runtime_suspend(dev);
+       if (ret)
+               return ret;
 
-       if (!ret)
-               omap_device_idle(pdev);
-
-       return ret;
+       return omap_device_idle(pdev);
 }
 
 static int _od_runtime_resume(struct device *dev)
 {
        struct platform_device *pdev = to_platform_device(dev);
+       int ret;
 
-       omap_device_enable(pdev);
+       ret = omap_device_enable(pdev);
+       if (ret)
+               return ret;
 
        return pm_generic_runtime_resume(dev);
 }
@@ -743,7 +745,8 @@ int omap_device_enable(struct platform_device *pdev)
 
        ret = _omap_device_enable_hwmods(od);
 
-       od->_state = OMAP_DEVICE_STATE_ENABLED;
+       if (ret == 0)
+               od->_state = OMAP_DEVICE_STATE_ENABLED;
 
        return ret;
 }
@@ -773,7 +776,8 @@ int omap_device_idle(struct platform_device *pdev)
 
        ret = _omap_device_idle_hwmods(od);
 
-       od->_state = OMAP_DEVICE_STATE_IDLE;
+       if (ret == 0)
+               od->_state = OMAP_DEVICE_STATE_IDLE;
 
        return ret;
 }
index 752969ff9de04f95ef8b9a695325901b6297cf78..d78c12e7cb5e1ace5f79a9d28f45321e809dea24 100644 (file)
@@ -3318,16 +3318,17 @@ int omap_hwmod_enable(struct omap_hwmod *oh)
  */
 int omap_hwmod_idle(struct omap_hwmod *oh)
 {
+       int r;
        unsigned long flags;
 
        if (!oh)
                return -EINVAL;
 
        spin_lock_irqsave(&oh->_lock, flags);
-       _idle(oh);
+       r = _idle(oh);
        spin_unlock_irqrestore(&oh->_lock, flags);
 
-       return 0;
+       return r;
 }
 
 /**
@@ -3340,16 +3341,17 @@ int omap_hwmod_idle(struct omap_hwmod *oh)
  */
 int omap_hwmod_shutdown(struct omap_hwmod *oh)
 {
+       int r;
        unsigned long flags;
 
        if (!oh)
                return -EINVAL;
 
        spin_lock_irqsave(&oh->_lock, flags);
-       _shutdown(oh);
+       r = _shutdown(oh);
        spin_unlock_irqrestore(&oh->_lock, flags);
 
-       return 0;
+       return r;
 }
 
 /*
index 9611c91d9b82154e6d5d7f46c75c1b1ab6ffd588..b5d27ec81610333d99868247eebb7ba011e5cca0 100644 (file)
@@ -109,6 +109,12 @@ extern struct omap_hwmod_sysc_fields omap_hwmod_sysc_type3;
 
 #define DEBUG_OMAPUART_FLAGS   (HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET)
 
+#ifdef CONFIG_OMAP_GPMC_DEBUG
+#define DEBUG_OMAP_GPMC_HWMOD_FLAGS    HWMOD_INIT_NO_RESET
+#else
+#define DEBUG_OMAP_GPMC_HWMOD_FLAGS    0
+#endif
+
 #if defined(CONFIG_DEBUG_OMAP2UART1)
 #undef DEBUG_OMAP2UART1_FLAGS
 #define DEBUG_OMAP2UART1_FLAGS DEBUG_OMAPUART_FLAGS
index 8821b9d6bae432859a6415f5686e10f977e92ae4..6dcfd03ced8faf878746245e8aaf4b45ded3a757 100644 (file)
@@ -762,16 +762,8 @@ struct omap_hwmod omap2xxx_gpmc_hwmod = {
        .name           = "gpmc",
        .class          = &omap2xxx_gpmc_hwmod_class,
        .main_clk       = "gpmc_fck",
-       /*
-        * XXX HWMOD_INIT_NO_RESET should not be needed for this IP
-        * block.  It is not being added due to any known bugs with
-        * resetting the GPMC IP block, but rather because any timings
-        * set by the bootloader are not being correctly programmed by
-        * the kernel from the board file or DT data.
-        * HWMOD_INIT_NO_RESET should be removed ASAP.
-        */
-       .flags          = (HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET |
-                          HWMOD_NO_IDLEST),
+       /* Skip reset for CONFIG_OMAP_GPMC_DEBUG for bootloader timings */
+       .flags          = HWMOD_NO_IDLEST | DEBUG_OMAP_GPMC_HWMOD_FLAGS,
        .prcm           = {
                .omap2  = {
                        .prcm_reg_id = 3,
index 130332c0534d341c67de45167e6b81b46a4c3c56..7f737965f543325b8c7fe1a50b4453f09f15b767 100644 (file)
@@ -145,6 +145,7 @@ extern struct omap_hwmod am33xx_uart5_hwmod;
 extern struct omap_hwmod am33xx_uart6_hwmod;
 extern struct omap_hwmod am33xx_wd_timer1_hwmod;
 
+extern struct omap_hwmod_class am33xx_emif_hwmod_class;
 extern struct omap_hwmod_class am33xx_l4_hwmod_class;
 extern struct omap_hwmod_class am33xx_wkup_m3_hwmod_class;
 extern struct omap_hwmod_class am33xx_control_hwmod_class;
index cabc5695b5043dd3c55db960de5103f4dcdbd2f9..907a452b78ea240b07d061993d4355b0dbde01a4 100644 (file)
@@ -202,6 +202,19 @@ struct omap_hwmod am33xx_prcm_hwmod = {
        .clkdm_name     = "l4_wkup_clkdm",
 };
 
+/*
+ * 'emif' class
+ * instance(s): emif
+ */
+static struct omap_hwmod_class_sysconfig am33xx_emif_sysc = {
+       .rev_offs       = 0x0000,
+};
+
+struct omap_hwmod_class am33xx_emif_hwmod_class = {
+       .name           = "emif",
+       .sysc           = &am33xx_emif_sysc,
+};
+
 /*
  * 'aes0' class
  */
@@ -668,7 +681,8 @@ struct omap_hwmod am33xx_gpmc_hwmod = {
        .name           = "gpmc",
        .class          = &am33xx_gpmc_hwmod_class,
        .clkdm_name     = "l3s_clkdm",
-       .flags          = (HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET),
+       /* Skip reset for CONFIG_OMAP_GPMC_DEBUG for bootloader timings */
+       .flags          = DEBUG_OMAP_GPMC_HWMOD_FLAGS,
        .main_clk       = "l3s_gclk",
        .prcm           = {
                .omap4  = {
index 0cf7b563dcd137702921b1033c1215d0108bd811..cc0791d9125be8f5f7ead557665990ee851fbeda 100644 (file)
  * IP blocks
  */
 
-/*
- * 'emif' class
- * instance(s): emif
- */
-static struct omap_hwmod_class_sysconfig am33xx_emif_sysc = {
-       .rev_offs       = 0x0000,
-};
-
-static struct omap_hwmod_class am33xx_emif_hwmod_class = {
-       .name           = "emif",
-       .sysc           = &am33xx_emif_sysc,
-};
-
 /* emif */
 static struct omap_hwmod am33xx_emif_hwmod = {
        .name           = "emif",
index 4e8e93c398db77ac98c235f38cf57354c5f2ab96..dc55f8dedf2c6bb597bddd858d9acd960398fceb 100644 (file)
@@ -2169,16 +2169,8 @@ static struct omap_hwmod omap3xxx_gpmc_hwmod = {
        .clkdm_name     = "core_l3_clkdm",
        .mpu_irqs       = omap3xxx_gpmc_irqs,
        .main_clk       = "gpmc_fck",
-       /*
-        * XXX HWMOD_INIT_NO_RESET should not be needed for this IP
-        * block.  It is not being added due to any known bugs with
-        * resetting the GPMC IP block, but rather because any timings
-        * set by the bootloader are not being correctly programmed by
-        * the kernel from the board file or DT data.
-        * HWMOD_INIT_NO_RESET should be removed ASAP.
-        */
-       .flags          = (HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET |
-                          HWMOD_NO_IDLEST),
+       /* Skip reset for CONFIG_OMAP_GPMC_DEBUG for bootloader timings */
+       .flags          = HWMOD_NO_IDLEST | DEBUG_OMAP_GPMC_HWMOD_FLAGS,
 };
 
 /*
@@ -3744,29 +3736,54 @@ static struct omap_hwmod_ocp_if *omap3xxx_hwmod_ocp_ifs[] __initdata = {
 /* GP-only hwmod links */
 static struct omap_hwmod_ocp_if *omap34xx_gp_hwmod_ocp_ifs[] __initdata = {
        &omap3xxx_l4_sec__timer12,
-       &omap3xxx_l4_core__sham,
-       &omap3xxx_l4_core__aes,
        NULL
 };
 
 static struct omap_hwmod_ocp_if *omap36xx_gp_hwmod_ocp_ifs[] __initdata = {
        &omap3xxx_l4_sec__timer12,
-       &omap3xxx_l4_core__sham,
-       &omap3xxx_l4_core__aes,
        NULL
 };
 
 static struct omap_hwmod_ocp_if *am35xx_gp_hwmod_ocp_ifs[] __initdata = {
        &omap3xxx_l4_sec__timer12,
-       /*
-        * Apparently the SHA/MD5 and AES accelerator IP blocks are
-        * only present on some AM35xx chips, and no one knows which
-        * ones.  See
-        * http://www.spinics.net/lists/arm-kernel/msg215466.html So
-        * if you need these IP blocks on an AM35xx, try uncommenting
-        * the following lines.
-        */
+       NULL
+};
+
+/* crypto hwmod links */
+static struct omap_hwmod_ocp_if *omap34xx_sham_hwmod_ocp_ifs[] __initdata = {
+       &omap3xxx_l4_core__sham,
+       NULL
+};
+
+static struct omap_hwmod_ocp_if *omap34xx_aes_hwmod_ocp_ifs[] __initdata = {
+       &omap3xxx_l4_core__aes,
+       NULL
+};
+
+static struct omap_hwmod_ocp_if *omap36xx_sham_hwmod_ocp_ifs[] __initdata = {
+       &omap3xxx_l4_core__sham,
+       NULL
+};
+
+static struct omap_hwmod_ocp_if *omap36xx_aes_hwmod_ocp_ifs[] __initdata = {
+       &omap3xxx_l4_core__aes,
+       NULL
+};
+
+/*
+ * Apparently the SHA/MD5 and AES accelerator IP blocks are
+ * only present on some AM35xx chips, and no one knows which
+ * ones.  See
+ * http://www.spinics.net/lists/arm-kernel/msg215466.html So
+ * if you need these IP blocks on an AM35xx, try uncommenting
+ * the following lines.
+ */
+static struct omap_hwmod_ocp_if *am35xx_sham_hwmod_ocp_ifs[] __initdata = {
        /* &omap3xxx_l4_core__sham, */
+       NULL
+};
+
+static struct omap_hwmod_ocp_if *am35xx_aes_hwmod_ocp_ifs[] __initdata = {
        /* &omap3xxx_l4_core__aes, */
        NULL
 };
@@ -3868,10 +3885,41 @@ static struct omap_hwmod_ocp_if *omap3xxx_dss_hwmod_ocp_ifs[] __initdata = {
        NULL
 };
 
+/**
+ * omap3xxx_hwmod_is_hs_ip_block_usable - is a security IP block accessible?
+ * @bus: struct device_node * for the top-level OMAP DT data
+ * @dev_name: device name used in the DT file
+ *
+ * Determine whether a "secure" IP block @dev_name is usable by Linux.
+ * There doesn't appear to be a 100% reliable way to determine this,
+ * so we rely on heuristics.  If @bus is null, meaning there's no DT
+ * data, then we only assume the IP block is accessible if the OMAP is
+ * fused as a 'general-purpose' SoC.  If however DT data is present,
+ * test to see if the IP block is described in the DT data and set to
+ * 'status = "okay"'.  If so then we assume the ODM has configured the
+ * OMAP firewalls to allow access to the IP block.
+ *
+ * Return: 0 if device named @dev_name is not likely to be accessible,
+ * or 1 if it is likely to be accessible.
+ */
+static int __init omap3xxx_hwmod_is_hs_ip_block_usable(struct device_node *bus,
+                                                      const char *dev_name)
+{
+       if (!bus)
+               return (omap_type() == OMAP2_DEVICE_TYPE_GP) ? 1 : 0;
+
+       if (of_device_is_available(of_find_node_by_name(bus, dev_name)))
+               return 1;
+
+       return 0;
+}
+
 int __init omap3xxx_hwmod_init(void)
 {
        int r;
-       struct omap_hwmod_ocp_if **h = NULL, **h_gp = NULL;
+       struct omap_hwmod_ocp_if **h = NULL, **h_gp = NULL, **h_sham = NULL;
+       struct omap_hwmod_ocp_if **h_aes = NULL;
+       struct device_node *bus = NULL;
        unsigned int rev;
 
        omap_hwmod_init();
@@ -3893,13 +3941,19 @@ int __init omap3xxx_hwmod_init(void)
            rev == OMAP3430_REV_ES3_1 || rev == OMAP3430_REV_ES3_1_2) {
                h = omap34xx_hwmod_ocp_ifs;
                h_gp = omap34xx_gp_hwmod_ocp_ifs;
+               h_sham = omap34xx_sham_hwmod_ocp_ifs;
+               h_aes = omap34xx_aes_hwmod_ocp_ifs;
        } else if (rev == AM35XX_REV_ES1_0 || rev == AM35XX_REV_ES1_1) {
                h = am35xx_hwmod_ocp_ifs;
                h_gp = am35xx_gp_hwmod_ocp_ifs;
+               h_sham = am35xx_sham_hwmod_ocp_ifs;
+               h_aes = am35xx_aes_hwmod_ocp_ifs;
        } else if (rev == OMAP3630_REV_ES1_0 || rev == OMAP3630_REV_ES1_1 ||
                   rev == OMAP3630_REV_ES1_2) {
                h = omap36xx_hwmod_ocp_ifs;
                h_gp = omap36xx_gp_hwmod_ocp_ifs;
+               h_sham = omap36xx_sham_hwmod_ocp_ifs;
+               h_aes = omap36xx_aes_hwmod_ocp_ifs;
        } else {
                WARN(1, "OMAP3 hwmod family init: unknown chip type\n");
                return -EINVAL;
@@ -3916,6 +3970,25 @@ int __init omap3xxx_hwmod_init(void)
                        return r;
        }
 
+       /*
+        * Register crypto hwmod links only if they are not disabled in DT.
+        * If DT information is missing, enable them only for GP devices.
+        */
+
+       if (of_have_populated_dt())
+               bus = of_find_node_by_name(NULL, "ocp");
+
+       if (h_sham && omap3xxx_hwmod_is_hs_ip_block_usable(bus, "sham")) {
+               r = omap_hwmod_register_links(h_sham);
+               if (r < 0)
+                       return r;
+       }
+
+       if (h_aes && omap3xxx_hwmod_is_hs_ip_block_usable(bus, "aes")) {
+               r = omap_hwmod_register_links(h_aes);
+               if (r < 0)
+                       return r;
+       }
 
        /*
         * Register hwmod links specific to certain ES levels of a
index 17e8004fc20f9e48c69722c32643f7684b7c9eb2..215d5efa0dba1d3c3773332ce4db315554df318e 100644 (file)
 
 
 /* IP blocks */
+static struct omap_hwmod am43xx_emif_hwmod = {
+       .name           = "emif",
+       .class          = &am33xx_emif_hwmod_class,
+       .clkdm_name     = "emif_clkdm",
+       .flags          = HWMOD_INIT_NO_IDLE,
+       .main_clk       = "dpll_ddr_m2_ck",
+       .prcm           = {
+               .omap4  = {
+                       .clkctrl_offs   = AM43XX_CM_PER_EMIF_CLKCTRL_OFFSET,
+                       .modulemode     = MODULEMODE_SWCTRL,
+               },
+       },
+};
+
 static struct omap_hwmod am43xx_l4_hs_hwmod = {
        .name           = "l4_hs",
        .class          = &am33xx_l4_hwmod_class,
@@ -583,6 +597,13 @@ static struct omap_hwmod am43xx_vpfe1_hwmod = {
 };
 
 /* Interfaces */
+static struct omap_hwmod_ocp_if am43xx_l3_main__emif = {
+       .master         = &am33xx_l3_main_hwmod,
+       .slave          = &am43xx_emif_hwmod,
+       .clk            = "dpll_core_m4_ck",
+       .user           = OCP_USER_MPU | OCP_USER_SDMA,
+};
+
 static struct omap_hwmod_ocp_if am43xx_l3_main__l4_hs = {
        .master         = &am33xx_l3_main_hwmod,
        .slave          = &am43xx_l4_hs_hwmod,
@@ -918,6 +939,7 @@ static struct omap_hwmod_ocp_if *am43xx_hwmod_ocp_ifs[] __initdata = {
        &am33xx_l3_main__l3_instr,
        &am33xx_l3_main__gfx,
        &am33xx_l3_s__l3_main,
+       &am43xx_l3_main__emif,
        &am33xx_pruss__l3_main,
        &am43xx_wkup_m3__l4_wkup,
        &am33xx_gfx__l3_main,
index f5e68a7820251360dc1aad459e259ee1c6d217ae..43eebf2c59e2f71a375cdbc5d3dbf227f7b99378 100644 (file)
@@ -1188,15 +1188,8 @@ static struct omap_hwmod omap44xx_gpmc_hwmod = {
        .name           = "gpmc",
        .class          = &omap44xx_gpmc_hwmod_class,
        .clkdm_name     = "l3_2_clkdm",
-       /*
-        * XXX HWMOD_INIT_NO_RESET should not be needed for this IP
-        * block.  It is not being added due to any known bugs with
-        * resetting the GPMC IP block, but rather because any timings
-        * set by the bootloader are not being correctly programmed by
-        * the kernel from the board file or DT data.
-        * HWMOD_INIT_NO_RESET should be removed ASAP.
-        */
-       .flags          = HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET,
+       /* Skip reset for CONFIG_OMAP_GPMC_DEBUG for bootloader timings */
+       .flags          = DEBUG_OMAP_GPMC_HWMOD_FLAGS,
        .prcm = {
                .omap4 = {
                        .clkctrl_offs = OMAP4_CM_L3_2_GPMC_CLKCTRL_OFFSET,
index 0e64c2fac0b5fad2c92af76a2042a1080108fc04..a0411f32e8b140d54fd0e5f2c4b6a860bd5db699 100644 (file)
@@ -819,8 +819,8 @@ static struct omap_hwmod dra7xx_gpmc_hwmod = {
        .name           = "gpmc",
        .class          = &dra7xx_gpmc_hwmod_class,
        .clkdm_name     = "l3main1_clkdm",
-       .flags          = (HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET |
-                          HWMOD_SWSUP_SIDLE),
+       /* Skip reset for CONFIG_OMAP_GPMC_DEBUG for bootloader timings */
+       .flags          = HWMOD_SWSUP_SIDLE | DEBUG_OMAP_GPMC_HWMOD_FLAGS,
        .main_clk       = "l3_iclk_div",
        .prcm = {
                .omap4 = {
index cab1eb61ac96ef5c2599e85c04f242ad5d54bbf3..c92413769144820f24e1a2cff369ff7910e06f2e 100644 (file)
@@ -478,6 +478,8 @@ static struct omap_hwmod dm81xx_gpmc_hwmod = {
        .clkdm_name     = "alwon_l3s_clkdm",
        .class          = &dm81xx_gpmc_hwmod_class,
        .main_clk       = "sysclk6_ck",
+       /* Skip reset for CONFIG_OMAP_GPMC_DEBUG for bootloader timings */
+       .flags          = DEBUG_OMAP_GPMC_HWMOD_FLAGS,
        .prcm = {
                .omap4 = {
                        .clkctrl_offs = DM816X_CM_ALWON_GPMC_CLKCTRL,
index 0e75ec3e114b0e812a3016ca340010b5321789d7..b2233b72b24d71e2a28144702da5341d56fbd56a 100644 (file)
@@ -116,7 +116,7 @@ const struct prcm_config omap2430_rate_table[] = {
                RATE_IN_243X},
 
        /* PRCM-boot/bypass */
-       {S13M, S13M, S13M, RB_CM_CLKSEL_MPU_VAL,                /* 13Mhz */
+       {S13M, S13M, S13M, RB_CM_CLKSEL_MPU_VAL,                /* 13MHz */
                RB_CM_CLKSEL_DSP_VAL, RB_CM_CLKSEL_GFX_VAL,
                RB_CM_CLKSEL1_CORE_VAL, MB_CM_CLKSEL1_PLL_13_VAL,
                MX_CLKSEL2_PLL_2x_VAL, RB_CM_CLKSEL_MDM_VAL,
@@ -124,7 +124,7 @@ const struct prcm_config omap2430_rate_table[] = {
                RATE_IN_243X},
 
        /* PRCM-boot/bypass */
-       {S12M, S12M, S12M, RB_CM_CLKSEL_MPU_VAL,                /* 12Mhz */
+       {S12M, S12M, S12M, RB_CM_CLKSEL_MPU_VAL,                /* 12MHz */
                RB_CM_CLKSEL_DSP_VAL, RB_CM_CLKSEL_GFX_VAL,
                RB_CM_CLKSEL1_CORE_VAL, MB_CM_CLKSEL1_PLL_12_VAL,
                MX_CLKSEL2_PLL_2x_VAL, RB_CM_CLKSEL_MDM_VAL,
index af11511dda50bd239dbba1aa6710d15c022e2e77..821171cf6b7dfbed55ced2ac437afdd783c453ed 100644 (file)
@@ -44,6 +44,27 @@ static void __init omap2420_n8x0_legacy_init(void)
 #endif
 
 #ifdef CONFIG_ARCH_OMAP3
+/*
+ * Configures GPIOs 126, 127 and 129 to 1.8V mode instead of 3.0V
+ * mode for MMC1 in case bootloader did not configure things.
+ * Note that if the pins are used for MMC1, pbias-regulator
+ * manages the IO voltage.
+ */
+static void __init omap3_gpio126_127_129(void)
+{
+       u32 reg;
+
+       reg = omap_ctrl_readl(OMAP343X_CONTROL_PBIAS_LITE);
+       reg &= ~OMAP343X_PBIASLITEVMODE1;
+       reg |= OMAP343X_PBIASLITEPWRDNZ1;
+       omap_ctrl_writel(reg, OMAP343X_CONTROL_PBIAS_LITE);
+       if (cpu_is_omap3630()) {
+               reg = omap_ctrl_readl(OMAP34XX_CONTROL_WKUP_CTRL);
+               reg |= OMAP36XX_GPIO_IO_PWRDNZ;
+               omap_ctrl_writel(reg, OMAP34XX_CONTROL_WKUP_CTRL);
+       }
+}
+
 static void __init hsmmc2_internal_input_clk(void)
 {
        u32 reg;
@@ -356,6 +377,7 @@ static struct pdata_init pdata_quirks[] __initdata = {
        { "nokia,omap3-n950", hsmmc2_internal_input_clk, },
        { "isee,omap3-igep0020-rev-f", omap3_igep0020_rev_f_legacy_init, },
        { "isee,omap3-igep0030-rev-g", omap3_igep0030_rev_g_legacy_init, },
+       { "logicpd,dm3730-torpedo-devkit", omap3_gpio126_127_129, },
        { "ti,omap3-evm-37xx", omap3_evm_legacy_init, },
        { "ti,am3517-evm", am3517_evm_legacy_init, },
        { "technexion,omap3-tao3530", omap3_tao3530_legacy_init, },
index a69e9a33cb6d1cf2a1d09af036411311f1e7af57..d2adfebd3b3fb4141f5ce279bb30a2fc8e7cf5c6 100644 (file)
@@ -55,7 +55,7 @@ static int __init omap2_init_pmu(unsigned oh_num, char *oh_names[])
        WARN(IS_ERR(omap_pmu_dev), "Can't build omap_device for %s.\n",
             dev_name);
 
-       return PTR_RET(omap_pmu_dev);
+       return PTR_ERR_OR_ZERO(omap_pmu_dev);
 }
 
 static int __init omap_init_pmu(void)
index d0261996db6d5e0e0f91f40e9429b4c9ea73a4c8..7eebc27fa89219b3138dfb968a20f26b0edee565 100644 (file)
 #define AM43XX_CM_PER_HDQ1W_CLKCTRL_OFFSET             0x04a0
 #define AM43XX_CM_PER_VPFE0_CLKCTRL_OFFSET             0x0068
 #define AM43XX_CM_PER_VPFE1_CLKCTRL_OFFSET             0x0070
+#define AM43XX_CM_PER_EMIF_CLKCTRL_OFFSET              0x0720
+
 #endif
index ae3f1553158d746b4f7edade9e4943064fcb6d07..339b0ecb7c327dc27bf7c14c7d793a2e3eb2ada3 100644 (file)
@@ -164,6 +164,6 @@ void omap2xxx_sdrc_init_params(u32 force_lock_to_unlock_mode)
        mem_timings.slow_dll_ctrl |=
                ((mem_timings.fast_dll_ctrl & 0xF) | (1 << 2));
 
-       /* 90 degree phase for anything below 133Mhz + disable DLL filter */
+       /* 90 degree phase for anything below 133MHz + disable DLL filter */
        mem_timings.slow_dll_ctrl |= ((1 << 1) | (3 << 8));
 }
index 57dee0c7cd2b3d57af4b11b3dcbb9ef156ecfd58..5fb50fe541539c1b1a182c480c54cf21cb47d03f 100644 (file)
@@ -203,7 +203,7 @@ static int __init omap_serial_early_init(void)
                if (cmdline_find_option(uart_name)) {
                        console_uart_id = uart->num;
 
-                       if (console_loglevel >= 10) {
+                       if (console_loglevel >= CONSOLE_LOGLEVEL_DEBUG) {
                                uart_debug = true;
                                pr_info("%s used as console in debug mode: uart%d clocks will not be gated",
                                        uart_name, uart->num);
index d1dedc8195ed2569508e0d522301bdf535aefda8..eafd120b53f1bc15c82f2cc47dc8033e31ca566e 100644 (file)
@@ -203,23 +203,8 @@ save_context_wfi:
         */
        ldr     r1, kernel_flush
        blx     r1
-       /*
-        * The kernel doesn't interwork: v7_flush_dcache_all in particluar will
-        * always return in Thumb state when CONFIG_THUMB2_KERNEL is enabled.
-        * This sequence switches back to ARM.  Note that .align may insert a
-        * nop: bx pc needs to be word-aligned in order to work.
-        */
- THUMB(        .thumb          )
- THUMB(        .align          )
- THUMB(        bx      pc      )
- THUMB(        nop             )
-       .arm
-
        b       omap3_do_wfi
-
-/*
- * Local variables
- */
+ENDPROC(omap34xx_cpu_suspend)
 omap3_do_wfi_sram_addr:
        .word omap3_do_wfi_sram
 kernel_flush:
@@ -364,10 +349,7 @@ exit_nonoff_modes:
  * ===================================
  */
        ldmfd   sp!, {r4 - r11, pc}     @ restore regs and return
-
-/*
- * Local variables
- */
+ENDPROC(omap3_do_wfi)
 sdrc_power:
        .word   SDRC_POWER_V
 cm_idlest1_core:
index 2c88ff2d0236afd35a6748fb452c234906f9ba6c..53a2537cd75a9363c3c1766cd719341caf201ae1 100644 (file)
@@ -64,7 +64,7 @@ ENTRY(omap242x_sram_ddr_init)
        mvn     r9, #0x4                @ mask to get clear bit2
        and     r10, r10, r9            @ clear bit2 for lock mode.
        orr     r10, r10, #0x8          @ make sure DLL on (es2 bit pos)
-       orr     r10, r10, #0x2          @ 90 degree phase for all below 133Mhz
+       orr     r10, r10, #0x2          @ 90 degree phase for all below 133MHz
        str     r10, [r11]              @ commit to DLLA_CTRL
        bl      i_dll_wait              @ wait for dll to lock
 
index d5deb9761fc7ee6fc2ad0e223df5344078a3877f..b3edd6f7f7dba8004f06ac607f959a3765d79e33 100644 (file)
@@ -64,7 +64,7 @@ ENTRY(omap243x_sram_ddr_init)
        mvn     r9, #0x4                @ mask to get clear bit2
        and     r10, r10, r9            @ clear bit2 for lock mode.
        orr     r10, r10, #0x8          @ make sure DLL on (es2 bit pos)
-       orr     r10, r10, #0x2          @ 90 degree phase for all below 133Mhz
+       orr     r10, r10, #0x2          @ 90 degree phase for all below 133MHz
        str     r10, [r11]              @ commit to DLLA_CTRL
        bl      i_dll_wait              @ wait for dll to lock
 
index d86fe33c5f538a206ed26421b54482d9058b1b3b..209d9fc5c16cf49909434ac243c1f794f3d22f81 100644 (file)
@@ -15,7 +15,6 @@
  * ready for them to initialise.
  */
 ENTRY(sirfsoc_secondary_startup)
-       bl v7_invalidate_l1
         mrc     p15, 0, r0, c0, c0, 5
         and     r0, r0, #15
         adr     r4, 1f
index 4087d334ecdfc6e36ace6ed23ce30fb9198ee6ef..2ceed407eda975141643e9ba973cae4a9e221390 100644 (file)
@@ -3,16 +3,15 @@
 #
 
 # Common support (must be linked before board specific support)
-obj-y                          += clock.o devices.o generic.o irq.o \
-                                  reset.o
+obj-y                          += devices.o generic.o irq.o reset.o
 obj-$(CONFIG_PM)               += pm.o sleep.o standby.o
 
 # Generic drivers that other drivers may depend upon
 
 # SoC-specific code
-obj-$(CONFIG_PXA25x)           += mfp-pxa2xx.o clock-pxa2xx.o pxa2xx.o pxa25x.o
-obj-$(CONFIG_PXA27x)           += mfp-pxa2xx.o clock-pxa2xx.o pxa2xx.o pxa27x.o
-obj-$(CONFIG_PXA3xx)           += mfp-pxa3xx.o clock-pxa3xx.o pxa3xx.o smemc.o pxa3xx-ulpi.o
+obj-$(CONFIG_PXA25x)           += mfp-pxa2xx.o pxa2xx.o pxa25x.o
+obj-$(CONFIG_PXA27x)           += mfp-pxa2xx.o pxa2xx.o pxa27x.o
+obj-$(CONFIG_PXA3xx)           += mfp-pxa3xx.o pxa3xx.o smemc.o pxa3xx-ulpi.o
 obj-$(CONFIG_CPU_PXA300)       += pxa300.o
 obj-$(CONFIG_CPU_PXA320)       += pxa320.o
 obj-$(CONFIG_CPU_PXA930)       += pxa930.o
diff --git a/arch/arm/mach-pxa/clock-pxa2xx.c b/arch/arm/mach-pxa/clock-pxa2xx.c
deleted file mode 100644 (file)
index 9ee2ad6..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * linux/arch/arm/mach-pxa/clock-pxa2xx.c
- *
- * 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/module.h>
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/io.h>
-#include <linux/syscore_ops.h>
-
-#include <mach/pxa2xx-regs.h>
-
-#include "clock.h"
-
-void clk_pxa2xx_cken_enable(struct clk *clk)
-{
-       CKEN |= 1 << clk->cken;
-}
-
-void clk_pxa2xx_cken_disable(struct clk *clk)
-{
-       CKEN &= ~(1 << clk->cken);
-}
-
-const struct clkops clk_pxa2xx_cken_ops = {
-       .enable         = clk_pxa2xx_cken_enable,
-       .disable        = clk_pxa2xx_cken_disable,
-};
-
-#ifdef CONFIG_PM
-static uint32_t saved_cken;
-
-static int pxa2xx_clock_suspend(void)
-{
-       saved_cken = CKEN;
-       return 0;
-}
-
-static void pxa2xx_clock_resume(void)
-{
-       CKEN = saved_cken;
-}
-#else
-#define pxa2xx_clock_suspend   NULL
-#define pxa2xx_clock_resume    NULL
-#endif
-
-struct syscore_ops pxa2xx_clock_syscore_ops = {
-       .suspend        = pxa2xx_clock_suspend,
-       .resume         = pxa2xx_clock_resume,
-};
diff --git a/arch/arm/mach-pxa/clock-pxa3xx.c b/arch/arm/mach-pxa/clock-pxa3xx.c
deleted file mode 100644 (file)
index d4e9499..0000000
+++ /dev/null
@@ -1,212 +0,0 @@
-/*
- * linux/arch/arm/mach-pxa/clock-pxa3xx.c
- *
- * 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/module.h>
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/io.h>
-#include <linux/syscore_ops.h>
-
-#include <mach/smemc.h>
-#include <mach/pxa3xx-regs.h>
-
-#include "clock.h"
-
-/* Crystal clock: 13MHz */
-#define BASE_CLK       13000000
-
-/* Ring Oscillator Clock: 60MHz */
-#define RO_CLK         60000000
-
-#define ACCR_D0CS      (1 << 26)
-#define ACCR_PCCE      (1 << 11)
-
-/* crystal frequency to HSIO bus frequency multiplier (HSS) */
-static unsigned char hss_mult[4] = { 8, 12, 16, 24 };
-
-/*
- * Get the clock frequency as reflected by CCSR and the turbo flag.
- * We assume these values have been applied via a fcs.
- * If info is not 0 we also display the current settings.
- */
-unsigned int pxa3xx_get_clk_frequency_khz(int info)
-{
-       unsigned long acsr, xclkcfg;
-       unsigned int t, xl, xn, hss, ro, XL, XN, CLK, HSS;
-
-       /* Read XCLKCFG register turbo bit */
-       __asm__ __volatile__("mrc\tp14, 0, %0, c6, c0, 0" : "=r"(xclkcfg));
-       t = xclkcfg & 0x1;
-
-       acsr = ACSR;
-
-       xl  = acsr & 0x1f;
-       xn  = (acsr >> 8) & 0x7;
-       hss = (acsr >> 14) & 0x3;
-
-       XL = xl * BASE_CLK;
-       XN = xn * XL;
-
-       ro = acsr & ACCR_D0CS;
-
-       CLK = (ro) ? RO_CLK : ((t) ? XN : XL);
-       HSS = (ro) ? RO_CLK : hss_mult[hss] * BASE_CLK;
-
-       if (info) {
-               pr_info("RO Mode clock: %d.%02dMHz (%sactive)\n",
-                       RO_CLK / 1000000, (RO_CLK % 1000000) / 10000,
-                       (ro) ? "" : "in");
-               pr_info("Run Mode clock: %d.%02dMHz (*%d)\n",
-                       XL / 1000000, (XL % 1000000) / 10000, xl);
-               pr_info("Turbo Mode clock: %d.%02dMHz (*%d, %sactive)\n",
-                       XN / 1000000, (XN % 1000000) / 10000, xn,
-                       (t) ? "" : "in");
-               pr_info("HSIO bus clock: %d.%02dMHz\n",
-                       HSS / 1000000, (HSS % 1000000) / 10000);
-       }
-
-       return CLK / 1000;
-}
-
-/*
- * Return the current AC97 clock frequency.
- */
-static unsigned long clk_pxa3xx_ac97_getrate(struct clk *clk)
-{
-       unsigned long rate = 312000000;
-       unsigned long ac97_div;
-
-       ac97_div = AC97_DIV;
-
-       /* This may loose precision for some rates but won't for the
-        * standard 24.576MHz.
-        */
-       rate /= (ac97_div >> 12) & 0x7fff;
-       rate *= (ac97_div & 0xfff);
-
-       return rate;
-}
-
-/*
- * Return the current HSIO bus clock frequency
- */
-static unsigned long clk_pxa3xx_hsio_getrate(struct clk *clk)
-{
-       unsigned long acsr;
-       unsigned int hss, hsio_clk;
-
-       acsr = ACSR;
-
-       hss = (acsr >> 14) & 0x3;
-       hsio_clk = (acsr & ACCR_D0CS) ? RO_CLK : hss_mult[hss] * BASE_CLK;
-
-       return hsio_clk;
-}
-
-/* crystal frequency to static memory controller multiplier (SMCFS) */
-static unsigned int smcfs_mult[8] = { 6, 0, 8, 0, 0, 16, };
-static unsigned int df_clkdiv[4] = { 1, 2, 4, 1 };
-
-static unsigned long clk_pxa3xx_smemc_getrate(struct clk *clk)
-{
-       unsigned long acsr = ACSR;
-       unsigned long memclkcfg = __raw_readl(MEMCLKCFG);
-
-       return BASE_CLK * smcfs_mult[(acsr >> 23) & 0x7] /
-                       df_clkdiv[(memclkcfg >> 16) & 0x3];
-}
-
-void clk_pxa3xx_cken_enable(struct clk *clk)
-{
-       unsigned long mask = 1ul << (clk->cken & 0x1f);
-
-       if (clk->cken < 32)
-               CKENA |= mask;
-       else if (clk->cken < 64)
-               CKENB |= mask;
-       else
-               CKENC |= mask;
-}
-
-void clk_pxa3xx_cken_disable(struct clk *clk)
-{
-       unsigned long mask = 1ul << (clk->cken & 0x1f);
-
-       if (clk->cken < 32)
-               CKENA &= ~mask;
-       else if (clk->cken < 64)
-               CKENB &= ~mask;
-       else
-               CKENC &= ~mask;
-}
-
-const struct clkops clk_pxa3xx_cken_ops = {
-       .enable         = clk_pxa3xx_cken_enable,
-       .disable        = clk_pxa3xx_cken_disable,
-};
-
-const struct clkops clk_pxa3xx_hsio_ops = {
-       .enable         = clk_pxa3xx_cken_enable,
-       .disable        = clk_pxa3xx_cken_disable,
-       .getrate        = clk_pxa3xx_hsio_getrate,
-};
-
-const struct clkops clk_pxa3xx_ac97_ops = {
-       .enable         = clk_pxa3xx_cken_enable,
-       .disable        = clk_pxa3xx_cken_disable,
-       .getrate        = clk_pxa3xx_ac97_getrate,
-};
-
-const struct clkops clk_pxa3xx_smemc_ops = {
-       .enable         = clk_pxa3xx_cken_enable,
-       .disable        = clk_pxa3xx_cken_disable,
-       .getrate        = clk_pxa3xx_smemc_getrate,
-};
-
-static void clk_pout_enable(struct clk *clk)
-{
-       OSCC |= OSCC_PEN;
-}
-
-static void clk_pout_disable(struct clk *clk)
-{
-       OSCC &= ~OSCC_PEN;
-}
-
-const struct clkops clk_pxa3xx_pout_ops = {
-       .enable         = clk_pout_enable,
-       .disable        = clk_pout_disable,
-};
-
-#ifdef CONFIG_PM
-static uint32_t cken[2];
-static uint32_t accr;
-
-static int pxa3xx_clock_suspend(void)
-{
-       cken[0] = CKENA;
-       cken[1] = CKENB;
-       accr = ACCR;
-       return 0;
-}
-
-static void pxa3xx_clock_resume(void)
-{
-       ACCR = accr;
-       CKENA = cken[0];
-       CKENB = cken[1];
-}
-#else
-#define pxa3xx_clock_suspend   NULL
-#define pxa3xx_clock_resume    NULL
-#endif
-
-struct syscore_ops pxa3xx_clock_syscore_ops = {
-       .suspend        = pxa3xx_clock_suspend,
-       .resume         = pxa3xx_clock_resume,
-};
diff --git a/arch/arm/mach-pxa/clock.c b/arch/arm/mach-pxa/clock.c
deleted file mode 100644 (file)
index 4d46610..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- *  linux/arch/arm/mach-sa1100/clock.c
- */
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/clk.h>
-#include <linux/spinlock.h>
-#include <linux/delay.h>
-#include <linux/clkdev.h>
-
-#include "clock.h"
-
-static DEFINE_SPINLOCK(clocks_lock);
-
-int clk_enable(struct clk *clk)
-{
-       unsigned long flags;
-
-       spin_lock_irqsave(&clocks_lock, flags);
-       if (clk->enabled++ == 0)
-               clk->ops->enable(clk);
-       spin_unlock_irqrestore(&clocks_lock, flags);
-
-       if (clk->delay)
-               udelay(clk->delay);
-
-       return 0;
-}
-EXPORT_SYMBOL(clk_enable);
-
-void clk_disable(struct clk *clk)
-{
-       unsigned long flags;
-
-       WARN_ON(clk->enabled == 0);
-
-       spin_lock_irqsave(&clocks_lock, flags);
-       if (--clk->enabled == 0)
-               clk->ops->disable(clk);
-       spin_unlock_irqrestore(&clocks_lock, flags);
-}
-EXPORT_SYMBOL(clk_disable);
-
-unsigned long clk_get_rate(struct clk *clk)
-{
-       unsigned long rate;
-
-       rate = clk->rate;
-       if (clk->ops->getrate)
-               rate = clk->ops->getrate(clk);
-
-       return rate;
-}
-EXPORT_SYMBOL(clk_get_rate);
-
-int clk_set_rate(struct clk *clk, unsigned long rate)
-{
-       unsigned long flags;
-       int ret = -EINVAL;
-
-       if (clk->ops->setrate) {
-               spin_lock_irqsave(&clocks_lock, flags);
-               ret = clk->ops->setrate(clk, rate);
-               spin_unlock_irqrestore(&clocks_lock, flags);
-       }
-
-       return ret;
-}
-EXPORT_SYMBOL(clk_set_rate);
-
-void clk_dummy_enable(struct clk *clk)
-{
-}
-
-void clk_dummy_disable(struct clk *clk)
-{
-}
-
-const struct clkops clk_dummy_ops = {
-       .enable         = clk_dummy_enable,
-       .disable        = clk_dummy_disable,
-};
-
-struct clk clk_dummy = {
-       .ops            = &clk_dummy_ops,
-};
diff --git a/arch/arm/mach-pxa/clock.h b/arch/arm/mach-pxa/clock.h
deleted file mode 100644 (file)
index 1f65d32..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-#include <linux/clkdev.h>
-#include <linux/syscore_ops.h>
-
-struct clkops {
-       void                    (*enable)(struct clk *);
-       void                    (*disable)(struct clk *);
-       unsigned long           (*getrate)(struct clk *);
-       int                     (*setrate)(struct clk *, unsigned long);
-};
-
-struct clk {
-       const struct clkops     *ops;
-       unsigned long           rate;
-       unsigned int            cken;
-       unsigned int            delay;
-       unsigned int            enabled;
-};
-
-void clk_dummy_enable(struct clk *);
-void clk_dummy_disable(struct clk *);
-
-extern const struct clkops clk_dummy_ops;
-extern struct clk clk_dummy;
-
-#define INIT_CLKREG(_clk,_devname,_conname)            \
-       {                                               \
-               .clk            = _clk,                 \
-               .dev_id         = _devname,             \
-               .con_id         = _conname,             \
-       }
-
-#define DEFINE_CK(_name, _cken, _ops)                  \
-struct clk clk_##_name = {                             \
-               .ops    = _ops,                         \
-               .cken   = CKEN_##_cken,                 \
-       }
-
-#define DEFINE_CLK(_name, _ops, _rate, _delay)         \
-struct clk clk_##_name = {                             \
-               .ops    = _ops,                         \
-               .rate   = _rate,                        \
-               .delay  = _delay,                       \
-       }
-
-#define DEFINE_PXA2_CKEN(_name, _cken, _rate, _delay)  \
-struct clk clk_##_name = {                             \
-               .ops    = &clk_pxa2xx_cken_ops,         \
-               .rate   = _rate,                        \
-               .cken   = CKEN_##_cken,                 \
-               .delay  = _delay,                       \
-       }
-
-extern const struct clkops clk_pxa2xx_cken_ops;
-
-void clk_pxa2xx_cken_enable(struct clk *clk);
-void clk_pxa2xx_cken_disable(struct clk *clk);
-
-extern struct syscore_ops pxa2xx_clock_syscore_ops;
-
-#if defined(CONFIG_PXA3xx)
-#define DEFINE_PXA3_CKEN(_name, _cken, _rate, _delay)  \
-struct clk clk_##_name = {                             \
-               .ops    = &clk_pxa3xx_cken_ops,         \
-               .rate   = _rate,                        \
-               .cken   = CKEN_##_cken,                 \
-               .delay  = _delay,                       \
-       }
-
-extern const struct clkops clk_pxa3xx_cken_ops;
-extern const struct clkops clk_pxa3xx_hsio_ops;
-extern const struct clkops clk_pxa3xx_ac97_ops;
-extern const struct clkops clk_pxa3xx_pout_ops;
-extern const struct clkops clk_pxa3xx_smemc_ops;
-
-extern void clk_pxa3xx_cken_enable(struct clk *);
-extern void clk_pxa3xx_cken_disable(struct clk *);
-
-extern struct syscore_ops pxa3xx_clock_syscore_ops;
-
-#endif
index cfb864173ce33b13ea01a5cab8321c0fc9f4131f..11863be590665a5ca41736a9e546f377e8bfdbc6 100644 (file)
@@ -12,6 +12,7 @@
 
 #include <linux/kernel.h>
 #include <linux/init.h>
+#include <linux/clk-provider.h>
 #include <linux/gpio.h>
 #include <linux/delay.h>
 #include <linux/platform_device.h>
@@ -39,7 +40,6 @@
 
 #include "devices.h"
 #include "generic.h"
-#include "clock.h"
 
 /* Only e800 has 128MB RAM */
 void __init eseries_fixup(struct tag *tags, char **cmdline)
@@ -125,27 +125,9 @@ struct resource eseries_tmio_resources[] = {
 };
 
 /* Some e-series hardware cannot control the 32K clock */
-static void clk_32k_dummy(struct clk *clk)
-{
-}
-
-static const struct clkops clk_32k_dummy_ops = {
-       .enable         = clk_32k_dummy,
-       .disable        = clk_32k_dummy,
-};
-
-static struct clk tmio_dummy_clk = {
-       .ops    = &clk_32k_dummy_ops,
-       .rate   = 32768,
-};
-
-static struct clk_lookup eseries_clkregs[] = {
-       INIT_CLKREG(&tmio_dummy_clk, NULL, "CLK_CK32K"),
-};
-
 static void __init eseries_register_clks(void)
 {
-       clkdev_add_table(eseries_clkregs, ARRAY_SIZE(eseries_clkregs));
+       clk_register_fixed_rate(NULL, "CLK_CK32K", NULL, CLK_IS_ROOT, 32768);
 }
 
 #ifdef CONFIG_MACH_E330
@@ -683,7 +665,7 @@ static unsigned long e750_pin_config[] __initdata = {
        /* PC Card */
        GPIO8_GPIO,   /* CD0 */
        GPIO44_GPIO,  /* CD1 */
-       GPIO11_GPIO,  /* IRQ0 */
+       /* GPIO11_GPIO,  IRQ0 */
        GPIO6_GPIO,   /* IRQ1 */
        GPIO27_GPIO,  /* RST0 */
        GPIO24_GPIO,  /* RST1 */
@@ -778,6 +760,9 @@ static unsigned long e800_pin_config[] __initdata = {
        GPIO29_AC97_SDATA_IN_0,
        GPIO30_AC97_SDATA_OUT,
        GPIO31_AC97_SYNC,
+
+       /* tc6393xb */
+       GPIO11_3_6MHz,
 };
 
 static struct w100_gen_regs e800_lcd_regs = {
index 04b013fbc98f46a02ae227fe86c631fa26985caa..ec510ecf83702f90d376369e799ab97d0bd5780b 100644 (file)
@@ -63,6 +63,12 @@ EXPORT_SYMBOL(get_clock_tick_rate);
  */
 void __init pxa_timer_init(void)
 {
+       if (cpu_is_pxa25x())
+               pxa25x_clocks_init();
+       if (cpu_is_pxa27x())
+               pxa27x_clocks_init();
+       if (cpu_is_pxa3xx())
+               pxa3xx_clocks_init();
        pxa_timer_nodt_init(IRQ_OST0, io_p2v(0x40a00000),
                            get_clock_tick_rate());
 }
index 7a9fa1aa4e41838d05ae1a72354572e12fb8581c..0b1dbb54871aaa9f465bd6dcd0095f0fc8f8ba08 100644 (file)
@@ -26,17 +26,20 @@ extern void pxa_timer_init(void);
 #define ARRAY_AND_SIZE(x)      (x), ARRAY_SIZE(x)
 
 #define pxa25x_handle_irq icip_handle_irq
+extern int __init pxa25x_clocks_init(void);
 extern void __init pxa25x_init_irq(void);
 extern void __init pxa25x_map_io(void);
 extern void __init pxa26x_init_irq(void);
 
 #define pxa27x_handle_irq ichp_handle_irq
+extern int __init pxa27x_clocks_init(void);
 extern void __init pxa27x_dt_init_irq(void);
 extern unsigned        pxa27x_get_clk_frequency_khz(int);
 extern void __init pxa27x_init_irq(void);
 extern void __init pxa27x_map_io(void);
 
 #define pxa3xx_handle_irq ichp_handle_irq
+extern int __init pxa3xx_clocks_init(void);
 extern void __init pxa3xx_dt_init_irq(void);
 extern void __init pxa3xx_init_irq(void);
 extern void __init pxa3xx_map_io(void);
index 89a7c06570d3adf248a00bf07c3c3aff631d23cf..98608c5575cb7cdc31d83386334db2ff7b523a25 100644 (file)
@@ -138,7 +138,7 @@ static int pxa_irq_map(struct irq_domain *h, unsigned int virq,
        return 0;
 }
 
-static struct irq_domain_ops pxa_irq_ops = {
+static const struct irq_domain_ops pxa_irq_ops = {
        .map    = pxa_irq_map,
        .xlate  = irq_domain_xlate_onecell,
 };
index 4ac9ab80d24bdf147c23a4f31ab85d76cb4a82c5..2d4bf1fb73120fb561416602e26fd9853fd742ad 100644 (file)
@@ -57,7 +57,6 @@
 #include <mach/smemc.h>
 
 #include "generic.h"
-#include "clock.h"
 #include "devices.h"
 
 static unsigned long lubbock_pin_config[] __initdata = {
@@ -102,6 +101,9 @@ static unsigned long lubbock_pin_config[] __initdata = {
        GPIO6_MMC_CLK,
        GPIO8_MMC_CS0,
 
+       /* SA1111 chip */
+       GPIO11_3_6MHz,
+
        /* wakeup */
        GPIO1_GPIO | WAKEUP_ON_EDGE_RISE,
 };
index 854f1f562d6b34590aac4d587a212cf4cf06829f..14f6aaf8fcc96a36ebb093d4f3247669e599c738 100644 (file)
@@ -28,7 +28,7 @@
 static void isp116x_pfm_delay(struct device *dev, int delay)
 {
 
-       /* 400Mhz PXA2 = 2.5ns / instruction */
+       /* 400MHz PXA2 = 2.5ns / instruction */
 
        int cyc = delay / 10;
 
index 66e4a2b6316ea650d02aace1fcc4dfae7e5a8909..23a90c62ec11bf3b82ed77693351a669a6dc697a 100644 (file)
 
 #include "generic.h"
 #include "devices.h"
-#include "clock.h"
 
 /*
  * Various clock factors driven by the CCCR register.
  */
 
-/* Crystal Frequency to Memory Frequency Multiplier (L) */
-static unsigned char L_clk_mult[32] = { 0, 27, 32, 36, 40, 45, 0, };
-
-/* Memory Frequency to Run Mode Frequency Multiplier (M) */
-static unsigned char M_clk_mult[4] = { 0, 1, 2, 4 };
-
-/* Run Mode Frequency to Turbo Mode Frequency Multiplier (N) */
-/* Note: we store the value N * 2 here. */
-static unsigned char N2_clk_mult[8] = { 0, 0, 2, 3, 4, 0, 6, 0 };
-
-/* Crystal clock */
-#define BASE_CLK       3686400
-
-/*
- * Get the clock frequency as reflected by CCCR and the turbo flag.
- * We assume these values have been applied via a fcs.
- * If info is not 0 we also display the current settings.
- */
-unsigned int pxa25x_get_clk_frequency_khz(int info)
-{
-       unsigned long cccr, turbo;
-       unsigned int l, L, m, M, n2, N;
-
-       cccr = CCCR;
-       asm( "mrc\tp14, 0, %0, c6, c0, 0" : "=r" (turbo) );
-
-       l  =  L_clk_mult[(cccr >> 0) & 0x1f];
-       m  =  M_clk_mult[(cccr >> 5) & 0x03];
-       n2 = N2_clk_mult[(cccr >> 7) & 0x07];
-
-       L = l * BASE_CLK;
-       M = m * L;
-       N = n2 * M / 2;
-
-       if(info)
-       {
-               L += 5000;
-               printk( KERN_INFO "Memory clock: %d.%02dMHz (*%d)\n",
-                       L / 1000000, (L % 1000000) / 10000, l );
-               M += 5000;
-               printk( KERN_INFO "Run Mode clock: %d.%02dMHz (*%d)\n",
-                       M / 1000000, (M % 1000000) / 10000, m );
-               N += 5000;
-               printk( KERN_INFO "Turbo Mode clock: %d.%02dMHz (*%d.%d, %sactive)\n",
-                       N / 1000000, (N % 1000000) / 10000, n2 / 2, (n2 % 2) * 5,
-                       (turbo & 1) ? "" : "in" );
-       }
-
-       return (turbo & 1) ? (N/1000) : (M/1000);
-}
-
-static unsigned long clk_pxa25x_mem_getrate(struct clk *clk)
-{
-       return L_clk_mult[(CCCR >> 0) & 0x1f] * BASE_CLK;
-}
-
-static const struct clkops clk_pxa25x_mem_ops = {
-       .enable         = clk_dummy_enable,
-       .disable        = clk_dummy_disable,
-       .getrate        = clk_pxa25x_mem_getrate,
-};
-
-static const struct clkops clk_pxa25x_lcd_ops = {
-       .enable         = clk_pxa2xx_cken_enable,
-       .disable        = clk_pxa2xx_cken_disable,
-       .getrate        = clk_pxa25x_mem_getrate,
-};
-
-static unsigned long gpio12_config_32k[] = {
-       GPIO12_32KHz,
-};
-
-static unsigned long gpio12_config_gpio[] = {
-       GPIO12_GPIO,
-};
-
-static void clk_gpio12_enable(struct clk *clk)
-{
-       pxa2xx_mfp_config(gpio12_config_32k, 1);
-}
-
-static void clk_gpio12_disable(struct clk *clk)
-{
-       pxa2xx_mfp_config(gpio12_config_gpio, 1);
-}
-
-static const struct clkops clk_pxa25x_gpio12_ops = {
-       .enable         = clk_gpio12_enable,
-       .disable        = clk_gpio12_disable,
-};
-
-static unsigned long gpio11_config_3m6[] = {
-       GPIO11_3_6MHz,
-};
-
-static unsigned long gpio11_config_gpio[] = {
-       GPIO11_GPIO,
-};
-
-static void clk_gpio11_enable(struct clk *clk)
-{
-       pxa2xx_mfp_config(gpio11_config_3m6, 1);
-}
-
-static void clk_gpio11_disable(struct clk *clk)
-{
-       pxa2xx_mfp_config(gpio11_config_gpio, 1);
-}
-
-static const struct clkops clk_pxa25x_gpio11_ops = {
-       .enable         = clk_gpio11_enable,
-       .disable        = clk_gpio11_disable,
-};
-
-/*
- * 3.6864MHz -> OST, GPIO, SSP, PWM, PLLs (95.842MHz, 147.456MHz)
- * 95.842MHz -> MMC 19.169MHz, I2C 31.949MHz, FICP 47.923MHz, USB 47.923MHz
- * 147.456MHz -> UART 14.7456MHz, AC97 12.288MHz, I2S 5.672MHz (allegedly)
- */
-
-/*
- * PXA 2xx clock declarations.
- */
-static DEFINE_PXA2_CKEN(pxa25x_hwuart, HWUART, 14745600, 1);
-static DEFINE_PXA2_CKEN(pxa25x_ffuart, FFUART, 14745600, 1);
-static DEFINE_PXA2_CKEN(pxa25x_btuart, BTUART, 14745600, 1);
-static DEFINE_PXA2_CKEN(pxa25x_stuart, STUART, 14745600, 1);
-static DEFINE_PXA2_CKEN(pxa25x_usb, USB, 47923000, 5);
-static DEFINE_PXA2_CKEN(pxa25x_mmc, MMC, 19169000, 0);
-static DEFINE_PXA2_CKEN(pxa25x_i2c, I2C, 31949000, 0);
-static DEFINE_PXA2_CKEN(pxa25x_ssp, SSP, 3686400, 0);
-static DEFINE_PXA2_CKEN(pxa25x_nssp, NSSP, 3686400, 0);
-static DEFINE_PXA2_CKEN(pxa25x_assp, ASSP, 3686400, 0);
-static DEFINE_PXA2_CKEN(pxa25x_pwm0, PWM0, 3686400, 0);
-static DEFINE_PXA2_CKEN(pxa25x_pwm1, PWM1, 3686400, 0);
-static DEFINE_PXA2_CKEN(pxa25x_ac97, AC97, 24576000, 0);
-static DEFINE_PXA2_CKEN(pxa25x_i2s, I2S, 14745600, 0);
-static DEFINE_PXA2_CKEN(pxa25x_ficp, FICP, 47923000, 0);
-
-static DEFINE_CK(pxa25x_lcd, LCD, &clk_pxa25x_lcd_ops);
-static DEFINE_CLK(pxa25x_gpio11, &clk_pxa25x_gpio11_ops, 3686400, 0);
-static DEFINE_CLK(pxa25x_gpio12, &clk_pxa25x_gpio12_ops, 32768, 0);
-static DEFINE_CLK(pxa25x_mem, &clk_pxa25x_mem_ops, 0, 0);
-
-static struct clk_lookup pxa25x_clkregs[] = {
-       INIT_CLKREG(&clk_pxa25x_lcd, "pxa2xx-fb", NULL),
-       INIT_CLKREG(&clk_pxa25x_ffuart, "pxa2xx-uart.0", NULL),
-       INIT_CLKREG(&clk_pxa25x_btuart, "pxa2xx-uart.1", NULL),
-       INIT_CLKREG(&clk_pxa25x_stuart, "pxa2xx-uart.2", NULL),
-       INIT_CLKREG(&clk_pxa25x_usb, "pxa25x-udc", NULL),
-       INIT_CLKREG(&clk_pxa25x_mmc, "pxa2xx-mci.0", NULL),
-       INIT_CLKREG(&clk_pxa25x_i2c, "pxa2xx-i2c.0", NULL),
-       INIT_CLKREG(&clk_pxa25x_ssp, "pxa25x-ssp.0", NULL),
-       INIT_CLKREG(&clk_pxa25x_nssp, "pxa25x-nssp.1", NULL),
-       INIT_CLKREG(&clk_pxa25x_assp, "pxa25x-nssp.2", NULL),
-       INIT_CLKREG(&clk_pxa25x_pwm0, "pxa25x-pwm.0", NULL),
-       INIT_CLKREG(&clk_pxa25x_pwm1, "pxa25x-pwm.1", NULL),
-       INIT_CLKREG(&clk_pxa25x_i2s, "pxa2xx-i2s", NULL),
-       INIT_CLKREG(&clk_pxa25x_stuart, "pxa2xx-ir", "UARTCLK"),
-       INIT_CLKREG(&clk_pxa25x_ficp, "pxa2xx-ir", "FICPCLK"),
-       INIT_CLKREG(&clk_pxa25x_ac97, NULL, "AC97CLK"),
-       INIT_CLKREG(&clk_pxa25x_gpio11, NULL, "GPIO11_CLK"),
-       INIT_CLKREG(&clk_pxa25x_gpio12, NULL, "GPIO12_CLK"),
-       INIT_CLKREG(&clk_pxa25x_mem, "pxa2xx-pcmcia", NULL),
-#ifdef CONFIG_CPU_PXA26x
-       INIT_CLKREG(&clk_dummy, "pxa26x-gpio", NULL),
-#else
-       INIT_CLKREG(&clk_dummy, "pxa25x-gpio", NULL),
-#endif
-       INIT_CLKREG(&clk_dummy, "sa1100-rtc", NULL),
-};
-
-static struct clk_lookup pxa25x_hwuart_clkreg =
-       INIT_CLKREG(&clk_pxa25x_hwuart, "pxa2xx-uart.3", NULL);
-
 #ifdef CONFIG_PM
 
 #define SAVE(x)                sleep_save[SLEEP_SAVE_##x] = x
@@ -374,8 +198,6 @@ static int __init pxa25x_init(void)
 
                reset_status = RCSR;
 
-               clkdev_add_table(pxa25x_clkregs, ARRAY_SIZE(pxa25x_clkregs));
-
                if ((ret = pxa_init_dma(IRQ_DMA, 16)))
                        return ret;
 
@@ -383,7 +205,6 @@ static int __init pxa25x_init(void)
 
                register_syscore_ops(&pxa_irq_syscore_ops);
                register_syscore_ops(&pxa2xx_mfp_syscore_ops);
-               register_syscore_ops(&pxa2xx_clock_syscore_ops);
 
                pxa_register_device(&pxa25x_device_gpio, &pxa25x_gpio_info);
                ret = platform_add_devices(pxa25x_devices,
@@ -392,10 +213,6 @@ static int __init pxa25x_init(void)
                        return ret;
        }
 
-       /* Only add HWUART for PXA255/26x; PXA210/250 do not have it. */
-       if (cpu_is_pxa255())
-               clkdev_add(&pxa25x_hwuart_clkreg);
-
        return ret;
 }
 
index af423a48c2e3bb13bdb6295fd03ccc2332f61eb0..b5abdeb5bb2d17d6e63e4bc844047e0ea1928b05 100644 (file)
@@ -37,7 +37,8 @@
 
 #include "generic.h"
 #include "devices.h"
-#include "clock.h"
+#include <linux/clk-provider.h>
+#include <linux/clkdev.h>
 
 void pxa27x_clear_otgph(void)
 {
@@ -73,174 +74,6 @@ void pxa27x_configure_ac97reset(int reset_gpio, bool to_gpio)
 }
 EXPORT_SYMBOL_GPL(pxa27x_configure_ac97reset);
 
-/* Crystal clock: 13MHz */
-#define BASE_CLK       13000000
-
-/*
- * Get the clock frequency as reflected by CCSR and the turbo flag.
- * We assume these values have been applied via a fcs.
- * If info is not 0 we also display the current settings.
- */
-unsigned int pxa27x_get_clk_frequency_khz(int info)
-{
-       unsigned long ccsr, clkcfg;
-       unsigned int l, L, m, M, n2, N, S;
-               int cccr_a, t, ht, b;
-
-       ccsr = CCSR;
-       cccr_a = CCCR & (1 << 25);
-
-       /* Read clkcfg register: it has turbo, b, half-turbo (and f) */
-       asm( "mrc\tp14, 0, %0, c6, c0, 0" : "=r" (clkcfg) );
-       t  = clkcfg & (1 << 0);
-       ht = clkcfg & (1 << 2);
-       b  = clkcfg & (1 << 3);
-
-       l  = ccsr & 0x1f;
-       n2 = (ccsr>>7) & 0xf;
-       m  = (l <= 10) ? 1 : (l <= 20) ? 2 : 4;
-
-       L  = l * BASE_CLK;
-       N  = (L * n2) / 2;
-       M  = (!cccr_a) ? (L/m) : ((b) ? L : (L/2));
-       S  = (b) ? L : (L/2);
-
-       if (info) {
-               printk( KERN_INFO "Run Mode clock: %d.%02dMHz (*%d)\n",
-                       L / 1000000, (L % 1000000) / 10000, l );
-               printk( KERN_INFO "Turbo Mode clock: %d.%02dMHz (*%d.%d, %sactive)\n",
-                       N / 1000000, (N % 1000000)/10000, n2 / 2, (n2 % 2)*5,
-                       (t) ? "" : "in" );
-               printk( KERN_INFO "Memory clock: %d.%02dMHz (/%d)\n",
-                       M / 1000000, (M % 1000000) / 10000, m );
-               printk( KERN_INFO "System bus clock: %d.%02dMHz \n",
-                       S / 1000000, (S % 1000000) / 10000 );
-       }
-
-       return (t) ? (N/1000) : (L/1000);
-}
-
-/*
- * Return the current mem clock frequency as reflected by CCCR[A], B, and L
- */
-static unsigned long clk_pxa27x_mem_getrate(struct clk *clk)
-{
-       unsigned long ccsr, clkcfg;
-       unsigned int l, L, m, M;
-               int cccr_a, b;
-
-       ccsr = CCSR;
-       cccr_a = CCCR & (1 << 25);
-
-       /* Read clkcfg register: it has turbo, b, half-turbo (and f) */
-       asm( "mrc\tp14, 0, %0, c6, c0, 0" : "=r" (clkcfg) );
-       b = clkcfg & (1 << 3);
-
-       l = ccsr & 0x1f;
-       m = (l <= 10) ? 1 : (l <= 20) ? 2 : 4;
-
-       L = l * BASE_CLK;
-       M = (!cccr_a) ? (L/m) : ((b) ? L : (L/2));
-
-       return M;
-}
-
-static const struct clkops clk_pxa27x_mem_ops = {
-       .enable         = clk_dummy_enable,
-       .disable        = clk_dummy_disable,
-       .getrate        = clk_pxa27x_mem_getrate,
-};
-
-/*
- * Return the current LCD clock frequency in units of 10kHz as
- */
-static unsigned int pxa27x_get_lcdclk_frequency_10khz(void)
-{
-       unsigned long ccsr;
-       unsigned int l, L, k, K;
-
-       ccsr = CCSR;
-
-       l = ccsr & 0x1f;
-       k = (l <= 7) ? 1 : (l <= 16) ? 2 : 4;
-
-       L = l * BASE_CLK;
-       K = L / k;
-
-       return (K / 10000);
-}
-
-static unsigned long clk_pxa27x_lcd_getrate(struct clk *clk)
-{
-       return pxa27x_get_lcdclk_frequency_10khz() * 10000;
-}
-
-static const struct clkops clk_pxa27x_lcd_ops = {
-       .enable         = clk_pxa2xx_cken_enable,
-       .disable        = clk_pxa2xx_cken_disable,
-       .getrate        = clk_pxa27x_lcd_getrate,
-};
-
-static DEFINE_PXA2_CKEN(pxa27x_ffuart, FFUART, 14857000, 1);
-static DEFINE_PXA2_CKEN(pxa27x_btuart, BTUART, 14857000, 1);
-static DEFINE_PXA2_CKEN(pxa27x_stuart, STUART, 14857000, 1);
-static DEFINE_PXA2_CKEN(pxa27x_i2s, I2S, 14682000, 0);
-static DEFINE_PXA2_CKEN(pxa27x_i2c, I2C, 32842000, 0);
-static DEFINE_PXA2_CKEN(pxa27x_usb, USB, 48000000, 5);
-static DEFINE_PXA2_CKEN(pxa27x_mmc, MMC, 19500000, 0);
-static DEFINE_PXA2_CKEN(pxa27x_ficp, FICP, 48000000, 0);
-static DEFINE_PXA2_CKEN(pxa27x_usbhost, USBHOST, 48000000, 0);
-static DEFINE_PXA2_CKEN(pxa27x_pwri2c, PWRI2C, 13000000, 0);
-static DEFINE_PXA2_CKEN(pxa27x_keypad, KEYPAD, 32768, 0);
-static DEFINE_PXA2_CKEN(pxa27x_ssp1, SSP1, 13000000, 0);
-static DEFINE_PXA2_CKEN(pxa27x_ssp2, SSP2, 13000000, 0);
-static DEFINE_PXA2_CKEN(pxa27x_ssp3, SSP3, 13000000, 0);
-static DEFINE_PXA2_CKEN(pxa27x_pwm0, PWM0, 13000000, 0);
-static DEFINE_PXA2_CKEN(pxa27x_pwm1, PWM1, 13000000, 0);
-static DEFINE_PXA2_CKEN(pxa27x_ac97, AC97, 24576000, 0);
-static DEFINE_PXA2_CKEN(pxa27x_ac97conf, AC97CONF, 24576000, 0);
-static DEFINE_PXA2_CKEN(pxa27x_msl, MSL, 48000000, 0);
-static DEFINE_PXA2_CKEN(pxa27x_usim, USIM, 48000000, 0);
-static DEFINE_PXA2_CKEN(pxa27x_memstk, MEMSTK, 19500000, 0);
-static DEFINE_PXA2_CKEN(pxa27x_im, IM, 0, 0);
-static DEFINE_PXA2_CKEN(pxa27x_memc, MEMC, 0, 0);
-
-static DEFINE_CK(pxa27x_lcd, LCD, &clk_pxa27x_lcd_ops);
-static DEFINE_CK(pxa27x_camera, CAMERA, &clk_pxa27x_lcd_ops);
-static DEFINE_CLK(pxa27x_mem, &clk_pxa27x_mem_ops, 0, 0);
-
-static struct clk_lookup pxa27x_clkregs[] = {
-       INIT_CLKREG(&clk_pxa27x_lcd, "pxa2xx-fb", NULL),
-       INIT_CLKREG(&clk_pxa27x_camera, "pxa27x-camera.0", NULL),
-       INIT_CLKREG(&clk_pxa27x_ffuart, "pxa2xx-uart.0", NULL),
-       INIT_CLKREG(&clk_pxa27x_btuart, "pxa2xx-uart.1", NULL),
-       INIT_CLKREG(&clk_pxa27x_stuart, "pxa2xx-uart.2", NULL),
-       INIT_CLKREG(&clk_pxa27x_i2s, "pxa2xx-i2s", NULL),
-       INIT_CLKREG(&clk_pxa27x_i2c, "pxa2xx-i2c.0", NULL),
-       INIT_CLKREG(&clk_pxa27x_usb, "pxa27x-udc", NULL),
-       INIT_CLKREG(&clk_pxa27x_mmc, "pxa2xx-mci.0", NULL),
-       INIT_CLKREG(&clk_pxa27x_stuart, "pxa2xx-ir", "UARTCLK"),
-       INIT_CLKREG(&clk_pxa27x_ficp, "pxa2xx-ir", "FICPCLK"),
-       INIT_CLKREG(&clk_pxa27x_usbhost, "pxa27x-ohci", NULL),
-       INIT_CLKREG(&clk_pxa27x_pwri2c, "pxa2xx-i2c.1", NULL),
-       INIT_CLKREG(&clk_pxa27x_keypad, "pxa27x-keypad", NULL),
-       INIT_CLKREG(&clk_pxa27x_ssp1, "pxa27x-ssp.0", NULL),
-       INIT_CLKREG(&clk_pxa27x_ssp2, "pxa27x-ssp.1", NULL),
-       INIT_CLKREG(&clk_pxa27x_ssp3, "pxa27x-ssp.2", NULL),
-       INIT_CLKREG(&clk_pxa27x_pwm0, "pxa27x-pwm.0", NULL),
-       INIT_CLKREG(&clk_pxa27x_pwm1, "pxa27x-pwm.1", NULL),
-       INIT_CLKREG(&clk_pxa27x_ac97, NULL, "AC97CLK"),
-       INIT_CLKREG(&clk_pxa27x_ac97conf, NULL, "AC97CONFCLK"),
-       INIT_CLKREG(&clk_pxa27x_msl, NULL, "MSLCLK"),
-       INIT_CLKREG(&clk_pxa27x_usim, NULL, "USIMCLK"),
-       INIT_CLKREG(&clk_pxa27x_memstk, NULL, "MSTKCLK"),
-       INIT_CLKREG(&clk_pxa27x_im, NULL, "IMCLK"),
-       INIT_CLKREG(&clk_pxa27x_memc, NULL, "MEMCLK"),
-       INIT_CLKREG(&clk_pxa27x_mem, "pxa2xx-pcmcia", NULL),
-       INIT_CLKREG(&clk_dummy, "pxa27x-gpio", NULL),
-       INIT_CLKREG(&clk_dummy, "sa1100-rtc", NULL),
-};
-
 #ifdef CONFIG_PM
 
 #define SAVE(x)                sleep_save[SLEEP_SAVE_##x] = x
@@ -466,8 +299,6 @@ static int __init pxa27x_init(void)
 
                reset_status = RCSR;
 
-               clkdev_add_table(pxa27x_clkregs, ARRAY_SIZE(pxa27x_clkregs));
-
                if ((ret = pxa_init_dma(IRQ_DMA, 32)))
                        return ret;
 
@@ -475,10 +306,13 @@ static int __init pxa27x_init(void)
 
                register_syscore_ops(&pxa_irq_syscore_ops);
                register_syscore_ops(&pxa2xx_mfp_syscore_ops);
-               register_syscore_ops(&pxa2xx_clock_syscore_ops);
 
-               pxa_register_device(&pxa27x_device_gpio, &pxa27x_gpio_info);
-               ret = platform_add_devices(devices, ARRAY_SIZE(devices));
+               if (!of_have_populated_dt()) {
+                       pxa_register_device(&pxa27x_device_gpio,
+                                           &pxa27x_gpio_info);
+                       ret = platform_add_devices(devices,
+                                                  ARRAY_SIZE(devices));
+               }
        }
 
        return ret;
index 17cbc0c7bdb8dd6572ff9da306c359cfca2b5e20..28c5b5686638fdfa26a8f166f21e88b28693eabf 100644 (file)
@@ -22,7 +22,6 @@
 
 #include "generic.h"
 #include "devices.h"
-#include "clock.h"
 
 static struct mfp_addr_map pxa300_mfp_addr_map[] __initdata = {
 
@@ -84,32 +83,15 @@ static struct mfp_addr_map pxa310_mfp_addr_map[] __initdata = {
        MFP_ADDR_END,
 };
 
-static DEFINE_PXA3_CKEN(common_nand, NAND, 156000000, 0);
-static DEFINE_PXA3_CKEN(gcu, PXA300_GCU, 0, 0);
-
-static struct clk_lookup common_clkregs[] = {
-       INIT_CLKREG(&clk_common_nand, "pxa3xx-nand", NULL),
-       INIT_CLKREG(&clk_gcu, "pxa3xx-gcu", NULL),
-};
-
-static DEFINE_PXA3_CKEN(pxa310_mmc3, MMC3, 19500000, 0);
-
-static struct clk_lookup pxa310_clkregs[] = {
-       INIT_CLKREG(&clk_pxa310_mmc3, "pxa2xx-mci.2", NULL),
-};
-
 static int __init pxa300_init(void)
 {
        if (cpu_is_pxa300() || cpu_is_pxa310()) {
                mfp_init_base(io_p2v(MFPR_BASE));
                mfp_init_addr(pxa300_mfp_addr_map);
-               clkdev_add_table(ARRAY_AND_SIZE(common_clkregs));
        }
 
-       if (cpu_is_pxa310()) {
+       if (cpu_is_pxa310())
                mfp_init_addr(pxa310_mfp_addr_map);
-               clkdev_add_table(ARRAY_AND_SIZE(pxa310_clkregs));
-       }
 
        return 0;
 }
index 6dc99d4f2dc630065398d20a08817df5773e6cc8..2f55bb4b9087f3e683c15c8b34d6ceab2a1537d0 100644 (file)
@@ -22,7 +22,6 @@
 
 #include "generic.h"
 #include "devices.h"
-#include "clock.h"
 
 static struct mfp_addr_map pxa320_mfp_addr_map[] __initdata = {
 
@@ -78,20 +77,11 @@ static struct mfp_addr_map pxa320_mfp_addr_map[] __initdata = {
        MFP_ADDR_END,
 };
 
-static DEFINE_PXA3_CKEN(pxa320_nand, NAND, 104000000, 0);
-static DEFINE_PXA3_CKEN(gcu, PXA320_GCU, 0, 0);
-
-static struct clk_lookup pxa320_clkregs[] = {
-       INIT_CLKREG(&clk_pxa320_nand, "pxa3xx-nand", NULL),
-       INIT_CLKREG(&clk_gcu, "pxa3xx-gcu", NULL),
-};
-
 static int __init pxa320_init(void)
 {
        if (cpu_is_pxa320()) {
                mfp_init_base(io_p2v(MFPR_BASE));
                mfp_init_addr(pxa320_mfp_addr_map);
-               clkdev_add_table(ARRAY_AND_SIZE(pxa320_clkregs));
        }
 
        return 0;
index edcbd9c0bcb2edf1f6ace9805c4b3a04f7671601..bd4cbef15ccf2147a7cce6aa1d51f185cfd57f8f 100644 (file)
 
 #include "generic.h"
 #include "devices.h"
-#include "clock.h"
 
 #define PECR_IE(n)     ((1 << ((n) * 2)) << 28)
 #define PECR_IS(n)     ((1 << ((n) * 2)) << 29)
 
 extern void __init pxa_dt_irq_init(int (*fn)(struct irq_data *, unsigned int));
-
-static DEFINE_PXA3_CKEN(pxa3xx_ffuart, FFUART, 14857000, 1);
-static DEFINE_PXA3_CKEN(pxa3xx_btuart, BTUART, 14857000, 1);
-static DEFINE_PXA3_CKEN(pxa3xx_stuart, STUART, 14857000, 1);
-static DEFINE_PXA3_CKEN(pxa3xx_i2c, I2C, 32842000, 0);
-static DEFINE_PXA3_CKEN(pxa3xx_udc, UDC, 48000000, 5);
-static DEFINE_PXA3_CKEN(pxa3xx_usbh, USBH, 48000000, 0);
-static DEFINE_PXA3_CKEN(pxa3xx_u2d, USB2, 48000000, 0);
-static DEFINE_PXA3_CKEN(pxa3xx_keypad, KEYPAD, 32768, 0);
-static DEFINE_PXA3_CKEN(pxa3xx_ssp1, SSP1, 13000000, 0);
-static DEFINE_PXA3_CKEN(pxa3xx_ssp2, SSP2, 13000000, 0);
-static DEFINE_PXA3_CKEN(pxa3xx_ssp3, SSP3, 13000000, 0);
-static DEFINE_PXA3_CKEN(pxa3xx_ssp4, SSP4, 13000000, 0);
-static DEFINE_PXA3_CKEN(pxa3xx_pwm0, PWM0, 13000000, 0);
-static DEFINE_PXA3_CKEN(pxa3xx_pwm1, PWM1, 13000000, 0);
-static DEFINE_PXA3_CKEN(pxa3xx_mmc1, MMC1, 19500000, 0);
-static DEFINE_PXA3_CKEN(pxa3xx_mmc2, MMC2, 19500000, 0);
-static DEFINE_PXA3_CKEN(pxa3xx_gpio, GPIO, 13000000, 0);
-
-static DEFINE_CK(pxa3xx_lcd, LCD, &clk_pxa3xx_hsio_ops);
-static DEFINE_CK(pxa3xx_smemc, SMC, &clk_pxa3xx_smemc_ops);
-static DEFINE_CK(pxa3xx_camera, CAMERA, &clk_pxa3xx_hsio_ops);
-static DEFINE_CK(pxa3xx_ac97, AC97, &clk_pxa3xx_ac97_ops);
-static DEFINE_CLK(pxa3xx_pout, &clk_pxa3xx_pout_ops, 13000000, 70);
-
-static struct clk_lookup pxa3xx_clkregs[] = {
-       INIT_CLKREG(&clk_pxa3xx_pout, NULL, "CLK_POUT"),
-       /* Power I2C clock is always on */
-       INIT_CLKREG(&clk_dummy, "pxa3xx-pwri2c.1", NULL),
-       INIT_CLKREG(&clk_pxa3xx_lcd, "pxa2xx-fb", NULL),
-       INIT_CLKREG(&clk_pxa3xx_camera, NULL, "CAMCLK"),
-       INIT_CLKREG(&clk_pxa3xx_ac97, NULL, "AC97CLK"),
-       INIT_CLKREG(&clk_pxa3xx_ffuart, "pxa2xx-uart.0", NULL),
-       INIT_CLKREG(&clk_pxa3xx_btuart, "pxa2xx-uart.1", NULL),
-       INIT_CLKREG(&clk_pxa3xx_stuart, "pxa2xx-uart.2", NULL),
-       INIT_CLKREG(&clk_pxa3xx_stuart, "pxa2xx-ir", "UARTCLK"),
-       INIT_CLKREG(&clk_pxa3xx_i2c, "pxa2xx-i2c.0", NULL),
-       INIT_CLKREG(&clk_pxa3xx_udc, "pxa27x-udc", NULL),
-       INIT_CLKREG(&clk_pxa3xx_usbh, "pxa27x-ohci", NULL),
-       INIT_CLKREG(&clk_pxa3xx_u2d, "pxa3xx-u2d", NULL),
-       INIT_CLKREG(&clk_pxa3xx_keypad, "pxa27x-keypad", NULL),
-       INIT_CLKREG(&clk_pxa3xx_ssp1, "pxa3xx-ssp.0", NULL),
-       INIT_CLKREG(&clk_pxa3xx_ssp2, "pxa3xx-ssp.1", NULL),
-       INIT_CLKREG(&clk_pxa3xx_ssp3, "pxa3xx-ssp.2", NULL),
-       INIT_CLKREG(&clk_pxa3xx_ssp4, "pxa3xx-ssp.3", NULL),
-       INIT_CLKREG(&clk_pxa3xx_pwm0, "pxa27x-pwm.0", NULL),
-       INIT_CLKREG(&clk_pxa3xx_pwm1, "pxa27x-pwm.1", NULL),
-       INIT_CLKREG(&clk_pxa3xx_mmc1, "pxa2xx-mci.0", NULL),
-       INIT_CLKREG(&clk_pxa3xx_mmc2, "pxa2xx-mci.1", NULL),
-       INIT_CLKREG(&clk_pxa3xx_smemc, "pxa2xx-pcmcia", NULL),
-       INIT_CLKREG(&clk_pxa3xx_gpio, "pxa3xx-gpio", NULL),
-       INIT_CLKREG(&clk_pxa3xx_gpio, "pxa93x-gpio", NULL),
-       INIT_CLKREG(&clk_dummy, "sa1100-rtc", NULL),
-};
-
 #ifdef CONFIG_PM
 
 #define ISRAM_START    0x5c000000
@@ -476,8 +420,6 @@ static int __init pxa3xx_init(void)
                 */
                ASCR &= ~(ASCR_RDH | ASCR_D1S | ASCR_D2S | ASCR_D3S);
 
-               clkdev_add_table(pxa3xx_clkregs, ARRAY_SIZE(pxa3xx_clkregs));
-
                if ((ret = pxa_init_dma(IRQ_DMA, 32)))
                        return ret;
 
@@ -485,7 +427,6 @@ static int __init pxa3xx_init(void)
 
                register_syscore_ops(&pxa_irq_syscore_ops);
                register_syscore_ops(&pxa3xx_mfp_syscore_ops);
-               register_syscore_ops(&pxa3xx_clock_syscore_ops);
 
                if (of_have_populated_dt())
                        return 0;
index 6dc4f025e6743342524cd49f2bef74e9955899e4..88f70c37ad0dddef1fa85e9dd804c3c2fda41459 100644 (file)
@@ -56,7 +56,6 @@
 
 #include "generic.h"
 #include "devices.h"
-#include "clock.h"
 
 /* common GPIO definitions */
 
index 7780d1faa06f563057e68e749e7ccc7a9a8006d6..93bf4ef44d2c831f860489f3350fcb0c7c0a3c66 100644 (file)
@@ -58,7 +58,6 @@
 #include <asm/mach/sharpsl_param.h>
 
 #include "generic.h"
-#include "clock.h"
 #include "devices.h"
 
 static unsigned long tosa_pin_config[] = {
index 39bca96b555a6f08a630aefd2a7b53a941487d39..492c048813da6c96df835f91cc6ddbf98f6b517a 100644 (file)
@@ -17,4 +17,3 @@ extern char rockchip_secondary_trampoline;
 extern char rockchip_secondary_trampoline_end;
 
 extern unsigned long rockchip_boot_fn;
-extern void rockchip_secondary_startup(void);
index 46c22dedf632abb7375167e93380629f3ac44acf..d69708b0728296f77a6af33744c54305d821765d 100644 (file)
 #include <linux/linkage.h>
 #include <linux/init.h>
 
-ENTRY(rockchip_secondary_startup)
-       mrc     p15, 0, r0, c0, c0, 0   @ read main ID register
-       ldr     r1, =0x00000c09         @ Cortex-A9 primary part number
-       teq     r0, r1
-       beq     v7_invalidate_l1
-       b       secondary_startup
-ENDPROC(rockchip_secondary_startup)
-
 ENTRY(rockchip_secondary_trampoline)
        ldr     pc, 1f
 ENDPROC(rockchip_secondary_trampoline)
index 5b4ca3c3c8797d2560c4addaad6773b974ebb2d0..2e6ab67e2284497f9fc1d8fe323c2daaa4f34809 100644 (file)
@@ -149,8 +149,7 @@ static int __cpuinit rockchip_boot_secondary(unsigned int cpu,
                 * sram_base_addr + 8: start address for pc
                 * */
                udelay(10);
-               writel(virt_to_phys(rockchip_secondary_startup),
-                       sram_base_addr + 8);
+               writel(virt_to_phys(secondary_startup), sram_base_addr + 8);
                writel(0xDEADBEAF, sram_base_addr + 4);
                dsb_sev();
        }
@@ -189,7 +188,7 @@ static int __init rockchip_smp_prepare_sram(struct device_node *node)
        }
 
        /* set the boot function for the sram code */
-       rockchip_boot_fn = virt_to_phys(rockchip_secondary_startup);
+       rockchip_boot_fn = virt_to_phys(secondary_startup);
 
        /* copy the trampoline to sram, that runs during startup of the core */
        memcpy(sram_base_addr, &rockchip_secondary_trampoline, trampoline_sz);
index 0fb484221c90e0eb9c0a5aeefd5df7beac098678..45006479d4617bf3b862eb98147323b216573dfd 100644 (file)
@@ -139,7 +139,7 @@ config MACH_ARMADILLO800EVA
        select ARCH_REQUIRE_GPIOLIB
        select REGULATOR_FIXED_VOLTAGE if REGULATOR
        select SMSC_PHY if SH_ETH
-       select SND_SOC_WM8978 if SND_SIMPLE_CARD
+       select SND_SOC_WM8978 if SND_SIMPLE_CARD && I2C
        select USE_OF
 
 config MACH_BOCKW
@@ -148,7 +148,7 @@ config MACH_BOCKW
        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
+       select SND_SOC_AK4642 if SND_SIMPLE_CARD && I2C
        select USE_OF
 
 config MACH_BOCKW_REFERENCE
index afc60bad6fd6b7d02093b6bf7d384ec4d7914cec..476092b86c6e42420e2654a8d2abe8b8aa6dcaee 100644 (file)
@@ -14,7 +14,6 @@ extern void shmobile_smp_sleep(void);
 extern void shmobile_smp_hook(unsigned int cpu, unsigned long fn,
                              unsigned long arg);
 extern int shmobile_smp_cpu_disable(unsigned int cpu);
-extern void shmobile_invalidate_start(void);
 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);
index 69df8bfac1672202073d5096631e1897857f5a5e..fa5248c52399c9b5e78e3c1cd7c167523f306424 100644 (file)
@@ -22,7 +22,7 @@
  * Boot code for secondary CPUs.
  *
  * First we turn on L1 cache coherency for our CPU. Then we jump to
- * shmobile_invalidate_start that invalidates the cache and hands over control
+ * secondary_startup that invalidates the cache and hands over control
  * to the common ARM startup code.
  */
 ENTRY(shmobile_boot_scu)
@@ -36,7 +36,7 @@ ENTRY(shmobile_boot_scu)
        bic     r2, r2, r3              @ Clear bits of our CPU (Run Mode)
        str     r2, [r0, #8]            @ write back
 
-       b       shmobile_invalidate_start
+       b       secondary_startup
 ENDPROC(shmobile_boot_scu)
 
        .text
index 50c491567e11c2a43c6d86940f186299624e3f1a..330c1fc63197df89684e03578c1c0693b8e6f24f 100644 (file)
 #include <asm/assembler.h>
 #include <asm/memory.h>
 
-#ifdef CONFIG_SMP
-ENTRY(shmobile_invalidate_start)
-       bl      v7_invalidate_l1
-       b       secondary_startup
-ENDPROC(shmobile_invalidate_start)
-#endif
-
 /*
  * Reset vector for secondary CPUs.
  * This will be mapped at address 0 by SBAR register.
index f483b560b066a78d5dd99b9dd51c0591ab85cc0b..b0790fc322824431235fc65bc8a4b1790e04a78d 100644 (file)
@@ -133,7 +133,7 @@ void __init shmobile_smp_apmu_prepare_cpus(unsigned int max_cpus,
 int shmobile_smp_apmu_boot_secondary(unsigned int cpu, struct task_struct *idle)
 {
        /* For this particular CPU register boot vector */
-       shmobile_smp_hook(cpu, virt_to_phys(shmobile_invalidate_start), 0);
+       shmobile_smp_hook(cpu, virt_to_phys(secondary_startup), 0);
 
        return apmu_wrap(cpu, apmu_power_on);
 }
index b5f8d75d51a0568d603c293df64d403711b77447..90efdeb56be50450dd978e47bbcb9ed5854384d8 100644 (file)
@@ -1,5 +1,6 @@
-config ARCH_SOCFPGA
+menuconfig ARCH_SOCFPGA
        bool "Altera SOCFPGA family" if ARCH_MULTI_V7
+       select ARCH_SUPPORTS_BIG_ENDIAN
        select ARM_AMBA
        select ARM_GIC
        select CACHE_L2X0
@@ -8,3 +9,11 @@ config ARCH_SOCFPGA
        select HAVE_ARM_SCU
        select HAVE_ARM_TWD if SMP
        select MFD_SYSCON
+
+if ARCH_SOCFPGA
+config SOCFPGA_SUSPEND
+       bool "Suspend to RAM on SOCFPGA"
+       help
+         Select this if you want to enable Suspend-to-RAM on SOCFPGA
+         platforms.
+endif
index 6dd7a93a90fea07c472c8cbcbd6f0a0ec5a4d779..b8f9e238e4abc8974a0337365c5e2270599f8077 100644 (file)
@@ -4,3 +4,4 @@
 
 obj-y                                  := socfpga.o
 obj-$(CONFIG_SMP)      += headsmp.o platsmp.o
+obj-$(CONFIG_SOCFPGA_SUSPEND)  += pm.o self-refresh.o
index a0f3b1cd497cc70656637c6dd2215a07942c0b1e..7259c37327025bb60ff2e81654a2b338ab1db37d 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright 2012 Pavel Machek <pavel@denx.de>
- * Copyright (C) 2012 Altera Corporation
+ * Copyright (C) 2012-2015 Altera 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
 #define SOCFPGA_RSTMGR_MODPERRST       0x14
 #define SOCFPGA_RSTMGR_BRGMODRST       0x1c
 
+#define SOCFPGA_A10_RSTMGR_MODMPURST   0x20
+
 /* System Manager bits */
 #define RSTMGR_CTRL_SWCOLDRSTREQ       0x1     /* Cold Reset */
 #define RSTMGR_CTRL_SWWARMRSTREQ       0x2     /* Warm Reset */
 
 #define RSTMGR_MPUMODRST_CPU1          0x2     /* CPU1 Reset */
 
-extern void socfpga_secondary_startup(void);
-extern void __iomem *socfpga_scu_base_addr;
-
 extern void socfpga_init_clocks(void);
 extern void socfpga_sysmgr_init(void);
 
 extern void __iomem *sys_manager_base_addr;
 extern void __iomem *rst_manager_base_addr;
+extern void __iomem *sdr_ctl_base_addr;
+
+u32 socfpga_sdram_self_refresh(u32 sdr_base);
+extern unsigned int socfpga_sdram_self_refresh_sz;
 
-extern struct smp_operations socfpga_smp_ops;
 extern char secondary_trampoline, secondary_trampoline_end;
 
 extern unsigned long socfpga_cpu1start_addr;
index f65ea0af4af37dbdce42f9bf1af740b4feeb9e22..5d94b7a2fb108dc1bc1c5fcdd4edfa80ab2c0c7f 100644 (file)
@@ -10,6 +10,7 @@
 #include <linux/linkage.h>
 #include <linux/init.h>
 #include <asm/memory.h>
+#include <asm/assembler.h>
 
        .arch   armv7-a
 
@@ -18,20 +19,17 @@ ENTRY(secondary_trampoline)
         * Thus, we can just subtract the PAGE_OFFSET to get the physical
         * address of &cpu1start_addr. This would not work for platforms
         * where the physical memory does not start at 0x0.
-        */
+       */
+ARM_BE8(setend be)
        adr     r0, 1f
        ldmia   r0, {r1, r2}
        sub     r2, r2, #PAGE_OFFSET
        ldr     r3, [r2]
        ldr     r4, [r3]
+ARM_BE8(rev    r4, r4)
        bx      r4
 
        .align
 1:     .long   .
        .long   socfpga_cpu1start_addr
 ENTRY(secondary_trampoline_end)
-
-ENTRY(socfpga_secondary_startup)
-       bl      v7_invalidate_l1
-       b       secondary_startup
-ENDPROC(socfpga_secondary_startup)
index c64d89b7c0ca80c6a61f3d8e1c7439756bb83ee2..c6f1df89f9af7fdf10049805714c4f5045165dc2 100644 (file)
@@ -40,7 +40,7 @@ static int socfpga_boot_secondary(unsigned int cpu, struct task_struct *idle)
 
                memcpy(phys_to_virt(0), &secondary_trampoline, trampoline_size);
 
-               writel(virt_to_phys(socfpga_secondary_startup),
+               writel(virt_to_phys(secondary_startup),
                       sys_manager_base_addr + (socfpga_cpu1start_addr & 0x000000ff));
 
                flush_cache_all();
@@ -54,32 +54,43 @@ static int socfpga_boot_secondary(unsigned int cpu, struct task_struct *idle)
        return 0;
 }
 
-/*
- * Initialise the CPU possible map early - this describes the CPUs
- * which may be present or become present in the system.
- */
-static void __init socfpga_smp_init_cpus(void)
+static int socfpga_a10_boot_secondary(unsigned int cpu, struct task_struct *idle)
 {
-       unsigned int i, ncores;
+       int trampoline_size = &secondary_trampoline_end - &secondary_trampoline;
 
-       ncores = scu_get_core_count(socfpga_scu_base_addr);
+       if (socfpga_cpu1start_addr) {
+               writel(RSTMGR_MPUMODRST_CPU1, rst_manager_base_addr +
+                      SOCFPGA_A10_RSTMGR_MODMPURST);
+               memcpy(phys_to_virt(0), &secondary_trampoline, trampoline_size);
 
-       for (i = 0; i < ncores; i++)
-               set_cpu_possible(i, true);
+               writel(virt_to_phys(secondary_startup),
+                      sys_manager_base_addr + (socfpga_cpu1start_addr & 0x00000fff));
 
-       /* sanity check */
-       if (ncores > num_possible_cpus()) {
-               pr_warn("socfpga: no. of cores (%d) greater than configured"
-                       "maximum of %d - clipping\n", ncores, num_possible_cpus());
-               ncores = num_possible_cpus();
+               flush_cache_all();
+               smp_wmb();
+               outer_clean_range(0, trampoline_size);
+
+               /* This will release CPU #1 out of reset. */
+               writel(0, rst_manager_base_addr + SOCFPGA_A10_RSTMGR_MODMPURST);
        }
 
-       for (i = 0; i < ncores; i++)
-               set_cpu_possible(i, true);
+       return 0;
 }
 
 static void __init socfpga_smp_prepare_cpus(unsigned int max_cpus)
 {
+       struct device_node *np;
+       void __iomem *socfpga_scu_base_addr;
+
+       np = of_find_compatible_node(NULL, NULL, "arm,cortex-a9-scu");
+       if (!np) {
+               pr_err("%s: missing scu\n", __func__);
+               return;
+       }
+
+       socfpga_scu_base_addr = of_iomap(np, 0);
+       if (!socfpga_scu_base_addr)
+               return;
        scu_enable(socfpga_scu_base_addr);
 }
 
@@ -95,11 +106,21 @@ static void socfpga_cpu_die(unsigned int cpu)
                cpu_do_idle();
 }
 
-struct smp_operations socfpga_smp_ops __initdata = {
-       .smp_init_cpus          = socfpga_smp_init_cpus,
+static struct smp_operations socfpga_smp_ops __initdata = {
        .smp_prepare_cpus       = socfpga_smp_prepare_cpus,
        .smp_boot_secondary     = socfpga_boot_secondary,
 #ifdef CONFIG_HOTPLUG_CPU
        .cpu_die                = socfpga_cpu_die,
 #endif
 };
+
+static struct smp_operations socfpga_a10_smp_ops __initdata = {
+       .smp_prepare_cpus       = socfpga_smp_prepare_cpus,
+       .smp_boot_secondary     = socfpga_a10_boot_secondary,
+#ifdef CONFIG_HOTPLUG_CPU
+       .cpu_die                = socfpga_cpu_die,
+#endif
+};
+
+CPU_METHOD_OF_DECLARE(socfpga_smp, "altr,socfpga-smp", &socfpga_smp_ops);
+CPU_METHOD_OF_DECLARE(socfpga_a10_smp, "altr,socfpga-a10-smp", &socfpga_a10_smp_ops);
diff --git a/arch/arm/mach-socfpga/pm.c b/arch/arm/mach-socfpga/pm.c
new file mode 100644 (file)
index 0000000..1ed89fc
--- /dev/null
@@ -0,0 +1,149 @@
+/*
+ *  arch/arm/mach-socfpga/pm.c
+ *
+ * Copyright (C) 2014-2015 Altera Corporation. All rights reserved.
+ *
+ * with code from pm-imx6.c
+ * Copyright 2011-2014 Freescale Semiconductor, Inc.
+ * Copyright 2011 Linaro 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/bitops.h>
+#include <linux/genalloc.h>
+#include <linux/init.h>
+#include <linux/io.h>
+#include <linux/of_platform.h>
+#include <linux/suspend.h>
+#include <asm/suspend.h>
+#include <asm/fncpy.h>
+#include "core.h"
+
+/* Pointer to function copied to ocram */
+static u32 (*socfpga_sdram_self_refresh_in_ocram)(u32 sdr_base);
+
+static int socfpga_setup_ocram_self_refresh(void)
+{
+       struct platform_device *pdev;
+       phys_addr_t ocram_pbase;
+       struct device_node *np;
+       struct gen_pool *ocram_pool;
+       unsigned long ocram_base;
+       void __iomem *suspend_ocram_base;
+       int ret = 0;
+
+       np = of_find_compatible_node(NULL, NULL, "mmio-sram");
+       if (!np) {
+               pr_err("%s: Unable to find mmio-sram in dtb\n", __func__);
+               return -ENODEV;
+       }
+
+       pdev = of_find_device_by_node(np);
+       if (!pdev) {
+               pr_warn("%s: failed to find ocram device!\n", __func__);
+               ret = -ENODEV;
+               goto put_node;
+       }
+
+       ocram_pool = dev_get_gen_pool(&pdev->dev);
+       if (!ocram_pool) {
+               pr_warn("%s: ocram pool unavailable!\n", __func__);
+               ret = -ENODEV;
+               goto put_node;
+       }
+
+       ocram_base = gen_pool_alloc(ocram_pool, socfpga_sdram_self_refresh_sz);
+       if (!ocram_base) {
+               pr_warn("%s: unable to alloc ocram!\n", __func__);
+               ret = -ENOMEM;
+               goto put_node;
+       }
+
+       ocram_pbase = gen_pool_virt_to_phys(ocram_pool, ocram_base);
+
+       suspend_ocram_base = __arm_ioremap_exec(ocram_pbase,
+                                               socfpga_sdram_self_refresh_sz,
+                                               false);
+       if (!suspend_ocram_base) {
+               pr_warn("%s: __arm_ioremap_exec failed!\n", __func__);
+               ret = -ENOMEM;
+               goto put_node;
+       }
+
+       /* Copy the code that puts DDR in self refresh to ocram */
+       socfpga_sdram_self_refresh_in_ocram =
+               (void *)fncpy(suspend_ocram_base,
+                             &socfpga_sdram_self_refresh,
+                             socfpga_sdram_self_refresh_sz);
+
+       WARN(!socfpga_sdram_self_refresh_in_ocram,
+            "could not copy function to ocram");
+       if (!socfpga_sdram_self_refresh_in_ocram)
+               ret = -EFAULT;
+
+put_node:
+       of_node_put(np);
+
+       return ret;
+}
+
+static int socfpga_pm_suspend(unsigned long arg)
+{
+       u32 ret;
+
+       if (!sdr_ctl_base_addr)
+               return -EFAULT;
+
+       ret = socfpga_sdram_self_refresh_in_ocram((u32)sdr_ctl_base_addr);
+
+       pr_debug("%s self-refresh loops request=%d exit=%d\n", __func__,
+                ret & 0xffff, (ret >> 16) & 0xffff);
+
+       return 0;
+}
+
+static int socfpga_pm_enter(suspend_state_t state)
+{
+       switch (state) {
+       case PM_SUSPEND_STANDBY:
+       case PM_SUSPEND_MEM:
+               outer_disable();
+               cpu_suspend(0, socfpga_pm_suspend);
+               outer_resume();
+               break;
+       default:
+               return -EINVAL;
+       }
+       return 0;
+}
+
+static const struct platform_suspend_ops socfpga_pm_ops = {
+       .valid  = suspend_valid_only_mem,
+       .enter  = socfpga_pm_enter,
+};
+
+static int __init socfpga_pm_init(void)
+{
+       int ret;
+
+       ret = socfpga_setup_ocram_self_refresh();
+       if (ret)
+               return ret;
+
+       suspend_set_ops(&socfpga_pm_ops);
+       pr_info("SoCFPGA initialized for DDR self-refresh during suspend.\n");
+
+       return 0;
+}
+arch_initcall(socfpga_pm_init);
diff --git a/arch/arm/mach-socfpga/self-refresh.S b/arch/arm/mach-socfpga/self-refresh.S
new file mode 100644 (file)
index 0000000..f2d7f88
--- /dev/null
@@ -0,0 +1,136 @@
+/*
+ * Copyright (C) 2014-2015 Altera Corporation. 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 <linux/linkage.h>
+#include <asm/assembler.h>
+
+#define MAX_LOOP_COUNT         1000
+
+/* Register offset */
+#define SDR_CTRLGRP_LOWPWREQ_ADDR       0x54
+#define SDR_CTRLGRP_LOWPWRACK_ADDR      0x58
+
+/* Bitfield positions */
+#define SELFRSHREQ_POS                  3
+#define SELFRSHREQ_MASK                 0x8
+
+#define SELFRFSHACK_POS                 1
+#define SELFRFSHACK_MASK                0x2
+
+       /*
+        * This code assumes that when the bootloader configured
+        * the sdram controller for the DDR on the board it
+        * configured the following fields depending on the DDR
+        * vendor/configuration:
+        *
+        * sdr.ctrlcfg.lowpwreq.selfrfshmask
+        * sdr.ctrlcfg.lowpwrtiming.clkdisablecycles
+        * sdr.ctrlcfg.dramtiming4.selfrfshexit
+        */
+
+       .arch   armv7-a
+       .text
+       .align 3
+
+       /*
+        * socfpga_sdram_self_refresh
+        *
+        *  r0 : sdr_ctl_base_addr
+        *  r1 : temp storage of return value
+        *  r2 : temp storage of register values
+        *  r3 : loop counter
+        *
+        *  return value: lower 16 bits: loop count going into self refresh
+        *                upper 16 bits: loop count exiting self refresh
+        */
+ENTRY(socfpga_sdram_self_refresh)
+       /* Enable dynamic clock gating in the Power Control Register. */
+       mrc     p15, 0, r2, c15, c0, 0
+       orr     r2, r2, #1
+       mcr     p15, 0, r2, c15, c0, 0
+
+       /* Enable self refresh: set sdr.ctrlgrp.lowpwreq.selfrshreq = 1 */
+       ldr     r2, [r0, #SDR_CTRLGRP_LOWPWREQ_ADDR]
+       orr     r2, r2, #SELFRSHREQ_MASK
+       str     r2, [r0, #SDR_CTRLGRP_LOWPWREQ_ADDR]
+
+       /* Poll until sdr.ctrlgrp.lowpwrack.selfrfshack == 1 or hit max loops */
+       mov     r3, #0
+while_ack_0:
+       ldr     r2, [r0, #SDR_CTRLGRP_LOWPWRACK_ADDR]
+       and     r2, r2, #SELFRFSHACK_MASK
+       cmp     r2, #SELFRFSHACK_MASK
+       beq     ack_1
+
+       add     r3, #1
+       cmp     r3, #MAX_LOOP_COUNT
+       bne     while_ack_0
+
+ack_1:
+       mov     r1, r3
+
+       /*
+        * Execute an ISB instruction to ensure that all of the
+        * CP15 register changes have been committed.
+        */
+       isb
+
+       /*
+        * Execute a barrier instruction to ensure that all cache,
+        * TLB and branch predictor maintenance operations issued
+        * by any CPU in the cluster have completed.
+        */
+       dsb
+       dmb
+
+       wfi
+
+       /* Disable self-refresh: set sdr.ctrlgrp.lowpwreq.selfrshreq = 0 */
+       ldr     r2, [r0, #SDR_CTRLGRP_LOWPWREQ_ADDR]
+       bic     r2, r2, #SELFRSHREQ_MASK
+       str     r2, [r0, #SDR_CTRLGRP_LOWPWREQ_ADDR]
+
+       /* Poll until sdr.ctrlgrp.lowpwrack.selfrfshack == 0 or hit max loops */
+       mov     r3, #0
+while_ack_1:
+       ldr     r2, [r0, #SDR_CTRLGRP_LOWPWRACK_ADDR]
+       and     r2, r2, #SELFRFSHACK_MASK
+       cmp     r2, #SELFRFSHACK_MASK
+       bne     ack_0
+
+       add     r3, #1
+       cmp     r3, #MAX_LOOP_COUNT
+       bne     while_ack_1
+
+ack_0:
+       /*
+        * Prepare return value:
+        * Shift loop count for exiting self refresh into upper 16 bits.
+        * Leave loop count for requesting self refresh in lower 16 bits.
+        */
+       mov     r3, r3, lsl #16
+       add     r1, r1, r3
+
+       /* Disable dynamic clock gating in the Power Control Register. */
+       mrc     p15, 0, r2, c15, c0, 0
+       bic     r2, r2, #1
+       mcr     p15, 0, r2, c15, c0, 0
+
+       mov     r0, r1                  @ return value
+       bx      lr                      @ return
+
+ENDPROC(socfpga_sdram_self_refresh)
+ENTRY(socfpga_sdram_self_refresh_sz)
+       .word   . - socfpga_sdram_self_refresh
index f5e597c207b9e47d26c0a7d021563cc6bdc8bf35..19643a756c48b68b8eb57ca328785d55921ff7d7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2012 Altera Corporation
+ *  Copyright (C) 2012-2015 Altera 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
 
 #include "core.h"
 
-void __iomem *socfpga_scu_base_addr = ((void __iomem *)(SOCFPGA_SCU_VIRT_BASE));
 void __iomem *sys_manager_base_addr;
 void __iomem *rst_manager_base_addr;
+void __iomem *sdr_ctl_base_addr;
 unsigned long socfpga_cpu1start_addr;
 
-static struct map_desc scu_io_desc __initdata = {
-       .virtual        = SOCFPGA_SCU_VIRT_BASE,
-       .pfn            = 0, /* run-time */
-       .length         = SZ_8K,
-       .type           = MT_DEVICE,
-};
-
-static struct map_desc uart_io_desc __initdata = {
-       .virtual        = 0xfec02000,
-       .pfn            = __phys_to_pfn(0xffc02000),
-       .length         = SZ_8K,
-       .type           = MT_DEVICE,
-};
-
-static void __init socfpga_scu_map_io(void)
-{
-       unsigned long base;
-
-       /* Get SCU base */
-       asm("mrc p15, 4, %0, c15, c0, 0" : "=r" (base));
-
-       scu_io_desc.pfn = __phys_to_pfn(base);
-       iotable_init(&scu_io_desc, 1);
-}
-
-static void __init socfpga_map_io(void)
-{
-       socfpga_scu_map_io();
-       iotable_init(&uart_io_desc, 1);
-       early_printk("Early printk initialized\n");
-}
-
 void __init socfpga_sysmgr_init(void)
 {
        struct device_node *np;
@@ -82,6 +50,9 @@ void __init socfpga_sysmgr_init(void)
 
        np = of_find_compatible_node(NULL, NULL, "altr,rst-mgr");
        rst_manager_base_addr = of_iomap(np, 0);
+
+       np = of_find_compatible_node(NULL, NULL, "altr,sdr-ctl");
+       sdr_ctl_base_addr = of_iomap(np, 0);
 }
 
 static void __init socfpga_init_irq(void)
@@ -111,8 +82,6 @@ static const char *altera_dt_match[] = {
 DT_MACHINE_START(SOCFPGA, "Altera SOCFPGA")
        .l2c_aux_val    = 0,
        .l2c_aux_mask   = ~0,
-       .smp            = smp_ops(socfpga_smp_ops),
-       .map_io         = socfpga_map_io,
        .init_irq       = socfpga_init_irq,
        .restart        = socfpga_cyclone5_restart,
        .dt_compat      = altera_dt_match,
index 3b1ac463a4947f21f3e82de66d8853a902367fa4..125865daaf1719e931cb051b9039292799b8e930 100644 (file)
@@ -1,6 +1,7 @@
 menuconfig ARCH_STI
        bool "STMicroelectronics Consumer Electronics SOCs" if ARCH_MULTI_V7
        select ARM_GIC
+       select ST_IRQCHIP
        select ARM_GLOBAL_TIMER
        select PINCTRL
        select PINCTRL_ST
diff --git a/arch/arm/mach-stm32/Makefile b/arch/arm/mach-stm32/Makefile
new file mode 100644 (file)
index 0000000..bd0b7b5
--- /dev/null
@@ -0,0 +1 @@
+obj-y += board-dt.o
diff --git a/arch/arm/mach-stm32/Makefile.boot b/arch/arm/mach-stm32/Makefile.boot
new file mode 100644 (file)
index 0000000..eacfc3f
--- /dev/null
@@ -0,0 +1,3 @@
+# Empty file waiting for deletion once Makefile.boot isn't needed any more.
+# Patch waits for application at
+# http://www.arm.linux.org.uk/developer/patches/viewpatch.php?id=7889/1 .
diff --git a/arch/arm/mach-stm32/board-dt.c b/arch/arm/mach-stm32/board-dt.c
new file mode 100644 (file)
index 0000000..f2ad772
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+ * Copyright (C) Maxime Coquelin 2015
+ * Author:  Maxime Coquelin <mcoquelin.stm32@gmail.com>
+ * License terms:  GNU General Public License (GPL), version 2
+ */
+
+#include <linux/kernel.h>
+#include <asm/v7m.h>
+#include <asm/mach/arch.h>
+
+static const char *const stm32_compat[] __initconst = {
+       "st,stm32f429",
+       NULL
+};
+
+DT_MACHINE_START(STM32DT, "STM32 (Device Tree Support)")
+       .dt_compat = stm32_compat,
+       .restart = armv7m_restart,
+MACHINE_END
index 587b0468efcc30f094c45ca6c4e50b91afff122d..e8483ec79d6706c0994b2dcd71a8183cd1e6a787 100644 (file)
@@ -121,3 +121,72 @@ static struct smp_operations sun6i_smp_ops __initdata = {
        .smp_boot_secondary     = sun6i_smp_boot_secondary,
 };
 CPU_METHOD_OF_DECLARE(sun6i_a31_smp, "allwinner,sun6i-a31", &sun6i_smp_ops);
+
+static void __init sun8i_smp_prepare_cpus(unsigned int max_cpus)
+{
+       struct device_node *node;
+
+       node = of_find_compatible_node(NULL, NULL, "allwinner,sun8i-a23-prcm");
+       if (!node) {
+               pr_err("Missing A23 PRCM node in the device tree\n");
+               return;
+       }
+
+       prcm_membase = of_iomap(node, 0);
+       if (!prcm_membase) {
+               pr_err("Couldn't map A23 PRCM registers\n");
+               return;
+       }
+
+       node = of_find_compatible_node(NULL, NULL,
+                                      "allwinner,sun8i-a23-cpuconfig");
+       if (!node) {
+               pr_err("Missing A23 CPU config node in the device tree\n");
+               return;
+       }
+
+       cpucfg_membase = of_iomap(node, 0);
+       if (!cpucfg_membase)
+               pr_err("Couldn't map A23 CPU config registers\n");
+
+}
+
+static int sun8i_smp_boot_secondary(unsigned int cpu,
+                                   struct task_struct *idle)
+{
+       u32 reg;
+
+       if (!(prcm_membase && cpucfg_membase))
+               return -EFAULT;
+
+       spin_lock(&cpu_lock);
+
+       /* Set CPU boot address */
+       writel(virt_to_phys(secondary_startup),
+              cpucfg_membase + CPUCFG_PRIVATE0_REG);
+
+       /* Assert the CPU core in reset */
+       writel(0, cpucfg_membase + CPUCFG_CPU_RST_CTRL_REG(cpu));
+
+       /* Assert the L1 cache in reset */
+       reg = readl(cpucfg_membase + CPUCFG_GEN_CTRL_REG);
+       writel(reg & ~BIT(cpu), cpucfg_membase + CPUCFG_GEN_CTRL_REG);
+
+       /* Clear CPU power-off gating */
+       reg = readl(prcm_membase + PRCM_CPU_PWROFF_REG);
+       writel(reg & ~BIT(cpu), prcm_membase + PRCM_CPU_PWROFF_REG);
+       mdelay(1);
+
+       /* Deassert the CPU core reset */
+       writel(3, cpucfg_membase + CPUCFG_CPU_RST_CTRL_REG(cpu));
+
+       spin_unlock(&cpu_lock);
+
+       return 0;
+}
+
+struct smp_operations sun8i_smp_ops __initdata = {
+       .smp_prepare_cpus       = sun8i_smp_prepare_cpus,
+       .smp_boot_secondary     = sun8i_smp_boot_secondary,
+};
+CPU_METHOD_OF_DECLARE(sun8i_a23_smp, "allwinner,sun8i-a23", &sun8i_smp_ops);
index e48a74458c258908ae7a6751ce005df21b1f624c..fffad2426ee4bc0ea1689b0de9e760db41713a0f 100644 (file)
@@ -19,7 +19,7 @@ obj-$(CONFIG_ARCH_TEGRA_3x_SOC)               += pm-tegra30.o
 ifeq ($(CONFIG_CPU_IDLE),y)
 obj-$(CONFIG_ARCH_TEGRA_3x_SOC)                += cpuidle-tegra30.o
 endif
-obj-$(CONFIG_SMP)                      += platsmp.o headsmp.o
+obj-$(CONFIG_SMP)                      += platsmp.o
 obj-$(CONFIG_HOTPLUG_CPU)               += hotplug.o
 
 obj-$(CONFIG_ARCH_TEGRA_114_SOC)       += sleep-tegra30.o
index 88de2dce2e8722820644b752ae8c4cee0c129ec9..7469347b17493890ec43856b2a961a407bc6f7e0 100644 (file)
@@ -34,6 +34,7 @@
 #include "iomap.h"
 #include "irq.h"
 #include "pm.h"
+#include "reset.h"
 #include "sleep.h"
 
 #ifdef CONFIG_PM_SLEEP
@@ -70,15 +71,13 @@ static struct cpuidle_driver tegra_idle_driver = {
 
 #ifdef CONFIG_PM_SLEEP
 #ifdef CONFIG_SMP
-static void __iomem *pmc = IO_ADDRESS(TEGRA_PMC_BASE);
-
 static int tegra20_reset_sleeping_cpu_1(void)
 {
        int ret = 0;
 
        tegra_pen_lock();
 
-       if (readl(pmc + PMC_SCRATCH41) == CPU_RESETTABLE)
+       if (readb(tegra20_cpu1_resettable_status) == CPU_RESETTABLE)
                tegra20_cpu_shutdown(1);
        else
                ret = -EINVAL;
diff --git a/arch/arm/mach-tegra/headsmp.S b/arch/arm/mach-tegra/headsmp.S
deleted file mode 100644 (file)
index 2072e73..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <linux/linkage.h>
-#include <linux/init.h>
-
-#include "sleep.h"
-
-        .section ".text.head", "ax"
-
-ENTRY(tegra_secondary_startup)
-        check_cpu_part_num 0xc09, r8, r9
-        bleq    v7_invalidate_l1
-        b       secondary_startup
-ENDPROC(tegra_secondary_startup)
index 71be4af5e975bec078508d1ea920568edf11b289..e3070fdab80b8b7481c0527e2d649ae7d664dc58 100644 (file)
@@ -169,10 +169,10 @@ after_errata:
        cmp     r6, #TEGRA20
        bne     1f
        /* If not CPU0, don't let CPU0 reset CPU1 now that CPU1 is coming up. */
-       mov32   r5, TEGRA_PMC_BASE
-       mov     r0, #0
+       mov32   r5, TEGRA_IRAM_BASE + TEGRA_IRAM_RESET_HANDLER_OFFSET
+       mov     r0, #CPU_NOT_RESETTABLE
        cmp     r10, #0
-       strne   r0, [r5, #PMC_SCRATCH41]
+       strneb  r0, [r5, #__tegra20_cpu1_resettable_status_offset]
 1:
 #endif
 
@@ -281,6 +281,10 @@ __tegra_cpu_reset_handler_data:
        .rept   TEGRA_RESET_DATA_SIZE
        .long   0
        .endr
+       .globl  __tegra20_cpu1_resettable_status_offset
+       .equ    __tegra20_cpu1_resettable_status_offset, \
+                                       . - __tegra_cpu_reset_handler_start
+       .byte   0
        .align L1_CACHE_SHIFT
 
 ENTRY(__tegra_cpu_reset_handler_end)
index 894c5c472184f9cf9c08f34966b83ff982766939..6fd9db54887eeebd400e425a216bce2cce9399b2 100644 (file)
@@ -94,7 +94,7 @@ void __init tegra_cpu_reset_handler_init(void)
        __tegra_cpu_reset_handler_data[TEGRA_RESET_MASK_PRESENT] =
                *((u32 *)cpu_possible_mask);
        __tegra_cpu_reset_handler_data[TEGRA_RESET_STARTUP_SECONDARY] =
-               virt_to_phys((void *)tegra_secondary_startup);
+               virt_to_phys((void *)secondary_startup);
 #endif
 
 #ifdef CONFIG_PM_SLEEP
index 76a93434c6ee07b8b2357761c7a18c1335e6039e..9c479c7925b85fc3e72032bdd9385a51160dc0e0 100644 (file)
@@ -35,8 +35,8 @@ extern unsigned long __tegra_cpu_reset_handler_data[TEGRA_RESET_DATA_SIZE];
 
 void __tegra_cpu_reset_handler_start(void);
 void __tegra_cpu_reset_handler(void);
+void __tegra20_cpu1_resettable_status_offset(void);
 void __tegra_cpu_reset_handler_end(void);
-void tegra_secondary_startup(void);
 
 #ifdef CONFIG_PM_SLEEP
 #define tegra_cpu_lp1_mask \
@@ -47,6 +47,9 @@ void tegra_secondary_startup(void);
        (IO_ADDRESS(TEGRA_IRAM_BASE + TEGRA_IRAM_RESET_HANDLER_OFFSET + \
        ((u32)&__tegra_cpu_reset_handler_data[TEGRA_RESET_MASK_LP2] - \
         (u32)__tegra_cpu_reset_handler_start)))
+#define tegra20_cpu1_resettable_status \
+       (IO_ADDRESS(TEGRA_IRAM_BASE + TEGRA_IRAM_RESET_HANDLER_OFFSET + \
+        (u32)__tegra20_cpu1_resettable_status_offset))
 #endif
 
 #define tegra_cpu_reset_handler_offset \
index be4bc5f853f5c370ed345bf135d1092b9e94e883..e6b684e14322cef21e44d1b660e4c6e8d0c7ec43 100644 (file)
@@ -97,9 +97,10 @@ ENDPROC(tegra20_hotplug_shutdown)
 ENTRY(tegra20_cpu_shutdown)
        cmp     r0, #0
        reteq   lr                      @ must not be called for CPU 0
-       mov32   r1, TEGRA_PMC_VIRT + PMC_SCRATCH41
+       mov32   r1, TEGRA_IRAM_RESET_BASE_VIRT
+       ldr     r2, =__tegra20_cpu1_resettable_status_offset
        mov     r12, #CPU_RESETTABLE
-       str     r12, [r1]
+       strb    r12, [r1, r2]
 
        cpu_to_halt_reg r1, r0
        ldr     r3, =TEGRA_FLOW_CTRL_VIRT
@@ -182,38 +183,41 @@ ENDPROC(tegra_pen_unlock)
 /*
  * tegra20_cpu_clear_resettable(void)
  *
- * Called to clear the "resettable soon" flag in PMC_SCRATCH41 when
+ * Called to clear the "resettable soon" flag in IRAM variable when
  * it is expected that the secondary CPU will be idle soon.
  */
 ENTRY(tegra20_cpu_clear_resettable)
-       mov32   r1, TEGRA_PMC_VIRT + PMC_SCRATCH41
+       mov32   r1, TEGRA_IRAM_RESET_BASE_VIRT
+       ldr     r2, =__tegra20_cpu1_resettable_status_offset
        mov     r12, #CPU_NOT_RESETTABLE
-       str     r12, [r1]
+       strb    r12, [r1, r2]
        ret     lr
 ENDPROC(tegra20_cpu_clear_resettable)
 
 /*
  * tegra20_cpu_set_resettable_soon(void)
  *
- * Called to set the "resettable soon" flag in PMC_SCRATCH41 when
+ * Called to set the "resettable soon" flag in IRAM variable when
  * it is expected that the secondary CPU will be idle soon.
  */
 ENTRY(tegra20_cpu_set_resettable_soon)
-       mov32   r1, TEGRA_PMC_VIRT + PMC_SCRATCH41
+       mov32   r1, TEGRA_IRAM_RESET_BASE_VIRT
+       ldr     r2, =__tegra20_cpu1_resettable_status_offset
        mov     r12, #CPU_RESETTABLE_SOON
-       str     r12, [r1]
+       strb    r12, [r1, r2]
        ret     lr
 ENDPROC(tegra20_cpu_set_resettable_soon)
 
 /*
  * tegra20_cpu_is_resettable_soon(void)
  *
- * Returns true if the "resettable soon" flag in PMC_SCRATCH41 has been
+ * Returns true if the "resettable soon" flag in IRAM variable has been
  * set because it is expected that the secondary CPU will be idle soon.
  */
 ENTRY(tegra20_cpu_is_resettable_soon)
-       mov32   r1, TEGRA_PMC_VIRT + PMC_SCRATCH41
-       ldr     r12, [r1]
+       mov32   r1, TEGRA_IRAM_RESET_BASE_VIRT
+       ldr     r2, =__tegra20_cpu1_resettable_status_offset
+       ldrb    r12, [r1, r2]
        cmp     r12, #CPU_RESETTABLE_SOON
        moveq   r0, #1
        movne   r0, #0
@@ -256,9 +260,10 @@ ENTRY(tegra20_sleep_cpu_secondary_finish)
        mov     r0, #TEGRA_FLUSH_CACHE_LOUIS
        bl      tegra_disable_clean_inv_dcache
 
-       mov32   r0, TEGRA_PMC_VIRT + PMC_SCRATCH41
+       mov32   r0, TEGRA_IRAM_RESET_BASE_VIRT
+       ldr     r4, =__tegra20_cpu1_resettable_status_offset
        mov     r3, #CPU_RESETTABLE
-       str     r3, [r0]
+       strb    r3, [r0, r4]
 
        bl      tegra_cpu_do_idle
 
@@ -274,10 +279,10 @@ ENTRY(tegra20_sleep_cpu_secondary_finish)
 
        bl      tegra_pen_lock
 
-       mov32   r3, TEGRA_PMC_VIRT
-       add     r0, r3, #PMC_SCRATCH41
+       mov32   r0, TEGRA_IRAM_RESET_BASE_VIRT
+       ldr     r4, =__tegra20_cpu1_resettable_status_offset
        mov     r3, #CPU_NOT_RESETTABLE
-       str     r3, [r0]
+       strb    r3, [r0, r4]
 
        bl      tegra_pen_unlock
 
index 5d8d13aeab937f0f9fd5348cd34cf5e638035769..9a2f0b051e1035a4f956dbf98a90a9de493416e9 100644 (file)
@@ -223,7 +223,7 @@ wfe_war:
        b       __cpu_reset_again
 
        /*
-        * 38 nop's, which fills reset of wfe cache line and
+        * 38 nop's, which fills rest of wfe cache line and
         * 4 more cachelines with nop
         */
        .rept 38
index 92d46ec1361abba6f8beb6130d753ea634c8933a..0d59360d891da8e244c81241f1cf39c96235919c 100644 (file)
@@ -18,6 +18,7 @@
 #define __MACH_TEGRA_SLEEP_H
 
 #include "iomap.h"
+#include "irammap.h"
 
 #define TEGRA_ARM_PERIF_VIRT (TEGRA_ARM_PERIF_BASE - IO_CPU_PHYS \
                                        + IO_CPU_VIRT)
@@ -29,6 +30,9 @@
                                        + IO_APB_VIRT)
 #define TEGRA_PMC_VIRT (TEGRA_PMC_BASE - IO_APB_PHYS + IO_APB_VIRT)
 
+#define TEGRA_IRAM_RESET_BASE_VIRT (IO_IRAM_VIRT + \
+                               TEGRA_IRAM_RESET_HANDLER_OFFSET)
+
 /* PMC_SCRATCH37-39 and 41 are used for tegra_pen_lock and idle */
 #define PMC_SCRATCH37  0x130
 #define PMC_SCRATCH38  0x134
index 861d88486dbec233d4ab52a42af4f666ab48ba7c..2378fa560a210b4a523d60a230b1b6ca128a42ce 100644 (file)
@@ -163,6 +163,5 @@ DT_MACHINE_START(TEGRA_DT, "NVIDIA Tegra SoC (Flattened Device Tree)")
        .init_irq       = tegra_dt_init_irq,
        .init_machine   = tegra_dt_init,
        .init_late      = tegra_dt_init_late,
-       .restart        = tegra_pmc_restart,
        .dt_compat      = tegra_dt_board_compat,
 MACHINE_END
diff --git a/arch/arm/mach-uniphier/Kconfig b/arch/arm/mach-uniphier/Kconfig
new file mode 100644 (file)
index 0000000..b640458
--- /dev/null
@@ -0,0 +1,11 @@
+config ARCH_UNIPHIER
+       bool "Socionext UniPhier SoCs"
+       depends on ARCH_MULTI_V7
+       select ARM_AMBA
+       select ARM_GLOBAL_TIMER
+       select ARM_GIC
+       select HAVE_ARM_SCU
+       select HAVE_ARM_TWD if SMP
+       help
+         Support for UniPhier SoC family developed by Socionext Inc.
+         (formerly, System LSI Business Division of Panasonic Corporation)
diff --git a/arch/arm/mach-uniphier/Makefile b/arch/arm/mach-uniphier/Makefile
new file mode 100644 (file)
index 0000000..60bd226
--- /dev/null
@@ -0,0 +1,2 @@
+obj-y                  := uniphier.o
+obj-$(CONFIG_SMP)      += platsmp.o
diff --git a/arch/arm/mach-uniphier/platsmp.c b/arch/arm/mach-uniphier/platsmp.c
new file mode 100644 (file)
index 0000000..5943e1c
--- /dev/null
@@ -0,0 +1,90 @@
+/*
+ * 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/sizes.h>
+#include <linux/compiler.h>
+#include <linux/init.h>
+#include <linux/io.h>
+#include <linux/regmap.h>
+#include <linux/mfd/syscon.h>
+#include <asm/smp.h>
+#include <asm/smp_scu.h>
+
+static struct regmap *sbcm_regmap;
+
+static void __init uniphier_smp_prepare_cpus(unsigned int max_cpus)
+{
+       static cpumask_t only_cpu_0 = { CPU_BITS_CPU0 };
+       unsigned long scu_base_phys = 0;
+       void __iomem *scu_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 (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;
+       }
+
+       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;
+       }
+
+       scu_enable(scu_base);
+       iounmap(scu_base);
+
+       return;
+err:
+       pr_warn("disabling SMP\n");
+       init_cpu_present(&only_cpu_0);
+       sbcm_regmap = NULL;
+}
+
+static void __naked uniphier_secondary_startup(void)
+{
+       asm("bl         v7_invalidate_l1\n"
+           "b          secondary_startup\n");
+};
+
+static int uniphier_boot_secondary(unsigned int cpu,
+                                  struct task_struct *idle)
+{
+       int ret;
+
+       if (!sbcm_regmap)
+               return -ENODEV;
+
+       ret = regmap_write(sbcm_regmap, 0x1208,
+                          virt_to_phys(uniphier_secondary_startup));
+       if (!ret)
+               asm("sev"); /* wake up secondary CPU */
+
+       return ret;
+}
+
+struct smp_operations uniphier_smp_ops __initdata = {
+       .smp_prepare_cpus       = uniphier_smp_prepare_cpus,
+       .smp_boot_secondary     = uniphier_boot_secondary,
+};
+CPU_METHOD_OF_DECLARE(uniphier_smp, "socionext,uniphier-smp",
+                     &uniphier_smp_ops);
diff --git a/arch/arm/mach-uniphier/uniphier.c b/arch/arm/mach-uniphier/uniphier.c
new file mode 100644 (file)
index 0000000..9be10ef
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * 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 <asm/mach/arch.h>
+
+static const char * const uniphier_dt_compat[] __initconst = {
+       "socionext,ph1-sld3",
+       "socionext,ph1-ld4",
+       "socionext,ph1-pro4",
+       "socionext,ph1-sld8",
+       "socionext,ph1-pro5",
+       "socionext,proxstream2",
+       "socionext,ph1-ld6b",
+       NULL,
+};
+
+DT_MACHINE_START(UNIPHIER, "Socionext UniPhier")
+       .dt_compat      = uniphier_dt_compat,
+MACHINE_END
index e97ee556f92f8535e5f29f4cc5b369bfe73c3ab8..7557bede7ae67700c6cc65e593e94210bc93408d 100644 (file)
@@ -6,6 +6,7 @@
 
 #include <linux/io.h>
 #include <linux/of.h>
+#include <linux/of_address.h>
 
 #include <asm/hardware/cache-l2x0.h>
 
 static int __init ux500_l2x0_unlock(void)
 {
        int i;
-       void __iomem *l2x0_base = __io_address(U8500_L2CC_BASE);
+       struct device_node *np;
+       void __iomem *l2x0_base;
+
+       np = of_find_compatible_node(NULL, NULL, "arm,pl310-cache");
+       l2x0_base = of_iomap(np, 0);
+       of_node_put(np);
+       if (!l2x0_base)
+               return -ENODEV;
 
        /*
         * Unlock Data and Instruction Lock if locked. Ux500 U-Boot versions
@@ -30,6 +38,7 @@ static int __init ux500_l2x0_unlock(void)
                writel_relaxed(0x0, l2x0_base + L2X0_LOCKDOWN_WAY_I_BASE +
                               i * L2X0_LOCKDOWN_STRIDE);
        }
+       iounmap(l2x0_base);
        return 0;
 }
 
index 6f63954c8bded70698bb3a1cd7b88800856f3bd2..16913800bbf9c5a5b3f799e3b0991a06e935e858 100644 (file)
@@ -43,60 +43,10 @@ static struct prcmu_pdata db8500_prcmu_pdata = {
        .legacy_offset  = DB8500_PRCMU_LEGACY_OFFSET,
 };
 
-/* minimum static i/o mapping required to boot U8500 platforms */
-static struct map_desc u8500_uart_io_desc[] __initdata = {
-       __IO_DEV_DESC(U8500_UART0_BASE, SZ_4K),
-       __IO_DEV_DESC(U8500_UART2_BASE, SZ_4K),
-};
-/*  U8500 and U9540 common io_desc */
-static struct map_desc u8500_common_io_desc[] __initdata = {
-       /* SCU base also covers GIC CPU BASE and TWD with its 4K page */
-       __IO_DEV_DESC(U8500_SCU_BASE, SZ_4K),
-       __IO_DEV_DESC(U8500_GIC_DIST_BASE, SZ_4K),
-       __IO_DEV_DESC(U8500_L2CC_BASE, SZ_4K),
-       __IO_DEV_DESC(U8500_MTU0_BASE, SZ_4K),
-       __IO_DEV_DESC(U8500_BACKUPRAM0_BASE, SZ_8K),
-
-       __IO_DEV_DESC(U8500_CLKRST1_BASE, SZ_4K),
-       __IO_DEV_DESC(U8500_CLKRST2_BASE, SZ_4K),
-       __IO_DEV_DESC(U8500_CLKRST3_BASE, SZ_4K),
-       __IO_DEV_DESC(U8500_CLKRST5_BASE, SZ_4K),
-       __IO_DEV_DESC(U8500_CLKRST6_BASE, SZ_4K),
-
-       __IO_DEV_DESC(U8500_GPIO0_BASE, SZ_4K),
-       __IO_DEV_DESC(U8500_GPIO1_BASE, SZ_4K),
-       __IO_DEV_DESC(U8500_GPIO2_BASE, SZ_4K),
-       __IO_DEV_DESC(U8500_GPIO3_BASE, SZ_4K),
-};
-
-/* U8500 IO map specific description */
-static struct map_desc u8500_io_desc[] __initdata = {
-       __IO_DEV_DESC(U8500_PRCMU_BASE, SZ_4K),
-       __IO_DEV_DESC(U8500_PRCMU_TCDM_BASE, SZ_4K),
-
-};
-
-/* U9540 IO map specific description */
-static struct map_desc u9540_io_desc[] __initdata = {
-       __IO_DEV_DESC(U8500_PRCMU_BASE, SZ_4K + SZ_8K),
-       __IO_DEV_DESC(U8500_PRCMU_TCDM_BASE, SZ_4K + SZ_8K),
-};
-
 static void __init u8500_map_io(void)
 {
-       /*
-        * Map the UARTs early so that the DEBUG_LL stuff continues to work.
-        */
-       iotable_init(u8500_uart_io_desc, ARRAY_SIZE(u8500_uart_io_desc));
-
-       ux500_map_io();
-
-       iotable_init(u8500_common_io_desc, ARRAY_SIZE(u8500_common_io_desc));
-
-       if (cpu_is_ux540_family())
-               iotable_init(u9540_io_desc, ARRAY_SIZE(u9540_io_desc));
-       else
-               iotable_init(u8500_io_desc, ARRAY_SIZE(u8500_io_desc));
+       debug_ll_io_init();
+       ux500_setup_id();
 }
 
 /*
@@ -125,14 +75,18 @@ static struct arm_pmu_platdata db8500_pmu_platdata = {
 
 static const char *db8500_read_soc_id(void)
 {
-       void __iomem *uid = __io_address(U8500_BB_UID_BASE);
+       void __iomem *uid;
 
+       uid = ioremap(U8500_BB_UID_BASE, 0x20);
+       if (!uid)
+               return NULL;
        /* Throw these device-specific numbers into the entropy pool */
        add_device_randomness(uid, 0x14);
        return kasprintf(GFP_KERNEL, "%08x%08x%08x%08x%08x",
                         readl((u32 *)uid+0),
                         readl((u32 *)uid+1), readl((u32 *)uid+2),
                         readl((u32 *)uid+3), readl((u32 *)uid+4));
+       iounmap(uid);
 }
 
 static struct device * __init db8500_soc_device_init(void)
index 6ced0f6802629f8e94ff67ccdd9fe185e4418bc6..e31d3d61c9988a645bf081f7462fffaee3db67dd 100644 (file)
@@ -16,6 +16,7 @@
 #include <linux/stat.h>
 #include <linux/of.h>
 #include <linux/of_irq.h>
+#include <linux/of_address.h>
 #include <linux/irq.h>
 #include <linux/irqchip.h>
 #include <linux/irqchip/arm-gic.h>
@@ -52,31 +53,36 @@ void ux500_restart(enum reboot_mode mode, const char *cmd)
 */
 void __init ux500_init_irq(void)
 {
+       struct device_node *np;
+       struct resource r;
+
        gic_set_irqchip_flags(IRQCHIP_SKIP_SET_WAKE | IRQCHIP_MASK_ON_SUSPEND);
        irqchip_init();
+       np = of_find_compatible_node(NULL, NULL, "stericsson,db8500-prcmu");
+       of_address_to_resource(np, 0, &r);
+       of_node_put(np);
+       if (!r.start) {
+               pr_err("could not find PRCMU base resource\n");
+               return;
+       }
+       prcmu_early_init(r.start, r.end-r.start);
+       ux500_pm_init(r.start, r.end-r.start);
 
        /*
         * Init clocks here so that they are available for system timer
         * initialization.
         */
        if (cpu_is_u8500_family()) {
-               prcmu_early_init(U8500_PRCMU_BASE, SZ_8K - 1);
-               ux500_pm_init(U8500_PRCMU_BASE, SZ_8K - 1);
-
                u8500_of_clk_init(U8500_CLKRST1_BASE,
                                  U8500_CLKRST2_BASE,
                                  U8500_CLKRST3_BASE,
                                  U8500_CLKRST5_BASE,
                                  U8500_CLKRST6_BASE);
        } else if (cpu_is_u9540()) {
-               prcmu_early_init(U8500_PRCMU_BASE, SZ_8K - 1);
-               ux500_pm_init(U8500_PRCMU_BASE, SZ_8K - 1);
                u9540_clk_init(U8500_CLKRST1_BASE, U8500_CLKRST2_BASE,
                               U8500_CLKRST3_BASE, U8500_CLKRST5_BASE,
                               U8500_CLKRST6_BASE);
        } else if (cpu_is_u8540()) {
-               prcmu_early_init(U8500_PRCMU_BASE, SZ_8K + SZ_4K - 1);
-               ux500_pm_init(U8500_PRCMU_BASE, SZ_8K + SZ_4K - 1);
                u8540_clk_init(U8500_CLKRST1_BASE, U8500_CLKRST2_BASE,
                               U8500_CLKRST3_BASE, U8500_CLKRST5_BASE,
                               U8500_CLKRST6_BASE);
index 392f2fdb37d05fbba89ac4517d9a4ee1ac7c4857..1e81e990044b527a003682b1f2fe7e76bd5a7113 100644 (file)
@@ -72,7 +72,7 @@ static unsigned int partnumber(unsigned int asicid)
  * DB9540      0x413fc090      0xFFFFDBF4              0x009540xx
  */
 
-void __init ux500_map_io(void)
+void __init ux500_setup_id(void)
 {
        unsigned int cpuid = read_cpuid_id();
        unsigned int asicid = 0;
index a44967f3168c8e5254f1917b5aac9a8995301f0e..62b1de922bd8fdeaddc55aa13b295dc83b9a2120 100644 (file)
@@ -16,6 +16,8 @@
 #include <linux/device.h>
 #include <linux/smp.h>
 #include <linux/io.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
 
 #include <asm/cacheflush.h>
 #include <asm/smp_plat.h>
@@ -26,6 +28,9 @@
 #include "db8500-regs.h"
 #include "id.h"
 
+static void __iomem *scu_base;
+static void __iomem *backupram;
+
 /* This is called from headsmp.S to wakeup the secondary core */
 extern void u8500_secondary_startup(void);
 
@@ -41,16 +46,6 @@ static void write_pen_release(int val)
        sync_cache_w(&pen_release);
 }
 
-static void __iomem *scu_base_addr(void)
-{
-       if (cpu_is_u8500_family() || cpu_is_ux540_family())
-               return __io_address(U8500_SCU_BASE);
-       else
-               ux500_unknown_soc();
-
-       return NULL;
-}
-
 static DEFINE_SPINLOCK(boot_lock);
 
 static void ux500_secondary_init(unsigned int cpu)
@@ -104,13 +99,6 @@ static int ux500_boot_secondary(unsigned int cpu, struct task_struct *idle)
 
 static void __init wakeup_secondary(void)
 {
-       void __iomem *backupram;
-
-       if (cpu_is_u8500_family() || cpu_is_ux540_family())
-               backupram = __io_address(U8500_BACKUPRAM0_BASE);
-       else
-               ux500_unknown_soc();
-
        /*
         * write the address of secondary startup into the backup ram register
         * at offset 0x1FF4, then write the magic number 0xA1FEED01 to the
@@ -135,10 +123,16 @@ static void __init wakeup_secondary(void)
  */
 static void __init ux500_smp_init_cpus(void)
 {
-       void __iomem *scu_base = scu_base_addr();
        unsigned int i, ncores;
+       struct device_node *np;
 
-       ncores = scu_base ? scu_get_core_count(scu_base) : 1;
+       np = of_find_compatible_node(NULL, NULL, "arm,cortex-a9-scu");
+       scu_base = of_iomap(np, 0);
+       of_node_put(np);
+       if (!scu_base)
+               return;
+       backupram = ioremap(U8500_BACKUPRAM0_BASE, SZ_8K);
+       ncores = scu_get_core_count(scu_base);
 
        /* sanity check */
        if (ncores > nr_cpu_ids) {
@@ -153,8 +147,7 @@ static void __init ux500_smp_init_cpus(void)
 
 static void __init ux500_smp_prepare_cpus(unsigned int max_cpus)
 {
-
-       scu_enable(scu_base_addr());
+       scu_enable(scu_base);
        wakeup_secondary();
 }
 
index 2cb587b50905af29edbfb914a61ad4e4c9615035..8538910db202ab6a13e0e3588f27b2a3157c4bc2 100644 (file)
@@ -15,6 +15,8 @@
 #include <linux/io.h>
 #include <linux/suspend.h>
 #include <linux/platform_data/arm-ux500-pm.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
 
 #include "db8500-regs.h"
 #include "pm_domains.h"
@@ -42,6 +44,7 @@
 #define PRCM_ARMITVAL127TO96   (prcmu_base + 0x26C)
 
 static void __iomem *prcmu_base;
+static void __iomem *dist_base;
 
 /* This function decouple the gic from the prcmu */
 int prcmu_gic_decouple(void)
@@ -88,7 +91,6 @@ bool prcmu_gic_pending_irq(void)
 {
        u32 pr; /* Pending register */
        u32 er; /* Enable register */
-       void __iomem *dist_base = __io_address(U8500_GIC_DIST_BASE);
        int i;
 
        /* 5 registers. STI & PPI not skipped */
@@ -143,7 +145,6 @@ bool prcmu_is_cpu_in_wfi(int cpu)
 int prcmu_copy_gic_settings(void)
 {
        u32 er; /* Enable register */
-       void __iomem *dist_base = __io_address(U8500_GIC_DIST_BASE);
        int i;
 
        /* We skip the STI and PPI */
@@ -179,11 +180,21 @@ static const struct platform_suspend_ops ux500_suspend_ops = {
 
 void __init ux500_pm_init(u32 phy_base, u32 size)
 {
+       struct device_node *np;
+
        prcmu_base = ioremap(phy_base, size);
        if (!prcmu_base) {
                pr_err("could not remap PRCMU for PM functions\n");
                return;
        }
+       np = of_find_compatible_node(NULL, NULL, "arm,cortex-a9-gic");
+       dist_base = of_iomap(np, 0);
+       of_node_put(np);
+       if (!dist_base) {
+               pr_err("could not remap GIC dist base for PM functions\n");
+               return;
+       }
+
        /*
         * On watchdog reboot the GIC is in some cases decoupled.
         * This will make sure that the GIC is correctly configured.
index 2dea8b59d2220e1bacf274bdf7c75c010bbf8728..1fb6ad2789f18b404ab77dada2da69eee92599ee 100644 (file)
@@ -18,7 +18,7 @@
 
 void ux500_restart(enum reboot_mode mode, const char *cmd);
 
-void __init ux500_map_io(void);
+void __init ux500_setup_id(void);
 
 extern void __init ux500_init_irq(void);
 
@@ -26,20 +26,6 @@ extern struct device *ux500_soc_device_init(const char *soc_id);
 
 extern void ux500_timer_init(void);
 
-#define __IO_DEV_DESC(x, sz)   {               \
-       .virtual        = IO_ADDRESS(x),        \
-       .pfn            = __phys_to_pfn(x),     \
-       .length         = sz,                   \
-       .type           = MT_DEVICE,            \
-}
-
-#define __MEM_DEV_DESC(x, sz)  {               \
-       .virtual        = IO_ADDRESS(x),        \
-       .pfn            = __phys_to_pfn(x),     \
-       .length         = sz,                   \
-       .type           = MT_MEMORY_RWX,                \
-}
-
 extern struct smp_operations ux500_smp_ops;
 extern void ux500_cpu_die(unsigned int cpu);
 
diff --git a/arch/arm/mach-zx/Kconfig b/arch/arm/mach-zx/Kconfig
new file mode 100644 (file)
index 0000000..2a910dc
--- /dev/null
@@ -0,0 +1,18 @@
+menuconfig ARCH_ZX
+       bool "ZTE ZX family" if ARCH_MULTI_V7
+       help
+         Support for ZTE ZX-based family of processors. TV
+         set-top-box processor is supported. More will be
+         added soon.
+
+if ARCH_ZX
+
+config SOC_ZX296702
+       def_bool y
+       select ARM_GIC
+       select ARM_GLOBAL_TIMER
+       select HAVE_ARM_SCU if SMP
+       select HAVE_ARM_TWD if SMP
+       help
+         Support for ZTE ZX296702 SoC which is a dual core CortexA9MP
+endif
diff --git a/arch/arm/mach-zx/Makefile b/arch/arm/mach-zx/Makefile
new file mode 100644 (file)
index 0000000..7c2edf6
--- /dev/null
@@ -0,0 +1,2 @@
+obj-$(CONFIG_SOC_ZX296702) += zx296702.o
+obj-$(CONFIG_SMP) += headsmp.o platsmp.o
diff --git a/arch/arm/mach-zx/core.h b/arch/arm/mach-zx/core.h
new file mode 100644 (file)
index 0000000..3efe8e0
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+ * Copyright 2014 Linaro Ltd.
+ * Copyright (C) 2014 ZTE 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 __MACH_ZX_CORE_H
+#define __MACH_ZX_CORE_H
+
+extern void zx_resume_jump(void);
+extern size_t zx_suspend_iram_sz;
+extern unsigned long zx_secondary_startup_pa;
+
+void zx_secondary_startup(void);
+
+#endif /* __MACH_ZX_CORE_H */
diff --git a/arch/arm/mach-zx/headsmp.S b/arch/arm/mach-zx/headsmp.S
new file mode 100644 (file)
index 0000000..a1aa402
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2014 Linaro Ltd.
+ * Copyright (C) 2014 ZTE 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.
+ */
+
+#include <linux/linkage.h>
+
+       .align 3
+       .arm
+
+/* It runs from physical address */
+ENTRY(zx_resume_jump)
+       adr     r1, zx_secondary_startup_pa
+       ldr     r0, [r1]
+       bx      r0
+ENDPROC(zx_resume_jump)
+
+ENTRY(zx_secondary_startup_pa)
+       .word   zx_secondary_startup_pa
+
+ENTRY(zx_suspend_iram_sz)
+        .word  . - zx_resume_jump
+ENDPROC(zx_secondary_startup_pa)
+
+
+ENTRY(zx_secondary_startup)
+       bl      v7_invalidate_l1
+       b       secondary_startup
+ENDPROC(zx_secondary_startup)
diff --git a/arch/arm/mach-zx/platsmp.c b/arch/arm/mach-zx/platsmp.c
new file mode 100644 (file)
index 0000000..a369398
--- /dev/null
@@ -0,0 +1,189 @@
+/*
+ * Copyright 2014 Linaro Ltd.
+ * Copyright (C) 2014 ZTE 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.
+ */
+
+#include <linux/delay.h>
+#include <linux/errno.h>
+#include <linux/init.h>
+#include <linux/io.h>
+#include <linux/jiffies.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/smp.h>
+
+#include <asm/cacheflush.h>
+#include <asm/cp15.h>
+#include <asm/fncpy.h>
+#include <asm/proc-fns.h>
+#include <asm/smp_scu.h>
+#include <asm/smp_plat.h>
+
+#include "core.h"
+
+#define AON_SYS_CTRL_RESERVED1         0xa8
+
+#define BUS_MATRIX_REMAP_CONFIG                0x00
+
+#define PCU_CPU0_CTRL                  0x00
+#define PCU_CPU1_CTRL                  0x04
+#define PCU_CPU1_ST                    0x0c
+#define PCU_GLOBAL_CTRL                        0x14
+#define PCU_EXPEND_CONTROL             0x34
+
+#define ZX_IRAM_BASE                   0x00200000
+
+static void __iomem *pcu_base;
+static void __iomem *matrix_base;
+static void __iomem *scu_base;
+
+void __init zx_smp_prepare_cpus(unsigned int max_cpus)
+{
+       struct device_node *np;
+       unsigned long base = 0;
+       void __iomem *aonsysctrl_base;
+       void __iomem *sys_iram;
+
+       base = scu_a9_get_base();
+       scu_base = ioremap(base, SZ_256);
+       if (!scu_base) {
+               pr_err("%s: failed to map scu\n", __func__);
+               return;
+       }
+
+       scu_enable(scu_base);
+
+       np = of_find_compatible_node(NULL, NULL, "zte,sysctrl");
+       if (!np) {
+               pr_err("%s: failed to find sysctrl node\n", __func__);
+               return;
+       }
+
+       aonsysctrl_base = of_iomap(np, 0);
+       if (!aonsysctrl_base) {
+               pr_err("%s: failed to map aonsysctrl\n", __func__);
+               of_node_put(np);
+               return;
+       }
+
+       /*
+        * Write the address of secondary startup into the
+        * system-wide flags register. The BootMonitor waits
+        * until it receives a soft interrupt, and then the
+        * secondary CPU branches to this address.
+        */
+       __raw_writel(virt_to_phys(zx_secondary_startup),
+                    aonsysctrl_base + AON_SYS_CTRL_RESERVED1);
+
+       iounmap(aonsysctrl_base);
+       of_node_put(np);
+
+       np = of_find_compatible_node(NULL, NULL, "zte,zx296702-pcu");
+       pcu_base = of_iomap(np, 0);
+       of_node_put(np);
+       WARN_ON(!pcu_base);
+
+       np = of_find_compatible_node(NULL, NULL, "zte,zx-bus-matrix");
+       matrix_base = of_iomap(np, 0);
+       of_node_put(np);
+       WARN_ON(!matrix_base);
+
+       /* Map the first 4 KB IRAM for suspend usage */
+       sys_iram = __arm_ioremap_exec(ZX_IRAM_BASE, PAGE_SIZE, false);
+       zx_secondary_startup_pa = virt_to_phys(zx_secondary_startup);
+       fncpy(sys_iram, &zx_resume_jump, zx_suspend_iram_sz);
+}
+
+static int zx_boot_secondary(unsigned int cpu, struct task_struct *idle)
+{
+       static bool first_boot = true;
+
+       if (first_boot) {
+               arch_send_wakeup_ipi_mask(cpumask_of(cpu));
+               first_boot = false;
+               return 0;
+       }
+
+       /* Swap the base address mapping between IRAM and IROM */
+       writel_relaxed(0x1, matrix_base + BUS_MATRIX_REMAP_CONFIG);
+
+       /* Power on CPU1 */
+       writel_relaxed(0x0, pcu_base + PCU_CPU1_CTRL);
+
+       /* Wait for power on ack */
+       while (readl_relaxed(pcu_base + PCU_CPU1_ST) & 0x4)
+               cpu_relax();
+
+       /* Swap back the mapping of IRAM and IROM */
+       writel_relaxed(0x0, matrix_base + BUS_MATRIX_REMAP_CONFIG);
+
+       return 0;
+}
+
+#ifdef CONFIG_HOTPLUG_CPU
+static inline void cpu_enter_lowpower(void)
+{
+       unsigned int v;
+
+       asm volatile(
+               "mcr    p15, 0, %1, c7, c5, 0\n"
+       "       mcr     p15, 0, %1, c7, c10, 4\n"
+       /*
+        * Turn off coherency
+        */
+       "       mrc     p15, 0, %0, c1, c0, 1\n"
+       "       bic     %0, %0, %3\n"
+       "       mcr     p15, 0, %0, c1, c0, 1\n"
+       "       mrc     p15, 0, %0, c1, c0, 0\n"
+       "       bic     %0, %0, %2\n"
+       "       mcr     p15, 0, %0, c1, c0, 0\n"
+         : "=&r" (v)
+         : "r" (0), "Ir" (CR_C), "Ir" (0x40)
+         : "cc");
+}
+
+static int zx_cpu_kill(unsigned int cpu)
+{
+       unsigned long timeout = jiffies + msecs_to_jiffies(2000);
+
+       writel_relaxed(0x2, pcu_base + PCU_CPU1_CTRL);
+
+       while ((readl_relaxed(pcu_base + PCU_CPU1_ST) & 0x3) != 0x0) {
+               if (time_after(jiffies, timeout)) {
+                       pr_err("*** cpu1 poweroff timeout\n");
+                       break;
+               }
+       }
+       return 1;
+}
+
+static void zx_cpu_die(unsigned int cpu)
+{
+       scu_power_mode(scu_base, SCU_PM_POWEROFF);
+       cpu_enter_lowpower();
+
+       while (1)
+               cpu_do_idle();
+}
+#endif
+
+static void zx_secondary_init(unsigned int cpu)
+{
+       scu_power_mode(scu_base, SCU_PM_NORMAL);
+}
+
+struct smp_operations zx_smp_ops __initdata = {
+       .smp_prepare_cpus       = zx_smp_prepare_cpus,
+       .smp_secondary_init     = zx_secondary_init,
+       .smp_boot_secondary     = zx_boot_secondary,
+#ifdef CONFIG_HOTPLUG_CPU
+       .cpu_kill               = zx_cpu_kill,
+       .cpu_die                = zx_cpu_die,
+#endif
+};
+
+CPU_METHOD_OF_DECLARE(zx_smp, "zte,zx296702-smp", &zx_smp_ops);
diff --git a/arch/arm/mach-zx/zx296702.c b/arch/arm/mach-zx/zx296702.c
new file mode 100644 (file)
index 0000000..60bb1a8
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2014 Linaro Ltd.
+ * Copyright (C) 2014 ZTE 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.
+ */
+
+#include <asm/mach/arch.h>
+#include <asm/mach/map.h>
+
+#include <linux/of_address.h>
+#include <linux/of_platform.h>
+
+static const char *zx296702_dt_compat[] __initconst = {
+       "zte,zx296702",
+       NULL,
+};
+
+DT_MACHINE_START(ZX, "ZTE ZX296702 (Device Tree)")
+       .dt_compat      = zx296702_dt_compat,
+       .l2c_aux_val    = 0,
+       .l2c_aux_mask   = ~0,
+MACHINE_END
index 58ef2a700414fcca15d58091223778746c1d1c8d..616d5840fc2e4aefe2af918a56aa48a85f3c931c 100644 (file)
@@ -190,11 +190,6 @@ static void __init zynq_irq_init(void)
        irqchip_init();
 }
 
-static void zynq_system_reset(enum reboot_mode mode, const char *cmd)
-{
-       zynq_slcr_system_reset();
-}
-
 static const char * const zynq_dt_match[] = {
        "xlnx,zynq-7000",
        NULL
@@ -212,5 +207,4 @@ DT_MACHINE_START(XILINX_EP107, "Xilinx Zynq Platform")
        .init_time      = zynq_timer_init,
        .dt_compat      = zynq_dt_match,
        .reserve        = zynq_memory_init,
-       .restart        = zynq_system_reset,
 MACHINE_END
index 382c60e9aa1606fa980fb6c88e1aadd286e8210f..79cda2e5fa4ec4e214c2cdf5a5cb6d79b12d719b 100644 (file)
 #ifndef __MACH_ZYNQ_COMMON_H__
 #define __MACH_ZYNQ_COMMON_H__
 
-void zynq_secondary_startup(void);
-
 extern int zynq_slcr_init(void);
 extern int zynq_early_slcr_init(void);
-extern void zynq_slcr_system_reset(void);
 extern void zynq_slcr_cpu_stop(int cpu);
 extern void zynq_slcr_cpu_start(int cpu);
 extern bool zynq_slcr_cpu_state_read(int cpu);
index dd8c071941e7ff3b9f991989ede3acc5aaac856b..045c72720a4d5e1c69dd22efd3fdbfdcfe811184 100644 (file)
@@ -22,8 +22,3 @@ zynq_secondary_trampoline_jump:
 .globl zynq_secondary_trampoline_end
 zynq_secondary_trampoline_end:
 ENDPROC(zynq_secondary_trampoline)
-
-ENTRY(zynq_secondary_startup)
-       bl      v7_invalidate_l1
-       b       secondary_startup
-ENDPROC(zynq_secondary_startup)
index 52d768ff785711a1d9d2fc384400e754ae8ddbef..f66816c4918695a6f2000d3813a870645429f7d9 100644 (file)
@@ -87,10 +87,9 @@ int zynq_cpun_start(u32 address, int cpu)
 }
 EXPORT_SYMBOL(zynq_cpun_start);
 
-static int zynq_boot_secondary(unsigned int cpu,
-                                               struct task_struct *idle)
+static int zynq_boot_secondary(unsigned int cpu, struct task_struct *idle)
 {
-       return zynq_cpun_start(virt_to_phys(zynq_secondary_startup), cpu);
+       return zynq_cpun_start(virt_to_phys(secondary_startup), cpu);
 }
 
 /*
index c3c24fd8b3062ce32921275bb0434a549b8749d1..26320ebf349349a06c8257aa7ce87e7c7d5c46c9 100644 (file)
@@ -15,6 +15,7 @@
  */
 
 #include <linux/io.h>
+#include <linux/reboot.h>
 #include <linux/mfd/syscon.h>
 #include <linux/of_address.h>
 #include <linux/regmap.h>
@@ -92,19 +93,20 @@ u32 zynq_slcr_get_device_id(void)
 }
 
 /**
- * zynq_slcr_system_reset - Reset the entire system.
+ * zynq_slcr_system_restart - Restart the entire system.
+ *
+ * @nb:                Pointer to restart notifier block (unused)
+ * @action:    Reboot mode (unused)
+ * @data:      Restart handler private data (unused)
+ *
+ * Return:     0 always
  */
-void zynq_slcr_system_reset(void)
+static
+int zynq_slcr_system_restart(struct notifier_block *nb,
+                            unsigned long action, void *data)
 {
        u32 reboot;
 
-       /*
-        * Unlock the SLCR then reset the system.
-        * Note that this seems to require raw i/o
-        * functions or there's a lockup?
-        */
-       zynq_slcr_unlock();
-
        /*
         * Clear 0x0F000000 bits of reboot status register to workaround
         * the FSBL not loading the bitstream after soft-reboot
@@ -113,8 +115,14 @@ void zynq_slcr_system_reset(void)
        zynq_slcr_read(&reboot, SLCR_REBOOT_STATUS_OFFSET);
        zynq_slcr_write(reboot & 0xF0FFFFFF, SLCR_REBOOT_STATUS_OFFSET);
        zynq_slcr_write(1, SLCR_PS_RST_CTRL_OFFSET);
+       return 0;
 }
 
+static struct notifier_block zynq_slcr_restart_nb = {
+       .notifier_call  = zynq_slcr_system_restart,
+       .priority       = 192,
+};
+
 /**
  * zynq_slcr_cpu_start - Start cpu
  * @cpu:       cpu number
@@ -219,6 +227,8 @@ int __init zynq_early_slcr_init(void)
        /* unlock the SLCR so that registers can be changed */
        zynq_slcr_unlock();
 
+       register_restart_handler(&zynq_slcr_restart_nb);
+
        pr_info("%s mapped to %p\n", np->name, zynq_slcr_base);
 
        of_node_put(np);
index 3d1054f11a8aea87be84819c83fe46f2a6303a58..75ae72160099a5b3b4f439f62b1f43f02e936073 100644 (file)
@@ -336,7 +336,7 @@ __v7_pj4b_setup:
 __v7_setup:
        adr     r12, __v7_setup_stack           @ the local stack
        stmia   r12, {r0-r5, r7, r9, r11, lr}
-       bl      v7_flush_dcache_louis
+       bl      v7_invalidate_l1
        ldmia   r12, {r0-r5, r7, r9, r11, lr}
 
        mrc     p15, 0, r0, c0, c0, 0           @ read main ID register
index 6416e03b448231444d192ca05f44b2d0d5656786..1e460b4ee3b9d591a560c8145226fe067f8b3da2 100644 (file)
 
 #include <linux/omap-dma.h>
 
+#ifdef CONFIG_ARCH_OMAP1
+#include <mach/soc.h>
+#endif
+
 /*
  * MAX_LOGICAL_DMA_CH_COUNT: the maximum number of logical DMA
  * channels that an instance of the SDMA IP block can support.  Used
index e2be70df06c6506459c732596e6bffe18ff3f296..efa6e85619ad824c2d9ea9a2bdb0b2c0eb9a3077 100644 (file)
@@ -389,7 +389,7 @@ static int s3c_adc_probe(struct platform_device *pdev)
        if (ret)
                return ret;
 
-       clk_enable(adc->clk);
+       clk_prepare_enable(adc->clk);
 
        tmp = adc->prescale | S3C2410_ADCCON_PRSCEN;
 
@@ -413,7 +413,7 @@ static int s3c_adc_remove(struct platform_device *pdev)
 {
        struct adc_device *adc = platform_get_drvdata(pdev);
 
-       clk_disable(adc->clk);
+       clk_disable_unprepare(adc->clk);
        regulator_disable(adc->vdd);
 
        return 0;
@@ -475,7 +475,7 @@ static int s3c_adc_resume(struct device *dev)
 #define s3c_adc_resume NULL
 #endif
 
-static struct platform_device_id s3c_adc_driver_ids[] = {
+static const struct platform_device_id s3c_adc_driver_ids[] = {
        {
                .name           = "s3c24xx-adc",
                .driver_data    = TYPE_ADCV1,
index f6e4d56eda007faeb26639fc54a2014b8fae1b58..2a61e4b04600896329bb0ca8f316cb3861ed2cf2 100644 (file)
@@ -445,6 +445,19 @@ static void vfp_enable(void *unused)
        set_copro_access(access | CPACC_FULL(10) | CPACC_FULL(11));
 }
 
+/* Called by platforms on which we want to disable VFP because it may not be
+ * present on all CPUs within a SMP complex. Needs to be called prior to
+ * vfp_init().
+ */
+void vfp_disable(void)
+{
+       if (VFP_arch) {
+               pr_debug("%s: should be called prior to vfp_init\n", __func__);
+               return;
+       }
+       VFP_arch = 1;
+}
+
 #ifdef CONFIG_CPU_PM
 static int vfp_pm_suspend(void)
 {
index 7796af4b1d6f65f6352ed40cd6dfcaf580cfd63d..cb8fa34e1a6c717f78174ba847e354fb92653246 100644 (file)
@@ -181,6 +181,11 @@ config ARCH_FSL_LS2085A
        help
          This enables support for Freescale LS2085A SOC.
 
+config ARCH_HISI
+       bool "Hisilicon SoC Family"
+       help
+         This enables support for Hisilicon ARMv8 SoC family
+
 config ARCH_MEDIATEK
        bool "Mediatek MT65xx & MT81xx ARMv8 SoC"
        select ARM_GIC
index ad26a752b976ad5e961255029e3638d7c173323c..38913be23695255db81b30d6b25c090d719ca924 100644 (file)
@@ -4,6 +4,7 @@ dts-dirs += arm
 dts-dirs += cavium
 dts-dirs += exynos
 dts-dirs += freescale
+dts-dirs += hisilicon
 dts-dirs += mediatek
 dts-dirs += qcom
 dts-dirs += sprd
index c8d3e0e866787bcbe7ac1d72b370d20927a15a5d..6bbab95307aee5222e579b6382771f89e99e9b60 100644 (file)
                        phy-names = "sata-phy";
                };
 
+               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>;
+               };
+
                rtc: rtc@10510000 {
                        compatible = "apm,xgene-rtc";
                        reg = <0x0 0x10510000 0x0 0x400>;
index 301a0dada1fe0342f888f2960d20e194f9b5fdbb..c5c98b91514e90186e6bbe432a1c0a7d880ed9e9 100644 (file)
@@ -1,5 +1,5 @@
 dtb-$(CONFIG_ARCH_VEXPRESS) += foundation-v8.dtb
-dtb-$(CONFIG_ARCH_VEXPRESS) += juno.dtb
+dtb-$(CONFIG_ARCH_VEXPRESS) += juno.dtb juno-r1.dtb
 dtb-$(CONFIG_ARCH_VEXPRESS) += rtsm_ve-aemv8a.dtb
 
 always         := $(dtb-y)
diff --git a/arch/arm64/boot/dts/arm/juno-base.dtsi b/arch/arm64/boot/dts/arm/juno-base.dtsi
new file mode 100644 (file)
index 0000000..e3ee960
--- /dev/null
@@ -0,0 +1,154 @@
+       /*
+        *  Devices shared by all Juno boards
+        */
+
+       memtimer: timer@2a810000 {
+               compatible = "arm,armv7-timer-mem";
+               reg = <0x0 0x2a810000 0x0 0x10000>;
+               clock-frequency = <50000000>;
+               #address-cells = <2>;
+               #size-cells = <2>;
+               ranges;
+               status = "disabled";
+               frame@2a830000 {
+                       frame-number = <1>;
+                       interrupts = <0 60 4>;
+                       reg = <0x0 0x2a830000 0x0 0x10000>;
+               };
+       };
+
+       gic: interrupt-controller@2c010000 {
+               compatible = "arm,gic-400", "arm,cortex-a15-gic";
+               reg = <0x0 0x2c010000 0 0x1000>,
+                     <0x0 0x2c02f000 0 0x2000>,
+                     <0x0 0x2c04f000 0 0x2000>,
+                     <0x0 0x2c06f000 0 0x2000>;
+               #address-cells = <2>;
+               #interrupt-cells = <3>;
+               #size-cells = <2>;
+               interrupt-controller;
+               interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(6) | IRQ_TYPE_LEVEL_HIGH)>;
+               ranges = <0 0 0 0x2c1c0000 0 0x40000>;
+               v2m_0: v2m@0 {
+                       compatible = "arm,gic-v2m-frame";
+                       msi-controller;
+                       reg = <0 0 0 0x1000>;
+               };
+       };
+
+       timer {
+               compatible = "arm,armv8-timer";
+               interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(6) | IRQ_TYPE_LEVEL_LOW)>,
+                            <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(6) | IRQ_TYPE_LEVEL_LOW)>,
+                            <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(6) | IRQ_TYPE_LEVEL_LOW)>,
+                            <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(6) | IRQ_TYPE_LEVEL_LOW)>;
+       };
+
+       /include/ "juno-clocks.dtsi"
+
+       dma@7ff00000 {
+               compatible = "arm,pl330", "arm,primecell";
+               reg = <0x0 0x7ff00000 0 0x1000>;
+               #dma-cells = <1>;
+               #dma-channels = <8>;
+               #dma-requests = <32>;
+               interrupts = <GIC_SPI 88 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 89 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 90 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 91 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 110 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 111 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&soc_faxiclk>;
+               clock-names = "apb_pclk";
+       };
+
+       soc_uart0: uart@7ff80000 {
+               compatible = "arm,pl011", "arm,primecell";
+               reg = <0x0 0x7ff80000 0x0 0x1000>;
+               interrupts = <GIC_SPI 83 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&soc_uartclk>, <&soc_refclk100mhz>;
+               clock-names = "uartclk", "apb_pclk";
+       };
+
+       i2c@7ffa0000 {
+               compatible = "snps,designware-i2c";
+               reg = <0x0 0x7ffa0000 0x0 0x1000>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+               interrupts = <GIC_SPI 104 IRQ_TYPE_LEVEL_HIGH>;
+               clock-frequency = <400000>;
+               i2c-sda-hold-time-ns = <500>;
+               clocks = <&soc_smc50mhz>;
+
+               dvi0: dvi-transmitter@70 {
+                       compatible = "nxp,tda998x";
+                       reg = <0x70>;
+               };
+
+               dvi1: dvi-transmitter@71 {
+                       compatible = "nxp,tda998x";
+                       reg = <0x71>;
+               };
+       };
+
+       ohci@7ffb0000 {
+               compatible = "generic-ohci";
+               reg = <0x0 0x7ffb0000 0x0 0x10000>;
+               interrupts = <GIC_SPI 116 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&soc_usb48mhz>;
+       };
+
+       ehci@7ffc0000 {
+               compatible = "generic-ehci";
+               reg = <0x0 0x7ffc0000 0x0 0x10000>;
+               interrupts = <GIC_SPI 117 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&soc_usb48mhz>;
+       };
+
+       memory-controller@7ffd0000 {
+               compatible = "arm,pl354", "arm,primecell";
+               reg = <0 0x7ffd0000 0 0x1000>;
+               interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 87 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&soc_smc50mhz>;
+               clock-names = "apb_pclk";
+       };
+
+       memory@80000000 {
+               device_type = "memory";
+               /* last 16MB of the first memory area is reserved for secure world use by firmware */
+               reg = <0x00000000 0x80000000 0x0 0x7f000000>,
+                     <0x00000008 0x80000000 0x1 0x80000000>;
+       };
+
+       smb {
+               compatible = "simple-bus";
+               #address-cells = <2>;
+               #size-cells = <1>;
+               ranges = <0 0 0 0x08000000 0x04000000>,
+                        <1 0 0 0x14000000 0x04000000>,
+                        <2 0 0 0x18000000 0x04000000>,
+                        <3 0 0 0x1c000000 0x04000000>,
+                        <4 0 0 0x0c000000 0x04000000>,
+                        <5 0 0 0x10000000 0x04000000>;
+
+               #interrupt-cells = <1>;
+               interrupt-map-mask = <0 0 15>;
+               interrupt-map = <0 0  0 &gic 0 0 0  68 IRQ_TYPE_LEVEL_HIGH>,
+                               <0 0  1 &gic 0 0 0  69 IRQ_TYPE_LEVEL_HIGH>,
+                               <0 0  2 &gic 0 0 0  70 IRQ_TYPE_LEVEL_HIGH>,
+                               <0 0  3 &gic 0 0 0 160 IRQ_TYPE_LEVEL_HIGH>,
+                               <0 0  4 &gic 0 0 0 161 IRQ_TYPE_LEVEL_HIGH>,
+                               <0 0  5 &gic 0 0 0 162 IRQ_TYPE_LEVEL_HIGH>,
+                               <0 0  6 &gic 0 0 0 163 IRQ_TYPE_LEVEL_HIGH>,
+                               <0 0  7 &gic 0 0 0 164 IRQ_TYPE_LEVEL_HIGH>,
+                               <0 0  8 &gic 0 0 0 165 IRQ_TYPE_LEVEL_HIGH>,
+                               <0 0  9 &gic 0 0 0 166 IRQ_TYPE_LEVEL_HIGH>,
+                               <0 0 10 &gic 0 0 0 167 IRQ_TYPE_LEVEL_HIGH>,
+                               <0 0 11 &gic 0 0 0 168 IRQ_TYPE_LEVEL_HIGH>,
+                               <0 0 12 &gic 0 0 0 169 IRQ_TYPE_LEVEL_HIGH>;
+
+               /include/ "juno-motherboard.dtsi"
+       };
index c9b89efe0f562a9dd7cd1a60126f42cb8948ff23..25352ed943e6e04a98689106b94994e8269a31fb 100644 (file)
@@ -36,9 +36,9 @@
                clock-output-names = "apb_pclk";
        };
 
-       soc_faxiclk: refclk533mhz {
+       soc_faxiclk: refclk400mhz {
                compatible = "fixed-clock";
                #clock-cells = <0>;
-               clock-frequency = <533000000>;
+               clock-frequency = <400000000>;
                clock-output-names = "faxi_clk";
        };
index 351c95bda89e5215a9ca525171509bfb4f831bee..021e0f40f4195d3f6283dab77a516a1bd663be47 100644 (file)
                                regulator-always-on;
                        };
 
+                       gpio_keys {
+                               compatible = "gpio-keys";
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               button@1 {
+                                       debounce_interval = <50>;
+                                       wakeup = <1>;
+                                       linux,code = <116>;
+                                       label = "POWER";
+                                       gpios = <&iofpga_gpio0 0 0x4>;
+                               };
+                               button@2 {
+                                       debounce_interval = <50>;
+                                       wakeup = <1>;
+                                       linux,code = <102>;
+                                       label = "HOME";
+                                       gpios = <&iofpga_gpio0 1 0x4>;
+                               };
+                               button@3 {
+                                       debounce_interval = <50>;
+                                       wakeup = <1>;
+                                       linux,code = <152>;
+                                       label = "RLOCK";
+                                       gpios = <&iofpga_gpio0 2 0x4>;
+                               };
+                               button@4 {
+                                       debounce_interval = <50>;
+                                       wakeup = <1>;
+                                       linux,code = <115>;
+                                       label = "VOL+";
+                                       gpios = <&iofpga_gpio0 3 0x4>;
+                               };
+                               button@5 {
+                                       debounce_interval = <50>;
+                                       wakeup = <1>;
+                                       linux,code = <114>;
+                                       label = "VOL-";
+                                       gpios = <&iofpga_gpio0 4 0x4>;
+                               };
+                               button@6 {
+                                       debounce_interval = <50>;
+                                       wakeup = <1>;
+                                       linux,code = <99>;
+                                       label = "NMI";
+                                       gpios = <&iofpga_gpio0 5 0x4>;
+                               };
+                       };
+
                        ethernet@2,00000000 {
                                compatible = "smsc,lan9118", "smsc,lan9115";
                                reg = <2 0x00000000 0x10000>;
                                        clock-output-names = "timerclken0", "timerclken1", "timerclken2", "timerclken3";
                                };
 
+                               apbregs@010000 {
+                                       compatible = "syscon", "simple-mfd";
+                                       reg = <0x010000 0x1000>;
+
+                                       led@08.0 {
+                                               compatible = "register-bit-led";
+                                               offset = <0x08>;
+                                               mask = <0x01>;
+                                               label = "vexpress:0";
+                                               linux,default-trigger = "heartbeat";
+                                               default-state = "on";
+                                       };
+                                       led@08.1 {
+                                               compatible = "register-bit-led";
+                                               offset = <0x08>;
+                                               mask = <0x02>;
+                                               label = "vexpress:1";
+                                               linux,default-trigger = "mmc0";
+                                               default-state = "off";
+                                       };
+                                       led@08.2 {
+                                               compatible = "register-bit-led";
+                                               offset = <0x08>;
+                                               mask = <0x04>;
+                                               label = "vexpress:2";
+                                               linux,default-trigger = "cpu0";
+                                               default-state = "off";
+                                       };
+                                       led@08.3 {
+                                               compatible = "register-bit-led";
+                                               offset = <0x08>;
+                                               mask = <0x08>;
+                                               label = "vexpress:3";
+                                               linux,default-trigger = "cpu1";
+                                               default-state = "off";
+                                       };
+                                       led@08.4 {
+                                               compatible = "register-bit-led";
+                                               offset = <0x08>;
+                                               mask = <0x10>;
+                                               label = "vexpress:4";
+                                               linux,default-trigger = "cpu2";
+                                               default-state = "off";
+                                       };
+                                       led@08.5 {
+                                               compatible = "register-bit-led";
+                                               offset = <0x08>;
+                                               mask = <0x20>;
+                                               label = "vexpress:5";
+                                               linux,default-trigger = "cpu3";
+                                               default-state = "off";
+                                       };
+                                       led@08.6 {
+                                               compatible = "register-bit-led";
+                                               offset = <0x08>;
+                                               mask = <0x40>;
+                                               label = "vexpress:6";
+                                               default-state = "off";
+                                       };
+                                       led@08.7 {
+                                               compatible = "register-bit-led";
+                                               offset = <0x08>;
+                                               mask = <0x80>;
+                                               label = "vexpress:7";
+                                               default-state = "off";
+                                       };
+                               };
+
                                mmci@050000 {
                                        compatible = "arm,pl180", "arm,primecell";
                                        reg = <0x050000 0x1000>;
                                        clocks = <&soc_smc50mhz>;
                                        clock-names = "apb_pclk";
                                };
+
+                               iofpga_gpio0: gpio@1d0000 {
+                                       compatible = "arm,pl061", "arm,primecell";
+                                       reg = <0x1d0000 0x1000>;
+                                       interrupts = <6>;
+                                       clocks = <&soc_smc50mhz>;
+                                       clock-names = "apb_pclk";
+                                       gpio-controller;
+                                       #gpio-cells = <2>;
+                                       interrupt-controller;
+                                       #interrupt-cells = <2>;
+                               };
                        };
                };
diff --git a/arch/arm64/boot/dts/arm/juno-r1.dts b/arch/arm64/boot/dts/arm/juno-r1.dts
new file mode 100644 (file)
index 0000000..c627511
--- /dev/null
@@ -0,0 +1,116 @@
+/*
+ * ARM Ltd. Juno Platform
+ *
+ * Copyright (c) 2015 ARM Ltd.
+ *
+ * This file is licensed under a dual GPLv2 or BSD license.
+ */
+
+/dts-v1/;
+
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+
+/ {
+       model = "ARM Juno development board (r1)";
+       compatible = "arm,juno-r1", "arm,juno", "arm,vexpress";
+       interrupt-parent = <&gic>;
+       #address-cells = <2>;
+       #size-cells = <2>;
+
+       aliases {
+               serial0 = &soc_uart0;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       psci {
+               compatible = "arm,psci-0.2";
+               method = "smc";
+       };
+
+       cpus {
+               #address-cells = <2>;
+               #size-cells = <0>;
+
+               A57_0: cpu@0 {
+                       compatible = "arm,cortex-a57","arm,armv8";
+                       reg = <0x0 0x0>;
+                       device_type = "cpu";
+                       enable-method = "psci";
+                       next-level-cache = <&A57_L2>;
+               };
+
+               A57_1: cpu@1 {
+                       compatible = "arm,cortex-a57","arm,armv8";
+                       reg = <0x0 0x1>;
+                       device_type = "cpu";
+                       enable-method = "psci";
+                       next-level-cache = <&A57_L2>;
+               };
+
+               A53_0: cpu@100 {
+                       compatible = "arm,cortex-a53","arm,armv8";
+                       reg = <0x0 0x100>;
+                       device_type = "cpu";
+                       enable-method = "psci";
+                       next-level-cache = <&A53_L2>;
+               };
+
+               A53_1: cpu@101 {
+                       compatible = "arm,cortex-a53","arm,armv8";
+                       reg = <0x0 0x101>;
+                       device_type = "cpu";
+                       enable-method = "psci";
+                       next-level-cache = <&A53_L2>;
+               };
+
+               A53_2: cpu@102 {
+                       compatible = "arm,cortex-a53","arm,armv8";
+                       reg = <0x0 0x102>;
+                       device_type = "cpu";
+                       enable-method = "psci";
+                       next-level-cache = <&A53_L2>;
+               };
+
+               A53_3: cpu@103 {
+                       compatible = "arm,cortex-a53","arm,armv8";
+                       reg = <0x0 0x103>;
+                       device_type = "cpu";
+                       enable-method = "psci";
+                       next-level-cache = <&A53_L2>;
+               };
+
+               A57_L2: l2-cache0 {
+                       compatible = "cache";
+               };
+
+               A53_L2: l2-cache1 {
+                       compatible = "cache";
+               };
+       };
+
+       pmu {
+               compatible = "arm,armv8-pmuv3";
+               interrupts = <GIC_SPI 02 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 06 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 18 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 22 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 30 IRQ_TYPE_LEVEL_HIGH>;
+               interrupt-affinity = <&A57_0>,
+                                    <&A57_1>,
+                                    <&A53_0>,
+                                    <&A53_1>,
+                                    <&A53_2>,
+                                    <&A53_3>;
+       };
+
+       #include "juno-base.dtsi"
+
+};
+
+&memtimer {
+       status = "okay";
+};
index 5e9110a3353da48e24b3be0d77f15ceb0d3cdd6e..d7cbdd482a61d231cbbfcff772dcf48e51e92bb2 100644 (file)
                };
        };
 
-       memory@80000000 {
-               device_type = "memory";
-               /* last 16MB of the first memory area is reserved for secure world use by firmware */
-               reg = <0x00000000 0x80000000 0x0 0x7f000000>,
-                     <0x00000008 0x80000000 0x1 0x80000000>;
-       };
-
-       gic: interrupt-controller@2c001000 {
-               compatible = "arm,gic-400", "arm,cortex-a15-gic";
-               reg = <0x0 0x2c010000 0 0x1000>,
-                     <0x0 0x2c02f000 0 0x2000>,
-                     <0x0 0x2c04f000 0 0x2000>,
-                     <0x0 0x2c06f000 0 0x2000>;
-               #address-cells = <0>;
-               #interrupt-cells = <3>;
-               interrupt-controller;
-               interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(6) | IRQ_TYPE_LEVEL_HIGH)>;
-       };
-
-       timer {
-               compatible = "arm,armv8-timer";
-               interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(6) | IRQ_TYPE_LEVEL_LOW)>,
-                            <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(6) | IRQ_TYPE_LEVEL_LOW)>,
-                            <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(6) | IRQ_TYPE_LEVEL_LOW)>,
-                            <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(6) | IRQ_TYPE_LEVEL_LOW)>;
-       };
-
        pmu {
                compatible = "arm,armv8-pmuv3";
                interrupts = <GIC_SPI 02 IRQ_TYPE_LEVEL_HIGH>,
                                     <&A53_3>;
        };
 
-       /include/ "juno-clocks.dtsi"
-
-       dma@7ff00000 {
-               compatible = "arm,pl330", "arm,primecell";
-               reg = <0x0 0x7ff00000 0 0x1000>;
-               #dma-cells = <1>;
-               #dma-channels = <8>;
-               #dma-requests = <32>;
-               interrupts = <GIC_SPI 88 IRQ_TYPE_LEVEL_HIGH>,
-                            <GIC_SPI 89 IRQ_TYPE_LEVEL_HIGH>,
-                            <GIC_SPI 90 IRQ_TYPE_LEVEL_HIGH>,
-                            <GIC_SPI 91 IRQ_TYPE_LEVEL_HIGH>,
-                            <GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>,
-                            <GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH>,
-                            <GIC_SPI 110 IRQ_TYPE_LEVEL_HIGH>,
-                            <GIC_SPI 111 IRQ_TYPE_LEVEL_HIGH>;
-               clocks = <&soc_faxiclk>;
-               clock-names = "apb_pclk";
-       };
-
-       soc_uart0: uart@7ff80000 {
-               compatible = "arm,pl011", "arm,primecell";
-               reg = <0x0 0x7ff80000 0x0 0x1000>;
-               interrupts = <GIC_SPI 83 IRQ_TYPE_LEVEL_HIGH>;
-               clocks = <&soc_uartclk>, <&soc_refclk100mhz>;
-               clock-names = "uartclk", "apb_pclk";
-       };
-
-       i2c@7ffa0000 {
-               compatible = "snps,designware-i2c";
-               reg = <0x0 0x7ffa0000 0x0 0x1000>;
-               #address-cells = <1>;
-               #size-cells = <0>;
-               interrupts = <GIC_SPI 104 IRQ_TYPE_LEVEL_HIGH>;
-               clock-frequency = <400000>;
-               i2c-sda-hold-time-ns = <500>;
-               clocks = <&soc_smc50mhz>;
-
-               dvi0: dvi-transmitter@70 {
-                       compatible = "nxp,tda998x";
-                       reg = <0x70>;
-               };
-
-               dvi1: dvi-transmitter@71 {
-                       compatible = "nxp,tda998x";
-                       reg = <0x71>;
-               };
-       };
-
-       ohci@7ffb0000 {
-               compatible = "generic-ohci";
-               reg = <0x0 0x7ffb0000 0x0 0x10000>;
-               interrupts = <GIC_SPI 116 IRQ_TYPE_LEVEL_HIGH>;
-               clocks = <&soc_usb48mhz>;
-       };
-
-       ehci@7ffc0000 {
-               compatible = "generic-ehci";
-               reg = <0x0 0x7ffc0000 0x0 0x10000>;
-               interrupts = <GIC_SPI 117 IRQ_TYPE_LEVEL_HIGH>;
-               clocks = <&soc_usb48mhz>;
-       };
-
-       memory-controller@7ffd0000 {
-               compatible = "arm,pl354", "arm,primecell";
-               reg = <0 0x7ffd0000 0 0x1000>;
-               interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>,
-                            <GIC_SPI 87 IRQ_TYPE_LEVEL_HIGH>;
-               clocks = <&soc_smc50mhz>;
-               clock-names = "apb_pclk";
-       };
-
-       smb {
-               compatible = "simple-bus";
-               #address-cells = <2>;
-               #size-cells = <1>;
-               ranges = <0 0 0 0x08000000 0x04000000>,
-                        <1 0 0 0x14000000 0x04000000>,
-                        <2 0 0 0x18000000 0x04000000>,
-                        <3 0 0 0x1c000000 0x04000000>,
-                        <4 0 0 0x0c000000 0x04000000>,
-                        <5 0 0 0x10000000 0x04000000>;
-
-               #interrupt-cells = <1>;
-               interrupt-map-mask = <0 0 15>;
-               interrupt-map = <0 0  0 &gic 0  68 IRQ_TYPE_LEVEL_HIGH>,
-                               <0 0  1 &gic 0  69 IRQ_TYPE_LEVEL_HIGH>,
-                               <0 0  2 &gic 0  70 IRQ_TYPE_LEVEL_HIGH>,
-                               <0 0  3 &gic 0 160 IRQ_TYPE_LEVEL_HIGH>,
-                               <0 0  4 &gic 0 161 IRQ_TYPE_LEVEL_HIGH>,
-                               <0 0  5 &gic 0 162 IRQ_TYPE_LEVEL_HIGH>,
-                               <0 0  6 &gic 0 163 IRQ_TYPE_LEVEL_HIGH>,
-                               <0 0  7 &gic 0 164 IRQ_TYPE_LEVEL_HIGH>,
-                               <0 0  8 &gic 0 165 IRQ_TYPE_LEVEL_HIGH>,
-                               <0 0  9 &gic 0 166 IRQ_TYPE_LEVEL_HIGH>,
-                               <0 0 10 &gic 0 167 IRQ_TYPE_LEVEL_HIGH>,
-                               <0 0 11 &gic 0 168 IRQ_TYPE_LEVEL_HIGH>,
-                               <0 0 12 &gic 0 169 IRQ_TYPE_LEVEL_HIGH>;
-
-               /include/ "juno-motherboard.dtsi"
-       };
+       #include "juno-base.dtsi"
 };
diff --git a/arch/arm64/boot/dts/hisilicon/Makefile b/arch/arm64/boot/dts/hisilicon/Makefile
new file mode 100644 (file)
index 0000000..fa81a6e
--- /dev/null
@@ -0,0 +1,5 @@
+dtb-$(CONFIG_ARCH_HISI) += hi6220-hikey.dtb
+
+always         := $(dtb-y)
+subdir-y       := $(dts-dirs)
+clean-files    := *.dtb
diff --git a/arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts b/arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts
new file mode 100644 (file)
index 0000000..e36a539
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * dts file for Hisilicon HiKey Development Board
+ *
+ * Copyright (C) 2015, Hisilicon Ltd.
+ *
+ */
+
+/dts-v1/;
+
+/*Reserved 1MB memory for MCU*/
+/memreserve/ 0x05e00000 0x00100000;
+
+#include "hi6220.dtsi"
+
+/ {
+       model = "HiKey Development Board";
+       compatible = "hisilicon,hi6220-hikey", "hisilicon,hi6220";
+
+       aliases {
+               serial0 = &uart0;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       memory@0 {
+               device_type = "memory";
+               reg = <0x0 0x0 0x0 0x40000000>;
+       };
+};
diff --git a/arch/arm64/boot/dts/hisilicon/hi6220.dtsi b/arch/arm64/boot/dts/hisilicon/hi6220.dtsi
new file mode 100644 (file)
index 0000000..3f03380
--- /dev/null
@@ -0,0 +1,171 @@
+/*
+ * dts file for Hisilicon Hi6220 SoC
+ *
+ * Copyright (C) 2015, Hisilicon Ltd.
+ */
+
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+
+/ {
+       compatible = "hisilicon,hi6220";
+       interrupt-parent = <&gic>;
+       #address-cells = <2>;
+       #size-cells = <2>;
+
+       psci {
+               compatible = "arm,psci-0.2";
+               method = "smc";
+       };
+
+       cpus {
+               #address-cells = <2>;
+               #size-cells = <0>;
+
+               cpu-map {
+                       cluster0 {
+                               core0 {
+                                       cpu = <&cpu0>;
+                               };
+                               core1 {
+                                       cpu = <&cpu1>;
+                               };
+                               core2 {
+                                       cpu = <&cpu2>;
+                               };
+                               core3 {
+                                       cpu = <&cpu3>;
+                               };
+                       };
+                       cluster1 {
+                               core0 {
+                                       cpu = <&cpu4>;
+                               };
+                               core1 {
+                                       cpu = <&cpu5>;
+                               };
+                               core2 {
+                                       cpu = <&cpu6>;
+                               };
+                               core3 {
+                                       cpu = <&cpu7>;
+                               };
+                       };
+               };
+
+               cpu0: cpu@0 {
+                       compatible = "arm,cortex-a53", "arm,armv8";
+                       device_type = "cpu";
+                       reg = <0x0 0x0>;
+                       enable-method = "psci";
+               };
+
+               cpu1: cpu@1 {
+                       compatible = "arm,cortex-a53", "arm,armv8";
+                       device_type = "cpu";
+                       reg = <0x0 0x1>;
+                       enable-method = "psci";
+               };
+
+               cpu2: cpu@2 {
+                       compatible = "arm,cortex-a53", "arm,armv8";
+                       device_type = "cpu";
+                       reg = <0x0 0x2>;
+                       enable-method = "psci";
+               };
+
+               cpu3: cpu@3 {
+                       compatible = "arm,cortex-a53", "arm,armv8";
+                       device_type = "cpu";
+                       reg = <0x0 0x3>;
+                       enable-method = "psci";
+               };
+
+               cpu4: cpu@100 {
+                       compatible = "arm,cortex-a53", "arm,armv8";
+                       device_type = "cpu";
+                       reg = <0x0 0x100>;
+                       enable-method = "psci";
+               };
+
+               cpu5: cpu@101 {
+                       compatible = "arm,cortex-a53", "arm,armv8";
+                       device_type = "cpu";
+                       reg = <0x0 0x101>;
+                       enable-method = "psci";
+               };
+
+               cpu6: cpu@102 {
+                       compatible = "arm,cortex-a53", "arm,armv8";
+                       device_type = "cpu";
+                       reg = <0x0 0x102>;
+                       enable-method = "psci";
+               };
+
+               cpu7: cpu@103 {
+                       compatible = "arm,cortex-a53", "arm,armv8";
+                       device_type = "cpu";
+                       reg = <0x0 0x103>;
+                       enable-method = "psci";
+               };
+       };
+
+       gic: interrupt-controller@f6801000 {
+               compatible = "arm,gic-400";
+               reg = <0x0 0xf6801000 0 0x1000>, /* GICD */
+                     <0x0 0xf6802000 0 0x2000>, /* GICC */
+                     <0x0 0xf6804000 0 0x2000>, /* GICH */
+                     <0x0 0xf6806000 0 0x2000>; /* GICV */
+               #address-cells = <0>;
+               #interrupt-cells = <3>;
+               interrupt-controller;
+               interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_HIGH)>;
+       };
+
+       timer {
+               compatible = "arm,armv8-timer";
+               interrupt-parent = <&gic>;
+               interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>,
+                            <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>,
+                            <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>,
+                            <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>;
+       };
+
+       soc {
+               compatible = "simple-bus";
+               #address-cells = <2>;
+               #size-cells = <2>;
+               ranges;
+
+               ao_ctrl: ao_ctrl@f7800000 {
+                       compatible = "hisilicon,hi6220-aoctrl", "syscon";
+                       reg = <0x0 0xf7800000 0x0 0x2000>;
+                       #clock-cells = <1>;
+               };
+
+               sys_ctrl: sys_ctrl@f7030000 {
+                       compatible = "hisilicon,hi6220-sysctrl", "syscon";
+                       reg = <0x0 0xf7030000 0x0 0x2000>;
+                       #clock-cells = <1>;
+               };
+
+               media_ctrl: media_ctrl@f4410000 {
+                       compatible = "hisilicon,hi6220-mediactrl", "syscon";
+                       reg = <0x0 0xf4410000 0x0 0x1000>;
+                       #clock-cells = <1>;
+               };
+
+               pm_ctrl: pm_ctrl@f7032000 {
+                       compatible = "hisilicon,hi6220-pmctrl", "syscon";
+                       reg = <0x0 0xf7032000 0x0 0x1000>;
+                       #clock-cells = <1>;
+               };
+
+               uart0: uart@f8015000 {  /* console */
+                       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>;
+                       clock-names = "uartclk", "apb_pclk";
+               };
+       };
+};
index 43d54017b779d4e211462b8bebe2604025bb08ea..d0ab012fa379eb97c6e43ebad83ee18185d2b598 100644 (file)
@@ -16,7 +16,8 @@
 #include "mt8173.dtsi"
 
 / {
-       model = "mediatek,mt8173-evb";
+       model = "MediaTek MT8173 evaluation board";
+       compatible = "mediatek,mt8173-evb", "mediatek,mt8173";
 
        aliases {
                serial0 = &uart0;
index 924fdb6673ff62a46616b59143f6785f4a3540aa..27237a1c1a87030b41825777e9ce0750892870b3 100644 (file)
                compatible = "arm,armv8-timer";
                interrupt-parent = <&gic>;
                interrupts = <GIC_PPI 13
-                       (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
+                             (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
                             <GIC_PPI 14
-                       (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
+                             (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
                             <GIC_PPI 11
-                       (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
+                             (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
                             <GIC_PPI 10
-                       (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>;
+                             (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>;
        };
 
        soc {
                compatible = "simple-bus";
                ranges;
 
-               syscfg_pctl_a: syscfg_pctl_a@10005000 {
-                       compatible = "mediatek,mt8173-pctl-a-syscfg", "syscon";
-                       reg = <0 0x10005000 0 0x1000>;
-               };
-
-               pio: pinctrl@0x10005000 {
+               /*
+                * Pinctrl access register at 0x10005000 through regmap.
+                * Register 0x1000b000 is used by EINT.
+                */
+               pio: pinctrl@10005000 {
                        compatible = "mediatek,mt8173-pinctrl";
-                       reg = <0 0x1000B000 0 0x1000>;
+                       reg = <0 0x1000b000 0 0x1000>;
                        mediatek,pctl-regmap = <&syscfg_pctl_a>;
                        pins-are-numbered;
                        gpio-controller;
                        interrupt-controller;
                        #interrupt-cells = <2>;
                        interrupts = <GIC_SPI 145 IRQ_TYPE_LEVEL_HIGH>,
-                                               <GIC_SPI 146 IRQ_TYPE_LEVEL_HIGH>,
-                                               <GIC_SPI 147 IRQ_TYPE_LEVEL_HIGH>;
+                                    <GIC_SPI 146 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 147 IRQ_TYPE_LEVEL_HIGH>;
+               };
+
+               syscfg_pctl_a: syscfg_pctl_a@10005000 {
+                       compatible = "mediatek,mt8173-pctl-a-syscfg", "syscon";
+                       reg = <0 0x10005000 0 0x1000>;
                };
 
                sysirq: intpol-controller@10200620 {
                        compatible = "mediatek,mt8173-sysirq",
-                                       "mediatek,mt6577-sysirq";
+                                    "mediatek,mt6577-sysirq";
                        interrupt-controller;
                        #interrupt-cells = <3>;
                        interrupt-parent = <&gic>;
 
                uart0: serial@11002000 {
                        compatible = "mediatek,mt8173-uart",
-                                       "mediatek,mt6577-uart";
+                                    "mediatek,mt6577-uart";
                        reg = <0 0x11002000 0 0x400>;
                        interrupts = <GIC_SPI 83 IRQ_TYPE_LEVEL_LOW>;
                        clocks = <&uart_clk>;
 
                uart1: serial@11003000 {
                        compatible = "mediatek,mt8173-uart",
-                                       "mediatek,mt6577-uart";
+                                    "mediatek,mt6577-uart";
                        reg = <0 0x11003000 0 0x400>;
                        interrupts = <GIC_SPI 84 IRQ_TYPE_LEVEL_LOW>;
                        clocks = <&uart_clk>;
 
                uart2: serial@11004000 {
                        compatible = "mediatek,mt8173-uart",
-                                       "mediatek,mt6577-uart";
+                                    "mediatek,mt6577-uart";
                        reg = <0 0x11004000 0 0x400>;
                        interrupts = <GIC_SPI 85 IRQ_TYPE_LEVEL_LOW>;
                        clocks = <&uart_clk>;
 
                uart3: serial@11005000 {
                        compatible = "mediatek,mt8173-uart",
-                                       "mediatek,mt6577-uart";
+                                    "mediatek,mt6577-uart";
                        reg = <0 0x11005000 0 0x400>;
                        interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_LOW>;
                        clocks = <&uart_clk>;
                        status = "disabled";
                };
        };
-
 };
 
diff --git a/arch/arm64/boot/dts/qcom/apq8016-sbc-pmic-pins.dtsi b/arch/arm64/boot/dts/qcom/apq8016-sbc-pmic-pins.dtsi
new file mode 100644 (file)
index 0000000..535532b
--- /dev/null
@@ -0,0 +1,30 @@
+#include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
+
+&pm8916_gpios {
+
+       pinctrl-names = "default";
+       pinctrl-0 = <&pm8916_gpios_default>;
+
+       pm8916_gpios_default: default {
+               usb_hub_reset_pm {
+                       pins = "gpio1";
+                       function = PMIC_GPIO_FUNC_NORMAL;
+                       output-low;
+               };
+               usb_sw_sel_pm {
+                       pins = "gpio2";
+                       function = PMIC_GPIO_FUNC_NORMAL;
+                       input-disable;
+               };
+               usr_led_3_ctrl {
+                       pins = "gpio3";
+                       function = PMIC_GPIO_FUNC_NORMAL;
+                       output-low;
+               };
+               usr_led_4_ctrl {
+                       pins = "gpio4";
+                       function = PMIC_GPIO_FUNC_NORMAL;
+                       output-low;
+               };
+       };
+};
diff --git a/arch/arm64/boot/dts/qcom/apq8016-sbc-soc-pins.dtsi b/arch/arm64/boot/dts/qcom/apq8016-sbc-soc-pins.dtsi
new file mode 100644 (file)
index 0000000..5f7023f
--- /dev/null
@@ -0,0 +1,21 @@
+
+#include <dt-bindings/gpio/gpio.h>
+
+&msmgpio {
+
+       pinctrl-names = "default";
+       pinctrl-0 = <&soc_gpios_default>;
+
+       soc_gpios_default: default {
+               usr_led_1_ctrl_default: usr_led_1_ctrl_default {
+                       pins = "gpio21";
+                       function = "gpio";
+                       output-low;
+               };
+               usr_led_2_ctrl_default: usr_led_2_ctrl_default {
+                       pins = "gpio120";
+                       function = "gpio";
+                       output-low;
+               };
+       };
+};
index 703a4f16e711ab7da3e206c6e2be92497533118a..98abece6b23309179c55e42bf81507bd88526ed5 100644 (file)
@@ -12,6 +12,9 @@
  */
 
 #include "msm8916.dtsi"
+#include "pm8916.dtsi"
+#include "apq8016-sbc-soc-pins.dtsi"
+#include "apq8016-sbc-pmic-pins.dtsi"
 
 / {
        aliases {
index bea871b0df1367e6e58af81d6cbfbd42687993d1..a1aa0b201e926a493c624a69c5695946bafb3ff0 100644 (file)
@@ -12,6 +12,7 @@
  */
 
 #include "msm8916.dtsi"
+#include "pm8916.dtsi"
 
 / {
        aliases {
index f212b8303d04ffaac3c2d53bdd7ce9239e963548..0f49ebd0aa8b24a1cfc0ed77ae30f08c3f548c19 100644 (file)
                ranges = <0 0 0 0xffffffff>;
                compatible = "simple-bus";
 
-               pinctrl@1000000 {
+               restart@4ab000 {
+                       compatible = "qcom,pshold";
+                       reg = <0x4ab000 0x4>;
+               };
+
+               msmgpio: pinctrl@1000000 {
                        compatible = "qcom,msm8916-pinctrl";
                        reg = <0x1000000 0x300000>;
                        interrupts = <GIC_SPI 208 IRQ_TYPE_LEVEL_HIGH>;
                                status = "disabled";
                        };
                };
+
+               spmi_bus: spmi@200f000 {
+                       compatible = "qcom,spmi-pmic-arb";
+                       reg = <0x200f000 0x001000>,
+                             <0x2400000 0x400000>,
+                             <0x2c00000 0x400000>,
+                             <0x3800000 0x200000>,
+                             <0x200a000 0x002100>;
+                       reg-names = "core", "chnls", "obsrvr", "intr", "cnfg";
+                       interrupt-names = "periph_irq";
+                       interrupts = <GIC_SPI 190 IRQ_TYPE_NONE>;
+                       qcom,ee = <0>;
+                       qcom,channel = <0>;
+                       #address-cells = <2>;
+                       #size-cells = <0>;
+                       interrupt-controller;
+                       #interrupt-cells = <4>;
+               };
        };
 };
diff --git a/arch/arm64/boot/dts/qcom/pm8916.dtsi b/arch/arm64/boot/dts/qcom/pm8916.dtsi
new file mode 100644 (file)
index 0000000..b222ece
--- /dev/null
@@ -0,0 +1,99 @@
+#include <dt-bindings/iio/qcom,spmi-vadc.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+#include <dt-bindings/spmi/spmi.h>
+
+&spmi_bus {
+
+       usid0: pm8916@0 {
+               compatible = "qcom,spmi-pmic";
+               reg = <0x0 SPMI_USID>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               rtc@6000 {
+                       compatible = "qcom,pm8941-rtc";
+                       reg = <0x6000 0x6100>;
+                       reg-names = "rtc", "alarm";
+                       interrupts = <0x0 0x61 0x1 IRQ_TYPE_EDGE_RISING>;
+               };
+
+               pwrkey@800 {
+                       compatible = "qcom,pm8941-pwrkey";
+                       reg = <0x800>;
+                       interrupts = <0x0 0x8 0 IRQ_TYPE_EDGE_BOTH>;
+                       debounce = <15625>;
+                       bias-pull-up;
+               };
+
+               pm8916_gpios: gpios@c000 {
+                       compatible = "qcom,pm8916-gpio";
+                       reg = <0xc000 0x400>;
+                       gpio-controller;
+                       #gpio-cells = <2>;
+                       interrupts = <0 0xc0 0 IRQ_TYPE_NONE>,
+                                    <0 0xc1 0 IRQ_TYPE_NONE>,
+                                    <0 0xc2 0 IRQ_TYPE_NONE>,
+                                    <0 0xc3 0 IRQ_TYPE_NONE>;
+               };
+
+               pm8916_mpps: mpps@a000 {
+                       compatible = "qcom,pm8916-mpp";
+                       reg = <0xa000 0x400>;
+                       gpio-controller;
+                       #gpio-cells = <2>;
+                       interrupts = <0 0xa0 0 IRQ_TYPE_NONE>,
+                                    <0 0xa1 0 IRQ_TYPE_NONE>,
+                                    <0 0xa2 0 IRQ_TYPE_NONE>,
+                                    <0 0xa3 0 IRQ_TYPE_NONE>;
+               };
+
+               pm8916_temp: temp-alarm@2400 {
+                       compatible = "qcom,spmi-temp-alarm";
+                       reg = <0x2400 0x100>;
+                       interrupts = <0 0x24 0 IRQ_TYPE_EDGE_RISING>;
+                       io-channels = <&pm8916_vadc VADC_DIE_TEMP>;
+                       io-channel-names = "thermal";
+                       #thermal-sensor-cells = <0>;
+               };
+
+               pm8916_vadc: vadc@3100 {
+                       compatible = "qcom,spmi-vadc";
+                       reg = <0x3100 0x100>;
+                       interrupts = <0x0 0x31 0x0 IRQ_TYPE_EDGE_RISING>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       #io-channel-cells = <1>;
+
+                       usb_in {
+                               reg = <VADC_USBIN>;
+                               qcom,pre-scaling = <1 10>;
+                       };
+                       vph_pwr {
+                               reg = <VADC_VSYS>;
+                               qcom,pre-scaling = <1 3>;
+                       };
+                       die_temp {
+                               reg = <VADC_DIE_TEMP>;
+                       };
+                       ref_625mv {
+                               reg = <VADC_REF_625MV>;
+                       };
+                       ref_1250v {
+                               reg = <VADC_REF_1250MV>;
+                       };
+                       ref_gnd {
+                               reg = <VADC_GND_REF>;
+                       };
+                       ref_vdd {
+                               reg = <VADC_VDD_VADC>;
+                       };
+               };
+       };
+
+       usid1: pm8916@1 {
+               compatible = "qcom,spmi-pmic";
+               reg = <0x1 SPMI_USID>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+       };
+};
diff --git a/arch/arm64/boot/dts/skeleton.dtsi b/arch/arm64/boot/dts/skeleton.dtsi
deleted file mode 100644 (file)
index 38ead82..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-/*
- * Skeleton device tree; the bare minimum needed to boot; just include and
- * add a compatible value.  The bootloader will typically populate the memory
- * node.
- */
-
-/ {
-       #address-cells = <2>;
-       #size-cells = <1>;
-       chosen { };
-       aliases { };
-       memory { device_type = "memory"; reg = <0 0 0>; };
-};
index 2ed7449d9273c01b314d59c7a81b12472b4f7948..aa6d99f7f178f72f602ed72e9b984ebbc139d9dd 100644 (file)
@@ -33,6 +33,7 @@ CONFIG_MODULE_UNLOAD=y
 # CONFIG_IOSCHED_DEADLINE is not set
 CONFIG_ARCH_EXYNOS7=y
 CONFIG_ARCH_FSL_LS2085A=y
+CONFIG_ARCH_HISI=y
 CONFIG_ARCH_MEDIATEK=y
 CONFIG_ARCH_SEATTLE=y
 CONFIG_ARCH_TEGRA=y
@@ -94,6 +95,7 @@ CONFIG_SMC91X=y
 CONFIG_SMSC911X=y
 # CONFIG_WLAN is not set
 CONFIG_INPUT_EVDEV=y
+CONFIG_KEYBOARD_GPIO=y
 # CONFIG_SERIO_SERPORT is not set
 CONFIG_SERIO_AMBAKMI=y
 CONFIG_LEGACY_PTY_COUNT=16
@@ -138,6 +140,12 @@ CONFIG_MMC_ARMMMCI=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_PLTFM=y
 CONFIG_MMC_SPI=y
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
+CONFIG_LEDS_SYSCON=y
+CONFIG_LEDS_TRIGGERS=y
+CONFIG_LEDS_TRIGGER_HEARTBEAT=y
+CONFIG_LEDS_TRIGGER_CPU=y
 CONFIG_RTC_CLASS=y
 CONFIG_RTC_DRV_EFI=y
 CONFIG_RTC_DRV_XGENE=y
index 4e8ad0523118d631ea24f6b9f8fd1c3ffb123194..6abebe82d4e93ed0329f271cd54e2af5c1bc38d2 100644 (file)
@@ -10,6 +10,7 @@
 #include <linux/compiler.h>
 #include <linux/types.h>
 #include <asm/byteorder.h>
+#include <asm/def_LPBlackfin.h>
 
 #define __raw_readb bfin_read8
 #define __raw_readw bfin_read16
index 558e94977942033dc8247bcc510ebb705aa9698a..68f0c5871adcdf51f40380ffbba09b1e5e52202c 100644 (file)
@@ -2,7 +2,6 @@
 # Makefile for the Cobalt micro systems family specific parts of the kernel
 #
 
-obj-y := buttons.o irq.o lcd.o led.o reset.o rtc.o serial.o setup.o time.o
+obj-y := buttons.o irq.o lcd.o led.o mtd.o reset.o rtc.o serial.o setup.o time.o
 
 obj-$(CONFIG_PCI)              += pci.o
-obj-$(CONFIG_MTD_PHYSMAP)      += mtd.o
index 18ae5ddef118c071e1240486e90f08be3e4b0871..c28a8499aec7f4fa18c5bd4c71922812d2ebf143 100644 (file)
 #define _PAGE_PRESENT_SHIFT    0
 #define _PAGE_PRESENT          (1 << _PAGE_PRESENT_SHIFT)
 /* R2 or later cores check for RI/XI support to determine _PAGE_READ */
-#ifdef CONFIG_CPU_MIPSR2
+#if defined(CONFIG_CPU_MIPSR2) || defined(CONFIG_CPU_MIPSR6)
 #define _PAGE_WRITE_SHIFT      (_PAGE_PRESENT_SHIFT + 1)
 #define _PAGE_WRITE            (1 << _PAGE_WRITE_SHIFT)
 #else
 #define _PAGE_SPLITTING                (1 << _PAGE_SPLITTING_SHIFT)
 
 /* Only R2 or newer cores have the XI bit */
-#ifdef CONFIG_CPU_MIPSR2
+#if defined(CONFIG_CPU_MIPSR2) || defined(CONFIG_CPU_MIPSR6)
 #define _PAGE_NO_EXEC_SHIFT    (_PAGE_SPLITTING_SHIFT + 1)
 #else
 #define _PAGE_GLOBAL_SHIFT     (_PAGE_SPLITTING_SHIFT + 1)
 #define _PAGE_GLOBAL           (1 << _PAGE_GLOBAL_SHIFT)
-#endif /* CONFIG_CPU_MIPSR2 */
+#endif /* CONFIG_CPU_MIPSR2 || CONFIG_CPU_MIPSR6 */
 
 #endif /* CONFIG_64BIT && CONFIG_MIPS_HUGE_TLB_SUPPORT */
 
-#ifdef CONFIG_CPU_MIPSR2
+#if defined(CONFIG_CPU_MIPSR2) || defined(CONFIG_CPU_MIPSR6)
 /* XI - page cannot be executed */
 #ifndef _PAGE_NO_EXEC_SHIFT
 #define _PAGE_NO_EXEC_SHIFT    (_PAGE_MODIFIED_SHIFT + 1)
 #define _PAGE_GLOBAL_SHIFT     (_PAGE_NO_READ_SHIFT + 1)
 #define _PAGE_GLOBAL           (1 << _PAGE_GLOBAL_SHIFT)
 
-#else  /* !CONFIG_CPU_MIPSR2 */
+#else  /* !CONFIG_CPU_MIPSR2 && !CONFIG_CPU_MIPSR6 */
 #define _PAGE_GLOBAL_SHIFT     (_PAGE_MODIFIED_SHIFT + 1)
 #define _PAGE_GLOBAL           (1 << _PAGE_GLOBAL_SHIFT)
-#endif /* CONFIG_CPU_MIPSR2 */
+#endif /* CONFIG_CPU_MIPSR2 || CONFIG_CPU_MIPSR6 */
 
 #define _PAGE_VALID_SHIFT      (_PAGE_GLOBAL_SHIFT + 1)
 #define _PAGE_VALID            (1 << _PAGE_VALID_SHIFT)
  */
 static inline uint64_t pte_to_entrylo(unsigned long pte_val)
 {
-#ifdef CONFIG_CPU_MIPSR2
+#if defined(CONFIG_CPU_MIPSR2) || defined(CONFIG_CPU_MIPSR6)
        if (cpu_has_rixi) {
                int sa;
 #ifdef CONFIG_32BIT
index e92d6c4b5ed192305b0b1f1605481f745cfadb10..7163cd7fdd69a622892e4be83acbe0450e8f2af0 100644 (file)
@@ -104,7 +104,6 @@ do {                                                                        \
        if (test_and_clear_tsk_thread_flag(prev, TIF_USEDMSA))          \
                __fpsave = FP_SAVE_VECTOR;                              \
        (last) = resume(prev, next, task_thread_info(next), __fpsave);  \
-       disable_msa();                                                  \
 } while (0)
 
 #define finish_arch_switch(prev)                                       \
@@ -122,6 +121,7 @@ do {                                                                        \
        if (cpu_has_userlocal)                                          \
                write_c0_userlocal(current_thread_info()->tp_value);    \
        __restore_watch();                                              \
+       disable_msa();                                                  \
 } while (0)
 
 #endif /* _ASM_SWITCH_TO_H */
index e70c33fdb88153ac6bfdf12a4f632d3b3a26ccb9..f2e8153e44f536213e196002f005bb86da9ef72f 100644 (file)
@@ -3,15 +3,13 @@
 #
 
 obj-y += setup.o init.o cmdline.o env.o time.o reset.o irq.o \
-    bonito-irq.o mem.o machtype.o platform.o
+    bonito-irq.o mem.o machtype.o platform.o serial.o
 obj-$(CONFIG_PCI) += pci.o
 
 #
 # Serial port support
 #
 obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
-loongson-serial-$(CONFIG_SERIAL_8250) := serial.o
-obj-y += $(loongson-serial-m) $(loongson-serial-y)
 obj-$(CONFIG_LOONGSON_UART_BASE) += uart_base.o
 obj-$(CONFIG_LOONGSON_MC146818) += rtc.o
 
index ba8593a515baaa274d968aa64e6f54125238c032..de156ba3bd71c0d4db274a619c7c9fd6038c119c 100644 (file)
@@ -48,7 +48,9 @@ extern u8 sk_load_word[], sk_load_half[], sk_load_byte[];
  * We get 160 bytes stack space from calling function, but only use
  * 11 * 8 byte (old backchain + r15 - r6) for storing registers.
  */
-#define STK_OFF (MAX_BPF_STACK + 8 + 4 + 4 + (160 - 11 * 8))
+#define STK_SPACE      (MAX_BPF_STACK + 8 + 4 + 4 + 160)
+#define STK_160_UNUSED (160 - 11 * 8)
+#define STK_OFF                (STK_SPACE - STK_160_UNUSED)
 #define STK_OFF_TMP    160     /* Offset of tmp buffer on stack */
 #define STK_OFF_HLEN   168     /* Offset of SKB header length on stack */
 
index 20c146d1251ae2cd6c07279bf371adae6b2e3a1e..55423d8be580113d045d30edbf86d26fb74340ff 100644 (file)
@@ -384,13 +384,16 @@ static void bpf_jit_prologue(struct bpf_jit *jit)
        }
        /* Setup stack and backchain */
        if (jit->seen & SEEN_STACK) {
-               /* lgr %bfp,%r15 (BPF frame pointer) */
-               EMIT4(0xb9040000, BPF_REG_FP, REG_15);
+               if (jit->seen & SEEN_FUNC)
+                       /* lgr %w1,%r15 (backchain) */
+                       EMIT4(0xb9040000, REG_W1, REG_15);
+               /* la %bfp,STK_160_UNUSED(%r15) (BPF frame pointer) */
+               EMIT4_DISP(0x41000000, BPF_REG_FP, REG_15, STK_160_UNUSED);
                /* aghi %r15,-STK_OFF */
                EMIT4_IMM(0xa70b0000, REG_15, -STK_OFF);
                if (jit->seen & SEEN_FUNC)
-                       /* stg %bfp,152(%r15) (backchain) */
-                       EMIT6_DISP_LH(0xe3000000, 0x0024, BPF_REG_FP, REG_0,
+                       /* stg %w1,152(%r15) (backchain) */
+                       EMIT6_DISP_LH(0xe3000000, 0x0024, REG_W1, REG_0,
                                      REG_15, 152);
        }
        /*
index 00b7d3a2fc60681253eb2e1c1b874e48bbd02a4a..16efa3ad037f7cffbdbb4a5ffcf57a5d25325648 100644 (file)
@@ -175,10 +175,10 @@ ENTRY(__clear_user)
        br      r3
 
        .section .fixup, "ax"
+99:
        br      r3
        .previous
        .section __ex_table, "a"
        .align  2
-99:
        .word   0b, 99b
        .previous
index dd319e59246baf4949a937b8376d17b041e87d13..90b7c501c95ba021a7017efa71463cef26111c66 100644 (file)
@@ -839,6 +839,7 @@ static int uncore_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id
        box->phys_id = phys_id;
        box->pci_dev = pdev;
        box->pmu = pmu;
+       uncore_box_init(box);
        pci_set_drvdata(pdev, box);
 
        raw_spin_lock(&uncore_box_lock);
@@ -1002,8 +1003,10 @@ static int uncore_cpu_starting(int cpu)
                        pmu = &type->pmus[j];
                        box = *per_cpu_ptr(pmu->box, cpu);
                        /* called by uncore_cpu_init? */
-                       if (box && box->phys_id >= 0)
+                       if (box && box->phys_id >= 0) {
+                               uncore_box_init(box);
                                continue;
+                       }
 
                        for_each_online_cpu(k) {
                                exist = *per_cpu_ptr(pmu->box, k);
@@ -1019,8 +1022,10 @@ static int uncore_cpu_starting(int cpu)
                                }
                        }
 
-                       if (box)
+                       if (box) {
                                box->phys_id = phys_id;
+                               uncore_box_init(box);
+                       }
                }
        }
        return 0;
index f789ec9a0133f57f177e1ffc4134aba8d3a4a1f6..ceac8f5dc0184b531548e302e11ae981e753a7e9 100644 (file)
@@ -258,14 +258,6 @@ static inline int uncore_num_counters(struct intel_uncore_box *box)
        return box->pmu->type->num_counters;
 }
 
-static inline void uncore_box_init(struct intel_uncore_box *box)
-{
-       if (!test_and_set_bit(UNCORE_BOX_FLAG_INITIATED, &box->flags)) {
-               if (box->pmu->type->ops->init_box)
-                       box->pmu->type->ops->init_box(box);
-       }
-}
-
 static inline void uncore_disable_box(struct intel_uncore_box *box)
 {
        if (box->pmu->type->ops->disable_box)
@@ -274,8 +266,6 @@ static inline void uncore_disable_box(struct intel_uncore_box *box)
 
 static inline void uncore_enable_box(struct intel_uncore_box *box)
 {
-       uncore_box_init(box);
-
        if (box->pmu->type->ops->enable_box)
                box->pmu->type->ops->enable_box(box);
 }
@@ -298,6 +288,14 @@ static inline u64 uncore_read_counter(struct intel_uncore_box *box,
        return box->pmu->type->ops->read_counter(box, event);
 }
 
+static inline void uncore_box_init(struct intel_uncore_box *box)
+{
+       if (!test_and_set_bit(UNCORE_BOX_FLAG_INITIATED, &box->flags)) {
+               if (box->pmu->type->ops->init_box)
+                       box->pmu->type->ops->init_box(box);
+       }
+}
+
 static inline bool uncore_box_is_fake(struct intel_uncore_box *box)
 {
        return (box->phys_id < 0);
index 12d9548457e7195a8a36b458e374cab9cabe5e07..6d6e85dd5849878e9caa379ef20eaab10b97559f 100644 (file)
                                ((1ULL << (n)) - 1)))
 
 /* Haswell-EP Ubox */
-#define HSWEP_U_MSR_PMON_CTR0                  0x705
-#define HSWEP_U_MSR_PMON_CTL0                  0x709
+#define HSWEP_U_MSR_PMON_CTR0                  0x709
+#define HSWEP_U_MSR_PMON_CTL0                  0x705
 #define HSWEP_U_MSR_PMON_FILTER                        0x707
 
 #define HSWEP_U_MSR_PMON_UCLK_FIXED_CTL                0x703
@@ -1914,7 +1914,7 @@ static struct intel_uncore_type hswep_uncore_cbox = {
        .name                   = "cbox",
        .num_counters           = 4,
        .num_boxes              = 18,
-       .perf_ctr_bits          = 44,
+       .perf_ctr_bits          = 48,
        .event_ctl              = HSWEP_C0_MSR_PMON_CTL0,
        .perf_ctr               = HSWEP_C0_MSR_PMON_CTR0,
        .event_mask             = SNBEP_CBO_MSR_PMON_RAW_EVENT_MASK,
index 629af0f1c5c4d0953010adc88233132bcdff4cb7..4c7deb4f78a147b1a4a8b451120d3b80fa6401dc 100644 (file)
@@ -1090,6 +1090,17 @@ static void update_divide_count(struct kvm_lapic *apic)
                                   apic->divide_count);
 }
 
+static void apic_update_lvtt(struct kvm_lapic *apic)
+{
+       u32 timer_mode = kvm_apic_get_reg(apic, APIC_LVTT) &
+                       apic->lapic_timer.timer_mode_mask;
+
+       if (apic->lapic_timer.timer_mode != timer_mode) {
+               apic->lapic_timer.timer_mode = timer_mode;
+               hrtimer_cancel(&apic->lapic_timer.timer);
+       }
+}
+
 static void apic_timer_expired(struct kvm_lapic *apic)
 {
        struct kvm_vcpu *vcpu = apic->vcpu;
@@ -1298,6 +1309,7 @@ static int apic_reg_write(struct kvm_lapic *apic, u32 reg, u32 val)
                                apic_set_reg(apic, APIC_LVTT + 0x10 * i,
                                             lvt_val | APIC_LVT_MASKED);
                        }
+                       apic_update_lvtt(apic);
                        atomic_set(&apic->lapic_timer.pending, 0);
 
                }
@@ -1330,20 +1342,13 @@ static int apic_reg_write(struct kvm_lapic *apic, u32 reg, u32 val)
 
                break;
 
-       case APIC_LVTT: {
-               u32 timer_mode = val & apic->lapic_timer.timer_mode_mask;
-
-               if (apic->lapic_timer.timer_mode != timer_mode) {
-                       apic->lapic_timer.timer_mode = timer_mode;
-                       hrtimer_cancel(&apic->lapic_timer.timer);
-               }
-
+       case APIC_LVTT:
                if (!kvm_apic_sw_enabled(apic))
                        val |= APIC_LVT_MASKED;
                val &= (apic_lvt_mask[0] | apic->lapic_timer.timer_mode_mask);
                apic_set_reg(apic, APIC_LVTT, val);
+               apic_update_lvtt(apic);
                break;
-       }
 
        case APIC_TMICT:
                if (apic_lvtt_tscdeadline(apic))
@@ -1576,7 +1581,7 @@ void kvm_lapic_reset(struct kvm_vcpu *vcpu)
 
        for (i = 0; i < APIC_LVT_NUM; i++)
                apic_set_reg(apic, APIC_LVTT + 0x10 * i, APIC_LVT_MASKED);
-       apic->lapic_timer.timer_mode = 0;
+       apic_update_lvtt(apic);
        apic_set_reg(apic, APIC_LVT0,
                     SET_APIC_DELIVERY_MODE(0, APIC_MODE_EXTINT));
 
@@ -1802,6 +1807,7 @@ void kvm_apic_post_state_restore(struct kvm_vcpu *vcpu,
 
        apic_update_ppr(apic);
        hrtimer_cancel(&apic->lapic_timer.timer);
+       apic_update_lvtt(apic);
        update_divide_count(apic);
        start_apic_timer(apic);
        apic->irr_pending = true;
index 44a7d25154973437e0ce4233e142d01c43a948b9..b73337634214c209e250051cd21e00bd2436fcd6 100644 (file)
@@ -4215,13 +4215,13 @@ void kvm_mmu_pte_write(struct kvm_vcpu *vcpu, gpa_t gpa,
        u64 entry, gentry, *spte;
        int npte;
        bool remote_flush, local_flush, zap_page;
-       union kvm_mmu_page_role mask = (union kvm_mmu_page_role) {
-               .cr0_wp = 1,
-               .cr4_pae = 1,
-               .nxe = 1,
-               .smep_andnot_wp = 1,
-               .smap_andnot_wp = 1,
-       };
+       union kvm_mmu_page_role mask = { };
+
+       mask.cr0_wp = 1;
+       mask.cr4_pae = 1;
+       mask.nxe = 1;
+       mask.smep_andnot_wp = 1;
+       mask.smap_andnot_wp = 1;
 
        /*
         * If we don't have indirect shadow pages, it means no page is
index e68b71b85a7eaf0e3097debe8bf4dc4078e7a038..594eea04266e6d05f7256255552a1c4c72c664f3 100644 (file)
@@ -1600,6 +1600,7 @@ static int blk_mq_hctx_notify(void *data, unsigned long action,
        return NOTIFY_OK;
 }
 
+/* hctx->ctxs will be freed in queue's release handler */
 static void blk_mq_exit_hctx(struct request_queue *q,
                struct blk_mq_tag_set *set,
                struct blk_mq_hw_ctx *hctx, unsigned int hctx_idx)
@@ -1618,7 +1619,6 @@ static void blk_mq_exit_hctx(struct request_queue *q,
 
        blk_mq_unregister_cpu_notifier(&hctx->cpu_notifier);
        blk_free_flush_queue(hctx->fq);
-       kfree(hctx->ctxs);
        blk_mq_free_bitmap(&hctx->ctx_map);
 }
 
@@ -1891,8 +1891,12 @@ void blk_mq_release(struct request_queue *q)
        unsigned int i;
 
        /* hctx kobj stays in hctx */
-       queue_for_each_hw_ctx(q, hctx, i)
+       queue_for_each_hw_ctx(q, hctx, i) {
+               if (!hctx)
+                       continue;
+               kfree(hctx->ctxs);
                kfree(hctx);
+       }
 
        kfree(q->queue_hw_ctx);
 
index 666e11b8398378d145552b18e51c190c18847a9f..ea982eadaf6380b974d6b1d39a7197085217ac91 100644 (file)
@@ -422,9 +422,9 @@ int blk_alloc_devt(struct hd_struct *part, dev_t *devt)
        /* allocate ext devt */
        idr_preload(GFP_KERNEL);
 
-       spin_lock(&ext_devt_lock);
+       spin_lock_bh(&ext_devt_lock);
        idx = idr_alloc(&ext_devt_idr, part, 0, NR_EXT_DEVT, GFP_NOWAIT);
-       spin_unlock(&ext_devt_lock);
+       spin_unlock_bh(&ext_devt_lock);
 
        idr_preload_end();
        if (idx < 0)
@@ -449,9 +449,9 @@ void blk_free_devt(dev_t devt)
                return;
 
        if (MAJOR(devt) == BLOCK_EXT_MAJOR) {
-               spin_lock(&ext_devt_lock);
+               spin_lock_bh(&ext_devt_lock);
                idr_remove(&ext_devt_idr, blk_mangle_minor(MINOR(devt)));
-               spin_unlock(&ext_devt_lock);
+               spin_unlock_bh(&ext_devt_lock);
        }
 }
 
@@ -690,13 +690,13 @@ struct gendisk *get_gendisk(dev_t devt, int *partno)
        } else {
                struct hd_struct *part;
 
-               spin_lock(&ext_devt_lock);
+               spin_lock_bh(&ext_devt_lock);
                part = idr_find(&ext_devt_idr, blk_mangle_minor(MINOR(devt)));
                if (part && get_disk(part_to_disk(part))) {
                        *partno = part->partno;
                        disk = part_to_disk(part);
                }
-               spin_unlock(&ext_devt_lock);
+               spin_unlock_bh(&ext_devt_lock);
        }
 
        return disk;
index 9dca4b995be0792b6c4f1920b9786cb6517a2b5f..f7bf7d9249e725e0740c9d1264d970a2bee84e28 100644 (file)
@@ -827,7 +827,6 @@ config PATA_AT32
 config PATA_AT91
        tristate "PATA support for AT91SAM9260"
        depends on ARM && SOC_AT91SAM9
-       depends on !ARCH_MULTIPLATFORM
        help
          This option enables support for IDE devices on the Atmel AT91SAM9260 SoC.
 
index 23716dd8a7ec3f569f82db531e1ed71bc330c7d6..5928d0746a270e7b6b2ee12a022b19ed731f03fe 100644 (file)
@@ -45,7 +45,7 @@ static void ahci_mvebu_mbus_config(struct ahci_host_priv *hpriv,
                writel((cs->mbus_attr << 8) |
                       (dram->mbus_dram_target_id << 4) | 1,
                       hpriv->mmio + AHCI_WINDOW_CTRL(i));
-               writel(cs->base, hpriv->mmio + AHCI_WINDOW_BASE(i));
+               writel(cs->base >> 16, hpriv->mmio + AHCI_WINDOW_BASE(i));
                writel(((cs->size - 1) & 0xffff0000),
                       hpriv->mmio + AHCI_WINDOW_SIZE(i));
        }
index 9e85937d36a91421de5ffe5e8671690ba26c1f57..ace0a4de3449ab14ed0b514fd108537709f86aa4 100644 (file)
 #include <linux/ata.h>
 #include <linux/clk.h>
 #include <linux/libata.h>
+#include <linux/mfd/syscon.h>
+#include <linux/mfd/syscon/atmel-smc.h>
 #include <linux/platform_device.h>
 #include <linux/ata_platform.h>
 #include <linux/platform_data/atmel.h>
+#include <linux/regmap.h>
 
-#include <mach/at91sam9_smc.h>
 #include <asm/gpio.h>
 
 #define DRV_NAME               "pata_at91"
@@ -57,6 +59,15 @@ struct smc_range {
        int max;
 };
 
+struct regmap *smc;
+
+struct at91sam9_smc_generic_fields {
+       struct regmap_field *setup;
+       struct regmap_field *pulse;
+       struct regmap_field *cycle;
+       struct regmap_field *mode;
+} fields;
+
 /**
  * adjust_smc_value - adjust value for one of SMC registers.
  * @value: adjusted value
@@ -206,7 +217,6 @@ static void set_smc_timing(struct device *dev, struct ata_device *adev,
 {
        int ret = 0;
        int use_iordy;
-       struct sam9_smc_config smc;
        unsigned int t6z;         /* data tristate time in ns */
        unsigned int cycle;       /* SMC Cycle width in MCK ticks */
        unsigned int setup;       /* SMC Setup width in MCK ticks */
@@ -244,19 +254,21 @@ static void set_smc_timing(struct device *dev, struct ata_device *adev,
 
        dev_dbg(dev, "Use IORDY=%u, TDF Cycles=%u\n", use_iordy, tdf_cycles);
 
-       /* SMC Setup Register */
-       smc.nwe_setup = smc.nrd_setup = setup;
-       smc.ncs_write_setup = smc.ncs_read_setup = 0;
-       /* SMC Pulse Register */
-       smc.nwe_pulse = smc.nrd_pulse = pulse;
-       smc.ncs_write_pulse = smc.ncs_read_pulse = cs_pulse;
-       /* SMC Cycle Register */
-       smc.write_cycle = smc.read_cycle = cycle;
-       /* SMC Mode Register*/
-       smc.tdf_cycles = tdf_cycles;
-       smc.mode = info->mode;
-
-       sam9_smc_configure(0, info->cs, &smc);
+       regmap_fields_write(fields.setup, info->cs,
+                           AT91SAM9_SMC_NRDSETUP(setup) |
+                           AT91SAM9_SMC_NWESETUP(setup) |
+                           AT91SAM9_SMC_NCS_NRDSETUP(0) |
+                           AT91SAM9_SMC_NCS_WRSETUP(0));
+       regmap_fields_write(fields.pulse, info->cs,
+                           AT91SAM9_SMC_NRDPULSE(pulse) |
+                           AT91SAM9_SMC_NWEPULSE(pulse) |
+                           AT91SAM9_SMC_NCS_NRDPULSE(cs_pulse) |
+                           AT91SAM9_SMC_NCS_WRPULSE(cs_pulse));
+       regmap_fields_write(fields.cycle, info->cs,
+                           AT91SAM9_SMC_NRDCYCLE(cycle) |
+                           AT91SAM9_SMC_NWECYCLE(cycle));
+       regmap_fields_write(fields.mode, info->cs, info->mode |
+                           AT91_SMC_TDF_(tdf_cycles));
 }
 
 static void pata_at91_set_piomode(struct ata_port *ap, struct ata_device *adev)
@@ -280,21 +292,21 @@ static unsigned int pata_at91_data_xfer_noirq(struct ata_device *dev,
 {
        struct at91_ide_info *info = dev->link->ap->host->private_data;
        unsigned int consumed;
+       unsigned int mode;
        unsigned long flags;
-       struct sam9_smc_config smc;
 
        local_irq_save(flags);
-       sam9_smc_read_mode(0, info->cs, &smc);
+       regmap_fields_read(fields.mode, info->cs, &mode);
 
        /* set 16bit mode before writing data */
-       smc.mode = (smc.mode & ~AT91_SMC_DBW) | AT91_SMC_DBW_16;
-       sam9_smc_write_mode(0, info->cs, &smc);
+       regmap_fields_write(fields.mode, info->cs, (mode & ~AT91_SMC_DBW) |
+                           AT91_SMC_DBW_16);
 
        consumed = ata_sff_data_xfer(dev, buf, buflen, rw);
 
        /* restore 8bit mode after data is written */
-       smc.mode = (smc.mode & ~AT91_SMC_DBW) | AT91_SMC_DBW_8;
-       sam9_smc_write_mode(0, info->cs, &smc);
+       regmap_fields_write(fields.mode, info->cs, (mode & ~AT91_SMC_DBW) |
+                           AT91_SMC_DBW_8);
 
        local_irq_restore(flags);
        return consumed;
@@ -312,6 +324,36 @@ static struct ata_port_operations pata_at91_port_ops = {
        .cable_detect   = ata_cable_40wire,
 };
 
+static int at91sam9_smc_fields_init(struct device *dev)
+{
+       struct reg_field field = REG_FIELD(0, 0, 31);
+
+       field.id_size = 8;
+       field.id_offset = AT91SAM9_SMC_GENERIC_BLK_SZ;
+
+       field.reg = AT91SAM9_SMC_SETUP(AT91SAM9_SMC_GENERIC);
+       fields.setup = devm_regmap_field_alloc(dev, smc, field);
+       if (IS_ERR(fields.setup))
+               return PTR_ERR(fields.setup);
+
+       field.reg = AT91SAM9_SMC_PULSE(AT91SAM9_SMC_GENERIC);
+       fields.pulse = devm_regmap_field_alloc(dev, smc, field);
+       if (IS_ERR(fields.pulse))
+               return PTR_ERR(fields.pulse);
+
+       field.reg = AT91SAM9_SMC_CYCLE(AT91SAM9_SMC_GENERIC);
+       fields.cycle = devm_regmap_field_alloc(dev, smc, field);
+       if (IS_ERR(fields.cycle))
+               return PTR_ERR(fields.cycle);
+
+       field.reg = AT91SAM9_SMC_MODE(AT91SAM9_SMC_GENERIC);
+       fields.mode = devm_regmap_field_alloc(dev, smc, field);
+       if (IS_ERR(fields.mode))
+               return PTR_ERR(fields.mode);
+
+       return 0;
+}
+
 static int pata_at91_probe(struct platform_device *pdev)
 {
        struct at91_cf_data *board = dev_get_platdata(&pdev->dev);
@@ -341,6 +383,14 @@ static int pata_at91_probe(struct platform_device *pdev)
 
        irq = board->irq_pin;
 
+       smc = syscon_regmap_lookup_by_phandle(pdev->dev.of_node, "atmel,smc");
+       if (IS_ERR(smc))
+               return PTR_ERR(smc);
+
+       ret = at91sam9_smc_fields_init(dev);
+       if (ret < 0)
+               return ret;
+
        /* init ata host */
 
        host = ata_host_alloc(dev, 1);
index 80a80548ad0a80acf28c3407e6a6048825f92af3..27245957eee3cd906f546d67853d2ebd6ce54d30 100644 (file)
@@ -1053,7 +1053,7 @@ static struct of_device_id octeon_cf_match[] = {
        },
        {},
 };
-MODULE_DEVICE_TABLE(of, octeon_i2c_match);
+MODULE_DEVICE_TABLE(of, octeon_cf_match);
 
 static struct platform_driver octeon_cf_driver = {
        .probe          = octeon_cf_probe,
index eb1fed5bd516ffac33c850eed47fad402250c686..3ccef9eba6f9dc53cecb785c23582cbdeb3b8618 100644 (file)
@@ -406,6 +406,7 @@ config BLK_DEV_RAM_DAX
 
 config BLK_DEV_PMEM
        tristate "Persistent memory block device support"
+       depends on HAS_IOMEM
        help
          Saying Y here will allow you to use a contiguous range of reserved
          memory as one or more persistent block devices.
index 8dcbced0eafd5f8dc0a53dc8d8e9d4b37bad9bab..6e134f4759c0c9e98b93f221e7687004d4418342 100644 (file)
@@ -805,7 +805,9 @@ static void zram_reset_device(struct zram *zram)
        memset(&zram->stats, 0, sizeof(zram->stats));
        zram->disksize = 0;
        zram->max_comp_streams = 1;
+
        set_capacity(zram->disk, 0);
+       part_stat_set_all(&zram->disk->part0, 0);
 
        up_write(&zram->init_lock);
        /* I/O operation under all of CPU are done so let's free */
index a1d4af6df3f57a5e7de71bbdaa79bb5f271d0fef..1a82f3a17681b77926a11c29ba23cbdc27d8b6b5 100644 (file)
@@ -7,21 +7,24 @@ menu "Bus devices"
 config ARM_CCI
        bool
 
+config ARM_CCI_PMU
+       bool
+       select ARM_CCI
+
 config ARM_CCI400_COMMON
        bool
        select ARM_CCI
 
 config ARM_CCI400_PMU
        bool "ARM CCI400 PMU support"
-       default y
-       depends on ARM || ARM64
-       depends on HW_PERF_EVENTS
+       depends on (ARM && CPU_V7) || ARM64
+       depends on PERF_EVENTS
        select ARM_CCI400_COMMON
+       select ARM_CCI_PMU
        help
-         Support for PMU events monitoring on the ARM CCI cache coherent
-         interconnect.
-
-         If unsure, say Y
+         Support for PMU events monitoring on the ARM CCI-400 (cache coherent
+         interconnect). CCI-400 supports counting events related to the
+         connected slave/master interfaces.
 
 config ARM_CCI400_PORT_CTRL
        bool
@@ -31,6 +34,20 @@ config ARM_CCI400_PORT_CTRL
          Low level power management driver for CCI400 cache coherent
          interconnect for ARM platforms.
 
+config ARM_CCI500_PMU
+       bool "ARM CCI500 PMU support"
+       default y
+       depends on (ARM && CPU_V7) || ARM64
+       depends on PERF_EVENTS
+       select ARM_CCI_PMU
+       help
+         Support for PMU events monitoring on the ARM CCI-500 cache coherent
+         interconnect. CCI-500 provides 8 independent event counters, which
+         can count events pertaining to the slave/master interfaces as well
+         as the internal events to the CCI.
+
+         If unsure, say Y
+
 config ARM_CCN
        bool "ARM CCN driver support"
        depends on ARM || ARM64
index 5340604b23a4e1b24b0c01bf3798dbc35fcda40a..577cc4bf6a9d17987a2f6bf8e62935dc5aa71f01 100644 (file)
@@ -51,13 +51,16 @@ static const struct cci_nb_ports cci400_ports = {
 static const struct of_device_id arm_cci_matches[] = {
 #ifdef CONFIG_ARM_CCI400_COMMON
        {.compatible = "arm,cci-400", .data = CCI400_PORTS_DATA },
+#endif
+#ifdef CONFIG_ARM_CCI500_PMU
+       { .compatible = "arm,cci-500", },
 #endif
        {},
 };
 
-#ifdef CONFIG_ARM_CCI400_PMU
+#ifdef CONFIG_ARM_CCI_PMU
 
-#define DRIVER_NAME            "CCI-400"
+#define DRIVER_NAME            "ARM-CCI"
 #define DRIVER_NAME_PMU                DRIVER_NAME " PMU"
 
 #define CCI_PMCR               0x0100
@@ -77,20 +80,21 @@ static const struct of_device_id arm_cci_matches[] = {
 
 #define CCI_PMU_OVRFLW_FLAG    1
 
-#define CCI_PMU_CNTR_BASE(idx) ((idx) * SZ_4K)
-
-#define CCI_PMU_CNTR_MASK      ((1ULL << 32) -1)
+#define CCI_PMU_CNTR_SIZE(model)       ((model)->cntr_size)
+#define CCI_PMU_CNTR_BASE(model, idx)  ((idx) * CCI_PMU_CNTR_SIZE(model))
+#define CCI_PMU_CNTR_MASK              ((1ULL << 32) -1)
+#define CCI_PMU_CNTR_LAST(cci_pmu)     (cci_pmu->num_cntrs - 1)
 
-#define CCI_PMU_EVENT_MASK             0xffUL
-#define CCI_PMU_EVENT_SOURCE(event)    ((event >> 5) & 0x7)
-#define CCI_PMU_EVENT_CODE(event)      (event & 0x1f)
-
-#define CCI_PMU_MAX_HW_EVENTS 5   /* CCI PMU has 4 counters + 1 cycle counter */
+#define CCI_PMU_MAX_HW_CNTRS(model) \
+       ((model)->num_hw_cntrs + (model)->fixed_hw_cntrs)
 
 /* Types of interfaces that can generate events */
 enum {
        CCI_IF_SLAVE,
        CCI_IF_MASTER,
+#ifdef CONFIG_ARM_CCI500_PMU
+       CCI_IF_GLOBAL,
+#endif
        CCI_IF_MAX,
 };
 
@@ -100,14 +104,30 @@ struct event_range {
 };
 
 struct cci_pmu_hw_events {
-       struct perf_event *events[CCI_PMU_MAX_HW_EVENTS];
-       unsigned long used_mask[BITS_TO_LONGS(CCI_PMU_MAX_HW_EVENTS)];
+       struct perf_event **events;
+       unsigned long *used_mask;
        raw_spinlock_t pmu_lock;
 };
 
+struct cci_pmu;
+/*
+ * struct cci_pmu_model:
+ * @fixed_hw_cntrs - Number of fixed event counters
+ * @num_hw_cntrs - Maximum number of programmable event counters
+ * @cntr_size - Size of an event counter mapping
+ */
 struct cci_pmu_model {
        char *name;
+       u32 fixed_hw_cntrs;
+       u32 num_hw_cntrs;
+       u32 cntr_size;
+       u64 nformat_attrs;
+       u64 nevent_attrs;
+       struct dev_ext_attribute *format_attrs;
+       struct dev_ext_attribute *event_attrs;
        struct event_range event_ranges[CCI_IF_MAX];
+       int (*validate_hw_event)(struct cci_pmu *, unsigned long);
+       int (*get_event_idx)(struct cci_pmu *, struct cci_pmu_hw_events *, unsigned long);
 };
 
 static struct cci_pmu_model cci_pmu_models[];
@@ -116,33 +136,59 @@ struct cci_pmu {
        void __iomem *base;
        struct pmu pmu;
        int nr_irqs;
-       int irqs[CCI_PMU_MAX_HW_EVENTS];
+       int *irqs;
        unsigned long active_irqs;
        const struct cci_pmu_model *model;
        struct cci_pmu_hw_events hw_events;
        struct platform_device *plat_device;
-       int num_events;
+       int num_cntrs;
        atomic_t active_events;
        struct mutex reserve_mutex;
+       struct notifier_block cpu_nb;
        cpumask_t cpus;
 };
-static struct cci_pmu *pmu;
 
 #define to_cci_pmu(c)  (container_of(c, struct cci_pmu, pmu))
 
+enum cci_models {
+#ifdef CONFIG_ARM_CCI400_PMU
+       CCI400_R0,
+       CCI400_R1,
+#endif
+#ifdef CONFIG_ARM_CCI500_PMU
+       CCI500_R0,
+#endif
+       CCI_MODEL_MAX
+};
+
+static ssize_t cci_pmu_format_show(struct device *dev,
+                       struct device_attribute *attr, char *buf);
+static ssize_t cci_pmu_event_show(struct device *dev,
+                       struct device_attribute *attr, char *buf);
+
+#define CCI_EXT_ATTR_ENTRY(_name, _func, _config) \
+       { __ATTR(_name, S_IRUGO, _func, NULL), (void *)_config }
+
+#define CCI_FORMAT_EXT_ATTR_ENTRY(_name, _config) \
+       CCI_EXT_ATTR_ENTRY(_name, cci_pmu_format_show, (char *)_config)
+#define CCI_EVENT_EXT_ATTR_ENTRY(_name, _config) \
+       CCI_EXT_ATTR_ENTRY(_name, cci_pmu_event_show, (unsigned long)_config)
+
+/* CCI400 PMU Specific definitions */
+
+#ifdef CONFIG_ARM_CCI400_PMU
+
 /* Port ids */
-#define CCI_PORT_S0    0
-#define CCI_PORT_S1    1
-#define CCI_PORT_S2    2
-#define CCI_PORT_S3    3
-#define CCI_PORT_S4    4
-#define CCI_PORT_M0    5
-#define CCI_PORT_M1    6
-#define CCI_PORT_M2    7
-
-#define CCI_REV_R0             0
-#define CCI_REV_R1             1
-#define CCI_REV_R1_PX          5
+#define CCI400_PORT_S0         0
+#define CCI400_PORT_S1         1
+#define CCI400_PORT_S2         2
+#define CCI400_PORT_S3         3
+#define CCI400_PORT_S4         4
+#define CCI400_PORT_M0         5
+#define CCI400_PORT_M1         6
+#define CCI400_PORT_M2         7
+
+#define CCI400_R1_PX           5
 
 /*
  * Instead of an event id to monitor CCI cycles, a dedicated counter is
@@ -150,12 +196,11 @@ static struct cci_pmu *pmu;
  * make use of this event in hardware.
  */
 enum cci400_perf_events {
-       CCI_PMU_CYCLES = 0xff
+       CCI400_PMU_CYCLES = 0xff
 };
 
-#define CCI_PMU_CYCLE_CNTR_IDX         0
-#define CCI_PMU_CNTR0_IDX              1
-#define CCI_PMU_CNTR_LAST(cci_pmu)     (CCI_PMU_CYCLE_CNTR_IDX + cci_pmu->num_events - 1)
+#define CCI400_PMU_CYCLE_CNTR_IDX      0
+#define CCI400_PMU_CNTR0_IDX           1
 
 /*
  * CCI PMU event id is an 8-bit value made of two parts - bits 7:5 for one of 8
@@ -169,37 +214,173 @@ enum cci400_perf_events {
  * the different revisions and are used to validate the event to be monitored.
  */
 
-#define CCI_REV_R0_SLAVE_PORT_MIN_EV   0x00
-#define CCI_REV_R0_SLAVE_PORT_MAX_EV   0x13
-#define CCI_REV_R0_MASTER_PORT_MIN_EV  0x14
-#define CCI_REV_R0_MASTER_PORT_MAX_EV  0x1a
+#define CCI400_PMU_EVENT_MASK          0xffUL
+#define CCI400_PMU_EVENT_SOURCE_SHIFT  5
+#define CCI400_PMU_EVENT_SOURCE_MASK   0x7
+#define CCI400_PMU_EVENT_CODE_SHIFT    0
+#define CCI400_PMU_EVENT_CODE_MASK     0x1f
+#define CCI400_PMU_EVENT_SOURCE(event) \
+       ((event >> CCI400_PMU_EVENT_SOURCE_SHIFT) & \
+                       CCI400_PMU_EVENT_SOURCE_MASK)
+#define CCI400_PMU_EVENT_CODE(event) \
+       ((event >> CCI400_PMU_EVENT_CODE_SHIFT) & CCI400_PMU_EVENT_CODE_MASK)
+
+#define CCI400_R0_SLAVE_PORT_MIN_EV    0x00
+#define CCI400_R0_SLAVE_PORT_MAX_EV    0x13
+#define CCI400_R0_MASTER_PORT_MIN_EV   0x14
+#define CCI400_R0_MASTER_PORT_MAX_EV   0x1a
+
+#define CCI400_R1_SLAVE_PORT_MIN_EV    0x00
+#define CCI400_R1_SLAVE_PORT_MAX_EV    0x14
+#define CCI400_R1_MASTER_PORT_MIN_EV   0x00
+#define CCI400_R1_MASTER_PORT_MAX_EV   0x11
+
+#define CCI400_CYCLE_EVENT_EXT_ATTR_ENTRY(_name, _config) \
+       CCI_EXT_ATTR_ENTRY(_name, cci400_pmu_cycle_event_show, \
+                                       (unsigned long)_config)
+
+static ssize_t cci400_pmu_cycle_event_show(struct device *dev,
+                       struct device_attribute *attr, char *buf);
+
+static struct dev_ext_attribute cci400_pmu_format_attrs[] = {
+       CCI_FORMAT_EXT_ATTR_ENTRY(event, "config:0-4"),
+       CCI_FORMAT_EXT_ATTR_ENTRY(source, "config:5-7"),
+};
+
+static struct dev_ext_attribute cci400_r0_pmu_event_attrs[] = {
+       /* Slave events */
+       CCI_EVENT_EXT_ATTR_ENTRY(si_rrq_hs_any, 0x0),
+       CCI_EVENT_EXT_ATTR_ENTRY(si_rrq_hs_device, 0x01),
+       CCI_EVENT_EXT_ATTR_ENTRY(si_rrq_hs_normal_or_nonshareable, 0x2),
+       CCI_EVENT_EXT_ATTR_ENTRY(si_rrq_hs_inner_or_outershareable, 0x3),
+       CCI_EVENT_EXT_ATTR_ENTRY(si_rrq_hs_cache_maintenance, 0x4),
+       CCI_EVENT_EXT_ATTR_ENTRY(si_rrq_hs_mem_barrier, 0x5),
+       CCI_EVENT_EXT_ATTR_ENTRY(si_rrq_hs_sync_barrier, 0x6),
+       CCI_EVENT_EXT_ATTR_ENTRY(si_rrq_hs_dvm_msg, 0x7),
+       CCI_EVENT_EXT_ATTR_ENTRY(si_rrq_hs_dvm_msg_sync, 0x8),
+       CCI_EVENT_EXT_ATTR_ENTRY(si_rrq_stall_tt_full, 0x9),
+       CCI_EVENT_EXT_ATTR_ENTRY(si_r_data_last_hs_snoop, 0xA),
+       CCI_EVENT_EXT_ATTR_ENTRY(si_r_data_stall_rvalids_h_rready_l, 0xB),
+       CCI_EVENT_EXT_ATTR_ENTRY(si_wrq_hs_any, 0xC),
+       CCI_EVENT_EXT_ATTR_ENTRY(si_wrq_hs_device, 0xD),
+       CCI_EVENT_EXT_ATTR_ENTRY(si_wrq_hs_normal_or_nonshareable, 0xE),
+       CCI_EVENT_EXT_ATTR_ENTRY(si_wrq_hs_inner_or_outershare_wback_wclean, 0xF),
+       CCI_EVENT_EXT_ATTR_ENTRY(si_wrq_hs_write_unique, 0x10),
+       CCI_EVENT_EXT_ATTR_ENTRY(si_wrq_hs_write_line_unique, 0x11),
+       CCI_EVENT_EXT_ATTR_ENTRY(si_wrq_hs_evict, 0x12),
+       CCI_EVENT_EXT_ATTR_ENTRY(si_wrq_stall_tt_full, 0x13),
+       /* Master events */
+       CCI_EVENT_EXT_ATTR_ENTRY(mi_retry_speculative_fetch, 0x14),
+       CCI_EVENT_EXT_ATTR_ENTRY(mi_rrq_stall_addr_hazard, 0x15),
+       CCI_EVENT_EXT_ATTR_ENTRY(mi_rrq_stall_id_hazard, 0x16),
+       CCI_EVENT_EXT_ATTR_ENTRY(mi_rrq_stall_tt_full, 0x17),
+       CCI_EVENT_EXT_ATTR_ENTRY(mi_rrq_stall_barrier_hazard, 0x18),
+       CCI_EVENT_EXT_ATTR_ENTRY(mi_wrq_stall_barrier_hazard, 0x19),
+       CCI_EVENT_EXT_ATTR_ENTRY(mi_wrq_stall_tt_full, 0x1A),
+       /* Special event for cycles counter */
+       CCI400_CYCLE_EVENT_EXT_ATTR_ENTRY(cycles, 0xff),
+};
+
+static struct dev_ext_attribute cci400_r1_pmu_event_attrs[] = {
+       /* Slave events */
+       CCI_EVENT_EXT_ATTR_ENTRY(si_rrq_hs_any, 0x0),
+       CCI_EVENT_EXT_ATTR_ENTRY(si_rrq_hs_device, 0x01),
+       CCI_EVENT_EXT_ATTR_ENTRY(si_rrq_hs_normal_or_nonshareable, 0x2),
+       CCI_EVENT_EXT_ATTR_ENTRY(si_rrq_hs_inner_or_outershareable, 0x3),
+       CCI_EVENT_EXT_ATTR_ENTRY(si_rrq_hs_cache_maintenance, 0x4),
+       CCI_EVENT_EXT_ATTR_ENTRY(si_rrq_hs_mem_barrier, 0x5),
+       CCI_EVENT_EXT_ATTR_ENTRY(si_rrq_hs_sync_barrier, 0x6),
+       CCI_EVENT_EXT_ATTR_ENTRY(si_rrq_hs_dvm_msg, 0x7),
+       CCI_EVENT_EXT_ATTR_ENTRY(si_rrq_hs_dvm_msg_sync, 0x8),
+       CCI_EVENT_EXT_ATTR_ENTRY(si_rrq_stall_tt_full, 0x9),
+       CCI_EVENT_EXT_ATTR_ENTRY(si_r_data_last_hs_snoop, 0xA),
+       CCI_EVENT_EXT_ATTR_ENTRY(si_r_data_stall_rvalids_h_rready_l, 0xB),
+       CCI_EVENT_EXT_ATTR_ENTRY(si_wrq_hs_any, 0xC),
+       CCI_EVENT_EXT_ATTR_ENTRY(si_wrq_hs_device, 0xD),
+       CCI_EVENT_EXT_ATTR_ENTRY(si_wrq_hs_normal_or_nonshareable, 0xE),
+       CCI_EVENT_EXT_ATTR_ENTRY(si_wrq_hs_inner_or_outershare_wback_wclean, 0xF),
+       CCI_EVENT_EXT_ATTR_ENTRY(si_wrq_hs_write_unique, 0x10),
+       CCI_EVENT_EXT_ATTR_ENTRY(si_wrq_hs_write_line_unique, 0x11),
+       CCI_EVENT_EXT_ATTR_ENTRY(si_wrq_hs_evict, 0x12),
+       CCI_EVENT_EXT_ATTR_ENTRY(si_wrq_stall_tt_full, 0x13),
+       CCI_EVENT_EXT_ATTR_ENTRY(si_rrq_stall_slave_id_hazard, 0x14),
+       /* Master events */
+       CCI_EVENT_EXT_ATTR_ENTRY(mi_retry_speculative_fetch, 0x0),
+       CCI_EVENT_EXT_ATTR_ENTRY(mi_stall_cycle_addr_hazard, 0x1),
+       CCI_EVENT_EXT_ATTR_ENTRY(mi_rrq_stall_master_id_hazard, 0x2),
+       CCI_EVENT_EXT_ATTR_ENTRY(mi_rrq_stall_hi_prio_rtq_full, 0x3),
+       CCI_EVENT_EXT_ATTR_ENTRY(mi_rrq_stall_barrier_hazard, 0x4),
+       CCI_EVENT_EXT_ATTR_ENTRY(mi_wrq_stall_barrier_hazard, 0x5),
+       CCI_EVENT_EXT_ATTR_ENTRY(mi_wrq_stall_wtq_full, 0x6),
+       CCI_EVENT_EXT_ATTR_ENTRY(mi_rrq_stall_low_prio_rtq_full, 0x7),
+       CCI_EVENT_EXT_ATTR_ENTRY(mi_rrq_stall_mid_prio_rtq_full, 0x8),
+       CCI_EVENT_EXT_ATTR_ENTRY(mi_rrq_stall_qvn_vn0, 0x9),
+       CCI_EVENT_EXT_ATTR_ENTRY(mi_rrq_stall_qvn_vn1, 0xA),
+       CCI_EVENT_EXT_ATTR_ENTRY(mi_rrq_stall_qvn_vn2, 0xB),
+       CCI_EVENT_EXT_ATTR_ENTRY(mi_rrq_stall_qvn_vn3, 0xC),
+       CCI_EVENT_EXT_ATTR_ENTRY(mi_wrq_stall_qvn_vn0, 0xD),
+       CCI_EVENT_EXT_ATTR_ENTRY(mi_wrq_stall_qvn_vn1, 0xE),
+       CCI_EVENT_EXT_ATTR_ENTRY(mi_wrq_stall_qvn_vn2, 0xF),
+       CCI_EVENT_EXT_ATTR_ENTRY(mi_wrq_stall_qvn_vn3, 0x10),
+       CCI_EVENT_EXT_ATTR_ENTRY(mi_wrq_unique_or_line_unique_addr_hazard, 0x11),
+       /* Special event for cycles counter */
+       CCI400_CYCLE_EVENT_EXT_ATTR_ENTRY(cycles, 0xff),
+};
 
-#define CCI_REV_R1_SLAVE_PORT_MIN_EV   0x00
-#define CCI_REV_R1_SLAVE_PORT_MAX_EV   0x14
-#define CCI_REV_R1_MASTER_PORT_MIN_EV  0x00
-#define CCI_REV_R1_MASTER_PORT_MAX_EV  0x11
+static ssize_t cci400_pmu_cycle_event_show(struct device *dev,
+                       struct device_attribute *attr, char *buf)
+{
+       struct dev_ext_attribute *eattr = container_of(attr,
+                               struct dev_ext_attribute, attr);
+       return snprintf(buf, PAGE_SIZE, "config=0x%lx\n", (unsigned long)eattr->var);
+}
 
-static int pmu_validate_hw_event(unsigned long hw_event)
+static int cci400_get_event_idx(struct cci_pmu *cci_pmu,
+                               struct cci_pmu_hw_events *hw,
+                               unsigned long cci_event)
 {
-       u8 ev_source = CCI_PMU_EVENT_SOURCE(hw_event);
-       u8 ev_code = CCI_PMU_EVENT_CODE(hw_event);
+       int idx;
+
+       /* cycles event idx is fixed */
+       if (cci_event == CCI400_PMU_CYCLES) {
+               if (test_and_set_bit(CCI400_PMU_CYCLE_CNTR_IDX, hw->used_mask))
+                       return -EAGAIN;
+
+               return CCI400_PMU_CYCLE_CNTR_IDX;
+       }
+
+       for (idx = CCI400_PMU_CNTR0_IDX; idx <= CCI_PMU_CNTR_LAST(cci_pmu); ++idx)
+               if (!test_and_set_bit(idx, hw->used_mask))
+                       return idx;
+
+       /* No counters available */
+       return -EAGAIN;
+}
+
+static int cci400_validate_hw_event(struct cci_pmu *cci_pmu, unsigned long hw_event)
+{
+       u8 ev_source = CCI400_PMU_EVENT_SOURCE(hw_event);
+       u8 ev_code = CCI400_PMU_EVENT_CODE(hw_event);
        int if_type;
 
-       if (hw_event & ~CCI_PMU_EVENT_MASK)
+       if (hw_event & ~CCI400_PMU_EVENT_MASK)
                return -ENOENT;
 
+       if (hw_event == CCI400_PMU_CYCLES)
+               return hw_event;
+
        switch (ev_source) {
-       case CCI_PORT_S0:
-       case CCI_PORT_S1:
-       case CCI_PORT_S2:
-       case CCI_PORT_S3:
-       case CCI_PORT_S4:
+       case CCI400_PORT_S0:
+       case CCI400_PORT_S1:
+       case CCI400_PORT_S2:
+       case CCI400_PORT_S3:
+       case CCI400_PORT_S4:
                /* Slave Interface */
                if_type = CCI_IF_SLAVE;
                break;
-       case CCI_PORT_M0:
-       case CCI_PORT_M1:
-       case CCI_PORT_M2:
+       case CCI400_PORT_M0:
+       case CCI400_PORT_M1:
+       case CCI400_PORT_M2:
                /* Master Interface */
                if_type = CCI_IF_MASTER;
                break;
@@ -207,87 +388,291 @@ static int pmu_validate_hw_event(unsigned long hw_event)
                return -ENOENT;
        }
 
-       if (ev_code >= pmu->model->event_ranges[if_type].min &&
-               ev_code <= pmu->model->event_ranges[if_type].max)
+       if (ev_code >= cci_pmu->model->event_ranges[if_type].min &&
+               ev_code <= cci_pmu->model->event_ranges[if_type].max)
                return hw_event;
 
        return -ENOENT;
 }
 
-static int probe_cci_revision(void)
+static int probe_cci400_revision(void)
 {
        int rev;
        rev = readl_relaxed(cci_ctrl_base + CCI_PID2) & CCI_PID2_REV_MASK;
        rev >>= CCI_PID2_REV_SHIFT;
 
-       if (rev < CCI_REV_R1_PX)
-               return CCI_REV_R0;
+       if (rev < CCI400_R1_PX)
+               return CCI400_R0;
        else
-               return CCI_REV_R1;
+               return CCI400_R1;
 }
 
 static const struct cci_pmu_model *probe_cci_model(struct platform_device *pdev)
 {
        if (platform_has_secure_cci_access())
-               return &cci_pmu_models[probe_cci_revision()];
+               return &cci_pmu_models[probe_cci400_revision()];
        return NULL;
 }
+#else  /* !CONFIG_ARM_CCI400_PMU */
+static inline struct cci_pmu_model *probe_cci_model(struct platform_device *pdev)
+{
+       return NULL;
+}
+#endif /* CONFIG_ARM_CCI400_PMU */
+
+#ifdef CONFIG_ARM_CCI500_PMU
+
+/*
+ * CCI500 provides 8 independent event counters that can count
+ * any of the events available.
+ *
+ * CCI500 PMU event id is an 9-bit value made of two parts.
+ *      bits [8:5] - Source for the event
+ *                   0x0-0x6 - Slave interfaces
+ *                   0x8-0xD - Master interfaces
+ *                   0xf     - Global Events
+ *                   0x7,0xe - Reserved
+ *
+ *      bits [4:0] - Event code (specific to type of interface)
+ */
+
+/* Port ids */
+#define CCI500_PORT_S0                 0x0
+#define CCI500_PORT_S1                 0x1
+#define CCI500_PORT_S2                 0x2
+#define CCI500_PORT_S3                 0x3
+#define CCI500_PORT_S4                 0x4
+#define CCI500_PORT_S5                 0x5
+#define CCI500_PORT_S6                 0x6
+
+#define CCI500_PORT_M0                 0x8
+#define CCI500_PORT_M1                 0x9
+#define CCI500_PORT_M2                 0xa
+#define CCI500_PORT_M3                 0xb
+#define CCI500_PORT_M4                 0xc
+#define CCI500_PORT_M5                 0xd
+
+#define CCI500_PORT_GLOBAL             0xf
+
+#define CCI500_PMU_EVENT_MASK          0x1ffUL
+#define CCI500_PMU_EVENT_SOURCE_SHIFT  0x5
+#define CCI500_PMU_EVENT_SOURCE_MASK   0xf
+#define CCI500_PMU_EVENT_CODE_SHIFT    0x0
+#define CCI500_PMU_EVENT_CODE_MASK     0x1f
+
+#define CCI500_PMU_EVENT_SOURCE(event) \
+       ((event >> CCI500_PMU_EVENT_SOURCE_SHIFT) & CCI500_PMU_EVENT_SOURCE_MASK)
+#define CCI500_PMU_EVENT_CODE(event)   \
+       ((event >> CCI500_PMU_EVENT_CODE_SHIFT) & CCI500_PMU_EVENT_CODE_MASK)
+
+#define CCI500_SLAVE_PORT_MIN_EV       0x00
+#define CCI500_SLAVE_PORT_MAX_EV       0x1f
+#define CCI500_MASTER_PORT_MIN_EV      0x00
+#define CCI500_MASTER_PORT_MAX_EV      0x06
+#define CCI500_GLOBAL_PORT_MIN_EV      0x00
+#define CCI500_GLOBAL_PORT_MAX_EV      0x0f
+
+
+#define CCI500_GLOBAL_EVENT_EXT_ATTR_ENTRY(_name, _config) \
+       CCI_EXT_ATTR_ENTRY(_name, cci500_pmu_global_event_show, \
+                                       (unsigned long) _config)
+
+static ssize_t cci500_pmu_global_event_show(struct device *dev,
+                               struct device_attribute *attr, char *buf);
+
+static struct dev_ext_attribute cci500_pmu_format_attrs[] = {
+       CCI_FORMAT_EXT_ATTR_ENTRY(event, "config:0-4"),
+       CCI_FORMAT_EXT_ATTR_ENTRY(source, "config:5-8"),
+};
+
+static struct dev_ext_attribute cci500_pmu_event_attrs[] = {
+       /* Slave events */
+       CCI_EVENT_EXT_ATTR_ENTRY(si_rrq_hs_arvalid, 0x0),
+       CCI_EVENT_EXT_ATTR_ENTRY(si_rrq_dev, 0x1),
+       CCI_EVENT_EXT_ATTR_ENTRY(si_rrq_hs_nonshareable, 0x2),
+       CCI_EVENT_EXT_ATTR_ENTRY(si_rrq_hs_shareable_non_alloc, 0x3),
+       CCI_EVENT_EXT_ATTR_ENTRY(si_rrq_hs_shareable_alloc, 0x4),
+       CCI_EVENT_EXT_ATTR_ENTRY(si_rrq_hs_invalidate, 0x5),
+       CCI_EVENT_EXT_ATTR_ENTRY(si_rrq_hs_cache_maint, 0x6),
+       CCI_EVENT_EXT_ATTR_ENTRY(si_rrq_hs_dvm_msg, 0x7),
+       CCI_EVENT_EXT_ATTR_ENTRY(si_rrq_hs_rval, 0x8),
+       CCI_EVENT_EXT_ATTR_ENTRY(si_rrq_hs_rlast_snoop, 0x9),
+       CCI_EVENT_EXT_ATTR_ENTRY(si_wrq_hs_awalid, 0xA),
+       CCI_EVENT_EXT_ATTR_ENTRY(si_wrq_dev, 0xB),
+       CCI_EVENT_EXT_ATTR_ENTRY(si_wrq_non_shareable, 0xC),
+       CCI_EVENT_EXT_ATTR_ENTRY(si_wrq_share_wb, 0xD),
+       CCI_EVENT_EXT_ATTR_ENTRY(si_wrq_share_wlu, 0xE),
+       CCI_EVENT_EXT_ATTR_ENTRY(si_wrq_share_wunique, 0xF),
+       CCI_EVENT_EXT_ATTR_ENTRY(si_wrq_evict, 0x10),
+       CCI_EVENT_EXT_ATTR_ENTRY(si_wrq_wrevict, 0x11),
+       CCI_EVENT_EXT_ATTR_ENTRY(si_w_data_beat, 0x12),
+       CCI_EVENT_EXT_ATTR_ENTRY(si_srq_acvalid, 0x13),
+       CCI_EVENT_EXT_ATTR_ENTRY(si_srq_read, 0x14),
+       CCI_EVENT_EXT_ATTR_ENTRY(si_srq_clean, 0x15),
+       CCI_EVENT_EXT_ATTR_ENTRY(si_srq_data_transfer_low, 0x16),
+       CCI_EVENT_EXT_ATTR_ENTRY(si_rrq_stall_arvalid, 0x17),
+       CCI_EVENT_EXT_ATTR_ENTRY(si_r_data_stall, 0x18),
+       CCI_EVENT_EXT_ATTR_ENTRY(si_wrq_stall, 0x19),
+       CCI_EVENT_EXT_ATTR_ENTRY(si_w_data_stall, 0x1A),
+       CCI_EVENT_EXT_ATTR_ENTRY(si_w_resp_stall, 0x1B),
+       CCI_EVENT_EXT_ATTR_ENTRY(si_srq_stall, 0x1C),
+       CCI_EVENT_EXT_ATTR_ENTRY(si_s_data_stall, 0x1D),
+       CCI_EVENT_EXT_ATTR_ENTRY(si_rq_stall_ot_limit, 0x1E),
+       CCI_EVENT_EXT_ATTR_ENTRY(si_r_stall_arbit, 0x1F),
+
+       /* Master events */
+       CCI_EVENT_EXT_ATTR_ENTRY(mi_r_data_beat_any, 0x0),
+       CCI_EVENT_EXT_ATTR_ENTRY(mi_w_data_beat_any, 0x1),
+       CCI_EVENT_EXT_ATTR_ENTRY(mi_rrq_stall, 0x2),
+       CCI_EVENT_EXT_ATTR_ENTRY(mi_r_data_stall, 0x3),
+       CCI_EVENT_EXT_ATTR_ENTRY(mi_wrq_stall, 0x4),
+       CCI_EVENT_EXT_ATTR_ENTRY(mi_w_data_stall, 0x5),
+       CCI_EVENT_EXT_ATTR_ENTRY(mi_w_resp_stall, 0x6),
+
+       /* Global events */
+       CCI500_GLOBAL_EVENT_EXT_ATTR_ENTRY(cci_snoop_access_filter_bank_0_1, 0x0),
+       CCI500_GLOBAL_EVENT_EXT_ATTR_ENTRY(cci_snoop_access_filter_bank_2_3, 0x1),
+       CCI500_GLOBAL_EVENT_EXT_ATTR_ENTRY(cci_snoop_access_filter_bank_4_5, 0x2),
+       CCI500_GLOBAL_EVENT_EXT_ATTR_ENTRY(cci_snoop_access_filter_bank_6_7, 0x3),
+       CCI500_GLOBAL_EVENT_EXT_ATTR_ENTRY(cci_snoop_access_miss_filter_bank_0_1, 0x4),
+       CCI500_GLOBAL_EVENT_EXT_ATTR_ENTRY(cci_snoop_access_miss_filter_bank_2_3, 0x5),
+       CCI500_GLOBAL_EVENT_EXT_ATTR_ENTRY(cci_snoop_access_miss_filter_bank_4_5, 0x6),
+       CCI500_GLOBAL_EVENT_EXT_ATTR_ENTRY(cci_snoop_access_miss_filter_bank_6_7, 0x7),
+       CCI500_GLOBAL_EVENT_EXT_ATTR_ENTRY(cci_snoop_back_invalidation, 0x8),
+       CCI500_GLOBAL_EVENT_EXT_ATTR_ENTRY(cci_snoop_stall_alloc_busy, 0x9),
+       CCI500_GLOBAL_EVENT_EXT_ATTR_ENTRY(cci_snoop_stall_tt_full, 0xA),
+       CCI500_GLOBAL_EVENT_EXT_ATTR_ENTRY(cci_wrq, 0xB),
+       CCI500_GLOBAL_EVENT_EXT_ATTR_ENTRY(cci_snoop_cd_hs, 0xC),
+       CCI500_GLOBAL_EVENT_EXT_ATTR_ENTRY(cci_rq_stall_addr_hazard, 0xD),
+       CCI500_GLOBAL_EVENT_EXT_ATTR_ENTRY(cci_snopp_rq_stall_tt_full, 0xE),
+       CCI500_GLOBAL_EVENT_EXT_ATTR_ENTRY(cci_snoop_rq_tzmp1_prot, 0xF),
+};
+
+static ssize_t cci500_pmu_global_event_show(struct device *dev,
+                               struct device_attribute *attr, char *buf)
+{
+       struct dev_ext_attribute *eattr = container_of(attr,
+                                       struct dev_ext_attribute, attr);
+       /* Global events have single fixed source code */
+       return snprintf(buf, PAGE_SIZE, "event=0x%lx,source=0x%x\n",
+                               (unsigned long)eattr->var, CCI500_PORT_GLOBAL);
+}
+
+static int cci500_validate_hw_event(struct cci_pmu *cci_pmu,
+                                       unsigned long hw_event)
+{
+       u32 ev_source = CCI500_PMU_EVENT_SOURCE(hw_event);
+       u32 ev_code = CCI500_PMU_EVENT_CODE(hw_event);
+       int if_type;
+
+       if (hw_event & ~CCI500_PMU_EVENT_MASK)
+               return -ENOENT;
+
+       switch (ev_source) {
+       case CCI500_PORT_S0:
+       case CCI500_PORT_S1:
+       case CCI500_PORT_S2:
+       case CCI500_PORT_S3:
+       case CCI500_PORT_S4:
+       case CCI500_PORT_S5:
+       case CCI500_PORT_S6:
+               if_type = CCI_IF_SLAVE;
+               break;
+       case CCI500_PORT_M0:
+       case CCI500_PORT_M1:
+       case CCI500_PORT_M2:
+       case CCI500_PORT_M3:
+       case CCI500_PORT_M4:
+       case CCI500_PORT_M5:
+               if_type = CCI_IF_MASTER;
+               break;
+       case CCI500_PORT_GLOBAL:
+               if_type = CCI_IF_GLOBAL;
+               break;
+       default:
+               return -ENOENT;
+       }
+
+       if (ev_code >= cci_pmu->model->event_ranges[if_type].min &&
+               ev_code <= cci_pmu->model->event_ranges[if_type].max)
+               return hw_event;
+
+       return -ENOENT;
+}
+#endif /* CONFIG_ARM_CCI500_PMU */
+
+static ssize_t cci_pmu_format_show(struct device *dev,
+                       struct device_attribute *attr, char *buf)
+{
+       struct dev_ext_attribute *eattr = container_of(attr,
+                               struct dev_ext_attribute, attr);
+       return snprintf(buf, PAGE_SIZE, "%s\n", (char *)eattr->var);
+}
+
+static ssize_t cci_pmu_event_show(struct device *dev,
+                       struct device_attribute *attr, char *buf)
+{
+       struct dev_ext_attribute *eattr = container_of(attr,
+                               struct dev_ext_attribute, attr);
+       /* source parameter is mandatory for normal PMU events */
+       return snprintf(buf, PAGE_SIZE, "source=?,event=0x%lx\n",
+                                        (unsigned long)eattr->var);
+}
 
 static int pmu_is_valid_counter(struct cci_pmu *cci_pmu, int idx)
 {
-       return CCI_PMU_CYCLE_CNTR_IDX <= idx &&
-               idx <= CCI_PMU_CNTR_LAST(cci_pmu);
+       return 0 <= idx && idx <= CCI_PMU_CNTR_LAST(cci_pmu);
 }
 
-static u32 pmu_read_register(int idx, unsigned int offset)
+static u32 pmu_read_register(struct cci_pmu *cci_pmu, int idx, unsigned int offset)
 {
-       return readl_relaxed(pmu->base + CCI_PMU_CNTR_BASE(idx) + offset);
+       return readl_relaxed(cci_pmu->base +
+                            CCI_PMU_CNTR_BASE(cci_pmu->model, idx) + offset);
 }
 
-static void pmu_write_register(u32 value, int idx, unsigned int offset)
+static void pmu_write_register(struct cci_pmu *cci_pmu, u32 value,
+                              int idx, unsigned int offset)
 {
-       return writel_relaxed(value, pmu->base + CCI_PMU_CNTR_BASE(idx) + offset);
+       return writel_relaxed(value, cci_pmu->base +
+                             CCI_PMU_CNTR_BASE(cci_pmu->model, idx) + offset);
 }
 
-static void pmu_disable_counter(int idx)
+static void pmu_disable_counter(struct cci_pmu *cci_pmu, int idx)
 {
-       pmu_write_register(0, idx, CCI_PMU_CNTR_CTRL);
+       pmu_write_register(cci_pmu, 0, idx, CCI_PMU_CNTR_CTRL);
 }
 
-static void pmu_enable_counter(int idx)
+static void pmu_enable_counter(struct cci_pmu *cci_pmu, int idx)
 {
-       pmu_write_register(1, idx, CCI_PMU_CNTR_CTRL);
+       pmu_write_register(cci_pmu, 1, idx, CCI_PMU_CNTR_CTRL);
 }
 
-static void pmu_set_event(int idx, unsigned long event)
+static void pmu_set_event(struct cci_pmu *cci_pmu, int idx, unsigned long event)
 {
-       pmu_write_register(event, idx, CCI_PMU_EVT_SEL);
+       pmu_write_register(cci_pmu, event, idx, CCI_PMU_EVT_SEL);
 }
 
+/*
+ * Returns the number of programmable counters actually implemented
+ * by the cci
+ */
 static u32 pmu_get_max_counters(void)
 {
-       u32 n_cnts = (readl_relaxed(cci_ctrl_base + CCI_PMCR) &
-                     CCI_PMCR_NCNT_MASK) >> CCI_PMCR_NCNT_SHIFT;
-
-       /* add 1 for cycle counter */
-       return n_cnts + 1;
+       return (readl_relaxed(cci_ctrl_base + CCI_PMCR) &
+               CCI_PMCR_NCNT_MASK) >> CCI_PMCR_NCNT_SHIFT;
 }
 
 static int pmu_get_event_idx(struct cci_pmu_hw_events *hw, struct perf_event *event)
 {
        struct cci_pmu *cci_pmu = to_cci_pmu(event->pmu);
-       struct hw_perf_event *hw_event = &event->hw;
-       unsigned long cci_event = hw_event->config_base;
+       unsigned long cci_event = event->hw.config_base;
        int idx;
 
-       if (cci_event == CCI_PMU_CYCLES) {
-               if (test_and_set_bit(CCI_PMU_CYCLE_CNTR_IDX, hw->used_mask))
-                       return -EAGAIN;
+       if (cci_pmu->model->get_event_idx)
+               return cci_pmu->model->get_event_idx(cci_pmu, hw, cci_event);
 
-               return CCI_PMU_CYCLE_CNTR_IDX;
-       }
-
-       for (idx = CCI_PMU_CNTR0_IDX; idx <= CCI_PMU_CNTR_LAST(cci_pmu); ++idx)
+       /* Generic code to find an unused idx from the mask */
+       for(idx = 0; idx <= CCI_PMU_CNTR_LAST(cci_pmu); idx++)
                if (!test_and_set_bit(idx, hw->used_mask))
                        return idx;
 
@@ -297,18 +682,13 @@ static int pmu_get_event_idx(struct cci_pmu_hw_events *hw, struct perf_event *ev
 
 static int pmu_map_event(struct perf_event *event)
 {
-       int mapping;
-       unsigned long config = event->attr.config;
+       struct cci_pmu *cci_pmu = to_cci_pmu(event->pmu);
 
-       if (event->attr.type < PERF_TYPE_MAX)
+       if (event->attr.type < PERF_TYPE_MAX ||
+                       !cci_pmu->model->validate_hw_event)
                return -ENOENT;
 
-       if (config == CCI_PMU_CYCLES)
-               mapping = config;
-       else
-               mapping = pmu_validate_hw_event(config);
-
-       return mapping;
+       return  cci_pmu->model->validate_hw_event(cci_pmu, event->attr.config);
 }
 
 static int pmu_request_irq(struct cci_pmu *cci_pmu, irq_handler_t handler)
@@ -319,7 +699,7 @@ static int pmu_request_irq(struct cci_pmu *cci_pmu, irq_handler_t handler)
        if (unlikely(!pmu_device))
                return -ENODEV;
 
-       if (pmu->nr_irqs < 1) {
+       if (cci_pmu->nr_irqs < 1) {
                dev_err(&pmu_device->dev, "no irqs for CCI PMUs defined\n");
                return -ENODEV;
        }
@@ -331,16 +711,16 @@ static int pmu_request_irq(struct cci_pmu *cci_pmu, irq_handler_t handler)
         *
         * This should allow handling of non-unique interrupt for the counters.
         */
-       for (i = 0; i < pmu->nr_irqs; i++) {
-               int err = request_irq(pmu->irqs[i], handler, IRQF_SHARED,
+       for (i = 0; i < cci_pmu->nr_irqs; i++) {
+               int err = request_irq(cci_pmu->irqs[i], handler, IRQF_SHARED,
                                "arm-cci-pmu", cci_pmu);
                if (err) {
                        dev_err(&pmu_device->dev, "unable to request IRQ%d for ARM CCI PMU counters\n",
-                               pmu->irqs[i]);
+                               cci_pmu->irqs[i]);
                        return err;
                }
 
-               set_bit(i, &pmu->active_irqs);
+               set_bit(i, &cci_pmu->active_irqs);
        }
 
        return 0;
@@ -350,11 +730,11 @@ static void pmu_free_irq(struct cci_pmu *cci_pmu)
 {
        int i;
 
-       for (i = 0; i < pmu->nr_irqs; i++) {
-               if (!test_and_clear_bit(i, &pmu->active_irqs))
+       for (i = 0; i < cci_pmu->nr_irqs; i++) {
+               if (!test_and_clear_bit(i, &cci_pmu->active_irqs))
                        continue;
 
-               free_irq(pmu->irqs[i], cci_pmu);
+               free_irq(cci_pmu->irqs[i], cci_pmu);
        }
 }
 
@@ -369,7 +749,7 @@ static u32 pmu_read_counter(struct perf_event *event)
                dev_err(&cci_pmu->plat_device->dev, "Invalid CCI PMU counter %d\n", idx);
                return 0;
        }
-       value = pmu_read_register(idx, CCI_PMU_CNTR);
+       value = pmu_read_register(cci_pmu, idx, CCI_PMU_CNTR);
 
        return value;
 }
@@ -383,7 +763,7 @@ static void pmu_write_counter(struct perf_event *event, u32 value)
        if (unlikely(!pmu_is_valid_counter(cci_pmu, idx)))
                dev_err(&cci_pmu->plat_device->dev, "Invalid CCI PMU counter %d\n", idx);
        else
-               pmu_write_register(value, idx, CCI_PMU_CNTR);
+               pmu_write_register(cci_pmu, value, idx, CCI_PMU_CNTR);
 }
 
 static u64 pmu_event_update(struct perf_event *event)
@@ -427,7 +807,7 @@ static irqreturn_t pmu_handle_irq(int irq_num, void *dev)
 {
        unsigned long flags;
        struct cci_pmu *cci_pmu = dev;
-       struct cci_pmu_hw_events *events = &pmu->hw_events;
+       struct cci_pmu_hw_events *events = &cci_pmu->hw_events;
        int idx, handled = IRQ_NONE;
 
        raw_spin_lock_irqsave(&events->pmu_lock, flags);
@@ -436,7 +816,7 @@ static irqreturn_t pmu_handle_irq(int irq_num, void *dev)
         * This should work regardless of whether we have per-counter overflow
         * interrupt or a combined overflow interrupt.
         */
-       for (idx = CCI_PMU_CYCLE_CNTR_IDX; idx <= CCI_PMU_CNTR_LAST(cci_pmu); idx++) {
+       for (idx = 0; idx <= CCI_PMU_CNTR_LAST(cci_pmu); idx++) {
                struct perf_event *event = events->events[idx];
                struct hw_perf_event *hw_counter;
 
@@ -446,11 +826,12 @@ static irqreturn_t pmu_handle_irq(int irq_num, void *dev)
                hw_counter = &event->hw;
 
                /* Did this counter overflow? */
-               if (!(pmu_read_register(idx, CCI_PMU_OVRFLW) &
+               if (!(pmu_read_register(cci_pmu, idx, CCI_PMU_OVRFLW) &
                      CCI_PMU_OVRFLW_FLAG))
                        continue;
 
-               pmu_write_register(CCI_PMU_OVRFLW_FLAG, idx, CCI_PMU_OVRFLW);
+               pmu_write_register(cci_pmu, CCI_PMU_OVRFLW_FLAG, idx,
+                                                       CCI_PMU_OVRFLW);
 
                pmu_event_update(event);
                pmu_event_set_period(event);
@@ -492,7 +873,7 @@ static void cci_pmu_enable(struct pmu *pmu)
 {
        struct cci_pmu *cci_pmu = to_cci_pmu(pmu);
        struct cci_pmu_hw_events *hw_events = &cci_pmu->hw_events;
-       int enabled = bitmap_weight(hw_events->used_mask, cci_pmu->num_events);
+       int enabled = bitmap_weight(hw_events->used_mask, cci_pmu->num_cntrs);
        unsigned long flags;
        u32 val;
 
@@ -523,6 +904,16 @@ static void cci_pmu_disable(struct pmu *pmu)
        raw_spin_unlock_irqrestore(&hw_events->pmu_lock, flags);
 }
 
+/*
+ * Check if the idx represents a non-programmable counter.
+ * All the fixed event counters are mapped before the programmable
+ * counters.
+ */
+static bool pmu_fixed_hw_idx(struct cci_pmu *cci_pmu, int idx)
+{
+       return (idx >= 0) && (idx < cci_pmu->model->fixed_hw_cntrs);
+}
+
 static void cci_pmu_start(struct perf_event *event, int pmu_flags)
 {
        struct cci_pmu *cci_pmu = to_cci_pmu(event->pmu);
@@ -547,12 +938,12 @@ static void cci_pmu_start(struct perf_event *event, int pmu_flags)
 
        raw_spin_lock_irqsave(&hw_events->pmu_lock, flags);
 
-       /* Configure the event to count, unless you are counting cycles */
-       if (idx != CCI_PMU_CYCLE_CNTR_IDX)
-               pmu_set_event(idx, hwc->config_base);
+       /* Configure the counter unless you are counting a fixed event */
+       if (!pmu_fixed_hw_idx(cci_pmu, idx))
+               pmu_set_event(cci_pmu, idx, hwc->config_base);
 
        pmu_event_set_period(event);
-       pmu_enable_counter(idx);
+       pmu_enable_counter(cci_pmu, idx);
 
        raw_spin_unlock_irqrestore(&hw_events->pmu_lock, flags);
 }
@@ -575,7 +966,7 @@ static void cci_pmu_stop(struct perf_event *event, int pmu_flags)
         * We always reprogram the counter, so ignore PERF_EF_UPDATE. See
         * cci_pmu_start()
         */
-       pmu_disable_counter(idx);
+       pmu_disable_counter(cci_pmu, idx);
        pmu_event_update(event);
        hwc->state |= PERF_HES_STOPPED | PERF_HES_UPTODATE;
 }
@@ -655,13 +1046,16 @@ static int
 validate_group(struct perf_event *event)
 {
        struct perf_event *sibling, *leader = event->group_leader;
+       struct cci_pmu *cci_pmu = to_cci_pmu(event->pmu);
+       unsigned long mask[BITS_TO_LONGS(cci_pmu->num_cntrs)];
        struct cci_pmu_hw_events fake_pmu = {
                /*
                 * Initialise the fake PMU. We only need to populate the
                 * used_mask for the purposes of validation.
                 */
-               .used_mask = { 0 },
+               .used_mask = mask,
        };
+       memset(mask, 0, BITS_TO_LONGS(cci_pmu->num_cntrs) * sizeof(unsigned long));
 
        if (!validate_event(event->pmu, &fake_pmu, leader))
                return -EINVAL;
@@ -779,20 +1173,27 @@ static int cci_pmu_event_init(struct perf_event *event)
        return err;
 }
 
-static ssize_t pmu_attr_cpumask_show(struct device *dev,
+static ssize_t pmu_cpumask_attr_show(struct device *dev,
                                     struct device_attribute *attr, char *buf)
 {
+       struct dev_ext_attribute *eattr = container_of(attr,
+                                       struct dev_ext_attribute, attr);
+       struct cci_pmu *cci_pmu = eattr->var;
+
        int n = scnprintf(buf, PAGE_SIZE - 1, "%*pbl",
-                         cpumask_pr_args(&pmu->cpus));
+                         cpumask_pr_args(&cci_pmu->cpus));
        buf[n++] = '\n';
        buf[n] = '\0';
        return n;
 }
 
-static DEVICE_ATTR(cpumask, S_IRUGO, pmu_attr_cpumask_show, NULL);
+static struct dev_ext_attribute pmu_cpumask_attr = {
+       __ATTR(cpumask, S_IRUGO, pmu_cpumask_attr_show, NULL),
+       NULL,           /* Populated in cci_pmu_init */
+};
 
 static struct attribute *pmu_attrs[] = {
-       &dev_attr_cpumask.attr,
+       &pmu_cpumask_attr.attr.attr,
        NULL,
 };
 
@@ -800,14 +1201,78 @@ static struct attribute_group pmu_attr_group = {
        .attrs = pmu_attrs,
 };
 
+static struct attribute_group pmu_format_attr_group = {
+       .name = "format",
+       .attrs = NULL,          /* Filled in cci_pmu_init_attrs */
+};
+
+static struct attribute_group pmu_event_attr_group = {
+       .name = "events",
+       .attrs = NULL,          /* Filled in cci_pmu_init_attrs */
+};
+
 static const struct attribute_group *pmu_attr_groups[] = {
        &pmu_attr_group,
+       &pmu_format_attr_group,
+       &pmu_event_attr_group,
        NULL
 };
 
+static struct attribute **alloc_attrs(struct platform_device *pdev,
+                               int n, struct dev_ext_attribute *source)
+{
+       int i;
+       struct attribute **attrs;
+
+       /* Alloc n + 1 (for terminating NULL) */
+       attrs  = devm_kcalloc(&pdev->dev, n + 1, sizeof(struct attribute *),
+                                                               GFP_KERNEL);
+       if (!attrs)
+               return attrs;
+       for(i = 0; i < n; i++)
+               attrs[i] = &source[i].attr.attr;
+       return attrs;
+}
+
+static int cci_pmu_init_attrs(struct cci_pmu *cci_pmu, struct platform_device *pdev)
+{
+       const struct cci_pmu_model *model = cci_pmu->model;
+       struct attribute **attrs;
+
+       /*
+        * All allocations below are managed, hence doesn't need to be
+        * free'd explicitly in case of an error.
+        */
+
+       if (model->nevent_attrs) {
+               attrs = alloc_attrs(pdev, model->nevent_attrs,
+                                               model->event_attrs);
+               if (!attrs)
+                       return -ENOMEM;
+               pmu_event_attr_group.attrs = attrs;
+       }
+       if (model->nformat_attrs) {
+               attrs = alloc_attrs(pdev, model->nformat_attrs,
+                                                model->format_attrs);
+               if (!attrs)
+                       return -ENOMEM;
+               pmu_format_attr_group.attrs = attrs;
+       }
+       pmu_cpumask_attr.var = cci_pmu;
+
+       return 0;
+}
+
 static int cci_pmu_init(struct cci_pmu *cci_pmu, struct platform_device *pdev)
 {
        char *name = cci_pmu->model->name;
+       u32 num_cntrs;
+       int rc;
+
+       rc = cci_pmu_init_attrs(cci_pmu, pdev);
+       if (rc)
+               return rc;
+
        cci_pmu->pmu = (struct pmu) {
                .name           = cci_pmu->model->name,
                .task_ctx_nr    = perf_invalid_context,
@@ -823,7 +1288,15 @@ static int cci_pmu_init(struct cci_pmu *cci_pmu, struct platform_device *pdev)
        };
 
        cci_pmu->plat_device = pdev;
-       cci_pmu->num_events = pmu_get_max_counters();
+       num_cntrs = pmu_get_max_counters();
+       if (num_cntrs > cci_pmu->model->num_hw_cntrs) {
+               dev_warn(&pdev->dev,
+                       "PMU implements more counters(%d) than supported by"
+                       " the model(%d), truncated.",
+                       num_cntrs, cci_pmu->model->num_hw_cntrs);
+               num_cntrs = cci_pmu->model->num_hw_cntrs;
+       }
+       cci_pmu->num_cntrs = num_cntrs + cci_pmu->model->fixed_hw_cntrs;
 
        return perf_pmu_register(&cci_pmu->pmu, name, -1);
 }
@@ -831,12 +1304,14 @@ static int cci_pmu_init(struct cci_pmu *cci_pmu, struct platform_device *pdev)
 static int cci_pmu_cpu_notifier(struct notifier_block *self,
                                unsigned long action, void *hcpu)
 {
+       struct cci_pmu *cci_pmu = container_of(self,
+                                       struct cci_pmu, cpu_nb);
        unsigned int cpu = (long)hcpu;
        unsigned int target;
 
        switch (action & ~CPU_TASKS_FROZEN) {
        case CPU_DOWN_PREPARE:
-               if (!cpumask_test_and_clear_cpu(cpu, &pmu->cpus))
+               if (!cpumask_test_and_clear_cpu(cpu, &cci_pmu->cpus))
                        break;
                target = cpumask_any_but(cpu_online_mask, cpu);
                if (target < 0) // UP, last CPU
@@ -845,7 +1320,7 @@ static int cci_pmu_cpu_notifier(struct notifier_block *self,
                 * TODO: migrate context once core races on event->ctx have
                 * been fixed.
                 */
-               cpumask_set_cpu(target, &pmu->cpus);
+               cpumask_set_cpu(target, &cci_pmu->cpus);
        default:
                break;
        }
@@ -853,57 +1328,103 @@ static int cci_pmu_cpu_notifier(struct notifier_block *self,
        return NOTIFY_OK;
 }
 
-static struct notifier_block cci_pmu_cpu_nb = {
-       .notifier_call  = cci_pmu_cpu_notifier,
-       /*
-        * to migrate uncore events, our notifier should be executed
-        * before perf core's notifier.
-        */
-       .priority       = CPU_PRI_PERF + 1,
-};
-
 static struct cci_pmu_model cci_pmu_models[] = {
-       [CCI_REV_R0] = {
+#ifdef CONFIG_ARM_CCI400_PMU
+       [CCI400_R0] = {
                .name = "CCI_400",
+               .fixed_hw_cntrs = 1,    /* Cycle counter */
+               .num_hw_cntrs = 4,
+               .cntr_size = SZ_4K,
+               .format_attrs = cci400_pmu_format_attrs,
+               .nformat_attrs = ARRAY_SIZE(cci400_pmu_format_attrs),
+               .event_attrs = cci400_r0_pmu_event_attrs,
+               .nevent_attrs = ARRAY_SIZE(cci400_r0_pmu_event_attrs),
                .event_ranges = {
                        [CCI_IF_SLAVE] = {
-                               CCI_REV_R0_SLAVE_PORT_MIN_EV,
-                               CCI_REV_R0_SLAVE_PORT_MAX_EV,
+                               CCI400_R0_SLAVE_PORT_MIN_EV,
+                               CCI400_R0_SLAVE_PORT_MAX_EV,
                        },
                        [CCI_IF_MASTER] = {
-                               CCI_REV_R0_MASTER_PORT_MIN_EV,
-                               CCI_REV_R0_MASTER_PORT_MAX_EV,
+                               CCI400_R0_MASTER_PORT_MIN_EV,
+                               CCI400_R0_MASTER_PORT_MAX_EV,
                        },
                },
+               .validate_hw_event = cci400_validate_hw_event,
+               .get_event_idx = cci400_get_event_idx,
        },
-       [CCI_REV_R1] = {
+       [CCI400_R1] = {
                .name = "CCI_400_r1",
+               .fixed_hw_cntrs = 1,    /* Cycle counter */
+               .num_hw_cntrs = 4,
+               .cntr_size = SZ_4K,
+               .format_attrs = cci400_pmu_format_attrs,
+               .nformat_attrs = ARRAY_SIZE(cci400_pmu_format_attrs),
+               .event_attrs = cci400_r1_pmu_event_attrs,
+               .nevent_attrs = ARRAY_SIZE(cci400_r1_pmu_event_attrs),
                .event_ranges = {
                        [CCI_IF_SLAVE] = {
-                               CCI_REV_R1_SLAVE_PORT_MIN_EV,
-                               CCI_REV_R1_SLAVE_PORT_MAX_EV,
+                               CCI400_R1_SLAVE_PORT_MIN_EV,
+                               CCI400_R1_SLAVE_PORT_MAX_EV,
                        },
                        [CCI_IF_MASTER] = {
-                               CCI_REV_R1_MASTER_PORT_MIN_EV,
-                               CCI_REV_R1_MASTER_PORT_MAX_EV,
+                               CCI400_R1_MASTER_PORT_MIN_EV,
+                               CCI400_R1_MASTER_PORT_MAX_EV,
                        },
                },
+               .validate_hw_event = cci400_validate_hw_event,
+               .get_event_idx = cci400_get_event_idx,
        },
+#endif
+#ifdef CONFIG_ARM_CCI500_PMU
+       [CCI500_R0] = {
+               .name = "CCI_500",
+               .fixed_hw_cntrs = 0,
+               .num_hw_cntrs = 8,
+               .cntr_size = SZ_64K,
+               .format_attrs = cci500_pmu_format_attrs,
+               .nformat_attrs = ARRAY_SIZE(cci500_pmu_format_attrs),
+               .event_attrs = cci500_pmu_event_attrs,
+               .nevent_attrs = ARRAY_SIZE(cci500_pmu_event_attrs),
+               .event_ranges = {
+                       [CCI_IF_SLAVE] = {
+                               CCI500_SLAVE_PORT_MIN_EV,
+                               CCI500_SLAVE_PORT_MAX_EV,
+                       },
+                       [CCI_IF_MASTER] = {
+                               CCI500_MASTER_PORT_MIN_EV,
+                               CCI500_MASTER_PORT_MAX_EV,
+                       },
+                       [CCI_IF_GLOBAL] = {
+                               CCI500_GLOBAL_PORT_MIN_EV,
+                               CCI500_GLOBAL_PORT_MAX_EV,
+                       },
+               },
+               .validate_hw_event = cci500_validate_hw_event,
+       },
+#endif
 };
 
 static const struct of_device_id arm_cci_pmu_matches[] = {
+#ifdef CONFIG_ARM_CCI400_PMU
        {
                .compatible = "arm,cci-400-pmu",
                .data   = NULL,
        },
        {
                .compatible = "arm,cci-400-pmu,r0",
-               .data   = &cci_pmu_models[CCI_REV_R0],
+               .data   = &cci_pmu_models[CCI400_R0],
        },
        {
                .compatible = "arm,cci-400-pmu,r1",
-               .data   = &cci_pmu_models[CCI_REV_R1],
+               .data   = &cci_pmu_models[CCI400_R1],
+       },
+#endif
+#ifdef CONFIG_ARM_CCI500_PMU
+       {
+               .compatible = "arm,cci-500-pmu,r0",
+               .data = &cci_pmu_models[CCI500_R0],
        },
+#endif
        {},
 };
 
@@ -932,68 +1453,114 @@ static bool is_duplicate_irq(int irq, int *irqs, int nr_irqs)
        return false;
 }
 
-static int cci_pmu_probe(struct platform_device *pdev)
+static struct cci_pmu *cci_pmu_alloc(struct platform_device *pdev)
 {
-       struct resource *res;
-       int i, ret, irq;
+       struct cci_pmu *cci_pmu;
        const struct cci_pmu_model *model;
 
+       /*
+        * All allocations are devm_* hence we don't have to free
+        * them explicitly on an error, as it would end up in driver
+        * detach.
+        */
        model = get_cci_model(pdev);
        if (!model) {
                dev_warn(&pdev->dev, "CCI PMU version not supported\n");
-               return -ENODEV;
+               return ERR_PTR(-ENODEV);
        }
 
-       pmu = devm_kzalloc(&pdev->dev, sizeof(*pmu), GFP_KERNEL);
-       if (!pmu)
-               return -ENOMEM;
+       cci_pmu = devm_kzalloc(&pdev->dev, sizeof(*cci_pmu), GFP_KERNEL);
+       if (!cci_pmu)
+               return ERR_PTR(-ENOMEM);
+
+       cci_pmu->model = model;
+       cci_pmu->irqs = devm_kcalloc(&pdev->dev, CCI_PMU_MAX_HW_CNTRS(model),
+                                       sizeof(*cci_pmu->irqs), GFP_KERNEL);
+       if (!cci_pmu->irqs)
+               return ERR_PTR(-ENOMEM);
+       cci_pmu->hw_events.events = devm_kcalloc(&pdev->dev,
+                                            CCI_PMU_MAX_HW_CNTRS(model),
+                                            sizeof(*cci_pmu->hw_events.events),
+                                            GFP_KERNEL);
+       if (!cci_pmu->hw_events.events)
+               return ERR_PTR(-ENOMEM);
+       cci_pmu->hw_events.used_mask = devm_kcalloc(&pdev->dev,
+                                               BITS_TO_LONGS(CCI_PMU_MAX_HW_CNTRS(model)),
+                                               sizeof(*cci_pmu->hw_events.used_mask),
+                                               GFP_KERNEL);
+       if (!cci_pmu->hw_events.used_mask)
+               return ERR_PTR(-ENOMEM);
+
+       return cci_pmu;
+}
+
+
+static int cci_pmu_probe(struct platform_device *pdev)
+{
+       struct resource *res;
+       struct cci_pmu *cci_pmu;
+       int i, ret, irq;
+
+       cci_pmu = cci_pmu_alloc(pdev);
+       if (IS_ERR(cci_pmu))
+               return PTR_ERR(cci_pmu);
 
-       pmu->model = model;
        res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       pmu->base = devm_ioremap_resource(&pdev->dev, res);
-       if (IS_ERR(pmu->base))
+       cci_pmu->base = devm_ioremap_resource(&pdev->dev, res);
+       if (IS_ERR(cci_pmu->base))
                return -ENOMEM;
 
        /*
-        * CCI PMU has 5 overflow signals - one per counter; but some may be tied
+        * CCI PMU has one overflow interrupt per counter; but some may be tied
         * together to a common interrupt.
         */
-       pmu->nr_irqs = 0;
-       for (i = 0; i < CCI_PMU_MAX_HW_EVENTS; i++) {
+       cci_pmu->nr_irqs = 0;
+       for (i = 0; i < CCI_PMU_MAX_HW_CNTRS(cci_pmu->model); i++) {
                irq = platform_get_irq(pdev, i);
                if (irq < 0)
                        break;
 
-               if (is_duplicate_irq(irq, pmu->irqs, pmu->nr_irqs))
+               if (is_duplicate_irq(irq, cci_pmu->irqs, cci_pmu->nr_irqs))
                        continue;
 
-               pmu->irqs[pmu->nr_irqs++] = irq;
+               cci_pmu->irqs[cci_pmu->nr_irqs++] = irq;
        }
 
        /*
         * Ensure that the device tree has as many interrupts as the number
         * of counters.
         */
-       if (i < CCI_PMU_MAX_HW_EVENTS) {
+       if (i < CCI_PMU_MAX_HW_CNTRS(cci_pmu->model)) {
                dev_warn(&pdev->dev, "In-correct number of interrupts: %d, should be %d\n",
-                       i, CCI_PMU_MAX_HW_EVENTS);
+                       i, CCI_PMU_MAX_HW_CNTRS(cci_pmu->model));
                return -EINVAL;
        }
 
-       raw_spin_lock_init(&pmu->hw_events.pmu_lock);
-       mutex_init(&pmu->reserve_mutex);
-       atomic_set(&pmu->active_events, 0);
-       cpumask_set_cpu(smp_processor_id(), &pmu->cpus);
+       raw_spin_lock_init(&cci_pmu->hw_events.pmu_lock);
+       mutex_init(&cci_pmu->reserve_mutex);
+       atomic_set(&cci_pmu->active_events, 0);
+       cpumask_set_cpu(smp_processor_id(), &cci_pmu->cpus);
+
+       cci_pmu->cpu_nb = (struct notifier_block) {
+               .notifier_call  = cci_pmu_cpu_notifier,
+               /*
+                * to migrate uncore events, our notifier should be executed
+                * before perf core's notifier.
+                */
+               .priority       = CPU_PRI_PERF + 1,
+       };
 
-       ret = register_cpu_notifier(&cci_pmu_cpu_nb);
+       ret = register_cpu_notifier(&cci_pmu->cpu_nb);
        if (ret)
                return ret;
 
-       ret = cci_pmu_init(pmu, pdev);
-       if (ret)
+       ret = cci_pmu_init(cci_pmu, pdev);
+       if (ret) {
+               unregister_cpu_notifier(&cci_pmu->cpu_nb);
                return ret;
+       }
 
-       pr_info("ARM %s PMU driver probed", pmu->model->name);
+       pr_info("ARM %s PMU driver probed", cci_pmu->model->name);
        return 0;
 }
 
@@ -1032,14 +1599,14 @@ static int __init cci_platform_init(void)
        return platform_driver_register(&cci_platform_driver);
 }
 
-#else /* !CONFIG_ARM_CCI400_PMU */
+#else /* !CONFIG_ARM_CCI_PMU */
 
 static int __init cci_platform_init(void)
 {
        return 0;
 }
 
-#endif /* CONFIG_ARM_CCI400_PMU */
+#endif /* CONFIG_ARM_CCI_PMU */
 
 #ifdef CONFIG_ARM_CCI400_PORT_CTRL
 
index aaa0f2a871185f139844b5fd682225a6160ba3d2..7d9879e166cf4c4346402cb353ef3cd002483740 100644 (file)
@@ -166,13 +166,17 @@ struct arm_ccn_dt {
 
        struct hrtimer hrtimer;
 
+       cpumask_t cpu;
+       struct notifier_block cpu_nb;
+
        struct pmu pmu;
 };
 
 struct arm_ccn {
        struct device *dev;
        void __iomem *base;
-       unsigned irq_used:1;
+       unsigned int irq;
+
        unsigned sbas_present:1;
        unsigned sbsx_present:1;
 
@@ -212,7 +216,7 @@ static int arm_ccn_node_to_xp_port(int node)
 
 static void arm_ccn_pmu_config_set(u64 *config, u32 node_xp, u32 type, u32 port)
 {
-       *config &= ~((0xff << 0) | (0xff << 8) | (0xff << 24));
+       *config &= ~((0xff << 0) | (0xff << 8) | (0x3 << 24));
        *config |= (node_xp << 0) | (type << 8) | (port << 24);
 }
 
@@ -336,6 +340,23 @@ static ssize_t arm_ccn_pmu_event_show(struct device *dev,
        if (event->mask)
                res += snprintf(buf + res, PAGE_SIZE - res, ",mask=0x%x",
                                event->mask);
+
+       /* Arguments required by an event */
+       switch (event->type) {
+       case CCN_TYPE_CYCLES:
+               break;
+       case CCN_TYPE_XP:
+               res += snprintf(buf + res, PAGE_SIZE - res,
+                               ",xp=?,port=?,vc=?,dir=?");
+               if (event->event == CCN_EVENT_WATCHPOINT)
+                       res += snprintf(buf + res, PAGE_SIZE - res,
+                                       ",cmp_l=?,cmp_h=?,mask=?");
+               break;
+       default:
+               res += snprintf(buf + res, PAGE_SIZE - res, ",node=?");
+               break;
+       }
+
        res += snprintf(buf + res, PAGE_SIZE - res, "\n");
 
        return res;
@@ -521,6 +542,25 @@ static struct attribute_group arm_ccn_pmu_cmp_mask_attr_group = {
        .attrs = arm_ccn_pmu_cmp_mask_attrs,
 };
 
+static ssize_t arm_ccn_pmu_cpumask_show(struct device *dev,
+                                    struct device_attribute *attr, char *buf)
+{
+       struct arm_ccn *ccn = pmu_to_arm_ccn(dev_get_drvdata(dev));
+
+       return cpumap_print_to_pagebuf(true, buf, &ccn->dt.cpu);
+}
+
+static struct device_attribute arm_ccn_pmu_cpumask_attr =
+               __ATTR(cpumask, S_IRUGO, arm_ccn_pmu_cpumask_show, NULL);
+
+static struct attribute *arm_ccn_pmu_cpumask_attrs[] = {
+       &arm_ccn_pmu_cpumask_attr.attr,
+       NULL,
+};
+
+static struct attribute_group arm_ccn_pmu_cpumask_attr_group = {
+       .attrs = arm_ccn_pmu_cpumask_attrs,
+};
 
 /*
  * Default poll period is 10ms, which is way over the top anyway,
@@ -542,6 +582,7 @@ static const struct attribute_group *arm_ccn_pmu_attr_groups[] = {
        &arm_ccn_pmu_events_attr_group,
        &arm_ccn_pmu_format_attr_group,
        &arm_ccn_pmu_cmp_mask_attr_group,
+       &arm_ccn_pmu_cpumask_attr_group,
        NULL
 };
 
@@ -587,7 +628,65 @@ static int arm_ccn_pmu_type_eq(u32 a, u32 b)
        return 0;
 }
 
-static void arm_ccn_pmu_event_destroy(struct perf_event *event)
+static int arm_ccn_pmu_event_alloc(struct perf_event *event)
+{
+       struct arm_ccn *ccn = pmu_to_arm_ccn(event->pmu);
+       struct hw_perf_event *hw = &event->hw;
+       u32 node_xp, type, event_id;
+       struct arm_ccn_component *source;
+       int bit;
+
+       node_xp = CCN_CONFIG_NODE(event->attr.config);
+       type = CCN_CONFIG_TYPE(event->attr.config);
+       event_id = CCN_CONFIG_EVENT(event->attr.config);
+
+       /* Allocate the cycle counter */
+       if (type == CCN_TYPE_CYCLES) {
+               if (test_and_set_bit(CCN_IDX_PMU_CYCLE_COUNTER,
+                               ccn->dt.pmu_counters_mask))
+                       return -EAGAIN;
+
+               hw->idx = CCN_IDX_PMU_CYCLE_COUNTER;
+               ccn->dt.pmu_counters[CCN_IDX_PMU_CYCLE_COUNTER].event = event;
+
+               return 0;
+       }
+
+       /* Allocate an event counter */
+       hw->idx = arm_ccn_pmu_alloc_bit(ccn->dt.pmu_counters_mask,
+                       CCN_NUM_PMU_EVENT_COUNTERS);
+       if (hw->idx < 0) {
+               dev_dbg(ccn->dev, "No more counters available!\n");
+               return -EAGAIN;
+       }
+
+       if (type == CCN_TYPE_XP)
+               source = &ccn->xp[node_xp];
+       else
+               source = &ccn->node[node_xp];
+       ccn->dt.pmu_counters[hw->idx].source = source;
+
+       /* Allocate an event source or a watchpoint */
+       if (type == CCN_TYPE_XP && event_id == CCN_EVENT_WATCHPOINT)
+               bit = arm_ccn_pmu_alloc_bit(source->xp.dt_cmp_mask,
+                               CCN_NUM_XP_WATCHPOINTS);
+       else
+               bit = arm_ccn_pmu_alloc_bit(source->pmu_events_mask,
+                               CCN_NUM_PMU_EVENTS);
+       if (bit < 0) {
+               dev_dbg(ccn->dev, "No more event sources/watchpoints on node/XP %d!\n",
+                               node_xp);
+               clear_bit(hw->idx, ccn->dt.pmu_counters_mask);
+               return -EAGAIN;
+       }
+       hw->config_base = bit;
+
+       ccn->dt.pmu_counters[hw->idx].event = event;
+
+       return 0;
+}
+
+static void arm_ccn_pmu_event_release(struct perf_event *event)
 {
        struct arm_ccn *ccn = pmu_to_arm_ccn(event->pmu);
        struct hw_perf_event *hw = &event->hw;
@@ -616,15 +715,14 @@ static int arm_ccn_pmu_event_init(struct perf_event *event)
        struct arm_ccn *ccn;
        struct hw_perf_event *hw = &event->hw;
        u32 node_xp, type, event_id;
-       int valid, bit;
-       struct arm_ccn_component *source;
+       int valid;
        int i;
+       struct perf_event *sibling;
 
        if (event->attr.type != event->pmu->type)
                return -ENOENT;
 
        ccn = pmu_to_arm_ccn(event->pmu);
-       event->destroy = arm_ccn_pmu_event_destroy;
 
        if (hw->sample_period) {
                dev_warn(ccn->dev, "Sampling not supported!\n");
@@ -642,6 +740,16 @@ static int arm_ccn_pmu_event_init(struct perf_event *event)
                dev_warn(ccn->dev, "Can't provide per-task data!\n");
                return -EOPNOTSUPP;
        }
+       /*
+        * Many perf core operations (eg. events rotation) operate on a
+        * single CPU context. This is obvious for CPU PMUs, where one
+        * expects the same sets of events being observed on all CPUs,
+        * but can lead to issues for off-core PMUs, like CCN, where each
+        * event could be theoretically assigned to a different CPU. To
+        * mitigate this, we enforce CPU assignment to one, selected
+        * processor (the one described in the "cpumask" attribute).
+        */
+       event->cpu = cpumask_first(&ccn->dt.cpu);
 
        node_xp = CCN_CONFIG_NODE(event->attr.config);
        type = CCN_CONFIG_TYPE(event->attr.config);
@@ -711,48 +819,20 @@ static int arm_ccn_pmu_event_init(struct perf_event *event)
                                node_xp, type, port);
        }
 
-       /* Allocate the cycle counter */
-       if (type == CCN_TYPE_CYCLES) {
-               if (test_and_set_bit(CCN_IDX_PMU_CYCLE_COUNTER,
-                               ccn->dt.pmu_counters_mask))
-                       return -EAGAIN;
-
-               hw->idx = CCN_IDX_PMU_CYCLE_COUNTER;
-               ccn->dt.pmu_counters[CCN_IDX_PMU_CYCLE_COUNTER].event = event;
-
-               return 0;
-       }
-
-       /* Allocate an event counter */
-       hw->idx = arm_ccn_pmu_alloc_bit(ccn->dt.pmu_counters_mask,
-                       CCN_NUM_PMU_EVENT_COUNTERS);
-       if (hw->idx < 0) {
-               dev_warn(ccn->dev, "No more counters available!\n");
-               return -EAGAIN;
-       }
-
-       if (type == CCN_TYPE_XP)
-               source = &ccn->xp[node_xp];
-       else
-               source = &ccn->node[node_xp];
-       ccn->dt.pmu_counters[hw->idx].source = source;
-
-       /* Allocate an event source or a watchpoint */
-       if (type == CCN_TYPE_XP && event_id == CCN_EVENT_WATCHPOINT)
-               bit = arm_ccn_pmu_alloc_bit(source->xp.dt_cmp_mask,
-                               CCN_NUM_XP_WATCHPOINTS);
-       else
-               bit = arm_ccn_pmu_alloc_bit(source->pmu_events_mask,
-                               CCN_NUM_PMU_EVENTS);
-       if (bit < 0) {
-               dev_warn(ccn->dev, "No more event sources/watchpoints on node/XP %d!\n",
-                               node_xp);
-               clear_bit(hw->idx, ccn->dt.pmu_counters_mask);
-               return -EAGAIN;
-       }
-       hw->config_base = bit;
+       /*
+        * We must NOT create groups containing mixed PMUs, although software
+        * events are acceptable (for example to create a CCN group
+        * periodically read when a hrtimer aka cpu-clock leader triggers).
+        */
+       if (event->group_leader->pmu != event->pmu &&
+                       !is_software_event(event->group_leader))
+               return -EINVAL;
 
-       ccn->dt.pmu_counters[hw->idx].event = event;
+       list_for_each_entry(sibling, &event->group_leader->sibling_list,
+                       group_entry)
+               if (sibling->pmu != event->pmu &&
+                               !is_software_event(sibling))
+                       return -EINVAL;
 
        return 0;
 }
@@ -835,9 +915,14 @@ static void arm_ccn_pmu_event_start(struct perf_event *event, int flags)
                        arm_ccn_pmu_read_counter(ccn, hw->idx));
        hw->state = 0;
 
-       if (!ccn->irq_used)
+       /*
+        * Pin the timer, so that the overflows are handled by the chosen
+        * event->cpu (this is the same one as presented in "cpumask"
+        * attribute).
+        */
+       if (!ccn->irq)
                hrtimer_start(&ccn->dt.hrtimer, arm_ccn_pmu_timer_period(),
-                               HRTIMER_MODE_REL);
+                               HRTIMER_MODE_REL_PINNED);
 
        /* Set the DT bus input, engaging the counter */
        arm_ccn_pmu_xp_dt_config(event, 1);
@@ -852,7 +937,7 @@ static void arm_ccn_pmu_event_stop(struct perf_event *event, int flags)
        /* Disable counting, setting the DT bus to pass-through mode */
        arm_ccn_pmu_xp_dt_config(event, 0);
 
-       if (!ccn->irq_used)
+       if (!ccn->irq)
                hrtimer_cancel(&ccn->dt.hrtimer);
 
        /* Let the DT bus drain */
@@ -1014,8 +1099,13 @@ static void arm_ccn_pmu_event_config(struct perf_event *event)
 
 static int arm_ccn_pmu_event_add(struct perf_event *event, int flags)
 {
+       int err;
        struct hw_perf_event *hw = &event->hw;
 
+       err = arm_ccn_pmu_event_alloc(event);
+       if (err)
+               return err;
+
        arm_ccn_pmu_event_config(event);
 
        hw->state = PERF_HES_STOPPED;
@@ -1029,6 +1119,8 @@ static int arm_ccn_pmu_event_add(struct perf_event *event, int flags)
 static void arm_ccn_pmu_event_del(struct perf_event *event, int flags)
 {
        arm_ccn_pmu_event_stop(event, PERF_EF_UPDATE);
+
+       arm_ccn_pmu_event_release(event);
 }
 
 static void arm_ccn_pmu_event_read(struct perf_event *event)
@@ -1079,12 +1171,39 @@ static enum hrtimer_restart arm_ccn_pmu_timer_handler(struct hrtimer *hrtimer)
 }
 
 
+static int arm_ccn_pmu_cpu_notifier(struct notifier_block *nb,
+               unsigned long action, void *hcpu)
+{
+       struct arm_ccn_dt *dt = container_of(nb, struct arm_ccn_dt, cpu_nb);
+       struct arm_ccn *ccn = container_of(dt, struct arm_ccn, dt);
+       unsigned int cpu = (long)hcpu; /* for (long) see kernel/cpu.c */
+       unsigned int target;
+
+       switch (action & ~CPU_TASKS_FROZEN) {
+       case CPU_DOWN_PREPARE:
+               if (!cpumask_test_and_clear_cpu(cpu, &dt->cpu))
+                       break;
+               target = cpumask_any_but(cpu_online_mask, cpu);
+               if (target < 0)
+                       break;
+               perf_pmu_migrate_context(&dt->pmu, cpu, target);
+               cpumask_set_cpu(target, &dt->cpu);
+               WARN_ON(irq_set_affinity(ccn->irq, &dt->cpu) != 0);
+       default:
+               break;
+       }
+
+       return NOTIFY_OK;
+}
+
+
 static DEFINE_IDA(arm_ccn_pmu_ida);
 
 static int arm_ccn_pmu_init(struct arm_ccn *ccn)
 {
        int i;
        char *name;
+       int err;
 
        /* Initialize DT subsystem */
        ccn->dt.base = ccn->base + CCN_REGION_SIZE;
@@ -1136,20 +1255,58 @@ static int arm_ccn_pmu_init(struct arm_ccn *ccn)
        };
 
        /* No overflow interrupt? Have to use a timer instead. */
-       if (!ccn->irq_used) {
+       if (!ccn->irq) {
                dev_info(ccn->dev, "No access to interrupts, using timer.\n");
                hrtimer_init(&ccn->dt.hrtimer, CLOCK_MONOTONIC,
                                HRTIMER_MODE_REL);
                ccn->dt.hrtimer.function = arm_ccn_pmu_timer_handler;
        }
 
-       return perf_pmu_register(&ccn->dt.pmu, name, -1);
+       /* Pick one CPU which we will use to collect data from CCN... */
+       cpumask_set_cpu(smp_processor_id(), &ccn->dt.cpu);
+
+       /*
+        * ... and change the selection when it goes offline. Priority is
+        * picked to have a chance to migrate events before perf is notified.
+        */
+       ccn->dt.cpu_nb.notifier_call = arm_ccn_pmu_cpu_notifier;
+       ccn->dt.cpu_nb.priority = CPU_PRI_PERF + 1,
+       err = register_cpu_notifier(&ccn->dt.cpu_nb);
+       if (err)
+               goto error_cpu_notifier;
+
+       /* Also make sure that the overflow interrupt is handled by this CPU */
+       if (ccn->irq) {
+               err = irq_set_affinity(ccn->irq, &ccn->dt.cpu);
+               if (err) {
+                       dev_err(ccn->dev, "Failed to set interrupt affinity!\n");
+                       goto error_set_affinity;
+               }
+       }
+
+       err = perf_pmu_register(&ccn->dt.pmu, name, -1);
+       if (err)
+               goto error_pmu_register;
+
+       return 0;
+
+error_pmu_register:
+error_set_affinity:
+       unregister_cpu_notifier(&ccn->dt.cpu_nb);
+error_cpu_notifier:
+       ida_simple_remove(&arm_ccn_pmu_ida, ccn->dt.id);
+       for (i = 0; i < ccn->num_xps; i++)
+               writel(0, ccn->xp[i].base + CCN_XP_DT_CONTROL);
+       writel(0, ccn->dt.base + CCN_DT_PMCR);
+       return err;
 }
 
 static void arm_ccn_pmu_cleanup(struct arm_ccn *ccn)
 {
        int i;
 
+       irq_set_affinity(ccn->irq, cpu_possible_mask);
+       unregister_cpu_notifier(&ccn->dt.cpu_nb);
        for (i = 0; i < ccn->num_xps; i++)
                writel(0, ccn->xp[i].base + CCN_XP_DT_CONTROL);
        writel(0, ccn->dt.base + CCN_DT_PMCR);
@@ -1285,6 +1442,7 @@ static int arm_ccn_probe(struct platform_device *pdev)
 {
        struct arm_ccn *ccn;
        struct resource *res;
+       unsigned int irq;
        int err;
 
        ccn = devm_kzalloc(&pdev->dev, sizeof(*ccn), GFP_KERNEL);
@@ -1309,6 +1467,7 @@ static int arm_ccn_probe(struct platform_device *pdev)
        res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
        if (!res)
                return -EINVAL;
+       irq = res->start;
 
        /* Check if we can use the interrupt */
        writel(CCN_MN_ERRINT_STATUS__PMU_EVENTS__DISABLE,
@@ -1318,13 +1477,12 @@ static int arm_ccn_probe(struct platform_device *pdev)
                /* Can set 'disable' bits, so can acknowledge interrupts */
                writel(CCN_MN_ERRINT_STATUS__PMU_EVENTS__ENABLE,
                                ccn->base + CCN_MN_ERRINT_STATUS);
-               err = devm_request_irq(ccn->dev, res->start,
-                               arm_ccn_irq_handler, 0, dev_name(ccn->dev),
-                               ccn);
+               err = devm_request_irq(ccn->dev, irq, arm_ccn_irq_handler, 0,
+                               dev_name(ccn->dev), ccn);
                if (err)
                        return err;
 
-               ccn->irq_used = 1;
+               ccn->irq = irq;
        }
 
 
index 738612c45266c1b11f1319ae95275dcc881b8590..f364fa4d24ebffa8b9021036b3e3f22d0018da40 100644 (file)
@@ -91,6 +91,7 @@ static const int gisb_offsets_bcm7445[] = {
 struct brcmstb_gisb_arb_device {
        void __iomem    *base;
        const int       *gisb_offsets;
+       bool            big_endian;
        struct mutex    lock;
        struct list_head next;
        u32 valid_mask;
@@ -108,7 +109,10 @@ static u32 gisb_read(struct brcmstb_gisb_arb_device *gdev, int reg)
        if (offset == -1)
                return 1;
 
-       return ioread32(gdev->base + offset);
+       if (gdev->big_endian)
+               return ioread32be(gdev->base + offset);
+       else
+               return ioread32(gdev->base + offset);
 }
 
 static void gisb_write(struct brcmstb_gisb_arb_device *gdev, u32 val, int reg)
@@ -117,7 +121,11 @@ static void gisb_write(struct brcmstb_gisb_arb_device *gdev, u32 val, int reg)
 
        if (offset == -1)
                return;
-       iowrite32(val, gdev->base + reg);
+
+       if (gdev->big_endian)
+               iowrite32be(val, gdev->base + reg);
+       else
+               iowrite32(val, gdev->base + reg);
 }
 
 static ssize_t gisb_arb_get_timeout(struct device *dev,
@@ -296,6 +304,7 @@ static int __init brcmstb_gisb_arb_probe(struct platform_device *pdev)
                return -EINVAL;
        }
        gdev->gisb_offsets = of_id->data;
+       gdev->big_endian = of_device_is_big_endian(dn);
 
        err = devm_request_irq(&pdev->dev, timeout_irq,
                                brcmstb_gisb_timeout_handler, 0, pdev->name,
index fb9ec6221730a2d594f66d15e54471aea75cc750..c43c3d2baf73c2e7663d367ad35aa97be8c6ba33 100644 (file)
@@ -57,8 +57,8 @@
 #include <linux/of_address.h>
 #include <linux/debugfs.h>
 #include <linux/log2.h>
-#include <linux/syscore_ops.h>
 #include <linux/memblock.h>
+#include <linux/syscore_ops.h>
 
 /*
  * DDR target is the same on all platforms.
@@ -70,6 +70,7 @@
  */
 #define WIN_CTRL_OFF           0x0000
 #define   WIN_CTRL_ENABLE       BIT(0)
+/* Only on HW I/O coherency capable platforms */
 #define   WIN_CTRL_SYNCBARRIER  BIT(1)
 #define   WIN_CTRL_TGT_MASK     0xf0
 #define   WIN_CTRL_TGT_SHIFT    4
 
 /* Relative to mbusbridge_base */
 #define MBUS_BRIDGE_CTRL_OFF   0x0
-#define  MBUS_BRIDGE_SIZE_MASK  0xffff0000
 #define MBUS_BRIDGE_BASE_OFF   0x4
-#define  MBUS_BRIDGE_BASE_MASK  0xffff0000
 
 /* Maximum number of windows, for all known platforms */
 #define MBUS_WINS_MAX           20
@@ -154,13 +153,39 @@ struct mvebu_mbus_state {
 
 static struct mvebu_mbus_state mbus_state;
 
+/*
+ * We provide two variants of the mv_mbus_dram_info() function:
+ *
+ * - The normal one, where the described DRAM ranges may overlap with
+ *   the I/O windows, but for which the DRAM ranges are guaranteed to
+ *   have a power of two size. Such ranges are suitable for the DMA
+ *   masters that only DMA between the RAM and the device, which is
+ *   actually all devices except the crypto engines.
+ *
+ * - The 'nooverlap' one, where the described DRAM ranges are
+ *   guaranteed to not overlap with the I/O windows, but for which the
+ *   DRAM ranges will not have power of two sizes. They will only be
+ *   aligned on a 64 KB boundary, and have a size multiple of 64
+ *   KB. Such ranges are suitable for the DMA masters that DMA between
+ *   the crypto SRAM (which is mapped through an I/O window) and a
+ *   device. This is the case for the crypto engines.
+ */
+
 static struct mbus_dram_target_info mvebu_mbus_dram_info;
+static struct mbus_dram_target_info mvebu_mbus_dram_info_nooverlap;
+
 const struct mbus_dram_target_info *mv_mbus_dram_info(void)
 {
        return &mvebu_mbus_dram_info;
 }
 EXPORT_SYMBOL_GPL(mv_mbus_dram_info);
 
+const struct mbus_dram_target_info *mv_mbus_dram_info_nooverlap(void)
+{
+       return &mvebu_mbus_dram_info_nooverlap;
+}
+EXPORT_SYMBOL_GPL(mv_mbus_dram_info_nooverlap);
+
 /* Checks whether the given window has remap capability */
 static bool mvebu_mbus_window_is_remappable(struct mvebu_mbus_state *mbus,
                                            const int win)
@@ -323,8 +348,9 @@ static int mvebu_mbus_setup_window(struct mvebu_mbus_state *mbus,
        ctrl = ((size - 1) & WIN_CTRL_SIZE_MASK) |
                (attr << WIN_CTRL_ATTR_SHIFT)    |
                (target << WIN_CTRL_TGT_SHIFT)   |
-               WIN_CTRL_SYNCBARRIER             |
                WIN_CTRL_ENABLE;
+       if (mbus->hw_io_coherency)
+               ctrl |= WIN_CTRL_SYNCBARRIER;
 
        writel(base & WIN_BASE_LOW, addr + WIN_BASE_OFF);
        writel(ctrl, addr + WIN_CTRL_OFF);
@@ -592,7 +618,7 @@ mvebu_mbus_find_bridge_hole(uint64_t *start, uint64_t *end)
                 * This part of the memory is above 4 GB, so we don't
                 * care for the MBus bridge hole.
                 */
-               if (r->base >= 0x100000000)
+               if (r->base >= 0x100000000ULL)
                        continue;
 
                /*
@@ -604,49 +630,32 @@ mvebu_mbus_find_bridge_hole(uint64_t *start, uint64_t *end)
        }
 
        *start = s;
-       *end = 0x100000000;
+       *end = 0x100000000ULL;
 }
 
+/*
+ * This function fills in the mvebu_mbus_dram_info_nooverlap data
+ * structure, by looking at the mvebu_mbus_dram_info data, and
+ * removing the parts of it that overlap with I/O windows.
+ */
 static void __init
-mvebu_mbus_default_setup_cpu_target(struct mvebu_mbus_state *mbus)
+mvebu_mbus_setup_cpu_target_nooverlap(struct mvebu_mbus_state *mbus)
 {
-       int i;
-       int cs;
        uint64_t mbus_bridge_base, mbus_bridge_end;
-
-       mvebu_mbus_dram_info.mbus_dram_target_id = TARGET_DDR;
+       int cs_nooverlap = 0;
+       int i;
 
        mvebu_mbus_find_bridge_hole(&mbus_bridge_base, &mbus_bridge_end);
 
-       for (i = 0, cs = 0; i < 4; i++) {
-               u64 base = readl(mbus->sdramwins_base + DDR_BASE_CS_OFF(i));
-               u64 size = readl(mbus->sdramwins_base + DDR_SIZE_CS_OFF(i));
-               u64 end;
+       for (i = 0; i < mvebu_mbus_dram_info.num_cs; i++) {
                struct mbus_dram_window *w;
+               u64 base, size, end;
 
-               /* Ignore entries that are not enabled */
-               if (!(size & DDR_SIZE_ENABLED))
-                       continue;
-
-               /*
-                * Ignore entries whose base address is above 2^32,
-                * since devices cannot DMA to such high addresses
-                */
-               if (base & DDR_BASE_CS_HIGH_MASK)
-                       continue;
-
-               base = base & DDR_BASE_CS_LOW_MASK;
-               size = (size | ~DDR_SIZE_MASK) + 1;
+               w = &mvebu_mbus_dram_info.cs[i];
+               base = w->base;
+               size = w->size;
                end = base + size;
 
-               /*
-                * Adjust base/size of the current CS to make sure it
-                * doesn't overlap with the MBus bridge hole. This is
-                * particularly important for devices that do DMA from
-                * DRAM to a SRAM mapped in a MBus window, such as the
-                * CESA cryptographic engine.
-                */
-
                /*
                 * The CS is fully enclosed inside the MBus bridge
                 * area, so ignore it.
@@ -670,7 +679,7 @@ mvebu_mbus_default_setup_cpu_target(struct mvebu_mbus_state *mbus)
                if (base < mbus_bridge_base && end > mbus_bridge_base)
                        size -= end - mbus_bridge_base;
 
-               w = &mvebu_mbus_dram_info.cs[cs++];
+               w = &mvebu_mbus_dram_info_nooverlap.cs[cs_nooverlap++];
                w->cs_index = i;
                w->mbus_attr = 0xf & ~(1 << i);
                if (mbus->hw_io_coherency)
@@ -678,6 +687,42 @@ mvebu_mbus_default_setup_cpu_target(struct mvebu_mbus_state *mbus)
                w->base = base;
                w->size = size;
        }
+
+       mvebu_mbus_dram_info_nooverlap.mbus_dram_target_id = TARGET_DDR;
+       mvebu_mbus_dram_info_nooverlap.num_cs = cs_nooverlap;
+}
+
+static void __init
+mvebu_mbus_default_setup_cpu_target(struct mvebu_mbus_state *mbus)
+{
+       int i;
+       int cs;
+
+       mvebu_mbus_dram_info.mbus_dram_target_id = TARGET_DDR;
+
+       for (i = 0, cs = 0; i < 4; i++) {
+               u32 base = readl(mbus->sdramwins_base + DDR_BASE_CS_OFF(i));
+               u32 size = readl(mbus->sdramwins_base + DDR_SIZE_CS_OFF(i));
+
+               /*
+                * We only take care of entries for which the chip
+                * select is enabled, and that don't have high base
+                * address bits set (devices can only access the first
+                * 32 bits of the memory).
+                */
+               if ((size & DDR_SIZE_ENABLED) &&
+                   !(base & DDR_BASE_CS_HIGH_MASK)) {
+                       struct mbus_dram_window *w;
+
+                       w = &mvebu_mbus_dram_info.cs[cs++];
+                       w->cs_index = i;
+                       w->mbus_attr = 0xf & ~(1 << i);
+                       if (mbus->hw_io_coherency)
+                               w->mbus_attr |= ATTR_HW_COHERENCY;
+                       w->base = base & DDR_BASE_CS_LOW_MASK;
+                       w->size = (size | ~DDR_SIZE_MASK) + 1;
+               }
+       }
        mvebu_mbus_dram_info.num_cs = cs;
 }
 
@@ -1035,6 +1080,7 @@ static int __init mvebu_mbus_common_init(struct mvebu_mbus_state *mbus,
                mvebu_mbus_disable_window(mbus, win);
 
        mbus->soc->setup_cpu_target(mbus);
+       mvebu_mbus_setup_cpu_target_nooverlap(mbus);
 
        if (is_coherent)
                writel(UNIT_SYNC_BARRIER_ALL,
index 3d00c25382c53b02e9d461437aa38c5eea77b090..4dcbdd36f24eb552412310c78a482f38e013edcb 100644 (file)
@@ -50,6 +50,7 @@ obj-$(CONFIG_ARCH_BERLIN)             += berlin/
 obj-$(CONFIG_ARCH_HI3xxx)              += hisilicon/
 obj-$(CONFIG_ARCH_HIP04)               += hisilicon/
 obj-$(CONFIG_ARCH_HIX5HD2)             += hisilicon/
+obj-$(CONFIG_ARCH_MXC)                 += imx/
 obj-$(CONFIG_COMMON_CLK_KEYSTONE)      += keystone/
 ifeq ($(CONFIG_COMMON_CLK), y)
 obj-$(CONFIG_ARCH_MMP)                 += mmp/
@@ -72,4 +73,5 @@ obj-$(CONFIG_ARCH_OMAP2PLUS)          += ti/
 obj-$(CONFIG_ARCH_U8500)               += ux500/
 obj-$(CONFIG_COMMON_CLK_VERSATILE)     += versatile/
 obj-$(CONFIG_X86)                      += x86/
+obj-$(CONFIG_ARCH_ZX)                  += zte/
 obj-$(CONFIG_ARCH_ZYNQ)                        += zynq/
index 597fed423d7d31906b1ca37f3fa9931231a63460..df2c1afa52b4acaa6204d5595a76c65f7dc0cb70 100644 (file)
@@ -29,7 +29,7 @@
 #define PERIPHERAL_RSHIFT_MASK 0x3
 #define PERIPHERAL_RSHIFT(val) (((val) >> 16) & PERIPHERAL_RSHIFT_MASK)
 
-#define PERIPHERAL_MAX_SHIFT   4
+#define PERIPHERAL_MAX_SHIFT   3
 
 struct clk_peripheral {
        struct clk_hw hw;
@@ -242,7 +242,7 @@ static long clk_sam9x5_peripheral_round_rate(struct clk_hw *hw,
                return *parent_rate;
 
        if (periph->range.max) {
-               for (; shift < PERIPHERAL_MAX_SHIFT; shift++) {
+               for (; shift <= PERIPHERAL_MAX_SHIFT; shift++) {
                        cur_rate = *parent_rate >> shift;
                        if (cur_rate <= periph->range.max)
                                break;
@@ -254,7 +254,7 @@ static long clk_sam9x5_peripheral_round_rate(struct clk_hw *hw,
 
        best_diff = cur_rate - rate;
        best_rate = cur_rate;
-       for (; shift < PERIPHERAL_MAX_SHIFT; shift++) {
+       for (; shift <= PERIPHERAL_MAX_SHIFT; shift++) {
                cur_rate = *parent_rate >> shift;
                if (cur_rate < rate)
                        cur_diff = rate - cur_rate;
@@ -289,7 +289,7 @@ static int clk_sam9x5_peripheral_set_rate(struct clk_hw *hw,
        if (periph->range.max && rate > periph->range.max)
                return -EINVAL;
 
-       for (shift = 0; shift < PERIPHERAL_MAX_SHIFT; shift++) {
+       for (shift = 0; shift <= PERIPHERAL_MAX_SHIFT; shift++) {
                if (parent_rate >> shift == rate) {
                        periph->auto_div = false;
                        periph->div = shift;
index 6ec79dbc0840ad8940e9e9ab599a0f865f1cd881..cbbe40377ad622a7f9d38aca5651916dda549e54 100644 (file)
@@ -173,8 +173,7 @@ static long clk_pll_get_best_div_mul(struct clk_pll *pll, unsigned long rate,
        int i = 0;
 
        /* Check if parent_rate is a valid input rate */
-       if (parent_rate < characteristics->input.min ||
-           parent_rate > characteristics->input.max)
+       if (parent_rate < characteristics->input.min)
                return -ERANGE;
 
        /*
@@ -187,6 +186,15 @@ static long clk_pll_get_best_div_mul(struct clk_pll *pll, unsigned long rate,
        if (!mindiv)
                mindiv = 1;
 
+       if (parent_rate > characteristics->input.max) {
+               tmpdiv = DIV_ROUND_UP(parent_rate, characteristics->input.max);
+               if (tmpdiv > PLL_DIV_MAX)
+                       return -ERANGE;
+
+               if (tmpdiv > mindiv)
+                       mindiv = tmpdiv;
+       }
+
        /*
         * Calculate the maximum divider which is limited by PLL register
         * layout (limited by the MUL or DIV field size).
index 69abb08cf146513b0307a4a78449b2e5da971282..eb8e5dc9076d46f07901a98db214fbeec0b0a3dc 100644 (file)
@@ -121,7 +121,7 @@ extern void __init of_at91sam9x5_clk_smd_setup(struct device_node *np,
                                               struct at91_pmc *pmc);
 #endif
 
-#if defined(CONFIG_HAVE_AT91_SMD)
+#if defined(CONFIG_HAVE_AT91_H32MX)
 extern void __init of_sama5d4_clk_h32mx_setup(struct device_node *np,
                                              struct at91_pmc *pmc);
 #endif
index 515fb133495cc9a7cfafdccd815cffef8ec39767..73153fc45ee93067562732b66dd93da201a791b4 100644 (file)
@@ -502,12 +502,13 @@ static const struct berlin2_gate_data bg2_gates[] __initconst = {
 
 static void __init berlin2_clock_setup(struct device_node *np)
 {
+       struct device_node *parent_np = of_get_parent(np);
        const char *parent_names[9];
        struct clk *clk;
        u8 avpll_flags = 0;
        int n;
 
-       gbase = of_iomap(np, 0);
+       gbase = of_iomap(parent_np, 0);
        if (!gbase)
                return;
 
@@ -685,7 +686,5 @@ static void __init berlin2_clock_setup(struct device_node *np)
 bg2_fail:
        iounmap(gbase);
 }
-CLK_OF_DECLARE(berlin2_clock, "marvell,berlin2-chip-ctrl",
-              berlin2_clock_setup);
-CLK_OF_DECLARE(berlin2cd_clock, "marvell,berlin2cd-chip-ctrl",
+CLK_OF_DECLARE(berlin2_clk, "marvell,berlin2-clk",
               berlin2_clock_setup);
index 440ef81ab15c4ba8d9f70947db7e5a0d144a97a4..221f40c2b850c1fafc1143e7f5b4458ecad55982 100644 (file)
@@ -290,18 +290,19 @@ static const struct berlin2_gate_data bg2q_gates[] __initconst = {
 
 static void __init berlin2q_clock_setup(struct device_node *np)
 {
+       struct device_node *parent_np = of_get_parent(np);
        const char *parent_names[9];
        struct clk *clk;
        int n;
 
-       gbase = of_iomap(np, 0);
+       gbase = of_iomap(parent_np, 0);
        if (!gbase) {
                pr_err("%s: Unable to map global base\n", np->full_name);
                return;
        }
 
        /* BG2Q CPU PLL is not part of global registers */
-       cpupll_base = of_iomap(np, 1);
+       cpupll_base = of_iomap(parent_np, 1);
        if (!cpupll_base) {
                pr_err("%s: Unable to map cpupll base\n", np->full_name);
                iounmap(gbase);
@@ -384,5 +385,5 @@ bg2q_fail:
        iounmap(cpupll_base);
        iounmap(gbase);
 }
-CLK_OF_DECLARE(berlin2q_clock, "marvell,berlin2q-chip-ctrl",
+CLK_OF_DECLARE(berlin2q_clk, "marvell,berlin2q-clk",
               berlin2q_clock_setup);
diff --git a/drivers/clk/imx/Makefile b/drivers/clk/imx/Makefile
new file mode 100644 (file)
index 0000000..75fae16
--- /dev/null
@@ -0,0 +1,26 @@
+
+obj-y += \
+       clk.o \
+       clk-busy.o \
+       clk-cpu.o \
+       clk-fixup-div.o \
+       clk-fixup-mux.o \
+       clk-gate-exclusive.o \
+       clk-gate2.o \
+       clk-pllv1.o \
+       clk-pllv2.o \
+       clk-pllv3.o \
+       clk-pfd.o
+
+obj-$(CONFIG_SOC_IMX1)   += clk-imx1.o
+obj-$(CONFIG_SOC_IMX21)  += clk-imx21.o
+obj-$(CONFIG_SOC_IMX25)  += clk-imx25.o
+obj-$(CONFIG_SOC_IMX27)  += clk-imx27.o
+obj-$(CONFIG_SOC_IMX31)  += clk-imx31.o
+obj-$(CONFIG_SOC_IMX35)  += clk-imx35.o
+obj-$(CONFIG_SOC_IMX5)   += clk-imx51-imx53.o
+obj-$(CONFIG_SOC_IMX6Q)  += clk-imx6q.o
+obj-$(CONFIG_SOC_IMX6SL) += clk-imx6sl.o
+obj-$(CONFIG_SOC_IMX6SX) += clk-imx6sx.o
+obj-$(CONFIG_SOC_IMX7D)  += clk-imx7d.o
+obj-$(CONFIG_SOC_VF610)  += clk-vf610.o
diff --git a/drivers/clk/imx/clk-busy.c b/drivers/clk/imx/clk-busy.c
new file mode 100644 (file)
index 0000000..4bb1bc4
--- /dev/null
@@ -0,0 +1,189 @@
+/*
+ * Copyright 2012 Freescale Semiconductor, Inc.
+ * Copyright 2012 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:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+#include <linux/clk.h>
+#include <linux/clk-provider.h>
+#include <linux/io.h>
+#include <linux/slab.h>
+#include <linux/jiffies.h>
+#include <linux/err.h>
+#include "clk.h"
+
+static int clk_busy_wait(void __iomem *reg, u8 shift)
+{
+       unsigned long timeout = jiffies + msecs_to_jiffies(10);
+
+       while (readl_relaxed(reg) & (1 << shift))
+               if (time_after(jiffies, timeout))
+                       return -ETIMEDOUT;
+
+       return 0;
+}
+
+struct clk_busy_divider {
+       struct clk_divider div;
+       const struct clk_ops *div_ops;
+       void __iomem *reg;
+       u8 shift;
+};
+
+static inline struct clk_busy_divider *to_clk_busy_divider(struct clk_hw *hw)
+{
+       struct clk_divider *div = container_of(hw, struct clk_divider, hw);
+
+       return container_of(div, struct clk_busy_divider, div);
+}
+
+static unsigned long clk_busy_divider_recalc_rate(struct clk_hw *hw,
+                                                 unsigned long parent_rate)
+{
+       struct clk_busy_divider *busy = to_clk_busy_divider(hw);
+
+       return busy->div_ops->recalc_rate(&busy->div.hw, parent_rate);
+}
+
+static long clk_busy_divider_round_rate(struct clk_hw *hw, unsigned long rate,
+                                       unsigned long *prate)
+{
+       struct clk_busy_divider *busy = to_clk_busy_divider(hw);
+
+       return busy->div_ops->round_rate(&busy->div.hw, rate, prate);
+}
+
+static int clk_busy_divider_set_rate(struct clk_hw *hw, unsigned long rate,
+               unsigned long parent_rate)
+{
+       struct clk_busy_divider *busy = to_clk_busy_divider(hw);
+       int ret;
+
+       ret = busy->div_ops->set_rate(&busy->div.hw, rate, parent_rate);
+       if (!ret)
+               ret = clk_busy_wait(busy->reg, busy->shift);
+
+       return ret;
+}
+
+static struct clk_ops clk_busy_divider_ops = {
+       .recalc_rate = clk_busy_divider_recalc_rate,
+       .round_rate = clk_busy_divider_round_rate,
+       .set_rate = clk_busy_divider_set_rate,
+};
+
+struct clk *imx_clk_busy_divider(const char *name, const char *parent_name,
+                                void __iomem *reg, u8 shift, u8 width,
+                                void __iomem *busy_reg, u8 busy_shift)
+{
+       struct clk_busy_divider *busy;
+       struct clk *clk;
+       struct clk_init_data init;
+
+       busy = kzalloc(sizeof(*busy), GFP_KERNEL);
+       if (!busy)
+               return ERR_PTR(-ENOMEM);
+
+       busy->reg = busy_reg;
+       busy->shift = busy_shift;
+
+       busy->div.reg = reg;
+       busy->div.shift = shift;
+       busy->div.width = width;
+       busy->div.lock = &imx_ccm_lock;
+       busy->div_ops = &clk_divider_ops;
+
+       init.name = name;
+       init.ops = &clk_busy_divider_ops;
+       init.flags = CLK_SET_RATE_PARENT;
+       init.parent_names = &parent_name;
+       init.num_parents = 1;
+
+       busy->div.hw.init = &init;
+
+       clk = clk_register(NULL, &busy->div.hw);
+       if (IS_ERR(clk))
+               kfree(busy);
+
+       return clk;
+}
+
+struct clk_busy_mux {
+       struct clk_mux mux;
+       const struct clk_ops *mux_ops;
+       void __iomem *reg;
+       u8 shift;
+};
+
+static inline struct clk_busy_mux *to_clk_busy_mux(struct clk_hw *hw)
+{
+       struct clk_mux *mux = container_of(hw, struct clk_mux, hw);
+
+       return container_of(mux, struct clk_busy_mux, mux);
+}
+
+static u8 clk_busy_mux_get_parent(struct clk_hw *hw)
+{
+       struct clk_busy_mux *busy = to_clk_busy_mux(hw);
+
+       return busy->mux_ops->get_parent(&busy->mux.hw);
+}
+
+static int clk_busy_mux_set_parent(struct clk_hw *hw, u8 index)
+{
+       struct clk_busy_mux *busy = to_clk_busy_mux(hw);
+       int ret;
+
+       ret = busy->mux_ops->set_parent(&busy->mux.hw, index);
+       if (!ret)
+               ret = clk_busy_wait(busy->reg, busy->shift);
+
+       return ret;
+}
+
+static struct clk_ops clk_busy_mux_ops = {
+       .get_parent = clk_busy_mux_get_parent,
+       .set_parent = clk_busy_mux_set_parent,
+};
+
+struct clk *imx_clk_busy_mux(const char *name, void __iomem *reg, u8 shift,
+                            u8 width, void __iomem *busy_reg, u8 busy_shift,
+                            const char **parent_names, int num_parents)
+{
+       struct clk_busy_mux *busy;
+       struct clk *clk;
+       struct clk_init_data init;
+
+       busy = kzalloc(sizeof(*busy), GFP_KERNEL);
+       if (!busy)
+               return ERR_PTR(-ENOMEM);
+
+       busy->reg = busy_reg;
+       busy->shift = busy_shift;
+
+       busy->mux.reg = reg;
+       busy->mux.shift = shift;
+       busy->mux.mask = BIT(width) - 1;
+       busy->mux.lock = &imx_ccm_lock;
+       busy->mux_ops = &clk_mux_ops;
+
+       init.name = name;
+       init.ops = &clk_busy_mux_ops;
+       init.flags = 0;
+       init.parent_names = parent_names;
+       init.num_parents = num_parents;
+
+       busy->mux.hw.init = &init;
+
+       clk = clk_register(NULL, &busy->mux.hw);
+       if (IS_ERR(clk))
+               kfree(busy);
+
+       return clk;
+}
diff --git a/drivers/clk/imx/clk-cpu.c b/drivers/clk/imx/clk-cpu.c
new file mode 100644 (file)
index 0000000..9d46eac
--- /dev/null
@@ -0,0 +1,108 @@
+/*
+ * Copyright (c) 2014 Lucas Stach <l.stach@pengutronix.de>, Pengutronix
+ *
+ * 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.
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+#include <linux/clk.h>
+#include <linux/clk-provider.h>
+#include <linux/slab.h>
+#include "clk.h"
+
+struct clk_cpu {
+       struct clk_hw   hw;
+       struct clk      *div;
+       struct clk      *mux;
+       struct clk      *pll;
+       struct clk      *step;
+};
+
+static inline struct clk_cpu *to_clk_cpu(struct clk_hw *hw)
+{
+       return container_of(hw, struct clk_cpu, hw);
+}
+
+static unsigned long clk_cpu_recalc_rate(struct clk_hw *hw,
+                                        unsigned long parent_rate)
+{
+       struct clk_cpu *cpu = to_clk_cpu(hw);
+
+       return clk_get_rate(cpu->div);
+}
+
+static long clk_cpu_round_rate(struct clk_hw *hw, unsigned long rate,
+                              unsigned long *prate)
+{
+       struct clk_cpu *cpu = to_clk_cpu(hw);
+
+       return clk_round_rate(cpu->pll, rate);
+}
+
+static int clk_cpu_set_rate(struct clk_hw *hw, unsigned long rate,
+                           unsigned long parent_rate)
+{
+       struct clk_cpu *cpu = to_clk_cpu(hw);
+       int ret;
+
+       /* switch to PLL bypass clock */
+       ret = clk_set_parent(cpu->mux, cpu->step);
+       if (ret)
+               return ret;
+
+       /* reprogram PLL */
+       ret = clk_set_rate(cpu->pll, rate);
+       if (ret) {
+               clk_set_parent(cpu->mux, cpu->pll);
+               return ret;
+       }
+       /* switch back to PLL clock */
+       clk_set_parent(cpu->mux, cpu->pll);
+
+       /* Ensure the divider is what we expect */
+       clk_set_rate(cpu->div, rate);
+
+       return 0;
+}
+
+static const struct clk_ops clk_cpu_ops = {
+       .recalc_rate    = clk_cpu_recalc_rate,
+       .round_rate     = clk_cpu_round_rate,
+       .set_rate       = clk_cpu_set_rate,
+};
+
+struct clk *imx_clk_cpu(const char *name, const char *parent_name,
+               struct clk *div, struct clk *mux, struct clk *pll,
+               struct clk *step)
+{
+       struct clk_cpu *cpu;
+       struct clk *clk;
+       struct clk_init_data init;
+
+       cpu = kzalloc(sizeof(*cpu), GFP_KERNEL);
+       if (!cpu)
+               return ERR_PTR(-ENOMEM);
+
+       cpu->div = div;
+       cpu->mux = mux;
+       cpu->pll = pll;
+       cpu->step = step;
+
+       init.name = name;
+       init.ops = &clk_cpu_ops;
+       init.flags = 0;
+       init.parent_names = &parent_name;
+       init.num_parents = 1;
+
+       cpu->hw.init = &init;
+
+       clk = clk_register(NULL, &cpu->hw);
+       if (IS_ERR(clk))
+               kfree(cpu);
+
+       return clk;
+}
diff --git a/drivers/clk/imx/clk-fixup-div.c b/drivers/clk/imx/clk-fixup-div.c
new file mode 100644 (file)
index 0000000..21db020
--- /dev/null
@@ -0,0 +1,129 @@
+/*
+ * Copyright (C) 2013 Freescale Semiconductor, Inc.
+ *
+ * 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:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+#include <linux/clk-provider.h>
+#include <linux/err.h>
+#include <linux/io.h>
+#include <linux/slab.h>
+#include "clk.h"
+
+#define to_clk_div(_hw) container_of(_hw, struct clk_divider, hw)
+#define div_mask(d)    ((1 << (d->width)) - 1)
+
+/**
+ * struct clk_fixup_div - imx integer fixup divider clock
+ * @divider: the parent class
+ * @ops: pointer to clk_ops of parent class
+ * @fixup: a hook to fixup the write value
+ *
+ * The imx fixup divider clock is a subclass of basic clk_divider
+ * with an addtional fixup hook.
+ */
+struct clk_fixup_div {
+       struct clk_divider divider;
+       const struct clk_ops *ops;
+       void (*fixup)(u32 *val);
+};
+
+static inline struct clk_fixup_div *to_clk_fixup_div(struct clk_hw *hw)
+{
+       struct clk_divider *divider = to_clk_div(hw);
+
+       return container_of(divider, struct clk_fixup_div, divider);
+}
+
+static unsigned long clk_fixup_div_recalc_rate(struct clk_hw *hw,
+                                        unsigned long parent_rate)
+{
+       struct clk_fixup_div *fixup_div = to_clk_fixup_div(hw);
+
+       return fixup_div->ops->recalc_rate(&fixup_div->divider.hw, parent_rate);
+}
+
+static long clk_fixup_div_round_rate(struct clk_hw *hw, unsigned long rate,
+                              unsigned long *prate)
+{
+       struct clk_fixup_div *fixup_div = to_clk_fixup_div(hw);
+
+       return fixup_div->ops->round_rate(&fixup_div->divider.hw, rate, prate);
+}
+
+static int clk_fixup_div_set_rate(struct clk_hw *hw, unsigned long rate,
+                           unsigned long parent_rate)
+{
+       struct clk_fixup_div *fixup_div = to_clk_fixup_div(hw);
+       struct clk_divider *div = to_clk_div(hw);
+       unsigned int divider, value;
+       unsigned long flags = 0;
+       u32 val;
+
+       divider = parent_rate / rate;
+
+       /* Zero based divider */
+       value = divider - 1;
+
+       if (value > div_mask(div))
+               value = div_mask(div);
+
+       spin_lock_irqsave(div->lock, flags);
+
+       val = readl(div->reg);
+       val &= ~(div_mask(div) << div->shift);
+       val |= value << div->shift;
+       fixup_div->fixup(&val);
+       writel(val, div->reg);
+
+       spin_unlock_irqrestore(div->lock, flags);
+
+       return 0;
+}
+
+static const struct clk_ops clk_fixup_div_ops = {
+       .recalc_rate = clk_fixup_div_recalc_rate,
+       .round_rate = clk_fixup_div_round_rate,
+       .set_rate = clk_fixup_div_set_rate,
+};
+
+struct clk *imx_clk_fixup_divider(const char *name, const char *parent,
+                                 void __iomem *reg, u8 shift, u8 width,
+                                 void (*fixup)(u32 *val))
+{
+       struct clk_fixup_div *fixup_div;
+       struct clk *clk;
+       struct clk_init_data init;
+
+       if (!fixup)
+               return ERR_PTR(-EINVAL);
+
+       fixup_div = kzalloc(sizeof(*fixup_div), GFP_KERNEL);
+       if (!fixup_div)
+               return ERR_PTR(-ENOMEM);
+
+       init.name = name;
+       init.ops = &clk_fixup_div_ops;
+       init.flags = CLK_SET_RATE_PARENT;
+       init.parent_names = parent ? &parent : NULL;
+       init.num_parents = parent ? 1 : 0;
+
+       fixup_div->divider.reg = reg;
+       fixup_div->divider.shift = shift;
+       fixup_div->divider.width = width;
+       fixup_div->divider.lock = &imx_ccm_lock;
+       fixup_div->divider.hw.init = &init;
+       fixup_div->ops = &clk_divider_ops;
+       fixup_div->fixup = fixup;
+
+       clk = clk_register(NULL, &fixup_div->divider.hw);
+       if (IS_ERR(clk))
+               kfree(fixup_div);
+
+       return clk;
+}
diff --git a/drivers/clk/imx/clk-fixup-mux.c b/drivers/clk/imx/clk-fixup-mux.c
new file mode 100644 (file)
index 0000000..0d40b35
--- /dev/null
@@ -0,0 +1,108 @@
+/*
+ * Copyright (C) 2013 Freescale Semiconductor, Inc.
+ *
+ * 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:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+#include <linux/clk-provider.h>
+#include <linux/err.h>
+#include <linux/io.h>
+#include <linux/slab.h>
+#include "clk.h"
+
+#define to_clk_mux(_hw) container_of(_hw, struct clk_mux, hw)
+
+/**
+ * struct clk_fixup_mux - imx integer fixup multiplexer clock
+ * @mux: the parent class
+ * @ops: pointer to clk_ops of parent class
+ * @fixup: a hook to fixup the write value
+ *
+ * The imx fixup multiplexer clock is a subclass of basic clk_mux
+ * with an addtional fixup hook.
+ */
+struct clk_fixup_mux {
+       struct clk_mux mux;
+       const struct clk_ops *ops;
+       void (*fixup)(u32 *val);
+};
+
+static inline struct clk_fixup_mux *to_clk_fixup_mux(struct clk_hw *hw)
+{
+       struct clk_mux *mux = to_clk_mux(hw);
+
+       return container_of(mux, struct clk_fixup_mux, mux);
+}
+
+static u8 clk_fixup_mux_get_parent(struct clk_hw *hw)
+{
+       struct clk_fixup_mux *fixup_mux = to_clk_fixup_mux(hw);
+
+       return fixup_mux->ops->get_parent(&fixup_mux->mux.hw);
+}
+
+static int clk_fixup_mux_set_parent(struct clk_hw *hw, u8 index)
+{
+       struct clk_fixup_mux *fixup_mux = to_clk_fixup_mux(hw);
+       struct clk_mux *mux = to_clk_mux(hw);
+       unsigned long flags = 0;
+       u32 val;
+
+       spin_lock_irqsave(mux->lock, flags);
+
+       val = readl(mux->reg);
+       val &= ~(mux->mask << mux->shift);
+       val |= index << mux->shift;
+       fixup_mux->fixup(&val);
+       writel(val, mux->reg);
+
+       spin_unlock_irqrestore(mux->lock, flags);
+
+       return 0;
+}
+
+static const struct clk_ops clk_fixup_mux_ops = {
+       .get_parent = clk_fixup_mux_get_parent,
+       .set_parent = clk_fixup_mux_set_parent,
+};
+
+struct clk *imx_clk_fixup_mux(const char *name, void __iomem *reg,
+                             u8 shift, u8 width, const char **parents,
+                             int num_parents, void (*fixup)(u32 *val))
+{
+       struct clk_fixup_mux *fixup_mux;
+       struct clk *clk;
+       struct clk_init_data init;
+
+       if (!fixup)
+               return ERR_PTR(-EINVAL);
+
+       fixup_mux = kzalloc(sizeof(*fixup_mux), GFP_KERNEL);
+       if (!fixup_mux)
+               return ERR_PTR(-ENOMEM);
+
+       init.name = name;
+       init.ops = &clk_fixup_mux_ops;
+       init.parent_names = parents;
+       init.num_parents = num_parents;
+       init.flags = 0;
+
+       fixup_mux->mux.reg = reg;
+       fixup_mux->mux.shift = shift;
+       fixup_mux->mux.mask = BIT(width) - 1;
+       fixup_mux->mux.lock = &imx_ccm_lock;
+       fixup_mux->mux.hw.init = &init;
+       fixup_mux->ops = &clk_mux_ops;
+       fixup_mux->fixup = fixup;
+
+       clk = clk_register(NULL, &fixup_mux->mux.hw);
+       if (IS_ERR(clk))
+               kfree(fixup_mux);
+
+       return clk;
+}
diff --git a/drivers/clk/imx/clk-gate-exclusive.c b/drivers/clk/imx/clk-gate-exclusive.c
new file mode 100644 (file)
index 0000000..c12f5f2
--- /dev/null
@@ -0,0 +1,94 @@
+/*
+ * Copyright 2014 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.
+ */
+
+#include <linux/clk-provider.h>
+#include <linux/err.h>
+#include <linux/io.h>
+#include <linux/slab.h>
+#include "clk.h"
+
+/**
+ * struct clk_gate_exclusive - i.MX specific gate clock which is mutually
+ * exclusive with other gate clocks
+ *
+ * @gate: the parent class
+ * @exclusive_mask: mask of gate bits which are mutually exclusive to this
+ *     gate clock
+ *
+ * The imx exclusive gate clock is a subclass of basic clk_gate
+ * with an addtional mask to indicate which other gate bits in the same
+ * register is mutually exclusive to this gate clock.
+ */
+struct clk_gate_exclusive {
+       struct clk_gate gate;
+       u32 exclusive_mask;
+};
+
+static int clk_gate_exclusive_enable(struct clk_hw *hw)
+{
+       struct clk_gate *gate = container_of(hw, struct clk_gate, hw);
+       struct clk_gate_exclusive *exgate = container_of(gate,
+                                       struct clk_gate_exclusive, gate);
+       u32 val = readl(gate->reg);
+
+       if (val & exgate->exclusive_mask)
+               return -EBUSY;
+
+       return clk_gate_ops.enable(hw);
+}
+
+static void clk_gate_exclusive_disable(struct clk_hw *hw)
+{
+       clk_gate_ops.disable(hw);
+}
+
+static int clk_gate_exclusive_is_enabled(struct clk_hw *hw)
+{
+       return clk_gate_ops.is_enabled(hw);
+}
+
+static const struct clk_ops clk_gate_exclusive_ops = {
+       .enable = clk_gate_exclusive_enable,
+       .disable = clk_gate_exclusive_disable,
+       .is_enabled = clk_gate_exclusive_is_enabled,
+};
+
+struct clk *imx_clk_gate_exclusive(const char *name, const char *parent,
+        void __iomem *reg, u8 shift, u32 exclusive_mask)
+{
+       struct clk_gate_exclusive *exgate;
+       struct clk_gate *gate;
+       struct clk *clk;
+       struct clk_init_data init;
+
+       if (exclusive_mask == 0)
+               return ERR_PTR(-EINVAL);
+
+       exgate = kzalloc(sizeof(*exgate), GFP_KERNEL);
+       if (!exgate)
+               return ERR_PTR(-ENOMEM);
+       gate = &exgate->gate;
+
+       init.name = name;
+       init.ops = &clk_gate_exclusive_ops;
+       init.flags = CLK_SET_RATE_PARENT;
+       init.parent_names = parent ? &parent : NULL;
+       init.num_parents = parent ? 1 : 0;
+
+       gate->reg = reg;
+       gate->bit_idx = shift;
+       gate->lock = &imx_ccm_lock;
+       gate->hw.init = &init;
+       exgate->exclusive_mask = exclusive_mask;
+
+       clk = clk_register(NULL, &gate->hw);
+       if (IS_ERR(clk))
+               kfree(exgate);
+
+       return clk;
+}
diff --git a/drivers/clk/imx/clk-gate2.c b/drivers/clk/imx/clk-gate2.c
new file mode 100644 (file)
index 0000000..8935bff
--- /dev/null
@@ -0,0 +1,160 @@
+/*
+ * Copyright (C) 2010-2011 Canonical Ltd <jeremy.kerr@canonical.com>
+ * Copyright (C) 2011-2012 Mike Turquette, Linaro Ltd <mturquette@linaro.org>
+ *
+ * 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.
+ *
+ * Gated clock implementation
+ */
+
+#include <linux/clk-provider.h>
+#include <linux/module.h>
+#include <linux/slab.h>
+#include <linux/io.h>
+#include <linux/err.h>
+#include <linux/string.h>
+#include "clk.h"
+
+/**
+ * DOC: basic gatable clock which can gate and ungate it's ouput
+ *
+ * Traits of this clock:
+ * prepare - clk_(un)prepare only ensures parent is (un)prepared
+ * enable - clk_enable and clk_disable are functional & control gating
+ * rate - inherits rate from parent.  No clk_set_rate support
+ * parent - fixed parent.  No clk_set_parent support
+ */
+
+struct clk_gate2 {
+       struct clk_hw hw;
+       void __iomem    *reg;
+       u8              bit_idx;
+       u8              flags;
+       spinlock_t      *lock;
+       unsigned int    *share_count;
+};
+
+#define to_clk_gate2(_hw) container_of(_hw, struct clk_gate2, hw)
+
+static int clk_gate2_enable(struct clk_hw *hw)
+{
+       struct clk_gate2 *gate = to_clk_gate2(hw);
+       u32 reg;
+       unsigned long flags = 0;
+
+       spin_lock_irqsave(gate->lock, flags);
+
+       if (gate->share_count && (*gate->share_count)++ > 0)
+               goto out;
+
+       reg = readl(gate->reg);
+       reg |= 3 << gate->bit_idx;
+       writel(reg, gate->reg);
+
+out:
+       spin_unlock_irqrestore(gate->lock, flags);
+
+       return 0;
+}
+
+static void clk_gate2_disable(struct clk_hw *hw)
+{
+       struct clk_gate2 *gate = to_clk_gate2(hw);
+       u32 reg;
+       unsigned long flags = 0;
+
+       spin_lock_irqsave(gate->lock, flags);
+
+       if (gate->share_count) {
+               if (WARN_ON(*gate->share_count == 0))
+                       goto out;
+               else if (--(*gate->share_count) > 0)
+                       goto out;
+       }
+
+       reg = readl(gate->reg);
+       reg &= ~(3 << gate->bit_idx);
+       writel(reg, gate->reg);
+
+out:
+       spin_unlock_irqrestore(gate->lock, flags);
+}
+
+static int clk_gate2_reg_is_enabled(void __iomem *reg, u8 bit_idx)
+{
+       u32 val = readl(reg);
+
+       if (((val >> bit_idx) & 1) == 1)
+               return 1;
+
+       return 0;
+}
+
+static int clk_gate2_is_enabled(struct clk_hw *hw)
+{
+       struct clk_gate2 *gate = to_clk_gate2(hw);
+
+       return clk_gate2_reg_is_enabled(gate->reg, gate->bit_idx);
+}
+
+static void clk_gate2_disable_unused(struct clk_hw *hw)
+{
+       struct clk_gate2 *gate = to_clk_gate2(hw);
+       unsigned long flags = 0;
+       u32 reg;
+
+       spin_lock_irqsave(gate->lock, flags);
+
+       if (!gate->share_count || *gate->share_count == 0) {
+               reg = readl(gate->reg);
+               reg &= ~(3 << gate->bit_idx);
+               writel(reg, gate->reg);
+       }
+
+       spin_unlock_irqrestore(gate->lock, flags);
+}
+
+static struct clk_ops clk_gate2_ops = {
+       .enable = clk_gate2_enable,
+       .disable = clk_gate2_disable,
+       .disable_unused = clk_gate2_disable_unused,
+       .is_enabled = clk_gate2_is_enabled,
+};
+
+struct clk *clk_register_gate2(struct device *dev, const char *name,
+               const char *parent_name, unsigned long flags,
+               void __iomem *reg, u8 bit_idx,
+               u8 clk_gate2_flags, spinlock_t *lock,
+               unsigned int *share_count)
+{
+       struct clk_gate2 *gate;
+       struct clk *clk;
+       struct clk_init_data init;
+
+       gate = kzalloc(sizeof(struct clk_gate2), GFP_KERNEL);
+       if (!gate)
+               return ERR_PTR(-ENOMEM);
+
+       /* struct clk_gate2 assignments */
+       gate->reg = reg;
+       gate->bit_idx = bit_idx;
+       gate->flags = clk_gate2_flags;
+       gate->lock = lock;
+       gate->share_count = share_count;
+
+       init.name = name;
+       init.ops = &clk_gate2_ops;
+       init.flags = flags;
+       init.parent_names = parent_name ? &parent_name : NULL;
+       init.num_parents = parent_name ? 1 : 0;
+
+       gate->hw.init = &init;
+
+       clk = clk_register(dev, &gate->hw);
+       if (IS_ERR(clk))
+               kfree(gate);
+
+       return clk;
+}
diff --git a/drivers/clk/imx/clk-imx1.c b/drivers/clk/imx/clk-imx1.c
new file mode 100644 (file)
index 0000000..c2647fa
--- /dev/null
@@ -0,0 +1,122 @@
+/*
+ *  Copyright (C) 2008 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include <linux/clk.h>
+#include <linux/clkdev.h>
+#include <linux/clk-provider.h>
+#include <linux/err.h>
+#include <linux/init.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
+#include <dt-bindings/clock/imx1-clock.h>
+#include <soc/imx/timer.h>
+#include <asm/irq.h>
+
+#include "clk.h"
+
+#define MX1_CCM_BASE_ADDR      0x0021b000
+#define MX1_TIM1_BASE_ADDR     0x00220000
+#define MX1_TIM1_INT           (NR_IRQS_LEGACY + 59)
+
+static const char *prem_sel_clks[] = { "clk32_premult", "clk16m", };
+static const char *clko_sel_clks[] = { "per1", "hclk", "clk48m", "clk16m",
+                                      "prem", "fclk", };
+
+static struct clk *clk[IMX1_CLK_MAX];
+static struct clk_onecell_data clk_data;
+
+static void __iomem *ccm __initdata;
+#define CCM_CSCR       (ccm + 0x0000)
+#define CCM_MPCTL0     (ccm + 0x0004)
+#define CCM_SPCTL0     (ccm + 0x000c)
+#define CCM_PCDR       (ccm + 0x0020)
+#define SCM_GCCR       (ccm + 0x0810)
+
+static void __init _mx1_clocks_init(unsigned long fref)
+{
+       clk[IMX1_CLK_DUMMY] = imx_clk_fixed("dummy", 0);
+       clk[IMX1_CLK_CLK32] = imx_obtain_fixed_clock("clk32", fref);
+       clk[IMX1_CLK_CLK16M_EXT] = imx_clk_fixed("clk16m_ext", 16000000);
+       clk[IMX1_CLK_CLK16M] = imx_clk_gate("clk16m", "clk16m_ext", CCM_CSCR, 17);
+       clk[IMX1_CLK_CLK32_PREMULT] = imx_clk_fixed_factor("clk32_premult", "clk32", 512, 1);
+       clk[IMX1_CLK_PREM] = imx_clk_mux("prem", CCM_CSCR, 16, 1, prem_sel_clks, ARRAY_SIZE(prem_sel_clks));
+       clk[IMX1_CLK_MPLL] = imx_clk_pllv1(IMX_PLLV1_IMX1, "mpll", "clk32_premult", CCM_MPCTL0);
+       clk[IMX1_CLK_MPLL_GATE] = imx_clk_gate("mpll_gate", "mpll", CCM_CSCR, 0);
+       clk[IMX1_CLK_SPLL] = imx_clk_pllv1(IMX_PLLV1_IMX1, "spll", "prem", CCM_SPCTL0);
+       clk[IMX1_CLK_SPLL_GATE] = imx_clk_gate("spll_gate", "spll", CCM_CSCR, 1);
+       clk[IMX1_CLK_MCU] = imx_clk_divider("mcu", "clk32_premult", CCM_CSCR, 15, 1);
+       clk[IMX1_CLK_FCLK] = imx_clk_divider("fclk", "mpll_gate", CCM_CSCR, 15, 1);
+       clk[IMX1_CLK_HCLK] = imx_clk_divider("hclk", "spll_gate", CCM_CSCR, 10, 4);
+       clk[IMX1_CLK_CLK48M] = imx_clk_divider("clk48m", "spll_gate", CCM_CSCR, 26, 3);
+       clk[IMX1_CLK_PER1] = imx_clk_divider("per1", "spll_gate", CCM_PCDR, 0, 4);
+       clk[IMX1_CLK_PER2] = imx_clk_divider("per2", "spll_gate", CCM_PCDR, 4, 4);
+       clk[IMX1_CLK_PER3] = imx_clk_divider("per3", "spll_gate", CCM_PCDR, 16, 7);
+       clk[IMX1_CLK_CLKO] = imx_clk_mux("clko", CCM_CSCR, 29, 3, clko_sel_clks, ARRAY_SIZE(clko_sel_clks));
+       clk[IMX1_CLK_UART3_GATE] = imx_clk_gate("uart3_gate", "hclk", SCM_GCCR, 6);
+       clk[IMX1_CLK_SSI2_GATE] = imx_clk_gate("ssi2_gate", "hclk", SCM_GCCR, 5);
+       clk[IMX1_CLK_BROM_GATE] = imx_clk_gate("brom_gate", "hclk", SCM_GCCR, 4);
+       clk[IMX1_CLK_DMA_GATE] = imx_clk_gate("dma_gate", "hclk", SCM_GCCR, 3);
+       clk[IMX1_CLK_CSI_GATE] = imx_clk_gate("csi_gate", "hclk", SCM_GCCR, 2);
+       clk[IMX1_CLK_MMA_GATE] = imx_clk_gate("mma_gate", "hclk", SCM_GCCR, 1);
+       clk[IMX1_CLK_USBD_GATE] = imx_clk_gate("usbd_gate", "clk48m", SCM_GCCR, 0);
+
+       imx_check_clocks(clk, ARRAY_SIZE(clk));
+}
+
+int __init mx1_clocks_init(unsigned long fref)
+{
+       ccm = ioremap(MX1_CCM_BASE_ADDR, SZ_4K);
+       BUG_ON(!ccm);
+
+       _mx1_clocks_init(fref);
+
+       clk_register_clkdev(clk[IMX1_CLK_PER1], "per", "imx-gpt.0");
+       clk_register_clkdev(clk[IMX1_CLK_HCLK], "ipg", "imx-gpt.0");
+       clk_register_clkdev(clk[IMX1_CLK_DMA_GATE], "ahb", "imx1-dma");
+       clk_register_clkdev(clk[IMX1_CLK_HCLK], "ipg", "imx1-dma");
+       clk_register_clkdev(clk[IMX1_CLK_PER1], "per", "imx1-uart.0");
+       clk_register_clkdev(clk[IMX1_CLK_HCLK], "ipg", "imx1-uart.0");
+       clk_register_clkdev(clk[IMX1_CLK_PER1], "per", "imx1-uart.1");
+       clk_register_clkdev(clk[IMX1_CLK_HCLK], "ipg", "imx1-uart.1");
+       clk_register_clkdev(clk[IMX1_CLK_PER1], "per", "imx1-uart.2");
+       clk_register_clkdev(clk[IMX1_CLK_UART3_GATE], "ipg", "imx1-uart.2");
+       clk_register_clkdev(clk[IMX1_CLK_HCLK], NULL, "imx1-i2c.0");
+       clk_register_clkdev(clk[IMX1_CLK_PER2], "per", "imx1-cspi.0");
+       clk_register_clkdev(clk[IMX1_CLK_DUMMY], "ipg", "imx1-cspi.0");
+       clk_register_clkdev(clk[IMX1_CLK_PER2], "per", "imx1-cspi.1");
+       clk_register_clkdev(clk[IMX1_CLK_DUMMY], "ipg", "imx1-cspi.1");
+       clk_register_clkdev(clk[IMX1_CLK_PER2], "per", "imx1-fb.0");
+       clk_register_clkdev(clk[IMX1_CLK_DUMMY], "ipg", "imx1-fb.0");
+       clk_register_clkdev(clk[IMX1_CLK_DUMMY], "ahb", "imx1-fb.0");
+
+       mxc_timer_init(MX1_TIM1_BASE_ADDR, MX1_TIM1_INT, GPT_TYPE_IMX1);
+
+       return 0;
+}
+
+static void __init mx1_clocks_init_dt(struct device_node *np)
+{
+       ccm = of_iomap(np, 0);
+       BUG_ON(!ccm);
+
+       _mx1_clocks_init(32768);
+
+       clk_data.clks = clk;
+       clk_data.clk_num = ARRAY_SIZE(clk);
+       of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
+}
+CLK_OF_DECLARE(imx1_ccm, "fsl,imx1-ccm", mx1_clocks_init_dt);
diff --git a/drivers/clk/imx/clk-imx21.c b/drivers/clk/imx/clk-imx21.c
new file mode 100644 (file)
index 0000000..dba987e
--- /dev/null
@@ -0,0 +1,175 @@
+/*
+ * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
+ * Copyright 2008 Juergen Beisert, kernel@pengutronix.de
+ * Copyright 2008 Martin Fuzzey, mfuzzey@gmail.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.
+ */
+
+#include <linux/clk.h>
+#include <linux/clk-provider.h>
+#include <linux/clkdev.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
+#include <dt-bindings/clock/imx21-clock.h>
+#include <soc/imx/timer.h>
+#include <asm/irq.h>
+
+#include "clk.h"
+
+#define MX21_CCM_BASE_ADDR     0x10027000
+#define MX21_GPT1_BASE_ADDR    0x10003000
+#define MX21_INT_GPT1          (NR_IRQS_LEGACY + 26)
+
+static void __iomem *ccm __initdata;
+
+/* Register offsets */
+#define CCM_CSCR       (ccm + 0x00)
+#define CCM_MPCTL0     (ccm + 0x04)
+#define CCM_SPCTL0     (ccm + 0x0c)
+#define CCM_PCDR0      (ccm + 0x18)
+#define CCM_PCDR1      (ccm + 0x1c)
+#define CCM_PCCR0      (ccm + 0x20)
+#define CCM_PCCR1      (ccm + 0x24)
+
+static const char *mpll_osc_sel_clks[] = { "ckih_gate", "ckih_div1p5", };
+static const char *mpll_sel_clks[] = { "fpm_gate", "mpll_osc_sel", };
+static const char *spll_sel_clks[] = { "fpm_gate", "mpll_osc_sel", };
+static const char *ssi_sel_clks[] = { "spll_gate", "mpll_gate", };
+
+static struct clk *clk[IMX21_CLK_MAX];
+static struct clk_onecell_data clk_data;
+
+static void __init _mx21_clocks_init(unsigned long lref, unsigned long href)
+{
+       BUG_ON(!ccm);
+
+       clk[IMX21_CLK_DUMMY] = imx_clk_fixed("dummy", 0);
+       clk[IMX21_CLK_CKIL] = imx_obtain_fixed_clock("ckil", lref);
+       clk[IMX21_CLK_CKIH] = imx_obtain_fixed_clock("ckih", href);
+       clk[IMX21_CLK_FPM] = imx_clk_fixed_factor("fpm", "ckil", 512, 1);
+       clk[IMX21_CLK_CKIH_DIV1P5] = imx_clk_fixed_factor("ckih_div1p5", "ckih_gate", 2, 3);
+
+       clk[IMX21_CLK_MPLL_GATE] = imx_clk_gate("mpll_gate", "mpll", CCM_CSCR, 0);
+       clk[IMX21_CLK_SPLL_GATE] = imx_clk_gate("spll_gate", "spll", CCM_CSCR, 1);
+       clk[IMX21_CLK_FPM_GATE] = imx_clk_gate("fpm_gate", "fpm", CCM_CSCR, 2);
+       clk[IMX21_CLK_CKIH_GATE] = imx_clk_gate_dis("ckih_gate", "ckih", CCM_CSCR, 3);
+       clk[IMX21_CLK_MPLL_OSC_SEL] = imx_clk_mux("mpll_osc_sel", CCM_CSCR, 4, 1, mpll_osc_sel_clks, ARRAY_SIZE(mpll_osc_sel_clks));
+       clk[IMX21_CLK_IPG] = imx_clk_divider("ipg", "hclk", CCM_CSCR, 9, 1);
+       clk[IMX21_CLK_HCLK] = imx_clk_divider("hclk", "fclk", CCM_CSCR, 10, 4);
+       clk[IMX21_CLK_MPLL_SEL] = imx_clk_mux("mpll_sel", CCM_CSCR, 16, 1, mpll_sel_clks, ARRAY_SIZE(mpll_sel_clks));
+       clk[IMX21_CLK_SPLL_SEL] = imx_clk_mux("spll_sel", CCM_CSCR, 17, 1, spll_sel_clks, ARRAY_SIZE(spll_sel_clks));
+       clk[IMX21_CLK_SSI1_SEL] = imx_clk_mux("ssi1_sel", CCM_CSCR, 19, 1, ssi_sel_clks, ARRAY_SIZE(ssi_sel_clks));
+       clk[IMX21_CLK_SSI2_SEL] = imx_clk_mux("ssi2_sel", CCM_CSCR, 20, 1, ssi_sel_clks, ARRAY_SIZE(ssi_sel_clks));
+       clk[IMX21_CLK_USB_DIV] = imx_clk_divider("usb_div", "spll_gate", CCM_CSCR, 26, 3);
+       clk[IMX21_CLK_FCLK] = imx_clk_divider("fclk", "mpll_gate", CCM_CSCR, 29, 3);
+
+       clk[IMX21_CLK_MPLL] = imx_clk_pllv1(IMX_PLLV1_IMX21, "mpll", "mpll_sel", CCM_MPCTL0);
+
+       clk[IMX21_CLK_SPLL] = imx_clk_pllv1(IMX_PLLV1_IMX21, "spll", "spll_sel", CCM_SPCTL0);
+
+       clk[IMX21_CLK_NFC_DIV] = imx_clk_divider("nfc_div", "fclk", CCM_PCDR0, 12, 4);
+       clk[IMX21_CLK_SSI1_DIV] = imx_clk_divider("ssi1_div", "ssi1_sel", CCM_PCDR0, 16, 6);
+       clk[IMX21_CLK_SSI2_DIV] = imx_clk_divider("ssi2_div", "ssi2_sel", CCM_PCDR0, 26, 6);
+
+       clk[IMX21_CLK_PER1] = imx_clk_divider("per1", "mpll_gate", CCM_PCDR1, 0, 6);
+       clk[IMX21_CLK_PER2] = imx_clk_divider("per2", "mpll_gate", CCM_PCDR1, 8, 6);
+       clk[IMX21_CLK_PER3] = imx_clk_divider("per3", "mpll_gate", CCM_PCDR1, 16, 6);
+       clk[IMX21_CLK_PER4] = imx_clk_divider("per4", "mpll_gate", CCM_PCDR1, 24, 6);
+
+       clk[IMX21_CLK_UART1_IPG_GATE] = imx_clk_gate("uart1_ipg_gate", "ipg", CCM_PCCR0, 0);
+       clk[IMX21_CLK_UART2_IPG_GATE] = imx_clk_gate("uart2_ipg_gate", "ipg", CCM_PCCR0, 1);
+       clk[IMX21_CLK_UART3_IPG_GATE] = imx_clk_gate("uart3_ipg_gate", "ipg", CCM_PCCR0, 2);
+       clk[IMX21_CLK_UART4_IPG_GATE] = imx_clk_gate("uart4_ipg_gate", "ipg", CCM_PCCR0, 3);
+       clk[IMX21_CLK_CSPI1_IPG_GATE] = imx_clk_gate("cspi1_ipg_gate", "ipg", CCM_PCCR0, 4);
+       clk[IMX21_CLK_CSPI2_IPG_GATE] = imx_clk_gate("cspi2_ipg_gate", "ipg", CCM_PCCR0, 5);
+       clk[IMX21_CLK_SSI1_GATE] = imx_clk_gate("ssi1_gate", "ipg", CCM_PCCR0, 6);
+       clk[IMX21_CLK_SSI2_GATE] = imx_clk_gate("ssi2_gate", "ipg", CCM_PCCR0, 7);
+       clk[IMX21_CLK_SDHC1_IPG_GATE] = imx_clk_gate("sdhc1_ipg_gate", "ipg", CCM_PCCR0, 9);
+       clk[IMX21_CLK_SDHC2_IPG_GATE] = imx_clk_gate("sdhc2_ipg_gate", "ipg", CCM_PCCR0, 10);
+       clk[IMX21_CLK_GPIO_GATE] = imx_clk_gate("gpio_gate", "ipg", CCM_PCCR0, 11);
+       clk[IMX21_CLK_I2C_GATE] = imx_clk_gate("i2c_gate", "ipg", CCM_PCCR0, 12);
+       clk[IMX21_CLK_DMA_GATE] = imx_clk_gate("dma_gate", "ipg", CCM_PCCR0, 13);
+       clk[IMX21_CLK_USB_GATE] = imx_clk_gate("usb_gate", "usb_div", CCM_PCCR0, 14);
+       clk[IMX21_CLK_EMMA_GATE] = imx_clk_gate("emma_gate", "ipg", CCM_PCCR0, 15);
+       clk[IMX21_CLK_SSI2_BAUD_GATE] = imx_clk_gate("ssi2_baud_gate", "ipg", CCM_PCCR0, 16);
+       clk[IMX21_CLK_SSI1_BAUD_GATE] = imx_clk_gate("ssi1_baud_gate", "ipg", CCM_PCCR0, 17);
+       clk[IMX21_CLK_LCDC_IPG_GATE] = imx_clk_gate("lcdc_ipg_gate", "ipg", CCM_PCCR0, 18);
+       clk[IMX21_CLK_NFC_GATE] = imx_clk_gate("nfc_gate", "nfc_div", CCM_PCCR0, 19);
+       clk[IMX21_CLK_SLCDC_HCLK_GATE] = imx_clk_gate("slcdc_hclk_gate", "hclk", CCM_PCCR0, 21);
+       clk[IMX21_CLK_PER4_GATE] = imx_clk_gate("per4_gate", "per4", CCM_PCCR0, 22);
+       clk[IMX21_CLK_BMI_GATE] = imx_clk_gate("bmi_gate", "hclk", CCM_PCCR0, 23);
+       clk[IMX21_CLK_USB_HCLK_GATE] = imx_clk_gate("usb_hclk_gate", "hclk", CCM_PCCR0, 24);
+       clk[IMX21_CLK_SLCDC_GATE] = imx_clk_gate("slcdc_gate", "hclk", CCM_PCCR0, 25);
+       clk[IMX21_CLK_LCDC_HCLK_GATE] = imx_clk_gate("lcdc_hclk_gate", "hclk", CCM_PCCR0, 26);
+       clk[IMX21_CLK_EMMA_HCLK_GATE] = imx_clk_gate("emma_hclk_gate", "hclk", CCM_PCCR0, 27);
+       clk[IMX21_CLK_BROM_GATE] = imx_clk_gate("brom_gate", "hclk", CCM_PCCR0, 28);
+       clk[IMX21_CLK_DMA_HCLK_GATE] = imx_clk_gate("dma_hclk_gate", "hclk", CCM_PCCR0, 30);
+       clk[IMX21_CLK_CSI_HCLK_GATE] = imx_clk_gate("csi_hclk_gate", "hclk", CCM_PCCR0, 31);
+
+       clk[IMX21_CLK_CSPI3_IPG_GATE] = imx_clk_gate("cspi3_ipg_gate", "ipg", CCM_PCCR1, 23);
+       clk[IMX21_CLK_WDOG_GATE] = imx_clk_gate("wdog_gate", "ipg", CCM_PCCR1, 24);
+       clk[IMX21_CLK_GPT1_IPG_GATE] = imx_clk_gate("gpt1_ipg_gate", "ipg", CCM_PCCR1, 25);
+       clk[IMX21_CLK_GPT2_IPG_GATE] = imx_clk_gate("gpt2_ipg_gate", "ipg", CCM_PCCR1, 26);
+       clk[IMX21_CLK_GPT3_IPG_GATE] = imx_clk_gate("gpt3_ipg_gate", "ipg", CCM_PCCR1, 27);
+       clk[IMX21_CLK_PWM_IPG_GATE] = imx_clk_gate("pwm_ipg_gate", "ipg", CCM_PCCR1, 28);
+       clk[IMX21_CLK_RTC_GATE] = imx_clk_gate("rtc_gate", "ipg", CCM_PCCR1, 29);
+       clk[IMX21_CLK_KPP_GATE] = imx_clk_gate("kpp_gate", "ipg", CCM_PCCR1, 30);
+       clk[IMX21_CLK_OWIRE_GATE] = imx_clk_gate("owire_gate", "ipg", CCM_PCCR1, 31);
+
+       imx_check_clocks(clk, ARRAY_SIZE(clk));
+}
+
+int __init mx21_clocks_init(unsigned long lref, unsigned long href)
+{
+       ccm = ioremap(MX21_CCM_BASE_ADDR, SZ_2K);
+
+       _mx21_clocks_init(lref, href);
+
+       clk_register_clkdev(clk[IMX21_CLK_PER1], "per", "imx21-uart.0");
+       clk_register_clkdev(clk[IMX21_CLK_UART1_IPG_GATE], "ipg", "imx21-uart.0");
+       clk_register_clkdev(clk[IMX21_CLK_PER1], "per", "imx21-uart.1");
+       clk_register_clkdev(clk[IMX21_CLK_UART2_IPG_GATE], "ipg", "imx21-uart.1");
+       clk_register_clkdev(clk[IMX21_CLK_PER1], "per", "imx21-uart.2");
+       clk_register_clkdev(clk[IMX21_CLK_UART3_IPG_GATE], "ipg", "imx21-uart.2");
+       clk_register_clkdev(clk[IMX21_CLK_PER1], "per", "imx21-uart.3");
+       clk_register_clkdev(clk[IMX21_CLK_UART4_IPG_GATE], "ipg", "imx21-uart.3");
+       clk_register_clkdev(clk[IMX21_CLK_GPT1_IPG_GATE], "ipg", "imx-gpt.0");
+       clk_register_clkdev(clk[IMX21_CLK_PER1], "per", "imx-gpt.0");
+       clk_register_clkdev(clk[IMX21_CLK_PER2], "per", "imx21-cspi.0");
+       clk_register_clkdev(clk[IMX21_CLK_CSPI1_IPG_GATE], "ipg", "imx21-cspi.0");
+       clk_register_clkdev(clk[IMX21_CLK_PER2], "per", "imx21-cspi.1");
+       clk_register_clkdev(clk[IMX21_CLK_CSPI2_IPG_GATE], "ipg", "imx21-cspi.1");
+       clk_register_clkdev(clk[IMX21_CLK_PER2], "per", "imx21-cspi.2");
+       clk_register_clkdev(clk[IMX21_CLK_CSPI3_IPG_GATE], "ipg", "imx21-cspi.2");
+       clk_register_clkdev(clk[IMX21_CLK_PER3], "per", "imx21-fb.0");
+       clk_register_clkdev(clk[IMX21_CLK_LCDC_IPG_GATE], "ipg", "imx21-fb.0");
+       clk_register_clkdev(clk[IMX21_CLK_LCDC_HCLK_GATE], "ahb", "imx21-fb.0");
+       clk_register_clkdev(clk[IMX21_CLK_USB_GATE], "per", "imx21-hcd.0");
+       clk_register_clkdev(clk[IMX21_CLK_USB_HCLK_GATE], "ahb", "imx21-hcd.0");
+       clk_register_clkdev(clk[IMX21_CLK_NFC_GATE], NULL, "imx21-nand.0");
+       clk_register_clkdev(clk[IMX21_CLK_DMA_HCLK_GATE], "ahb", "imx21-dma");
+       clk_register_clkdev(clk[IMX21_CLK_DMA_GATE], "ipg", "imx21-dma");
+       clk_register_clkdev(clk[IMX21_CLK_WDOG_GATE], NULL, "imx2-wdt.0");
+       clk_register_clkdev(clk[IMX21_CLK_I2C_GATE], NULL, "imx21-i2c.0");
+       clk_register_clkdev(clk[IMX21_CLK_OWIRE_GATE], NULL, "mxc_w1.0");
+
+       mxc_timer_init(MX21_GPT1_BASE_ADDR, MX21_INT_GPT1, GPT_TYPE_IMX21);
+
+       return 0;
+}
+
+static void __init mx21_clocks_init_dt(struct device_node *np)
+{
+       ccm = of_iomap(np, 0);
+
+       _mx21_clocks_init(32768, 26000000);
+
+       clk_data.clks = clk;
+       clk_data.clk_num = ARRAY_SIZE(clk);
+       of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
+}
+CLK_OF_DECLARE(imx27_ccm, "fsl,imx21-ccm", mx21_clocks_init_dt);
diff --git a/drivers/clk/imx/clk-imx25.c b/drivers/clk/imx/clk-imx25.c
new file mode 100644 (file)
index 0000000..ec1a4c1
--- /dev/null
@@ -0,0 +1,262 @@
+/*
+ * Copyright (C) 2009 by Sascha Hauer, Pengutronix
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/list.h>
+#include <linux/clk.h>
+#include <linux/io.h>
+#include <linux/clkdev.h>
+#include <linux/err.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
+
+#include "clk.h"
+
+#define CCM_MPCTL      0x00
+#define CCM_UPCTL      0x04
+#define CCM_CCTL       0x08
+#define CCM_CGCR0      0x0C
+#define CCM_CGCR1      0x10
+#define CCM_CGCR2      0x14
+#define CCM_PCDR0      0x18
+#define CCM_PCDR1      0x1C
+#define CCM_PCDR2      0x20
+#define CCM_PCDR3      0x24
+#define CCM_RCSR       0x28
+#define CCM_CRDR       0x2C
+#define CCM_DCVR0      0x30
+#define CCM_DCVR1      0x34
+#define CCM_DCVR2      0x38
+#define CCM_DCVR3      0x3c
+#define CCM_LTR0       0x40
+#define CCM_LTR1       0x44
+#define CCM_LTR2       0x48
+#define CCM_LTR3       0x4c
+#define CCM_MCR                0x64
+
+#define ccm(x) (ccm_base + (x))
+
+static struct clk_onecell_data clk_data;
+
+static const char *cpu_sel_clks[] = { "mpll", "mpll_cpu_3_4", };
+static const char *per_sel_clks[] = { "ahb", "upll", };
+static const char *cko_sel_clks[] = { "dummy", "osc", "cpu", "ahb",
+                                     "ipg", "dummy", "dummy", "dummy",
+                                     "dummy", "dummy", "per0", "per2",
+                                     "per13", "per14", "usbotg_ahb", "dummy",};
+
+enum mx25_clks {
+       dummy, osc, mpll, upll, mpll_cpu_3_4, cpu_sel, cpu, ahb, usb_div, ipg,
+       per0_sel, per1_sel, per2_sel, per3_sel, per4_sel, per5_sel, per6_sel,
+       per7_sel, per8_sel, per9_sel, per10_sel, per11_sel, per12_sel,
+       per13_sel, per14_sel, per15_sel, per0, per1, per2, per3, per4, per5,
+       per6, per7, per8, per9, per10, per11, per12, per13, per14, per15,
+       csi_ipg_per, epit_ipg_per, esai_ipg_per, esdhc1_ipg_per, esdhc2_ipg_per,
+       gpt_ipg_per, i2c_ipg_per, lcdc_ipg_per, nfc_ipg_per, owire_ipg_per,
+       pwm_ipg_per, sim1_ipg_per, sim2_ipg_per, ssi1_ipg_per, ssi2_ipg_per,
+       uart_ipg_per, ata_ahb, reserved1, csi_ahb, emi_ahb, esai_ahb, esdhc1_ahb,
+       esdhc2_ahb, fec_ahb, lcdc_ahb, rtic_ahb, sdma_ahb, slcdc_ahb, usbotg_ahb,
+       reserved2, reserved3, reserved4, reserved5, can1_ipg, can2_ipg, csi_ipg,
+       cspi1_ipg, cspi2_ipg, cspi3_ipg, dryice_ipg, ect_ipg, epit1_ipg, epit2_ipg,
+       reserved6, esdhc1_ipg, esdhc2_ipg, fec_ipg, reserved7, reserved8, reserved9,
+       gpt1_ipg, gpt2_ipg, gpt3_ipg, gpt4_ipg, reserved10, reserved11, reserved12,
+       iim_ipg, reserved13, reserved14, kpp_ipg, lcdc_ipg, reserved15, pwm1_ipg,
+       pwm2_ipg, pwm3_ipg, pwm4_ipg, rngb_ipg, reserved16, scc_ipg, sdma_ipg,
+       sim1_ipg, sim2_ipg, slcdc_ipg, spba_ipg, ssi1_ipg, ssi2_ipg, tsc_ipg,
+       uart1_ipg, uart2_ipg, uart3_ipg, uart4_ipg, uart5_ipg, reserved17,
+       wdt_ipg, cko_div, cko_sel, cko, clk_max
+};
+
+static struct clk *clk[clk_max];
+
+static int __init __mx25_clocks_init(unsigned long osc_rate,
+                                    void __iomem *ccm_base)
+{
+       BUG_ON(!ccm_base);
+
+       clk[dummy] = imx_clk_fixed("dummy", 0);
+       clk[osc] = imx_clk_fixed("osc", osc_rate);
+       clk[mpll] = imx_clk_pllv1(IMX_PLLV1_IMX25, "mpll", "osc", ccm(CCM_MPCTL));
+       clk[upll] = imx_clk_pllv1(IMX_PLLV1_IMX25, "upll", "osc", ccm(CCM_UPCTL));
+       clk[mpll_cpu_3_4] = imx_clk_fixed_factor("mpll_cpu_3_4", "mpll", 3, 4);
+       clk[cpu_sel] = imx_clk_mux("cpu_sel", ccm(CCM_CCTL), 14, 1, cpu_sel_clks, ARRAY_SIZE(cpu_sel_clks));
+       clk[cpu] = imx_clk_divider("cpu", "cpu_sel", ccm(CCM_CCTL), 30, 2);
+       clk[ahb] = imx_clk_divider("ahb", "cpu", ccm(CCM_CCTL), 28, 2);
+       clk[usb_div] = imx_clk_divider("usb_div", "upll", ccm(CCM_CCTL), 16, 6); 
+       clk[ipg] = imx_clk_fixed_factor("ipg", "ahb", 1, 2);
+       clk[per0_sel] = imx_clk_mux("per0_sel", ccm(CCM_MCR), 0, 1, per_sel_clks, ARRAY_SIZE(per_sel_clks));
+       clk[per1_sel] = imx_clk_mux("per1_sel", ccm(CCM_MCR), 1, 1, per_sel_clks, ARRAY_SIZE(per_sel_clks));
+       clk[per2_sel] = imx_clk_mux("per2_sel", ccm(CCM_MCR), 2, 1, per_sel_clks, ARRAY_SIZE(per_sel_clks));
+       clk[per3_sel] = imx_clk_mux("per3_sel", ccm(CCM_MCR), 3, 1, per_sel_clks, ARRAY_SIZE(per_sel_clks));
+       clk[per4_sel] = imx_clk_mux("per4_sel", ccm(CCM_MCR), 4, 1, per_sel_clks, ARRAY_SIZE(per_sel_clks));
+       clk[per5_sel] = imx_clk_mux("per5_sel", ccm(CCM_MCR), 5, 1, per_sel_clks, ARRAY_SIZE(per_sel_clks));
+       clk[per6_sel] = imx_clk_mux("per6_sel", ccm(CCM_MCR), 6, 1, per_sel_clks, ARRAY_SIZE(per_sel_clks));
+       clk[per7_sel] = imx_clk_mux("per7_sel", ccm(CCM_MCR), 7, 1, per_sel_clks, ARRAY_SIZE(per_sel_clks));
+       clk[per8_sel] = imx_clk_mux("per8_sel", ccm(CCM_MCR), 8, 1, per_sel_clks, ARRAY_SIZE(per_sel_clks));
+       clk[per9_sel] = imx_clk_mux("per9_sel", ccm(CCM_MCR), 9, 1, per_sel_clks, ARRAY_SIZE(per_sel_clks));
+       clk[per10_sel] = imx_clk_mux("per10_sel", ccm(CCM_MCR), 10, 1, per_sel_clks, ARRAY_SIZE(per_sel_clks));
+       clk[per11_sel] = imx_clk_mux("per11_sel", ccm(CCM_MCR), 11, 1, per_sel_clks, ARRAY_SIZE(per_sel_clks));
+       clk[per12_sel] = imx_clk_mux("per12_sel", ccm(CCM_MCR), 12, 1, per_sel_clks, ARRAY_SIZE(per_sel_clks));
+       clk[per13_sel] = imx_clk_mux("per13_sel", ccm(CCM_MCR), 13, 1, per_sel_clks, ARRAY_SIZE(per_sel_clks));
+       clk[per14_sel] = imx_clk_mux("per14_sel", ccm(CCM_MCR), 14, 1, per_sel_clks, ARRAY_SIZE(per_sel_clks));
+       clk[per15_sel] = imx_clk_mux("per15_sel", ccm(CCM_MCR), 15, 1, per_sel_clks, ARRAY_SIZE(per_sel_clks));
+       clk[cko_div] = imx_clk_divider("cko_div", "cko_sel", ccm(CCM_MCR), 24, 6);
+       clk[cko_sel] = imx_clk_mux("cko_sel", ccm(CCM_MCR), 20, 4, cko_sel_clks, ARRAY_SIZE(cko_sel_clks));
+       clk[cko] = imx_clk_gate("cko", "cko_div", ccm(CCM_MCR),  30);
+       clk[per0] = imx_clk_divider("per0", "per0_sel", ccm(CCM_PCDR0), 0, 6);
+       clk[per1] = imx_clk_divider("per1", "per1_sel", ccm(CCM_PCDR0), 8, 6);
+       clk[per2] = imx_clk_divider("per2", "per2_sel", ccm(CCM_PCDR0), 16, 6);
+       clk[per3] = imx_clk_divider("per3", "per3_sel", ccm(CCM_PCDR0), 24, 6);
+       clk[per4] = imx_clk_divider("per4", "per4_sel", ccm(CCM_PCDR1), 0, 6);
+       clk[per5] = imx_clk_divider("per5", "per5_sel", ccm(CCM_PCDR1), 8, 6);
+       clk[per6] = imx_clk_divider("per6", "per6_sel", ccm(CCM_PCDR1), 16, 6);
+       clk[per7] = imx_clk_divider("per7", "per7_sel", ccm(CCM_PCDR1), 24, 6);
+       clk[per8] = imx_clk_divider("per8", "per8_sel", ccm(CCM_PCDR2), 0, 6);
+       clk[per9] = imx_clk_divider("per9", "per9_sel", ccm(CCM_PCDR2), 8, 6);
+       clk[per10] = imx_clk_divider("per10", "per10_sel", ccm(CCM_PCDR2), 16, 6);
+       clk[per11] = imx_clk_divider("per11", "per11_sel", ccm(CCM_PCDR2), 24, 6);
+       clk[per12] = imx_clk_divider("per12", "per12_sel", ccm(CCM_PCDR3), 0, 6);
+       clk[per13] = imx_clk_divider("per13", "per13_sel", ccm(CCM_PCDR3), 8, 6);
+       clk[per14] = imx_clk_divider("per14", "per14_sel", ccm(CCM_PCDR3), 16, 6);
+       clk[per15] = imx_clk_divider("per15", "per15_sel", ccm(CCM_PCDR3), 24, 6);
+       clk[csi_ipg_per] = imx_clk_gate("csi_ipg_per", "per0", ccm(CCM_CGCR0), 0);
+       clk[epit_ipg_per] = imx_clk_gate("epit_ipg_per", "per1", ccm(CCM_CGCR0),  1);
+       clk[esai_ipg_per] = imx_clk_gate("esai_ipg_per", "per2", ccm(CCM_CGCR0),  2);
+       clk[esdhc1_ipg_per] = imx_clk_gate("esdhc1_ipg_per", "per3", ccm(CCM_CGCR0),  3);
+       clk[esdhc2_ipg_per] = imx_clk_gate("esdhc2_ipg_per", "per4", ccm(CCM_CGCR0),  4);
+       clk[gpt_ipg_per] = imx_clk_gate("gpt_ipg_per", "per5", ccm(CCM_CGCR0),  5);
+       clk[i2c_ipg_per] = imx_clk_gate("i2c_ipg_per", "per6", ccm(CCM_CGCR0),  6);
+       clk[lcdc_ipg_per] = imx_clk_gate("lcdc_ipg_per", "per7", ccm(CCM_CGCR0),  7);
+       clk[nfc_ipg_per] = imx_clk_gate("nfc_ipg_per", "per8", ccm(CCM_CGCR0),  8);
+       clk[owire_ipg_per] = imx_clk_gate("owire_ipg_per", "per9", ccm(CCM_CGCR0),  9);
+       clk[pwm_ipg_per] = imx_clk_gate("pwm_ipg_per", "per10", ccm(CCM_CGCR0),  10);
+       clk[sim1_ipg_per] = imx_clk_gate("sim1_ipg_per", "per11", ccm(CCM_CGCR0),  11);
+       clk[sim2_ipg_per] = imx_clk_gate("sim2_ipg_per", "per12", ccm(CCM_CGCR0),  12);
+       clk[ssi1_ipg_per] = imx_clk_gate("ssi1_ipg_per", "per13", ccm(CCM_CGCR0), 13);
+       clk[ssi2_ipg_per] = imx_clk_gate("ssi2_ipg_per", "per14", ccm(CCM_CGCR0), 14);
+       clk[uart_ipg_per] = imx_clk_gate("uart_ipg_per", "per15", ccm(CCM_CGCR0), 15);
+       clk[ata_ahb] = imx_clk_gate("ata_ahb", "ahb", ccm(CCM_CGCR0), 16);
+       /* CCM_CGCR0(17): reserved */
+       clk[csi_ahb] = imx_clk_gate("csi_ahb", "ahb", ccm(CCM_CGCR0), 18);
+       clk[emi_ahb] = imx_clk_gate("emi_ahb", "ahb", ccm(CCM_CGCR0), 19);
+       clk[esai_ahb] = imx_clk_gate("esai_ahb", "ahb", ccm(CCM_CGCR0), 20);
+       clk[esdhc1_ahb] = imx_clk_gate("esdhc1_ahb", "ahb", ccm(CCM_CGCR0), 21);
+       clk[esdhc2_ahb] = imx_clk_gate("esdhc2_ahb", "ahb", ccm(CCM_CGCR0), 22);
+       clk[fec_ahb] = imx_clk_gate("fec_ahb", "ahb", ccm(CCM_CGCR0), 23);
+       clk[lcdc_ahb] = imx_clk_gate("lcdc_ahb", "ahb", ccm(CCM_CGCR0), 24);
+       clk[rtic_ahb] = imx_clk_gate("rtic_ahb", "ahb", ccm(CCM_CGCR0), 25);
+       clk[sdma_ahb] = imx_clk_gate("sdma_ahb", "ahb", ccm(CCM_CGCR0), 26);
+       clk[slcdc_ahb] = imx_clk_gate("slcdc_ahb", "ahb", ccm(CCM_CGCR0), 27);
+       clk[usbotg_ahb] = imx_clk_gate("usbotg_ahb", "ahb", ccm(CCM_CGCR0), 28);
+       /* CCM_CGCR0(29-31): reserved */
+       /* CCM_CGCR1(0): reserved in datasheet, used as audmux in FSL kernel */
+       clk[can1_ipg] = imx_clk_gate("can1_ipg", "ipg", ccm(CCM_CGCR1),  2);
+       clk[can2_ipg] = imx_clk_gate("can2_ipg", "ipg", ccm(CCM_CGCR1),  3);
+       clk[csi_ipg] = imx_clk_gate("csi_ipg", "ipg", ccm(CCM_CGCR1),  4);
+       clk[cspi1_ipg] = imx_clk_gate("cspi1_ipg", "ipg", ccm(CCM_CGCR1),  5);
+       clk[cspi2_ipg] = imx_clk_gate("cspi2_ipg", "ipg", ccm(CCM_CGCR1),  6);
+       clk[cspi3_ipg] = imx_clk_gate("cspi3_ipg", "ipg", ccm(CCM_CGCR1),  7);
+       clk[dryice_ipg] = imx_clk_gate("dryice_ipg", "ipg", ccm(CCM_CGCR1),  8);
+       clk[ect_ipg] = imx_clk_gate("ect_ipg", "ipg", ccm(CCM_CGCR1),  9);
+       clk[epit1_ipg] = imx_clk_gate("epit1_ipg", "ipg", ccm(CCM_CGCR1),  10);
+       clk[epit2_ipg] = imx_clk_gate("epit2_ipg", "ipg", ccm(CCM_CGCR1),  11);
+       /* CCM_CGCR1(12): reserved in datasheet, used as esai in FSL kernel */
+       clk[esdhc1_ipg] = imx_clk_gate("esdhc1_ipg", "ipg", ccm(CCM_CGCR1), 13);
+       clk[esdhc2_ipg] = imx_clk_gate("esdhc2_ipg", "ipg", ccm(CCM_CGCR1), 14);
+       clk[fec_ipg] = imx_clk_gate("fec_ipg", "ipg", ccm(CCM_CGCR1), 15);
+       /* CCM_CGCR1(16): reserved in datasheet, used as gpio1 in FSL kernel */
+       /* CCM_CGCR1(17): reserved in datasheet, used as gpio2 in FSL kernel */
+       /* CCM_CGCR1(18): reserved in datasheet, used as gpio3 in FSL kernel */
+       clk[gpt1_ipg] = imx_clk_gate("gpt1_ipg", "ipg", ccm(CCM_CGCR1), 19);
+       clk[gpt2_ipg] = imx_clk_gate("gpt2_ipg", "ipg", ccm(CCM_CGCR1), 20);
+       clk[gpt3_ipg] = imx_clk_gate("gpt3_ipg", "ipg", ccm(CCM_CGCR1), 21);
+       clk[gpt4_ipg] = imx_clk_gate("gpt4_ipg", "ipg", ccm(CCM_CGCR1), 22);
+       /* CCM_CGCR1(23): reserved in datasheet, used as i2c1 in FSL kernel */
+       /* CCM_CGCR1(24): reserved in datasheet, used as i2c2 in FSL kernel */
+       /* CCM_CGCR1(25): reserved in datasheet, used as i2c3 in FSL kernel */
+       clk[iim_ipg] = imx_clk_gate("iim_ipg", "ipg", ccm(CCM_CGCR1), 26);
+       /* CCM_CGCR1(27): reserved in datasheet, used as iomuxc in FSL kernel */
+       /* CCM_CGCR1(28): reserved in datasheet, used as kpp in FSL kernel */
+       clk[kpp_ipg] = imx_clk_gate("kpp_ipg", "ipg", ccm(CCM_CGCR1), 28);
+       clk[lcdc_ipg] = imx_clk_gate("lcdc_ipg", "ipg", ccm(CCM_CGCR1), 29);
+       /* CCM_CGCR1(30): reserved in datasheet, used as owire in FSL kernel */
+       clk[pwm1_ipg] = imx_clk_gate("pwm1_ipg", "ipg", ccm(CCM_CGCR1), 31);
+       clk[pwm2_ipg] = imx_clk_gate("pwm2_ipg", "ipg", ccm(CCM_CGCR2),  0);
+       clk[pwm3_ipg] = imx_clk_gate("pwm3_ipg", "ipg", ccm(CCM_CGCR2),  1);
+       clk[pwm4_ipg] = imx_clk_gate("pwm4_ipg", "ipg", ccm(CCM_CGCR2),  2);
+       clk[rngb_ipg] = imx_clk_gate("rngb_ipg", "ipg", ccm(CCM_CGCR2),  3);
+       /* CCM_CGCR2(4): reserved in datasheet, used as rtic in FSL kernel */
+       clk[scc_ipg] = imx_clk_gate("scc_ipg", "ipg", ccm(CCM_CGCR2),  5);
+       clk[sdma_ipg] = imx_clk_gate("sdma_ipg", "ipg", ccm(CCM_CGCR2),  6);
+       clk[sim1_ipg] = imx_clk_gate("sim1_ipg", "ipg", ccm(CCM_CGCR2),  7);
+       clk[sim2_ipg] = imx_clk_gate("sim2_ipg", "ipg", ccm(CCM_CGCR2),  8);
+       clk[slcdc_ipg] = imx_clk_gate("slcdc_ipg", "ipg", ccm(CCM_CGCR2),  9);
+       clk[spba_ipg] = imx_clk_gate("spba_ipg", "ipg", ccm(CCM_CGCR2),  10);
+       clk[ssi1_ipg] = imx_clk_gate("ssi1_ipg", "ipg", ccm(CCM_CGCR2), 11);
+       clk[ssi2_ipg] = imx_clk_gate("ssi2_ipg", "ipg", ccm(CCM_CGCR2), 12);
+       clk[tsc_ipg] = imx_clk_gate("tsc_ipg", "ipg", ccm(CCM_CGCR2), 13);
+       clk[uart1_ipg] = imx_clk_gate("uart1_ipg", "ipg", ccm(CCM_CGCR2), 14);
+       clk[uart2_ipg] = imx_clk_gate("uart2_ipg", "ipg", ccm(CCM_CGCR2), 15);
+       clk[uart3_ipg] = imx_clk_gate("uart3_ipg", "ipg", ccm(CCM_CGCR2), 16);
+       clk[uart4_ipg] = imx_clk_gate("uart4_ipg", "ipg", ccm(CCM_CGCR2), 17);
+       clk[uart5_ipg] = imx_clk_gate("uart5_ipg", "ipg", ccm(CCM_CGCR2), 18);
+       /* CCM_CGCR2(19): reserved in datasheet, but used as wdt in FSL kernel */
+       clk[wdt_ipg] = imx_clk_gate("wdt_ipg", "ipg", ccm(CCM_CGCR2), 19);
+
+       imx_check_clocks(clk, ARRAY_SIZE(clk));
+
+       clk_prepare_enable(clk[emi_ahb]);
+
+       /* Clock source for gpt must be derived from AHB */
+       clk_set_parent(clk[per5_sel], clk[ahb]);
+
+       /*
+        * Let's initially set up CLKO parent as ipg, since this configuration
+        * is used on some imx25 board designs to clock the audio codec.
+        */
+       clk_set_parent(clk[cko_sel], clk[ipg]);
+
+       return 0;
+}
+
+static void __init mx25_clocks_init_dt(struct device_node *np)
+{
+       struct device_node *refnp;
+       unsigned long osc_rate = 24000000;
+       void __iomem *ccm;
+
+       /* retrieve the freqency of fixed clocks from device tree */
+       for_each_compatible_node(refnp, NULL, "fixed-clock") {
+               u32 rate;
+               if (of_property_read_u32(refnp, "clock-frequency", &rate))
+                       continue;
+
+               if (of_device_is_compatible(refnp, "fsl,imx-osc"))
+                       osc_rate = rate;
+       }
+
+       ccm = of_iomap(np, 0);
+       __mx25_clocks_init(osc_rate, ccm);
+
+       clk_data.clks = clk;
+       clk_data.clk_num = ARRAY_SIZE(clk);
+       of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
+}
+CLK_OF_DECLARE(imx25_ccm, "fsl,imx25-ccm", mx25_clocks_init_dt);
diff --git a/drivers/clk/imx/clk-imx27.c b/drivers/clk/imx/clk-imx27.c
new file mode 100644 (file)
index 0000000..d9d50d5
--- /dev/null
@@ -0,0 +1,263 @@
+#include <linux/clk.h>
+#include <linux/clk-provider.h>
+#include <linux/clkdev.h>
+#include <linux/err.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
+#include <dt-bindings/clock/imx27-clock.h>
+#include <soc/imx/revision.h>
+#include <soc/imx/timer.h>
+#include <asm/irq.h>
+
+#include "clk.h"
+
+#define MX27_CCM_BASE_ADDR     0x10027000
+#define MX27_GPT1_BASE_ADDR    0x10003000
+#define MX27_INT_GPT1          (NR_IRQS_LEGACY + 26)
+
+static void __iomem *ccm __initdata;
+
+/* Register offsets */
+#define CCM_CSCR               (ccm + 0x00)
+#define CCM_MPCTL0             (ccm + 0x04)
+#define CCM_MPCTL1             (ccm + 0x08)
+#define CCM_SPCTL0             (ccm + 0x0c)
+#define CCM_SPCTL1             (ccm + 0x10)
+#define CCM_PCDR0              (ccm + 0x18)
+#define CCM_PCDR1              (ccm + 0x1c)
+#define CCM_PCCR0              (ccm + 0x20)
+#define CCM_PCCR1              (ccm + 0x24)
+#define CCM_CCSR               (ccm + 0x28)
+
+static const char *vpu_sel_clks[] = { "spll", "mpll_main2", };
+static const char *cpu_sel_clks[] = { "mpll_main2", "mpll", };
+static const char *mpll_sel_clks[] = { "fpm", "mpll_osc_sel", };
+static const char *mpll_osc_sel_clks[] = { "ckih_gate", "ckih_div1p5", };
+static const char *clko_sel_clks[] = {
+       "ckil", "fpm", "ckih_gate", "ckih_gate",
+       "ckih_gate", "mpll", "spll", "cpu_div",
+       "ahb", "ipg", "per1_div", "per2_div",
+       "per3_div", "per4_div", "ssi1_div", "ssi2_div",
+       "nfc_div", "mshc_div", "vpu_div", "60m",
+       "32k", "usb_div", "dptc",
+};
+
+static const char *ssi_sel_clks[] = { "spll_gate", "mpll", };
+
+static struct clk *clk[IMX27_CLK_MAX];
+static struct clk_onecell_data clk_data;
+
+static void __init _mx27_clocks_init(unsigned long fref)
+{
+       BUG_ON(!ccm);
+
+       clk[IMX27_CLK_DUMMY] = imx_clk_fixed("dummy", 0);
+       clk[IMX27_CLK_CKIH] = imx_clk_fixed("ckih", fref);
+       clk[IMX27_CLK_CKIL] = imx_clk_fixed("ckil", 32768);
+       clk[IMX27_CLK_FPM] = imx_clk_fixed_factor("fpm", "ckil", 1024, 1);
+       clk[IMX27_CLK_CKIH_DIV1P5] = imx_clk_fixed_factor("ckih_div1p5", "ckih_gate", 2, 3);
+       clk[IMX27_CLK_CKIH_GATE] = imx_clk_gate_dis("ckih_gate", "ckih", CCM_CSCR, 3);
+       clk[IMX27_CLK_MPLL_OSC_SEL] = imx_clk_mux("mpll_osc_sel", CCM_CSCR, 4, 1, mpll_osc_sel_clks, ARRAY_SIZE(mpll_osc_sel_clks));
+       clk[IMX27_CLK_MPLL_SEL] = imx_clk_mux("mpll_sel", CCM_CSCR, 16, 1, mpll_sel_clks, ARRAY_SIZE(mpll_sel_clks));
+       clk[IMX27_CLK_MPLL] = imx_clk_pllv1(IMX_PLLV1_IMX27, "mpll", "mpll_sel", CCM_MPCTL0);
+       clk[IMX27_CLK_SPLL] = imx_clk_pllv1(IMX_PLLV1_IMX27, "spll", "ckih_gate", CCM_SPCTL0);
+       clk[IMX27_CLK_SPLL_GATE] = imx_clk_gate("spll_gate", "spll", CCM_CSCR, 1);
+       clk[IMX27_CLK_MPLL_MAIN2] = imx_clk_fixed_factor("mpll_main2", "mpll", 2, 3);
+
+       if (mx27_revision() >= IMX_CHIP_REVISION_2_0) {
+               clk[IMX27_CLK_AHB] = imx_clk_divider("ahb", "mpll_main2", CCM_CSCR, 8, 2);
+               clk[IMX27_CLK_IPG] = imx_clk_fixed_factor("ipg", "ahb", 1, 2);
+       } else {
+               clk[IMX27_CLK_AHB] = imx_clk_divider("ahb", "mpll_main2", CCM_CSCR, 9, 4);
+               clk[IMX27_CLK_IPG] = imx_clk_divider("ipg", "ahb", CCM_CSCR, 8, 1);
+       }
+
+       clk[IMX27_CLK_MSHC_DIV] = imx_clk_divider("mshc_div", "ahb", CCM_PCDR0, 0, 6);
+       clk[IMX27_CLK_NFC_DIV] = imx_clk_divider("nfc_div", "ahb", CCM_PCDR0, 6, 4);
+       clk[IMX27_CLK_PER1_DIV] = imx_clk_divider("per1_div", "mpll_main2", CCM_PCDR1, 0, 6);
+       clk[IMX27_CLK_PER2_DIV] = imx_clk_divider("per2_div", "mpll_main2", CCM_PCDR1, 8, 6);
+       clk[IMX27_CLK_PER3_DIV] = imx_clk_divider("per3_div", "mpll_main2", CCM_PCDR1, 16, 6);
+       clk[IMX27_CLK_PER4_DIV] = imx_clk_divider("per4_div", "mpll_main2", CCM_PCDR1, 24, 6);
+       clk[IMX27_CLK_VPU_SEL] = imx_clk_mux("vpu_sel", CCM_CSCR, 21, 1, vpu_sel_clks, ARRAY_SIZE(vpu_sel_clks));
+       clk[IMX27_CLK_VPU_DIV] = imx_clk_divider("vpu_div", "vpu_sel", CCM_PCDR0, 10, 6);
+       clk[IMX27_CLK_USB_DIV] = imx_clk_divider("usb_div", "spll_gate", CCM_CSCR, 28, 3);
+       clk[IMX27_CLK_CPU_SEL] = imx_clk_mux("cpu_sel", CCM_CSCR, 15, 1, cpu_sel_clks, ARRAY_SIZE(cpu_sel_clks));
+       clk[IMX27_CLK_CLKO_SEL] = imx_clk_mux("clko_sel", CCM_CCSR, 0, 5, clko_sel_clks, ARRAY_SIZE(clko_sel_clks));
+
+       if (mx27_revision() >= IMX_CHIP_REVISION_2_0)
+               clk[IMX27_CLK_CPU_DIV] = imx_clk_divider("cpu_div", "cpu_sel", CCM_CSCR, 12, 2);
+       else
+               clk[IMX27_CLK_CPU_DIV] = imx_clk_divider("cpu_div", "cpu_sel", CCM_CSCR, 13, 3);
+
+       clk[IMX27_CLK_CLKO_DIV] = imx_clk_divider("clko_div", "clko_sel", CCM_PCDR0, 22, 3);
+       clk[IMX27_CLK_SSI1_SEL] = imx_clk_mux("ssi1_sel", CCM_CSCR, 22, 1, ssi_sel_clks, ARRAY_SIZE(ssi_sel_clks));
+       clk[IMX27_CLK_SSI2_SEL] = imx_clk_mux("ssi2_sel", CCM_CSCR, 23, 1, ssi_sel_clks, ARRAY_SIZE(ssi_sel_clks));
+       clk[IMX27_CLK_SSI1_DIV] = imx_clk_divider("ssi1_div", "ssi1_sel", CCM_PCDR0, 16, 6);
+       clk[IMX27_CLK_SSI2_DIV] = imx_clk_divider("ssi2_div", "ssi2_sel", CCM_PCDR0, 26, 6);
+       clk[IMX27_CLK_CLKO_EN] = imx_clk_gate("clko_en", "clko_div", CCM_PCCR0, 0);
+       clk[IMX27_CLK_SSI2_IPG_GATE] = imx_clk_gate("ssi2_ipg_gate", "ipg", CCM_PCCR0, 0);
+       clk[IMX27_CLK_SSI1_IPG_GATE] = imx_clk_gate("ssi1_ipg_gate", "ipg", CCM_PCCR0, 1);
+       clk[IMX27_CLK_SLCDC_IPG_GATE] = imx_clk_gate("slcdc_ipg_gate", "ipg", CCM_PCCR0, 2);
+       clk[IMX27_CLK_SDHC3_IPG_GATE] = imx_clk_gate("sdhc3_ipg_gate", "ipg", CCM_PCCR0, 3);
+       clk[IMX27_CLK_SDHC2_IPG_GATE] = imx_clk_gate("sdhc2_ipg_gate", "ipg", CCM_PCCR0, 4);
+       clk[IMX27_CLK_SDHC1_IPG_GATE] = imx_clk_gate("sdhc1_ipg_gate", "ipg", CCM_PCCR0, 5);
+       clk[IMX27_CLK_SCC_IPG_GATE] = imx_clk_gate("scc_ipg_gate", "ipg", CCM_PCCR0, 6);
+       clk[IMX27_CLK_SAHARA_IPG_GATE] = imx_clk_gate("sahara_ipg_gate", "ipg", CCM_PCCR0, 7);
+       clk[IMX27_CLK_RTIC_IPG_GATE] = imx_clk_gate("rtic_ipg_gate", "ipg", CCM_PCCR0, 8);
+       clk[IMX27_CLK_RTC_IPG_GATE] = imx_clk_gate("rtc_ipg_gate", "ipg", CCM_PCCR0, 9);
+       clk[IMX27_CLK_PWM_IPG_GATE] = imx_clk_gate("pwm_ipg_gate", "ipg", CCM_PCCR0, 11);
+       clk[IMX27_CLK_OWIRE_IPG_GATE] = imx_clk_gate("owire_ipg_gate", "ipg", CCM_PCCR0, 12);
+       clk[IMX27_CLK_MSHC_IPG_GATE] = imx_clk_gate("mshc_ipg_gate", "ipg", CCM_PCCR0, 13);
+       clk[IMX27_CLK_LCDC_IPG_GATE] = imx_clk_gate("lcdc_ipg_gate", "ipg", CCM_PCCR0, 14);
+       clk[IMX27_CLK_KPP_IPG_GATE] = imx_clk_gate("kpp_ipg_gate", "ipg", CCM_PCCR0, 15);
+       clk[IMX27_CLK_IIM_IPG_GATE] = imx_clk_gate("iim_ipg_gate", "ipg", CCM_PCCR0, 16);
+       clk[IMX27_CLK_I2C2_IPG_GATE] = imx_clk_gate("i2c2_ipg_gate", "ipg", CCM_PCCR0, 17);
+       clk[IMX27_CLK_I2C1_IPG_GATE] = imx_clk_gate("i2c1_ipg_gate", "ipg", CCM_PCCR0, 18);
+       clk[IMX27_CLK_GPT6_IPG_GATE] = imx_clk_gate("gpt6_ipg_gate", "ipg", CCM_PCCR0, 19);
+       clk[IMX27_CLK_GPT5_IPG_GATE] = imx_clk_gate("gpt5_ipg_gate", "ipg", CCM_PCCR0, 20);
+       clk[IMX27_CLK_GPT4_IPG_GATE] = imx_clk_gate("gpt4_ipg_gate", "ipg", CCM_PCCR0, 21);
+       clk[IMX27_CLK_GPT3_IPG_GATE] = imx_clk_gate("gpt3_ipg_gate", "ipg", CCM_PCCR0, 22);
+       clk[IMX27_CLK_GPT2_IPG_GATE] = imx_clk_gate("gpt2_ipg_gate", "ipg", CCM_PCCR0, 23);
+       clk[IMX27_CLK_GPT1_IPG_GATE] = imx_clk_gate("gpt1_ipg_gate", "ipg", CCM_PCCR0, 24);
+       clk[IMX27_CLK_GPIO_IPG_GATE] = imx_clk_gate("gpio_ipg_gate", "ipg", CCM_PCCR0, 25);
+       clk[IMX27_CLK_FEC_IPG_GATE] = imx_clk_gate("fec_ipg_gate", "ipg", CCM_PCCR0, 26);
+       clk[IMX27_CLK_EMMA_IPG_GATE] = imx_clk_gate("emma_ipg_gate", "ipg", CCM_PCCR0, 27);
+       clk[IMX27_CLK_DMA_IPG_GATE] = imx_clk_gate("dma_ipg_gate", "ipg", CCM_PCCR0, 28);
+       clk[IMX27_CLK_CSPI3_IPG_GATE] = imx_clk_gate("cspi3_ipg_gate", "ipg", CCM_PCCR0, 29);
+       clk[IMX27_CLK_CSPI2_IPG_GATE] = imx_clk_gate("cspi2_ipg_gate", "ipg", CCM_PCCR0, 30);
+       clk[IMX27_CLK_CSPI1_IPG_GATE] = imx_clk_gate("cspi1_ipg_gate", "ipg", CCM_PCCR0, 31);
+       clk[IMX27_CLK_MSHC_BAUD_GATE] = imx_clk_gate("mshc_baud_gate", "mshc_div", CCM_PCCR1, 2);
+       clk[IMX27_CLK_NFC_BAUD_GATE] = imx_clk_gate("nfc_baud_gate", "nfc_div", CCM_PCCR1,  3);
+       clk[IMX27_CLK_SSI2_BAUD_GATE] = imx_clk_gate("ssi2_baud_gate", "ssi2_div", CCM_PCCR1,  4);
+       clk[IMX27_CLK_SSI1_BAUD_GATE] = imx_clk_gate("ssi1_baud_gate", "ssi1_div", CCM_PCCR1,  5);
+       clk[IMX27_CLK_VPU_BAUD_GATE] = imx_clk_gate("vpu_baud_gate", "vpu_div", CCM_PCCR1,  6);
+       clk[IMX27_CLK_PER4_GATE] = imx_clk_gate("per4_gate", "per4_div", CCM_PCCR1,  7);
+       clk[IMX27_CLK_PER3_GATE] = imx_clk_gate("per3_gate", "per3_div", CCM_PCCR1,  8);
+       clk[IMX27_CLK_PER2_GATE] = imx_clk_gate("per2_gate", "per2_div", CCM_PCCR1,  9);
+       clk[IMX27_CLK_PER1_GATE] = imx_clk_gate("per1_gate", "per1_div", CCM_PCCR1, 10);
+       clk[IMX27_CLK_USB_AHB_GATE] = imx_clk_gate("usb_ahb_gate", "ahb", CCM_PCCR1, 11);
+       clk[IMX27_CLK_SLCDC_AHB_GATE] = imx_clk_gate("slcdc_ahb_gate", "ahb", CCM_PCCR1, 12);
+       clk[IMX27_CLK_SAHARA_AHB_GATE] = imx_clk_gate("sahara_ahb_gate", "ahb", CCM_PCCR1, 13);
+       clk[IMX27_CLK_RTIC_AHB_GATE] = imx_clk_gate("rtic_ahb_gate", "ahb", CCM_PCCR1, 14);
+       clk[IMX27_CLK_LCDC_AHB_GATE] = imx_clk_gate("lcdc_ahb_gate", "ahb", CCM_PCCR1, 15);
+       clk[IMX27_CLK_VPU_AHB_GATE] = imx_clk_gate("vpu_ahb_gate", "ahb", CCM_PCCR1, 16);
+       clk[IMX27_CLK_FEC_AHB_GATE] = imx_clk_gate("fec_ahb_gate", "ahb", CCM_PCCR1, 17);
+       clk[IMX27_CLK_EMMA_AHB_GATE] = imx_clk_gate("emma_ahb_gate", "ahb", CCM_PCCR1, 18);
+       clk[IMX27_CLK_EMI_AHB_GATE] = imx_clk_gate("emi_ahb_gate", "ahb", CCM_PCCR1, 19);
+       clk[IMX27_CLK_DMA_AHB_GATE] = imx_clk_gate("dma_ahb_gate", "ahb", CCM_PCCR1, 20);
+       clk[IMX27_CLK_CSI_AHB_GATE] = imx_clk_gate("csi_ahb_gate", "ahb", CCM_PCCR1, 21);
+       clk[IMX27_CLK_BROM_AHB_GATE] = imx_clk_gate("brom_ahb_gate", "ahb", CCM_PCCR1, 22);
+       clk[IMX27_CLK_ATA_AHB_GATE] = imx_clk_gate("ata_ahb_gate", "ahb", CCM_PCCR1, 23);
+       clk[IMX27_CLK_WDOG_IPG_GATE] = imx_clk_gate("wdog_ipg_gate", "ipg", CCM_PCCR1, 24);
+       clk[IMX27_CLK_USB_IPG_GATE] = imx_clk_gate("usb_ipg_gate", "ipg", CCM_PCCR1, 25);
+       clk[IMX27_CLK_UART6_IPG_GATE] = imx_clk_gate("uart6_ipg_gate", "ipg", CCM_PCCR1, 26);
+       clk[IMX27_CLK_UART5_IPG_GATE] = imx_clk_gate("uart5_ipg_gate", "ipg", CCM_PCCR1, 27);
+       clk[IMX27_CLK_UART4_IPG_GATE] = imx_clk_gate("uart4_ipg_gate", "ipg", CCM_PCCR1, 28);
+       clk[IMX27_CLK_UART3_IPG_GATE] = imx_clk_gate("uart3_ipg_gate", "ipg", CCM_PCCR1, 29);
+       clk[IMX27_CLK_UART2_IPG_GATE] = imx_clk_gate("uart2_ipg_gate", "ipg", CCM_PCCR1, 30);
+       clk[IMX27_CLK_UART1_IPG_GATE] = imx_clk_gate("uart1_ipg_gate", "ipg", CCM_PCCR1, 31);
+
+       imx_check_clocks(clk, ARRAY_SIZE(clk));
+
+       clk_register_clkdev(clk[IMX27_CLK_CPU_DIV], NULL, "cpu0");
+
+       clk_prepare_enable(clk[IMX27_CLK_EMI_AHB_GATE]);
+
+       imx_print_silicon_rev("i.MX27", mx27_revision());
+}
+
+int __init mx27_clocks_init(unsigned long fref)
+{
+       ccm = ioremap(MX27_CCM_BASE_ADDR, SZ_4K);
+
+       _mx27_clocks_init(fref);
+
+       clk_register_clkdev(clk[IMX27_CLK_UART1_IPG_GATE], "ipg", "imx21-uart.0");
+       clk_register_clkdev(clk[IMX27_CLK_PER1_GATE], "per", "imx21-uart.0");
+       clk_register_clkdev(clk[IMX27_CLK_UART2_IPG_GATE], "ipg", "imx21-uart.1");
+       clk_register_clkdev(clk[IMX27_CLK_PER1_GATE], "per", "imx21-uart.1");
+       clk_register_clkdev(clk[IMX27_CLK_UART3_IPG_GATE], "ipg", "imx21-uart.2");
+       clk_register_clkdev(clk[IMX27_CLK_PER1_GATE], "per", "imx21-uart.2");
+       clk_register_clkdev(clk[IMX27_CLK_UART4_IPG_GATE], "ipg", "imx21-uart.3");
+       clk_register_clkdev(clk[IMX27_CLK_PER1_GATE], "per", "imx21-uart.3");
+       clk_register_clkdev(clk[IMX27_CLK_UART5_IPG_GATE], "ipg", "imx21-uart.4");
+       clk_register_clkdev(clk[IMX27_CLK_PER1_GATE], "per", "imx21-uart.4");
+       clk_register_clkdev(clk[IMX27_CLK_UART6_IPG_GATE], "ipg", "imx21-uart.5");
+       clk_register_clkdev(clk[IMX27_CLK_PER1_GATE], "per", "imx21-uart.5");
+       clk_register_clkdev(clk[IMX27_CLK_GPT1_IPG_GATE], "ipg", "imx-gpt.0");
+       clk_register_clkdev(clk[IMX27_CLK_PER1_GATE], "per", "imx-gpt.0");
+       clk_register_clkdev(clk[IMX27_CLK_PER2_GATE], "per", "imx21-mmc.0");
+       clk_register_clkdev(clk[IMX27_CLK_SDHC1_IPG_GATE], "ipg", "imx21-mmc.0");
+       clk_register_clkdev(clk[IMX27_CLK_PER2_GATE], "per", "imx21-mmc.1");
+       clk_register_clkdev(clk[IMX27_CLK_SDHC2_IPG_GATE], "ipg", "imx21-mmc.1");
+       clk_register_clkdev(clk[IMX27_CLK_PER2_GATE], "per", "imx21-mmc.2");
+       clk_register_clkdev(clk[IMX27_CLK_SDHC2_IPG_GATE], "ipg", "imx21-mmc.2");
+       clk_register_clkdev(clk[IMX27_CLK_PER2_GATE], "per", "imx27-cspi.0");
+       clk_register_clkdev(clk[IMX27_CLK_CSPI1_IPG_GATE], "ipg", "imx27-cspi.0");
+       clk_register_clkdev(clk[IMX27_CLK_PER2_GATE], "per", "imx27-cspi.1");
+       clk_register_clkdev(clk[IMX27_CLK_CSPI2_IPG_GATE], "ipg", "imx27-cspi.1");
+       clk_register_clkdev(clk[IMX27_CLK_PER2_GATE], "per", "imx27-cspi.2");
+       clk_register_clkdev(clk[IMX27_CLK_CSPI3_IPG_GATE], "ipg", "imx27-cspi.2");
+       clk_register_clkdev(clk[IMX27_CLK_PER3_GATE], "per", "imx21-fb.0");
+       clk_register_clkdev(clk[IMX27_CLK_LCDC_IPG_GATE], "ipg", "imx21-fb.0");
+       clk_register_clkdev(clk[IMX27_CLK_LCDC_AHB_GATE], "ahb", "imx21-fb.0");
+       clk_register_clkdev(clk[IMX27_CLK_CSI_AHB_GATE], "ahb", "imx27-camera.0");
+       clk_register_clkdev(clk[IMX27_CLK_PER4_GATE], "per", "imx27-camera.0");
+       clk_register_clkdev(clk[IMX27_CLK_USB_DIV], "per", "imx-udc-mx27");
+       clk_register_clkdev(clk[IMX27_CLK_USB_IPG_GATE], "ipg", "imx-udc-mx27");
+       clk_register_clkdev(clk[IMX27_CLK_USB_AHB_GATE], "ahb", "imx-udc-mx27");
+       clk_register_clkdev(clk[IMX27_CLK_USB_DIV], "per", "mxc-ehci.0");
+       clk_register_clkdev(clk[IMX27_CLK_USB_IPG_GATE], "ipg", "mxc-ehci.0");
+       clk_register_clkdev(clk[IMX27_CLK_USB_AHB_GATE], "ahb", "mxc-ehci.0");
+       clk_register_clkdev(clk[IMX27_CLK_USB_DIV], "per", "mxc-ehci.1");
+       clk_register_clkdev(clk[IMX27_CLK_USB_IPG_GATE], "ipg", "mxc-ehci.1");
+       clk_register_clkdev(clk[IMX27_CLK_USB_AHB_GATE], "ahb", "mxc-ehci.1");
+       clk_register_clkdev(clk[IMX27_CLK_USB_DIV], "per", "mxc-ehci.2");
+       clk_register_clkdev(clk[IMX27_CLK_USB_IPG_GATE], "ipg", "mxc-ehci.2");
+       clk_register_clkdev(clk[IMX27_CLK_USB_AHB_GATE], "ahb", "mxc-ehci.2");
+       clk_register_clkdev(clk[IMX27_CLK_SSI1_IPG_GATE], NULL, "imx-ssi.0");
+       clk_register_clkdev(clk[IMX27_CLK_SSI2_IPG_GATE], NULL, "imx-ssi.1");
+       clk_register_clkdev(clk[IMX27_CLK_NFC_BAUD_GATE], NULL, "imx27-nand.0");
+       clk_register_clkdev(clk[IMX27_CLK_VPU_BAUD_GATE], "per", "coda-imx27.0");
+       clk_register_clkdev(clk[IMX27_CLK_VPU_AHB_GATE], "ahb", "coda-imx27.0");
+       clk_register_clkdev(clk[IMX27_CLK_DMA_AHB_GATE], "ahb", "imx27-dma");
+       clk_register_clkdev(clk[IMX27_CLK_DMA_IPG_GATE], "ipg", "imx27-dma");
+       clk_register_clkdev(clk[IMX27_CLK_FEC_IPG_GATE], "ipg", "imx27-fec.0");
+       clk_register_clkdev(clk[IMX27_CLK_FEC_AHB_GATE], "ahb", "imx27-fec.0");
+       clk_register_clkdev(clk[IMX27_CLK_WDOG_IPG_GATE], NULL, "imx2-wdt.0");
+       clk_register_clkdev(clk[IMX27_CLK_I2C1_IPG_GATE], NULL, "imx21-i2c.0");
+       clk_register_clkdev(clk[IMX27_CLK_I2C2_IPG_GATE], NULL, "imx21-i2c.1");
+       clk_register_clkdev(clk[IMX27_CLK_OWIRE_IPG_GATE], NULL, "mxc_w1.0");
+       clk_register_clkdev(clk[IMX27_CLK_KPP_IPG_GATE], NULL, "imx-keypad");
+       clk_register_clkdev(clk[IMX27_CLK_EMMA_AHB_GATE], "emma-ahb", "imx27-camera.0");
+       clk_register_clkdev(clk[IMX27_CLK_EMMA_IPG_GATE], "emma-ipg", "imx27-camera.0");
+       clk_register_clkdev(clk[IMX27_CLK_EMMA_AHB_GATE], "ahb", "m2m-emmaprp.0");
+       clk_register_clkdev(clk[IMX27_CLK_EMMA_IPG_GATE], "ipg", "m2m-emmaprp.0");
+
+       mxc_timer_init(MX27_GPT1_BASE_ADDR, MX27_INT_GPT1, GPT_TYPE_IMX21);
+
+       return 0;
+}
+
+static void __init mx27_clocks_init_dt(struct device_node *np)
+{
+       struct device_node *refnp;
+       u32 fref = 26000000; /* default */
+
+       for_each_compatible_node(refnp, NULL, "fixed-clock") {
+               if (!of_device_is_compatible(refnp, "fsl,imx-osc26m"))
+                       continue;
+
+               if (!of_property_read_u32(refnp, "clock-frequency", &fref))
+                       break;
+       }
+
+       ccm = of_iomap(np, 0);
+
+       _mx27_clocks_init(fref);
+
+       clk_data.clks = clk;
+       clk_data.clk_num = ARRAY_SIZE(clk);
+       of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
+}
+CLK_OF_DECLARE(imx27_ccm, "fsl,imx27-ccm", mx27_clocks_init_dt);
diff --git a/drivers/clk/imx/clk-imx31.c b/drivers/clk/imx/clk-imx31.c
new file mode 100644 (file)
index 0000000..fe66c40
--- /dev/null
@@ -0,0 +1,221 @@
+/*
+ * Copyright (C) 2012 Sascha Hauer <kernel@pengutronix.de>
+ *
+ * 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.
+ */
+
+#include <linux/module.h>
+#include <linux/clk.h>
+#include <linux/clkdev.h>
+#include <linux/io.h>
+#include <linux/err.h>
+#include <linux/of.h>
+#include <soc/imx/revision.h>
+#include <soc/imx/timer.h>
+#include <asm/irq.h>
+
+#include "clk.h"
+
+#define MX31_CCM_BASE_ADDR     0x53f80000
+#define MX31_GPT1_BASE_ADDR    0x53f90000
+#define MX31_INT_GPT           (NR_IRQS_LEGACY + 29)
+
+#define MXC_CCM_CCMR           0x00
+#define MXC_CCM_PDR0           0x04
+#define MXC_CCM_PDR1           0x08
+#define MXC_CCM_MPCTL          0x10
+#define MXC_CCM_UPCTL          0x14
+#define MXC_CCM_SRPCTL         0x18
+#define MXC_CCM_CGR0           0x20
+#define MXC_CCM_CGR1           0x24
+#define MXC_CCM_CGR2           0x28
+#define MXC_CCM_PMCR0          0x5c
+
+static const char *mcu_main_sel[] = { "spll", "mpll", };
+static const char *per_sel[] = { "per_div", "ipg", };
+static const char *csi_sel[] = { "upll", "spll", };
+static const char *fir_sel[] = { "mcu_main", "upll", "spll" };
+
+enum mx31_clks {
+       dummy, ckih, ckil, mpll, spll, upll, mcu_main, hsp, ahb, nfc, ipg,
+       per_div, per, csi, fir, csi_div, usb_div_pre, usb_div_post, fir_div_pre,
+       fir_div_post, sdhc1_gate, sdhc2_gate, gpt_gate, epit1_gate, epit2_gate,
+       iim_gate, ata_gate, sdma_gate, cspi3_gate, rng_gate, uart1_gate,
+       uart2_gate, ssi1_gate, i2c1_gate, i2c2_gate, i2c3_gate, hantro_gate,
+       mstick1_gate, mstick2_gate, csi_gate, rtc_gate, wdog_gate, pwm_gate,
+       sim_gate, ect_gate, usb_gate, kpp_gate, ipu_gate, uart3_gate,
+       uart4_gate, uart5_gate, owire_gate, ssi2_gate, cspi1_gate, cspi2_gate,
+       gacc_gate, emi_gate, rtic_gate, firi_gate, clk_max
+};
+
+static struct clk *clk[clk_max];
+static struct clk_onecell_data clk_data;
+
+int __init mx31_clocks_init(unsigned long fref)
+{
+       void __iomem *base;
+       struct device_node *np;
+
+       base = ioremap(MX31_CCM_BASE_ADDR, SZ_4K);
+       BUG_ON(!base);
+
+       clk[dummy] = imx_clk_fixed("dummy", 0);
+       clk[ckih] = imx_clk_fixed("ckih", fref);
+       clk[ckil] = imx_clk_fixed("ckil", 32768);
+       clk[mpll] = imx_clk_pllv1(IMX_PLLV1_IMX31, "mpll", "ckih", base + MXC_CCM_MPCTL);
+       clk[spll] = imx_clk_pllv1(IMX_PLLV1_IMX31, "spll", "ckih", base + MXC_CCM_SRPCTL);
+       clk[upll] = imx_clk_pllv1(IMX_PLLV1_IMX31, "upll", "ckih", base + MXC_CCM_UPCTL);
+       clk[mcu_main] = imx_clk_mux("mcu_main", base + MXC_CCM_PMCR0, 31, 1, mcu_main_sel, ARRAY_SIZE(mcu_main_sel));
+       clk[hsp] = imx_clk_divider("hsp", "mcu_main", base + MXC_CCM_PDR0, 11, 3);
+       clk[ahb] = imx_clk_divider("ahb", "mcu_main", base + MXC_CCM_PDR0, 3, 3);
+       clk[nfc] = imx_clk_divider("nfc", "ahb", base + MXC_CCM_PDR0, 8, 3);
+       clk[ipg] = imx_clk_divider("ipg", "ahb", base + MXC_CCM_PDR0, 6, 2);
+       clk[per_div] = imx_clk_divider("per_div", "upll", base + MXC_CCM_PDR0, 16, 5);
+       clk[per] = imx_clk_mux("per", base + MXC_CCM_CCMR, 24, 1, per_sel, ARRAY_SIZE(per_sel));
+       clk[csi] = imx_clk_mux("csi_sel", base + MXC_CCM_CCMR, 25, 1, csi_sel, ARRAY_SIZE(csi_sel));
+       clk[fir] = imx_clk_mux("fir_sel", base + MXC_CCM_CCMR, 11, 2, fir_sel, ARRAY_SIZE(fir_sel));
+       clk[csi_div] = imx_clk_divider("csi_div", "csi_sel", base + MXC_CCM_PDR0, 23, 9);
+       clk[usb_div_pre] = imx_clk_divider("usb_div_pre", "upll", base + MXC_CCM_PDR1, 30, 2);
+       clk[usb_div_post] = imx_clk_divider("usb_div_post", "usb_div_pre", base + MXC_CCM_PDR1, 27, 3);
+       clk[fir_div_pre] = imx_clk_divider("fir_div_pre", "fir_sel", base + MXC_CCM_PDR1, 24, 3);
+       clk[fir_div_post] = imx_clk_divider("fir_div_post", "fir_div_pre", base + MXC_CCM_PDR1, 23, 6);
+       clk[sdhc1_gate] = imx_clk_gate2("sdhc1_gate", "per", base + MXC_CCM_CGR0, 0);
+       clk[sdhc2_gate] = imx_clk_gate2("sdhc2_gate", "per", base + MXC_CCM_CGR0, 2);
+       clk[gpt_gate] = imx_clk_gate2("gpt_gate", "per", base + MXC_CCM_CGR0, 4);
+       clk[epit1_gate] = imx_clk_gate2("epit1_gate", "per", base + MXC_CCM_CGR0, 6);
+       clk[epit2_gate] = imx_clk_gate2("epit2_gate", "per", base + MXC_CCM_CGR0, 8);
+       clk[iim_gate] = imx_clk_gate2("iim_gate", "ipg", base + MXC_CCM_CGR0, 10);
+       clk[ata_gate] = imx_clk_gate2("ata_gate", "ipg", base + MXC_CCM_CGR0, 12);
+       clk[sdma_gate] = imx_clk_gate2("sdma_gate", "ahb", base + MXC_CCM_CGR0, 14);
+       clk[cspi3_gate] = imx_clk_gate2("cspi3_gate", "ipg", base + MXC_CCM_CGR0, 16);
+       clk[rng_gate] = imx_clk_gate2("rng_gate", "ipg", base + MXC_CCM_CGR0, 18);
+       clk[uart1_gate] = imx_clk_gate2("uart1_gate", "per", base + MXC_CCM_CGR0, 20);
+       clk[uart2_gate] = imx_clk_gate2("uart2_gate", "per", base + MXC_CCM_CGR0, 22);
+       clk[ssi1_gate] = imx_clk_gate2("ssi1_gate", "spll", base + MXC_CCM_CGR0, 24);
+       clk[i2c1_gate] = imx_clk_gate2("i2c1_gate", "per", base + MXC_CCM_CGR0, 26);
+       clk[i2c2_gate] = imx_clk_gate2("i2c2_gate", "per", base + MXC_CCM_CGR0, 28);
+       clk[i2c3_gate] = imx_clk_gate2("i2c3_gate", "per", base + MXC_CCM_CGR0, 30);
+       clk[hantro_gate] = imx_clk_gate2("hantro_gate", "per", base + MXC_CCM_CGR1, 0);
+       clk[mstick1_gate] = imx_clk_gate2("mstick1_gate", "per", base + MXC_CCM_CGR1, 2);
+       clk[mstick2_gate] = imx_clk_gate2("mstick2_gate", "per", base + MXC_CCM_CGR1, 4);
+       clk[csi_gate] = imx_clk_gate2("csi_gate", "csi_div", base + MXC_CCM_CGR1, 6);
+       clk[rtc_gate] = imx_clk_gate2("rtc_gate", "ipg", base + MXC_CCM_CGR1, 8);
+       clk[wdog_gate] = imx_clk_gate2("wdog_gate", "ipg", base + MXC_CCM_CGR1, 10);
+       clk[pwm_gate] = imx_clk_gate2("pwm_gate", "per", base + MXC_CCM_CGR1, 12);
+       clk[sim_gate] = imx_clk_gate2("sim_gate", "per", base + MXC_CCM_CGR1, 14);
+       clk[ect_gate] = imx_clk_gate2("ect_gate", "per", base + MXC_CCM_CGR1, 16);
+       clk[usb_gate] = imx_clk_gate2("usb_gate", "ahb", base + MXC_CCM_CGR1, 18);
+       clk[kpp_gate] = imx_clk_gate2("kpp_gate", "ipg", base + MXC_CCM_CGR1, 20);
+       clk[ipu_gate] = imx_clk_gate2("ipu_gate", "hsp", base + MXC_CCM_CGR1, 22);
+       clk[uart3_gate] = imx_clk_gate2("uart3_gate", "per", base + MXC_CCM_CGR1, 24);
+       clk[uart4_gate] = imx_clk_gate2("uart4_gate", "per", base + MXC_CCM_CGR1, 26);
+       clk[uart5_gate] = imx_clk_gate2("uart5_gate", "per", base + MXC_CCM_CGR1, 28);
+       clk[owire_gate] = imx_clk_gate2("owire_gate", "per", base + MXC_CCM_CGR1, 30);
+       clk[ssi2_gate] = imx_clk_gate2("ssi2_gate", "spll", base + MXC_CCM_CGR2, 0);
+       clk[cspi1_gate] = imx_clk_gate2("cspi1_gate", "ipg", base + MXC_CCM_CGR2, 2);
+       clk[cspi2_gate] = imx_clk_gate2("cspi2_gate", "ipg", base + MXC_CCM_CGR2, 4);
+       clk[gacc_gate] = imx_clk_gate2("gacc_gate", "per", base + MXC_CCM_CGR2, 6);
+       clk[emi_gate] = imx_clk_gate2("emi_gate", "ahb", base + MXC_CCM_CGR2, 8);
+       clk[rtic_gate] = imx_clk_gate2("rtic_gate", "ahb", base + MXC_CCM_CGR2, 10);
+       clk[firi_gate] = imx_clk_gate2("firi_gate", "upll", base+MXC_CCM_CGR2, 12);
+
+       imx_check_clocks(clk, ARRAY_SIZE(clk));
+
+       np = of_find_compatible_node(NULL, NULL, "fsl,imx31-ccm");
+
+       if (np) {
+               clk_data.clks = clk;
+               clk_data.clk_num = ARRAY_SIZE(clk);
+               of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
+       }
+
+       clk_register_clkdev(clk[gpt_gate], "per", "imx-gpt.0");
+       clk_register_clkdev(clk[ipg], "ipg", "imx-gpt.0");
+       clk_register_clkdev(clk[cspi1_gate], NULL, "imx31-cspi.0");
+       clk_register_clkdev(clk[cspi2_gate], NULL, "imx31-cspi.1");
+       clk_register_clkdev(clk[cspi3_gate], NULL, "imx31-cspi.2");
+       clk_register_clkdev(clk[pwm_gate], "pwm", NULL);
+       clk_register_clkdev(clk[wdog_gate], NULL, "imx2-wdt.0");
+       clk_register_clkdev(clk[rtc_gate], NULL, "imx21-rtc");
+       clk_register_clkdev(clk[epit1_gate], "epit", NULL);
+       clk_register_clkdev(clk[epit2_gate], "epit", NULL);
+       clk_register_clkdev(clk[nfc], NULL, "imx27-nand.0");
+       clk_register_clkdev(clk[ipu_gate], NULL, "ipu-core");
+       clk_register_clkdev(clk[ipu_gate], NULL, "mx3_sdc_fb");
+       clk_register_clkdev(clk[kpp_gate], NULL, "imx-keypad");
+       clk_register_clkdev(clk[usb_div_post], "per", "mxc-ehci.0");
+       clk_register_clkdev(clk[usb_gate], "ahb", "mxc-ehci.0");
+       clk_register_clkdev(clk[ipg], "ipg", "mxc-ehci.0");
+       clk_register_clkdev(clk[usb_div_post], "per", "mxc-ehci.1");
+       clk_register_clkdev(clk[usb_gate], "ahb", "mxc-ehci.1");
+       clk_register_clkdev(clk[ipg], "ipg", "mxc-ehci.1");
+       clk_register_clkdev(clk[usb_div_post], "per", "mxc-ehci.2");
+       clk_register_clkdev(clk[usb_gate], "ahb", "mxc-ehci.2");
+       clk_register_clkdev(clk[ipg], "ipg", "mxc-ehci.2");
+       clk_register_clkdev(clk[usb_div_post], "per", "imx-udc-mx27");
+       clk_register_clkdev(clk[usb_gate], "ahb", "imx-udc-mx27");
+       clk_register_clkdev(clk[ipg], "ipg", "imx-udc-mx27");
+       clk_register_clkdev(clk[csi_gate], NULL, "mx3-camera.0");
+       /* i.mx31 has the i.mx21 type uart */
+       clk_register_clkdev(clk[uart1_gate], "per", "imx21-uart.0");
+       clk_register_clkdev(clk[ipg], "ipg", "imx21-uart.0");
+       clk_register_clkdev(clk[uart2_gate], "per", "imx21-uart.1");
+       clk_register_clkdev(clk[ipg], "ipg", "imx21-uart.1");
+       clk_register_clkdev(clk[uart3_gate], "per", "imx21-uart.2");
+       clk_register_clkdev(clk[ipg], "ipg", "imx21-uart.2");
+       clk_register_clkdev(clk[uart4_gate], "per", "imx21-uart.3");
+       clk_register_clkdev(clk[ipg], "ipg", "imx21-uart.3");
+       clk_register_clkdev(clk[uart5_gate], "per", "imx21-uart.4");
+       clk_register_clkdev(clk[ipg], "ipg", "imx21-uart.4");
+       clk_register_clkdev(clk[i2c1_gate], NULL, "imx21-i2c.0");
+       clk_register_clkdev(clk[i2c2_gate], NULL, "imx21-i2c.1");
+       clk_register_clkdev(clk[i2c3_gate], NULL, "imx21-i2c.2");
+       clk_register_clkdev(clk[owire_gate], NULL, "mxc_w1.0");
+       clk_register_clkdev(clk[sdhc1_gate], NULL, "imx31-mmc.0");
+       clk_register_clkdev(clk[sdhc2_gate], NULL, "imx31-mmc.1");
+       clk_register_clkdev(clk[ssi1_gate], NULL, "imx-ssi.0");
+       clk_register_clkdev(clk[ssi2_gate], NULL, "imx-ssi.1");
+       clk_register_clkdev(clk[firi_gate], "firi", NULL);
+       clk_register_clkdev(clk[ata_gate], NULL, "pata_imx");
+       clk_register_clkdev(clk[rtic_gate], "rtic", NULL);
+       clk_register_clkdev(clk[rng_gate], NULL, "mxc_rnga");
+       clk_register_clkdev(clk[sdma_gate], NULL, "imx31-sdma");
+       clk_register_clkdev(clk[iim_gate], "iim", NULL);
+
+       clk_set_parent(clk[csi], clk[upll]);
+       clk_prepare_enable(clk[emi_gate]);
+       clk_prepare_enable(clk[iim_gate]);
+       mx31_revision();
+       clk_disable_unprepare(clk[iim_gate]);
+
+       mxc_timer_init(MX31_GPT1_BASE_ADDR, MX31_INT_GPT, GPT_TYPE_IMX31);
+
+       return 0;
+}
+
+int __init mx31_clocks_init_dt(void)
+{
+       struct device_node *np;
+       u32 fref = 26000000; /* default */
+
+       for_each_compatible_node(np, NULL, "fixed-clock") {
+               if (!of_device_is_compatible(np, "fsl,imx-osc26m"))
+                       continue;
+
+               if (!of_property_read_u32(np, "clock-frequency", &fref))
+                       break;
+       }
+
+       return mx31_clocks_init(fref);
+}
diff --git a/drivers/clk/imx/clk-imx35.c b/drivers/clk/imx/clk-imx35.c
new file mode 100644 (file)
index 0000000..69138ba
--- /dev/null
@@ -0,0 +1,310 @@
+/*
+ * Copyright (C) 2012 Sascha Hauer, Pengutronix <s.hauer@pengutronix.de>
+ *
+ * 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/mm.h>
+#include <linux/delay.h>
+#include <linux/clk.h>
+#include <linux/io.h>
+#include <linux/clkdev.h>
+#include <linux/of.h>
+#include <linux/err.h>
+#include <soc/imx/revision.h>
+#include <soc/imx/timer.h>
+#include <asm/irq.h>
+
+#include "clk.h"
+
+#define MX35_CCM_BASE_ADDR     0x53f80000
+#define MX35_GPT1_BASE_ADDR    0x53f90000
+#define MX35_INT_GPT           (NR_IRQS_LEGACY + 29)
+
+#define MXC_CCM_PDR0           0x04
+#define MX35_CCM_PDR2          0x0c
+#define MX35_CCM_PDR3          0x10
+#define MX35_CCM_PDR4          0x14
+#define MX35_CCM_MPCTL         0x1c
+#define MX35_CCM_PPCTL         0x20
+#define MX35_CCM_CGR0          0x2c
+#define MX35_CCM_CGR1          0x30
+#define MX35_CCM_CGR2          0x34
+#define MX35_CCM_CGR3          0x38
+
+struct arm_ahb_div {
+       unsigned char arm, ahb, sel;
+};
+
+static struct arm_ahb_div clk_consumer[] = {
+       { .arm = 1, .ahb = 4, .sel = 0},
+       { .arm = 1, .ahb = 3, .sel = 1},
+       { .arm = 2, .ahb = 2, .sel = 0},
+       { .arm = 0, .ahb = 0, .sel = 0},
+       { .arm = 0, .ahb = 0, .sel = 0},
+       { .arm = 0, .ahb = 0, .sel = 0},
+       { .arm = 4, .ahb = 1, .sel = 0},
+       { .arm = 1, .ahb = 5, .sel = 0},
+       { .arm = 1, .ahb = 8, .sel = 0},
+       { .arm = 1, .ahb = 6, .sel = 1},
+       { .arm = 2, .ahb = 4, .sel = 0},
+       { .arm = 0, .ahb = 0, .sel = 0},
+       { .arm = 0, .ahb = 0, .sel = 0},
+       { .arm = 0, .ahb = 0, .sel = 0},
+       { .arm = 4, .ahb = 2, .sel = 0},
+       { .arm = 0, .ahb = 0, .sel = 0},
+};
+
+static char hsp_div_532[] = { 4, 8, 3, 0 };
+static char hsp_div_400[] = { 3, 6, 3, 0 };
+
+static struct clk_onecell_data clk_data;
+
+static const char *std_sel[] = {"ppll", "arm"};
+static const char *ipg_per_sel[] = {"ahb_per_div", "arm_per_div"};
+
+enum mx35_clks {
+       ckih, mpll, ppll, mpll_075, arm, hsp, hsp_div, hsp_sel, ahb, ipg,
+       arm_per_div, ahb_per_div, ipg_per, uart_sel, uart_div, esdhc_sel,
+       esdhc1_div, esdhc2_div, esdhc3_div, spdif_sel, spdif_div_pre,
+       spdif_div_post, ssi_sel, ssi1_div_pre, ssi1_div_post, ssi2_div_pre,
+       ssi2_div_post, usb_sel, usb_div, nfc_div, asrc_gate, pata_gate,
+       audmux_gate, can1_gate, can2_gate, cspi1_gate, cspi2_gate, ect_gate,
+       edio_gate, emi_gate, epit1_gate, epit2_gate, esai_gate, esdhc1_gate,
+       esdhc2_gate, esdhc3_gate, fec_gate, gpio1_gate, gpio2_gate, gpio3_gate,
+       gpt_gate, i2c1_gate, i2c2_gate, i2c3_gate, iomuxc_gate, ipu_gate,
+       kpp_gate, mlb_gate, mshc_gate, owire_gate, pwm_gate, rngc_gate,
+       rtc_gate, rtic_gate, scc_gate, sdma_gate, spba_gate, spdif_gate,
+       ssi1_gate, ssi2_gate, uart1_gate, uart2_gate, uart3_gate, usbotg_gate,
+       wdog_gate, max_gate, admux_gate, csi_gate, csi_div, csi_sel, iim_gate,
+       gpu2d_gate, clk_max
+};
+
+static struct clk *clk[clk_max];
+
+int __init mx35_clocks_init(void)
+{
+       void __iomem *base;
+       u32 pdr0, consumer_sel, hsp_sel;
+       struct arm_ahb_div *aad;
+       unsigned char *hsp_div;
+
+       base = ioremap(MX35_CCM_BASE_ADDR, SZ_4K);
+       BUG_ON(!base);
+
+       pdr0 = __raw_readl(base + MXC_CCM_PDR0);
+       consumer_sel = (pdr0 >> 16) & 0xf;
+       aad = &clk_consumer[consumer_sel];
+       if (!aad->arm) {
+               pr_err("i.MX35 clk: illegal consumer mux selection 0x%x\n", consumer_sel);
+               /*
+                * We are basically stuck. Continue with a default entry and hope we
+                * get far enough to actually show the above message
+                */
+               aad = &clk_consumer[0];
+       }
+
+       clk[ckih] = imx_clk_fixed("ckih", 24000000);
+       clk[mpll] = imx_clk_pllv1(IMX_PLLV1_IMX35, "mpll", "ckih", base + MX35_CCM_MPCTL);
+       clk[ppll] = imx_clk_pllv1(IMX_PLLV1_IMX35, "ppll", "ckih", base + MX35_CCM_PPCTL);
+
+       clk[mpll] = imx_clk_fixed_factor("mpll_075", "mpll", 3, 4);
+
+       if (aad->sel)
+               clk[arm] = imx_clk_fixed_factor("arm", "mpll_075", 1, aad->arm);
+       else
+               clk[arm] = imx_clk_fixed_factor("arm", "mpll", 1, aad->arm);
+
+       if (clk_get_rate(clk[arm]) > 400000000)
+               hsp_div = hsp_div_532;
+       else
+               hsp_div = hsp_div_400;
+
+       hsp_sel = (pdr0 >> 20) & 0x3;
+       if (!hsp_div[hsp_sel]) {
+               pr_err("i.MX35 clk: illegal hsp clk selection 0x%x\n", hsp_sel);
+               hsp_sel = 0;
+       }
+
+       clk[hsp] = imx_clk_fixed_factor("hsp", "arm", 1, hsp_div[hsp_sel]);
+
+       clk[ahb] = imx_clk_fixed_factor("ahb", "arm", 1, aad->ahb);
+       clk[ipg] = imx_clk_fixed_factor("ipg", "ahb", 1, 2);
+
+       clk[arm_per_div] = imx_clk_divider("arm_per_div", "arm", base + MX35_CCM_PDR4, 16, 6);
+       clk[ahb_per_div] = imx_clk_divider("ahb_per_div", "ahb", base + MXC_CCM_PDR0, 12, 3);
+       clk[ipg_per] = imx_clk_mux("ipg_per", base + MXC_CCM_PDR0, 26, 1, ipg_per_sel, ARRAY_SIZE(ipg_per_sel));
+
+       clk[uart_sel] = imx_clk_mux("uart_sel", base + MX35_CCM_PDR3, 14, 1, std_sel, ARRAY_SIZE(std_sel));
+       clk[uart_div] = imx_clk_divider("uart_div", "uart_sel", base + MX35_CCM_PDR4, 10, 6);
+
+       clk[esdhc_sel] = imx_clk_mux("esdhc_sel", base + MX35_CCM_PDR4, 9, 1, std_sel, ARRAY_SIZE(std_sel));
+       clk[esdhc1_div] = imx_clk_divider("esdhc1_div", "esdhc_sel", base + MX35_CCM_PDR3, 0, 6);
+       clk[esdhc2_div] = imx_clk_divider("esdhc2_div", "esdhc_sel", base + MX35_CCM_PDR3, 8, 6);
+       clk[esdhc3_div] = imx_clk_divider("esdhc3_div", "esdhc_sel", base + MX35_CCM_PDR3, 16, 6);
+
+       clk[spdif_sel] = imx_clk_mux("spdif_sel", base + MX35_CCM_PDR3, 22, 1, std_sel, ARRAY_SIZE(std_sel));
+       clk[spdif_div_pre] = imx_clk_divider("spdif_div_pre", "spdif_sel", base + MX35_CCM_PDR3, 29, 3); /* divide by 1 not allowed */ 
+       clk[spdif_div_post] = imx_clk_divider("spdif_div_post", "spdif_div_pre", base + MX35_CCM_PDR3, 23, 6);
+
+       clk[ssi_sel] = imx_clk_mux("ssi_sel", base + MX35_CCM_PDR2, 6, 1, std_sel, ARRAY_SIZE(std_sel));
+       clk[ssi1_div_pre] = imx_clk_divider("ssi1_div_pre", "ssi_sel", base + MX35_CCM_PDR2, 24, 3);
+       clk[ssi1_div_post] = imx_clk_divider("ssi1_div_post", "ssi1_div_pre", base + MX35_CCM_PDR2, 0, 6);
+       clk[ssi2_div_pre] = imx_clk_divider("ssi2_div_pre", "ssi_sel", base + MX35_CCM_PDR2, 27, 3);
+       clk[ssi2_div_post] = imx_clk_divider("ssi2_div_post", "ssi2_div_pre", base + MX35_CCM_PDR2, 8, 6);
+
+       clk[usb_sel] = imx_clk_mux("usb_sel", base + MX35_CCM_PDR4, 9, 1, std_sel, ARRAY_SIZE(std_sel));
+       clk[usb_div] = imx_clk_divider("usb_div", "usb_sel", base + MX35_CCM_PDR4, 22, 6);
+
+       clk[nfc_div] = imx_clk_divider("nfc_div", "ahb", base + MX35_CCM_PDR4, 28, 4);
+
+       clk[csi_sel] = imx_clk_mux("csi_sel", base + MX35_CCM_PDR2, 7, 1, std_sel, ARRAY_SIZE(std_sel));
+       clk[csi_div] = imx_clk_divider("csi_div", "csi_sel", base + MX35_CCM_PDR2, 16, 6);
+
+       clk[asrc_gate] = imx_clk_gate2("asrc_gate", "ipg", base + MX35_CCM_CGR0,  0);
+       clk[pata_gate] = imx_clk_gate2("pata_gate", "ipg", base + MX35_CCM_CGR0,  2);
+       clk[audmux_gate] = imx_clk_gate2("audmux_gate", "ipg", base + MX35_CCM_CGR0,  4);
+       clk[can1_gate] = imx_clk_gate2("can1_gate", "ipg", base + MX35_CCM_CGR0,  6);
+       clk[can2_gate] = imx_clk_gate2("can2_gate", "ipg", base + MX35_CCM_CGR0,  8);
+       clk[cspi1_gate] = imx_clk_gate2("cspi1_gate", "ipg", base + MX35_CCM_CGR0, 10);
+       clk[cspi2_gate] = imx_clk_gate2("cspi2_gate", "ipg", base + MX35_CCM_CGR0, 12);
+       clk[ect_gate] = imx_clk_gate2("ect_gate", "ipg", base + MX35_CCM_CGR0, 14);
+       clk[edio_gate] = imx_clk_gate2("edio_gate",   "ipg", base + MX35_CCM_CGR0, 16);
+       clk[emi_gate] = imx_clk_gate2("emi_gate", "ipg", base + MX35_CCM_CGR0, 18);
+       clk[epit1_gate] = imx_clk_gate2("epit1_gate", "ipg", base + MX35_CCM_CGR0, 20);
+       clk[epit2_gate] = imx_clk_gate2("epit2_gate", "ipg", base + MX35_CCM_CGR0, 22);
+       clk[esai_gate] = imx_clk_gate2("esai_gate",   "ipg", base + MX35_CCM_CGR0, 24);
+       clk[esdhc1_gate] = imx_clk_gate2("esdhc1_gate", "esdhc1_div", base + MX35_CCM_CGR0, 26);
+       clk[esdhc2_gate] = imx_clk_gate2("esdhc2_gate", "esdhc2_div", base + MX35_CCM_CGR0, 28);
+       clk[esdhc3_gate] = imx_clk_gate2("esdhc3_gate", "esdhc3_div", base + MX35_CCM_CGR0, 30);
+
+       clk[fec_gate] = imx_clk_gate2("fec_gate", "ipg", base + MX35_CCM_CGR1,  0);
+       clk[gpio1_gate] = imx_clk_gate2("gpio1_gate", "ipg", base + MX35_CCM_CGR1,  2);
+       clk[gpio2_gate] = imx_clk_gate2("gpio2_gate", "ipg", base + MX35_CCM_CGR1,  4);
+       clk[gpio3_gate] = imx_clk_gate2("gpio3_gate", "ipg", base + MX35_CCM_CGR1,  6);
+       clk[gpt_gate] = imx_clk_gate2("gpt_gate", "ipg", base + MX35_CCM_CGR1,  8);
+       clk[i2c1_gate] = imx_clk_gate2("i2c1_gate", "ipg_per", base + MX35_CCM_CGR1, 10);
+       clk[i2c2_gate] = imx_clk_gate2("i2c2_gate", "ipg_per", base + MX35_CCM_CGR1, 12);
+       clk[i2c3_gate] = imx_clk_gate2("i2c3_gate", "ipg_per", base + MX35_CCM_CGR1, 14);
+       clk[iomuxc_gate] = imx_clk_gate2("iomuxc_gate", "ipg", base + MX35_CCM_CGR1, 16);
+       clk[ipu_gate] = imx_clk_gate2("ipu_gate", "hsp", base + MX35_CCM_CGR1, 18);
+       clk[kpp_gate] = imx_clk_gate2("kpp_gate", "ipg", base + MX35_CCM_CGR1, 20);
+       clk[mlb_gate] = imx_clk_gate2("mlb_gate", "ahb", base + MX35_CCM_CGR1, 22);
+       clk[mshc_gate] = imx_clk_gate2("mshc_gate", "dummy", base + MX35_CCM_CGR1, 24);
+       clk[owire_gate] = imx_clk_gate2("owire_gate", "ipg_per", base + MX35_CCM_CGR1, 26);
+       clk[pwm_gate] = imx_clk_gate2("pwm_gate", "ipg_per", base + MX35_CCM_CGR1, 28);
+       clk[rngc_gate] = imx_clk_gate2("rngc_gate", "ipg", base + MX35_CCM_CGR1, 30);
+
+       clk[rtc_gate] = imx_clk_gate2("rtc_gate", "ipg", base + MX35_CCM_CGR2,  0);
+       clk[rtic_gate] = imx_clk_gate2("rtic_gate", "ahb", base + MX35_CCM_CGR2,  2);
+       clk[scc_gate] = imx_clk_gate2("scc_gate", "ipg", base + MX35_CCM_CGR2,  4);
+       clk[sdma_gate] = imx_clk_gate2("sdma_gate", "ahb", base + MX35_CCM_CGR2,  6);
+       clk[spba_gate] = imx_clk_gate2("spba_gate", "ipg", base + MX35_CCM_CGR2,  8);
+       clk[spdif_gate] = imx_clk_gate2("spdif_gate", "spdif_div_post", base + MX35_CCM_CGR2, 10);
+       clk[ssi1_gate] = imx_clk_gate2("ssi1_gate", "ssi1_div_post", base + MX35_CCM_CGR2, 12);
+       clk[ssi2_gate] = imx_clk_gate2("ssi2_gate", "ssi2_div_post", base + MX35_CCM_CGR2, 14);
+       clk[uart1_gate] = imx_clk_gate2("uart1_gate", "uart_div", base + MX35_CCM_CGR2, 16);
+       clk[uart2_gate] = imx_clk_gate2("uart2_gate", "uart_div", base + MX35_CCM_CGR2, 18);
+       clk[uart3_gate] = imx_clk_gate2("uart3_gate", "uart_div", base + MX35_CCM_CGR2, 20);
+       clk[usbotg_gate] = imx_clk_gate2("usbotg_gate", "ahb", base + MX35_CCM_CGR2, 22);
+       clk[wdog_gate] = imx_clk_gate2("wdog_gate", "ipg", base + MX35_CCM_CGR2, 24);
+       clk[max_gate] = imx_clk_gate2("max_gate", "dummy", base + MX35_CCM_CGR2, 26);
+       clk[admux_gate] = imx_clk_gate2("admux_gate", "ipg", base + MX35_CCM_CGR2, 30);
+
+       clk[csi_gate] = imx_clk_gate2("csi_gate", "csi_div", base + MX35_CCM_CGR3,  0);
+       clk[iim_gate] = imx_clk_gate2("iim_gate", "ipg", base + MX35_CCM_CGR3,  2);
+       clk[gpu2d_gate] = imx_clk_gate2("gpu2d_gate", "ahb", base + MX35_CCM_CGR3,  4);
+
+       imx_check_clocks(clk, ARRAY_SIZE(clk));
+
+       clk_register_clkdev(clk[pata_gate], NULL, "pata_imx");
+       clk_register_clkdev(clk[can1_gate], NULL, "flexcan.0");
+       clk_register_clkdev(clk[can2_gate], NULL, "flexcan.1");
+       clk_register_clkdev(clk[cspi1_gate], "per", "imx35-cspi.0");
+       clk_register_clkdev(clk[cspi1_gate], "ipg", "imx35-cspi.0");
+       clk_register_clkdev(clk[cspi2_gate], "per", "imx35-cspi.1");
+       clk_register_clkdev(clk[cspi2_gate], "ipg", "imx35-cspi.1");
+       clk_register_clkdev(clk[epit1_gate], NULL, "imx-epit.0");
+       clk_register_clkdev(clk[epit2_gate], NULL, "imx-epit.1");
+       clk_register_clkdev(clk[esdhc1_gate], "per", "sdhci-esdhc-imx35.0");
+       clk_register_clkdev(clk[ipg], "ipg", "sdhci-esdhc-imx35.0");
+       clk_register_clkdev(clk[ahb], "ahb", "sdhci-esdhc-imx35.0");
+       clk_register_clkdev(clk[esdhc2_gate], "per", "sdhci-esdhc-imx35.1");
+       clk_register_clkdev(clk[ipg], "ipg", "sdhci-esdhc-imx35.1");
+       clk_register_clkdev(clk[ahb], "ahb", "sdhci-esdhc-imx35.1");
+       clk_register_clkdev(clk[esdhc3_gate], "per", "sdhci-esdhc-imx35.2");
+       clk_register_clkdev(clk[ipg], "ipg", "sdhci-esdhc-imx35.2");
+       clk_register_clkdev(clk[ahb], "ahb", "sdhci-esdhc-imx35.2");
+       /* i.mx35 has the i.mx27 type fec */
+       clk_register_clkdev(clk[fec_gate], NULL, "imx27-fec.0");
+       clk_register_clkdev(clk[gpt_gate], "per", "imx-gpt.0");
+       clk_register_clkdev(clk[ipg], "ipg", "imx-gpt.0");
+       clk_register_clkdev(clk[i2c1_gate], NULL, "imx21-i2c.0");
+       clk_register_clkdev(clk[i2c2_gate], NULL, "imx21-i2c.1");
+       clk_register_clkdev(clk[i2c3_gate], NULL, "imx21-i2c.2");
+       clk_register_clkdev(clk[ipu_gate], NULL, "ipu-core");
+       clk_register_clkdev(clk[ipu_gate], NULL, "mx3_sdc_fb");
+       clk_register_clkdev(clk[kpp_gate], NULL, "imx-keypad");
+       clk_register_clkdev(clk[owire_gate], NULL, "mxc_w1");
+       clk_register_clkdev(clk[sdma_gate], NULL, "imx35-sdma");
+       clk_register_clkdev(clk[ssi1_gate], NULL, "imx-ssi.0");
+       clk_register_clkdev(clk[ssi2_gate], NULL, "imx-ssi.1");
+       /* i.mx35 has the i.mx21 type uart */
+       clk_register_clkdev(clk[uart1_gate], "per", "imx21-uart.0");
+       clk_register_clkdev(clk[ipg], "ipg", "imx21-uart.0");
+       clk_register_clkdev(clk[uart2_gate], "per", "imx21-uart.1");
+       clk_register_clkdev(clk[ipg], "ipg", "imx21-uart.1");
+       clk_register_clkdev(clk[uart3_gate], "per", "imx21-uart.2");
+       clk_register_clkdev(clk[ipg], "ipg", "imx21-uart.2");
+       clk_register_clkdev(clk[usb_div], "per", "mxc-ehci.0");
+       clk_register_clkdev(clk[ipg], "ipg", "mxc-ehci.0");
+       clk_register_clkdev(clk[usbotg_gate], "ahb", "mxc-ehci.0");
+       clk_register_clkdev(clk[usb_div], "per", "mxc-ehci.1");
+       clk_register_clkdev(clk[ipg], "ipg", "mxc-ehci.1");
+       clk_register_clkdev(clk[usbotg_gate], "ahb", "mxc-ehci.1");
+       clk_register_clkdev(clk[usb_div], "per", "mxc-ehci.2");
+       clk_register_clkdev(clk[ipg], "ipg", "mxc-ehci.2");
+       clk_register_clkdev(clk[usbotg_gate], "ahb", "mxc-ehci.2");
+       clk_register_clkdev(clk[usb_div], "per", "imx-udc-mx27");
+       clk_register_clkdev(clk[ipg], "ipg", "imx-udc-mx27");
+       clk_register_clkdev(clk[usbotg_gate], "ahb", "imx-udc-mx27");
+       clk_register_clkdev(clk[wdog_gate], NULL, "imx2-wdt.0");
+       clk_register_clkdev(clk[nfc_div], NULL, "imx25-nand.0");
+       clk_register_clkdev(clk[csi_gate], NULL, "mx3-camera.0");
+       clk_register_clkdev(clk[admux_gate], "audmux", NULL);
+
+       clk_prepare_enable(clk[spba_gate]);
+       clk_prepare_enable(clk[gpio1_gate]);
+       clk_prepare_enable(clk[gpio2_gate]);
+       clk_prepare_enable(clk[gpio3_gate]);
+       clk_prepare_enable(clk[iim_gate]);
+       clk_prepare_enable(clk[emi_gate]);
+       clk_prepare_enable(clk[max_gate]);
+       clk_prepare_enable(clk[iomuxc_gate]);
+
+       /*
+        * SCC is needed to boot via mmc after a watchdog reset. The clock code
+        * before conversion to common clk also enabled UART1 (which isn't
+        * handled here and not needed for mmc) and IIM (which is enabled
+        * unconditionally above).
+        */
+       clk_prepare_enable(clk[scc_gate]);
+
+       imx_print_silicon_rev("i.MX35", mx35_revision());
+
+       mxc_timer_init(MX35_GPT1_BASE_ADDR, MX35_INT_GPT, GPT_TYPE_IMX31);
+
+       return 0;
+}
+
+static void __init mx35_clocks_init_dt(struct device_node *ccm_node)
+{
+       clk_data.clks = clk;
+       clk_data.clk_num = ARRAY_SIZE(clk);
+       of_clk_add_provider(ccm_node, of_clk_src_onecell_get, &clk_data);
+
+       mx35_clocks_init();
+}
+CLK_OF_DECLARE(imx35, "fsl,imx35-ccm", mx35_clocks_init_dt);
diff --git a/drivers/clk/imx/clk-imx51-imx53.c b/drivers/clk/imx/clk-imx51-imx53.c
new file mode 100644 (file)
index 0000000..a7e4f39
--- /dev/null
@@ -0,0 +1,570 @@
+/*
+ * Copyright (C) 2011 Sascha Hauer, Pengutronix <s.hauer@pengutronix.de>
+ *
+ * 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/mm.h>
+#include <linux/delay.h>
+#include <linux/clk.h>
+#include <linux/io.h>
+#include <linux/clkdev.h>
+#include <linux/clk-provider.h>
+#include <linux/err.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
+#include <soc/imx/revision.h>
+#include <dt-bindings/clock/imx5-clock.h>
+
+#include "clk.h"
+
+#define MX51_DPLL1_BASE                0x83f80000
+#define MX51_DPLL2_BASE                0x83f84000
+#define MX51_DPLL3_BASE                0x83f88000
+
+#define MX53_DPLL1_BASE                0x63f80000
+#define MX53_DPLL2_BASE                0x63f84000
+#define MX53_DPLL3_BASE                0x63f88000
+#define MX53_DPLL4_BASE                0x63f8c000
+
+#define MXC_CCM_CCR            (ccm_base + 0x00)
+#define MXC_CCM_CCDR           (ccm_base + 0x04)
+#define MXC_CCM_CSR            (ccm_base + 0x08)
+#define MXC_CCM_CCSR           (ccm_base + 0x0c)
+#define MXC_CCM_CACRR          (ccm_base + 0x10)
+#define MXC_CCM_CBCDR          (ccm_base + 0x14)
+#define MXC_CCM_CBCMR          (ccm_base + 0x18)
+#define MXC_CCM_CSCMR1         (ccm_base + 0x1c)
+#define MXC_CCM_CSCMR2         (ccm_base + 0x20)
+#define MXC_CCM_CSCDR1         (ccm_base + 0x24)
+#define MXC_CCM_CS1CDR         (ccm_base + 0x28)
+#define MXC_CCM_CS2CDR         (ccm_base + 0x2c)
+#define MXC_CCM_CDCDR          (ccm_base + 0x30)
+#define MXC_CCM_CHSCDR         (ccm_base + 0x34)
+#define MXC_CCM_CSCDR2         (ccm_base + 0x38)
+#define MXC_CCM_CSCDR3         (ccm_base + 0x3c)
+#define MXC_CCM_CSCDR4         (ccm_base + 0x40)
+#define MXC_CCM_CWDR           (ccm_base + 0x44)
+#define MXC_CCM_CDHIPR         (ccm_base + 0x48)
+#define MXC_CCM_CDCR           (ccm_base + 0x4c)
+#define MXC_CCM_CTOR           (ccm_base + 0x50)
+#define MXC_CCM_CLPCR          (ccm_base + 0x54)
+#define MXC_CCM_CISR           (ccm_base + 0x58)
+#define MXC_CCM_CIMR           (ccm_base + 0x5c)
+#define MXC_CCM_CCOSR          (ccm_base + 0x60)
+#define MXC_CCM_CGPR           (ccm_base + 0x64)
+#define MXC_CCM_CCGR0          (ccm_base + 0x68)
+#define MXC_CCM_CCGR1          (ccm_base + 0x6c)
+#define MXC_CCM_CCGR2          (ccm_base + 0x70)
+#define MXC_CCM_CCGR3          (ccm_base + 0x74)
+#define MXC_CCM_CCGR4          (ccm_base + 0x78)
+#define MXC_CCM_CCGR5          (ccm_base + 0x7c)
+#define MXC_CCM_CCGR6          (ccm_base + 0x80)
+#define MXC_CCM_CCGR7          (ccm_base + 0x84)
+
+/* Low-power Audio Playback Mode clock */
+static const char *lp_apm_sel[] = { "osc", };
+
+/* This is used multiple times */
+static const char *standard_pll_sel[] = { "pll1_sw", "pll2_sw", "pll3_sw", "lp_apm", };
+static const char *periph_apm_sel[] = { "pll1_sw", "pll3_sw", "lp_apm", };
+static const char *main_bus_sel[] = { "pll2_sw", "periph_apm", };
+static const char *per_lp_apm_sel[] = { "main_bus", "lp_apm", };
+static const char *per_root_sel[] = { "per_podf", "ipg", };
+static const char *esdhc_c_sel[] = { "esdhc_a_podf", "esdhc_b_podf", };
+static const char *esdhc_d_sel[] = { "esdhc_a_podf", "esdhc_b_podf", };
+static const char *ssi_apm_sels[] = { "ckih1", "lp_amp", "ckih2", };
+static const char *ssi_clk_sels[] = { "pll1_sw", "pll2_sw", "pll3_sw", "ssi_apm", };
+static const char *ssi3_clk_sels[] = { "ssi1_root_gate", "ssi2_root_gate", };
+static const char *ssi_ext1_com_sels[] = { "ssi_ext1_podf", "ssi1_root_gate", };
+static const char *ssi_ext2_com_sels[] = { "ssi_ext2_podf", "ssi2_root_gate", };
+static const char *emi_slow_sel[] = { "main_bus", "ahb", };
+static const char *usb_phy_sel_str[] = { "osc", "usb_phy_podf", };
+static const char *mx51_ipu_di0_sel[] = { "di_pred", "osc", "ckih1", "tve_di", };
+static const char *mx53_ipu_di0_sel[] = { "di_pred", "osc", "ckih1", "di_pll4_podf", "dummy", "ldb_di0_gate", };
+static const char *mx53_ldb_di0_sel[] = { "pll3_sw", "pll4_sw", };
+static const char *mx51_ipu_di1_sel[] = { "di_pred", "osc", "ckih1", "tve_di", "ipp_di1", };
+static const char *mx53_ipu_di1_sel[] = { "di_pred", "osc", "ckih1", "tve_di", "ipp_di1", "ldb_di1_gate", };
+static const char *mx53_ldb_di1_sel[] = { "pll3_sw", "pll4_sw", };
+static const char *mx51_tve_ext_sel[] = { "osc", "ckih1", };
+static const char *mx53_tve_ext_sel[] = { "pll4_sw", "ckih1", };
+static const char *mx51_tve_sel[] = { "tve_pred", "tve_ext_sel", };
+static const char *ipu_sel[] = { "axi_a", "axi_b", "emi_slow_gate", "ahb", };
+static const char *gpu3d_sel[] = { "axi_a", "axi_b", "emi_slow_gate", "ahb" };
+static const char *gpu2d_sel[] = { "axi_a", "axi_b", "emi_slow_gate", "ahb" };
+static const char *vpu_sel[] = { "axi_a", "axi_b", "emi_slow_gate", "ahb", };
+static const char *mx53_can_sel[] = { "ipg", "ckih1", "ckih2", "lp_apm", };
+static const char *mx53_cko1_sel[] = {
+       "cpu_podf", "pll1_sw", "pll2_sw", "pll3_sw",
+       "emi_slow_podf", "pll4_sw", "nfc_podf", "dummy",
+       "di_pred", "dummy", "dummy", "ahb",
+       "ipg", "per_root", "ckil", "dummy",};
+static const char *mx53_cko2_sel[] = {
+       "dummy"/* dptc_core */, "dummy"/* dptc_perich */,
+       "dummy", "esdhc_a_podf",
+       "usboh3_podf", "dummy"/* wrck_clk_root */,
+       "ecspi_podf", "dummy"/* pll1_ref_clk */,
+       "esdhc_b_podf", "dummy"/* ddr_clk_root */,
+       "dummy"/* arm_axi_clk_root */, "dummy"/* usb_phy_out */,
+       "vpu_sel", "ipu_sel",
+       "osc", "ckih1",
+       "dummy", "esdhc_c_sel",
+       "ssi1_root_podf", "ssi2_root_podf",
+       "dummy", "dummy",
+       "dummy"/* lpsr_clk_root */, "dummy"/* pgc_clk_root */,
+       "dummy"/* tve_out */, "usb_phy_sel",
+       "tve_sel", "lp_apm",
+       "uart_root", "dummy"/* spdif0_clk_root */,
+       "dummy", "dummy", };
+static const char *mx51_spdif_xtal_sel[] = { "osc", "ckih", "ckih2", };
+static const char *mx53_spdif_xtal_sel[] = { "osc", "ckih", "ckih2", "pll4_sw", };
+static const char *spdif_sel[] = { "pll1_sw", "pll2_sw", "pll3_sw", "spdif_xtal_sel", };
+static const char *spdif0_com_sel[] = { "spdif0_podf", "ssi1_root_gate", };
+static const char *mx51_spdif1_com_sel[] = { "spdif1_podf", "ssi2_root_gate", };
+static const char *step_sels[] = { "lp_apm", };
+static const char *cpu_podf_sels[] = { "pll1_sw", "step_sel" };
+
+static struct clk *clk[IMX5_CLK_END];
+static struct clk_onecell_data clk_data;
+
+static void __init mx5_clocks_common_init(void __iomem *ccm_base)
+{
+       clk[IMX5_CLK_DUMMY]             = imx_clk_fixed("dummy", 0);
+       clk[IMX5_CLK_CKIL]              = imx_obtain_fixed_clock("ckil", 0);
+       clk[IMX5_CLK_OSC]               = imx_obtain_fixed_clock("osc", 0);
+       clk[IMX5_CLK_CKIH1]             = imx_obtain_fixed_clock("ckih1", 0);
+       clk[IMX5_CLK_CKIH2]             = imx_obtain_fixed_clock("ckih2", 0);
+
+       clk[IMX5_CLK_PERIPH_APM]        = imx_clk_mux("periph_apm", MXC_CCM_CBCMR, 12, 2,
+                                               periph_apm_sel, ARRAY_SIZE(periph_apm_sel));
+       clk[IMX5_CLK_MAIN_BUS]          = imx_clk_mux("main_bus", MXC_CCM_CBCDR, 25, 1,
+                                               main_bus_sel, ARRAY_SIZE(main_bus_sel));
+       clk[IMX5_CLK_PER_LP_APM]        = imx_clk_mux("per_lp_apm", MXC_CCM_CBCMR, 1, 1,
+                                               per_lp_apm_sel, ARRAY_SIZE(per_lp_apm_sel));
+       clk[IMX5_CLK_PER_PRED1]         = imx_clk_divider("per_pred1", "per_lp_apm", MXC_CCM_CBCDR, 6, 2);
+       clk[IMX5_CLK_PER_PRED2]         = imx_clk_divider("per_pred2", "per_pred1", MXC_CCM_CBCDR, 3, 3);
+       clk[IMX5_CLK_PER_PODF]          = imx_clk_divider("per_podf", "per_pred2", MXC_CCM_CBCDR, 0, 3);
+       clk[IMX5_CLK_PER_ROOT]          = imx_clk_mux("per_root", MXC_CCM_CBCMR, 0, 1,
+                                               per_root_sel, ARRAY_SIZE(per_root_sel));
+       clk[IMX5_CLK_AHB]               = imx_clk_divider("ahb", "main_bus", MXC_CCM_CBCDR, 10, 3);
+       clk[IMX5_CLK_AHB_MAX]           = imx_clk_gate2("ahb_max", "ahb", MXC_CCM_CCGR0, 28);
+       clk[IMX5_CLK_AIPS_TZ1]          = imx_clk_gate2("aips_tz1", "ahb", MXC_CCM_CCGR0, 24);
+       clk[IMX5_CLK_AIPS_TZ2]          = imx_clk_gate2("aips_tz2", "ahb", MXC_CCM_CCGR0, 26);
+       clk[IMX5_CLK_TMAX1]             = imx_clk_gate2("tmax1", "ahb", MXC_CCM_CCGR1, 0);
+       clk[IMX5_CLK_TMAX2]             = imx_clk_gate2("tmax2", "ahb", MXC_CCM_CCGR1, 2);
+       clk[IMX5_CLK_TMAX3]             = imx_clk_gate2("tmax3", "ahb", MXC_CCM_CCGR1, 4);
+       clk[IMX5_CLK_SPBA]              = imx_clk_gate2("spba", "ipg", MXC_CCM_CCGR5, 0);
+       clk[IMX5_CLK_IPG]               = imx_clk_divider("ipg", "ahb", MXC_CCM_CBCDR, 8, 2);
+       clk[IMX5_CLK_AXI_A]             = imx_clk_divider("axi_a", "main_bus", MXC_CCM_CBCDR, 16, 3);
+       clk[IMX5_CLK_AXI_B]             = imx_clk_divider("axi_b", "main_bus", MXC_CCM_CBCDR, 19, 3);
+       clk[IMX5_CLK_UART_SEL]          = imx_clk_mux("uart_sel", MXC_CCM_CSCMR1, 24, 2,
+                                               standard_pll_sel, ARRAY_SIZE(standard_pll_sel));
+       clk[IMX5_CLK_UART_PRED]         = imx_clk_divider("uart_pred", "uart_sel", MXC_CCM_CSCDR1, 3, 3);
+       clk[IMX5_CLK_UART_ROOT]         = imx_clk_divider("uart_root", "uart_pred", MXC_CCM_CSCDR1, 0, 3);
+
+       clk[IMX5_CLK_ESDHC_A_SEL]       = imx_clk_mux("esdhc_a_sel", MXC_CCM_CSCMR1, 20, 2,
+                                               standard_pll_sel, ARRAY_SIZE(standard_pll_sel));
+       clk[IMX5_CLK_ESDHC_B_SEL]       = imx_clk_mux("esdhc_b_sel", MXC_CCM_CSCMR1, 16, 2,
+                                               standard_pll_sel, ARRAY_SIZE(standard_pll_sel));
+       clk[IMX5_CLK_ESDHC_A_PRED]      = imx_clk_divider("esdhc_a_pred", "esdhc_a_sel", MXC_CCM_CSCDR1, 16, 3);
+       clk[IMX5_CLK_ESDHC_A_PODF]      = imx_clk_divider("esdhc_a_podf", "esdhc_a_pred", MXC_CCM_CSCDR1, 11, 3);
+       clk[IMX5_CLK_ESDHC_B_PRED]      = imx_clk_divider("esdhc_b_pred", "esdhc_b_sel", MXC_CCM_CSCDR1, 22, 3);
+       clk[IMX5_CLK_ESDHC_B_PODF]      = imx_clk_divider("esdhc_b_podf", "esdhc_b_pred", MXC_CCM_CSCDR1, 19, 3);
+       clk[IMX5_CLK_ESDHC_C_SEL]       = imx_clk_mux("esdhc_c_sel", MXC_CCM_CSCMR1, 19, 1, esdhc_c_sel, ARRAY_SIZE(esdhc_c_sel));
+       clk[IMX5_CLK_ESDHC_D_SEL]       = imx_clk_mux("esdhc_d_sel", MXC_CCM_CSCMR1, 18, 1, esdhc_d_sel, ARRAY_SIZE(esdhc_d_sel));
+
+       clk[IMX5_CLK_EMI_SEL]           = imx_clk_mux("emi_sel", MXC_CCM_CBCDR, 26, 1,
+                                               emi_slow_sel, ARRAY_SIZE(emi_slow_sel));
+       clk[IMX5_CLK_EMI_SLOW_PODF]     = imx_clk_divider("emi_slow_podf", "emi_sel", MXC_CCM_CBCDR, 22, 3);
+       clk[IMX5_CLK_NFC_PODF]          = imx_clk_divider("nfc_podf", "emi_slow_podf", MXC_CCM_CBCDR, 13, 3);
+       clk[IMX5_CLK_ECSPI_SEL]         = imx_clk_mux("ecspi_sel", MXC_CCM_CSCMR1, 4, 2,
+                                               standard_pll_sel, ARRAY_SIZE(standard_pll_sel));
+       clk[IMX5_CLK_ECSPI_PRED]        = imx_clk_divider("ecspi_pred", "ecspi_sel", MXC_CCM_CSCDR2, 25, 3);
+       clk[IMX5_CLK_ECSPI_PODF]        = imx_clk_divider("ecspi_podf", "ecspi_pred", MXC_CCM_CSCDR2, 19, 6);
+       clk[IMX5_CLK_USBOH3_SEL]        = imx_clk_mux("usboh3_sel", MXC_CCM_CSCMR1, 22, 2,
+                                               standard_pll_sel, ARRAY_SIZE(standard_pll_sel));
+       clk[IMX5_CLK_USBOH3_PRED]       = imx_clk_divider("usboh3_pred", "usboh3_sel", MXC_CCM_CSCDR1, 8, 3);
+       clk[IMX5_CLK_USBOH3_PODF]       = imx_clk_divider("usboh3_podf", "usboh3_pred", MXC_CCM_CSCDR1, 6, 2);
+       clk[IMX5_CLK_USB_PHY_PRED]      = imx_clk_divider("usb_phy_pred", "pll3_sw", MXC_CCM_CDCDR, 3, 3);
+       clk[IMX5_CLK_USB_PHY_PODF]      = imx_clk_divider("usb_phy_podf", "usb_phy_pred", MXC_CCM_CDCDR, 0, 3);
+       clk[IMX5_CLK_USB_PHY_SEL]       = imx_clk_mux("usb_phy_sel", MXC_CCM_CSCMR1, 26, 1,
+                                               usb_phy_sel_str, ARRAY_SIZE(usb_phy_sel_str));
+       clk[IMX5_CLK_STEP_SEL]          = imx_clk_mux("step_sel", MXC_CCM_CCSR, 7, 2, step_sels, ARRAY_SIZE(step_sels));
+       clk[IMX5_CLK_CPU_PODF_SEL]      = imx_clk_mux("cpu_podf_sel", MXC_CCM_CCSR, 2, 1, cpu_podf_sels, ARRAY_SIZE(cpu_podf_sels));
+       clk[IMX5_CLK_CPU_PODF]          = imx_clk_divider("cpu_podf", "cpu_podf_sel", MXC_CCM_CACRR, 0, 3);
+       clk[IMX5_CLK_DI_PRED]           = imx_clk_divider("di_pred", "pll3_sw", MXC_CCM_CDCDR, 6, 3);
+       clk[IMX5_CLK_IIM_GATE]          = imx_clk_gate2("iim_gate", "ipg", MXC_CCM_CCGR0, 30);
+       clk[IMX5_CLK_UART1_IPG_GATE]    = imx_clk_gate2("uart1_ipg_gate", "ipg", MXC_CCM_CCGR1, 6);
+       clk[IMX5_CLK_UART1_PER_GATE]    = imx_clk_gate2("uart1_per_gate", "uart_root", MXC_CCM_CCGR1, 8);
+       clk[IMX5_CLK_UART2_IPG_GATE]    = imx_clk_gate2("uart2_ipg_gate", "ipg", MXC_CCM_CCGR1, 10);
+       clk[IMX5_CLK_UART2_PER_GATE]    = imx_clk_gate2("uart2_per_gate", "uart_root", MXC_CCM_CCGR1, 12);
+       clk[IMX5_CLK_UART3_IPG_GATE]    = imx_clk_gate2("uart3_ipg_gate", "ipg", MXC_CCM_CCGR1, 14);
+       clk[IMX5_CLK_UART3_PER_GATE]    = imx_clk_gate2("uart3_per_gate", "uart_root", MXC_CCM_CCGR1, 16);
+       clk[IMX5_CLK_I2C1_GATE]         = imx_clk_gate2("i2c1_gate", "per_root", MXC_CCM_CCGR1, 18);
+       clk[IMX5_CLK_I2C2_GATE]         = imx_clk_gate2("i2c2_gate", "per_root", MXC_CCM_CCGR1, 20);
+       clk[IMX5_CLK_PWM1_IPG_GATE]     = imx_clk_gate2("pwm1_ipg_gate", "ipg", MXC_CCM_CCGR2, 10);
+       clk[IMX5_CLK_PWM1_HF_GATE]      = imx_clk_gate2("pwm1_hf_gate", "per_root", MXC_CCM_CCGR2, 12);
+       clk[IMX5_CLK_PWM2_IPG_GATE]     = imx_clk_gate2("pwm2_ipg_gate", "ipg", MXC_CCM_CCGR2, 14);
+       clk[IMX5_CLK_PWM2_HF_GATE]      = imx_clk_gate2("pwm2_hf_gate", "per_root", MXC_CCM_CCGR2, 16);
+       clk[IMX5_CLK_GPT_IPG_GATE]      = imx_clk_gate2("gpt_ipg_gate", "ipg", MXC_CCM_CCGR2, 18);
+       clk[IMX5_CLK_GPT_HF_GATE]       = imx_clk_gate2("gpt_hf_gate", "per_root", MXC_CCM_CCGR2, 20);
+       clk[IMX5_CLK_FEC_GATE]          = imx_clk_gate2("fec_gate", "ipg", MXC_CCM_CCGR2, 24);
+       clk[IMX5_CLK_USBOH3_GATE]       = imx_clk_gate2("usboh3_gate", "ipg", MXC_CCM_CCGR2, 26);
+       clk[IMX5_CLK_USBOH3_PER_GATE]   = imx_clk_gate2("usboh3_per_gate", "usboh3_podf", MXC_CCM_CCGR2, 28);
+       clk[IMX5_CLK_ESDHC1_IPG_GATE]   = imx_clk_gate2("esdhc1_ipg_gate", "ipg", MXC_CCM_CCGR3, 0);
+       clk[IMX5_CLK_ESDHC2_IPG_GATE]   = imx_clk_gate2("esdhc2_ipg_gate", "ipg", MXC_CCM_CCGR3, 4);
+       clk[IMX5_CLK_ESDHC3_IPG_GATE]   = imx_clk_gate2("esdhc3_ipg_gate", "ipg", MXC_CCM_CCGR3, 8);
+       clk[IMX5_CLK_ESDHC4_IPG_GATE]   = imx_clk_gate2("esdhc4_ipg_gate", "ipg", MXC_CCM_CCGR3, 12);
+       clk[IMX5_CLK_SSI1_IPG_GATE]     = imx_clk_gate2("ssi1_ipg_gate", "ipg", MXC_CCM_CCGR3, 16);
+       clk[IMX5_CLK_SSI2_IPG_GATE]     = imx_clk_gate2("ssi2_ipg_gate", "ipg", MXC_CCM_CCGR3, 20);
+       clk[IMX5_CLK_SSI3_IPG_GATE]     = imx_clk_gate2("ssi3_ipg_gate", "ipg", MXC_CCM_CCGR3, 24);
+       clk[IMX5_CLK_ECSPI1_IPG_GATE]   = imx_clk_gate2("ecspi1_ipg_gate", "ipg", MXC_CCM_CCGR4, 18);
+       clk[IMX5_CLK_ECSPI1_PER_GATE]   = imx_clk_gate2("ecspi1_per_gate", "ecspi_podf", MXC_CCM_CCGR4, 20);
+       clk[IMX5_CLK_ECSPI2_IPG_GATE]   = imx_clk_gate2("ecspi2_ipg_gate", "ipg", MXC_CCM_CCGR4, 22);
+       clk[IMX5_CLK_ECSPI2_PER_GATE]   = imx_clk_gate2("ecspi2_per_gate", "ecspi_podf", MXC_CCM_CCGR4, 24);
+       clk[IMX5_CLK_CSPI_IPG_GATE]     = imx_clk_gate2("cspi_ipg_gate", "ipg", MXC_CCM_CCGR4, 26);
+       clk[IMX5_CLK_SDMA_GATE]         = imx_clk_gate2("sdma_gate", "ipg", MXC_CCM_CCGR4, 30);
+       clk[IMX5_CLK_EMI_FAST_GATE]     = imx_clk_gate2("emi_fast_gate", "dummy", MXC_CCM_CCGR5, 14);
+       clk[IMX5_CLK_EMI_SLOW_GATE]     = imx_clk_gate2("emi_slow_gate", "emi_slow_podf", MXC_CCM_CCGR5, 16);
+       clk[IMX5_CLK_IPU_SEL]           = imx_clk_mux("ipu_sel", MXC_CCM_CBCMR, 6, 2, ipu_sel, ARRAY_SIZE(ipu_sel));
+       clk[IMX5_CLK_IPU_GATE]          = imx_clk_gate2("ipu_gate", "ipu_sel", MXC_CCM_CCGR5, 10);
+       clk[IMX5_CLK_NFC_GATE]          = imx_clk_gate2("nfc_gate", "nfc_podf", MXC_CCM_CCGR5, 20);
+       clk[IMX5_CLK_IPU_DI0_GATE]      = imx_clk_gate2("ipu_di0_gate", "ipu_di0_sel", MXC_CCM_CCGR6, 10);
+       clk[IMX5_CLK_IPU_DI1_GATE]      = imx_clk_gate2("ipu_di1_gate", "ipu_di1_sel", MXC_CCM_CCGR6, 12);
+       clk[IMX5_CLK_GPU3D_SEL]         = imx_clk_mux("gpu3d_sel", MXC_CCM_CBCMR, 4, 2, gpu3d_sel, ARRAY_SIZE(gpu3d_sel));
+       clk[IMX5_CLK_GPU2D_SEL]         = imx_clk_mux("gpu2d_sel", MXC_CCM_CBCMR, 16, 2, gpu2d_sel, ARRAY_SIZE(gpu2d_sel));
+       clk[IMX5_CLK_GPU3D_GATE]        = imx_clk_gate2("gpu3d_gate", "gpu3d_sel", MXC_CCM_CCGR5, 2);
+       clk[IMX5_CLK_GARB_GATE]         = imx_clk_gate2("garb_gate", "axi_a", MXC_CCM_CCGR5, 4);
+       clk[IMX5_CLK_GPU2D_GATE]        = imx_clk_gate2("gpu2d_gate", "gpu2d_sel", MXC_CCM_CCGR6, 14);
+       clk[IMX5_CLK_VPU_SEL]           = imx_clk_mux("vpu_sel", MXC_CCM_CBCMR, 14, 2, vpu_sel, ARRAY_SIZE(vpu_sel));
+       clk[IMX5_CLK_VPU_GATE]          = imx_clk_gate2("vpu_gate", "vpu_sel", MXC_CCM_CCGR5, 6);
+       clk[IMX5_CLK_VPU_REFERENCE_GATE] = imx_clk_gate2("vpu_reference_gate", "osc", MXC_CCM_CCGR5, 8);
+       clk[IMX5_CLK_UART4_IPG_GATE]    = imx_clk_gate2("uart4_ipg_gate", "ipg", MXC_CCM_CCGR7, 8);
+       clk[IMX5_CLK_UART4_PER_GATE]    = imx_clk_gate2("uart4_per_gate", "uart_root", MXC_CCM_CCGR7, 10);
+       clk[IMX5_CLK_UART5_IPG_GATE]    = imx_clk_gate2("uart5_ipg_gate", "ipg", MXC_CCM_CCGR7, 12);
+       clk[IMX5_CLK_UART5_PER_GATE]    = imx_clk_gate2("uart5_per_gate", "uart_root", MXC_CCM_CCGR7, 14);
+       clk[IMX5_CLK_GPC_DVFS]          = imx_clk_gate2("gpc_dvfs", "dummy", MXC_CCM_CCGR5, 24);
+
+       clk[IMX5_CLK_SSI_APM]           = imx_clk_mux("ssi_apm", MXC_CCM_CSCMR1, 8, 2, ssi_apm_sels, ARRAY_SIZE(ssi_apm_sels));
+       clk[IMX5_CLK_SSI1_ROOT_SEL]     = imx_clk_mux("ssi1_root_sel", MXC_CCM_CSCMR1, 14, 2, ssi_clk_sels, ARRAY_SIZE(ssi_clk_sels));
+       clk[IMX5_CLK_SSI2_ROOT_SEL]     = imx_clk_mux("ssi2_root_sel", MXC_CCM_CSCMR1, 12, 2, ssi_clk_sels, ARRAY_SIZE(ssi_clk_sels));
+       clk[IMX5_CLK_SSI3_ROOT_SEL]     = imx_clk_mux("ssi3_root_sel", MXC_CCM_CSCMR1, 11, 1, ssi3_clk_sels, ARRAY_SIZE(ssi3_clk_sels));
+       clk[IMX5_CLK_SSI_EXT1_SEL]      = imx_clk_mux("ssi_ext1_sel", MXC_CCM_CSCMR1, 28, 2, ssi_clk_sels, ARRAY_SIZE(ssi_clk_sels));
+       clk[IMX5_CLK_SSI_EXT2_SEL]      = imx_clk_mux("ssi_ext2_sel", MXC_CCM_CSCMR1, 30, 2, ssi_clk_sels, ARRAY_SIZE(ssi_clk_sels));
+       clk[IMX5_CLK_SSI_EXT1_COM_SEL]  = imx_clk_mux("ssi_ext1_com_sel", MXC_CCM_CSCMR1, 0, 1, ssi_ext1_com_sels, ARRAY_SIZE(ssi_ext1_com_sels));
+       clk[IMX5_CLK_SSI_EXT2_COM_SEL]  = imx_clk_mux("ssi_ext2_com_sel", MXC_CCM_CSCMR1, 1, 1, ssi_ext2_com_sels, ARRAY_SIZE(ssi_ext2_com_sels));
+       clk[IMX5_CLK_SSI1_ROOT_PRED]    = imx_clk_divider("ssi1_root_pred", "ssi1_root_sel", MXC_CCM_CS1CDR, 6, 3);
+       clk[IMX5_CLK_SSI1_ROOT_PODF]    = imx_clk_divider("ssi1_root_podf", "ssi1_root_pred", MXC_CCM_CS1CDR, 0, 6);
+       clk[IMX5_CLK_SSI2_ROOT_PRED]    = imx_clk_divider("ssi2_root_pred", "ssi2_root_sel", MXC_CCM_CS2CDR, 6, 3);
+       clk[IMX5_CLK_SSI2_ROOT_PODF]    = imx_clk_divider("ssi2_root_podf", "ssi2_root_pred", MXC_CCM_CS2CDR, 0, 6);
+       clk[IMX5_CLK_SSI_EXT1_PRED]     = imx_clk_divider("ssi_ext1_pred", "ssi_ext1_sel", MXC_CCM_CS1CDR, 22, 3);
+       clk[IMX5_CLK_SSI_EXT1_PODF]     = imx_clk_divider("ssi_ext1_podf", "ssi_ext1_pred", MXC_CCM_CS1CDR, 16, 6);
+       clk[IMX5_CLK_SSI_EXT2_PRED]     = imx_clk_divider("ssi_ext2_pred", "ssi_ext2_sel", MXC_CCM_CS2CDR, 22, 3);
+       clk[IMX5_CLK_SSI_EXT2_PODF]     = imx_clk_divider("ssi_ext2_podf", "ssi_ext2_pred", MXC_CCM_CS2CDR, 16, 6);
+       clk[IMX5_CLK_SSI1_ROOT_GATE]    = imx_clk_gate2("ssi1_root_gate", "ssi1_root_podf", MXC_CCM_CCGR3, 18);
+       clk[IMX5_CLK_SSI2_ROOT_GATE]    = imx_clk_gate2("ssi2_root_gate", "ssi2_root_podf", MXC_CCM_CCGR3, 22);
+       clk[IMX5_CLK_SSI3_ROOT_GATE]    = imx_clk_gate2("ssi3_root_gate", "ssi3_root_sel", MXC_CCM_CCGR3, 26);
+       clk[IMX5_CLK_SSI_EXT1_GATE]     = imx_clk_gate2("ssi_ext1_gate", "ssi_ext1_com_sel", MXC_CCM_CCGR3, 28);
+       clk[IMX5_CLK_SSI_EXT2_GATE]     = imx_clk_gate2("ssi_ext2_gate", "ssi_ext2_com_sel", MXC_CCM_CCGR3, 30);
+       clk[IMX5_CLK_EPIT1_IPG_GATE]    = imx_clk_gate2("epit1_ipg_gate", "ipg", MXC_CCM_CCGR2, 2);
+       clk[IMX5_CLK_EPIT1_HF_GATE]     = imx_clk_gate2("epit1_hf_gate", "per_root", MXC_CCM_CCGR2, 4);
+       clk[IMX5_CLK_EPIT2_IPG_GATE]    = imx_clk_gate2("epit2_ipg_gate", "ipg", MXC_CCM_CCGR2, 6);
+       clk[IMX5_CLK_EPIT2_HF_GATE]     = imx_clk_gate2("epit2_hf_gate", "per_root", MXC_CCM_CCGR2, 8);
+       clk[IMX5_CLK_OWIRE_GATE]        = imx_clk_gate2("owire_gate", "per_root", MXC_CCM_CCGR2, 22);
+       clk[IMX5_CLK_SRTC_GATE]         = imx_clk_gate2("srtc_gate", "per_root", MXC_CCM_CCGR4, 28);
+       clk[IMX5_CLK_PATA_GATE]         = imx_clk_gate2("pata_gate", "ipg", MXC_CCM_CCGR4, 0);
+       clk[IMX5_CLK_SPDIF0_SEL]        = imx_clk_mux("spdif0_sel", MXC_CCM_CSCMR2, 0, 2, spdif_sel, ARRAY_SIZE(spdif_sel));
+       clk[IMX5_CLK_SPDIF0_PRED]       = imx_clk_divider("spdif0_pred", "spdif0_sel", MXC_CCM_CDCDR, 25, 3);
+       clk[IMX5_CLK_SPDIF0_PODF]       = imx_clk_divider("spdif0_podf", "spdif0_pred", MXC_CCM_CDCDR, 19, 6);
+       clk[IMX5_CLK_SPDIF0_COM_SEL]    = imx_clk_mux_flags("spdif0_com_sel", MXC_CCM_CSCMR2, 4, 1,
+                                               spdif0_com_sel, ARRAY_SIZE(spdif0_com_sel), CLK_SET_RATE_PARENT);
+       clk[IMX5_CLK_SPDIF0_GATE]       = imx_clk_gate2("spdif0_gate", "spdif0_com_sel", MXC_CCM_CCGR5, 26);
+       clk[IMX5_CLK_SPDIF_IPG_GATE]    = imx_clk_gate2("spdif_ipg_gate", "ipg", MXC_CCM_CCGR5, 30);
+       clk[IMX5_CLK_SAHARA_IPG_GATE]   = imx_clk_gate2("sahara_ipg_gate", "ipg", MXC_CCM_CCGR4, 14);
+       clk[IMX5_CLK_SATA_REF]          = imx_clk_fixed_factor("sata_ref", "usb_phy1_gate", 1, 1);
+
+       clk_register_clkdev(clk[IMX5_CLK_CPU_PODF], NULL, "cpu0");
+       clk_register_clkdev(clk[IMX5_CLK_GPC_DVFS], "gpc_dvfs", NULL);
+
+       /* Set SDHC parents to be PLL2 */
+       clk_set_parent(clk[IMX5_CLK_ESDHC_A_SEL], clk[IMX5_CLK_PLL2_SW]);
+       clk_set_parent(clk[IMX5_CLK_ESDHC_B_SEL], clk[IMX5_CLK_PLL2_SW]);
+
+       /* move usb phy clk to 24MHz */
+       clk_set_parent(clk[IMX5_CLK_USB_PHY_SEL], clk[IMX5_CLK_OSC]);
+
+       clk_prepare_enable(clk[IMX5_CLK_GPC_DVFS]);
+       clk_prepare_enable(clk[IMX5_CLK_AHB_MAX]); /* esdhc3 */
+       clk_prepare_enable(clk[IMX5_CLK_AIPS_TZ1]);
+       clk_prepare_enable(clk[IMX5_CLK_AIPS_TZ2]); /* fec */
+       clk_prepare_enable(clk[IMX5_CLK_SPBA]);
+       clk_prepare_enable(clk[IMX5_CLK_EMI_FAST_GATE]); /* fec */
+       clk_prepare_enable(clk[IMX5_CLK_EMI_SLOW_GATE]); /* eim */
+       clk_prepare_enable(clk[IMX5_CLK_MIPI_HSC1_GATE]);
+       clk_prepare_enable(clk[IMX5_CLK_MIPI_HSC2_GATE]);
+       clk_prepare_enable(clk[IMX5_CLK_MIPI_ESC_GATE]);
+       clk_prepare_enable(clk[IMX5_CLK_MIPI_HSP_GATE]);
+       clk_prepare_enable(clk[IMX5_CLK_TMAX1]);
+       clk_prepare_enable(clk[IMX5_CLK_TMAX2]); /* esdhc2, fec */
+       clk_prepare_enable(clk[IMX5_CLK_TMAX3]); /* esdhc1, esdhc4 */
+}
+
+static void __init mx50_clocks_init(struct device_node *np)
+{
+       void __iomem *ccm_base;
+       void __iomem *pll_base;
+       unsigned long r;
+
+       pll_base = ioremap(MX53_DPLL1_BASE, SZ_16K);
+       WARN_ON(!pll_base);
+       clk[IMX5_CLK_PLL1_SW]           = imx_clk_pllv2("pll1_sw", "osc", pll_base);
+
+       pll_base = ioremap(MX53_DPLL2_BASE, SZ_16K);
+       WARN_ON(!pll_base);
+       clk[IMX5_CLK_PLL2_SW]           = imx_clk_pllv2("pll2_sw", "osc", pll_base);
+
+       pll_base = ioremap(MX53_DPLL3_BASE, SZ_16K);
+       WARN_ON(!pll_base);
+       clk[IMX5_CLK_PLL3_SW]           = imx_clk_pllv2("pll3_sw", "osc", pll_base);
+
+       ccm_base = of_iomap(np, 0);
+       WARN_ON(!ccm_base);
+
+       mx5_clocks_common_init(ccm_base);
+
+       clk[IMX5_CLK_LP_APM]            = imx_clk_mux("lp_apm", MXC_CCM_CCSR, 10, 1,
+                                               lp_apm_sel, ARRAY_SIZE(lp_apm_sel));
+       clk[IMX5_CLK_ESDHC1_PER_GATE]   = imx_clk_gate2("esdhc1_per_gate", "esdhc_a_podf", MXC_CCM_CCGR3, 2);
+       clk[IMX5_CLK_ESDHC2_PER_GATE]   = imx_clk_gate2("esdhc2_per_gate", "esdhc_c_sel", MXC_CCM_CCGR3, 6);
+       clk[IMX5_CLK_ESDHC3_PER_GATE]   = imx_clk_gate2("esdhc3_per_gate", "esdhc_b_podf", MXC_CCM_CCGR3, 10);
+       clk[IMX5_CLK_ESDHC4_PER_GATE]   = imx_clk_gate2("esdhc4_per_gate", "esdhc_d_sel", MXC_CCM_CCGR3, 14);
+       clk[IMX5_CLK_USB_PHY1_GATE]     = imx_clk_gate2("usb_phy1_gate", "usb_phy_sel", MXC_CCM_CCGR4, 10);
+       clk[IMX5_CLK_USB_PHY2_GATE]     = imx_clk_gate2("usb_phy2_gate", "usb_phy_sel", MXC_CCM_CCGR4, 12);
+       clk[IMX5_CLK_I2C3_GATE]         = imx_clk_gate2("i2c3_gate", "per_root", MXC_CCM_CCGR1, 22);
+
+       clk[IMX5_CLK_CKO1_SEL]          = imx_clk_mux("cko1_sel", MXC_CCM_CCOSR, 0, 4,
+                                               mx53_cko1_sel, ARRAY_SIZE(mx53_cko1_sel));
+       clk[IMX5_CLK_CKO1_PODF]         = imx_clk_divider("cko1_podf", "cko1_sel", MXC_CCM_CCOSR, 4, 3);
+       clk[IMX5_CLK_CKO1]              = imx_clk_gate2("cko1", "cko1_podf", MXC_CCM_CCOSR, 7);
+
+       clk[IMX5_CLK_CKO2_SEL]          = imx_clk_mux("cko2_sel", MXC_CCM_CCOSR, 16, 5,
+                                               mx53_cko2_sel, ARRAY_SIZE(mx53_cko2_sel));
+       clk[IMX5_CLK_CKO2_PODF]         = imx_clk_divider("cko2_podf", "cko2_sel", MXC_CCM_CCOSR, 21, 3);
+       clk[IMX5_CLK_CKO2]              = imx_clk_gate2("cko2", "cko2_podf", MXC_CCM_CCOSR, 24);
+
+       imx_check_clocks(clk, ARRAY_SIZE(clk));
+
+       clk_data.clks = clk;
+       clk_data.clk_num = ARRAY_SIZE(clk);
+       of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
+
+       /* set SDHC root clock to 200MHZ*/
+       clk_set_rate(clk[IMX5_CLK_ESDHC_A_PODF], 200000000);
+       clk_set_rate(clk[IMX5_CLK_ESDHC_B_PODF], 200000000);
+
+       clk_prepare_enable(clk[IMX5_CLK_IIM_GATE]);
+       imx_print_silicon_rev("i.MX50", IMX_CHIP_REVISION_1_1);
+       clk_disable_unprepare(clk[IMX5_CLK_IIM_GATE]);
+
+       r = clk_round_rate(clk[IMX5_CLK_USBOH3_PER_GATE], 54000000);
+       clk_set_rate(clk[IMX5_CLK_USBOH3_PER_GATE], r);
+}
+CLK_OF_DECLARE(imx50_ccm, "fsl,imx50-ccm", mx50_clocks_init);
+
+static void __init mx51_clocks_init(struct device_node *np)
+{
+       void __iomem *ccm_base;
+       void __iomem *pll_base;
+       u32 val;
+
+       pll_base = ioremap(MX51_DPLL1_BASE, SZ_16K);
+       WARN_ON(!pll_base);
+       clk[IMX5_CLK_PLL1_SW]           = imx_clk_pllv2("pll1_sw", "osc", pll_base);
+
+       pll_base = ioremap(MX51_DPLL2_BASE, SZ_16K);
+       WARN_ON(!pll_base);
+       clk[IMX5_CLK_PLL2_SW]           = imx_clk_pllv2("pll2_sw", "osc", pll_base);
+
+       pll_base = ioremap(MX51_DPLL3_BASE, SZ_16K);
+       WARN_ON(!pll_base);
+       clk[IMX5_CLK_PLL3_SW]           = imx_clk_pllv2("pll3_sw", "osc", pll_base);
+
+       ccm_base = of_iomap(np, 0);
+       WARN_ON(!ccm_base);
+
+       mx5_clocks_common_init(ccm_base);
+
+       clk[IMX5_CLK_LP_APM]            = imx_clk_mux("lp_apm", MXC_CCM_CCSR, 9, 1,
+                                               lp_apm_sel, ARRAY_SIZE(lp_apm_sel));
+       clk[IMX5_CLK_IPU_DI0_SEL]       = imx_clk_mux("ipu_di0_sel", MXC_CCM_CSCMR2, 26, 3,
+                                               mx51_ipu_di0_sel, ARRAY_SIZE(mx51_ipu_di0_sel));
+       clk[IMX5_CLK_IPU_DI1_SEL]       = imx_clk_mux("ipu_di1_sel", MXC_CCM_CSCMR2, 29, 3,
+                                               mx51_ipu_di1_sel, ARRAY_SIZE(mx51_ipu_di1_sel));
+       clk[IMX5_CLK_TVE_EXT_SEL]       = imx_clk_mux_flags("tve_ext_sel", MXC_CCM_CSCMR1, 6, 1,
+                                               mx51_tve_ext_sel, ARRAY_SIZE(mx51_tve_ext_sel), CLK_SET_RATE_PARENT);
+       clk[IMX5_CLK_TVE_SEL]           = imx_clk_mux("tve_sel", MXC_CCM_CSCMR1, 7, 1,
+                                               mx51_tve_sel, ARRAY_SIZE(mx51_tve_sel));
+       clk[IMX5_CLK_TVE_GATE]          = imx_clk_gate2("tve_gate", "tve_sel", MXC_CCM_CCGR2, 30);
+       clk[IMX5_CLK_TVE_PRED]          = imx_clk_divider("tve_pred", "pll3_sw", MXC_CCM_CDCDR, 28, 3);
+       clk[IMX5_CLK_ESDHC1_PER_GATE]   = imx_clk_gate2("esdhc1_per_gate", "esdhc_a_podf", MXC_CCM_CCGR3, 2);
+       clk[IMX5_CLK_ESDHC2_PER_GATE]   = imx_clk_gate2("esdhc2_per_gate", "esdhc_b_podf", MXC_CCM_CCGR3, 6);
+       clk[IMX5_CLK_ESDHC3_PER_GATE]   = imx_clk_gate2("esdhc3_per_gate", "esdhc_c_sel", MXC_CCM_CCGR3, 10);
+       clk[IMX5_CLK_ESDHC4_PER_GATE]   = imx_clk_gate2("esdhc4_per_gate", "esdhc_d_sel", MXC_CCM_CCGR3, 14);
+       clk[IMX5_CLK_USB_PHY_GATE]      = imx_clk_gate2("usb_phy_gate", "usb_phy_sel", MXC_CCM_CCGR2, 0);
+       clk[IMX5_CLK_HSI2C_GATE]        = imx_clk_gate2("hsi2c_gate", "ipg", MXC_CCM_CCGR1, 22);
+       clk[IMX5_CLK_MIPI_HSC1_GATE]    = imx_clk_gate2("mipi_hsc1_gate", "ipg", MXC_CCM_CCGR4, 6);
+       clk[IMX5_CLK_MIPI_HSC2_GATE]    = imx_clk_gate2("mipi_hsc2_gate", "ipg", MXC_CCM_CCGR4, 8);
+       clk[IMX5_CLK_MIPI_ESC_GATE]     = imx_clk_gate2("mipi_esc_gate", "ipg", MXC_CCM_CCGR4, 10);
+       clk[IMX5_CLK_MIPI_HSP_GATE]     = imx_clk_gate2("mipi_hsp_gate", "ipg", MXC_CCM_CCGR4, 12);
+       clk[IMX5_CLK_SPDIF_XTAL_SEL]    = imx_clk_mux("spdif_xtal_sel", MXC_CCM_CSCMR1, 2, 2,
+                                               mx51_spdif_xtal_sel, ARRAY_SIZE(mx51_spdif_xtal_sel));
+       clk[IMX5_CLK_SPDIF1_SEL]        = imx_clk_mux("spdif1_sel", MXC_CCM_CSCMR2, 2, 2,
+                                               spdif_sel, ARRAY_SIZE(spdif_sel));
+       clk[IMX5_CLK_SPDIF1_PRED]       = imx_clk_divider("spdif1_pred", "spdif1_sel", MXC_CCM_CDCDR, 16, 3);
+       clk[IMX5_CLK_SPDIF1_PODF]       = imx_clk_divider("spdif1_podf", "spdif1_pred", MXC_CCM_CDCDR, 9, 6);
+       clk[IMX5_CLK_SPDIF1_COM_SEL]    = imx_clk_mux("spdif1_com_sel", MXC_CCM_CSCMR2, 5, 1,
+                                               mx51_spdif1_com_sel, ARRAY_SIZE(mx51_spdif1_com_sel));
+       clk[IMX5_CLK_SPDIF1_GATE]       = imx_clk_gate2("spdif1_gate", "spdif1_com_sel", MXC_CCM_CCGR5, 28);
+
+       imx_check_clocks(clk, ARRAY_SIZE(clk));
+
+       clk_data.clks = clk;
+       clk_data.clk_num = ARRAY_SIZE(clk);
+       of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
+
+       /* set the usboh3 parent to pll2_sw */
+       clk_set_parent(clk[IMX5_CLK_USBOH3_SEL], clk[IMX5_CLK_PLL2_SW]);
+
+       /* set SDHC root clock to 166.25MHZ*/
+       clk_set_rate(clk[IMX5_CLK_ESDHC_A_PODF], 166250000);
+       clk_set_rate(clk[IMX5_CLK_ESDHC_B_PODF], 166250000);
+
+       clk_prepare_enable(clk[IMX5_CLK_IIM_GATE]);
+       imx_print_silicon_rev("i.MX51", mx51_revision());
+       clk_disable_unprepare(clk[IMX5_CLK_IIM_GATE]);
+
+       /*
+        * Reference Manual says: Functionality of CCDR[18] and CLPCR[23] is no
+        * longer supported. Set to one for better power saving.
+        *
+        * The effect of not setting these bits is that MIPI clocks can't be
+        * enabled without the IPU clock being enabled aswell.
+        */
+       val = readl(MXC_CCM_CCDR);
+       val |= 1 << 18;
+       writel(val, MXC_CCM_CCDR);
+
+       val = readl(MXC_CCM_CLPCR);
+       val |= 1 << 23;
+       writel(val, MXC_CCM_CLPCR);
+}
+CLK_OF_DECLARE(imx51_ccm, "fsl,imx51-ccm", mx51_clocks_init);
+
+static void __init mx53_clocks_init(struct device_node *np)
+{
+       void __iomem *ccm_base;
+       void __iomem *pll_base;
+       unsigned long r;
+
+       pll_base = ioremap(MX53_DPLL1_BASE, SZ_16K);
+       WARN_ON(!pll_base);
+       clk[IMX5_CLK_PLL1_SW]           = imx_clk_pllv2("pll1_sw", "osc", pll_base);
+
+       pll_base = ioremap(MX53_DPLL2_BASE, SZ_16K);
+       WARN_ON(!pll_base);
+       clk[IMX5_CLK_PLL2_SW]           = imx_clk_pllv2("pll2_sw", "osc", pll_base);
+
+       pll_base = ioremap(MX53_DPLL3_BASE, SZ_16K);
+       WARN_ON(!pll_base);
+       clk[IMX5_CLK_PLL3_SW]           = imx_clk_pllv2("pll3_sw", "osc", pll_base);
+
+       pll_base = ioremap(MX53_DPLL4_BASE, SZ_16K);
+       WARN_ON(!pll_base);
+       clk[IMX5_CLK_PLL4_SW]           = imx_clk_pllv2("pll4_sw", "osc", pll_base);
+
+       ccm_base = of_iomap(np, 0);
+       WARN_ON(!ccm_base);
+
+       mx5_clocks_common_init(ccm_base);
+
+       clk[IMX5_CLK_LP_APM]            = imx_clk_mux("lp_apm", MXC_CCM_CCSR, 10, 1,
+                                               lp_apm_sel, ARRAY_SIZE(lp_apm_sel));
+       clk[IMX5_CLK_LDB_DI1_DIV_3_5]   = imx_clk_fixed_factor("ldb_di1_div_3_5", "ldb_di1_sel", 2, 7);
+       clk[IMX5_CLK_LDB_DI1_DIV]       = imx_clk_divider_flags("ldb_di1_div", "ldb_di1_div_3_5", MXC_CCM_CSCMR2, 11, 1, 0);
+       clk[IMX5_CLK_LDB_DI1_SEL]       = imx_clk_mux_flags("ldb_di1_sel", MXC_CCM_CSCMR2, 9, 1,
+                                               mx53_ldb_di1_sel, ARRAY_SIZE(mx53_ldb_di1_sel), CLK_SET_RATE_PARENT);
+       clk[IMX5_CLK_DI_PLL4_PODF]      = imx_clk_divider("di_pll4_podf", "pll4_sw", MXC_CCM_CDCDR, 16, 3);
+       clk[IMX5_CLK_LDB_DI0_DIV_3_5]   = imx_clk_fixed_factor("ldb_di0_div_3_5", "ldb_di0_sel", 2, 7);
+       clk[IMX5_CLK_LDB_DI0_DIV]       = imx_clk_divider_flags("ldb_di0_div", "ldb_di0_div_3_5", MXC_CCM_CSCMR2, 10, 1, 0);
+       clk[IMX5_CLK_LDB_DI0_SEL]       = imx_clk_mux_flags("ldb_di0_sel", MXC_CCM_CSCMR2, 8, 1,
+                                               mx53_ldb_di0_sel, ARRAY_SIZE(mx53_ldb_di0_sel), CLK_SET_RATE_PARENT);
+       clk[IMX5_CLK_LDB_DI0_GATE]      = imx_clk_gate2("ldb_di0_gate", "ldb_di0_div", MXC_CCM_CCGR6, 28);
+       clk[IMX5_CLK_LDB_DI1_GATE]      = imx_clk_gate2("ldb_di1_gate", "ldb_di1_div", MXC_CCM_CCGR6, 30);
+       clk[IMX5_CLK_IPU_DI0_SEL]       = imx_clk_mux("ipu_di0_sel", MXC_CCM_CSCMR2, 26, 3,
+                                               mx53_ipu_di0_sel, ARRAY_SIZE(mx53_ipu_di0_sel));
+       clk[IMX5_CLK_IPU_DI1_SEL]       = imx_clk_mux("ipu_di1_sel", MXC_CCM_CSCMR2, 29, 3,
+                                               mx53_ipu_di1_sel, ARRAY_SIZE(mx53_ipu_di1_sel));
+       clk[IMX5_CLK_TVE_EXT_SEL]       = imx_clk_mux_flags("tve_ext_sel", MXC_CCM_CSCMR1, 6, 1,
+                                               mx53_tve_ext_sel, ARRAY_SIZE(mx53_tve_ext_sel), CLK_SET_RATE_PARENT);
+       clk[IMX5_CLK_TVE_GATE]          = imx_clk_gate2("tve_gate", "tve_pred", MXC_CCM_CCGR2, 30);
+       clk[IMX5_CLK_TVE_PRED]          = imx_clk_divider("tve_pred", "tve_ext_sel", MXC_CCM_CDCDR, 28, 3);
+       clk[IMX5_CLK_ESDHC1_PER_GATE]   = imx_clk_gate2("esdhc1_per_gate", "esdhc_a_podf", MXC_CCM_CCGR3, 2);
+       clk[IMX5_CLK_ESDHC2_PER_GATE]   = imx_clk_gate2("esdhc2_per_gate", "esdhc_c_sel", MXC_CCM_CCGR3, 6);
+       clk[IMX5_CLK_ESDHC3_PER_GATE]   = imx_clk_gate2("esdhc3_per_gate", "esdhc_b_podf", MXC_CCM_CCGR3, 10);
+       clk[IMX5_CLK_ESDHC4_PER_GATE]   = imx_clk_gate2("esdhc4_per_gate", "esdhc_d_sel", MXC_CCM_CCGR3, 14);
+       clk[IMX5_CLK_USB_PHY1_GATE]     = imx_clk_gate2("usb_phy1_gate", "usb_phy_sel", MXC_CCM_CCGR4, 10);
+       clk[IMX5_CLK_USB_PHY2_GATE]     = imx_clk_gate2("usb_phy2_gate", "usb_phy_sel", MXC_CCM_CCGR4, 12);
+       clk[IMX5_CLK_CAN_SEL]           = imx_clk_mux("can_sel", MXC_CCM_CSCMR2, 6, 2,
+                                               mx53_can_sel, ARRAY_SIZE(mx53_can_sel));
+       clk[IMX5_CLK_CAN1_SERIAL_GATE]  = imx_clk_gate2("can1_serial_gate", "can_sel", MXC_CCM_CCGR6, 22);
+       clk[IMX5_CLK_CAN1_IPG_GATE]     = imx_clk_gate2("can1_ipg_gate", "ipg", MXC_CCM_CCGR6, 20);
+       clk[IMX5_CLK_OCRAM]             = imx_clk_gate2("ocram", "ahb", MXC_CCM_CCGR6, 2);
+       clk[IMX5_CLK_CAN2_SERIAL_GATE]  = imx_clk_gate2("can2_serial_gate", "can_sel", MXC_CCM_CCGR4, 8);
+       clk[IMX5_CLK_CAN2_IPG_GATE]     = imx_clk_gate2("can2_ipg_gate", "ipg", MXC_CCM_CCGR4, 6);
+       clk[IMX5_CLK_I2C3_GATE]         = imx_clk_gate2("i2c3_gate", "per_root", MXC_CCM_CCGR1, 22);
+       clk[IMX5_CLK_SATA_GATE]         = imx_clk_gate2("sata_gate", "ipg", MXC_CCM_CCGR4, 2);
+
+       clk[IMX5_CLK_CKO1_SEL]          = imx_clk_mux("cko1_sel", MXC_CCM_CCOSR, 0, 4,
+                                               mx53_cko1_sel, ARRAY_SIZE(mx53_cko1_sel));
+       clk[IMX5_CLK_CKO1_PODF]         = imx_clk_divider("cko1_podf", "cko1_sel", MXC_CCM_CCOSR, 4, 3);
+       clk[IMX5_CLK_CKO1]              = imx_clk_gate2("cko1", "cko1_podf", MXC_CCM_CCOSR, 7);
+
+       clk[IMX5_CLK_CKO2_SEL]          = imx_clk_mux("cko2_sel", MXC_CCM_CCOSR, 16, 5,
+                                               mx53_cko2_sel, ARRAY_SIZE(mx53_cko2_sel));
+       clk[IMX5_CLK_CKO2_PODF]         = imx_clk_divider("cko2_podf", "cko2_sel", MXC_CCM_CCOSR, 21, 3);
+       clk[IMX5_CLK_CKO2]              = imx_clk_gate2("cko2", "cko2_podf", MXC_CCM_CCOSR, 24);
+       clk[IMX5_CLK_SPDIF_XTAL_SEL]    = imx_clk_mux("spdif_xtal_sel", MXC_CCM_CSCMR1, 2, 2,
+                                               mx53_spdif_xtal_sel, ARRAY_SIZE(mx53_spdif_xtal_sel));
+       clk[IMX5_CLK_ARM]               = imx_clk_cpu("arm", "cpu_podf",
+                                               clk[IMX5_CLK_CPU_PODF],
+                                               clk[IMX5_CLK_CPU_PODF_SEL],
+                                               clk[IMX5_CLK_PLL1_SW],
+                                               clk[IMX5_CLK_STEP_SEL]);
+
+       imx_check_clocks(clk, ARRAY_SIZE(clk));
+
+       clk_data.clks = clk;
+       clk_data.clk_num = ARRAY_SIZE(clk);
+       of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
+
+       /* set SDHC root clock to 200MHZ*/
+       clk_set_rate(clk[IMX5_CLK_ESDHC_A_PODF], 200000000);
+       clk_set_rate(clk[IMX5_CLK_ESDHC_B_PODF], 200000000);
+
+       /* move can bus clk to 24MHz */
+       clk_set_parent(clk[IMX5_CLK_CAN_SEL], clk[IMX5_CLK_LP_APM]);
+
+       /* make sure step clock is running from 24MHz */
+       clk_set_parent(clk[IMX5_CLK_STEP_SEL], clk[IMX5_CLK_LP_APM]);
+
+       clk_prepare_enable(clk[IMX5_CLK_IIM_GATE]);
+       imx_print_silicon_rev("i.MX53", mx53_revision());
+       clk_disable_unprepare(clk[IMX5_CLK_IIM_GATE]);
+
+       r = clk_round_rate(clk[IMX5_CLK_USBOH3_PER_GATE], 54000000);
+       clk_set_rate(clk[IMX5_CLK_USBOH3_PER_GATE], r);
+}
+CLK_OF_DECLARE(imx53_ccm, "fsl,imx53-ccm", mx53_clocks_init);
diff --git a/drivers/clk/imx/clk-imx6q.c b/drivers/clk/imx/clk-imx6q.c
new file mode 100644 (file)
index 0000000..d046f8e
--- /dev/null
@@ -0,0 +1,538 @@
+/*
+ * Copyright 2011-2013 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:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+#include <linux/init.h>
+#include <linux/types.h>
+#include <linux/clk.h>
+#include <linux/clkdev.h>
+#include <linux/err.h>
+#include <linux/io.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
+#include <soc/imx/revision.h>
+#include <dt-bindings/clock/imx6qdl-clock.h>
+
+#include "clk.h"
+
+static const char *step_sels[] = { "osc", "pll2_pfd2_396m", };
+static const char *pll1_sw_sels[]      = { "pll1_sys", "step", };
+static const char *periph_pre_sels[]   = { "pll2_bus", "pll2_pfd2_396m", "pll2_pfd0_352m", "pll2_198m", };
+static const char *periph_clk2_sels[]  = { "pll3_usb_otg", "osc", "osc", "dummy", };
+static const char *periph2_clk2_sels[] = { "pll3_usb_otg", "pll2_bus", };
+static const char *periph_sels[]       = { "periph_pre", "periph_clk2", };
+static const char *periph2_sels[]      = { "periph2_pre", "periph2_clk2", };
+static const char *axi_sels[]          = { "periph", "pll2_pfd2_396m", "periph", "pll3_pfd1_540m", };
+static const char *audio_sels[]        = { "pll4_audio_div", "pll3_pfd2_508m", "pll3_pfd3_454m", "pll3_usb_otg", };
+static const char *gpu_axi_sels[]      = { "axi", "ahb", };
+static const char *gpu2d_core_sels[]   = { "axi", "pll3_usb_otg", "pll2_pfd0_352m", "pll2_pfd2_396m", };
+static const char *gpu3d_core_sels[]   = { "mmdc_ch0_axi", "pll3_usb_otg", "pll2_pfd1_594m", "pll2_pfd2_396m", };
+static const char *gpu3d_shader_sels[] = { "mmdc_ch0_axi", "pll3_usb_otg", "pll2_pfd1_594m", "pll3_pfd0_720m", };
+static const char *ipu_sels[]          = { "mmdc_ch0_axi", "pll2_pfd2_396m", "pll3_120m", "pll3_pfd1_540m", };
+static const char *ldb_di_sels[]       = { "pll5_video_div", "pll2_pfd0_352m", "pll2_pfd2_396m", "mmdc_ch1_axi", "pll3_usb_otg", };
+static const char *ipu_di_pre_sels[]   = { "mmdc_ch0_axi", "pll3_usb_otg", "pll5_video_div", "pll2_pfd0_352m", "pll2_pfd2_396m", "pll3_pfd1_540m", };
+static const char *ipu1_di0_sels[]     = { "ipu1_di0_pre", "dummy", "dummy", "ldb_di0", "ldb_di1", };
+static const char *ipu1_di1_sels[]     = { "ipu1_di1_pre", "dummy", "dummy", "ldb_di0", "ldb_di1", };
+static const char *ipu2_di0_sels[]     = { "ipu2_di0_pre", "dummy", "dummy", "ldb_di0", "ldb_di1", };
+static const char *ipu2_di1_sels[]     = { "ipu2_di1_pre", "dummy", "dummy", "ldb_di0", "ldb_di1", };
+static const char *hsi_tx_sels[]       = { "pll3_120m", "pll2_pfd2_396m", };
+static const char *pcie_axi_sels[]     = { "axi", "ahb", };
+static const char *ssi_sels[]          = { "pll3_pfd2_508m", "pll3_pfd3_454m", "pll4_audio_div", };
+static const char *usdhc_sels[]        = { "pll2_pfd2_396m", "pll2_pfd0_352m", };
+static const char *enfc_sels[] = { "pll2_pfd0_352m", "pll2_bus", "pll3_usb_otg", "pll2_pfd2_396m", };
+static const char *eim_sels[]          = { "pll2_pfd2_396m", "pll3_usb_otg", "axi", "pll2_pfd0_352m", };
+static const char *eim_slow_sels[]      = { "axi", "pll3_usb_otg", "pll2_pfd2_396m", "pll2_pfd0_352m", };
+static const char *vdo_axi_sels[]      = { "axi", "ahb", };
+static const char *vpu_axi_sels[]      = { "axi", "pll2_pfd2_396m", "pll2_pfd0_352m", };
+static const char *cko1_sels[] = { "pll3_usb_otg", "pll2_bus", "pll1_sys", "pll5_video_div",
+                                   "dummy", "axi", "enfc", "ipu1_di0", "ipu1_di1", "ipu2_di0",
+                                   "ipu2_di1", "ahb", "ipg", "ipg_per", "ckil", "pll4_audio_div", };
+static const char *cko2_sels[] = {
+       "mmdc_ch0_axi", "mmdc_ch1_axi", "usdhc4", "usdhc1",
+       "gpu2d_axi", "dummy", "ecspi_root", "gpu3d_axi",
+       "usdhc3", "dummy", "arm", "ipu1",
+       "ipu2", "vdo_axi", "osc", "gpu2d_core",
+       "gpu3d_core", "usdhc2", "ssi1", "ssi2",
+       "ssi3", "gpu3d_shader", "vpu_axi", "can_root",
+       "ldb_di0", "ldb_di1", "esai_extal", "eim_slow",
+       "uart_serial", "spdif", "asrc", "hsi_tx",
+};
+static const char *cko_sels[] = { "cko1", "cko2", };
+static const char *lvds_sels[] = {
+       "dummy", "dummy", "dummy", "dummy", "dummy", "dummy",
+       "pll4_audio", "pll5_video", "pll8_mlb", "enet_ref",
+       "pcie_ref_125m", "sata_ref_100m",
+};
+static const char *pll_bypass_src_sels[] = { "osc", "lvds1_in", "lvds2_in", "dummy", };
+static const char *pll1_bypass_sels[] = { "pll1", "pll1_bypass_src", };
+static const char *pll2_bypass_sels[] = { "pll2", "pll2_bypass_src", };
+static const char *pll3_bypass_sels[] = { "pll3", "pll3_bypass_src", };
+static const char *pll4_bypass_sels[] = { "pll4", "pll4_bypass_src", };
+static const char *pll5_bypass_sels[] = { "pll5", "pll5_bypass_src", };
+static const char *pll6_bypass_sels[] = { "pll6", "pll6_bypass_src", };
+static const char *pll7_bypass_sels[] = { "pll7", "pll7_bypass_src", };
+
+static struct clk *clk[IMX6QDL_CLK_END];
+static struct clk_onecell_data clk_data;
+
+static unsigned int const clks_init_on[] __initconst = {
+       IMX6QDL_CLK_MMDC_CH0_AXI,
+       IMX6QDL_CLK_ROM,
+       IMX6QDL_CLK_ARM,
+};
+
+static struct clk_div_table clk_enet_ref_table[] = {
+       { .val = 0, .div = 20, },
+       { .val = 1, .div = 10, },
+       { .val = 2, .div = 5, },
+       { .val = 3, .div = 4, },
+       { /* sentinel */ }
+};
+
+static struct clk_div_table post_div_table[] = {
+       { .val = 2, .div = 1, },
+       { .val = 1, .div = 2, },
+       { .val = 0, .div = 4, },
+       { /* sentinel */ }
+};
+
+static struct clk_div_table video_div_table[] = {
+       { .val = 0, .div = 1, },
+       { .val = 1, .div = 2, },
+       { .val = 2, .div = 1, },
+       { .val = 3, .div = 4, },
+       { /* sentinel */ }
+};
+
+static unsigned int share_count_esai;
+static unsigned int share_count_asrc;
+static unsigned int share_count_ssi1;
+static unsigned int share_count_ssi2;
+static unsigned int share_count_ssi3;
+static unsigned int share_count_mipi_core_cfg;
+
+static inline int clk_on_imx6q(void)
+{
+       return of_machine_is_compatible("fsl,imx6q");
+}
+
+static inline int clk_on_imx6dl(void)
+{
+       return of_machine_is_compatible("fsl,imx6dl");
+}
+
+static void __init imx6q_clocks_init(struct device_node *ccm_node)
+{
+       struct device_node *np;
+       void __iomem *base;
+       int i;
+       int ret;
+
+       clk[IMX6QDL_CLK_DUMMY] = imx_clk_fixed("dummy", 0);
+       clk[IMX6QDL_CLK_CKIL] = imx_obtain_fixed_clock("ckil", 0);
+       clk[IMX6QDL_CLK_CKIH] = imx_obtain_fixed_clock("ckih1", 0);
+       clk[IMX6QDL_CLK_OSC] = imx_obtain_fixed_clock("osc", 0);
+       /* Clock source from external clock via CLK1/2 PADs */
+       clk[IMX6QDL_CLK_ANACLK1] = imx_obtain_fixed_clock("anaclk1", 0);
+       clk[IMX6QDL_CLK_ANACLK2] = imx_obtain_fixed_clock("anaclk2", 0);
+
+       np = of_find_compatible_node(NULL, NULL, "fsl,imx6q-anatop");
+       base = of_iomap(np, 0);
+       WARN_ON(!base);
+
+       /* Audio/video PLL post dividers do not work on i.MX6q revision 1.0 */
+       if (clk_on_imx6q() && imx_get_soc_revision() == IMX_CHIP_REVISION_1_0) {
+               post_div_table[1].div = 1;
+               post_div_table[2].div = 1;
+               video_div_table[1].div = 1;
+               video_div_table[3].div = 1;
+       }
+
+       clk[IMX6QDL_PLL1_BYPASS_SRC] = imx_clk_mux("pll1_bypass_src", base + 0x00, 14, 2, pll_bypass_src_sels, ARRAY_SIZE(pll_bypass_src_sels));
+       clk[IMX6QDL_PLL2_BYPASS_SRC] = imx_clk_mux("pll2_bypass_src", base + 0x30, 14, 2, pll_bypass_src_sels, ARRAY_SIZE(pll_bypass_src_sels));
+       clk[IMX6QDL_PLL3_BYPASS_SRC] = imx_clk_mux("pll3_bypass_src", base + 0x10, 14, 2, pll_bypass_src_sels, ARRAY_SIZE(pll_bypass_src_sels));
+       clk[IMX6QDL_PLL4_BYPASS_SRC] = imx_clk_mux("pll4_bypass_src", base + 0x70, 14, 2, pll_bypass_src_sels, ARRAY_SIZE(pll_bypass_src_sels));
+       clk[IMX6QDL_PLL5_BYPASS_SRC] = imx_clk_mux("pll5_bypass_src", base + 0xa0, 14, 2, pll_bypass_src_sels, ARRAY_SIZE(pll_bypass_src_sels));
+       clk[IMX6QDL_PLL6_BYPASS_SRC] = imx_clk_mux("pll6_bypass_src", base + 0xe0, 14, 2, pll_bypass_src_sels, ARRAY_SIZE(pll_bypass_src_sels));
+       clk[IMX6QDL_PLL7_BYPASS_SRC] = imx_clk_mux("pll7_bypass_src", base + 0x20, 14, 2, pll_bypass_src_sels, ARRAY_SIZE(pll_bypass_src_sels));
+
+       /*                                    type               name    parent_name        base         div_mask */
+       clk[IMX6QDL_CLK_PLL1] = imx_clk_pllv3(IMX_PLLV3_SYS,     "pll1", "pll1_bypass_src", base + 0x00, 0x7f);
+       clk[IMX6QDL_CLK_PLL2] = imx_clk_pllv3(IMX_PLLV3_GENERIC, "pll2", "pll2_bypass_src", base + 0x30, 0x1);
+       clk[IMX6QDL_CLK_PLL3] = imx_clk_pllv3(IMX_PLLV3_USB,     "pll3", "pll3_bypass_src", base + 0x10, 0x3);
+       clk[IMX6QDL_CLK_PLL4] = imx_clk_pllv3(IMX_PLLV3_AV,      "pll4", "pll4_bypass_src", base + 0x70, 0x7f);
+       clk[IMX6QDL_CLK_PLL5] = imx_clk_pllv3(IMX_PLLV3_AV,      "pll5", "pll5_bypass_src", base + 0xa0, 0x7f);
+       clk[IMX6QDL_CLK_PLL6] = imx_clk_pllv3(IMX_PLLV3_ENET,    "pll6", "pll6_bypass_src", base + 0xe0, 0x3);
+       clk[IMX6QDL_CLK_PLL7] = imx_clk_pllv3(IMX_PLLV3_USB,     "pll7", "pll7_bypass_src", base + 0x20, 0x3);
+
+       clk[IMX6QDL_PLL1_BYPASS] = imx_clk_mux_flags("pll1_bypass", base + 0x00, 16, 1, pll1_bypass_sels, ARRAY_SIZE(pll1_bypass_sels), CLK_SET_RATE_PARENT);
+       clk[IMX6QDL_PLL2_BYPASS] = imx_clk_mux_flags("pll2_bypass", base + 0x30, 16, 1, pll2_bypass_sels, ARRAY_SIZE(pll2_bypass_sels), CLK_SET_RATE_PARENT);
+       clk[IMX6QDL_PLL3_BYPASS] = imx_clk_mux_flags("pll3_bypass", base + 0x10, 16, 1, pll3_bypass_sels, ARRAY_SIZE(pll3_bypass_sels), CLK_SET_RATE_PARENT);
+       clk[IMX6QDL_PLL4_BYPASS] = imx_clk_mux_flags("pll4_bypass", base + 0x70, 16, 1, pll4_bypass_sels, ARRAY_SIZE(pll4_bypass_sels), CLK_SET_RATE_PARENT);
+       clk[IMX6QDL_PLL5_BYPASS] = imx_clk_mux_flags("pll5_bypass", base + 0xa0, 16, 1, pll5_bypass_sels, ARRAY_SIZE(pll5_bypass_sels), CLK_SET_RATE_PARENT);
+       clk[IMX6QDL_PLL6_BYPASS] = imx_clk_mux_flags("pll6_bypass", base + 0xe0, 16, 1, pll6_bypass_sels, ARRAY_SIZE(pll6_bypass_sels), CLK_SET_RATE_PARENT);
+       clk[IMX6QDL_PLL7_BYPASS] = imx_clk_mux_flags("pll7_bypass", base + 0x20, 16, 1, pll7_bypass_sels, ARRAY_SIZE(pll7_bypass_sels), CLK_SET_RATE_PARENT);
+
+       /* Do not bypass PLLs initially */
+       clk_set_parent(clk[IMX6QDL_PLL1_BYPASS], clk[IMX6QDL_CLK_PLL1]);
+       clk_set_parent(clk[IMX6QDL_PLL2_BYPASS], clk[IMX6QDL_CLK_PLL2]);
+       clk_set_parent(clk[IMX6QDL_PLL3_BYPASS], clk[IMX6QDL_CLK_PLL3]);
+       clk_set_parent(clk[IMX6QDL_PLL4_BYPASS], clk[IMX6QDL_CLK_PLL4]);
+       clk_set_parent(clk[IMX6QDL_PLL5_BYPASS], clk[IMX6QDL_CLK_PLL5]);
+       clk_set_parent(clk[IMX6QDL_PLL6_BYPASS], clk[IMX6QDL_CLK_PLL6]);
+       clk_set_parent(clk[IMX6QDL_PLL7_BYPASS], clk[IMX6QDL_CLK_PLL7]);
+
+       clk[IMX6QDL_CLK_PLL1_SYS]      = imx_clk_gate("pll1_sys",      "pll1_bypass", base + 0x00, 13);
+       clk[IMX6QDL_CLK_PLL2_BUS]      = imx_clk_gate("pll2_bus",      "pll2_bypass", base + 0x30, 13);
+       clk[IMX6QDL_CLK_PLL3_USB_OTG]  = imx_clk_gate("pll3_usb_otg",  "pll3_bypass", base + 0x10, 13);
+       clk[IMX6QDL_CLK_PLL4_AUDIO]    = imx_clk_gate("pll4_audio",    "pll4_bypass", base + 0x70, 13);
+       clk[IMX6QDL_CLK_PLL5_VIDEO]    = imx_clk_gate("pll5_video",    "pll5_bypass", base + 0xa0, 13);
+       clk[IMX6QDL_CLK_PLL6_ENET]     = imx_clk_gate("pll6_enet",     "pll6_bypass", base + 0xe0, 13);
+       clk[IMX6QDL_CLK_PLL7_USB_HOST] = imx_clk_gate("pll7_usb_host", "pll7_bypass", base + 0x20, 13);
+
+       /*
+        * Bit 20 is the reserved and read-only bit, we do this only for:
+        * - Do nothing for usbphy clk_enable/disable
+        * - Keep refcount when do usbphy clk_enable/disable, in that case,
+        * the clk framework may need to enable/disable usbphy's parent
+        */
+       clk[IMX6QDL_CLK_USBPHY1] = imx_clk_gate("usbphy1", "pll3_usb_otg", base + 0x10, 20);
+       clk[IMX6QDL_CLK_USBPHY2] = imx_clk_gate("usbphy2", "pll7_usb_host", base + 0x20, 20);
+
+       /*
+        * usbphy*_gate needs to be on after system boots up, and software
+        * never needs to control it anymore.
+        */
+       clk[IMX6QDL_CLK_USBPHY1_GATE] = imx_clk_gate("usbphy1_gate", "dummy", base + 0x10, 6);
+       clk[IMX6QDL_CLK_USBPHY2_GATE] = imx_clk_gate("usbphy2_gate", "dummy", base + 0x20, 6);
+
+       clk[IMX6QDL_CLK_SATA_REF] = imx_clk_fixed_factor("sata_ref", "pll6_enet", 1, 5);
+       clk[IMX6QDL_CLK_PCIE_REF] = imx_clk_fixed_factor("pcie_ref", "pll6_enet", 1, 4);
+
+       clk[IMX6QDL_CLK_SATA_REF_100M] = imx_clk_gate("sata_ref_100m", "sata_ref", base + 0xe0, 20);
+       clk[IMX6QDL_CLK_PCIE_REF_125M] = imx_clk_gate("pcie_ref_125m", "pcie_ref", base + 0xe0, 19);
+
+       clk[IMX6QDL_CLK_ENET_REF] = clk_register_divider_table(NULL, "enet_ref", "pll6_enet", 0,
+                       base + 0xe0, 0, 2, 0, clk_enet_ref_table,
+                       &imx_ccm_lock);
+
+       clk[IMX6QDL_CLK_LVDS1_SEL] = imx_clk_mux("lvds1_sel", base + 0x160, 0, 5, lvds_sels, ARRAY_SIZE(lvds_sels));
+       clk[IMX6QDL_CLK_LVDS2_SEL] = imx_clk_mux("lvds2_sel", base + 0x160, 5, 5, lvds_sels, ARRAY_SIZE(lvds_sels));
+
+       /*
+        * lvds1_gate and lvds2_gate are pseudo-gates.  Both can be
+        * independently configured as clock inputs or outputs.  We treat
+        * the "output_enable" bit as a gate, even though it's really just
+        * enabling clock output.
+        */
+       clk[IMX6QDL_CLK_LVDS1_GATE] = imx_clk_gate_exclusive("lvds1_gate", "lvds1_sel", base + 0x160, 10, BIT(12));
+       clk[IMX6QDL_CLK_LVDS2_GATE] = imx_clk_gate_exclusive("lvds2_gate", "lvds2_sel", base + 0x160, 11, BIT(13));
+
+       clk[IMX6QDL_CLK_LVDS1_IN] = imx_clk_gate_exclusive("lvds1_in", "anaclk1", base + 0x160, 12, BIT(10));
+       clk[IMX6QDL_CLK_LVDS2_IN] = imx_clk_gate_exclusive("lvds2_in", "anaclk2", base + 0x160, 13, BIT(11));
+
+       /*                                            name              parent_name        reg       idx */
+       clk[IMX6QDL_CLK_PLL2_PFD0_352M] = imx_clk_pfd("pll2_pfd0_352m", "pll2_bus",     base + 0x100, 0);
+       clk[IMX6QDL_CLK_PLL2_PFD1_594M] = imx_clk_pfd("pll2_pfd1_594m", "pll2_bus",     base + 0x100, 1);
+       clk[IMX6QDL_CLK_PLL2_PFD2_396M] = imx_clk_pfd("pll2_pfd2_396m", "pll2_bus",     base + 0x100, 2);
+       clk[IMX6QDL_CLK_PLL3_PFD0_720M] = imx_clk_pfd("pll3_pfd0_720m", "pll3_usb_otg", base + 0xf0,  0);
+       clk[IMX6QDL_CLK_PLL3_PFD1_540M] = imx_clk_pfd("pll3_pfd1_540m", "pll3_usb_otg", base + 0xf0,  1);
+       clk[IMX6QDL_CLK_PLL3_PFD2_508M] = imx_clk_pfd("pll3_pfd2_508m", "pll3_usb_otg", base + 0xf0,  2);
+       clk[IMX6QDL_CLK_PLL3_PFD3_454M] = imx_clk_pfd("pll3_pfd3_454m", "pll3_usb_otg", base + 0xf0,  3);
+
+       /*                                                name         parent_name     mult div */
+       clk[IMX6QDL_CLK_PLL2_198M] = imx_clk_fixed_factor("pll2_198m", "pll2_pfd2_396m", 1, 2);
+       clk[IMX6QDL_CLK_PLL3_120M] = imx_clk_fixed_factor("pll3_120m", "pll3_usb_otg",   1, 4);
+       clk[IMX6QDL_CLK_PLL3_80M]  = imx_clk_fixed_factor("pll3_80m",  "pll3_usb_otg",   1, 6);
+       clk[IMX6QDL_CLK_PLL3_60M]  = imx_clk_fixed_factor("pll3_60m",  "pll3_usb_otg",   1, 8);
+       clk[IMX6QDL_CLK_TWD]       = imx_clk_fixed_factor("twd",       "arm",            1, 2);
+       clk[IMX6QDL_CLK_GPT_3M]    = imx_clk_fixed_factor("gpt_3m",    "osc",            1, 8);
+       clk[IMX6QDL_CLK_VIDEO_27M] = imx_clk_fixed_factor("video_27m", "pll3_pfd1_540m", 1, 20);
+       if (clk_on_imx6dl()) {
+               clk[IMX6QDL_CLK_GPU2D_AXI] = imx_clk_fixed_factor("gpu2d_axi", "mmdc_ch0_axi_podf", 1, 1);
+               clk[IMX6QDL_CLK_GPU3D_AXI] = imx_clk_fixed_factor("gpu3d_axi", "mmdc_ch0_axi_podf", 1, 1);
+       }
+
+       clk[IMX6QDL_CLK_PLL4_POST_DIV] = clk_register_divider_table(NULL, "pll4_post_div", "pll4_audio", CLK_SET_RATE_PARENT, base + 0x70, 19, 2, 0, post_div_table, &imx_ccm_lock);
+       clk[IMX6QDL_CLK_PLL4_AUDIO_DIV] = clk_register_divider(NULL, "pll4_audio_div", "pll4_post_div", CLK_SET_RATE_PARENT, base + 0x170, 15, 1, 0, &imx_ccm_lock);
+       clk[IMX6QDL_CLK_PLL5_POST_DIV] = clk_register_divider_table(NULL, "pll5_post_div", "pll5_video", CLK_SET_RATE_PARENT, base + 0xa0, 19, 2, 0, post_div_table, &imx_ccm_lock);
+       clk[IMX6QDL_CLK_PLL5_VIDEO_DIV] = clk_register_divider_table(NULL, "pll5_video_div", "pll5_post_div", CLK_SET_RATE_PARENT, base + 0x170, 30, 2, 0, video_div_table, &imx_ccm_lock);
+
+       np = ccm_node;
+       base = of_iomap(np, 0);
+       WARN_ON(!base);
+
+       /*                                              name                reg       shift width parent_names     num_parents */
+       clk[IMX6QDL_CLK_STEP]             = imx_clk_mux("step",             base + 0xc,  8,  1, step_sels,         ARRAY_SIZE(step_sels));
+       clk[IMX6QDL_CLK_PLL1_SW]          = imx_clk_mux("pll1_sw",          base + 0xc,  2,  1, pll1_sw_sels,      ARRAY_SIZE(pll1_sw_sels));
+       clk[IMX6QDL_CLK_PERIPH_PRE]       = imx_clk_mux("periph_pre",       base + 0x18, 18, 2, periph_pre_sels,   ARRAY_SIZE(periph_pre_sels));
+       clk[IMX6QDL_CLK_PERIPH2_PRE]      = imx_clk_mux("periph2_pre",      base + 0x18, 21, 2, periph_pre_sels,   ARRAY_SIZE(periph_pre_sels));
+       clk[IMX6QDL_CLK_PERIPH_CLK2_SEL]  = imx_clk_mux("periph_clk2_sel",  base + 0x18, 12, 2, periph_clk2_sels,  ARRAY_SIZE(periph_clk2_sels));
+       clk[IMX6QDL_CLK_PERIPH2_CLK2_SEL] = imx_clk_mux("periph2_clk2_sel", base + 0x18, 20, 1, periph2_clk2_sels, ARRAY_SIZE(periph2_clk2_sels));
+       clk[IMX6QDL_CLK_AXI_SEL]          = imx_clk_mux("axi_sel",          base + 0x14, 6,  2, axi_sels,          ARRAY_SIZE(axi_sels));
+       clk[IMX6QDL_CLK_ESAI_SEL]         = imx_clk_mux("esai_sel",         base + 0x20, 19, 2, audio_sels,        ARRAY_SIZE(audio_sels));
+       clk[IMX6QDL_CLK_ASRC_SEL]         = imx_clk_mux("asrc_sel",         base + 0x30, 7,  2, audio_sels,        ARRAY_SIZE(audio_sels));
+       clk[IMX6QDL_CLK_SPDIF_SEL]        = imx_clk_mux("spdif_sel",        base + 0x30, 20, 2, audio_sels,        ARRAY_SIZE(audio_sels));
+       if (clk_on_imx6q()) {
+               clk[IMX6QDL_CLK_GPU2D_AXI]        = imx_clk_mux("gpu2d_axi",        base + 0x18, 0,  1, gpu_axi_sels,      ARRAY_SIZE(gpu_axi_sels));
+               clk[IMX6QDL_CLK_GPU3D_AXI]        = imx_clk_mux("gpu3d_axi",        base + 0x18, 1,  1, gpu_axi_sels,      ARRAY_SIZE(gpu_axi_sels));
+       }
+       clk[IMX6QDL_CLK_GPU2D_CORE_SEL]   = imx_clk_mux("gpu2d_core_sel",   base + 0x18, 16, 2, gpu2d_core_sels,   ARRAY_SIZE(gpu2d_core_sels));
+       clk[IMX6QDL_CLK_GPU3D_CORE_SEL]   = imx_clk_mux("gpu3d_core_sel",   base + 0x18, 4,  2, gpu3d_core_sels,   ARRAY_SIZE(gpu3d_core_sels));
+       clk[IMX6QDL_CLK_GPU3D_SHADER_SEL] = imx_clk_mux("gpu3d_shader_sel", base + 0x18, 8,  2, gpu3d_shader_sels, ARRAY_SIZE(gpu3d_shader_sels));
+       clk[IMX6QDL_CLK_IPU1_SEL]         = imx_clk_mux("ipu1_sel",         base + 0x3c, 9,  2, ipu_sels,          ARRAY_SIZE(ipu_sels));
+       clk[IMX6QDL_CLK_IPU2_SEL]         = imx_clk_mux("ipu2_sel",         base + 0x3c, 14, 2, ipu_sels,          ARRAY_SIZE(ipu_sels));
+       clk[IMX6QDL_CLK_LDB_DI0_SEL]      = imx_clk_mux_flags("ldb_di0_sel", base + 0x2c, 9,  3, ldb_di_sels,      ARRAY_SIZE(ldb_di_sels), CLK_SET_RATE_PARENT);
+       clk[IMX6QDL_CLK_LDB_DI1_SEL]      = imx_clk_mux_flags("ldb_di1_sel", base + 0x2c, 12, 3, ldb_di_sels,      ARRAY_SIZE(ldb_di_sels), CLK_SET_RATE_PARENT);
+       clk[IMX6QDL_CLK_IPU1_DI0_PRE_SEL] = imx_clk_mux_flags("ipu1_di0_pre_sel", base + 0x34, 6,  3, ipu_di_pre_sels,   ARRAY_SIZE(ipu_di_pre_sels), CLK_SET_RATE_PARENT);
+       clk[IMX6QDL_CLK_IPU1_DI1_PRE_SEL] = imx_clk_mux_flags("ipu1_di1_pre_sel", base + 0x34, 15, 3, ipu_di_pre_sels,   ARRAY_SIZE(ipu_di_pre_sels), CLK_SET_RATE_PARENT);
+       clk[IMX6QDL_CLK_IPU2_DI0_PRE_SEL] = imx_clk_mux_flags("ipu2_di0_pre_sel", base + 0x38, 6,  3, ipu_di_pre_sels,   ARRAY_SIZE(ipu_di_pre_sels), CLK_SET_RATE_PARENT);
+       clk[IMX6QDL_CLK_IPU2_DI1_PRE_SEL] = imx_clk_mux_flags("ipu2_di1_pre_sel", base + 0x38, 15, 3, ipu_di_pre_sels,   ARRAY_SIZE(ipu_di_pre_sels), CLK_SET_RATE_PARENT);
+       clk[IMX6QDL_CLK_IPU1_DI0_SEL]     = imx_clk_mux_flags("ipu1_di0_sel",     base + 0x34, 0,  3, ipu1_di0_sels,     ARRAY_SIZE(ipu1_di0_sels), CLK_SET_RATE_PARENT);
+       clk[IMX6QDL_CLK_IPU1_DI1_SEL]     = imx_clk_mux_flags("ipu1_di1_sel",     base + 0x34, 9,  3, ipu1_di1_sels,     ARRAY_SIZE(ipu1_di1_sels), CLK_SET_RATE_PARENT);
+       clk[IMX6QDL_CLK_IPU2_DI0_SEL]     = imx_clk_mux_flags("ipu2_di0_sel",     base + 0x38, 0,  3, ipu2_di0_sels,     ARRAY_SIZE(ipu2_di0_sels), CLK_SET_RATE_PARENT);
+       clk[IMX6QDL_CLK_IPU2_DI1_SEL]     = imx_clk_mux_flags("ipu2_di1_sel",     base + 0x38, 9,  3, ipu2_di1_sels,     ARRAY_SIZE(ipu2_di1_sels), CLK_SET_RATE_PARENT);
+       clk[IMX6QDL_CLK_HSI_TX_SEL]       = imx_clk_mux("hsi_tx_sel",       base + 0x30, 28, 1, hsi_tx_sels,       ARRAY_SIZE(hsi_tx_sels));
+       clk[IMX6QDL_CLK_PCIE_AXI_SEL]     = imx_clk_mux("pcie_axi_sel",     base + 0x18, 10, 1, pcie_axi_sels,     ARRAY_SIZE(pcie_axi_sels));
+       clk[IMX6QDL_CLK_SSI1_SEL]         = imx_clk_fixup_mux("ssi1_sel",   base + 0x1c, 10, 2, ssi_sels,          ARRAY_SIZE(ssi_sels), imx_cscmr1_fixup);
+       clk[IMX6QDL_CLK_SSI2_SEL]         = imx_clk_fixup_mux("ssi2_sel",   base + 0x1c, 12, 2, ssi_sels,          ARRAY_SIZE(ssi_sels), imx_cscmr1_fixup);
+       clk[IMX6QDL_CLK_SSI3_SEL]         = imx_clk_fixup_mux("ssi3_sel",   base + 0x1c, 14, 2, ssi_sels,          ARRAY_SIZE(ssi_sels), imx_cscmr1_fixup);
+       clk[IMX6QDL_CLK_USDHC1_SEL]       = imx_clk_fixup_mux("usdhc1_sel", base + 0x1c, 16, 1, usdhc_sels,        ARRAY_SIZE(usdhc_sels), imx_cscmr1_fixup);
+       clk[IMX6QDL_CLK_USDHC2_SEL]       = imx_clk_fixup_mux("usdhc2_sel", base + 0x1c, 17, 1, usdhc_sels,        ARRAY_SIZE(usdhc_sels), imx_cscmr1_fixup);
+       clk[IMX6QDL_CLK_USDHC3_SEL]       = imx_clk_fixup_mux("usdhc3_sel", base + 0x1c, 18, 1, usdhc_sels,        ARRAY_SIZE(usdhc_sels), imx_cscmr1_fixup);
+       clk[IMX6QDL_CLK_USDHC4_SEL]       = imx_clk_fixup_mux("usdhc4_sel", base + 0x1c, 19, 1, usdhc_sels,        ARRAY_SIZE(usdhc_sels), imx_cscmr1_fixup);
+       clk[IMX6QDL_CLK_ENFC_SEL]         = imx_clk_mux("enfc_sel",         base + 0x2c, 16, 2, enfc_sels,         ARRAY_SIZE(enfc_sels));
+       clk[IMX6QDL_CLK_EIM_SEL]          = imx_clk_fixup_mux("eim_sel",      base + 0x1c, 27, 2, eim_sels,        ARRAY_SIZE(eim_sels), imx_cscmr1_fixup);
+       clk[IMX6QDL_CLK_EIM_SLOW_SEL]     = imx_clk_fixup_mux("eim_slow_sel", base + 0x1c, 29, 2, eim_slow_sels,   ARRAY_SIZE(eim_slow_sels), imx_cscmr1_fixup);
+       clk[IMX6QDL_CLK_VDO_AXI_SEL]      = imx_clk_mux("vdo_axi_sel",      base + 0x18, 11, 1, vdo_axi_sels,      ARRAY_SIZE(vdo_axi_sels));
+       clk[IMX6QDL_CLK_VPU_AXI_SEL]      = imx_clk_mux("vpu_axi_sel",      base + 0x18, 14, 2, vpu_axi_sels,      ARRAY_SIZE(vpu_axi_sels));
+       clk[IMX6QDL_CLK_CKO1_SEL]         = imx_clk_mux("cko1_sel",         base + 0x60, 0,  4, cko1_sels,         ARRAY_SIZE(cko1_sels));
+       clk[IMX6QDL_CLK_CKO2_SEL]         = imx_clk_mux("cko2_sel",         base + 0x60, 16, 5, cko2_sels,         ARRAY_SIZE(cko2_sels));
+       clk[IMX6QDL_CLK_CKO]              = imx_clk_mux("cko",              base + 0x60, 8, 1,  cko_sels,          ARRAY_SIZE(cko_sels));
+
+       /*                                          name         reg      shift width busy: reg, shift parent_names  num_parents */
+       clk[IMX6QDL_CLK_PERIPH]  = imx_clk_busy_mux("periph",  base + 0x14, 25,  1,   base + 0x48, 5,  periph_sels,  ARRAY_SIZE(periph_sels));
+       clk[IMX6QDL_CLK_PERIPH2] = imx_clk_busy_mux("periph2", base + 0x14, 26,  1,   base + 0x48, 3,  periph2_sels, ARRAY_SIZE(periph2_sels));
+
+       /*                                                  name                parent_name          reg       shift width */
+       clk[IMX6QDL_CLK_PERIPH_CLK2]      = imx_clk_divider("periph_clk2",      "periph_clk2_sel",   base + 0x14, 27, 3);
+       clk[IMX6QDL_CLK_PERIPH2_CLK2]     = imx_clk_divider("periph2_clk2",     "periph2_clk2_sel",  base + 0x14, 0,  3);
+       clk[IMX6QDL_CLK_IPG]              = imx_clk_divider("ipg",              "ahb",               base + 0x14, 8,  2);
+       clk[IMX6QDL_CLK_IPG_PER]          = imx_clk_fixup_divider("ipg_per",    "ipg",               base + 0x1c, 0,  6, imx_cscmr1_fixup);
+       clk[IMX6QDL_CLK_ESAI_PRED]        = imx_clk_divider("esai_pred",        "esai_sel",          base + 0x28, 9,  3);
+       clk[IMX6QDL_CLK_ESAI_PODF]        = imx_clk_divider("esai_podf",        "esai_pred",         base + 0x28, 25, 3);
+       clk[IMX6QDL_CLK_ASRC_PRED]        = imx_clk_divider("asrc_pred",        "asrc_sel",          base + 0x30, 12, 3);
+       clk[IMX6QDL_CLK_ASRC_PODF]        = imx_clk_divider("asrc_podf",        "asrc_pred",         base + 0x30, 9,  3);
+       clk[IMX6QDL_CLK_SPDIF_PRED]       = imx_clk_divider("spdif_pred",       "spdif_sel",         base + 0x30, 25, 3);
+       clk[IMX6QDL_CLK_SPDIF_PODF]       = imx_clk_divider("spdif_podf",       "spdif_pred",        base + 0x30, 22, 3);
+       clk[IMX6QDL_CLK_CAN_ROOT]         = imx_clk_divider("can_root",         "pll3_60m",          base + 0x20, 2,  6);
+       clk[IMX6QDL_CLK_ECSPI_ROOT]       = imx_clk_divider("ecspi_root",       "pll3_60m",          base + 0x38, 19, 6);
+       clk[IMX6QDL_CLK_GPU2D_CORE_PODF]  = imx_clk_divider("gpu2d_core_podf",  "gpu2d_core_sel",    base + 0x18, 23, 3);
+       clk[IMX6QDL_CLK_GPU3D_CORE_PODF]  = imx_clk_divider("gpu3d_core_podf",  "gpu3d_core_sel",    base + 0x18, 26, 3);
+       clk[IMX6QDL_CLK_GPU3D_SHADER]     = imx_clk_divider("gpu3d_shader",     "gpu3d_shader_sel",  base + 0x18, 29, 3);
+       clk[IMX6QDL_CLK_IPU1_PODF]        = imx_clk_divider("ipu1_podf",        "ipu1_sel",          base + 0x3c, 11, 3);
+       clk[IMX6QDL_CLK_IPU2_PODF]        = imx_clk_divider("ipu2_podf",        "ipu2_sel",          base + 0x3c, 16, 3);
+       clk[IMX6QDL_CLK_LDB_DI0_DIV_3_5]  = imx_clk_fixed_factor("ldb_di0_div_3_5", "ldb_di0_sel", 2, 7);
+       clk[IMX6QDL_CLK_LDB_DI0_PODF]     = imx_clk_divider_flags("ldb_di0_podf", "ldb_di0_div_3_5", base + 0x20, 10, 1, 0);
+       clk[IMX6QDL_CLK_LDB_DI1_DIV_3_5]  = imx_clk_fixed_factor("ldb_di1_div_3_5", "ldb_di1_sel", 2, 7);
+       clk[IMX6QDL_CLK_LDB_DI1_PODF]     = imx_clk_divider_flags("ldb_di1_podf", "ldb_di1_div_3_5", base + 0x20, 11, 1, 0);
+       clk[IMX6QDL_CLK_IPU1_DI0_PRE]     = imx_clk_divider("ipu1_di0_pre",     "ipu1_di0_pre_sel",  base + 0x34, 3,  3);
+       clk[IMX6QDL_CLK_IPU1_DI1_PRE]     = imx_clk_divider("ipu1_di1_pre",     "ipu1_di1_pre_sel",  base + 0x34, 12, 3);
+       clk[IMX6QDL_CLK_IPU2_DI0_PRE]     = imx_clk_divider("ipu2_di0_pre",     "ipu2_di0_pre_sel",  base + 0x38, 3,  3);
+       clk[IMX6QDL_CLK_IPU2_DI1_PRE]     = imx_clk_divider("ipu2_di1_pre",     "ipu2_di1_pre_sel",  base + 0x38, 12, 3);
+       clk[IMX6QDL_CLK_HSI_TX_PODF]      = imx_clk_divider("hsi_tx_podf",      "hsi_tx_sel",        base + 0x30, 29, 3);
+       clk[IMX6QDL_CLK_SSI1_PRED]        = imx_clk_divider("ssi1_pred",        "ssi1_sel",          base + 0x28, 6,  3);
+       clk[IMX6QDL_CLK_SSI1_PODF]        = imx_clk_divider("ssi1_podf",        "ssi1_pred",         base + 0x28, 0,  6);
+       clk[IMX6QDL_CLK_SSI2_PRED]        = imx_clk_divider("ssi2_pred",        "ssi2_sel",          base + 0x2c, 6,  3);
+       clk[IMX6QDL_CLK_SSI2_PODF]        = imx_clk_divider("ssi2_podf",        "ssi2_pred",         base + 0x2c, 0,  6);
+       clk[IMX6QDL_CLK_SSI3_PRED]        = imx_clk_divider("ssi3_pred",        "ssi3_sel",          base + 0x28, 22, 3);
+       clk[IMX6QDL_CLK_SSI3_PODF]        = imx_clk_divider("ssi3_podf",        "ssi3_pred",         base + 0x28, 16, 6);
+       clk[IMX6QDL_CLK_UART_SERIAL_PODF] = imx_clk_divider("uart_serial_podf", "pll3_80m",          base + 0x24, 0,  6);
+       clk[IMX6QDL_CLK_USDHC1_PODF]      = imx_clk_divider("usdhc1_podf",      "usdhc1_sel",        base + 0x24, 11, 3);
+       clk[IMX6QDL_CLK_USDHC2_PODF]      = imx_clk_divider("usdhc2_podf",      "usdhc2_sel",        base + 0x24, 16, 3);
+       clk[IMX6QDL_CLK_USDHC3_PODF]      = imx_clk_divider("usdhc3_podf",      "usdhc3_sel",        base + 0x24, 19, 3);
+       clk[IMX6QDL_CLK_USDHC4_PODF]      = imx_clk_divider("usdhc4_podf",      "usdhc4_sel",        base + 0x24, 22, 3);
+       clk[IMX6QDL_CLK_ENFC_PRED]        = imx_clk_divider("enfc_pred",        "enfc_sel",          base + 0x2c, 18, 3);
+       clk[IMX6QDL_CLK_ENFC_PODF]        = imx_clk_divider("enfc_podf",        "enfc_pred",         base + 0x2c, 21, 6);
+       clk[IMX6QDL_CLK_EIM_PODF]         = imx_clk_fixup_divider("eim_podf",   "eim_sel",           base + 0x1c, 20, 3, imx_cscmr1_fixup);
+       clk[IMX6QDL_CLK_EIM_SLOW_PODF]    = imx_clk_fixup_divider("eim_slow_podf", "eim_slow_sel",   base + 0x1c, 23, 3, imx_cscmr1_fixup);
+       clk[IMX6QDL_CLK_VPU_AXI_PODF]     = imx_clk_divider("vpu_axi_podf",     "vpu_axi_sel",       base + 0x24, 25, 3);
+       clk[IMX6QDL_CLK_CKO1_PODF]        = imx_clk_divider("cko1_podf",        "cko1_sel",          base + 0x60, 4,  3);
+       clk[IMX6QDL_CLK_CKO2_PODF]        = imx_clk_divider("cko2_podf",        "cko2_sel",          base + 0x60, 21, 3);
+
+       /*                                                        name                 parent_name    reg        shift width busy: reg, shift */
+       clk[IMX6QDL_CLK_AXI]               = imx_clk_busy_divider("axi",               "axi_sel",     base + 0x14, 16,  3,   base + 0x48, 0);
+       clk[IMX6QDL_CLK_MMDC_CH0_AXI_PODF] = imx_clk_busy_divider("mmdc_ch0_axi_podf", "periph",      base + 0x14, 19,  3,   base + 0x48, 4);
+       clk[IMX6QDL_CLK_MMDC_CH1_AXI_PODF] = imx_clk_busy_divider("mmdc_ch1_axi_podf", "periph2",     base + 0x14, 3,   3,   base + 0x48, 2);
+       clk[IMX6QDL_CLK_ARM]               = imx_clk_busy_divider("arm",               "pll1_sw",     base + 0x10, 0,   3,   base + 0x48, 16);
+       clk[IMX6QDL_CLK_AHB]               = imx_clk_busy_divider("ahb",               "periph",      base + 0x14, 10,  3,   base + 0x48, 1);
+
+       /*                                            name             parent_name          reg         shift */
+       clk[IMX6QDL_CLK_APBH_DMA]     = imx_clk_gate2("apbh_dma",      "usdhc3",            base + 0x68, 4);
+       clk[IMX6QDL_CLK_ASRC]         = imx_clk_gate2_shared("asrc",         "asrc_podf",   base + 0x68, 6, &share_count_asrc);
+       clk[IMX6QDL_CLK_ASRC_IPG]     = imx_clk_gate2_shared("asrc_ipg",     "ahb",         base + 0x68, 6, &share_count_asrc);
+       clk[IMX6QDL_CLK_ASRC_MEM]     = imx_clk_gate2_shared("asrc_mem",     "ahb",         base + 0x68, 6, &share_count_asrc);
+       clk[IMX6QDL_CLK_CAN1_IPG]     = imx_clk_gate2("can1_ipg",      "ipg",               base + 0x68, 14);
+       clk[IMX6QDL_CLK_CAN1_SERIAL]  = imx_clk_gate2("can1_serial",   "can_root",          base + 0x68, 16);
+       clk[IMX6QDL_CLK_CAN2_IPG]     = imx_clk_gate2("can2_ipg",      "ipg",               base + 0x68, 18);
+       clk[IMX6QDL_CLK_CAN2_SERIAL]  = imx_clk_gate2("can2_serial",   "can_root",          base + 0x68, 20);
+       clk[IMX6QDL_CLK_ECSPI1]       = imx_clk_gate2("ecspi1",        "ecspi_root",        base + 0x6c, 0);
+       clk[IMX6QDL_CLK_ECSPI2]       = imx_clk_gate2("ecspi2",        "ecspi_root",        base + 0x6c, 2);
+       clk[IMX6QDL_CLK_ECSPI3]       = imx_clk_gate2("ecspi3",        "ecspi_root",        base + 0x6c, 4);
+       clk[IMX6QDL_CLK_ECSPI4]       = imx_clk_gate2("ecspi4",        "ecspi_root",        base + 0x6c, 6);
+       if (clk_on_imx6dl())
+               clk[IMX6DL_CLK_I2C4]  = imx_clk_gate2("i2c4",          "ipg_per",           base + 0x6c, 8);
+       else
+               clk[IMX6Q_CLK_ECSPI5] = imx_clk_gate2("ecspi5",        "ecspi_root",        base + 0x6c, 8);
+       clk[IMX6QDL_CLK_ENET]         = imx_clk_gate2("enet",          "ipg",               base + 0x6c, 10);
+       clk[IMX6QDL_CLK_ESAI_EXTAL]   = imx_clk_gate2_shared("esai_extal",   "esai_podf",   base + 0x6c, 16, &share_count_esai);
+       clk[IMX6QDL_CLK_ESAI_IPG]     = imx_clk_gate2_shared("esai_ipg",   "ahb",           base + 0x6c, 16, &share_count_esai);
+       clk[IMX6QDL_CLK_ESAI_MEM]     = imx_clk_gate2_shared("esai_mem", "ahb",             base + 0x6c, 16, &share_count_esai);
+       clk[IMX6QDL_CLK_GPT_IPG]      = imx_clk_gate2("gpt_ipg",       "ipg",               base + 0x6c, 20);
+       clk[IMX6QDL_CLK_GPT_IPG_PER]  = imx_clk_gate2("gpt_ipg_per",   "ipg_per",           base + 0x6c, 22);
+       if (clk_on_imx6dl())
+               /*
+                * The multiplexer and divider of imx6q clock gpu3d_shader get
+                * redefined/reused as gpu2d_core_sel and gpu2d_core_podf on imx6dl.
+                */
+               clk[IMX6QDL_CLK_GPU2D_CORE] = imx_clk_gate2("gpu2d_core", "gpu3d_shader", base + 0x6c, 24);
+       else
+               clk[IMX6QDL_CLK_GPU2D_CORE] = imx_clk_gate2("gpu2d_core", "gpu2d_core_podf", base + 0x6c, 24);
+       clk[IMX6QDL_CLK_GPU3D_CORE]   = imx_clk_gate2("gpu3d_core",    "gpu3d_core_podf",   base + 0x6c, 26);
+       clk[IMX6QDL_CLK_HDMI_IAHB]    = imx_clk_gate2("hdmi_iahb",     "ahb",               base + 0x70, 0);
+       clk[IMX6QDL_CLK_HDMI_ISFR]    = imx_clk_gate2("hdmi_isfr",     "video_27m",         base + 0x70, 4);
+       clk[IMX6QDL_CLK_I2C1]         = imx_clk_gate2("i2c1",          "ipg_per",           base + 0x70, 6);
+       clk[IMX6QDL_CLK_I2C2]         = imx_clk_gate2("i2c2",          "ipg_per",           base + 0x70, 8);
+       clk[IMX6QDL_CLK_I2C3]         = imx_clk_gate2("i2c3",          "ipg_per",           base + 0x70, 10);
+       clk[IMX6QDL_CLK_IIM]          = imx_clk_gate2("iim",           "ipg",               base + 0x70, 12);
+       clk[IMX6QDL_CLK_ENFC]         = imx_clk_gate2("enfc",          "enfc_podf",         base + 0x70, 14);
+       clk[IMX6QDL_CLK_VDOA]         = imx_clk_gate2("vdoa",          "vdo_axi",           base + 0x70, 26);
+       clk[IMX6QDL_CLK_IPU1]         = imx_clk_gate2("ipu1",          "ipu1_podf",         base + 0x74, 0);
+       clk[IMX6QDL_CLK_IPU1_DI0]     = imx_clk_gate2("ipu1_di0",      "ipu1_di0_sel",      base + 0x74, 2);
+       clk[IMX6QDL_CLK_IPU1_DI1]     = imx_clk_gate2("ipu1_di1",      "ipu1_di1_sel",      base + 0x74, 4);
+       clk[IMX6QDL_CLK_IPU2]         = imx_clk_gate2("ipu2",          "ipu2_podf",         base + 0x74, 6);
+       clk[IMX6QDL_CLK_IPU2_DI0]     = imx_clk_gate2("ipu2_di0",      "ipu2_di0_sel",      base + 0x74, 8);
+       clk[IMX6QDL_CLK_LDB_DI0]      = imx_clk_gate2("ldb_di0",       "ldb_di0_podf",      base + 0x74, 12);
+       clk[IMX6QDL_CLK_LDB_DI1]      = imx_clk_gate2("ldb_di1",       "ldb_di1_podf",      base + 0x74, 14);
+       clk[IMX6QDL_CLK_IPU2_DI1]     = imx_clk_gate2("ipu2_di1",      "ipu2_di1_sel",      base + 0x74, 10);
+       clk[IMX6QDL_CLK_HSI_TX]       = imx_clk_gate2_shared("hsi_tx", "hsi_tx_podf",       base + 0x74, 16, &share_count_mipi_core_cfg);
+       clk[IMX6QDL_CLK_MIPI_CORE_CFG] = imx_clk_gate2_shared("mipi_core_cfg", "video_27m", base + 0x74, 16, &share_count_mipi_core_cfg);
+       clk[IMX6QDL_CLK_MIPI_IPG]     = imx_clk_gate2_shared("mipi_ipg", "ipg",             base + 0x74, 16, &share_count_mipi_core_cfg);
+       if (clk_on_imx6dl())
+               /*
+                * The multiplexer and divider of the imx6q clock gpu2d get
+                * redefined/reused as mlb_sys_sel and mlb_sys_clk_podf on imx6dl.
+                */
+               clk[IMX6QDL_CLK_MLB] = imx_clk_gate2("mlb",            "gpu2d_core_podf",   base + 0x74, 18);
+       else
+               clk[IMX6QDL_CLK_MLB] = imx_clk_gate2("mlb",            "axi",               base + 0x74, 18);
+       clk[IMX6QDL_CLK_MMDC_CH0_AXI] = imx_clk_gate2("mmdc_ch0_axi",  "mmdc_ch0_axi_podf", base + 0x74, 20);
+       clk[IMX6QDL_CLK_MMDC_CH1_AXI] = imx_clk_gate2("mmdc_ch1_axi",  "mmdc_ch1_axi_podf", base + 0x74, 22);
+       clk[IMX6QDL_CLK_OCRAM]        = imx_clk_gate2("ocram",         "ahb",               base + 0x74, 28);
+       clk[IMX6QDL_CLK_OPENVG_AXI]   = imx_clk_gate2("openvg_axi",    "axi",               base + 0x74, 30);
+       clk[IMX6QDL_CLK_PCIE_AXI]     = imx_clk_gate2("pcie_axi",      "pcie_axi_sel",      base + 0x78, 0);
+       clk[IMX6QDL_CLK_PER1_BCH]     = imx_clk_gate2("per1_bch",      "usdhc3",            base + 0x78, 12);
+       clk[IMX6QDL_CLK_PWM1]         = imx_clk_gate2("pwm1",          "ipg_per",           base + 0x78, 16);
+       clk[IMX6QDL_CLK_PWM2]         = imx_clk_gate2("pwm2",          "ipg_per",           base + 0x78, 18);
+       clk[IMX6QDL_CLK_PWM3]         = imx_clk_gate2("pwm3",          "ipg_per",           base + 0x78, 20);
+       clk[IMX6QDL_CLK_PWM4]         = imx_clk_gate2("pwm4",          "ipg_per",           base + 0x78, 22);
+       clk[IMX6QDL_CLK_GPMI_BCH_APB] = imx_clk_gate2("gpmi_bch_apb",  "usdhc3",            base + 0x78, 24);
+       clk[IMX6QDL_CLK_GPMI_BCH]     = imx_clk_gate2("gpmi_bch",      "usdhc4",            base + 0x78, 26);
+       clk[IMX6QDL_CLK_GPMI_IO]      = imx_clk_gate2("gpmi_io",       "enfc",              base + 0x78, 28);
+       clk[IMX6QDL_CLK_GPMI_APB]     = imx_clk_gate2("gpmi_apb",      "usdhc3",            base + 0x78, 30);
+       clk[IMX6QDL_CLK_ROM]          = imx_clk_gate2("rom",           "ahb",               base + 0x7c, 0);
+       clk[IMX6QDL_CLK_SATA]         = imx_clk_gate2("sata",          "ahb",               base + 0x7c, 4);
+       clk[IMX6QDL_CLK_SDMA]         = imx_clk_gate2("sdma",          "ahb",               base + 0x7c, 6);
+       clk[IMX6QDL_CLK_SPBA]         = imx_clk_gate2("spba",          "ipg",               base + 0x7c, 12);
+       clk[IMX6QDL_CLK_SPDIF]        = imx_clk_gate2("spdif",         "spdif_podf",        base + 0x7c, 14);
+       clk[IMX6QDL_CLK_SSI1_IPG]     = imx_clk_gate2_shared("ssi1_ipg",      "ipg",        base + 0x7c, 18, &share_count_ssi1);
+       clk[IMX6QDL_CLK_SSI2_IPG]     = imx_clk_gate2_shared("ssi2_ipg",      "ipg",        base + 0x7c, 20, &share_count_ssi2);
+       clk[IMX6QDL_CLK_SSI3_IPG]     = imx_clk_gate2_shared("ssi3_ipg",      "ipg",        base + 0x7c, 22, &share_count_ssi3);
+       clk[IMX6QDL_CLK_SSI1]         = imx_clk_gate2_shared("ssi1",          "ssi1_podf",  base + 0x7c, 18, &share_count_ssi1);
+       clk[IMX6QDL_CLK_SSI2]         = imx_clk_gate2_shared("ssi2",          "ssi2_podf",  base + 0x7c, 20, &share_count_ssi2);
+       clk[IMX6QDL_CLK_SSI3]         = imx_clk_gate2_shared("ssi3",          "ssi3_podf",  base + 0x7c, 22, &share_count_ssi3);
+       clk[IMX6QDL_CLK_UART_IPG]     = imx_clk_gate2("uart_ipg",      "ipg",               base + 0x7c, 24);
+       clk[IMX6QDL_CLK_UART_SERIAL]  = imx_clk_gate2("uart_serial",   "uart_serial_podf",  base + 0x7c, 26);
+       clk[IMX6QDL_CLK_USBOH3]       = imx_clk_gate2("usboh3",        "ipg",               base + 0x80, 0);
+       clk[IMX6QDL_CLK_USDHC1]       = imx_clk_gate2("usdhc1",        "usdhc1_podf",       base + 0x80, 2);
+       clk[IMX6QDL_CLK_USDHC2]       = imx_clk_gate2("usdhc2",        "usdhc2_podf",       base + 0x80, 4);
+       clk[IMX6QDL_CLK_USDHC3]       = imx_clk_gate2("usdhc3",        "usdhc3_podf",       base + 0x80, 6);
+       clk[IMX6QDL_CLK_USDHC4]       = imx_clk_gate2("usdhc4",        "usdhc4_podf",       base + 0x80, 8);
+       clk[IMX6QDL_CLK_EIM_SLOW]     = imx_clk_gate2("eim_slow",      "eim_slow_podf",     base + 0x80, 10);
+       clk[IMX6QDL_CLK_VDO_AXI]      = imx_clk_gate2("vdo_axi",       "vdo_axi_sel",       base + 0x80, 12);
+       clk[IMX6QDL_CLK_VPU_AXI]      = imx_clk_gate2("vpu_axi",       "vpu_axi_podf",      base + 0x80, 14);
+       clk[IMX6QDL_CLK_CKO1]         = imx_clk_gate("cko1",           "cko1_podf",         base + 0x60, 7);
+       clk[IMX6QDL_CLK_CKO2]         = imx_clk_gate("cko2",           "cko2_podf",         base + 0x60, 24);
+
+       /*
+        * The gpt_3m clock is not available on i.MX6Q TO1.0.  Let's point it
+        * to clock gpt_ipg_per to ease the gpt driver code.
+        */
+       if (clk_on_imx6q() && imx_get_soc_revision() == IMX_CHIP_REVISION_1_0)
+               clk[IMX6QDL_CLK_GPT_3M] = clk[IMX6QDL_CLK_GPT_IPG_PER];
+
+       imx_check_clocks(clk, ARRAY_SIZE(clk));
+
+       clk_data.clks = clk;
+       clk_data.clk_num = ARRAY_SIZE(clk);
+       of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
+
+       clk_register_clkdev(clk[IMX6QDL_CLK_ENET_REF], "enet_ref", NULL);
+
+       if ((imx_get_soc_revision() != IMX_CHIP_REVISION_1_0) ||
+           clk_on_imx6dl()) {
+               clk_set_parent(clk[IMX6QDL_CLK_LDB_DI0_SEL], clk[IMX6QDL_CLK_PLL5_VIDEO_DIV]);
+               clk_set_parent(clk[IMX6QDL_CLK_LDB_DI1_SEL], clk[IMX6QDL_CLK_PLL5_VIDEO_DIV]);
+       }
+
+       clk_set_parent(clk[IMX6QDL_CLK_IPU1_DI0_PRE_SEL], clk[IMX6QDL_CLK_PLL5_VIDEO_DIV]);
+       clk_set_parent(clk[IMX6QDL_CLK_IPU1_DI1_PRE_SEL], clk[IMX6QDL_CLK_PLL5_VIDEO_DIV]);
+       clk_set_parent(clk[IMX6QDL_CLK_IPU2_DI0_PRE_SEL], clk[IMX6QDL_CLK_PLL5_VIDEO_DIV]);
+       clk_set_parent(clk[IMX6QDL_CLK_IPU2_DI1_PRE_SEL], clk[IMX6QDL_CLK_PLL5_VIDEO_DIV]);
+       clk_set_parent(clk[IMX6QDL_CLK_IPU1_DI0_SEL], clk[IMX6QDL_CLK_IPU1_DI0_PRE]);
+       clk_set_parent(clk[IMX6QDL_CLK_IPU1_DI1_SEL], clk[IMX6QDL_CLK_IPU1_DI1_PRE]);
+       clk_set_parent(clk[IMX6QDL_CLK_IPU2_DI0_SEL], clk[IMX6QDL_CLK_IPU2_DI0_PRE]);
+       clk_set_parent(clk[IMX6QDL_CLK_IPU2_DI1_SEL], clk[IMX6QDL_CLK_IPU2_DI1_PRE]);
+
+       /*
+        * The gpmi needs 100MHz frequency in the EDO/Sync mode,
+        * We can not get the 100MHz from the pll2_pfd0_352m.
+        * So choose pll2_pfd2_396m as enfc_sel's parent.
+        */
+       clk_set_parent(clk[IMX6QDL_CLK_ENFC_SEL], clk[IMX6QDL_CLK_PLL2_PFD2_396M]);
+
+       for (i = 0; i < ARRAY_SIZE(clks_init_on); i++)
+               clk_prepare_enable(clk[clks_init_on[i]]);
+
+       if (IS_ENABLED(CONFIG_USB_MXS_PHY)) {
+               clk_prepare_enable(clk[IMX6QDL_CLK_USBPHY1_GATE]);
+               clk_prepare_enable(clk[IMX6QDL_CLK_USBPHY2_GATE]);
+       }
+
+       /*
+        * Let's initially set up CLKO with OSC24M, since this configuration
+        * is widely used by imx6q board designs to clock audio codec.
+        */
+       ret = clk_set_parent(clk[IMX6QDL_CLK_CKO2_SEL], clk[IMX6QDL_CLK_OSC]);
+       if (!ret)
+               ret = clk_set_parent(clk[IMX6QDL_CLK_CKO], clk[IMX6QDL_CLK_CKO2]);
+       if (ret)
+               pr_warn("failed to set up CLKO: %d\n", ret);
+
+       /* Audio-related clocks configuration */
+       clk_set_parent(clk[IMX6QDL_CLK_SPDIF_SEL], clk[IMX6QDL_CLK_PLL3_PFD3_454M]);
+
+       /* All existing boards with PCIe use LVDS1 */
+       if (IS_ENABLED(CONFIG_PCI_IMX6))
+               clk_set_parent(clk[IMX6QDL_CLK_LVDS1_SEL], clk[IMX6QDL_CLK_SATA_REF_100M]);
+}
+CLK_OF_DECLARE(imx6q, "fsl,imx6q-ccm", imx6q_clocks_init);
diff --git a/drivers/clk/imx/clk-imx6sl.c b/drivers/clk/imx/clk-imx6sl.c
new file mode 100644 (file)
index 0000000..a0d4cf2
--- /dev/null
@@ -0,0 +1,443 @@
+/*
+ * Copyright 2013-2014 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.
+ *
+ */
+
+#include <linux/clk.h>
+#include <linux/clkdev.h>
+#include <linux/err.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
+#include <dt-bindings/clock/imx6sl-clock.h>
+
+#include "clk.h"
+
+#define CCSR                   0xc
+#define BM_CCSR_PLL1_SW_CLK_SEL        (1 << 2)
+#define CACRR                  0x10
+#define CDHIPR                 0x48
+#define BM_CDHIPR_ARM_PODF_BUSY        (1 << 16)
+#define ARM_WAIT_DIV_396M      2
+#define ARM_WAIT_DIV_792M      4
+#define ARM_WAIT_DIV_996M      6
+
+#define PLL_ARM                        0x0
+#define BM_PLL_ARM_DIV_SELECT  (0x7f << 0)
+#define BM_PLL_ARM_POWERDOWN   (1 << 12)
+#define BM_PLL_ARM_ENABLE      (1 << 13)
+#define BM_PLL_ARM_LOCK                (1 << 31)
+#define PLL_ARM_DIV_792M       66
+
+static const char *step_sels[]         = { "osc", "pll2_pfd2", };
+static const char *pll1_sw_sels[]      = { "pll1_sys", "step", };
+static const char *ocram_alt_sels[]    = { "pll2_pfd2", "pll3_pfd1", };
+static const char *ocram_sels[]                = { "periph", "ocram_alt_sels", };
+static const char *pre_periph_sels[]   = { "pll2_bus", "pll2_pfd2", "pll2_pfd0", "pll2_198m", };
+static const char *periph_clk2_sels[]  = { "pll3_usb_otg", "osc", "osc", "dummy", };
+static const char *periph2_clk2_sels[] = { "pll3_usb_otg", "pll2_bus", };
+static const char *periph_sels[]       = { "pre_periph_sel", "periph_clk2_podf", };
+static const char *periph2_sels[]      = { "pre_periph2_sel", "periph2_clk2_podf", };
+static const char *csi_sels[]          = { "osc", "pll2_pfd2", "pll3_120m", "pll3_pfd1", };
+static const char *lcdif_axi_sels[]    = { "pll2_bus", "pll2_pfd2", "pll3_usb_otg", "pll3_pfd1", };
+static const char *usdhc_sels[]                = { "pll2_pfd2", "pll2_pfd0", };
+static const char *ssi_sels[]          = { "pll3_pfd2", "pll3_pfd3", "pll4_audio_div", "dummy", };
+static const char *perclk_sels[]       = { "ipg", "osc", };
+static const char *pxp_axi_sels[]      = { "pll2_bus", "pll3_usb_otg", "pll5_video_div", "pll2_pfd0", "pll2_pfd2", "pll3_pfd3", };
+static const char *epdc_axi_sels[]     = { "pll2_bus", "pll3_usb_otg", "pll5_video_div", "pll2_pfd0", "pll2_pfd2", "pll3_pfd2", };
+static const char *gpu2d_ovg_sels[]    = { "pll3_pfd1", "pll3_usb_otg", "pll2_bus", "pll2_pfd2", };
+static const char *gpu2d_sels[]                = { "pll2_pfd2", "pll3_usb_otg", "pll3_pfd1", "pll2_bus", };
+static const char *lcdif_pix_sels[]    = { "pll2_bus", "pll3_usb_otg", "pll5_video_div", "pll2_pfd0", "pll3_pfd0", "pll3_pfd1", };
+static const char *epdc_pix_sels[]     = { "pll2_bus", "pll3_usb_otg", "pll5_video_div", "pll2_pfd0", "pll2_pfd1", "pll3_pfd1", };
+static const char *audio_sels[]                = { "pll4_audio_div", "pll3_pfd2", "pll3_pfd3", "pll3_usb_otg", };
+static const char *ecspi_sels[]                = { "pll3_60m", "osc", };
+static const char *uart_sels[]         = { "pll3_80m", "osc", };
+static const char *lvds_sels[]         = {
+       "pll1_sys", "pll2_bus", "pll2_pfd0", "pll2_pfd1", "pll2_pfd2", "dummy", "pll4_audio", "pll5_video",
+       "dummy", "enet_ref", "dummy", "dummy", "pll3_usb_otg", "pll7_usb_host", "pll3_pfd0", "pll3_pfd1",
+       "pll3_pfd2", "pll3_pfd3", "osc", "dummy", "dummy", "dummy", "dummy", "dummy",
+        "dummy", "dummy", "dummy", "dummy", "dummy", "dummy", "dummy", "dummy",
+};
+static const char *pll_bypass_src_sels[] = { "osc", "lvds1_in", };
+static const char *pll1_bypass_sels[]  = { "pll1", "pll1_bypass_src", };
+static const char *pll2_bypass_sels[]  = { "pll2", "pll2_bypass_src", };
+static const char *pll3_bypass_sels[]  = { "pll3", "pll3_bypass_src", };
+static const char *pll4_bypass_sels[]  = { "pll4", "pll4_bypass_src", };
+static const char *pll5_bypass_sels[]  = { "pll5", "pll5_bypass_src", };
+static const char *pll6_bypass_sels[]  = { "pll6", "pll6_bypass_src", };
+static const char *pll7_bypass_sels[]  = { "pll7", "pll7_bypass_src", };
+
+static struct clk_div_table clk_enet_ref_table[] = {
+       { .val = 0, .div = 20, },
+       { .val = 1, .div = 10, },
+       { .val = 2, .div = 5, },
+       { .val = 3, .div = 4, },
+       { }
+};
+
+static struct clk_div_table post_div_table[] = {
+       { .val = 2, .div = 1, },
+       { .val = 1, .div = 2, },
+       { .val = 0, .div = 4, },
+       { }
+};
+
+static struct clk_div_table video_div_table[] = {
+       { .val = 0, .div = 1, },
+       { .val = 1, .div = 2, },
+       { .val = 2, .div = 1, },
+       { .val = 3, .div = 4, },
+       { }
+};
+
+static unsigned int share_count_ssi1;
+static unsigned int share_count_ssi2;
+static unsigned int share_count_ssi3;
+
+static struct clk *clks[IMX6SL_CLK_END];
+static struct clk_onecell_data clk_data;
+static void __iomem *ccm_base;
+static void __iomem *anatop_base;
+
+static const u32 clks_init_on[] __initconst = {
+       IMX6SL_CLK_IPG, IMX6SL_CLK_ARM, IMX6SL_CLK_MMDC_ROOT,
+};
+
+/*
+ * ERR005311 CCM: After exit from WAIT mode, unwanted interrupt(s) taken
+ *           during WAIT mode entry process could cause cache memory
+ *           corruption.
+ *
+ * Software workaround:
+ *     To prevent this issue from occurring, software should ensure that the
+ * ARM to IPG clock ratio is less than 12:5 (that is < 2.4x), before
+ * entering WAIT mode.
+ *
+ * This function will set the ARM clk to max value within the 12:5 limit.
+ * As IPG clock is fixed at 66MHz(so ARM freq must not exceed 158.4MHz),
+ * ARM freq are one of below setpoints: 396MHz, 792MHz and 996MHz, since
+ * the clk APIs can NOT be called in idle thread(may cause kernel schedule
+ * as there is sleep function in PLL wait function), so here we just slow
+ * down ARM to below freq according to previous freq:
+ *
+ * run mode      wait mode
+ * 396MHz   ->   132MHz;
+ * 792MHz   ->   158.4MHz;
+ * 996MHz   ->   142.3MHz;
+ */
+static int imx6sl_get_arm_divider_for_wait(void)
+{
+       if (readl_relaxed(ccm_base + CCSR) & BM_CCSR_PLL1_SW_CLK_SEL) {
+               return ARM_WAIT_DIV_396M;
+       } else {
+               if ((readl_relaxed(anatop_base + PLL_ARM) &
+                       BM_PLL_ARM_DIV_SELECT) == PLL_ARM_DIV_792M)
+                       return ARM_WAIT_DIV_792M;
+               else
+                       return ARM_WAIT_DIV_996M;
+       }
+}
+
+static void imx6sl_enable_pll_arm(bool enable)
+{
+       static u32 saved_pll_arm;
+       u32 val;
+
+       if (enable) {
+               saved_pll_arm = val = readl_relaxed(anatop_base + PLL_ARM);
+               val |= BM_PLL_ARM_ENABLE;
+               val &= ~BM_PLL_ARM_POWERDOWN;
+               writel_relaxed(val, anatop_base + PLL_ARM);
+               while (!(__raw_readl(anatop_base + PLL_ARM) & BM_PLL_ARM_LOCK))
+                       ;
+       } else {
+                writel_relaxed(saved_pll_arm, anatop_base + PLL_ARM);
+       }
+}
+
+void imx6sl_set_wait_clk(bool enter)
+{
+       static unsigned long saved_arm_div;
+       int arm_div_for_wait = imx6sl_get_arm_divider_for_wait();
+
+       /*
+        * According to hardware design, arm podf change need
+        * PLL1 clock enabled.
+        */
+       if (arm_div_for_wait == ARM_WAIT_DIV_396M)
+               imx6sl_enable_pll_arm(true);
+
+       if (enter) {
+               saved_arm_div = readl_relaxed(ccm_base + CACRR);
+               writel_relaxed(arm_div_for_wait, ccm_base + CACRR);
+       } else {
+               writel_relaxed(saved_arm_div, ccm_base + CACRR);
+       }
+       while (__raw_readl(ccm_base + CDHIPR) & BM_CDHIPR_ARM_PODF_BUSY)
+               ;
+
+       if (arm_div_for_wait == ARM_WAIT_DIV_396M)
+               imx6sl_enable_pll_arm(false);
+}
+
+static void __init imx6sl_clocks_init(struct device_node *ccm_node)
+{
+       struct device_node *np;
+       void __iomem *base;
+       int i;
+       int ret;
+
+       clks[IMX6SL_CLK_DUMMY] = imx_clk_fixed("dummy", 0);
+       clks[IMX6SL_CLK_CKIL] = imx_obtain_fixed_clock("ckil", 0);
+       clks[IMX6SL_CLK_OSC] = imx_obtain_fixed_clock("osc", 0);
+       /* Clock source from external clock via CLK1 PAD */
+       clks[IMX6SL_CLK_ANACLK1] = imx_obtain_fixed_clock("anaclk1", 0);
+
+       np = of_find_compatible_node(NULL, NULL, "fsl,imx6sl-anatop");
+       base = of_iomap(np, 0);
+       WARN_ON(!base);
+       anatop_base = base;
+
+       clks[IMX6SL_PLL1_BYPASS_SRC] = imx_clk_mux("pll1_bypass_src", base + 0x00, 14, 1, pll_bypass_src_sels, ARRAY_SIZE(pll_bypass_src_sels));
+       clks[IMX6SL_PLL2_BYPASS_SRC] = imx_clk_mux("pll2_bypass_src", base + 0x30, 14, 1, pll_bypass_src_sels, ARRAY_SIZE(pll_bypass_src_sels));
+       clks[IMX6SL_PLL3_BYPASS_SRC] = imx_clk_mux("pll3_bypass_src", base + 0x10, 14, 1, pll_bypass_src_sels, ARRAY_SIZE(pll_bypass_src_sels));
+       clks[IMX6SL_PLL4_BYPASS_SRC] = imx_clk_mux("pll4_bypass_src", base + 0x70, 14, 1, pll_bypass_src_sels, ARRAY_SIZE(pll_bypass_src_sels));
+       clks[IMX6SL_PLL5_BYPASS_SRC] = imx_clk_mux("pll5_bypass_src", base + 0xa0, 14, 1, pll_bypass_src_sels, ARRAY_SIZE(pll_bypass_src_sels));
+       clks[IMX6SL_PLL6_BYPASS_SRC] = imx_clk_mux("pll6_bypass_src", base + 0xe0, 14, 1, pll_bypass_src_sels, ARRAY_SIZE(pll_bypass_src_sels));
+       clks[IMX6SL_PLL7_BYPASS_SRC] = imx_clk_mux("pll7_bypass_src", base + 0x20, 14, 1, pll_bypass_src_sels, ARRAY_SIZE(pll_bypass_src_sels));
+
+       /*                                    type               name    parent_name        base         div_mask */
+       clks[IMX6SL_CLK_PLL1] = imx_clk_pllv3(IMX_PLLV3_SYS,     "pll1", "pll1_bypass_src", base + 0x00, 0x7f);
+       clks[IMX6SL_CLK_PLL2] = imx_clk_pllv3(IMX_PLLV3_GENERIC, "pll2", "pll2_bypass_src", base + 0x30, 0x1);
+       clks[IMX6SL_CLK_PLL3] = imx_clk_pllv3(IMX_PLLV3_USB,     "pll3", "pll3_bypass_src", base + 0x10, 0x3);
+       clks[IMX6SL_CLK_PLL4] = imx_clk_pllv3(IMX_PLLV3_AV,      "pll4", "pll4_bypass_src", base + 0x70, 0x7f);
+       clks[IMX6SL_CLK_PLL5] = imx_clk_pllv3(IMX_PLLV3_AV,      "pll5", "pll5_bypass_src", base + 0xa0, 0x7f);
+       clks[IMX6SL_CLK_PLL6] = imx_clk_pllv3(IMX_PLLV3_ENET,    "pll6", "pll6_bypass_src", base + 0xe0, 0x3);
+       clks[IMX6SL_CLK_PLL7] = imx_clk_pllv3(IMX_PLLV3_USB,     "pll7", "pll7_bypass_src", base + 0x20, 0x3);
+
+       clks[IMX6SL_PLL1_BYPASS] = imx_clk_mux_flags("pll1_bypass", base + 0x00, 16, 1, pll1_bypass_sels, ARRAY_SIZE(pll1_bypass_sels), CLK_SET_RATE_PARENT);
+       clks[IMX6SL_PLL2_BYPASS] = imx_clk_mux_flags("pll2_bypass", base + 0x30, 16, 1, pll2_bypass_sels, ARRAY_SIZE(pll2_bypass_sels), CLK_SET_RATE_PARENT);
+       clks[IMX6SL_PLL3_BYPASS] = imx_clk_mux_flags("pll3_bypass", base + 0x10, 16, 1, pll3_bypass_sels, ARRAY_SIZE(pll3_bypass_sels), CLK_SET_RATE_PARENT);
+       clks[IMX6SL_PLL4_BYPASS] = imx_clk_mux_flags("pll4_bypass", base + 0x70, 16, 1, pll4_bypass_sels, ARRAY_SIZE(pll4_bypass_sels), CLK_SET_RATE_PARENT);
+       clks[IMX6SL_PLL5_BYPASS] = imx_clk_mux_flags("pll5_bypass", base + 0xa0, 16, 1, pll5_bypass_sels, ARRAY_SIZE(pll5_bypass_sels), CLK_SET_RATE_PARENT);
+       clks[IMX6SL_PLL6_BYPASS] = imx_clk_mux_flags("pll6_bypass", base + 0xe0, 16, 1, pll6_bypass_sels, ARRAY_SIZE(pll6_bypass_sels), CLK_SET_RATE_PARENT);
+       clks[IMX6SL_PLL7_BYPASS] = imx_clk_mux_flags("pll7_bypass", base + 0x20, 16, 1, pll7_bypass_sels, ARRAY_SIZE(pll7_bypass_sels), CLK_SET_RATE_PARENT);
+
+       /* Do not bypass PLLs initially */
+       clk_set_parent(clks[IMX6SL_PLL1_BYPASS], clks[IMX6SL_CLK_PLL1]);
+       clk_set_parent(clks[IMX6SL_PLL2_BYPASS], clks[IMX6SL_CLK_PLL2]);
+       clk_set_parent(clks[IMX6SL_PLL3_BYPASS], clks[IMX6SL_CLK_PLL3]);
+       clk_set_parent(clks[IMX6SL_PLL4_BYPASS], clks[IMX6SL_CLK_PLL4]);
+       clk_set_parent(clks[IMX6SL_PLL5_BYPASS], clks[IMX6SL_CLK_PLL5]);
+       clk_set_parent(clks[IMX6SL_PLL6_BYPASS], clks[IMX6SL_CLK_PLL6]);
+       clk_set_parent(clks[IMX6SL_PLL7_BYPASS], clks[IMX6SL_CLK_PLL7]);
+
+       clks[IMX6SL_CLK_PLL1_SYS]      = imx_clk_gate("pll1_sys",      "pll1_bypass", base + 0x00, 13);
+       clks[IMX6SL_CLK_PLL2_BUS]      = imx_clk_gate("pll2_bus",      "pll2_bypass", base + 0x30, 13);
+       clks[IMX6SL_CLK_PLL3_USB_OTG]  = imx_clk_gate("pll3_usb_otg",  "pll3_bypass", base + 0x10, 13);
+       clks[IMX6SL_CLK_PLL4_AUDIO]    = imx_clk_gate("pll4_audio",    "pll4_bypass", base + 0x70, 13);
+       clks[IMX6SL_CLK_PLL5_VIDEO]    = imx_clk_gate("pll5_video",    "pll5_bypass", base + 0xa0, 13);
+       clks[IMX6SL_CLK_PLL6_ENET]     = imx_clk_gate("pll6_enet",     "pll6_bypass", base + 0xe0, 13);
+       clks[IMX6SL_CLK_PLL7_USB_HOST] = imx_clk_gate("pll7_usb_host", "pll7_bypass", base + 0x20, 13);
+
+       clks[IMX6SL_CLK_LVDS1_SEL] = imx_clk_mux("lvds1_sel", base + 0x160, 0, 5, lvds_sels, ARRAY_SIZE(lvds_sels));
+       clks[IMX6SL_CLK_LVDS1_OUT] = imx_clk_gate_exclusive("lvds1_out", "lvds1_sel", base + 0x160, 10, BIT(12));
+       clks[IMX6SL_CLK_LVDS1_IN] = imx_clk_gate_exclusive("lvds1_in", "anaclk1", base + 0x160, 12, BIT(10));
+
+       /*
+        * usbphy1 and usbphy2 are implemented as dummy gates using reserve
+        * bit 20.  They are used by phy driver to keep the refcount of
+        * parent PLL correct. usbphy1_gate and usbphy2_gate only needs to be
+        * turned on during boot, and software will not need to control it
+        * anymore after that.
+        */
+       clks[IMX6SL_CLK_USBPHY1]      = imx_clk_gate("usbphy1",      "pll3_usb_otg",  base + 0x10, 20);
+       clks[IMX6SL_CLK_USBPHY2]      = imx_clk_gate("usbphy2",      "pll7_usb_host", base + 0x20, 20);
+       clks[IMX6SL_CLK_USBPHY1_GATE] = imx_clk_gate("usbphy1_gate", "dummy",         base + 0x10, 6);
+       clks[IMX6SL_CLK_USBPHY2_GATE] = imx_clk_gate("usbphy2_gate", "dummy",         base + 0x20, 6);
+
+       /*                                                           dev   name              parent_name      flags                reg        shift width div: flags, div_table lock */
+       clks[IMX6SL_CLK_PLL4_POST_DIV]  = clk_register_divider_table(NULL, "pll4_post_div",  "pll4_audio",    CLK_SET_RATE_PARENT, base + 0x70,  19, 2,   0, post_div_table, &imx_ccm_lock);
+       clks[IMX6SL_CLK_PLL4_AUDIO_DIV] =       clk_register_divider(NULL, "pll4_audio_div", "pll4_post_div", CLK_SET_RATE_PARENT, base + 0x170, 15, 1,   0, &imx_ccm_lock);
+       clks[IMX6SL_CLK_PLL5_POST_DIV]  = clk_register_divider_table(NULL, "pll5_post_div",  "pll5_video",    CLK_SET_RATE_PARENT, base + 0xa0,  19, 2,   0, post_div_table, &imx_ccm_lock);
+       clks[IMX6SL_CLK_PLL5_VIDEO_DIV] = clk_register_divider_table(NULL, "pll5_video_div", "pll5_post_div", CLK_SET_RATE_PARENT, base + 0x170, 30, 2,   0, video_div_table, &imx_ccm_lock);
+       clks[IMX6SL_CLK_ENET_REF]       = clk_register_divider_table(NULL, "enet_ref",       "pll6_enet",     0,                   base + 0xe0,  0,  2,   0, clk_enet_ref_table, &imx_ccm_lock);
+
+       /*                                       name         parent_name     reg           idx */
+       clks[IMX6SL_CLK_PLL2_PFD0] = imx_clk_pfd("pll2_pfd0", "pll2_bus",     base + 0x100, 0);
+       clks[IMX6SL_CLK_PLL2_PFD1] = imx_clk_pfd("pll2_pfd1", "pll2_bus",     base + 0x100, 1);
+       clks[IMX6SL_CLK_PLL2_PFD2] = imx_clk_pfd("pll2_pfd2", "pll2_bus",     base + 0x100, 2);
+       clks[IMX6SL_CLK_PLL3_PFD0] = imx_clk_pfd("pll3_pfd0", "pll3_usb_otg", base + 0xf0,  0);
+       clks[IMX6SL_CLK_PLL3_PFD1] = imx_clk_pfd("pll3_pfd1", "pll3_usb_otg", base + 0xf0,  1);
+       clks[IMX6SL_CLK_PLL3_PFD2] = imx_clk_pfd("pll3_pfd2", "pll3_usb_otg", base + 0xf0,  2);
+       clks[IMX6SL_CLK_PLL3_PFD3] = imx_clk_pfd("pll3_pfd3", "pll3_usb_otg", base + 0xf0,  3);
+
+       /*                                                name         parent_name     mult div */
+       clks[IMX6SL_CLK_PLL2_198M] = imx_clk_fixed_factor("pll2_198m", "pll2_pfd2",      1, 2);
+       clks[IMX6SL_CLK_PLL3_120M] = imx_clk_fixed_factor("pll3_120m", "pll3_usb_otg",   1, 4);
+       clks[IMX6SL_CLK_PLL3_80M]  = imx_clk_fixed_factor("pll3_80m",  "pll3_usb_otg",   1, 6);
+       clks[IMX6SL_CLK_PLL3_60M]  = imx_clk_fixed_factor("pll3_60m",  "pll3_usb_otg",   1, 8);
+
+       np = ccm_node;
+       base = of_iomap(np, 0);
+       WARN_ON(!base);
+       ccm_base = base;
+
+       /*                                              name                reg       shift width parent_names     num_parents */
+       clks[IMX6SL_CLK_STEP]             = imx_clk_mux("step",             base + 0xc,  8,  1, step_sels,         ARRAY_SIZE(step_sels));
+       clks[IMX6SL_CLK_PLL1_SW]          = imx_clk_mux("pll1_sw",          base + 0xc,  2,  1, pll1_sw_sels,      ARRAY_SIZE(pll1_sw_sels));
+       clks[IMX6SL_CLK_OCRAM_ALT_SEL]    = imx_clk_mux("ocram_alt_sel",    base + 0x14, 7,  1, ocram_alt_sels,    ARRAY_SIZE(ocram_alt_sels));
+       clks[IMX6SL_CLK_OCRAM_SEL]        = imx_clk_mux("ocram_sel",        base + 0x14, 6,  1, ocram_sels,        ARRAY_SIZE(ocram_sels));
+       clks[IMX6SL_CLK_PRE_PERIPH2_SEL]  = imx_clk_mux("pre_periph2_sel",  base + 0x18, 21, 2, pre_periph_sels,   ARRAY_SIZE(pre_periph_sels));
+       clks[IMX6SL_CLK_PRE_PERIPH_SEL]   = imx_clk_mux("pre_periph_sel",   base + 0x18, 18, 2, pre_periph_sels,   ARRAY_SIZE(pre_periph_sels));
+       clks[IMX6SL_CLK_PERIPH2_CLK2_SEL] = imx_clk_mux("periph2_clk2_sel", base + 0x18, 20, 1, periph2_clk2_sels, ARRAY_SIZE(periph2_clk2_sels));
+       clks[IMX6SL_CLK_PERIPH_CLK2_SEL]  = imx_clk_mux("periph_clk2_sel",  base + 0x18, 12, 2, periph_clk2_sels,  ARRAY_SIZE(periph_clk2_sels));
+       clks[IMX6SL_CLK_CSI_SEL]          = imx_clk_mux("csi_sel",          base + 0x3c, 9,  2, csi_sels,          ARRAY_SIZE(csi_sels));
+       clks[IMX6SL_CLK_LCDIF_AXI_SEL]    = imx_clk_mux("lcdif_axi_sel",    base + 0x3c, 14, 2, lcdif_axi_sels,    ARRAY_SIZE(lcdif_axi_sels));
+       clks[IMX6SL_CLK_USDHC1_SEL]       = imx_clk_fixup_mux("usdhc1_sel", base + 0x1c, 16, 1, usdhc_sels,        ARRAY_SIZE(usdhc_sels),  imx_cscmr1_fixup);
+       clks[IMX6SL_CLK_USDHC2_SEL]       = imx_clk_fixup_mux("usdhc2_sel", base + 0x1c, 17, 1, usdhc_sels,        ARRAY_SIZE(usdhc_sels),  imx_cscmr1_fixup);
+       clks[IMX6SL_CLK_USDHC3_SEL]       = imx_clk_fixup_mux("usdhc3_sel", base + 0x1c, 18, 1, usdhc_sels,        ARRAY_SIZE(usdhc_sels),  imx_cscmr1_fixup);
+       clks[IMX6SL_CLK_USDHC4_SEL]       = imx_clk_fixup_mux("usdhc4_sel", base + 0x1c, 19, 1, usdhc_sels,        ARRAY_SIZE(usdhc_sels),  imx_cscmr1_fixup);
+       clks[IMX6SL_CLK_SSI1_SEL]         = imx_clk_fixup_mux("ssi1_sel",   base + 0x1c, 10, 2, ssi_sels,          ARRAY_SIZE(ssi_sels),    imx_cscmr1_fixup);
+       clks[IMX6SL_CLK_SSI2_SEL]         = imx_clk_fixup_mux("ssi2_sel",   base + 0x1c, 12, 2, ssi_sels,          ARRAY_SIZE(ssi_sels),    imx_cscmr1_fixup);
+       clks[IMX6SL_CLK_SSI3_SEL]         = imx_clk_fixup_mux("ssi3_sel",   base + 0x1c, 14, 2, ssi_sels,          ARRAY_SIZE(ssi_sels),    imx_cscmr1_fixup);
+       clks[IMX6SL_CLK_PERCLK_SEL]       = imx_clk_fixup_mux("perclk_sel", base + 0x1c, 6,  1, perclk_sels,       ARRAY_SIZE(perclk_sels), imx_cscmr1_fixup);
+       clks[IMX6SL_CLK_PXP_AXI_SEL]      = imx_clk_mux("pxp_axi_sel",      base + 0x34, 6,  3, pxp_axi_sels,      ARRAY_SIZE(pxp_axi_sels));
+       clks[IMX6SL_CLK_EPDC_AXI_SEL]     = imx_clk_mux("epdc_axi_sel",     base + 0x34, 15, 3, epdc_axi_sels,     ARRAY_SIZE(epdc_axi_sels));
+       clks[IMX6SL_CLK_GPU2D_OVG_SEL]    = imx_clk_mux("gpu2d_ovg_sel",    base + 0x18, 4,  2, gpu2d_ovg_sels,    ARRAY_SIZE(gpu2d_ovg_sels));
+       clks[IMX6SL_CLK_GPU2D_SEL]        = imx_clk_mux("gpu2d_sel",        base + 0x18, 8,  2, gpu2d_sels,        ARRAY_SIZE(gpu2d_sels));
+       clks[IMX6SL_CLK_LCDIF_PIX_SEL]    = imx_clk_mux("lcdif_pix_sel",    base + 0x38, 6,  3, lcdif_pix_sels,    ARRAY_SIZE(lcdif_pix_sels));
+       clks[IMX6SL_CLK_EPDC_PIX_SEL]     = imx_clk_mux("epdc_pix_sel",     base + 0x38, 15, 3, epdc_pix_sels,     ARRAY_SIZE(epdc_pix_sels));
+       clks[IMX6SL_CLK_SPDIF0_SEL]       = imx_clk_mux("spdif0_sel",       base + 0x30, 20, 2, audio_sels,        ARRAY_SIZE(audio_sels));
+       clks[IMX6SL_CLK_SPDIF1_SEL]       = imx_clk_mux("spdif1_sel",       base + 0x30, 7,  2, audio_sels,        ARRAY_SIZE(audio_sels));
+       clks[IMX6SL_CLK_EXTERN_AUDIO_SEL] = imx_clk_mux("extern_audio_sel", base + 0x20, 19, 2, audio_sels,        ARRAY_SIZE(audio_sels));
+       clks[IMX6SL_CLK_ECSPI_SEL]        = imx_clk_mux("ecspi_sel",        base + 0x38, 18, 1, ecspi_sels,        ARRAY_SIZE(ecspi_sels));
+       clks[IMX6SL_CLK_UART_SEL]         = imx_clk_mux("uart_sel",         base + 0x24, 6,  1, uart_sels,         ARRAY_SIZE(uart_sels));
+
+       /*                                          name       reg        shift width busy: reg, shift parent_names  num_parents */
+       clks[IMX6SL_CLK_PERIPH]  = imx_clk_busy_mux("periph",  base + 0x14, 25,  1,   base + 0x48, 5,  periph_sels,  ARRAY_SIZE(periph_sels));
+       clks[IMX6SL_CLK_PERIPH2] = imx_clk_busy_mux("periph2", base + 0x14, 26,  1,   base + 0x48, 3,  periph2_sels, ARRAY_SIZE(periph2_sels));
+
+       /*                                                   name                 parent_name          reg       shift width */
+       clks[IMX6SL_CLK_OCRAM_PODF]        = imx_clk_divider("ocram_podf",        "ocram_sel",         base + 0x14, 16, 3);
+       clks[IMX6SL_CLK_PERIPH_CLK2_PODF]  = imx_clk_divider("periph_clk2_podf",  "periph_clk2_sel",   base + 0x14, 27, 3);
+       clks[IMX6SL_CLK_PERIPH2_CLK2_PODF] = imx_clk_divider("periph2_clk2_podf", "periph2_clk2_sel",  base + 0x14, 0,  3);
+       clks[IMX6SL_CLK_IPG]               = imx_clk_divider("ipg",               "ahb",               base + 0x14, 8,  2);
+       clks[IMX6SL_CLK_CSI_PODF]          = imx_clk_divider("csi_podf",          "csi_sel",           base + 0x3c, 11, 3);
+       clks[IMX6SL_CLK_LCDIF_AXI_PODF]    = imx_clk_divider("lcdif_axi_podf",    "lcdif_axi_sel",     base + 0x3c, 16, 3);
+       clks[IMX6SL_CLK_USDHC1_PODF]       = imx_clk_divider("usdhc1_podf",       "usdhc1_sel",        base + 0x24, 11, 3);
+       clks[IMX6SL_CLK_USDHC2_PODF]       = imx_clk_divider("usdhc2_podf",       "usdhc2_sel",        base + 0x24, 16, 3);
+       clks[IMX6SL_CLK_USDHC3_PODF]       = imx_clk_divider("usdhc3_podf",       "usdhc3_sel",        base + 0x24, 19, 3);
+       clks[IMX6SL_CLK_USDHC4_PODF]       = imx_clk_divider("usdhc4_podf",       "usdhc4_sel",        base + 0x24, 22, 3);
+       clks[IMX6SL_CLK_SSI1_PRED]         = imx_clk_divider("ssi1_pred",         "ssi1_sel",          base + 0x28, 6,  3);
+       clks[IMX6SL_CLK_SSI1_PODF]         = imx_clk_divider("ssi1_podf",         "ssi1_pred",         base + 0x28, 0,  6);
+       clks[IMX6SL_CLK_SSI2_PRED]         = imx_clk_divider("ssi2_pred",         "ssi2_sel",          base + 0x2c, 6,  3);
+       clks[IMX6SL_CLK_SSI2_PODF]         = imx_clk_divider("ssi2_podf",         "ssi2_pred",         base + 0x2c, 0,  6);
+       clks[IMX6SL_CLK_SSI3_PRED]         = imx_clk_divider("ssi3_pred",         "ssi3_sel",          base + 0x28, 22, 3);
+       clks[IMX6SL_CLK_SSI3_PODF]         = imx_clk_divider("ssi3_podf",         "ssi3_pred",         base + 0x28, 16, 6);
+       clks[IMX6SL_CLK_PERCLK]            = imx_clk_fixup_divider("perclk",      "perclk_sel",        base + 0x1c, 0,  6, imx_cscmr1_fixup);
+       clks[IMX6SL_CLK_PXP_AXI_PODF]      = imx_clk_divider("pxp_axi_podf",      "pxp_axi_sel",       base + 0x34, 3,  3);
+       clks[IMX6SL_CLK_EPDC_AXI_PODF]     = imx_clk_divider("epdc_axi_podf",     "epdc_axi_sel",      base + 0x34, 12, 3);
+       clks[IMX6SL_CLK_GPU2D_OVG_PODF]    = imx_clk_divider("gpu2d_ovg_podf",    "gpu2d_ovg_sel",     base + 0x18, 26, 3);
+       clks[IMX6SL_CLK_GPU2D_PODF]        = imx_clk_divider("gpu2d_podf",        "gpu2d_sel",         base + 0x18, 29, 3);
+       clks[IMX6SL_CLK_LCDIF_PIX_PRED]    = imx_clk_divider("lcdif_pix_pred",    "lcdif_pix_sel",     base + 0x38, 3,  3);
+       clks[IMX6SL_CLK_EPDC_PIX_PRED]     = imx_clk_divider("epdc_pix_pred",     "epdc_pix_sel",      base + 0x38, 12, 3);
+       clks[IMX6SL_CLK_LCDIF_PIX_PODF]    = imx_clk_fixup_divider("lcdif_pix_podf", "lcdif_pix_pred", base + 0x1c, 20, 3, imx_cscmr1_fixup);
+       clks[IMX6SL_CLK_EPDC_PIX_PODF]     = imx_clk_divider("epdc_pix_podf",     "epdc_pix_pred",     base + 0x18, 23, 3);
+       clks[IMX6SL_CLK_SPDIF0_PRED]       = imx_clk_divider("spdif0_pred",       "spdif0_sel",        base + 0x30, 25, 3);
+       clks[IMX6SL_CLK_SPDIF0_PODF]       = imx_clk_divider("spdif0_podf",       "spdif0_pred",       base + 0x30, 22, 3);
+       clks[IMX6SL_CLK_SPDIF1_PRED]       = imx_clk_divider("spdif1_pred",       "spdif1_sel",        base + 0x30, 12, 3);
+       clks[IMX6SL_CLK_SPDIF1_PODF]       = imx_clk_divider("spdif1_podf",       "spdif1_pred",       base + 0x30, 9,  3);
+       clks[IMX6SL_CLK_EXTERN_AUDIO_PRED] = imx_clk_divider("extern_audio_pred", "extern_audio_sel",  base + 0x28, 9,  3);
+       clks[IMX6SL_CLK_EXTERN_AUDIO_PODF] = imx_clk_divider("extern_audio_podf", "extern_audio_pred", base + 0x28, 25, 3);
+       clks[IMX6SL_CLK_ECSPI_ROOT]        = imx_clk_divider("ecspi_root",        "ecspi_sel",         base + 0x38, 19, 6);
+       clks[IMX6SL_CLK_UART_ROOT]         = imx_clk_divider("uart_root",         "uart_sel",          base + 0x24, 0,  6);
+
+       /*                                                name         parent_name reg       shift width busy: reg, shift */
+       clks[IMX6SL_CLK_AHB]       = imx_clk_busy_divider("ahb",       "periph",  base + 0x14, 10, 3,    base + 0x48, 1);
+       clks[IMX6SL_CLK_MMDC_ROOT] = imx_clk_busy_divider("mmdc",      "periph2", base + 0x14, 3,  3,    base + 0x48, 2);
+       clks[IMX6SL_CLK_ARM]       = imx_clk_busy_divider("arm",       "pll1_sw", base + 0x10, 0,  3,    base + 0x48, 16);
+
+       /*                                            name            parent_name          reg         shift */
+       clks[IMX6SL_CLK_ECSPI1]       = imx_clk_gate2("ecspi1",       "ecspi_root",        base + 0x6c, 0);
+       clks[IMX6SL_CLK_ECSPI2]       = imx_clk_gate2("ecspi2",       "ecspi_root",        base + 0x6c, 2);
+       clks[IMX6SL_CLK_ECSPI3]       = imx_clk_gate2("ecspi3",       "ecspi_root",        base + 0x6c, 4);
+       clks[IMX6SL_CLK_ECSPI4]       = imx_clk_gate2("ecspi4",       "ecspi_root",        base + 0x6c, 6);
+       clks[IMX6SL_CLK_ENET]         = imx_clk_gate2("enet",         "ipg",               base + 0x6c, 10);
+       clks[IMX6SL_CLK_EPIT1]        = imx_clk_gate2("epit1",        "perclk",            base + 0x6c, 12);
+       clks[IMX6SL_CLK_EPIT2]        = imx_clk_gate2("epit2",        "perclk",            base + 0x6c, 14);
+       clks[IMX6SL_CLK_EXTERN_AUDIO] = imx_clk_gate2("extern_audio", "extern_audio_podf", base + 0x6c, 16);
+       clks[IMX6SL_CLK_GPT]          = imx_clk_gate2("gpt",          "perclk",            base + 0x6c, 20);
+       clks[IMX6SL_CLK_GPT_SERIAL]   = imx_clk_gate2("gpt_serial",   "perclk",            base + 0x6c, 22);
+       clks[IMX6SL_CLK_GPU2D_OVG]    = imx_clk_gate2("gpu2d_ovg",    "gpu2d_ovg_podf",    base + 0x6c, 26);
+       clks[IMX6SL_CLK_I2C1]         = imx_clk_gate2("i2c1",         "perclk",            base + 0x70, 6);
+       clks[IMX6SL_CLK_I2C2]         = imx_clk_gate2("i2c2",         "perclk",            base + 0x70, 8);
+       clks[IMX6SL_CLK_I2C3]         = imx_clk_gate2("i2c3",         "perclk",            base + 0x70, 10);
+       clks[IMX6SL_CLK_OCOTP]        = imx_clk_gate2("ocotp",        "ipg",               base + 0x70, 12);
+       clks[IMX6SL_CLK_CSI]          = imx_clk_gate2("csi",          "csi_podf",          base + 0x74, 0);
+       clks[IMX6SL_CLK_PXP_AXI]      = imx_clk_gate2("pxp_axi",      "pxp_axi_podf",      base + 0x74, 2);
+       clks[IMX6SL_CLK_EPDC_AXI]     = imx_clk_gate2("epdc_axi",     "epdc_axi_podf",     base + 0x74, 4);
+       clks[IMX6SL_CLK_LCDIF_AXI]    = imx_clk_gate2("lcdif_axi",    "lcdif_axi_podf",    base + 0x74, 6);
+       clks[IMX6SL_CLK_LCDIF_PIX]    = imx_clk_gate2("lcdif_pix",    "lcdif_pix_podf",    base + 0x74, 8);
+       clks[IMX6SL_CLK_EPDC_PIX]     = imx_clk_gate2("epdc_pix",     "epdc_pix_podf",     base + 0x74, 10);
+       clks[IMX6SL_CLK_OCRAM]        = imx_clk_gate2("ocram",        "ocram_podf",        base + 0x74, 28);
+       clks[IMX6SL_CLK_PWM1]         = imx_clk_gate2("pwm1",         "perclk",            base + 0x78, 16);
+       clks[IMX6SL_CLK_PWM2]         = imx_clk_gate2("pwm2",         "perclk",            base + 0x78, 18);
+       clks[IMX6SL_CLK_PWM3]         = imx_clk_gate2("pwm3",         "perclk",            base + 0x78, 20);
+       clks[IMX6SL_CLK_PWM4]         = imx_clk_gate2("pwm4",         "perclk",            base + 0x78, 22);
+       clks[IMX6SL_CLK_SDMA]         = imx_clk_gate2("sdma",         "ipg",               base + 0x7c, 6);
+       clks[IMX6SL_CLK_SPBA]         = imx_clk_gate2("spba",         "ipg",               base + 0x7c, 12);
+       clks[IMX6SL_CLK_SPDIF]        = imx_clk_gate2("spdif",        "spdif0_podf",       base + 0x7c, 14);
+       clks[IMX6SL_CLK_SSI1_IPG]     = imx_clk_gate2_shared("ssi1_ipg",     "ipg",        base + 0x7c, 18, &share_count_ssi1);
+       clks[IMX6SL_CLK_SSI2_IPG]     = imx_clk_gate2_shared("ssi2_ipg",     "ipg",        base + 0x7c, 20, &share_count_ssi2);
+       clks[IMX6SL_CLK_SSI3_IPG]     = imx_clk_gate2_shared("ssi3_ipg",     "ipg",        base + 0x7c, 22, &share_count_ssi3);
+       clks[IMX6SL_CLK_SSI1]         = imx_clk_gate2_shared("ssi1",         "ssi1_podf",  base + 0x7c, 18, &share_count_ssi1);
+       clks[IMX6SL_CLK_SSI2]         = imx_clk_gate2_shared("ssi2",         "ssi2_podf",  base + 0x7c, 20, &share_count_ssi2);
+       clks[IMX6SL_CLK_SSI3]         = imx_clk_gate2_shared("ssi3",         "ssi3_podf",  base + 0x7c, 22, &share_count_ssi3);
+       clks[IMX6SL_CLK_UART]         = imx_clk_gate2("uart",         "ipg",               base + 0x7c, 24);
+       clks[IMX6SL_CLK_UART_SERIAL]  = imx_clk_gate2("uart_serial",  "uart_root",         base + 0x7c, 26);
+       clks[IMX6SL_CLK_USBOH3]       = imx_clk_gate2("usboh3",       "ipg",               base + 0x80, 0);
+       clks[IMX6SL_CLK_USDHC1]       = imx_clk_gate2("usdhc1",       "usdhc1_podf",       base + 0x80, 2);
+       clks[IMX6SL_CLK_USDHC2]       = imx_clk_gate2("usdhc2",       "usdhc2_podf",       base + 0x80, 4);
+       clks[IMX6SL_CLK_USDHC3]       = imx_clk_gate2("usdhc3",       "usdhc3_podf",       base + 0x80, 6);
+       clks[IMX6SL_CLK_USDHC4]       = imx_clk_gate2("usdhc4",       "usdhc4_podf",       base + 0x80, 8);
+
+       imx_check_clocks(clks, ARRAY_SIZE(clks));
+
+       clk_data.clks = clks;
+       clk_data.clk_num = ARRAY_SIZE(clks);
+       of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
+
+       /* Ensure the AHB clk is at 132MHz. */
+       ret = clk_set_rate(clks[IMX6SL_CLK_AHB], 132000000);
+       if (ret)
+               pr_warn("%s: failed to set AHB clock rate %d!\n",
+                       __func__, ret);
+
+       /*
+        * Make sure those always on clocks are enabled to maintain the correct
+        * usecount and enabling/disabling of parent PLLs.
+        */
+       for (i = 0; i < ARRAY_SIZE(clks_init_on); i++)
+               clk_prepare_enable(clks[clks_init_on[i]]);
+
+       if (IS_ENABLED(CONFIG_USB_MXS_PHY)) {
+               clk_prepare_enable(clks[IMX6SL_CLK_USBPHY1_GATE]);
+               clk_prepare_enable(clks[IMX6SL_CLK_USBPHY2_GATE]);
+       }
+
+       /* Audio-related clocks configuration */
+       clk_set_parent(clks[IMX6SL_CLK_SPDIF0_SEL], clks[IMX6SL_CLK_PLL3_PFD3]);
+
+       /* set PLL5 video as lcdif pix parent clock */
+       clk_set_parent(clks[IMX6SL_CLK_LCDIF_PIX_SEL],
+                       clks[IMX6SL_CLK_PLL5_VIDEO_DIV]);
+
+       clk_set_parent(clks[IMX6SL_CLK_LCDIF_AXI_SEL],
+                      clks[IMX6SL_CLK_PLL2_PFD2]);
+}
+CLK_OF_DECLARE(imx6sl, "fsl,imx6sl-ccm", imx6sl_clocks_init);
diff --git a/drivers/clk/imx/clk-imx6sx.c b/drivers/clk/imx/clk-imx6sx.c
new file mode 100644 (file)
index 0000000..5b95c2c
--- /dev/null
@@ -0,0 +1,561 @@
+/*
+ * Copyright (C) 2014 Freescale Semiconductor, Inc.
+ *
+ * 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:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+#include <dt-bindings/clock/imx6sx-clock.h>
+#include <linux/clk.h>
+#include <linux/clkdev.h>
+#include <linux/err.h>
+#include <linux/init.h>
+#include <linux/io.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
+#include <linux/types.h>
+
+#include "clk.h"
+
+#define CCDR    0x4
+#define BM_CCM_CCDR_MMDC_CH0_MASK       (0x2 << 16)
+
+static const char *step_sels[]         = { "osc", "pll2_pfd2_396m", };
+static const char *pll1_sw_sels[]      = { "pll1_sys", "step", };
+static const char *periph_pre_sels[]   = { "pll2_bus", "pll2_pfd2_396m", "pll2_pfd0_352m", "pll2_198m", };
+static const char *periph2_pre_sels[]  = { "pll2_bus", "pll2_pfd2_396m", "pll2_pfd0_352m", "pll4_audio_div", };
+static const char *periph_clk2_sels[]  = { "pll3_usb_otg", "osc", "osc", };
+static const char *periph2_clk2_sels[] = { "pll3_usb_otg", "osc", };
+static const char *periph_sels[]       = { "periph_pre", "periph_clk2", };
+static const char *periph2_sels[]      = { "periph2_pre", "periph2_clk2", };
+static const char *ocram_sels[]                = { "periph", "pll2_pfd2_396m", "periph", "pll3_pfd1_540m", };
+static const char *audio_sels[]                = { "pll4_audio_div", "pll3_pfd2_508m", "pll5_video_div", "pll3_usb_otg", };
+static const char *gpu_axi_sels[]      = { "pll2_pfd2_396m", "pll3_pfd0_720m", "pll3_pfd1_540m", "pll2_bus", };
+static const char *gpu_core_sels[]     = { "pll3_pfd1_540m", "pll3_pfd0_720m", "pll2_bus", "pll2_pfd2_396m", };
+static const char *ldb_di0_div_sels[]  = { "ldb_di0_div_3_5", "ldb_di0_div_7", };
+static const char *ldb_di1_div_sels[]  = { "ldb_di1_div_3_5", "ldb_di1_div_7", };
+static const char *ldb_di0_sels[]      = { "pll5_video_div", "pll2_pfd0_352m", "pll2_pfd2_396m", "pll2_pfd3_594m", "pll2_pfd1_594m", "pll3_pfd3_454m", };
+static const char *ldb_di1_sels[]      = { "pll3_usb_otg", "pll2_pfd0_352m", "pll2_pfd2_396m", "pll2_bus", "pll3_pfd3_454m", "pll3_pfd2_508m", };
+static const char *pcie_axi_sels[]     = { "axi", "ahb", };
+static const char *ssi_sels[]          = { "pll3_pfd2_508m", "pll5_video_div", "pll4_audio_div", };
+static const char *qspi1_sels[]                = { "pll3_usb_otg", "pll2_pfd0_352m", "pll2_pfd2_396m", "pll2_bus", "pll3_pfd3_454m", "pll3_pfd2_508m", };
+static const char *perclk_sels[]       = { "ipg", "osc", };
+static const char *usdhc_sels[]                = { "pll2_pfd2_396m", "pll2_pfd0_352m", };
+static const char *vid_sels[]          = { "pll3_pfd1_540m", "pll3_usb_otg", "pll3_pfd3_454m", "pll4_audio_div", "pll5_video_div", };
+static const char *can_sels[]          = { "pll3_60m", "osc", "pll3_80m", "dummy", };
+static const char *uart_sels[]         = { "pll3_80m", "osc", };
+static const char *qspi2_sels[]                = { "pll2_pfd0_352m", "pll2_bus", "pll3_usb_otg", "pll2_pfd2_396m", "pll3_pfd3_454m", "dummy", "dummy", "dummy", };
+static const char *enet_pre_sels[]     = { "pll2_bus", "pll3_usb_otg", "pll5_video_div", "pll2_pfd0_352m", "pll2_pfd2_396m", "pll3_pfd2_508m", };
+static const char *enet_sels[]         = { "enet_podf", "ipp_di0", "ipp_di1", "ldb_di0", "ldb_di1", };
+static const char *m4_pre_sels[]       = { "pll2_bus", "pll3_usb_otg", "osc", "pll2_pfd0_352m", "pll2_pfd2_396m", "pll3_pfd3_454m", };
+static const char *m4_sels[]           = { "m4_pre_sel", "ipp_di0", "ipp_di1", "ldb_di0", "ldb_di1", };
+static const char *eim_slow_sels[]     = { "ocram", "pll3_usb_otg", "pll2_pfd2_396m", "pll2_pfd0_352m", };
+static const char *ecspi_sels[]                = { "pll3_60m", "osc", };
+static const char *lcdif1_pre_sels[]   = { "pll2_bus", "pll3_pfd3_454m", "pll5_video_div", "pll2_pfd0_352m", "pll2_pfd1_594m", "pll3_pfd1_540m", };
+static const char *lcdif1_sels[]       = { "lcdif1_podf", "ipp_di0", "ipp_di1", "ldb_di0", "ldb_di1", };
+static const char *lcdif2_pre_sels[]   = { "pll2_bus", "pll3_pfd3_454m", "pll5_video_div", "pll2_pfd0_352m", "pll2_pfd3_594m", "pll3_pfd1_540m", };
+static const char *lcdif2_sels[]       = { "lcdif2_podf", "ipp_di0", "ipp_di1", "ldb_di0", "ldb_di1", };
+static const char *display_sels[]      = { "pll2_bus", "pll2_pfd2_396m", "pll3_usb_otg", "pll3_pfd1_540m", };
+static const char *csi_sels[]          = { "osc", "pll2_pfd2_396m", "pll3_120m", "pll3_pfd1_540m", };
+static const char *cko1_sels[]         = {
+       "pll3_usb_otg", "pll2_bus", "pll1_sys", "pll5_video_div",
+       "dummy", "ocram", "dummy", "pxp_axi", "epdc_axi", "lcdif_pix",
+       "epdc_pix", "ahb", "ipg", "perclk", "ckil", "pll4_audio_div",
+};
+static const char *cko2_sels[]         = {
+       "dummy", "mmdc_p0_fast", "usdhc4", "usdhc1", "dummy", "wrck",
+       "ecspi_root", "dummy", "usdhc3", "pcie", "arm", "csi_core",
+       "lcdif_axi", "dummy", "osc", "dummy", "gpu2d_ovg_core",
+       "usdhc2", "ssi1", "ssi2", "ssi3", "gpu2d_core", "dummy",
+       "dummy", "dummy", "dummy", "esai_extal", "eim_slow", "uart_serial",
+       "spdif", "asrc", "dummy",
+};
+static const char *cko_sels[] = { "cko1", "cko2", };
+static const char *lvds_sels[] = {
+       "arm", "pll1_sys", "dummy", "dummy", "dummy", "dummy", "dummy", "pll5_video_div",
+       "dummy", "dummy", "pcie_ref_125m", "dummy", "usbphy1", "usbphy2",
+};
+static const char *pll_bypass_src_sels[] = { "osc", "lvds1_in", };
+static const char *pll1_bypass_sels[] = { "pll1", "pll1_bypass_src", };
+static const char *pll2_bypass_sels[] = { "pll2", "pll2_bypass_src", };
+static const char *pll3_bypass_sels[] = { "pll3", "pll3_bypass_src", };
+static const char *pll4_bypass_sels[] = { "pll4", "pll4_bypass_src", };
+static const char *pll5_bypass_sels[] = { "pll5", "pll5_bypass_src", };
+static const char *pll6_bypass_sels[] = { "pll6", "pll6_bypass_src", };
+static const char *pll7_bypass_sels[] = { "pll7", "pll7_bypass_src", };
+
+static struct clk *clks[IMX6SX_CLK_CLK_END];
+static struct clk_onecell_data clk_data;
+
+static int const clks_init_on[] __initconst = {
+       IMX6SX_CLK_AIPS_TZ1, IMX6SX_CLK_AIPS_TZ2, IMX6SX_CLK_AIPS_TZ3,
+       IMX6SX_CLK_IPMUX1, IMX6SX_CLK_IPMUX2, IMX6SX_CLK_IPMUX3,
+       IMX6SX_CLK_WAKEUP, IMX6SX_CLK_MMDC_P0_FAST, IMX6SX_CLK_MMDC_P0_IPG,
+       IMX6SX_CLK_ROM, IMX6SX_CLK_ARM, IMX6SX_CLK_IPG, IMX6SX_CLK_OCRAM,
+       IMX6SX_CLK_PER2_MAIN, IMX6SX_CLK_PERCLK, IMX6SX_CLK_M4,
+       IMX6SX_CLK_QSPI1, IMX6SX_CLK_QSPI2, IMX6SX_CLK_UART_IPG,
+       IMX6SX_CLK_UART_SERIAL, IMX6SX_CLK_I2C3, IMX6SX_CLK_ECSPI5,
+       IMX6SX_CLK_CAN1_IPG, IMX6SX_CLK_CAN1_SERIAL, IMX6SX_CLK_CAN2_IPG,
+       IMX6SX_CLK_CAN2_SERIAL, IMX6SX_CLK_CANFD, IMX6SX_CLK_EPIT1,
+       IMX6SX_CLK_EPIT2,
+};
+
+static struct clk_div_table clk_enet_ref_table[] = {
+       { .val = 0, .div = 20, },
+       { .val = 1, .div = 10, },
+       { .val = 2, .div = 5, },
+       { .val = 3, .div = 4, },
+       { }
+};
+
+static struct clk_div_table post_div_table[] = {
+       { .val = 2, .div = 1, },
+       { .val = 1, .div = 2, },
+       { .val = 0, .div = 4, },
+       { }
+};
+
+static struct clk_div_table video_div_table[] = {
+       { .val = 0, .div = 1, },
+       { .val = 1, .div = 2, },
+       { .val = 2, .div = 1, },
+       { .val = 3, .div = 4, },
+       { }
+};
+
+static u32 share_count_asrc;
+static u32 share_count_audio;
+static u32 share_count_esai;
+static u32 share_count_ssi1;
+static u32 share_count_ssi2;
+static u32 share_count_ssi3;
+
+static void __init imx6sx_clocks_init(struct device_node *ccm_node)
+{
+       struct device_node *np;
+       void __iomem *base;
+       int i;
+
+       clks[IMX6SX_CLK_DUMMY] = imx_clk_fixed("dummy", 0);
+
+       clks[IMX6SX_CLK_CKIL] = of_clk_get_by_name(ccm_node, "ckil");
+       clks[IMX6SX_CLK_OSC] = of_clk_get_by_name(ccm_node, "osc");
+
+       /* ipp_di clock is external input */
+       clks[IMX6SX_CLK_IPP_DI0] = of_clk_get_by_name(ccm_node, "ipp_di0");
+       clks[IMX6SX_CLK_IPP_DI1] = of_clk_get_by_name(ccm_node, "ipp_di1");
+
+       /* Clock source from external clock via CLK1 PAD */
+       clks[IMX6SX_CLK_ANACLK1] = imx_obtain_fixed_clock("anaclk1", 0);
+
+       np = of_find_compatible_node(NULL, NULL, "fsl,imx6sx-anatop");
+       base = of_iomap(np, 0);
+       WARN_ON(!base);
+
+       clks[IMX6SX_PLL1_BYPASS_SRC] = imx_clk_mux("pll1_bypass_src", base + 0x00, 14, 1, pll_bypass_src_sels, ARRAY_SIZE(pll_bypass_src_sels));
+       clks[IMX6SX_PLL2_BYPASS_SRC] = imx_clk_mux("pll2_bypass_src", base + 0x30, 14, 1, pll_bypass_src_sels, ARRAY_SIZE(pll_bypass_src_sels));
+       clks[IMX6SX_PLL3_BYPASS_SRC] = imx_clk_mux("pll3_bypass_src", base + 0x10, 14, 1, pll_bypass_src_sels, ARRAY_SIZE(pll_bypass_src_sels));
+       clks[IMX6SX_PLL4_BYPASS_SRC] = imx_clk_mux("pll4_bypass_src", base + 0x70, 14, 1, pll_bypass_src_sels, ARRAY_SIZE(pll_bypass_src_sels));
+       clks[IMX6SX_PLL5_BYPASS_SRC] = imx_clk_mux("pll5_bypass_src", base + 0xa0, 14, 1, pll_bypass_src_sels, ARRAY_SIZE(pll_bypass_src_sels));
+       clks[IMX6SX_PLL6_BYPASS_SRC] = imx_clk_mux("pll6_bypass_src", base + 0xe0, 14, 1, pll_bypass_src_sels, ARRAY_SIZE(pll_bypass_src_sels));
+       clks[IMX6SX_PLL7_BYPASS_SRC] = imx_clk_mux("pll7_bypass_src", base + 0x20, 14, 1, pll_bypass_src_sels, ARRAY_SIZE(pll_bypass_src_sels));
+
+       /*                                    type               name    parent_name        base         div_mask */
+       clks[IMX6SX_CLK_PLL1] = imx_clk_pllv3(IMX_PLLV3_SYS,     "pll1", "pll1_bypass_src", base + 0x00, 0x7f);
+       clks[IMX6SX_CLK_PLL2] = imx_clk_pllv3(IMX_PLLV3_GENERIC, "pll2", "pll2_bypass_src", base + 0x30, 0x1);
+       clks[IMX6SX_CLK_PLL3] = imx_clk_pllv3(IMX_PLLV3_USB,     "pll3", "pll3_bypass_src", base + 0x10, 0x3);
+       clks[IMX6SX_CLK_PLL4] = imx_clk_pllv3(IMX_PLLV3_AV,      "pll4", "pll4_bypass_src", base + 0x70, 0x7f);
+       clks[IMX6SX_CLK_PLL5] = imx_clk_pllv3(IMX_PLLV3_AV,      "pll5", "pll5_bypass_src", base + 0xa0, 0x7f);
+       clks[IMX6SX_CLK_PLL6] = imx_clk_pllv3(IMX_PLLV3_ENET,    "pll6", "pll6_bypass_src", base + 0xe0, 0x3);
+       clks[IMX6SX_CLK_PLL7] = imx_clk_pllv3(IMX_PLLV3_USB,     "pll7", "pll7_bypass_src", base + 0x20, 0x3);
+
+       clks[IMX6SX_PLL1_BYPASS] = imx_clk_mux_flags("pll1_bypass", base + 0x00, 16, 1, pll1_bypass_sels, ARRAY_SIZE(pll1_bypass_sels), CLK_SET_RATE_PARENT);
+       clks[IMX6SX_PLL2_BYPASS] = imx_clk_mux_flags("pll2_bypass", base + 0x30, 16, 1, pll2_bypass_sels, ARRAY_SIZE(pll2_bypass_sels), CLK_SET_RATE_PARENT);
+       clks[IMX6SX_PLL3_BYPASS] = imx_clk_mux_flags("pll3_bypass", base + 0x10, 16, 1, pll3_bypass_sels, ARRAY_SIZE(pll3_bypass_sels), CLK_SET_RATE_PARENT);
+       clks[IMX6SX_PLL4_BYPASS] = imx_clk_mux_flags("pll4_bypass", base + 0x70, 16, 1, pll4_bypass_sels, ARRAY_SIZE(pll4_bypass_sels), CLK_SET_RATE_PARENT);
+       clks[IMX6SX_PLL5_BYPASS] = imx_clk_mux_flags("pll5_bypass", base + 0xa0, 16, 1, pll5_bypass_sels, ARRAY_SIZE(pll5_bypass_sels), CLK_SET_RATE_PARENT);
+       clks[IMX6SX_PLL6_BYPASS] = imx_clk_mux_flags("pll6_bypass", base + 0xe0, 16, 1, pll6_bypass_sels, ARRAY_SIZE(pll6_bypass_sels), CLK_SET_RATE_PARENT);
+       clks[IMX6SX_PLL7_BYPASS] = imx_clk_mux_flags("pll7_bypass", base + 0x20, 16, 1, pll7_bypass_sels, ARRAY_SIZE(pll7_bypass_sels), CLK_SET_RATE_PARENT);
+
+       /* Do not bypass PLLs initially */
+       clk_set_parent(clks[IMX6SX_PLL1_BYPASS], clks[IMX6SX_CLK_PLL1]);
+       clk_set_parent(clks[IMX6SX_PLL2_BYPASS], clks[IMX6SX_CLK_PLL2]);
+       clk_set_parent(clks[IMX6SX_PLL3_BYPASS], clks[IMX6SX_CLK_PLL3]);
+       clk_set_parent(clks[IMX6SX_PLL4_BYPASS], clks[IMX6SX_CLK_PLL4]);
+       clk_set_parent(clks[IMX6SX_PLL5_BYPASS], clks[IMX6SX_CLK_PLL5]);
+       clk_set_parent(clks[IMX6SX_PLL6_BYPASS], clks[IMX6SX_CLK_PLL6]);
+       clk_set_parent(clks[IMX6SX_PLL7_BYPASS], clks[IMX6SX_CLK_PLL7]);
+
+       clks[IMX6SX_CLK_PLL1_SYS]      = imx_clk_gate("pll1_sys",      "pll1_bypass", base + 0x00, 13);
+       clks[IMX6SX_CLK_PLL2_BUS]      = imx_clk_gate("pll2_bus",      "pll2_bypass", base + 0x30, 13);
+       clks[IMX6SX_CLK_PLL3_USB_OTG]  = imx_clk_gate("pll3_usb_otg",  "pll3_bypass", base + 0x10, 13);
+       clks[IMX6SX_CLK_PLL4_AUDIO]    = imx_clk_gate("pll4_audio",    "pll4_bypass", base + 0x70, 13);
+       clks[IMX6SX_CLK_PLL5_VIDEO]    = imx_clk_gate("pll5_video",    "pll5_bypass", base + 0xa0, 13);
+       clks[IMX6SX_CLK_PLL6_ENET]     = imx_clk_gate("pll6_enet",     "pll6_bypass", base + 0xe0, 13);
+       clks[IMX6SX_CLK_PLL7_USB_HOST] = imx_clk_gate("pll7_usb_host", "pll7_bypass", base + 0x20, 13);
+
+       /*
+        * Bit 20 is the reserved and read-only bit, we do this only for:
+        * - Do nothing for usbphy clk_enable/disable
+        * - Keep refcount when do usbphy clk_enable/disable, in that case,
+        * the clk framework may need to enable/disable usbphy's parent
+        */
+       clks[IMX6SX_CLK_USBPHY1] = imx_clk_gate("usbphy1", "pll3_usb_otg",  base + 0x10, 20);
+       clks[IMX6SX_CLK_USBPHY2] = imx_clk_gate("usbphy2", "pll7_usb_host", base + 0x20, 20);
+
+       /*
+        * usbphy*_gate needs to be on after system boots up, and software
+        * never needs to control it anymore.
+        */
+       clks[IMX6SX_CLK_USBPHY1_GATE] = imx_clk_gate("usbphy1_gate", "dummy", base + 0x10, 6);
+       clks[IMX6SX_CLK_USBPHY2_GATE] = imx_clk_gate("usbphy2_gate", "dummy", base + 0x20, 6);
+
+       /* FIXME 100MHz is used for pcie ref for all imx6 pcie, excepted imx6q */
+       clks[IMX6SX_CLK_PCIE_REF] = imx_clk_fixed_factor("pcie_ref", "pll6_enet", 1, 5);
+       clks[IMX6SX_CLK_PCIE_REF_125M] = imx_clk_gate("pcie_ref_125m", "pcie_ref", base + 0xe0, 19);
+
+       clks[IMX6SX_CLK_LVDS1_OUT] = imx_clk_gate_exclusive("lvds1_out", "lvds1_sel", base + 0x160, 10, BIT(12));
+       clks[IMX6SX_CLK_LVDS1_IN]  = imx_clk_gate_exclusive("lvds1_in",  "anaclk1",   base + 0x160, 12, BIT(10));
+
+       clks[IMX6SX_CLK_ENET_REF] = clk_register_divider_table(NULL, "enet_ref", "pll6_enet", 0,
+                       base + 0xe0, 0, 2, 0, clk_enet_ref_table,
+                       &imx_ccm_lock);
+       clks[IMX6SX_CLK_ENET2_REF] = clk_register_divider_table(NULL, "enet2_ref", "pll6_enet", 0,
+                       base + 0xe0, 2, 2, 0, clk_enet_ref_table,
+                       &imx_ccm_lock);
+       clks[IMX6SX_CLK_ENET2_REF_125M] = imx_clk_gate("enet2_ref_125m", "enet2_ref", base + 0xe0, 20);
+
+       clks[IMX6SX_CLK_ENET_PTP_REF] = imx_clk_fixed_factor("enet_ptp_ref", "pll6_enet", 1, 20);
+       clks[IMX6SX_CLK_ENET_PTP] = imx_clk_gate("enet_ptp_25m", "enet_ptp_ref", base + 0xe0, 21);
+
+       /*                                       name              parent_name     reg           idx */
+       clks[IMX6SX_CLK_PLL2_PFD0] = imx_clk_pfd("pll2_pfd0_352m", "pll2_bus",     base + 0x100, 0);
+       clks[IMX6SX_CLK_PLL2_PFD1] = imx_clk_pfd("pll2_pfd1_594m", "pll2_bus",     base + 0x100, 1);
+       clks[IMX6SX_CLK_PLL2_PFD2] = imx_clk_pfd("pll2_pfd2_396m", "pll2_bus",     base + 0x100, 2);
+       clks[IMX6SX_CLK_PLL2_PFD3] = imx_clk_pfd("pll2_pfd3_594m", "pll2_bus",     base + 0x100, 3);
+       clks[IMX6SX_CLK_PLL3_PFD0] = imx_clk_pfd("pll3_pfd0_720m", "pll3_usb_otg", base + 0xf0,  0);
+       clks[IMX6SX_CLK_PLL3_PFD1] = imx_clk_pfd("pll3_pfd1_540m", "pll3_usb_otg", base + 0xf0,  1);
+       clks[IMX6SX_CLK_PLL3_PFD2] = imx_clk_pfd("pll3_pfd2_508m", "pll3_usb_otg", base + 0xf0,  2);
+       clks[IMX6SX_CLK_PLL3_PFD3] = imx_clk_pfd("pll3_pfd3_454m", "pll3_usb_otg", base + 0xf0,  3);
+
+       /*                                                name         parent_name       mult div */
+       clks[IMX6SX_CLK_PLL2_198M] = imx_clk_fixed_factor("pll2_198m", "pll2_pfd2_396m", 1,   2);
+       clks[IMX6SX_CLK_PLL3_120M] = imx_clk_fixed_factor("pll3_120m", "pll3_usb_otg",   1,   4);
+       clks[IMX6SX_CLK_PLL3_80M]  = imx_clk_fixed_factor("pll3_80m",  "pll3_usb_otg",   1,   6);
+       clks[IMX6SX_CLK_PLL3_60M]  = imx_clk_fixed_factor("pll3_60m",  "pll3_usb_otg",   1,   8);
+       clks[IMX6SX_CLK_TWD]       = imx_clk_fixed_factor("twd",       "arm",            1,   2);
+       clks[IMX6SX_CLK_GPT_3M]    = imx_clk_fixed_factor("gpt_3m",    "osc",            1,   8);
+
+       clks[IMX6SX_CLK_PLL4_POST_DIV]  = clk_register_divider_table(NULL, "pll4_post_div", "pll4_audio",
+                               CLK_SET_RATE_PARENT, base + 0x70, 19, 2, 0, post_div_table, &imx_ccm_lock);
+       clks[IMX6SX_CLK_PLL4_AUDIO_DIV] = clk_register_divider(NULL, "pll4_audio_div", "pll4_post_div",
+                               CLK_SET_RATE_PARENT, base + 0x170, 15, 1, 0, &imx_ccm_lock);
+       clks[IMX6SX_CLK_PLL5_POST_DIV]  = clk_register_divider_table(NULL, "pll5_post_div", "pll5_video",
+                               CLK_SET_RATE_PARENT, base + 0xa0, 19, 2, 0, post_div_table, &imx_ccm_lock);
+       clks[IMX6SX_CLK_PLL5_VIDEO_DIV] = clk_register_divider_table(NULL, "pll5_video_div", "pll5_post_div",
+                               CLK_SET_RATE_PARENT, base + 0x170, 30, 2, 0, video_div_table, &imx_ccm_lock);
+
+       /*                                                name                reg           shift   width   parent_names       num_parents */
+       clks[IMX6SX_CLK_LVDS1_SEL]          = imx_clk_mux("lvds1_sel",        base + 0x160, 0,      5,      lvds_sels,         ARRAY_SIZE(lvds_sels));
+
+       np = ccm_node;
+       base = of_iomap(np, 0);
+       WARN_ON(!base);
+
+       /*                                                name                reg           shift   width   parent_names       num_parents */
+       clks[IMX6SX_CLK_STEP]               = imx_clk_mux("step",             base + 0xc,   8,      1,      step_sels,         ARRAY_SIZE(step_sels));
+       clks[IMX6SX_CLK_PLL1_SW]            = imx_clk_mux("pll1_sw",          base + 0xc,   2,      1,      pll1_sw_sels,      ARRAY_SIZE(pll1_sw_sels));
+       clks[IMX6SX_CLK_OCRAM_SEL]          = imx_clk_mux("ocram_sel",        base + 0x14,  6,      2,      ocram_sels,        ARRAY_SIZE(ocram_sels));
+       clks[IMX6SX_CLK_PERIPH_PRE]         = imx_clk_mux("periph_pre",       base + 0x18,  18,     2,      periph_pre_sels,   ARRAY_SIZE(periph_pre_sels));
+       clks[IMX6SX_CLK_PERIPH2_PRE]        = imx_clk_mux("periph2_pre",      base + 0x18,  21,     2,      periph2_pre_sels,   ARRAY_SIZE(periph2_pre_sels));
+       clks[IMX6SX_CLK_PERIPH_CLK2_SEL]    = imx_clk_mux("periph_clk2_sel",  base + 0x18,  12,     2,      periph_clk2_sels,  ARRAY_SIZE(periph_clk2_sels));
+       clks[IMX6SX_CLK_PERIPH2_CLK2_SEL]   = imx_clk_mux("periph2_clk2_sel", base + 0x18,  20,     1,      periph2_clk2_sels, ARRAY_SIZE(periph2_clk2_sels));
+       clks[IMX6SX_CLK_PCIE_AXI_SEL]       = imx_clk_mux("pcie_axi_sel",     base + 0x18,  10,     1,      pcie_axi_sels,     ARRAY_SIZE(pcie_axi_sels));
+       clks[IMX6SX_CLK_GPU_AXI_SEL]        = imx_clk_mux("gpu_axi_sel",      base + 0x18,  8,      2,      gpu_axi_sels,      ARRAY_SIZE(gpu_axi_sels));
+       clks[IMX6SX_CLK_GPU_CORE_SEL]       = imx_clk_mux("gpu_core_sel",     base + 0x18,  4,      2,      gpu_core_sels,     ARRAY_SIZE(gpu_core_sels));
+       clks[IMX6SX_CLK_EIM_SLOW_SEL]       = imx_clk_mux("eim_slow_sel",     base + 0x1c,  29,     2,      eim_slow_sels,     ARRAY_SIZE(eim_slow_sels));
+       clks[IMX6SX_CLK_USDHC1_SEL]         = imx_clk_mux("usdhc1_sel",       base + 0x1c,  16,     1,      usdhc_sels,        ARRAY_SIZE(usdhc_sels));
+       clks[IMX6SX_CLK_USDHC2_SEL]         = imx_clk_mux("usdhc2_sel",       base + 0x1c,  17,     1,      usdhc_sels,        ARRAY_SIZE(usdhc_sels));
+       clks[IMX6SX_CLK_USDHC3_SEL]         = imx_clk_mux("usdhc3_sel",       base + 0x1c,  18,     1,      usdhc_sels,        ARRAY_SIZE(usdhc_sels));
+       clks[IMX6SX_CLK_USDHC4_SEL]         = imx_clk_mux("usdhc4_sel",       base + 0x1c,  19,     1,      usdhc_sels,        ARRAY_SIZE(usdhc_sels));
+       clks[IMX6SX_CLK_SSI3_SEL]           = imx_clk_mux("ssi3_sel",         base + 0x1c,  14,     2,      ssi_sels,          ARRAY_SIZE(ssi_sels));
+       clks[IMX6SX_CLK_SSI2_SEL]           = imx_clk_mux("ssi2_sel",         base + 0x1c,  12,     2,      ssi_sels,          ARRAY_SIZE(ssi_sels));
+       clks[IMX6SX_CLK_SSI1_SEL]           = imx_clk_mux("ssi1_sel",         base + 0x1c,  10,     2,      ssi_sels,          ARRAY_SIZE(ssi_sels));
+       clks[IMX6SX_CLK_QSPI1_SEL]          = imx_clk_mux_flags("qspi1_sel", base + 0x1c,  7, 3, qspi1_sels, ARRAY_SIZE(qspi1_sels), CLK_SET_RATE_PARENT);
+       clks[IMX6SX_CLK_PERCLK_SEL]         = imx_clk_mux("perclk_sel",       base + 0x1c,  6,      1,      perclk_sels,       ARRAY_SIZE(perclk_sels));
+       clks[IMX6SX_CLK_VID_SEL]            = imx_clk_mux("vid_sel",          base + 0x20,  21,     3,      vid_sels,          ARRAY_SIZE(vid_sels));
+       clks[IMX6SX_CLK_ESAI_SEL]           = imx_clk_mux("esai_sel",         base + 0x20,  19,     2,      audio_sels,        ARRAY_SIZE(audio_sels));
+       clks[IMX6SX_CLK_CAN_SEL]            = imx_clk_mux("can_sel",          base + 0x20,  8,      2,      can_sels,          ARRAY_SIZE(can_sels));
+       clks[IMX6SX_CLK_UART_SEL]           = imx_clk_mux("uart_sel",         base + 0x24,  6,      1,      uart_sels,         ARRAY_SIZE(uart_sels));
+       clks[IMX6SX_CLK_QSPI2_SEL]          = imx_clk_mux_flags("qspi2_sel", base + 0x2c, 15, 3, qspi2_sels, ARRAY_SIZE(qspi2_sels), CLK_SET_RATE_PARENT);
+       clks[IMX6SX_CLK_SPDIF_SEL]          = imx_clk_mux("spdif_sel",        base + 0x30,  20,     2,      audio_sels,        ARRAY_SIZE(audio_sels));
+       clks[IMX6SX_CLK_AUDIO_SEL]          = imx_clk_mux("audio_sel",        base + 0x30,  7,      2,      audio_sels,        ARRAY_SIZE(audio_sels));
+       clks[IMX6SX_CLK_ENET_PRE_SEL]       = imx_clk_mux("enet_pre_sel",     base + 0x34,  15,     3,      enet_pre_sels,     ARRAY_SIZE(enet_pre_sels));
+       clks[IMX6SX_CLK_ENET_SEL]           = imx_clk_mux("enet_sel",         base + 0x34,  9,      3,      enet_sels,         ARRAY_SIZE(enet_sels));
+       clks[IMX6SX_CLK_M4_PRE_SEL]         = imx_clk_mux("m4_pre_sel",       base + 0x34,  6,      3,      m4_pre_sels,       ARRAY_SIZE(m4_pre_sels));
+       clks[IMX6SX_CLK_M4_SEL]             = imx_clk_mux("m4_sel",           base + 0x34,  0,      3,      m4_sels,           ARRAY_SIZE(m4_sels));
+       clks[IMX6SX_CLK_ECSPI_SEL]          = imx_clk_mux("ecspi_sel",        base + 0x38,  18,     1,      ecspi_sels,        ARRAY_SIZE(ecspi_sels));
+       clks[IMX6SX_CLK_LCDIF2_PRE_SEL]     = imx_clk_mux("lcdif2_pre_sel",   base + 0x38,  6,      3,      lcdif2_pre_sels,   ARRAY_SIZE(lcdif2_pre_sels));
+       clks[IMX6SX_CLK_LCDIF2_SEL]         = imx_clk_mux("lcdif2_sel",       base + 0x38,  0,      3,      lcdif2_sels,       ARRAY_SIZE(lcdif2_sels));
+       clks[IMX6SX_CLK_DISPLAY_SEL]        = imx_clk_mux("display_sel",      base + 0x3c,  14,     2,      display_sels,      ARRAY_SIZE(display_sels));
+       clks[IMX6SX_CLK_CSI_SEL]            = imx_clk_mux("csi_sel",          base + 0x3c,  9,      2,      csi_sels,          ARRAY_SIZE(csi_sels));
+       clks[IMX6SX_CLK_CKO1_SEL]           = imx_clk_mux("cko1_sel",         base + 0x60,  0,      4,      cko1_sels,         ARRAY_SIZE(cko1_sels));
+       clks[IMX6SX_CLK_CKO2_SEL]           = imx_clk_mux("cko2_sel",         base + 0x60,  16,     5,      cko2_sels,         ARRAY_SIZE(cko2_sels));
+       clks[IMX6SX_CLK_CKO]                = imx_clk_mux("cko",              base + 0x60,  8,      1,      cko_sels,          ARRAY_SIZE(cko_sels));
+
+       clks[IMX6SX_CLK_LDB_DI1_DIV_SEL]    = imx_clk_mux_flags("ldb_di1_div_sel", base + 0x20, 11, 1, ldb_di1_div_sels, ARRAY_SIZE(ldb_di1_div_sels), CLK_SET_RATE_PARENT);
+       clks[IMX6SX_CLK_LDB_DI0_DIV_SEL]    = imx_clk_mux_flags("ldb_di0_div_sel", base + 0x20, 10, 1, ldb_di0_div_sels, ARRAY_SIZE(ldb_di0_div_sels), CLK_SET_RATE_PARENT);
+       clks[IMX6SX_CLK_LDB_DI1_SEL]        = imx_clk_mux_flags("ldb_di1_sel",     base + 0x2c, 12, 3, ldb_di1_sels,      ARRAY_SIZE(ldb_di1_sels),    CLK_SET_RATE_PARENT);
+       clks[IMX6SX_CLK_LDB_DI0_SEL]        = imx_clk_mux_flags("ldb_di0_sel",     base + 0x2c, 9,  3, ldb_di0_sels,      ARRAY_SIZE(ldb_di0_sels),    CLK_SET_RATE_PARENT);
+       clks[IMX6SX_CLK_LCDIF1_PRE_SEL]     = imx_clk_mux_flags("lcdif1_pre_sel",  base + 0x38, 15, 3, lcdif1_pre_sels,   ARRAY_SIZE(lcdif1_pre_sels), CLK_SET_RATE_PARENT);
+       clks[IMX6SX_CLK_LCDIF1_SEL]         = imx_clk_mux_flags("lcdif1_sel",      base + 0x38, 9,  3, lcdif1_sels,       ARRAY_SIZE(lcdif1_sels),     CLK_SET_RATE_PARENT);
+
+       /*                                                    name              parent_name          reg          shift width */
+       clks[IMX6SX_CLK_PERIPH_CLK2]        = imx_clk_divider("periph_clk2",    "periph_clk2_sel",   base + 0x14, 27,   3);
+       clks[IMX6SX_CLK_PERIPH2_CLK2]       = imx_clk_divider("periph2_clk2",   "periph2_clk2_sel",  base + 0x14, 0,    3);
+       clks[IMX6SX_CLK_IPG]                = imx_clk_divider("ipg",            "ahb",               base + 0x14, 8,    2);
+       clks[IMX6SX_CLK_GPU_CORE_PODF]      = imx_clk_divider("gpu_core_podf",  "gpu_core_sel",      base + 0x18, 29,   3);
+       clks[IMX6SX_CLK_GPU_AXI_PODF]       = imx_clk_divider("gpu_axi_podf",   "gpu_axi_sel",       base + 0x18, 26,   3);
+       clks[IMX6SX_CLK_LCDIF1_PODF]        = imx_clk_divider("lcdif1_podf",    "lcdif1_pred",       base + 0x18, 23,   3);
+       clks[IMX6SX_CLK_QSPI1_PODF]         = imx_clk_divider("qspi1_podf",     "qspi1_sel",         base + 0x1c, 26,   3);
+       clks[IMX6SX_CLK_EIM_SLOW_PODF]      = imx_clk_divider("eim_slow_podf",  "eim_slow_sel",      base + 0x1c, 23,   3);
+       clks[IMX6SX_CLK_LCDIF2_PODF]        = imx_clk_divider("lcdif2_podf",    "lcdif2_pred",       base + 0x1c, 20,   3);
+       clks[IMX6SX_CLK_PERCLK]             = imx_clk_divider("perclk",         "perclk_sel",        base + 0x1c, 0,    6);
+       clks[IMX6SX_CLK_VID_PODF]           = imx_clk_divider("vid_podf",       "vid_sel",           base + 0x20, 24,   2);
+       clks[IMX6SX_CLK_CAN_PODF]           = imx_clk_divider("can_podf",       "can_sel",           base + 0x20, 2,    6);
+       clks[IMX6SX_CLK_USDHC4_PODF]        = imx_clk_divider("usdhc4_podf",    "usdhc4_sel",        base + 0x24, 22,   3);
+       clks[IMX6SX_CLK_USDHC3_PODF]        = imx_clk_divider("usdhc3_podf",    "usdhc3_sel",        base + 0x24, 19,   3);
+       clks[IMX6SX_CLK_USDHC2_PODF]        = imx_clk_divider("usdhc2_podf",    "usdhc2_sel",        base + 0x24, 16,   3);
+       clks[IMX6SX_CLK_USDHC1_PODF]        = imx_clk_divider("usdhc1_podf",    "usdhc1_sel",        base + 0x24, 11,   3);
+       clks[IMX6SX_CLK_UART_PODF]          = imx_clk_divider("uart_podf",      "uart_sel",          base + 0x24, 0,    6);
+       clks[IMX6SX_CLK_ESAI_PRED]          = imx_clk_divider("esai_pred",      "esai_sel",          base + 0x28, 9,    3);
+       clks[IMX6SX_CLK_ESAI_PODF]          = imx_clk_divider("esai_podf",      "esai_pred",         base + 0x28, 25,   3);
+       clks[IMX6SX_CLK_SSI3_PRED]          = imx_clk_divider("ssi3_pred",      "ssi3_sel",          base + 0x28, 22,   3);
+       clks[IMX6SX_CLK_SSI3_PODF]          = imx_clk_divider("ssi3_podf",      "ssi3_pred",         base + 0x28, 16,   6);
+       clks[IMX6SX_CLK_SSI1_PRED]          = imx_clk_divider("ssi1_pred",      "ssi1_sel",          base + 0x28, 6,    3);
+       clks[IMX6SX_CLK_SSI1_PODF]          = imx_clk_divider("ssi1_podf",      "ssi1_pred",         base + 0x28, 0,    6);
+       clks[IMX6SX_CLK_QSPI2_PRED]         = imx_clk_divider("qspi2_pred",     "qspi2_sel",         base + 0x2c, 18,   3);
+       clks[IMX6SX_CLK_QSPI2_PODF]         = imx_clk_divider("qspi2_podf",     "qspi2_pred",        base + 0x2c, 21,   6);
+       clks[IMX6SX_CLK_SSI2_PRED]          = imx_clk_divider("ssi2_pred",      "ssi2_sel",          base + 0x2c, 6,    3);
+       clks[IMX6SX_CLK_SSI2_PODF]          = imx_clk_divider("ssi2_podf",      "ssi2_pred",         base + 0x2c, 0,    6);
+       clks[IMX6SX_CLK_SPDIF_PRED]         = imx_clk_divider("spdif_pred",     "spdif_sel",         base + 0x30, 25,   3);
+       clks[IMX6SX_CLK_SPDIF_PODF]         = imx_clk_divider("spdif_podf",     "spdif_pred",        base + 0x30, 22,   3);
+       clks[IMX6SX_CLK_AUDIO_PRED]         = imx_clk_divider("audio_pred",     "audio_sel",         base + 0x30, 12,   3);
+       clks[IMX6SX_CLK_AUDIO_PODF]         = imx_clk_divider("audio_podf",     "audio_pred",        base + 0x30, 9,    3);
+       clks[IMX6SX_CLK_ENET_PODF]          = imx_clk_divider("enet_podf",      "enet_pre_sel",      base + 0x34, 12,   3);
+       clks[IMX6SX_CLK_M4_PODF]            = imx_clk_divider("m4_podf",        "m4_sel",            base + 0x34, 3,    3);
+       clks[IMX6SX_CLK_ECSPI_PODF]         = imx_clk_divider("ecspi_podf",     "ecspi_sel",         base + 0x38, 19,   6);
+       clks[IMX6SX_CLK_LCDIF1_PRED]        = imx_clk_divider("lcdif1_pred",    "lcdif1_pre_sel",    base + 0x38, 12,   3);
+       clks[IMX6SX_CLK_LCDIF2_PRED]        = imx_clk_divider("lcdif2_pred",    "lcdif2_pre_sel",    base + 0x38, 3,    3);
+       clks[IMX6SX_CLK_DISPLAY_PODF]       = imx_clk_divider("display_podf",   "display_sel",       base + 0x3c, 16,   3);
+       clks[IMX6SX_CLK_CSI_PODF]           = imx_clk_divider("csi_podf",       "csi_sel",           base + 0x3c, 11,   3);
+       clks[IMX6SX_CLK_CKO1_PODF]          = imx_clk_divider("cko1_podf",      "cko1_sel",          base + 0x60, 4,    3);
+       clks[IMX6SX_CLK_CKO2_PODF]          = imx_clk_divider("cko2_podf",      "cko2_sel",          base + 0x60, 21,   3);
+
+       clks[IMX6SX_CLK_LDB_DI0_DIV_3_5]    = imx_clk_fixed_factor("ldb_di0_div_3_5", "ldb_di0_sel", 2, 7);
+       clks[IMX6SX_CLK_LDB_DI0_DIV_7]      = imx_clk_fixed_factor("ldb_di0_div_7",   "ldb_di0_sel", 1, 7);
+       clks[IMX6SX_CLK_LDB_DI1_DIV_3_5]    = imx_clk_fixed_factor("ldb_di1_div_3_5", "ldb_di1_sel", 2, 7);
+       clks[IMX6SX_CLK_LDB_DI1_DIV_7]      = imx_clk_fixed_factor("ldb_di1_div_7",   "ldb_di1_sel", 1, 7);
+
+       /*                                               name        reg          shift width busy: reg,   shift parent_names       num_parents */
+       clks[IMX6SX_CLK_PERIPH]       = imx_clk_busy_mux("periph",   base + 0x14, 25,   1,    base + 0x48, 5,    periph_sels,       ARRAY_SIZE(periph_sels));
+       clks[IMX6SX_CLK_PERIPH2]      = imx_clk_busy_mux("periph2",  base + 0x14, 26,   1,    base + 0x48, 3,    periph2_sels,      ARRAY_SIZE(periph2_sels));
+       /*                                                   name             parent_name    reg          shift width busy: reg,   shift */
+       clks[IMX6SX_CLK_OCRAM_PODF]   = imx_clk_busy_divider("ocram_podf",    "ocram_sel",   base + 0x14, 16,   3,    base + 0x48, 0);
+       clks[IMX6SX_CLK_AHB]          = imx_clk_busy_divider("ahb",           "periph",      base + 0x14, 10,   3,    base + 0x48, 1);
+       clks[IMX6SX_CLK_MMDC_PODF]    = imx_clk_busy_divider("mmdc_podf",     "periph2",     base + 0x14, 3,    3,    base + 0x48, 2);
+       clks[IMX6SX_CLK_ARM]          = imx_clk_busy_divider("arm",           "pll1_sw",     base + 0x10, 0,    3,    base + 0x48, 16);
+
+       /*                                            name             parent_name          reg         shift */
+       /* CCGR0 */
+       clks[IMX6SX_CLK_AIPS_TZ1]     = imx_clk_gate2("aips_tz1",      "ahb",               base + 0x68, 0);
+       clks[IMX6SX_CLK_AIPS_TZ2]     = imx_clk_gate2("aips_tz2",      "ahb",               base + 0x68, 2);
+       clks[IMX6SX_CLK_APBH_DMA]     = imx_clk_gate2("apbh_dma",      "usdhc3",            base + 0x68, 4);
+       clks[IMX6SX_CLK_ASRC_MEM]     = imx_clk_gate2_shared("asrc_mem", "ahb",             base + 0x68, 6, &share_count_asrc);
+       clks[IMX6SX_CLK_ASRC_IPG]     = imx_clk_gate2_shared("asrc_ipg", "ahb",             base + 0x68, 6, &share_count_asrc);
+       clks[IMX6SX_CLK_CAAM_MEM]     = imx_clk_gate2("caam_mem",      "ahb",               base + 0x68, 8);
+       clks[IMX6SX_CLK_CAAM_ACLK]    = imx_clk_gate2("caam_aclk",     "ahb",               base + 0x68, 10);
+       clks[IMX6SX_CLK_CAAM_IPG]     = imx_clk_gate2("caam_ipg",      "ipg",               base + 0x68, 12);
+       clks[IMX6SX_CLK_CAN1_IPG]     = imx_clk_gate2("can1_ipg",      "ipg",               base + 0x68, 14);
+       clks[IMX6SX_CLK_CAN1_SERIAL]  = imx_clk_gate2("can1_serial",   "can_podf",          base + 0x68, 16);
+       clks[IMX6SX_CLK_CAN2_IPG]     = imx_clk_gate2("can2_ipg",      "ipg",               base + 0x68, 18);
+       clks[IMX6SX_CLK_CAN2_SERIAL]  = imx_clk_gate2("can2_serial",   "can_podf",          base + 0x68, 20);
+       clks[IMX6SX_CLK_DCIC1]        = imx_clk_gate2("dcic1",         "display_podf",      base + 0x68, 24);
+       clks[IMX6SX_CLK_DCIC2]        = imx_clk_gate2("dcic2",         "display_podf",      base + 0x68, 26);
+       clks[IMX6SX_CLK_AIPS_TZ3]     = imx_clk_gate2("aips_tz3",      "ahb",               base + 0x68, 30);
+
+       /* CCGR1 */
+       clks[IMX6SX_CLK_ECSPI1]       = imx_clk_gate2("ecspi1",        "ecspi_podf",        base + 0x6c, 0);
+       clks[IMX6SX_CLK_ECSPI2]       = imx_clk_gate2("ecspi2",        "ecspi_podf",        base + 0x6c, 2);
+       clks[IMX6SX_CLK_ECSPI3]       = imx_clk_gate2("ecspi3",        "ecspi_podf",        base + 0x6c, 4);
+       clks[IMX6SX_CLK_ECSPI4]       = imx_clk_gate2("ecspi4",        "ecspi_podf",        base + 0x6c, 6);
+       clks[IMX6SX_CLK_ECSPI5]       = imx_clk_gate2("ecspi5",        "ecspi_podf",        base + 0x6c, 8);
+       clks[IMX6SX_CLK_EPIT1]        = imx_clk_gate2("epit1",         "perclk",            base + 0x6c, 12);
+       clks[IMX6SX_CLK_EPIT2]        = imx_clk_gate2("epit2",         "perclk",            base + 0x6c, 14);
+       clks[IMX6SX_CLK_ESAI_EXTAL]   = imx_clk_gate2_shared("esai_extal", "esai_podf",     base + 0x6c, 16, &share_count_esai);
+       clks[IMX6SX_CLK_ESAI_IPG]     = imx_clk_gate2_shared("esai_ipg",   "ahb",           base + 0x6c, 16, &share_count_esai);
+       clks[IMX6SX_CLK_ESAI_MEM]     = imx_clk_gate2_shared("esai_mem",   "ahb",           base + 0x6c, 16, &share_count_esai);
+       clks[IMX6SX_CLK_WAKEUP]       = imx_clk_gate2("wakeup",        "ipg",               base + 0x6c, 18);
+       clks[IMX6SX_CLK_GPT_BUS]      = imx_clk_gate2("gpt_bus",       "perclk",            base + 0x6c, 20);
+       clks[IMX6SX_CLK_GPT_SERIAL]   = imx_clk_gate2("gpt_serial",    "perclk",            base + 0x6c, 22);
+       clks[IMX6SX_CLK_GPU]          = imx_clk_gate2("gpu",           "gpu_core_podf",     base + 0x6c, 26);
+       clks[IMX6SX_CLK_CANFD]        = imx_clk_gate2("canfd",         "can_podf",          base + 0x6c, 30);
+
+       /* CCGR2 */
+       clks[IMX6SX_CLK_CSI]          = imx_clk_gate2("csi",           "csi_podf",          base + 0x70, 2);
+       clks[IMX6SX_CLK_I2C1]         = imx_clk_gate2("i2c1",          "perclk",            base + 0x70, 6);
+       clks[IMX6SX_CLK_I2C2]         = imx_clk_gate2("i2c2",          "perclk",            base + 0x70, 8);
+       clks[IMX6SX_CLK_I2C3]         = imx_clk_gate2("i2c3",          "perclk",            base + 0x70, 10);
+       clks[IMX6SX_CLK_OCOTP]        = imx_clk_gate2("ocotp",         "ipg",               base + 0x70, 12);
+       clks[IMX6SX_CLK_IOMUXC]       = imx_clk_gate2("iomuxc",        "lcdif1_podf",       base + 0x70, 14);
+       clks[IMX6SX_CLK_IPMUX1]       = imx_clk_gate2("ipmux1",        "ahb",               base + 0x70, 16);
+       clks[IMX6SX_CLK_IPMUX2]       = imx_clk_gate2("ipmux2",        "ahb",               base + 0x70, 18);
+       clks[IMX6SX_CLK_IPMUX3]       = imx_clk_gate2("ipmux3",        "ahb",               base + 0x70, 20);
+       clks[IMX6SX_CLK_TZASC1]       = imx_clk_gate2("tzasc1",        "mmdc_podf",         base + 0x70, 22);
+       clks[IMX6SX_CLK_LCDIF_APB]    = imx_clk_gate2("lcdif_apb",     "display_podf",      base + 0x70, 28);
+       clks[IMX6SX_CLK_PXP_AXI]      = imx_clk_gate2("pxp_axi",       "display_podf",      base + 0x70, 30);
+
+       /* CCGR3 */
+       clks[IMX6SX_CLK_M4]           = imx_clk_gate2("m4",            "m4_podf",           base + 0x74, 2);
+       clks[IMX6SX_CLK_ENET]         = imx_clk_gate2("enet",          "ipg",               base + 0x74, 4);
+       clks[IMX6SX_CLK_ENET_AHB]     = imx_clk_gate2("enet_ahb",      "enet_sel",          base + 0x74, 4);
+       clks[IMX6SX_CLK_DISPLAY_AXI]  = imx_clk_gate2("display_axi",   "display_podf",      base + 0x74, 6);
+       clks[IMX6SX_CLK_LCDIF2_PIX]   = imx_clk_gate2("lcdif2_pix",    "lcdif2_sel",        base + 0x74, 8);
+       clks[IMX6SX_CLK_LCDIF1_PIX]   = imx_clk_gate2("lcdif1_pix",    "lcdif1_sel",        base + 0x74, 10);
+       clks[IMX6SX_CLK_LDB_DI0]      = imx_clk_gate2("ldb_di0",       "ldb_di0_div_sel",   base + 0x74, 12);
+       clks[IMX6SX_CLK_QSPI1]        = imx_clk_gate2("qspi1",         "qspi1_podf",        base + 0x74, 14);
+       clks[IMX6SX_CLK_MLB]          = imx_clk_gate2("mlb",           "ahb",               base + 0x74, 18);
+       clks[IMX6SX_CLK_MMDC_P0_FAST] = imx_clk_gate2("mmdc_p0_fast",  "mmdc_podf",         base + 0x74, 20);
+       clks[IMX6SX_CLK_MMDC_P0_IPG]  = imx_clk_gate2("mmdc_p0_ipg",   "ipg",               base + 0x74, 24);
+       clks[IMX6SX_CLK_OCRAM]        = imx_clk_gate2("ocram",         "ocram_podf",        base + 0x74, 28);
+
+       /* CCGR4 */
+       clks[IMX6SX_CLK_PCIE_AXI]     = imx_clk_gate2("pcie_axi",      "display_podf",      base + 0x78, 0);
+       clks[IMX6SX_CLK_QSPI2]        = imx_clk_gate2("qspi2",         "qspi2_podf",        base + 0x78, 10);
+       clks[IMX6SX_CLK_PER1_BCH]     = imx_clk_gate2("per1_bch",      "usdhc3",            base + 0x78, 12);
+       clks[IMX6SX_CLK_PER2_MAIN]    = imx_clk_gate2("per2_main",     "ahb",               base + 0x78, 14);
+       clks[IMX6SX_CLK_PWM1]         = imx_clk_gate2("pwm1",          "perclk",            base + 0x78, 16);
+       clks[IMX6SX_CLK_PWM2]         = imx_clk_gate2("pwm2",          "perclk",            base + 0x78, 18);
+       clks[IMX6SX_CLK_PWM3]         = imx_clk_gate2("pwm3",          "perclk",            base + 0x78, 20);
+       clks[IMX6SX_CLK_PWM4]         = imx_clk_gate2("pwm4",          "perclk",            base + 0x78, 22);
+       clks[IMX6SX_CLK_GPMI_BCH_APB] = imx_clk_gate2("gpmi_bch_apb",  "usdhc3",            base + 0x78, 24);
+       clks[IMX6SX_CLK_GPMI_BCH]     = imx_clk_gate2("gpmi_bch",      "usdhc4",            base + 0x78, 26);
+       clks[IMX6SX_CLK_GPMI_IO]      = imx_clk_gate2("gpmi_io",       "qspi2_podf",        base + 0x78, 28);
+       clks[IMX6SX_CLK_GPMI_APB]     = imx_clk_gate2("gpmi_apb",      "usdhc3",            base + 0x78, 30);
+
+       /* CCGR5 */
+       clks[IMX6SX_CLK_ROM]          = imx_clk_gate2("rom",           "ahb",               base + 0x7c, 0);
+       clks[IMX6SX_CLK_SDMA]         = imx_clk_gate2("sdma",          "ahb",               base + 0x7c, 6);
+       clks[IMX6SX_CLK_SPBA]         = imx_clk_gate2("spba",          "ipg",               base + 0x7c, 12);
+       clks[IMX6SX_CLK_AUDIO]        = imx_clk_gate2_shared("audio",  "audio_podf",        base + 0x7c, 14, &share_count_audio);
+       clks[IMX6SX_CLK_SPDIF]        = imx_clk_gate2_shared("spdif",  "spdif_podf",        base + 0x7c, 14, &share_count_audio);
+       clks[IMX6SX_CLK_SSI1_IPG]     = imx_clk_gate2_shared("ssi1_ipg",      "ipg",        base + 0x7c, 18, &share_count_ssi1);
+       clks[IMX6SX_CLK_SSI2_IPG]     = imx_clk_gate2_shared("ssi2_ipg",      "ipg",        base + 0x7c, 20, &share_count_ssi2);
+       clks[IMX6SX_CLK_SSI3_IPG]     = imx_clk_gate2_shared("ssi3_ipg",      "ipg",        base + 0x7c, 22, &share_count_ssi3);
+       clks[IMX6SX_CLK_SSI1]         = imx_clk_gate2_shared("ssi1",          "ssi1_podf",  base + 0x7c, 18, &share_count_ssi1);
+       clks[IMX6SX_CLK_SSI2]         = imx_clk_gate2_shared("ssi2",          "ssi2_podf",  base + 0x7c, 20, &share_count_ssi2);
+       clks[IMX6SX_CLK_SSI3]         = imx_clk_gate2_shared("ssi3",          "ssi3_podf",  base + 0x7c, 22, &share_count_ssi3);
+       clks[IMX6SX_CLK_UART_IPG]     = imx_clk_gate2("uart_ipg",      "ipg",               base + 0x7c, 24);
+       clks[IMX6SX_CLK_UART_SERIAL]  = imx_clk_gate2("uart_serial",   "uart_podf",         base + 0x7c, 26);
+       clks[IMX6SX_CLK_SAI1_IPG]     = imx_clk_gate2("sai1_ipg",      "ipg",               base + 0x7c, 28);
+       clks[IMX6SX_CLK_SAI2_IPG]     = imx_clk_gate2("sai2_ipg",      "ipg",               base + 0x7c, 30);
+       clks[IMX6SX_CLK_SAI1]         = imx_clk_gate2("sai1",          "ssi1_podf",         base + 0x7c, 28);
+       clks[IMX6SX_CLK_SAI2]         = imx_clk_gate2("sai2",          "ssi2_podf",         base + 0x7c, 30);
+
+       /* CCGR6 */
+       clks[IMX6SX_CLK_USBOH3]       = imx_clk_gate2("usboh3",        "ipg",               base + 0x80, 0);
+       clks[IMX6SX_CLK_USDHC1]       = imx_clk_gate2("usdhc1",        "usdhc1_podf",       base + 0x80, 2);
+       clks[IMX6SX_CLK_USDHC2]       = imx_clk_gate2("usdhc2",        "usdhc2_podf",       base + 0x80, 4);
+       clks[IMX6SX_CLK_USDHC3]       = imx_clk_gate2("usdhc3",        "usdhc3_podf",       base + 0x80, 6);
+       clks[IMX6SX_CLK_USDHC4]       = imx_clk_gate2("usdhc4",        "usdhc4_podf",       base + 0x80, 8);
+       clks[IMX6SX_CLK_EIM_SLOW]     = imx_clk_gate2("eim_slow",      "eim_slow_podf",     base + 0x80, 10);
+       clks[IMX6SX_CLK_PWM8]         = imx_clk_gate2("pwm8",          "perclk",            base + 0x80, 16);
+       clks[IMX6SX_CLK_VADC]         = imx_clk_gate2("vadc",          "vid_podf",          base + 0x80, 20);
+       clks[IMX6SX_CLK_GIS]          = imx_clk_gate2("gis",           "display_podf",      base + 0x80, 22);
+       clks[IMX6SX_CLK_I2C4]         = imx_clk_gate2("i2c4",          "perclk",            base + 0x80, 24);
+       clks[IMX6SX_CLK_PWM5]         = imx_clk_gate2("pwm5",          "perclk",            base + 0x80, 26);
+       clks[IMX6SX_CLK_PWM6]         = imx_clk_gate2("pwm6",          "perclk",            base + 0x80, 28);
+       clks[IMX6SX_CLK_PWM7]         = imx_clk_gate2("pwm7",          "perclk",            base + 0x80, 30);
+
+       clks[IMX6SX_CLK_CKO1]         = imx_clk_gate("cko1",           "cko1_podf",         base + 0x60, 7);
+       clks[IMX6SX_CLK_CKO2]         = imx_clk_gate("cko2",           "cko2_podf",         base + 0x60, 24);
+
+       /* mask handshake of mmdc */
+       writel_relaxed(BM_CCM_CCDR_MMDC_CH0_MASK, base + CCDR);
+
+       imx_check_clocks(clks, ARRAY_SIZE(clks));
+
+       clk_data.clks = clks;
+       clk_data.clk_num = ARRAY_SIZE(clks);
+       of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
+
+       for (i = 0; i < ARRAY_SIZE(clks_init_on); i++)
+               clk_prepare_enable(clks[clks_init_on[i]]);
+
+       if (IS_ENABLED(CONFIG_USB_MXS_PHY)) {
+               clk_prepare_enable(clks[IMX6SX_CLK_USBPHY1_GATE]);
+               clk_prepare_enable(clks[IMX6SX_CLK_USBPHY2_GATE]);
+       }
+
+       /* Set the default 132MHz for EIM module */
+       clk_set_parent(clks[IMX6SX_CLK_EIM_SLOW_SEL], clks[IMX6SX_CLK_PLL2_PFD2]);
+       clk_set_rate(clks[IMX6SX_CLK_EIM_SLOW], 132000000);
+
+       /* set parent clock for LCDIF1 pixel clock */
+       clk_set_parent(clks[IMX6SX_CLK_LCDIF1_PRE_SEL], clks[IMX6SX_CLK_PLL5_VIDEO_DIV]);
+       clk_set_parent(clks[IMX6SX_CLK_LCDIF1_SEL], clks[IMX6SX_CLK_LCDIF1_PODF]);
+
+       /* Set the parent clks of PCIe lvds1 and pcie_axi to be pcie ref, axi */
+       if (clk_set_parent(clks[IMX6SX_CLK_LVDS1_SEL], clks[IMX6SX_CLK_PCIE_REF_125M]))
+               pr_err("Failed to set pcie bus parent clk.\n");
+       if (clk_set_parent(clks[IMX6SX_CLK_PCIE_AXI_SEL], clks[IMX6SX_CLK_AXI]))
+               pr_err("Failed to set pcie parent clk.\n");
+
+       /*
+        * Init enet system AHB clock, set to 200MHz
+        * pll2_pfd2_396m-> ENET_PODF-> ENET_AHB
+        */
+       clk_set_parent(clks[IMX6SX_CLK_ENET_PRE_SEL], clks[IMX6SX_CLK_PLL2_PFD2]);
+       clk_set_parent(clks[IMX6SX_CLK_ENET_SEL], clks[IMX6SX_CLK_ENET_PODF]);
+       clk_set_rate(clks[IMX6SX_CLK_ENET_PODF], 200000000);
+       clk_set_rate(clks[IMX6SX_CLK_ENET_REF], 125000000);
+       clk_set_rate(clks[IMX6SX_CLK_ENET2_REF], 125000000);
+
+       /* Audio clocks */
+       clk_set_rate(clks[IMX6SX_CLK_PLL4_AUDIO_DIV], 393216000);
+
+       clk_set_parent(clks[IMX6SX_CLK_SPDIF_SEL], clks[IMX6SX_CLK_PLL4_AUDIO_DIV]);
+       clk_set_rate(clks[IMX6SX_CLK_SPDIF_PODF], 98304000);
+
+       clk_set_parent(clks[IMX6SX_CLK_AUDIO_SEL], clks[IMX6SX_CLK_PLL3_USB_OTG]);
+       clk_set_rate(clks[IMX6SX_CLK_AUDIO_PODF], 24000000);
+
+       clk_set_parent(clks[IMX6SX_CLK_SSI1_SEL], clks[IMX6SX_CLK_PLL4_AUDIO_DIV]);
+       clk_set_parent(clks[IMX6SX_CLK_SSI2_SEL], clks[IMX6SX_CLK_PLL4_AUDIO_DIV]);
+       clk_set_parent(clks[IMX6SX_CLK_SSI3_SEL], clks[IMX6SX_CLK_PLL4_AUDIO_DIV]);
+       clk_set_rate(clks[IMX6SX_CLK_SSI1_PODF], 24576000);
+       clk_set_rate(clks[IMX6SX_CLK_SSI2_PODF], 24576000);
+       clk_set_rate(clks[IMX6SX_CLK_SSI3_PODF], 24576000);
+
+       clk_set_parent(clks[IMX6SX_CLK_ESAI_SEL], clks[IMX6SX_CLK_PLL4_AUDIO_DIV]);
+       clk_set_rate(clks[IMX6SX_CLK_ESAI_PODF], 24576000);
+
+       /* Set parent clock for vadc */
+       clk_set_parent(clks[IMX6SX_CLK_VID_SEL], clks[IMX6SX_CLK_PLL3_USB_OTG]);
+
+       /* default parent of can_sel clock is invalid, manually set it here */
+       clk_set_parent(clks[IMX6SX_CLK_CAN_SEL], clks[IMX6SX_CLK_PLL3_60M]);
+
+       /* Update gpu clock from default 528M to 720M */
+       clk_set_parent(clks[IMX6SX_CLK_GPU_CORE_SEL], clks[IMX6SX_CLK_PLL3_PFD0]);
+       clk_set_parent(clks[IMX6SX_CLK_GPU_AXI_SEL], clks[IMX6SX_CLK_PLL3_PFD0]);
+
+       clk_set_parent(clks[IMX6SX_CLK_QSPI1_SEL], clks[IMX6SX_CLK_PLL2_BUS]);
+       clk_set_parent(clks[IMX6SX_CLK_QSPI2_SEL], clks[IMX6SX_CLK_PLL2_BUS]);
+}
+CLK_OF_DECLARE(imx6sx, "fsl,imx6sx-ccm", imx6sx_clocks_init);
diff --git a/drivers/clk/imx/clk-imx7d.c b/drivers/clk/imx/clk-imx7d.c
new file mode 100644 (file)
index 0000000..71f3a94
--- /dev/null
@@ -0,0 +1,860 @@
+/*
+ * Copyright (C) 2014-2015 Freescale Semiconductor, Inc.
+ *
+ * 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:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+#include <dt-bindings/clock/imx7d-clock.h>
+#include <linux/clk.h>
+#include <linux/clkdev.h>
+#include <linux/err.h>
+#include <linux/init.h>
+#include <linux/io.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
+#include <linux/types.h>
+
+#include "clk.h"
+
+static struct clk *clks[IMX7D_CLK_END];
+static const char *arm_a7_sel[] = { "osc", "pll_arm_main_clk",
+       "pll_enet_500m_clk", "pll_dram_main_clk",
+       "pll_sys_main_clk", "pll_sys_pfd0_392m_clk", "pll_audio_main_clk",
+       "pll_usb_main_clk", };
+
+static const char *arm_m4_sel[] = { "osc", "pll_sys_main_240m_clk",
+       "pll_enet_250m_clk", "pll_sys_pfd2_270m_clk",
+       "pll_dram_533m_clk", "pll_audio_main_clk", "pll_video_main_clk",
+       "pll_usb_main_clk", };
+
+static const char *arm_m0_sel[] = { "osc", "pll_sys_main_120m_clk",
+       "pll_enet_125m_clk", "pll_sys_pfd2_135m_clk",
+       "pll_dram_533m_clk", "pll_audio_main_clk", "pll_video_main_clk",
+       "pll_usb_main_clk", };
+
+static const char *axi_sel[] = { "osc", "pll_sys_pfd1_332m_clk",
+       "pll_dram_533m_clk", "pll_enet_250m_clk", "pll_sys_pfd5_clk",
+       "pll_audio_main_clk", "pll_video_main_clk", "pll_sys_pfd7_clk", };
+
+static const char *disp_axi_sel[] = { "osc", "pll_sys_pfd1_332m_clk",
+       "pll_dram_533m_clk", "pll_enet_250m_clk", "pll_sys_pfd6_clk",
+       "pll_sys_pfd7_clk", "pll_audio_main_clk", "pll_video_main_clk", };
+
+static const char *enet_axi_sel[] = { "osc", "pll_sys_pfd2_270m_clk",
+       "pll_dram_533m_clk", "pll_enet_250m_clk",
+       "pll_sys_main_240m_clk", "pll_audio_main_clk", "pll_video_main_clk",
+       "pll_sys_pfd4_clk", };
+
+static const char *nand_usdhc_bus_sel[] = { "osc", "pll_sys_pfd2_270m_clk",
+       "pll_dram_533m_clk", "pll_sys_main_240m_clk",
+       "pll_sys_pfd2_135m_clk", "pll_sys_pfd6_clk", "pll_enet_250m_clk",
+       "pll_audio_main_clk", };
+
+static const char *ahb_channel_sel[] = { "osc", "pll_sys_pfd2_135m_clk",
+       "pll_dram_533m_clk", "pll_sys_pfd0_392m_clk",
+       "pll_enet_125m_clk", "pll_usb_main_clk", "pll_audio_main_clk",
+       "pll_video_main_clk", };
+
+static const char *dram_phym_sel[] = { "pll_dram_main_clk",
+       "dram_phym_alt_clk", };
+
+static const char *dram_sel[] = { "pll_dram_main_clk",
+       "dram_alt_clk", };
+
+static const char *dram_phym_alt_sel[] = { "osc", "pll_dram_533m_clk",
+       "pll_sys_main_clk", "pll_enet_500m_clk",
+       "pll_usb_main_clk", "pll_sys_pfd7_clk", "pll_audio_main_clk",
+       "pll_video_main_clk", };
+
+static const char *dram_alt_sel[] = { "osc", "pll_dram_533m_clk",
+       "pll_sys_main_clk", "pll_enet_500m_clk",
+       "pll_enet_250m_clk", "pll_sys_pfd0_392m_clk",
+       "pll_audio_main_clk", "pll_sys_pfd2_270m_clk", };
+
+static const char *usb_hsic_sel[] = { "osc", "pll_sys_main_clk",
+       "pll_usb_main_clk", "pll_sys_pfd3_clk", "pll_sys_pfd4_clk",
+       "pll_sys_pfd5_clk", "pll_sys_pfd6_clk", "pll_sys_pfd7_clk", };
+
+static const char *pcie_ctrl_sel[] = { "osc", "pll_enet_250m_clk",
+       "pll_sys_main_240m_clk", "pll_sys_pfd2_270m_clk",
+       "pll_dram_533m_clk", "pll_enet_500m_clk",
+       "pll_sys_pfd1_332m_clk", "pll_sys_pfd6_clk", };
+
+static const char *pcie_phy_sel[] = { "osc", "pll_enet_100m_clk",
+       "pll_enet_500m_clk", "ext_clk_1", "ext_clk_2", "ext_clk_3",
+       "ext_clk_4", "pll_sys_pfd0_392m_clk", };
+
+static const char *epdc_pixel_sel[] = { "osc", "pll_sys_pfd1_332m_clk",
+       "pll_dram_533m_clk", "pll_sys_main_clk", "pll_sys_pfd5_clk",
+       "pll_sys_pfd6_clk", "pll_sys_pfd7_clk", "pll_video_main_clk", };
+
+static const char *lcdif_pixel_sel[] = { "osc", "pll_sys_pfd5_clk",
+       "pll_dram_533m_clk", "ext_clk_3", "pll_sys_pfd4_clk",
+       "pll_sys_pfd2_270m_clk", "pll_video_main_clk",
+       "pll_usb_main_clk", };
+
+static const char *mipi_dsi_sel[] = { "osc", "pll_sys_pfd5_clk",
+       "pll_sys_pfd3_clk", "pll_sys_main_clk", "pll_sys_pfd0_196m_clk",
+       "pll_dram_533m_clk", "pll_video_main_clk", "pll_audio_main_clk", };
+
+static const char *mipi_csi_sel[] = { "osc", "pll_sys_pfd4_clk",
+       "pll_sys_pfd3_clk", "pll_sys_main_clk", "pll_sys_pfd0_196m_clk",
+       "pll_dram_533m_clk", "pll_video_main_clk", "pll_audio_main_clk", };
+
+static const char *mipi_dphy_sel[] = { "osc", "pll_sys_main_120m_clk",
+       "pll_dram_533m_clk", "pll_sys_pfd5_clk", "ref_1m_clk", "ext_clk_2",
+       "pll_video_main_clk", "ext_clk_3", };
+
+static const char *sai1_sel[] = { "osc", "pll_sys_pfd2_135m_clk",
+       "pll_audio_main_clk", "pll_dram_533m_clk", "pll_video_main_clk",
+       "pll_sys_pfd4_clk", "pll_enet_125m_clk", "ext_clk_2", };
+
+static const char *sai2_sel[] = { "osc", "pll_sys_pfd2_135m_clk",
+       "pll_audio_main_clk", "pll_dram_533m_clk", "pll_video_main_clk",
+       "pll_sys_pfd4_clk", "pll_enet_125m_clk", "ext_clk_2", };
+
+static const char *sai3_sel[] = { "osc", "pll_sys_pfd2_135m_clk",
+       "pll_audio_main_clk", "pll_dram_533m_clk", "pll_video_main_clk",
+       "pll_sys_pfd4_clk", "pll_enet_125m_clk", "ext_clk_3", };
+
+static const char *spdif_sel[] = { "osc", "pll_sys_pfd2_135m_clk",
+       "pll_audio_main_clk", "pll_dram_533m_clk", "pll_video_main_clk",
+       "pll_sys_pfd4_clk", "pll_enet_125m_clk", "ext_3_clk", };
+
+static const char *enet1_ref_sel[] = { "osc", "pll_enet_125m_clk",
+       "pll_enet_50m_clk", "pll_enet_25m_clk",
+       "pll_sys_main_120m_clk", "pll_audio_main_clk", "pll_video_main_clk",
+       "ext_clk_4", };
+
+static const char *enet1_time_sel[] = { "osc", "pll_enet_100m_clk",
+       "pll_audio_main_clk", "ext_clk_1", "ext_clk_2", "ext_clk_3",
+       "ext_clk_4", "pll_video_main_clk", };
+
+static const char *enet2_ref_sel[] = { "osc", "pll_enet_125m_clk",
+       "pll_enet_50m_clk", "pll_enet_25m_clk",
+       "pll_sys_main_120m_clk", "pll_audio_main_clk", "pll_video_main_clk",
+       "ext_clk_4", };
+
+static const char *enet2_time_sel[] = { "osc", "pll_enet_100m_clk",
+       "pll_audio_main_clk", "ext_clk_1", "ext_clk_2", "ext_clk_3",
+       "ext_clk_4", "pll_video_main_clk", };
+
+static const char *enet_phy_ref_sel[] = { "osc", "pll_enet_25m_clk",
+       "pll_enet_50m_clk", "pll_enet_125m_clk",
+       "pll_dram_533m_clk", "pll_audio_main_clk", "pll_video_main_clk",
+       "pll_sys_pfd3_clk", };
+
+static const char *eim_sel[] = { "osc", "pll_sys_pfd2_135m_clk",
+       "pll_sys_main_120m_clk", "pll_dram_533m_clk",
+       "pll_sys_pfd2_270m_clk", "pll_sys_pfd3_clk", "pll_enet_125m_clk",
+       "pll_usb_main_clk", };
+
+static const char *nand_sel[] = { "osc", "pll_sys_main_clk",
+       "pll_dram_533m_clk", "pll_sys_pfd0_392m_clk", "pll_sys_pfd3_clk",
+       "pll_enet_500m_clk", "pll_enet_250m_clk",
+       "pll_video_main_clk", };
+
+static const char *qspi_sel[] = { "osc", "pll_sys_pfd4_clk",
+       "pll_dram_533m_clk", "pll_enet_500m_clk", "pll_sys_pfd3_clk",
+       "pll_sys_pfd2_270m_clk", "pll_sys_pfd6_clk", "pll_sys_pfd7_clk", };
+
+static const char *usdhc1_sel[] = { "osc", "pll_sys_pfd0_392m_clk",
+       "pll_dram_533m_clk", "pll_enet_500m_clk", "pll_sys_pfd4_clk",
+       "pll_sys_pfd2_270m_clk", "pll_sys_pfd6_clk", "pll_sys_pfd7_clk", };
+
+static const char *usdhc2_sel[] = { "osc", "pll_sys_pfd0_392m_clk",
+       "pll_dram_533m_clk", "pll_enet_500m_clk", "pll_sys_pfd4_clk",
+       "pll_sys_pfd2_270m_clk", "pll_sys_pfd6_clk", "pll_sys_pfd7_clk", };
+
+static const char *usdhc3_sel[] = { "osc", "pll_sys_pfd0_392m_clk",
+       "pll_dram_533m_clk", "pll_enet_500m_clk", "pll_sys_pfd4_clk",
+       "pll_sys_pfd2_270m_clk", "pll_sys_pfd6_clk", "pll_sys_pfd7_clk", };
+
+static const char *can1_sel[] = { "osc", "pll_sys_main_120m_clk",
+       "pll_dram_533m_clk", "pll_sys_main_clk",
+       "pll_enet_40m_clk", "pll_usb_main_clk", "ext_clk_1",
+       "ext_clk_4", };
+
+static const char *can2_sel[] = { "osc", "pll_sys_main_120m_clk",
+       "pll_dram_533m_clk", "pll_sys_main_clk",
+       "pll_enet_40m_clk", "pll_usb_main_clk", "ext_clk_1",
+       "ext_clk_3", };
+
+static const char *i2c1_sel[] = { "osc", "pll_sys_main_120m_clk",
+       "pll_enet_50m_clk", "pll_dram_533m_clk",
+       "pll_audio_main_clk", "pll_video_main_clk", "pll_usb_main_clk",
+       "pll_sys_pfd2_135m_clk", };
+
+static const char *i2c2_sel[] = { "osc", "pll_sys_main_120m_clk",
+       "pll_enet_50m_clk", "pll_dram_533m_clk",
+       "pll_audio_main_clk", "pll_video_main_clk", "pll_usb_main_clk",
+       "pll_sys_pfd2_135m_clk", };
+
+static const char *i2c3_sel[] = { "osc", "pll_sys_main_120m_clk",
+       "pll_enet_50m_clk", "pll_dram_533m_clk",
+       "pll_audio_main_clk", "pll_video_main_clk", "pll_usb_main_clk",
+       "pll_sys_pfd2_135m_clk", };
+
+static const char *i2c4_sel[] = { "osc", "pll_sys_main_120m_clk",
+       "pll_enet_50m_clk", "pll_dram_533m_clk",
+       "pll_audio_main_clk", "pll_video_main_clk", "pll_usb_main_clk",
+       "pll_sys_pfd2_135m_clk", };
+
+static const char *uart1_sel[] = { "osc", "pll_sys_main_240m_clk",
+       "pll_enet_40m_clk", "pll_enet_100m_clk",
+       "pll_sys_main_clk", "ext_clk_2", "ext_clk_4",
+       "pll_usb_main_clk", };
+
+static const char *uart2_sel[] = { "osc", "pll_sys_main_240m_clk",
+       "pll_enet_40m_clk", "pll_enet_100m_clk",
+       "pll_sys_main_clk", "ext_clk_2", "ext_clk_3",
+       "pll_usb_main_clk", };
+
+static const char *uart3_sel[] = { "osc", "pll_sys_main_240m_clk",
+       "pll_enet_40m_clk", "pll_enet_100m_clk",
+       "pll_sys_main_clk", "ext_clk_2", "ext_clk_4",
+       "pll_usb_main_clk", };
+
+static const char *uart4_sel[] = { "osc", "pll_sys_main_240m_clk",
+       "pll_enet_40m_clk", "pll_enet_100m_clk",
+       "pll_sys_main_clk", "ext_clk_2", "ext_clk_3",
+       "pll_usb_main_clk", };
+
+static const char *uart5_sel[] = { "osc", "pll_sys_main_240m_clk",
+       "pll_enet_40m_clk", "pll_enet_100m_clk",
+       "pll_sys_main_clk", "ext_clk_2", "ext_clk_4",
+       "pll_usb_main_clk", };
+
+static const char *uart6_sel[] = { "osc", "pll_sys_main_240m_clk",
+       "pll_enet_40m_clk", "pll_enet_100m_clk",
+       "pll_sys_main_clk", "ext_clk_2", "ext_clk_3",
+       "pll_usb_main_clk", };
+
+static const char *uart7_sel[] = { "osc", "pll_sys_main_240m_clk",
+       "pll_enet_40m_clk", "pll_enet_100m_clk",
+       "pll_sys_main_clk", "ext_clk_2", "ext_clk_4",
+       "pll_usb_main_clk", };
+
+static const char *ecspi1_sel[] = { "osc", "pll_sys_main_240m_clk",
+       "pll_enet_40m_clk", "pll_sys_main_120m_clk",
+       "pll_sys_main_clk", "pll_sys_pfd4_clk", "pll_enet_250m_clk",
+       "pll_usb_main_clk", };
+
+static const char *ecspi2_sel[] = { "osc", "pll_sys_main_240m_clk",
+       "pll_enet_40m_clk", "pll_sys_main_120m_clk",
+       "pll_sys_main_clk", "pll_sys_pfd4_clk", "pll_enet_250m_clk",
+       "pll_usb_main_clk", };
+
+static const char *ecspi3_sel[] = { "osc", "pll_sys_main_240m_clk",
+       "pll_enet_40m_clk", "pll_sys_main_120m_clk",
+       "pll_sys_main_clk", "pll_sys_pfd4_clk", "pll_enet_250m_clk",
+       "pll_usb_main_clk", };
+
+static const char *ecspi4_sel[] = { "osc", "pll_sys_main_240m_clk",
+       "pll_enet_40m_clk", "pll_sys_main_120m_clk",
+       "pll_sys_main_clk", "pll_sys_pfd4_clk", "pll_enet_250m_clk",
+       "pll_usb_main_clk", };
+
+static const char *pwm1_sel[] = { "osc", "pll_enet_100m_clk",
+       "pll_sys_main_120m_clk", "pll_enet_40m_clk", "pll_audio_main_clk",
+       "ext_clk_1", "ref_1m_clk", "pll_video_main_clk", };
+
+static const char *pwm2_sel[] = { "osc", "pll_enet_100m_clk",
+       "pll_sys_main_120m_clk", "pll_enet_40m_clk", "pll_audio_main_clk",
+       "ext_clk_1", "ref_1m_clk", "pll_video_main_clk", };
+
+static const char *pwm3_sel[] = { "osc", "pll_enet_100m_clk",
+       "pll_sys_main_120m_clk", "pll_enet_40m_clk", "pll_audio_main_clk",
+       "ext_clk_2", "ref_1m_clk", "pll_video_main_clk", };
+
+static const char *pwm4_sel[] = { "osc", "pll_enet_100m_clk",
+       "pll_sys_main_120m_clk", "pll_enet_40m_clk", "pll_audio_main_clk",
+       "ext_clk_2", "ref_1m_clk", "pll_video_main_clk", };
+
+static const char *flextimer1_sel[] = { "osc", "pll_enet_100m_clk",
+       "pll_sys_main_120m_clk", "pll_enet_40m_clk", "pll_audio_main_clk",
+       "ext_clk_3", "ref_1m_clk", "pll_video_main_clk", };
+
+static const char *flextimer2_sel[] = { "osc", "pll_enet_100m_clk",
+       "pll_sys_main_120m_clk", "pll_enet_40m_clk", "pll_audio_main_clk",
+       "ext_clk_3", "ref_1m_clk", "pll_video_main_clk", };
+
+static const char *sim1_sel[] = { "osc", "pll_sys_pfd2_135m_clk",
+       "pll_sys_main_120m_clk", "pll_dram_533m_clk",
+       "pll_usb_main_clk", "pll_audio_main_clk", "pll_enet_125m_clk",
+       "pll_sys_pfd7_clk", };
+
+static const char *sim2_sel[] = { "osc", "pll_sys_pfd2_135m_clk",
+       "pll_sys_main_120m_clk", "pll_dram_533m_clk",
+       "pll_usb_main_clk", "pll_video_main_clk", "pll_enet_125m_clk",
+       "pll_sys_pfd7_clk", };
+
+static const char *gpt1_sel[] = { "osc", "pll_enet_100m_clk",
+       "pll_sys_pfd0_392m_clk", "pll_enet_40m_clk", "pll_video_main_clk",
+       "ref_1m_clk", "pll_audio_main_clk", "ext_clk_1", };
+
+static const char *gpt2_sel[] = { "osc", "pll_enet_100m_clk",
+       "pll_sys_pfd0_392m_clk", "pll_enet_40m_clk", "pll_video_main_clk",
+       "ref_1m_clk", "pll_audio_main_clk", "ext_clk_2", };
+
+static const char *gpt3_sel[] = { "osc", "pll_enet_100m_clk",
+       "pll_sys_pfd0_392m_clk", "pll_enet_40m_clk", "pll_video_main_clk",
+       "ref_1m_clk", "pll_audio_main_clk", "ext_clk_3", };
+
+static const char *gpt4_sel[] = { "osc", "pll_enet_100m_clk",
+       "pll_sys_pfd0_392m_clk", "pll_enet_40m_clk", "pll_video_main_clk",
+       "ref_1m_clk", "pll_audio_main_clk", "ext_clk_4", };
+
+static const char *trace_sel[] = { "osc", "pll_sys_pfd2_135m_clk",
+       "pll_sys_main_120m_clk", "pll_dram_533m_clk",
+       "pll_enet_125m_clk", "pll_usb_main_clk", "ext_clk_2",
+       "ext_clk_3", };
+
+static const char *wdog_sel[] = { "osc", "pll_sys_pfd2_135m_clk",
+       "pll_sys_main_120m_clk", "pll_dram_533m_clk",
+       "pll_enet_125m_clk", "pll_usb_main_clk", "ref_1m_clk",
+       "pll_sys_pfd1_166m_clk", };
+
+static const char *csi_mclk_sel[] = { "osc", "pll_sys_pfd2_135m_clk",
+       "pll_sys_main_120m_clk", "pll_dram_533m_clk",
+       "pll_enet_125m_clk", "pll_audio_main_clk", "pll_video_main_clk",
+       "pll_usb_main_clk", };
+
+static const char *audio_mclk_sel[] = { "osc", "pll_sys_pfd2_135m_clk",
+       "pll_sys_main_120m_clk", "pll_dram_533m_clk",
+       "pll_enet_125m_clk", "pll_audio_main_clk", "pll_video_main_clk",
+       "pll_usb_main_clk", };
+
+static const char *wrclk_sel[] = { "osc", "pll_enet_40m_clk",
+       "pll_dram_533m_clk", "pll_usb_main_clk",
+       "pll_sys_main_240m_clk", "pll_sys_pfd2_270m_clk",
+       "pll_enet_500m_clk", "pll_sys_pfd7_clk", };
+
+static const char *clko1_sel[] = { "osc", "pll_sys_main_clk",
+       "pll_sys_main_240m_clk", "pll_sys_pfd0_196m_clk", "pll_sys_pfd3_clk",
+       "pll_enet_500m_clk", "pll_dram_533m_clk", "ref_1m_clk", };
+
+static const char *clko2_sel[] = { "osc", "pll_sys_main_240m_clk",
+       "pll_sys_pfd0_392m_clk", "pll_sys_pfd1_166m_clk", "pll_sys_pfd4_clk",
+       "pll_audio_main_clk", "pll_video_main_clk", "osc_32k_clk", };
+
+static const char *lvds1_sel[] = { "pll_arm_main_clk",
+       "pll_sys_main_clk", "pll_sys_pfd0_392m_clk", "pll_sys_pfd1_332m_clk",
+       "pll_sys_pfd2_270m_clk", "pll_sys_pfd3_clk", "pll_sys_pfd4_clk",
+       "pll_sys_pfd5_clk", "pll_sys_pfd6_clk", "pll_sys_pfd7_clk",
+       "pll_audio_main_clk", "pll_video_main_clk", "pll_enet_500m_clk",
+       "pll_enet_250m_clk", "pll_enet_125m_clk", "pll_enet_100m_clk",
+       "pll_enet_50m_clk", "pll_enet_40m_clk", "pll_enet_25m_clk",
+       "pll_dram_main_clk", };
+
+static const char *pll_bypass_src_sel[] = { "osc", "dummy", };
+static const char *pll_arm_bypass_sel[] = { "pll_arm_main", "pll_arm_main_src", };
+static const char *pll_dram_bypass_sel[] = { "pll_dram_main", "pll_dram_main_src", };
+static const char *pll_sys_bypass_sel[] = { "pll_sys_main", "pll_sys_main_src", };
+static const char *pll_enet_bypass_sel[] = { "pll_enet_main", "pll_enet_main_src", };
+static const char *pll_audio_bypass_sel[] = { "pll_audio_main", "pll_audio_main_src", };
+static const char *pll_video_bypass_sel[] = { "pll_video_main", "pll_video_main_src", };
+
+static struct clk_onecell_data clk_data;
+
+static void __init imx7d_clocks_init(struct device_node *ccm_node)
+{
+       struct device_node *np;
+       void __iomem *base;
+       int i;
+
+       clks[IMX7D_CLK_DUMMY] = imx_clk_fixed("dummy", 0);
+       clks[IMX7D_OSC_24M_CLK] = of_clk_get_by_name(ccm_node, "osc");
+
+       np = of_find_compatible_node(NULL, NULL, "fsl,imx7d-anatop");
+       base = of_iomap(np, 0);
+       WARN_ON(!base);
+
+       clks[IMX7D_PLL_ARM_MAIN_SRC]  = imx_clk_mux("pll_arm_main_src", base + 0x60, 14, 2, pll_bypass_src_sel, ARRAY_SIZE(pll_bypass_src_sel));
+       clks[IMX7D_PLL_DRAM_MAIN_SRC] = imx_clk_mux("pll_dram_main_src", base + 0x70, 14, 2, pll_bypass_src_sel, ARRAY_SIZE(pll_bypass_src_sel));
+       clks[IMX7D_PLL_SYS_MAIN_SRC]  = imx_clk_mux("pll_sys_main_src", base + 0xb0, 14, 2, pll_bypass_src_sel, ARRAY_SIZE(pll_bypass_src_sel));
+       clks[IMX7D_PLL_ENET_MAIN_SRC] = imx_clk_mux("pll_enet_main_src", base + 0xe0, 14, 2, pll_bypass_src_sel, ARRAY_SIZE(pll_bypass_src_sel));
+       clks[IMX7D_PLL_AUDIO_MAIN_SRC] = imx_clk_mux("pll_audio_main_src", base + 0xf0, 14, 2, pll_bypass_src_sel, ARRAY_SIZE(pll_bypass_src_sel));
+       clks[IMX7D_PLL_VIDEO_MAIN_SRC] = imx_clk_mux("pll_video_main_src", base + 0x130, 14, 2, pll_bypass_src_sel, ARRAY_SIZE(pll_bypass_src_sel));
+
+       clks[IMX7D_PLL_ARM_MAIN]  = imx_clk_pllv3(IMX_PLLV3_SYS, "pll_arm_main", "pll_arm_main_src", base + 0x60, 0x7f);
+       clks[IMX7D_PLL_DRAM_MAIN] = imx_clk_pllv3(IMX_PLLV3_SYS, "pll_dram_main", "pll_dram_main_src", base + 0x70, 0x7f);
+       clks[IMX7D_PLL_SYS_MAIN]  = imx_clk_pllv3(IMX_PLLV3_GENERIC, "pll_sys_main", "pll_sys_main_src", base + 0xb0, 0x1);
+       clks[IMX7D_PLL_ENET_MAIN] = imx_clk_pllv3(IMX_PLLV3_ENET_IMX7, "pll_enet_main", "pll_enet_main_src", base + 0xe0, 0x0);
+       clks[IMX7D_PLL_AUDIO_MAIN] = imx_clk_pllv3(IMX_PLLV3_AV, "pll_audio_main", "pll_audio_main_src", base + 0xf0, 0x7f);
+       clks[IMX7D_PLL_VIDEO_MAIN] = imx_clk_pllv3(IMX_PLLV3_AV, "pll_video_main", "pll_video_main_src", base + 0x130, 0x7f);
+
+       clks[IMX7D_PLL_ARM_MAIN_BYPASS]  = imx_clk_mux_flags("pll_arm_main_bypass", base + 0x60, 16, 1, pll_arm_bypass_sel, ARRAY_SIZE(pll_arm_bypass_sel), CLK_SET_RATE_PARENT);
+       clks[IMX7D_PLL_DRAM_MAIN_BYPASS] = imx_clk_mux_flags("pll_dram_main_bypass", base + 0x70, 16, 1, pll_dram_bypass_sel, ARRAY_SIZE(pll_dram_bypass_sel), CLK_SET_RATE_PARENT);
+       clks[IMX7D_PLL_SYS_MAIN_BYPASS]  = imx_clk_mux_flags("pll_sys_main_bypass", base + 0xb0, 16, 1, pll_sys_bypass_sel, ARRAY_SIZE(pll_sys_bypass_sel), CLK_SET_RATE_PARENT);
+       clks[IMX7D_PLL_ENET_MAIN_BYPASS] = imx_clk_mux_flags("pll_enet_main_bypass", base + 0xe0, 16, 1, pll_enet_bypass_sel, ARRAY_SIZE(pll_enet_bypass_sel), CLK_SET_RATE_PARENT);
+       clks[IMX7D_PLL_AUDIO_MAIN_BYPASS] = imx_clk_mux_flags("pll_audio_main_bypass", base + 0xf0, 16, 1, pll_audio_bypass_sel, ARRAY_SIZE(pll_audio_bypass_sel), CLK_SET_RATE_PARENT);
+       clks[IMX7D_PLL_VIDEO_MAIN_BYPASS] = imx_clk_mux_flags("pll_video_main_bypass", base + 0x130, 16, 1, pll_video_bypass_sel, ARRAY_SIZE(pll_video_bypass_sel), CLK_SET_RATE_PARENT);
+
+       clk_set_parent(clks[IMX7D_PLL_ARM_MAIN_BYPASS], clks[IMX7D_PLL_ARM_MAIN]);
+       clk_set_parent(clks[IMX7D_PLL_DRAM_MAIN_BYPASS], clks[IMX7D_PLL_DRAM_MAIN]);
+       clk_set_parent(clks[IMX7D_PLL_SYS_MAIN_BYPASS], clks[IMX7D_PLL_SYS_MAIN]);
+       clk_set_parent(clks[IMX7D_PLL_ENET_MAIN_BYPASS], clks[IMX7D_PLL_ENET_MAIN]);
+       clk_set_parent(clks[IMX7D_PLL_AUDIO_MAIN_BYPASS], clks[IMX7D_PLL_AUDIO_MAIN]);
+       clk_set_parent(clks[IMX7D_PLL_VIDEO_MAIN_BYPASS], clks[IMX7D_PLL_VIDEO_MAIN]);
+
+       clks[IMX7D_PLL_ARM_MAIN_CLK] = imx_clk_gate("pll_arm_main_clk", "pll_arm_main_bypass", base + 0x60, 13);
+       clks[IMX7D_PLL_DRAM_MAIN_CLK] = imx_clk_gate("pll_dram_main_clk", "pll_dram_main_bypass", base + 0x70, 13);
+       clks[IMX7D_PLL_SYS_MAIN_CLK] = imx_clk_gate("pll_sys_main_clk", "pll_sys_main_bypass", base + 0xb0, 13);
+       clks[IMX7D_PLL_AUDIO_MAIN_CLK] = imx_clk_gate("pll_audio_main_clk", "pll_audio_main_bypass", base + 0xf0, 13);
+       clks[IMX7D_PLL_VIDEO_MAIN_CLK] = imx_clk_gate("pll_video_main_clk", "pll_video_main_bypass", base + 0x130, 13);
+
+       clks[IMX7D_PLL_SYS_PFD0_392M_CLK] = imx_clk_pfd("pll_sys_pfd0_392m_clk", "pll_sys_main_clk", base + 0xc0, 0);
+       clks[IMX7D_PLL_SYS_PFD1_332M_CLK] = imx_clk_pfd("pll_sys_pfd1_332m_clk", "pll_sys_main_clk", base + 0xc0, 1);
+       clks[IMX7D_PLL_SYS_PFD2_270M_CLK] = imx_clk_pfd("pll_sys_pfd2_270m_clk", "pll_sys_main_clk", base + 0xc0, 2);
+
+       clks[IMX7D_PLL_SYS_PFD3_CLK] = imx_clk_pfd("pll_sys_pfd3_clk", "pll_sys_main_clk", base + 0xc0, 3);
+       clks[IMX7D_PLL_SYS_PFD4_CLK] = imx_clk_pfd("pll_sys_pfd4_clk", "pll_sys_main_clk", base + 0xd0, 0);
+       clks[IMX7D_PLL_SYS_PFD5_CLK] = imx_clk_pfd("pll_sys_pfd5_clk", "pll_sys_main_clk", base + 0xd0, 1);
+       clks[IMX7D_PLL_SYS_PFD6_CLK] = imx_clk_pfd("pll_sys_pfd6_clk", "pll_sys_main_clk", base + 0xd0, 2);
+       clks[IMX7D_PLL_SYS_PFD7_CLK] = imx_clk_pfd("pll_sys_pfd7_clk", "pll_sys_main_clk", base + 0xd0, 3);
+
+       clks[IMX7D_PLL_SYS_MAIN_480M] = imx_clk_fixed_factor("pll_sys_main_480m", "pll_sys_main_clk", 1, 1);
+       clks[IMX7D_PLL_SYS_MAIN_240M] = imx_clk_fixed_factor("pll_sys_main_240m", "pll_sys_main_clk", 1, 2);
+       clks[IMX7D_PLL_SYS_MAIN_120M] = imx_clk_fixed_factor("pll_sys_main_120m", "pll_sys_main_clk", 1, 4);
+       clks[IMX7D_PLL_DRAM_MAIN_533M] = imx_clk_fixed_factor("pll_dram_533m", "pll_dram_main_clk", 1, 2);
+
+       clks[IMX7D_PLL_SYS_MAIN_480M_CLK] = imx_clk_gate_dis("pll_sys_main_480m_clk", "pll_sys_main_480m", base + 0xb0, 4);
+       clks[IMX7D_PLL_SYS_MAIN_240M_CLK] = imx_clk_gate_dis("pll_sys_main_240m_clk", "pll_sys_main_240m", base + 0xb0, 5);
+       clks[IMX7D_PLL_SYS_MAIN_120M_CLK] = imx_clk_gate_dis("pll_sys_main_120m_clk", "pll_sys_main_120m", base + 0xb0, 6);
+       clks[IMX7D_PLL_DRAM_MAIN_533M_CLK] = imx_clk_gate("pll_dram_533m_clk", "pll_dram_533m", base + 0x70, 12);
+
+       clks[IMX7D_PLL_SYS_PFD0_196M] = imx_clk_fixed_factor("pll_sys_pfd0_196m", "pll_sys_pfd0_392m_clk", 1, 2);
+       clks[IMX7D_PLL_SYS_PFD1_166M] = imx_clk_fixed_factor("pll_sys_pfd1_166m", "pll_sys_pfd1_332m_clk", 1, 2);
+       clks[IMX7D_PLL_SYS_PFD2_135M] = imx_clk_fixed_factor("pll_sys_pfd2_135m", "pll_sys_pfd2_270m_clk", 1, 2);
+
+       clks[IMX7D_PLL_SYS_PFD0_196M_CLK] = imx_clk_gate_dis("pll_sys_pfd0_196m_clk", "pll_sys_pfd0_196m", base + 0xb0, 26);
+       clks[IMX7D_PLL_SYS_PFD1_166M_CLK] = imx_clk_gate_dis("pll_sys_pfd1_166m_clk", "pll_sys_pfd1_166m", base + 0xb0, 27);
+       clks[IMX7D_PLL_SYS_PFD2_135M_CLK] = imx_clk_gate_dis("pll_sys_pfd2_135m_clk", "pll_sys_pfd2_135m", base + 0xb0, 28);
+
+       clks[IMX7D_PLL_ENET_MAIN_CLK] = imx_clk_fixed_factor("pll_enet_main_clk", "pll_enet_main_bypass", 1, 1);
+       clks[IMX7D_PLL_ENET_MAIN_500M] = imx_clk_fixed_factor("pll_enet_500m", "pll_enet_main_clk", 1, 2);
+       clks[IMX7D_PLL_ENET_MAIN_250M] = imx_clk_fixed_factor("pll_enet_250m", "pll_enet_main_clk", 1, 4);
+       clks[IMX7D_PLL_ENET_MAIN_125M] = imx_clk_fixed_factor("pll_enet_125m", "pll_enet_main_clk", 1, 8);
+       clks[IMX7D_PLL_ENET_MAIN_100M] = imx_clk_fixed_factor("pll_enet_100m", "pll_enet_main_clk", 1, 10);
+       clks[IMX7D_PLL_ENET_MAIN_50M] = imx_clk_fixed_factor("pll_enet_50m", "pll_enet_main_clk", 1, 20);
+       clks[IMX7D_PLL_ENET_MAIN_40M] = imx_clk_fixed_factor("pll_enet_40m", "pll_enet_main_clk", 1, 25);
+       clks[IMX7D_PLL_ENET_MAIN_25M] = imx_clk_fixed_factor("pll_enet_25m", "pll_enet_main_clk", 1, 40);
+
+       clks[IMX7D_PLL_ENET_MAIN_500M_CLK] = imx_clk_gate("pll_enet_500m_clk", "pll_enet_500m", base + 0xe0, 12);
+       clks[IMX7D_PLL_ENET_MAIN_250M_CLK] = imx_clk_gate("pll_enet_250m_clk", "pll_enet_250m", base + 0xe0, 11);
+       clks[IMX7D_PLL_ENET_MAIN_125M_CLK] = imx_clk_gate("pll_enet_125m_clk", "pll_enet_125m", base + 0xe0, 10);
+       clks[IMX7D_PLL_ENET_MAIN_100M_CLK] = imx_clk_gate("pll_enet_100m_clk", "pll_enet_100m", base + 0xe0, 9);
+       clks[IMX7D_PLL_ENET_MAIN_50M_CLK]  = imx_clk_gate("pll_enet_50m_clk", "pll_enet_50m", base + 0xe0, 8);
+       clks[IMX7D_PLL_ENET_MAIN_40M_CLK]  = imx_clk_gate("pll_enet_40m_clk", "pll_enet_40m", base + 0xe0, 7);
+       clks[IMX7D_PLL_ENET_MAIN_25M_CLK]  = imx_clk_gate("pll_enet_25m_clk", "pll_enet_25m", base + 0xe0, 6);
+
+       clks[IMX7D_LVDS1_OUT_SEL] = imx_clk_mux("lvds1_sel", base + 0x170, 0, 5, lvds1_sel, ARRAY_SIZE(lvds1_sel));
+       clks[IMX7D_LVDS1_OUT_CLK] = imx_clk_gate_exclusive("lvds1_out", "lvds1_sel", base + 0x170, 5, BIT(6));
+
+       np = ccm_node;
+       base = of_iomap(np, 0);
+       WARN_ON(!base);
+
+       clks[IMX7D_ARM_A7_ROOT_SRC] = imx_clk_mux("arm_a7_src", base + 0x8000, 24, 3, arm_a7_sel, ARRAY_SIZE(arm_a7_sel));
+       clks[IMX7D_ARM_M4_ROOT_SRC] = imx_clk_mux("arm_m4_src", base + 0x8080, 24, 3, arm_m4_sel, ARRAY_SIZE(arm_m4_sel));
+       clks[IMX7D_ARM_M0_ROOT_SRC] = imx_clk_mux("arm_m0_src", base + 0x8100, 24, 3, arm_m0_sel, ARRAY_SIZE(arm_m0_sel));
+       clks[IMX7D_MAIN_AXI_ROOT_SRC] = imx_clk_mux("axi_src", base + 0x8800, 24, 3, axi_sel, ARRAY_SIZE(axi_sel));
+       clks[IMX7D_DISP_AXI_ROOT_SRC] = imx_clk_mux("disp_axi_src", base + 0x8880, 24, 3, disp_axi_sel, ARRAY_SIZE(disp_axi_sel));
+       clks[IMX7D_ENET_AXI_ROOT_SRC] = imx_clk_mux("enet_axi_src", base + 0x8900, 24, 3, enet_axi_sel, ARRAY_SIZE(enet_axi_sel));
+       clks[IMX7D_NAND_USDHC_BUS_ROOT_SRC] = imx_clk_mux("nand_usdhc_src", base + 0x8980, 24, 3, nand_usdhc_bus_sel, ARRAY_SIZE(nand_usdhc_bus_sel));
+       clks[IMX7D_AHB_CHANNEL_ROOT_SRC] = imx_clk_mux("ahb_src", base + 0x9000, 24, 3, ahb_channel_sel, ARRAY_SIZE(ahb_channel_sel));
+       clks[IMX7D_DRAM_PHYM_ROOT_SRC] = imx_clk_mux("dram_phym_src", base + 0x9800, 24, 1, dram_phym_sel, ARRAY_SIZE(dram_phym_sel));
+       clks[IMX7D_DRAM_ROOT_SRC] = imx_clk_mux("dram_src", base + 0x9880, 24, 1, dram_sel, ARRAY_SIZE(dram_sel));
+       clks[IMX7D_DRAM_PHYM_ALT_ROOT_SRC] = imx_clk_mux("dram_phym_alt_src", base + 0xa000, 24, 3, dram_phym_alt_sel, ARRAY_SIZE(dram_phym_alt_sel));
+       clks[IMX7D_DRAM_ALT_ROOT_SRC]  = imx_clk_mux("dram_alt_src", base + 0xa080, 24, 3, dram_alt_sel, ARRAY_SIZE(dram_alt_sel));
+       clks[IMX7D_USB_HSIC_ROOT_SRC] = imx_clk_mux("usb_hsic_src", base + 0xa100, 24, 3, usb_hsic_sel, ARRAY_SIZE(usb_hsic_sel));
+       clks[IMX7D_PCIE_CTRL_ROOT_SRC] = imx_clk_mux("pcie_ctrl_src", base + 0xa180, 24, 3, pcie_ctrl_sel, ARRAY_SIZE(pcie_ctrl_sel));
+       clks[IMX7D_PCIE_PHY_ROOT_SRC] = imx_clk_mux("pcie_phy_src", base + 0xa200, 24, 3, pcie_phy_sel, ARRAY_SIZE(pcie_phy_sel));
+       clks[IMX7D_EPDC_PIXEL_ROOT_SRC] = imx_clk_mux("epdc_pixel_src", base + 0xa280, 24, 3, epdc_pixel_sel, ARRAY_SIZE(epdc_pixel_sel));
+       clks[IMX7D_LCDIF_PIXEL_ROOT_SRC] = imx_clk_mux("lcdif_pixel_src", base + 0xa300, 24, 3, lcdif_pixel_sel, ARRAY_SIZE(lcdif_pixel_sel));
+       clks[IMX7D_MIPI_DSI_ROOT_SRC] = imx_clk_mux("mipi_dsi_src", base + 0xa380, 24, 3,  mipi_dsi_sel, ARRAY_SIZE(mipi_dsi_sel));
+       clks[IMX7D_MIPI_CSI_ROOT_SRC] = imx_clk_mux("mipi_csi_src", base + 0xa400, 24, 3, mipi_csi_sel, ARRAY_SIZE(mipi_csi_sel));
+       clks[IMX7D_MIPI_DPHY_ROOT_SRC] = imx_clk_mux("mipi_dphy_src", base + 0xa480, 24, 3, mipi_dphy_sel, ARRAY_SIZE(mipi_dphy_sel));
+       clks[IMX7D_SAI1_ROOT_SRC] = imx_clk_mux("sai1_src", base + 0xa500, 24, 3, sai1_sel, ARRAY_SIZE(sai1_sel));
+       clks[IMX7D_SAI2_ROOT_SRC] = imx_clk_mux("sai2_src", base + 0xa580, 24, 3, sai2_sel, ARRAY_SIZE(sai2_sel));
+       clks[IMX7D_SAI3_ROOT_SRC] = imx_clk_mux("sai3_src", base + 0xa600, 24, 3, sai3_sel, ARRAY_SIZE(sai3_sel));
+       clks[IMX7D_SPDIF_ROOT_SRC] = imx_clk_mux("spdif_src", base + 0xa680, 24, 3, spdif_sel, ARRAY_SIZE(spdif_sel));
+       clks[IMX7D_ENET1_REF_ROOT_SRC] = imx_clk_mux("enet1_ref_src", base + 0xa700, 24, 3, enet1_ref_sel, ARRAY_SIZE(enet1_ref_sel));
+       clks[IMX7D_ENET1_TIME_ROOT_SRC] = imx_clk_mux("enet1_time_src", base + 0xa780, 24, 3, enet1_time_sel, ARRAY_SIZE(enet1_time_sel));
+       clks[IMX7D_ENET2_REF_ROOT_SRC] = imx_clk_mux("enet2_ref_src", base + 0xa800, 24, 3, enet2_ref_sel, ARRAY_SIZE(enet2_ref_sel));
+       clks[IMX7D_ENET2_TIME_ROOT_SRC] = imx_clk_mux("enet2_time_src", base + 0xa880, 24, 3, enet2_time_sel, ARRAY_SIZE(enet2_time_sel));
+       clks[IMX7D_ENET_PHY_REF_ROOT_SRC] = imx_clk_mux("enet_phy_ref_src", base + 0xa900, 24, 3, enet_phy_ref_sel, ARRAY_SIZE(enet_phy_ref_sel));
+       clks[IMX7D_EIM_ROOT_SRC] = imx_clk_mux("eim_src", base + 0xa980, 24, 3, eim_sel, ARRAY_SIZE(eim_sel));
+       clks[IMX7D_NAND_ROOT_SRC] = imx_clk_mux("nand_src", base + 0xaa00, 24, 3, nand_sel, ARRAY_SIZE(nand_sel));
+       clks[IMX7D_QSPI_ROOT_SRC] = imx_clk_mux("qspi_src", base + 0xaa80, 24, 3, qspi_sel, ARRAY_SIZE(qspi_sel));
+       clks[IMX7D_USDHC1_ROOT_SRC] = imx_clk_mux("usdhc1_src", base + 0xab00, 24, 3, usdhc1_sel, ARRAY_SIZE(usdhc1_sel));
+       clks[IMX7D_USDHC2_ROOT_SRC] = imx_clk_mux("usdhc2_src", base + 0xab80, 24, 3, usdhc2_sel, ARRAY_SIZE(usdhc2_sel));
+       clks[IMX7D_USDHC3_ROOT_SRC] = imx_clk_mux("usdhc3_src", base + 0xac00, 24, 3, usdhc3_sel, ARRAY_SIZE(usdhc3_sel));
+       clks[IMX7D_CAN1_ROOT_SRC] = imx_clk_mux("can1_src", base + 0xac80, 24, 3, can1_sel, ARRAY_SIZE(can1_sel));
+       clks[IMX7D_CAN2_ROOT_SRC] = imx_clk_mux("can2_src", base + 0xad00, 24, 3, can2_sel, ARRAY_SIZE(can2_sel));
+       clks[IMX7D_I2C1_ROOT_SRC] = imx_clk_mux("i2c1_src", base + 0xad80, 24, 3, i2c1_sel, ARRAY_SIZE(i2c1_sel));
+       clks[IMX7D_I2C2_ROOT_SRC] = imx_clk_mux("i2c2_src", base + 0xae00, 24, 3, i2c2_sel, ARRAY_SIZE(i2c2_sel));
+       clks[IMX7D_I2C3_ROOT_SRC] = imx_clk_mux("i2c3_src", base + 0xae80, 24, 3, i2c3_sel, ARRAY_SIZE(i2c3_sel));
+       clks[IMX7D_I2C4_ROOT_SRC] = imx_clk_mux("i2c4_src", base + 0xaf00, 24, 3, i2c4_sel, ARRAY_SIZE(i2c4_sel));
+       clks[IMX7D_UART1_ROOT_SRC] = imx_clk_mux("uart1_src", base + 0xaf80, 24, 3, uart1_sel, ARRAY_SIZE(uart1_sel));
+       clks[IMX7D_UART2_ROOT_SRC] = imx_clk_mux("uart2_src", base + 0xb000, 24, 3, uart2_sel, ARRAY_SIZE(uart2_sel));
+       clks[IMX7D_UART3_ROOT_SRC] = imx_clk_mux("uart3_src", base + 0xb080, 24, 3, uart3_sel, ARRAY_SIZE(uart3_sel));
+       clks[IMX7D_UART4_ROOT_SRC] = imx_clk_mux("uart4_src", base + 0xb100, 24, 3, uart4_sel, ARRAY_SIZE(uart4_sel));
+       clks[IMX7D_UART5_ROOT_SRC] = imx_clk_mux("uart5_src", base + 0xb180, 24, 3, uart5_sel, ARRAY_SIZE(uart5_sel));
+       clks[IMX7D_UART6_ROOT_SRC] = imx_clk_mux("uart6_src", base + 0xb200, 24, 3, uart6_sel, ARRAY_SIZE(uart6_sel));
+       clks[IMX7D_UART7_ROOT_SRC] = imx_clk_mux("uart7_src", base + 0xb280, 24, 3, uart7_sel, ARRAY_SIZE(uart7_sel));
+       clks[IMX7D_ECSPI1_ROOT_SRC] = imx_clk_mux("ecspi1_src", base + 0xb300, 24, 3, ecspi1_sel, ARRAY_SIZE(ecspi1_sel));
+       clks[IMX7D_ECSPI2_ROOT_SRC] = imx_clk_mux("ecspi2_src", base + 0xb380, 24, 3, ecspi2_sel, ARRAY_SIZE(ecspi2_sel));
+       clks[IMX7D_ECSPI3_ROOT_SRC] = imx_clk_mux("ecspi3_src", base + 0xb400, 24, 3, ecspi3_sel, ARRAY_SIZE(ecspi3_sel));
+       clks[IMX7D_ECSPI4_ROOT_SRC] = imx_clk_mux("ecspi4_src", base + 0xb480, 24, 3, ecspi4_sel, ARRAY_SIZE(ecspi4_sel));
+       clks[IMX7D_PWM1_ROOT_SRC] = imx_clk_mux("pwm1_src", base + 0xb500, 24, 3, pwm1_sel, ARRAY_SIZE(pwm1_sel));
+       clks[IMX7D_PWM2_ROOT_SRC] = imx_clk_mux("pwm2_src", base + 0xb580, 24, 3, pwm2_sel, ARRAY_SIZE(pwm2_sel));
+       clks[IMX7D_PWM3_ROOT_SRC] = imx_clk_mux("pwm3_src", base + 0xb600, 24, 3, pwm3_sel, ARRAY_SIZE(pwm3_sel));
+       clks[IMX7D_PWM4_ROOT_SRC] = imx_clk_mux("pwm4_src", base + 0xb680, 24, 3, pwm4_sel, ARRAY_SIZE(pwm4_sel));
+       clks[IMX7D_FLEXTIMER1_ROOT_SRC] = imx_clk_mux("flextimer1_src", base + 0xb700, 24, 3, flextimer1_sel, ARRAY_SIZE(flextimer1_sel));
+       clks[IMX7D_FLEXTIMER2_ROOT_SRC] = imx_clk_mux("flextimer2_src", base + 0xb780, 24, 3, flextimer2_sel, ARRAY_SIZE(flextimer2_sel));
+       clks[IMX7D_SIM1_ROOT_SRC] = imx_clk_mux("sim1_src", base + 0xb800, 24, 3, sim1_sel, ARRAY_SIZE(sim1_sel));
+       clks[IMX7D_SIM2_ROOT_SRC] = imx_clk_mux("sim2_src", base + 0xb880, 24, 3, sim2_sel, ARRAY_SIZE(sim2_sel));
+       clks[IMX7D_GPT1_ROOT_SRC] = imx_clk_mux("gpt1_src", base + 0xb900, 24, 3, gpt1_sel, ARRAY_SIZE(gpt1_sel));
+       clks[IMX7D_GPT2_ROOT_SRC] = imx_clk_mux("gpt2_src", base + 0xb980, 24, 3, gpt2_sel, ARRAY_SIZE(gpt2_sel));
+       clks[IMX7D_GPT3_ROOT_SRC] = imx_clk_mux("gpt3_src", base + 0xba00, 24, 3, gpt3_sel, ARRAY_SIZE(gpt3_sel));
+       clks[IMX7D_GPT4_ROOT_SRC] = imx_clk_mux("gpt4_src", base + 0xba80, 24, 3, gpt4_sel, ARRAY_SIZE(gpt4_sel));
+       clks[IMX7D_TRACE_ROOT_SRC] = imx_clk_mux("trace_src", base + 0xbb00, 24, 3, trace_sel, ARRAY_SIZE(trace_sel));
+       clks[IMX7D_WDOG_ROOT_SRC] = imx_clk_mux("wdog_src", base + 0xbb80, 24, 3, wdog_sel, ARRAY_SIZE(wdog_sel));
+       clks[IMX7D_CSI_MCLK_ROOT_SRC] = imx_clk_mux("csi_mclk_src", base + 0xbc00, 24, 3, csi_mclk_sel, ARRAY_SIZE(csi_mclk_sel));
+       clks[IMX7D_AUDIO_MCLK_ROOT_SRC] = imx_clk_mux("audio_mclk_src", base + 0xbc80, 24, 3, audio_mclk_sel, ARRAY_SIZE(audio_mclk_sel));
+       clks[IMX7D_WRCLK_ROOT_SRC] = imx_clk_mux("wrclk_src", base + 0xbd00, 24, 3, wrclk_sel, ARRAY_SIZE(wrclk_sel));
+       clks[IMX7D_CLKO1_ROOT_SRC] = imx_clk_mux("clko1_src", base + 0xbd80, 24, 3, clko1_sel, ARRAY_SIZE(clko1_sel));
+       clks[IMX7D_CLKO2_ROOT_SRC] = imx_clk_mux("clko2_src", base + 0xbe00, 24, 3, clko2_sel, ARRAY_SIZE(clko2_sel));
+
+       clks[IMX7D_ARM_A7_ROOT_CG] = imx_clk_gate("arm_a7_cg", "arm_a7_src", base + 0x8000, 28);
+       clks[IMX7D_ARM_M4_ROOT_CG] = imx_clk_gate("arm_m4_cg", "arm_m4_src", base + 0x8080, 28);
+       clks[IMX7D_ARM_M0_ROOT_CG] = imx_clk_gate("arm_m0_cg", "arm_m0_src", base + 0x8100, 28);
+       clks[IMX7D_MAIN_AXI_ROOT_CG] = imx_clk_gate("axi_cg", "axi_src", base + 0x8800, 28);
+       clks[IMX7D_DISP_AXI_ROOT_CG] = imx_clk_gate("disp_axi_cg", "disp_axi_src", base + 0x8880, 28);
+       clks[IMX7D_ENET_AXI_ROOT_CG] = imx_clk_gate("enet_axi_cg", "enet_axi_src", base + 0x8900, 28);
+       clks[IMX7D_NAND_USDHC_BUS_ROOT_CG] = imx_clk_gate("nand_usdhc_cg", "nand_usdhc_src", base + 0x8980, 28);
+       clks[IMX7D_AHB_CHANNEL_ROOT_CG] = imx_clk_gate("ahb_cg", "ahb_src", base + 0x9000, 28);
+       clks[IMX7D_DRAM_PHYM_ROOT_CG] = imx_clk_gate("dram_phym_cg", "dram_phym_src", base + 0x9800, 28);
+       clks[IMX7D_DRAM_ROOT_CG] = imx_clk_gate("dram_cg", "dram_src", base + 0x9880, 28);
+       clks[IMX7D_DRAM_PHYM_ALT_ROOT_CG] = imx_clk_gate("dram_phym_alt_cg", "dram_phym_alt_src", base + 0xa000, 28);
+       clks[IMX7D_DRAM_ALT_ROOT_CG] = imx_clk_gate("dram_alt_cg", "dram_alt_src", base + 0xa080, 28);
+       clks[IMX7D_USB_HSIC_ROOT_CG] = imx_clk_gate("usb_hsic_cg", "usb_hsic_src", base + 0xa100, 28);
+       clks[IMX7D_PCIE_CTRL_ROOT_CG] = imx_clk_gate("pcie_ctrl_cg", "pcie_ctrl_src", base + 0xa180, 28);
+       clks[IMX7D_PCIE_PHY_ROOT_CG] = imx_clk_gate("pcie_phy_cg", "pcie_phy_src", base + 0xa200, 28);
+       clks[IMX7D_EPDC_PIXEL_ROOT_CG] = imx_clk_gate("epdc_pixel_cg", "epdc_pixel_src", base + 0xa280, 28);
+       clks[IMX7D_LCDIF_PIXEL_ROOT_CG] = imx_clk_gate("lcdif_pixel_cg", "lcdif_pixel_src", base + 0xa300, 28);
+       clks[IMX7D_MIPI_DSI_ROOT_CG] = imx_clk_gate("mipi_dsi_cg", "mipi_dsi_src", base + 0xa380, 28);
+       clks[IMX7D_MIPI_CSI_ROOT_CG] = imx_clk_gate("mipi_csi_cg", "mipi_csi_src", base + 0xa400, 28);
+       clks[IMX7D_MIPI_DPHY_ROOT_CG] = imx_clk_gate("mipi_dphy_cg", "mipi_dphy_src", base + 0xa480, 28);
+       clks[IMX7D_SAI1_ROOT_CG] = imx_clk_gate("sai1_cg", "sai1_src", base + 0xa500, 28);
+       clks[IMX7D_SAI2_ROOT_CG] = imx_clk_gate("sai2_cg", "sai2_src", base + 0xa580, 28);
+       clks[IMX7D_SAI3_ROOT_CG] = imx_clk_gate("sai3_cg", "sai3_src", base + 0xa600, 28);
+       clks[IMX7D_SPDIF_ROOT_CG] = imx_clk_gate("spdif_cg", "spdif_src", base + 0xa680, 28);
+       clks[IMX7D_ENET1_REF_ROOT_CG] = imx_clk_gate("enet1_ref_cg", "enet1_ref_src", base + 0xa700, 28);
+       clks[IMX7D_ENET1_TIME_ROOT_CG] = imx_clk_gate("enet1_time_cg", "enet1_time_src", base + 0xa780, 28);
+       clks[IMX7D_ENET2_REF_ROOT_CG] = imx_clk_gate("enet2_ref_cg", "enet2_ref_src", base + 0xa800, 28);
+       clks[IMX7D_ENET2_TIME_ROOT_CG] = imx_clk_gate("enet2_time_cg", "enet2_time_src", base + 0xa880, 28);
+       clks[IMX7D_ENET_PHY_REF_ROOT_CG] = imx_clk_gate("enet_phy_ref_cg", "enet_phy_ref_src", base + 0xa900, 28);
+       clks[IMX7D_EIM_ROOT_CG] = imx_clk_gate("eim_cg", "eim_src", base + 0xa980, 28);
+       clks[IMX7D_NAND_ROOT_CG] = imx_clk_gate("nand_cg", "nand_src", base + 0xaa00, 28);
+       clks[IMX7D_QSPI_ROOT_CG] = imx_clk_gate("qspi_cg", "qspi_src", base + 0xaa80, 28);
+       clks[IMX7D_USDHC1_ROOT_CG] = imx_clk_gate("usdhc1_cg", "usdhc1_src", base + 0xab00, 28);
+       clks[IMX7D_USDHC2_ROOT_CG] = imx_clk_gate("usdhc2_cg", "usdhc2_src", base + 0xab80, 28);
+       clks[IMX7D_USDHC3_ROOT_CG] = imx_clk_gate("usdhc3_cg", "usdhc3_src", base + 0xac00, 28);
+       clks[IMX7D_CAN1_ROOT_CG] = imx_clk_gate("can1_cg", "can1_src", base + 0xac80, 28);
+       clks[IMX7D_CAN2_ROOT_CG] = imx_clk_gate("can2_cg", "can2_src", base + 0xad00, 28);
+       clks[IMX7D_I2C1_ROOT_CG] = imx_clk_gate("i2c1_cg", "i2c1_src", base + 0xad80, 28);
+       clks[IMX7D_I2C2_ROOT_CG] = imx_clk_gate("i2c2_cg", "i2c2_src", base + 0xae00, 28);
+       clks[IMX7D_I2C3_ROOT_CG] = imx_clk_gate("i2c3_cg", "i2c3_src", base + 0xae80, 28);
+       clks[IMX7D_I2C4_ROOT_CG] = imx_clk_gate("i2c4_cg", "i2c4_src", base + 0xaf00, 28);
+       clks[IMX7D_UART1_ROOT_CG] = imx_clk_gate("uart1_cg", "uart1_src", base + 0xaf80, 28);
+       clks[IMX7D_UART2_ROOT_CG] = imx_clk_gate("uart2_cg", "uart2_src", base + 0xb000, 28);
+       clks[IMX7D_UART3_ROOT_CG] = imx_clk_gate("uart3_cg", "uart3_src", base + 0xb080, 28);
+       clks[IMX7D_UART4_ROOT_CG] = imx_clk_gate("uart4_cg", "uart4_src", base + 0xb100, 28);
+       clks[IMX7D_UART5_ROOT_CG] = imx_clk_gate("uart5_cg", "uart5_src", base + 0xb180, 28);
+       clks[IMX7D_UART6_ROOT_CG] = imx_clk_gate("uart6_cg", "uart6_src", base + 0xb200, 28);
+       clks[IMX7D_UART7_ROOT_CG] = imx_clk_gate("uart7_cg", "uart7_src", base + 0xb280, 28);
+       clks[IMX7D_ECSPI1_ROOT_CG] = imx_clk_gate("ecspi1_cg", "ecspi1_src", base + 0xb300, 28);
+       clks[IMX7D_ECSPI2_ROOT_CG] = imx_clk_gate("ecspi2_cg", "ecspi2_src", base + 0xb380, 28);
+       clks[IMX7D_ECSPI3_ROOT_CG] = imx_clk_gate("ecspi3_cg", "ecspi3_src", base + 0xb400, 28);
+       clks[IMX7D_ECSPI4_ROOT_CG] = imx_clk_gate("ecspi4_cg", "ecspi4_src", base + 0xb480, 28);
+       clks[IMX7D_PWM1_ROOT_CG] = imx_clk_gate("pwm1_cg", "pwm1_src", base + 0xb500, 28);
+       clks[IMX7D_PWM2_ROOT_CG] = imx_clk_gate("pwm2_cg", "pwm2_src", base + 0xb580, 28);
+       clks[IMX7D_PWM3_ROOT_CG] = imx_clk_gate("pwm3_cg", "pwm3_src", base + 0xb600, 28);
+       clks[IMX7D_PWM4_ROOT_CG] = imx_clk_gate("pwm4_cg", "pwm4_src", base + 0xb680, 28);
+       clks[IMX7D_FLEXTIMER1_ROOT_CG] = imx_clk_gate("flextimer1_cg", "flextimer1_src", base + 0xb700, 28);
+       clks[IMX7D_FLEXTIMER2_ROOT_CG] = imx_clk_gate("flextimer2_cg", "flextimer2_src", base + 0xb780, 28);
+       clks[IMX7D_SIM1_ROOT_CG] = imx_clk_gate("sim1_cg", "sim1_src", base + 0xb800, 28);
+       clks[IMX7D_SIM2_ROOT_CG] = imx_clk_gate("sim2_cg", "sim2_src", base + 0xb880, 28);
+       clks[IMX7D_GPT1_ROOT_CG] = imx_clk_gate("gpt1_cg", "gpt1_src", base + 0xb900, 28);
+       clks[IMX7D_GPT2_ROOT_CG] = imx_clk_gate("gpt2_cg", "gpt2_src", base + 0xb980, 28);
+       clks[IMX7D_GPT3_ROOT_CG] = imx_clk_gate("gpt3_cg", "gpt3_src", base + 0xbA00, 28);
+       clks[IMX7D_GPT4_ROOT_CG] = imx_clk_gate("gpt4_cg", "gpt4_src", base + 0xbA80, 28);
+       clks[IMX7D_TRACE_ROOT_CG] = imx_clk_gate("trace_cg", "trace_src", base + 0xbb00, 28);
+       clks[IMX7D_WDOG_ROOT_CG] = imx_clk_gate("wdog_cg", "wdog_src", base + 0xbb80, 28);
+       clks[IMX7D_CSI_MCLK_ROOT_CG] = imx_clk_gate("csi_mclk_cg", "csi_mclk_src", base + 0xbc00, 28);
+       clks[IMX7D_AUDIO_MCLK_ROOT_CG] = imx_clk_gate("audio_mclk_cg", "audio_mclk_src", base + 0xbc80, 28);
+       clks[IMX7D_WRCLK_ROOT_CG] = imx_clk_gate("wrclk_cg", "wrclk_src", base + 0xbd00, 28);
+       clks[IMX7D_CLKO1_ROOT_CG] = imx_clk_gate("clko1_cg", "clko1_src", base + 0xbd80, 28);
+       clks[IMX7D_CLKO2_ROOT_CG] = imx_clk_gate("clko2_cg", "clko2_src", base + 0xbe00, 28);
+
+       clks[IMX7D_MAIN_AXI_ROOT_PRE_DIV] = imx_clk_divider("axi_pre_div", "axi_cg", base + 0x8800, 16, 3);
+       clks[IMX7D_DISP_AXI_ROOT_PRE_DIV] = imx_clk_divider("disp_axi_pre_div", "disp_axi_cg", base + 0x8880, 16, 3);
+       clks[IMX7D_ENET_AXI_ROOT_PRE_DIV] = imx_clk_divider("enet_axi_pre_div", "enet_axi_cg", base + 0x8900, 16, 3);
+       clks[IMX7D_NAND_USDHC_BUS_ROOT_PRE_DIV] = imx_clk_divider("nand_usdhc_pre_div", "nand_usdhc_cg", base + 0x8980, 16, 3);
+       clks[IMX7D_AHB_CHANNEL_ROOT_PRE_DIV] = imx_clk_divider("ahb_pre_div", "ahb_cg", base + 0x9000, 16, 3);
+       clks[IMX7D_DRAM_PHYM_ALT_ROOT_PRE_DIV] = imx_clk_divider("dram_phym_alt_pre_div", "dram_phym_alt_cg", base + 0xa000, 16, 3);
+       clks[IMX7D_DRAM_ALT_ROOT_PRE_DIV] = imx_clk_divider("dram_alt_pre_div", "dram_alt_cg", base + 0xa080, 16, 3);
+       clks[IMX7D_USB_HSIC_ROOT_PRE_DIV] = imx_clk_divider("usb_hsic_pre_div", "usb_hsic_cg", base + 0xa100, 16, 3);
+       clks[IMX7D_PCIE_CTRL_ROOT_PRE_DIV] = imx_clk_divider("pcie_ctrl_pre_div", "pcie_ctrl_cg", base + 0xa180, 16, 3);
+       clks[IMX7D_PCIE_PHY_ROOT_PRE_DIV] = imx_clk_divider("pcie_phy_pre_div", "pcie_phy_cg", base + 0xa200, 16, 3);
+       clks[IMX7D_EPDC_PIXEL_ROOT_PRE_DIV] = imx_clk_divider("epdc_pixel_pre_div", "epdc_pixel_cg", base + 0xa280, 16, 3);
+       clks[IMX7D_LCDIF_PIXEL_ROOT_PRE_DIV] = imx_clk_divider("lcdif_pixel_pre_div", "lcdif_pixel_cg", base + 0xa300, 16, 3);
+       clks[IMX7D_MIPI_DSI_ROOT_PRE_DIV] = imx_clk_divider("mipi_dsi_pre_div", "mipi_dsi_cg", base + 0xa380, 16, 3);
+       clks[IMX7D_MIPI_CSI_ROOT_PRE_DIV] = imx_clk_divider("mipi_csi_pre_div", "mipi_csi_cg", base + 0xa400, 16, 3);
+       clks[IMX7D_MIPI_DPHY_ROOT_PRE_DIV] = imx_clk_divider("mipi_dphy_pre_div", "mipi_dphy_cg", base + 0xa480, 16, 3);
+       clks[IMX7D_SAI1_ROOT_PRE_DIV] = imx_clk_divider("sai1_pre_div", "sai1_cg", base + 0xa500, 16, 3);
+       clks[IMX7D_SAI2_ROOT_PRE_DIV] = imx_clk_divider("sai2_pre_div", "sai2_cg", base + 0xa580, 16, 3);
+       clks[IMX7D_SAI3_ROOT_PRE_DIV] = imx_clk_divider("sai3_pre_div", "sai3_cg", base + 0xa600, 16, 3);
+       clks[IMX7D_SPDIF_ROOT_PRE_DIV] = imx_clk_divider("spdif_pre_div", "spdif_cg", base + 0xa680, 16, 3);
+       clks[IMX7D_ENET1_REF_ROOT_PRE_DIV] = imx_clk_divider("enet1_ref_pre_div", "enet1_ref_cg", base + 0xa700, 16, 3);
+       clks[IMX7D_ENET1_TIME_ROOT_PRE_DIV] = imx_clk_divider("enet1_time_pre_div", "enet1_time_cg", base + 0xa780, 16, 3);
+       clks[IMX7D_ENET2_REF_ROOT_PRE_DIV] = imx_clk_divider("enet2_ref_pre_div", "enet2_ref_cg", base + 0xa800, 16, 3);
+       clks[IMX7D_ENET2_TIME_ROOT_PRE_DIV] = imx_clk_divider("enet2_time_pre_div", "enet2_time_cg", base + 0xa880, 16, 3);
+       clks[IMX7D_ENET_PHY_REF_ROOT_PRE_DIV] = imx_clk_divider("enet_phy_ref_pre_div", "enet_phy_ref_cg", base + 0xa900, 16, 3);
+       clks[IMX7D_EIM_ROOT_PRE_DIV] = imx_clk_divider("eim_pre_div", "eim_cg", base + 0xa980, 16, 3);
+       clks[IMX7D_NAND_ROOT_PRE_DIV] = imx_clk_divider("nand_pre_div", "nand_cg", base + 0xaa00, 16, 3);
+       clks[IMX7D_QSPI_ROOT_PRE_DIV] = imx_clk_divider("qspi_pre_div", "qspi_cg", base + 0xaa80, 16, 3);
+       clks[IMX7D_USDHC1_ROOT_PRE_DIV] = imx_clk_divider("usdhc1_pre_div", "usdhc1_cg", base + 0xab00, 16, 3);
+       clks[IMX7D_USDHC2_ROOT_PRE_DIV] = imx_clk_divider("usdhc2_pre_div", "usdhc2_cg", base + 0xab80, 16, 3);
+       clks[IMX7D_USDHC3_ROOT_PRE_DIV] = imx_clk_divider("usdhc3_pre_div", "usdhc3_cg", base + 0xac00, 16, 3);
+       clks[IMX7D_CAN1_ROOT_PRE_DIV] = imx_clk_divider("can1_pre_div", "can1_cg", base + 0xac80, 16, 3);
+       clks[IMX7D_CAN2_ROOT_PRE_DIV] = imx_clk_divider("can2_pre_div", "can2_cg", base + 0xad00, 16, 3);
+       clks[IMX7D_I2C1_ROOT_PRE_DIV] = imx_clk_divider("i2c1_pre_div", "i2c1_cg", base + 0xad80, 16, 3);
+       clks[IMX7D_I2C2_ROOT_PRE_DIV] = imx_clk_divider("i2c2_pre_div", "i2c2_cg", base + 0xae00, 16, 3);
+       clks[IMX7D_I2C3_ROOT_PRE_DIV] = imx_clk_divider("i2c3_pre_div", "i2c3_cg", base + 0xae80, 16, 3);
+       clks[IMX7D_I2C4_ROOT_PRE_DIV] = imx_clk_divider("i2c4_pre_div", "i2c4_cg", base + 0xaf00, 16, 3);
+       clks[IMX7D_UART1_ROOT_PRE_DIV] = imx_clk_divider("uart1_pre_div", "uart1_cg", base + 0xaf80, 16, 3);
+       clks[IMX7D_UART2_ROOT_PRE_DIV] = imx_clk_divider("uart2_pre_div", "uart2_cg", base + 0xb000, 16, 3);
+       clks[IMX7D_UART3_ROOT_PRE_DIV] = imx_clk_divider("uart3_pre_div", "uart3_cg", base + 0xb080, 16, 3);
+       clks[IMX7D_UART4_ROOT_PRE_DIV] = imx_clk_divider("uart4_pre_div", "uart4_cg", base + 0xb100, 16, 3);
+       clks[IMX7D_UART5_ROOT_PRE_DIV] = imx_clk_divider("uart5_pre_div", "uart5_cg", base + 0xb180, 16, 3);
+       clks[IMX7D_UART6_ROOT_PRE_DIV] = imx_clk_divider("uart6_pre_div", "uart6_cg", base + 0xb200, 16, 3);
+       clks[IMX7D_UART7_ROOT_PRE_DIV] = imx_clk_divider("uart7_pre_div", "uart7_cg", base + 0xb280, 16, 3);
+       clks[IMX7D_ECSPI1_ROOT_PRE_DIV] = imx_clk_divider("ecspi1_pre_div", "ecspi1_cg", base + 0xb300, 16, 3);
+       clks[IMX7D_ECSPI2_ROOT_PRE_DIV] = imx_clk_divider("ecspi2_pre_div", "ecspi2_cg", base + 0xb380, 16, 3);
+       clks[IMX7D_ECSPI3_ROOT_PRE_DIV] = imx_clk_divider("ecspi3_pre_div", "ecspi3_cg", base + 0xb400, 16, 3);
+       clks[IMX7D_ECSPI4_ROOT_PRE_DIV] = imx_clk_divider("ecspi4_pre_div", "ecspi4_cg", base + 0xb480, 16, 3);
+       clks[IMX7D_PWM1_ROOT_PRE_DIV] = imx_clk_divider("pwm1_pre_div", "pwm1_cg", base + 0xb500, 16, 3);
+       clks[IMX7D_PWM2_ROOT_PRE_DIV] = imx_clk_divider("pwm2_pre_div", "pwm2_cg", base + 0xb580, 16, 3);
+       clks[IMX7D_PWM3_ROOT_PRE_DIV] = imx_clk_divider("pwm3_pre_div", "pwm3_cg", base + 0xb600, 16, 3);
+       clks[IMX7D_PWM4_ROOT_PRE_DIV] = imx_clk_divider("pwm4_pre_div", "pwm4_cg", base + 0xb680, 16, 3);
+       clks[IMX7D_FLEXTIMER1_ROOT_PRE_DIV] = imx_clk_divider("flextimer1_pre_div", "flextimer1_cg", base + 0xb700, 16, 3);
+       clks[IMX7D_FLEXTIMER2_ROOT_PRE_DIV] = imx_clk_divider("flextimer2_pre_div", "flextimer2_cg", base + 0xb780, 16, 3);
+       clks[IMX7D_SIM1_ROOT_PRE_DIV] = imx_clk_divider("sim1_pre_div", "sim1_cg", base + 0xb800, 16, 3);
+       clks[IMX7D_SIM2_ROOT_PRE_DIV] = imx_clk_divider("sim2_pre_div", "sim2_cg", base + 0xb880, 16, 3);
+       clks[IMX7D_GPT1_ROOT_PRE_DIV] = imx_clk_divider("gpt1_pre_div", "gpt1_cg", base + 0xb900, 16, 3);
+       clks[IMX7D_GPT2_ROOT_PRE_DIV] = imx_clk_divider("gpt2_pre_div", "gpt2_cg", base + 0xb980, 16, 3);
+       clks[IMX7D_GPT3_ROOT_PRE_DIV] = imx_clk_divider("gpt3_pre_div", "gpt3_cg", base + 0xba00, 16, 3);
+       clks[IMX7D_GPT4_ROOT_PRE_DIV] = imx_clk_divider("gpt4_pre_div", "gpt4_cg", base + 0xba80, 16, 3);
+       clks[IMX7D_TRACE_ROOT_PRE_DIV] = imx_clk_divider("trace_pre_div", "trace_cg", base + 0xbb00, 16, 3);
+       clks[IMX7D_WDOG_ROOT_PRE_DIV] = imx_clk_divider("wdog_pre_div", "wdog_cg", base + 0xbb80, 16, 3);
+       clks[IMX7D_CSI_MCLK_ROOT_PRE_DIV] = imx_clk_divider("csi_mclk_pre_div", "csi_mclk_cg", base + 0xbc00, 16, 3);
+       clks[IMX7D_AUDIO_MCLK_ROOT_PRE_DIV] = imx_clk_divider("audio_mclk_pre_div", "audio_mclk_cg", base + 0xbc80, 16, 3);
+       clks[IMX7D_WRCLK_ROOT_PRE_DIV] = imx_clk_divider("wrclk_pre_div", "wrclk_cg", base + 0xbd00, 16, 3);
+       clks[IMX7D_CLKO1_ROOT_PRE_DIV] = imx_clk_divider("clko1_pre_div", "clko1_cg", base + 0xbd80, 16, 3);
+       clks[IMX7D_CLKO2_ROOT_PRE_DIV] = imx_clk_divider("clko2_pre_div", "clko2_cg", base + 0xbe00, 16, 3);
+
+       clks[IMX7D_ARM_A7_ROOT_DIV] = imx_clk_divider("arm_a7_div", "arm_a7_cg", base + 0x8000, 0, 3);
+       clks[IMX7D_ARM_M4_ROOT_DIV] = imx_clk_divider("arm_m4_div", "arm_m4_cg", base + 0x8080, 0, 3);
+       clks[IMX7D_ARM_M0_ROOT_DIV] = imx_clk_divider("arm_m0_div", "arm_m0_cg", base + 0x8100, 0, 3);
+       clks[IMX7D_MAIN_AXI_ROOT_DIV] = imx_clk_divider("axi_post_div", "axi_pre_div", base + 0x8800, 0, 6);
+       clks[IMX7D_DISP_AXI_ROOT_DIV] = imx_clk_divider("disp_axi_post_div", "disp_axi_pre_div", base + 0x8880, 0, 6);
+       clks[IMX7D_ENET_AXI_ROOT_DIV] = imx_clk_divider("enet_axi_post_div", "enet_axi_pre_div", base + 0x8900, 0, 6);
+       clks[IMX7D_NAND_USDHC_BUS_ROOT_DIV] = imx_clk_divider("nand_usdhc_post_div", "nand_usdhc_pre_div", base + 0x8980, 0, 6);
+       clks[IMX7D_AHB_CHANNEL_ROOT_DIV] = imx_clk_divider("ahb_post_div", "ahb_pre_div", base + 0x9000, 0, 6);
+       clks[IMX7D_DRAM_ROOT_DIV] = imx_clk_divider("dram_post_div", "dram_cg", base + 0x9880, 0, 3);
+       clks[IMX7D_DRAM_PHYM_ALT_ROOT_DIV] = imx_clk_divider("dram_phym_alt_post_div", "dram_phym_alt_pre_div", base + 0xa000, 0, 3);
+       clks[IMX7D_DRAM_ALT_ROOT_DIV] = imx_clk_divider("dram_alt_post_div", "dram_alt_pre_div", base + 0xa080, 0, 3);
+       clks[IMX7D_USB_HSIC_ROOT_DIV] = imx_clk_divider("usb_hsic_post_div", "usb_hsic_pre_div", base + 0xa100, 0, 6);
+       clks[IMX7D_PCIE_CTRL_ROOT_DIV] = imx_clk_divider("pcie_ctrl_post_div", "pcie_ctrl_pre_div", base + 0xa180, 0, 6);
+       clks[IMX7D_PCIE_PHY_ROOT_DIV] = imx_clk_divider("pcie_phy_post_div", "pcie_phy_pre_div", base + 0xa200, 0, 6);
+       clks[IMX7D_EPDC_PIXEL_ROOT_DIV] = imx_clk_divider("epdc_pixel_post_div", "epdc_pixel_pre_div", base + 0xa280, 0, 6);
+       clks[IMX7D_LCDIF_PIXEL_ROOT_DIV] = imx_clk_divider("lcdif_pixel_post_div", "lcdif_pixel_pre_div", base + 0xa300, 0, 6);
+       clks[IMX7D_MIPI_DSI_ROOT_DIV] = imx_clk_divider("mipi_dsi_post_div", "mipi_dsi_pre_div", base + 0xa380, 0, 6);
+       clks[IMX7D_MIPI_CSI_ROOT_DIV] = imx_clk_divider("mipi_csi_post_div", "mipi_csi_pre_div", base + 0xa400, 0, 6);
+       clks[IMX7D_MIPI_DPHY_ROOT_DIV] = imx_clk_divider("mipi_dphy_post_div", "mipi_csi_dphy_div", base + 0xa480, 0, 6);
+       clks[IMX7D_SAI1_ROOT_DIV] = imx_clk_divider("sai1_post_div", "sai1_pre_div", base + 0xa500, 0, 6);
+       clks[IMX7D_SAI2_ROOT_DIV] = imx_clk_divider("sai2_post_div", "sai2_pre_div", base + 0xa580, 0, 6);
+       clks[IMX7D_SAI3_ROOT_DIV] = imx_clk_divider("sai3_post_div", "sai3_pre_div", base + 0xa600, 0, 6);
+       clks[IMX7D_SPDIF_ROOT_DIV] = imx_clk_divider("spdif_post_div", "spdif_pre_div", base + 0xa680, 0, 6);
+       clks[IMX7D_ENET1_REF_ROOT_DIV] = imx_clk_divider("enet1_ref_post_div", "enet1_ref_pre_div", base + 0xa700, 0, 6);
+       clks[IMX7D_ENET1_TIME_ROOT_DIV] = imx_clk_divider("enet1_time_post_div", "enet1_time_pre_div", base + 0xa780, 0, 6);
+       clks[IMX7D_ENET2_REF_ROOT_DIV] = imx_clk_divider("enet2_ref_post_div", "enet2_ref_pre_div", base + 0xa800, 0, 6);
+       clks[IMX7D_ENET2_TIME_ROOT_DIV] = imx_clk_divider("enet2_time_post_div", "enet2_time_pre_div", base + 0xa880, 0, 6);
+       clks[IMX7D_ENET_PHY_REF_ROOT_DIV] = imx_clk_divider("enet_phy_ref_post_div", "enet_phy_ref_pre_div", base + 0xa900, 0, 6);
+       clks[IMX7D_EIM_ROOT_DIV] = imx_clk_divider("eim_post_div", "eim_pre_div", base + 0xa980, 0, 6);
+       clks[IMX7D_NAND_ROOT_DIV] = imx_clk_divider("nand_post_div", "nand_pre_div", base + 0xaa00, 0, 6);
+       clks[IMX7D_QSPI_ROOT_DIV] = imx_clk_divider("qspi_post_div", "qspi_pre_div", base + 0xaa80, 0, 6);
+       clks[IMX7D_USDHC1_ROOT_DIV] = imx_clk_divider("usdhc1_post_div", "usdhc1_pre_div", base + 0xab00, 0, 6);
+       clks[IMX7D_USDHC2_ROOT_DIV] = imx_clk_divider("usdhc2_post_div", "usdhc2_pre_div", base + 0xab80, 0, 6);
+       clks[IMX7D_USDHC3_ROOT_DIV] = imx_clk_divider("usdhc3_post_div", "usdhc3_pre_div", base + 0xac00, 0, 6);
+       clks[IMX7D_CAN1_ROOT_DIV] = imx_clk_divider("can1_post_div", "can1_pre_div", base + 0xac80, 0, 6);
+       clks[IMX7D_CAN2_ROOT_DIV] = imx_clk_divider("can2_post_div", "can2_pre_div", base + 0xad00, 0, 6);
+       clks[IMX7D_I2C1_ROOT_DIV] = imx_clk_divider("i2c1_post_div", "i2c1_pre_div", base + 0xad80, 0, 6);
+       clks[IMX7D_I2C2_ROOT_DIV] = imx_clk_divider("i2c2_post_div", "i2c2_pre_div", base + 0xae00, 0, 6);
+       clks[IMX7D_I2C3_ROOT_DIV] = imx_clk_divider("i2c3_post_div", "i2c3_pre_div", base + 0xae80, 0, 6);
+       clks[IMX7D_I2C4_ROOT_DIV] = imx_clk_divider("i2c4_post_div", "i2c4_pre_div", base + 0xaf00, 0, 6);
+       clks[IMX7D_UART1_ROOT_DIV] = imx_clk_divider("uart1_post_div", "uart1_pre_div", base + 0xaf80, 0, 6);
+       clks[IMX7D_UART2_ROOT_DIV] = imx_clk_divider("uart2_post_div", "uart2_pre_div", base + 0xb000, 0, 6);
+       clks[IMX7D_UART3_ROOT_DIV] = imx_clk_divider("uart3_post_div", "uart3_pre_div", base + 0xb080, 0, 6);
+       clks[IMX7D_UART4_ROOT_DIV] = imx_clk_divider("uart4_post_div", "uart4_pre_div", base + 0xb100, 0, 6);
+       clks[IMX7D_UART5_ROOT_DIV] = imx_clk_divider("uart5_post_div", "uart5_pre_div", base + 0xb180, 0, 6);
+       clks[IMX7D_UART6_ROOT_DIV] = imx_clk_divider("uart6_post_div", "uart6_pre_div", base + 0xb200, 0, 6);
+       clks[IMX7D_UART7_ROOT_DIV] = imx_clk_divider("uart7_post_div", "uart7_pre_div", base + 0xb280, 0, 6);
+       clks[IMX7D_ECSPI1_ROOT_DIV] = imx_clk_divider("ecspi1_post_div", "ecspi1_pre_div", base + 0xb300, 0, 6);
+       clks[IMX7D_ECSPI2_ROOT_DIV] = imx_clk_divider("ecspi2_post_div", "ecspi2_pre_div", base + 0xb380, 0, 6);
+       clks[IMX7D_ECSPI3_ROOT_DIV] = imx_clk_divider("ecspi3_post_div", "ecspi3_pre_div", base + 0xb400, 0, 6);
+       clks[IMX7D_ECSPI4_ROOT_DIV] = imx_clk_divider("ecspi4_post_div", "ecspi4_pre_div", base + 0xb480, 0, 6);
+       clks[IMX7D_PWM1_ROOT_DIV] = imx_clk_divider("pwm1_post_div", "pwm1_pre_div", base + 0xb500, 0, 6);
+       clks[IMX7D_PWM2_ROOT_DIV] = imx_clk_divider("pwm2_post_div", "pwm2_pre_div", base + 0xb580, 0, 6);
+       clks[IMX7D_PWM3_ROOT_DIV] = imx_clk_divider("pwm3_post_div", "pwm3_pre_div", base + 0xb600, 0, 6);
+       clks[IMX7D_PWM4_ROOT_DIV] = imx_clk_divider("pwm4_post_div", "pwm4_pre_div", base + 0xb680, 0, 6);
+       clks[IMX7D_FLEXTIMER1_ROOT_DIV] = imx_clk_divider("flextimer1_post_div", "flextimer1_pre_div", base + 0xb700, 0, 6);
+       clks[IMX7D_FLEXTIMER2_ROOT_DIV] = imx_clk_divider("flextimer2_post_div", "flextimer2_pre_div", base + 0xb780, 0, 6);
+       clks[IMX7D_SIM1_ROOT_DIV] = imx_clk_divider("sim1_post_div", "sim1_pre_div", base + 0xb800, 0, 6);
+       clks[IMX7D_SIM2_ROOT_DIV] = imx_clk_divider("sim2_post_div", "sim2_pre_div", base + 0xb880, 0, 6);
+       clks[IMX7D_GPT1_ROOT_DIV] = imx_clk_divider("gpt1_post_div", "gpt1_pre_div", base + 0xb900, 0, 6);
+       clks[IMX7D_GPT2_ROOT_DIV] = imx_clk_divider("gpt2_post_div", "gpt2_pre_div", base + 0xb980, 0, 6);
+       clks[IMX7D_GPT3_ROOT_DIV] = imx_clk_divider("gpt3_post_div", "gpt3_pre_div", base + 0xba00, 0, 6);
+       clks[IMX7D_GPT4_ROOT_DIV] = imx_clk_divider("gpt4_post_div", "gpt4_pre_div", base + 0xba80, 0, 6);
+       clks[IMX7D_TRACE_ROOT_DIV] = imx_clk_divider("trace_post_div", "trace_pre_div", base + 0xbb00, 0, 6);
+       clks[IMX7D_WDOG_ROOT_DIV] = imx_clk_divider("wdog_post_div", "wdog_pre_div", base + 0xbb80, 0, 6);
+       clks[IMX7D_CSI_MCLK_ROOT_DIV] = imx_clk_divider("csi_mclk_post_div", "csi_mclk_pre_div", base + 0xbc00, 0, 6);
+       clks[IMX7D_AUDIO_MCLK_ROOT_DIV] = imx_clk_divider("audio_mclk_post_div", "audio_mclk_pre_div", base + 0xbc80, 0, 6);
+       clks[IMX7D_WRCLK_ROOT_DIV] = imx_clk_divider("wrclk_post_div", "wrclk_pre_div", base + 0xbd00, 0, 6);
+       clks[IMX7D_CLKO1_ROOT_DIV] = imx_clk_divider("clko1_post_div", "clko1_pre_div", base + 0xbd80, 0, 6);
+       clks[IMX7D_CLKO2_ROOT_DIV] = imx_clk_divider("clko2_post_div", "clko2_pre_div", base + 0xbe00, 0, 6);
+
+       clks[IMX7D_ARM_A7_ROOT_CLK] = imx_clk_gate2("arm_a7_root_clk", "arm_a7_div", base + 0x4000, 0);
+       clks[IMX7D_ARM_M4_ROOT_CLK] = imx_clk_gate2("arm_m4_root_clk", "arm_m4_div", base + 0x4010, 0);
+       clks[IMX7D_ARM_M0_ROOT_CLK] = imx_clk_gate2("arm_m0_root_clk", "arm_m0_div", base + 0x4020, 0);
+       clks[IMX7D_MAIN_AXI_ROOT_CLK] = imx_clk_gate2("main_axi_root_clk", "axi_post_div", base + 0x4040, 0);
+       clks[IMX7D_DISP_AXI_ROOT_CLK] = imx_clk_gate2("disp_axi_root_clk", "disp_axi_post_div", base + 0x4050, 0);
+       clks[IMX7D_ENET_AXI_ROOT_CLK] = imx_clk_gate2("enet_axi_root_clk", "enet_axi_post_div", base + 0x4060, 0);
+       clks[IMX7D_OCRAM_CLK] = imx_clk_gate2("ocram_clk", "axi_post_div", base + 0x4110, 0);
+       clks[IMX7D_OCRAM_S_CLK] = imx_clk_gate2("ocram_s_clk", "ahb_post_div", base + 0x4120, 0);
+       clks[IMX7D_NAND_USDHC_BUS_ROOT_CLK] = imx_clk_gate2("nand_usdhc_root_clk", "nand_usdhc_post_div", base + 0x4130, 0);
+       clks[IMX7D_AHB_CHANNEL_ROOT_CLK] = imx_clk_gate2("ahb_root_clk", "ahb_post_div", base + 0x4200, 0);
+       clks[IMX7D_DRAM_ROOT_CLK] = imx_clk_gate2("dram_root_clk", "dram_post_div", base + 0x4130, 0);
+       clks[IMX7D_DRAM_PHYM_ROOT_CLK] = imx_clk_gate2("dram_phym_root_clk", "dram_phym_cg", base + 0x4130, 0);
+       clks[IMX7D_DRAM_PHYM_ALT_ROOT_CLK] = imx_clk_gate2("dram_phym_alt_root_clk", "dram_phym_alt_post_div", base + 0x4130, 0);
+       clks[IMX7D_DRAM_ALT_ROOT_CLK] = imx_clk_gate2("dram_alt_root_clk", "dram_alt_post_div", base + 0x4130, 0);
+       clks[IMX7D_USB_HSIC_ROOT_CLK] = imx_clk_gate2("usb_hsic_root_clk", "usb_hsic_post_div", base + 0x4420, 0);
+       clks[IMX7D_PCIE_CTRL_ROOT_CLK] = imx_clk_gate2("pcie_ctrl_root_clk", "pcie_ctrl_post_div", base + 0x4600, 0);
+       clks[IMX7D_PCIE_PHY_ROOT_CLK] = imx_clk_gate2("pcie_phy_root_clk", "pcie_phy_post_div", base + 0x4600, 0);
+       clks[IMX7D_EPDC_PIXEL_ROOT_CLK] = imx_clk_gate2("epdc_pixel_root_clk", "epdc_pixel_post_div", base + 0x44a0, 0);
+       clks[IMX7D_LCDIF_PIXEL_ROOT_CLK] = imx_clk_gate2("lcdif_pixel_root_clk", "lcdif_pixel_post_div", base + 0x44b0, 0);
+       clks[IMX7D_MIPI_DSI_ROOT_CLK] = imx_clk_gate2("mipi_dsi_root_clk", "mipi_dsi_post_div", base + 0x4650, 0);
+       clks[IMX7D_MIPI_CSI_ROOT_CLK] = imx_clk_gate2("mipi_csi_root_clk", "mipi_csi_post_div", base + 0x4640, 0);
+       clks[IMX7D_MIPI_DPHY_ROOT_CLK] = imx_clk_gate2("mipi_dphy_root_clk", "mipi_dphy_post_div", base + 0x4660, 0);
+       clks[IMX7D_SAI1_ROOT_CLK] = imx_clk_gate2("sai1_root_clk", "sai1_post_div", base + 0x48c0, 0);
+       clks[IMX7D_SAI2_ROOT_CLK] = imx_clk_gate2("sai2_root_clk", "sai2_post_div", base + 0x48d0, 0);
+       clks[IMX7D_SAI3_ROOT_CLK] = imx_clk_gate2("sai3_root_clk", "sai3_post_div", base + 0x48e0, 0);
+       clks[IMX7D_SPDIF_ROOT_CLK] = imx_clk_gate2("spdif_root_clk", "spdif_post_div", base + 0x44d0, 0);
+       clks[IMX7D_ENET1_REF_ROOT_CLK] = imx_clk_gate2("enet1_ref_root_clk", "enet1_ref_post_div", base + 0x44e0, 0);
+       clks[IMX7D_ENET1_TIME_ROOT_CLK] = imx_clk_gate2("enet1_time_root_clk", "enet1_time_post_div", base + 0x44f0, 0);
+       clks[IMX7D_ENET2_REF_ROOT_CLK] = imx_clk_gate2("enet2_ref_root_clk", "enet2_ref_post_div", base + 0x4500, 0);
+       clks[IMX7D_ENET2_TIME_ROOT_CLK] = imx_clk_gate2("enet2_time_root_clk", "enet2_time_post_div", base + 0x4510, 0);
+       clks[IMX7D_ENET_PHY_REF_ROOT_CLK] = imx_clk_gate2("enet_phy_ref_root_clk", "enet_phy_ref_post_div", base + 0x4520, 0);
+       clks[IMX7D_EIM_ROOT_CLK] = imx_clk_gate2("eim_root_clk", "eim_post_div", base + 0x4160, 0);
+       clks[IMX7D_NAND_ROOT_CLK] = imx_clk_gate2("nand_root_clk", "nand_post_div", base + 0x4140, 0);
+       clks[IMX7D_QSPI_ROOT_CLK] = imx_clk_gate2("qspi_root_clk", "qspi_post_div", base + 0x4150, 0);
+       clks[IMX7D_USDHC1_ROOT_CLK] = imx_clk_gate2("usdhc1_root_clk", "usdhc1_post_div", base + 0x46c0, 0);
+       clks[IMX7D_USDHC2_ROOT_CLK] = imx_clk_gate2("usdhc2_root_clk", "usdhc2_post_div", base + 0x46d0, 0);
+       clks[IMX7D_USDHC3_ROOT_CLK] = imx_clk_gate2("usdhc3_root_clk", "usdhc3_post_div", base + 0x46e0, 0);
+       clks[IMX7D_CAN1_ROOT_CLK] = imx_clk_gate2("can1_root_clk", "can1_post_div", base + 0x4740, 0);
+       clks[IMX7D_CAN2_ROOT_CLK] = imx_clk_gate2("can2_root_clk", "can2_post_div", base + 0x4750, 0);
+       clks[IMX7D_I2C1_ROOT_CLK] = imx_clk_gate2("i2c1_root_clk", "i2c1_post_div", base + 0x4880, 0);
+       clks[IMX7D_I2C2_ROOT_CLK] = imx_clk_gate2("i2c2_root_clk", "i2c2_post_div", base + 0x4890, 0);
+       clks[IMX7D_I2C3_ROOT_CLK] = imx_clk_gate2("i2c3_root_clk", "i2c3_post_div", base + 0x48a0, 0);
+       clks[IMX7D_I2C4_ROOT_CLK] = imx_clk_gate2("i2c4_root_clk", "i2c4_post_div", base + 0x48b0, 0);
+       clks[IMX7D_UART1_ROOT_CLK] = imx_clk_gate2("uart1_root_clk", "uart1_post_div", base + 0x4940, 0);
+       clks[IMX7D_UART2_ROOT_CLK] = imx_clk_gate2("uart2_root_clk", "uart2_post_div", base + 0x4950, 0);
+       clks[IMX7D_UART3_ROOT_CLK] = imx_clk_gate2("uart3_root_clk", "uart3_post_div", base + 0x4960, 0);
+       clks[IMX7D_UART4_ROOT_CLK] = imx_clk_gate2("uart4_root_clk", "uart4_post_div", base + 0x4970, 0);
+       clks[IMX7D_UART5_ROOT_CLK] = imx_clk_gate2("uart5_root_clk", "uart5_post_div", base + 0x4980, 0);
+       clks[IMX7D_UART6_ROOT_CLK] = imx_clk_gate2("uart6_root_clk", "uart6_post_div", base + 0x4990, 0);
+       clks[IMX7D_UART7_ROOT_CLK] = imx_clk_gate2("uart7_root_clk", "uart7_post_div", base + 0x49a0, 0);
+       clks[IMX7D_ECSPI1_ROOT_CLK] = imx_clk_gate2("ecspi1_root_clk", "ecspi1_post_div", base + 0x4780, 0);
+       clks[IMX7D_ECSPI2_ROOT_CLK] = imx_clk_gate2("ecspi2_root_clk", "ecspi2_post_div", base + 0x4790, 0);
+       clks[IMX7D_ECSPI3_ROOT_CLK] = imx_clk_gate2("ecspi3_root_clk", "ecspi3_post_div", base + 0x47a0, 0);
+       clks[IMX7D_ECSPI4_ROOT_CLK] = imx_clk_gate2("ecspi4_root_clk", "ecspi4_post_div", base + 0x47b0, 0);
+       clks[IMX7D_PWM1_ROOT_CLK] = imx_clk_gate2("pwm1_root_clk", "pwm1_post_div", base + 0x4840, 0);
+       clks[IMX7D_PWM2_ROOT_CLK] = imx_clk_gate2("pwm2_root_clk", "pwm2_post_div", base + 0x4850, 0);
+       clks[IMX7D_PWM3_ROOT_CLK] = imx_clk_gate2("pwm3_root_clk", "pwm3_post_div", base + 0x4860, 0);
+       clks[IMX7D_PWM4_ROOT_CLK] = imx_clk_gate2("pwm4_root_clk", "pwm4_post_div", base + 0x4870, 0);
+       clks[IMX7D_FLEXTIMER1_ROOT_CLK] = imx_clk_gate2("flextimer1_root_clk", "flextimer1_post_div", base + 0x4800, 0);
+       clks[IMX7D_FLEXTIMER2_ROOT_CLK] = imx_clk_gate2("flextimer2_root_clk", "flextimer2_post_div", base + 0x4810, 0);
+       clks[IMX7D_SIM1_ROOT_CLK] = imx_clk_gate2("sim1_root_clk", "sim1_post_div", base + 0x4900, 0);
+       clks[IMX7D_SIM2_ROOT_CLK] = imx_clk_gate2("sim2_root_clk", "sim2_post_div", base + 0x4910, 0);
+       clks[IMX7D_GPT1_ROOT_CLK] = imx_clk_gate2("gpt1_root_clk", "gpt1_post_div", base + 0x47c0, 0);
+       clks[IMX7D_GPT2_ROOT_CLK] = imx_clk_gate2("gpt2_root_clk", "gpt2_post_div", base + 0x47d0, 0);
+       clks[IMX7D_GPT3_ROOT_CLK] = imx_clk_gate2("gpt3_root_clk", "gpt3_post_div", base + 0x47e0, 0);
+       clks[IMX7D_GPT4_ROOT_CLK] = imx_clk_gate2("gpt4_root_clk", "gpt4_post_div", base + 0x47f0, 0);
+       clks[IMX7D_TRACE_ROOT_CLK] = imx_clk_gate2("trace_root_clk", "trace_post_div", base + 0x4300, 0);
+       clks[IMX7D_WDOG1_ROOT_CLK] = imx_clk_gate2("wdog1_root_clk", "wdog_post_div", base + 0x49c0, 0);
+       clks[IMX7D_WDOG2_ROOT_CLK] = imx_clk_gate2("wdog2_root_clk", "wdog_post_div", base + 0x49d0, 0);
+       clks[IMX7D_WDOG3_ROOT_CLK] = imx_clk_gate2("wdog3_root_clk", "wdog_post_div", base + 0x49e0, 0);
+       clks[IMX7D_WDOG4_ROOT_CLK] = imx_clk_gate2("wdog4_root_clk", "wdog_post_div", base + 0x49f0, 0);
+       clks[IMX7D_CSI_MCLK_ROOT_CLK] = imx_clk_gate2("csi_mclk_root_clk", "csi_mclk_post_div", base + 0x4490, 0);
+       clks[IMX7D_AUDIO_MCLK_ROOT_CLK] = imx_clk_gate2("audio_mclk_root_clk", "audio_mclk_post_div", base + 0x4790, 0);
+       clks[IMX7D_WRCLK_ROOT_CLK] = imx_clk_gate2("wrclk_root_clk", "wrclk_post_div", base + 0x47a0, 0);
+
+       clks[IMX7D_GPT_3M_CLK] = imx_clk_fixed_factor("gpt_3m", "osc", 1, 8);
+
+       for (i = 0; i < ARRAY_SIZE(clks); i++)
+               if (IS_ERR(clks[i]))
+                       pr_err("i.MX7D clk %d: register failed with %ld\n",
+                                       i, PTR_ERR(clks[i]));
+
+       clk_data.clks = clks;
+       clk_data.clk_num = ARRAY_SIZE(clks);
+       of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
+
+       /* TO BE FIXED LATER
+        * Enable all clock to bring up imx7, otherwise system will be halt and block
+        * the other part upstream Because imx7d clock design changed, clock framework
+        * need do a little modify.
+        * Dong Aisheng is working on this. After that, this part need be changed.
+        */
+       for (i = 0; i < IMX7D_CLK_END; i++)
+               clk_prepare_enable(clks[i]);
+
+       /* use old gpt clk setting, gpt1 root clk must be twice as gpt counter freq */
+       clk_set_parent(clks[IMX7D_GPT1_ROOT_SRC], clks[IMX7D_OSC_24M_CLK]);
+
+       /*
+        * init enet clock source:
+        *      AXI clock source is 250MHz
+        *      Phy refrence clock is 25MHz
+        *      1588 time clock source is 100MHz
+        */
+       clk_set_parent(clks[IMX7D_ENET_AXI_ROOT_SRC], clks[IMX7D_PLL_ENET_MAIN_250M_CLK]);
+       clk_set_parent(clks[IMX7D_ENET_PHY_REF_ROOT_SRC], clks[IMX7D_PLL_ENET_MAIN_25M_CLK]);
+       clk_set_parent(clks[IMX7D_ENET1_TIME_ROOT_SRC], clks[IMX7D_PLL_ENET_MAIN_100M_CLK]);
+       clk_set_parent(clks[IMX7D_ENET2_TIME_ROOT_SRC], clks[IMX7D_PLL_ENET_MAIN_100M_CLK]);
+
+       /* set uart module clock's parent clock source that must be great then 80MHz */
+       clk_set_parent(clks[IMX7D_UART1_ROOT_SRC], clks[IMX7D_OSC_24M_CLK]);
+
+}
+CLK_OF_DECLARE(imx7d, "fsl,imx7d-ccm", imx7d_clocks_init);
diff --git a/drivers/clk/imx/clk-pfd.c b/drivers/clk/imx/clk-pfd.c
new file mode 100644 (file)
index 0000000..0b0f6f6
--- /dev/null
@@ -0,0 +1,158 @@
+/*
+ * Copyright 2012 Freescale Semiconductor, Inc.
+ * Copyright 2012 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:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+#include <linux/clk.h>
+#include <linux/clk-provider.h>
+#include <linux/io.h>
+#include <linux/slab.h>
+#include <linux/err.h>
+#include "clk.h"
+
+/**
+ * struct clk_pfd - IMX PFD clock
+ * @clk_hw:    clock source
+ * @reg:       PFD register address
+ * @idx:       the index of PFD encoded in the register
+ *
+ * PFD clock found on i.MX6 series.  Each register for PFD has 4 clk_pfd
+ * data encoded, and member idx is used to specify the one.  And each
+ * register has SET, CLR and TOG registers at offset 0x4 0x8 and 0xc.
+ */
+struct clk_pfd {
+       struct clk_hw   hw;
+       void __iomem    *reg;
+       u8              idx;
+};
+
+#define to_clk_pfd(_hw) container_of(_hw, struct clk_pfd, hw)
+
+#define SET    0x4
+#define CLR    0x8
+#define OTG    0xc
+
+static int clk_pfd_enable(struct clk_hw *hw)
+{
+       struct clk_pfd *pfd = to_clk_pfd(hw);
+
+       writel_relaxed(1 << ((pfd->idx + 1) * 8 - 1), pfd->reg + CLR);
+
+       return 0;
+}
+
+static void clk_pfd_disable(struct clk_hw *hw)
+{
+       struct clk_pfd *pfd = to_clk_pfd(hw);
+
+       writel_relaxed(1 << ((pfd->idx + 1) * 8 - 1), pfd->reg + SET);
+}
+
+static unsigned long clk_pfd_recalc_rate(struct clk_hw *hw,
+                                        unsigned long parent_rate)
+{
+       struct clk_pfd *pfd = to_clk_pfd(hw);
+       u64 tmp = parent_rate;
+       u8 frac = (readl_relaxed(pfd->reg) >> (pfd->idx * 8)) & 0x3f;
+
+       tmp *= 18;
+       do_div(tmp, frac);
+
+       return tmp;
+}
+
+static long clk_pfd_round_rate(struct clk_hw *hw, unsigned long rate,
+                              unsigned long *prate)
+{
+       u64 tmp = *prate;
+       u8 frac;
+
+       tmp = tmp * 18 + rate / 2;
+       do_div(tmp, rate);
+       frac = tmp;
+       if (frac < 12)
+               frac = 12;
+       else if (frac > 35)
+               frac = 35;
+       tmp = *prate;
+       tmp *= 18;
+       do_div(tmp, frac);
+
+       return tmp;
+}
+
+static int clk_pfd_set_rate(struct clk_hw *hw, unsigned long rate,
+               unsigned long parent_rate)
+{
+       struct clk_pfd *pfd = to_clk_pfd(hw);
+       u64 tmp = parent_rate;
+       u8 frac;
+
+       tmp = tmp * 18 + rate / 2;
+       do_div(tmp, rate);
+       frac = tmp;
+       if (frac < 12)
+               frac = 12;
+       else if (frac > 35)
+               frac = 35;
+
+       writel_relaxed(0x3f << (pfd->idx * 8), pfd->reg + CLR);
+       writel_relaxed(frac << (pfd->idx * 8), pfd->reg + SET);
+
+       return 0;
+}
+
+static int clk_pfd_is_enabled(struct clk_hw *hw)
+{
+       struct clk_pfd *pfd = to_clk_pfd(hw);
+
+       if (readl_relaxed(pfd->reg) & (1 << ((pfd->idx + 1) * 8 - 1)))
+               return 0;
+
+       return 1;
+}
+
+static const struct clk_ops clk_pfd_ops = {
+       .enable         = clk_pfd_enable,
+       .disable        = clk_pfd_disable,
+       .recalc_rate    = clk_pfd_recalc_rate,
+       .round_rate     = clk_pfd_round_rate,
+       .set_rate       = clk_pfd_set_rate,
+       .is_enabled     = clk_pfd_is_enabled,
+};
+
+struct clk *imx_clk_pfd(const char *name, const char *parent_name,
+                       void __iomem *reg, u8 idx)
+{
+       struct clk_pfd *pfd;
+       struct clk *clk;
+       struct clk_init_data init;
+
+       pfd = kzalloc(sizeof(*pfd), GFP_KERNEL);
+       if (!pfd)
+               return ERR_PTR(-ENOMEM);
+
+       pfd->reg = reg;
+       pfd->idx = idx;
+
+       init.name = name;
+       init.ops = &clk_pfd_ops;
+       init.flags = 0;
+       init.parent_names = &parent_name;
+       init.num_parents = 1;
+
+       pfd->hw.init = &init;
+
+       clk = clk_register(NULL, &pfd->hw);
+       if (IS_ERR(clk))
+               kfree(pfd);
+
+       return clk;
+}
diff --git a/drivers/clk/imx/clk-pllv1.c b/drivers/clk/imx/clk-pllv1.c
new file mode 100644 (file)
index 0000000..c34ad8a
--- /dev/null
@@ -0,0 +1,141 @@
+#include <linux/clk.h>
+#include <linux/clk-provider.h>
+#include <linux/io.h>
+#include <linux/slab.h>
+#include <linux/kernel.h>
+#include <linux/err.h>
+
+#include "clk.h"
+
+/**
+ * pll v1
+ *
+ * @clk_hw     clock source
+ * @parent     the parent clock name
+ * @base       base address of pll registers
+ *
+ * PLL clock version 1, found on i.MX1/21/25/27/31/35
+ */
+
+#define MFN_BITS       (10)
+#define MFN_SIGN       (BIT(MFN_BITS - 1))
+#define MFN_MASK       (MFN_SIGN - 1)
+
+struct clk_pllv1 {
+       struct clk_hw   hw;
+       void __iomem    *base;
+       enum imx_pllv1_type type;
+};
+
+#define to_clk_pllv1(clk) (container_of(clk, struct clk_pllv1, clk))
+
+static inline bool is_imx1_pllv1(struct clk_pllv1 *pll)
+{
+       return pll->type == IMX_PLLV1_IMX1;
+}
+
+static inline bool is_imx21_pllv1(struct clk_pllv1 *pll)
+{
+       return pll->type == IMX_PLLV1_IMX21;
+}
+
+static inline bool is_imx27_pllv1(struct clk_pllv1 *pll)
+{
+       return pll->type == IMX_PLLV1_IMX27;
+}
+
+static inline bool mfn_is_negative(struct clk_pllv1 *pll, unsigned int mfn)
+{
+       return !is_imx1_pllv1(pll) && !is_imx21_pllv1(pll) && (mfn & MFN_SIGN);
+}
+
+static unsigned long clk_pllv1_recalc_rate(struct clk_hw *hw,
+               unsigned long parent_rate)
+{
+       struct clk_pllv1 *pll = to_clk_pllv1(hw);
+       long long ll;
+       int mfn_abs;
+       unsigned int mfi, mfn, mfd, pd;
+       u32 reg;
+       unsigned long rate;
+
+       reg = readl(pll->base);
+
+       /*
+        * Get the resulting clock rate from a PLL register value and the input
+        * frequency. PLLs with this register layout can be found on i.MX1,
+        * i.MX21, i.MX27 and i,MX31
+        *
+        *                  mfi + mfn / (mfd + 1)
+        *  f = 2 * f_ref * --------------------
+        *                        pd + 1
+        */
+
+       mfi = (reg >> 10) & 0xf;
+       mfn = reg & 0x3ff;
+       mfd = (reg >> 16) & 0x3ff;
+       pd =  (reg >> 26) & 0xf;
+
+       mfi = mfi <= 5 ? 5 : mfi;
+
+       mfn_abs = mfn;
+
+       /*
+        * On all i.MXs except i.MX1 and i.MX21 mfn is a 10bit
+        * 2's complements number.
+        * On i.MX27 the bit 9 is the sign bit.
+        */
+       if (mfn_is_negative(pll, mfn)) {
+               if (is_imx27_pllv1(pll))
+                       mfn_abs = mfn & MFN_MASK;
+               else
+                       mfn_abs = BIT(MFN_BITS) - mfn;
+       }
+
+       rate = parent_rate * 2;
+       rate /= pd + 1;
+
+       ll = (unsigned long long)rate * mfn_abs;
+
+       do_div(ll, mfd + 1);
+
+       if (mfn_is_negative(pll, mfn))
+               ll = -ll;
+
+       ll = (rate * mfi) + ll;
+
+       return ll;
+}
+
+static struct clk_ops clk_pllv1_ops = {
+       .recalc_rate = clk_pllv1_recalc_rate,
+};
+
+struct clk *imx_clk_pllv1(enum imx_pllv1_type type, const char *name,
+               const char *parent, void __iomem *base)
+{
+       struct clk_pllv1 *pll;
+       struct clk *clk;
+       struct clk_init_data init;
+
+       pll = kmalloc(sizeof(*pll), GFP_KERNEL);
+       if (!pll)
+               return ERR_PTR(-ENOMEM);
+
+       pll->base = base;
+       pll->type = type;
+
+       init.name = name;
+       init.ops = &clk_pllv1_ops;
+       init.flags = 0;
+       init.parent_names = &parent;
+       init.num_parents = 1;
+
+       pll->hw.init = &init;
+
+       clk = clk_register(NULL, &pll->hw);
+       if (IS_ERR(clk))
+               kfree(pll);
+
+       return clk;
+}
diff --git a/drivers/clk/imx/clk-pllv2.c b/drivers/clk/imx/clk-pllv2.c
new file mode 100644 (file)
index 0000000..20889d5
--- /dev/null
@@ -0,0 +1,266 @@
+#include <linux/kernel.h>
+#include <linux/clk.h>
+#include <linux/io.h>
+#include <linux/errno.h>
+#include <linux/delay.h>
+#include <linux/slab.h>
+#include <linux/err.h>
+
+#include <asm/div64.h>
+
+#include "clk.h"
+
+#define to_clk_pllv2(clk) (container_of(clk, struct clk_pllv2, clk))
+
+/* PLL Register Offsets */
+#define MXC_PLL_DP_CTL                 0x00
+#define MXC_PLL_DP_CONFIG              0x04
+#define MXC_PLL_DP_OP                  0x08
+#define MXC_PLL_DP_MFD                 0x0C
+#define MXC_PLL_DP_MFN                 0x10
+#define MXC_PLL_DP_MFNMINUS            0x14
+#define MXC_PLL_DP_MFNPLUS             0x18
+#define MXC_PLL_DP_HFS_OP              0x1C
+#define MXC_PLL_DP_HFS_MFD             0x20
+#define MXC_PLL_DP_HFS_MFN             0x24
+#define MXC_PLL_DP_MFN_TOGC            0x28
+#define MXC_PLL_DP_DESTAT              0x2c
+
+/* PLL Register Bit definitions */
+#define MXC_PLL_DP_CTL_MUL_CTRL                0x2000
+#define MXC_PLL_DP_CTL_DPDCK0_2_EN     0x1000
+#define MXC_PLL_DP_CTL_DPDCK0_2_OFFSET 12
+#define MXC_PLL_DP_CTL_ADE             0x800
+#define MXC_PLL_DP_CTL_REF_CLK_DIV     0x400
+#define MXC_PLL_DP_CTL_REF_CLK_SEL_MASK        (3 << 8)
+#define MXC_PLL_DP_CTL_REF_CLK_SEL_OFFSET      8
+#define MXC_PLL_DP_CTL_HFSM            0x80
+#define MXC_PLL_DP_CTL_PRE             0x40
+#define MXC_PLL_DP_CTL_UPEN            0x20
+#define MXC_PLL_DP_CTL_RST             0x10
+#define MXC_PLL_DP_CTL_RCP             0x8
+#define MXC_PLL_DP_CTL_PLM             0x4
+#define MXC_PLL_DP_CTL_BRM0            0x2
+#define MXC_PLL_DP_CTL_LRF             0x1
+
+#define MXC_PLL_DP_CONFIG_BIST         0x8
+#define MXC_PLL_DP_CONFIG_SJC_CE       0x4
+#define MXC_PLL_DP_CONFIG_AREN         0x2
+#define MXC_PLL_DP_CONFIG_LDREQ                0x1
+
+#define MXC_PLL_DP_OP_MFI_OFFSET       4
+#define MXC_PLL_DP_OP_MFI_MASK         (0xF << 4)
+#define MXC_PLL_DP_OP_PDF_OFFSET       0
+#define MXC_PLL_DP_OP_PDF_MASK         0xF
+
+#define MXC_PLL_DP_MFD_OFFSET          0
+#define MXC_PLL_DP_MFD_MASK            0x07FFFFFF
+
+#define MXC_PLL_DP_MFN_OFFSET          0x0
+#define MXC_PLL_DP_MFN_MASK            0x07FFFFFF
+
+#define MXC_PLL_DP_MFN_TOGC_TOG_DIS    (1 << 17)
+#define MXC_PLL_DP_MFN_TOGC_TOG_EN     (1 << 16)
+#define MXC_PLL_DP_MFN_TOGC_CNT_OFFSET 0x0
+#define MXC_PLL_DP_MFN_TOGC_CNT_MASK   0xFFFF
+
+#define MXC_PLL_DP_DESTAT_TOG_SEL      (1 << 31)
+#define MXC_PLL_DP_DESTAT_MFN          0x07FFFFFF
+
+#define MAX_DPLL_WAIT_TRIES    1000 /* 1000 * udelay(1) = 1ms */
+
+struct clk_pllv2 {
+       struct clk_hw   hw;
+       void __iomem    *base;
+};
+
+static unsigned long __clk_pllv2_recalc_rate(unsigned long parent_rate,
+               u32 dp_ctl, u32 dp_op, u32 dp_mfd, u32 dp_mfn)
+{
+       long mfi, mfn, mfd, pdf, ref_clk, mfn_abs;
+       unsigned long dbl;
+       s64 temp;
+
+       dbl = dp_ctl & MXC_PLL_DP_CTL_DPDCK0_2_EN;
+
+       pdf = dp_op & MXC_PLL_DP_OP_PDF_MASK;
+       mfi = (dp_op & MXC_PLL_DP_OP_MFI_MASK) >> MXC_PLL_DP_OP_MFI_OFFSET;
+       mfi = (mfi <= 5) ? 5 : mfi;
+       mfd = dp_mfd & MXC_PLL_DP_MFD_MASK;
+       mfn = mfn_abs = dp_mfn & MXC_PLL_DP_MFN_MASK;
+       /* Sign extend to 32-bits */
+       if (mfn >= 0x04000000) {
+               mfn |= 0xFC000000;
+               mfn_abs = -mfn;
+       }
+
+       ref_clk = 2 * parent_rate;
+       if (dbl != 0)
+               ref_clk *= 2;
+
+       ref_clk /= (pdf + 1);
+       temp = (u64) ref_clk * mfn_abs;
+       do_div(temp, mfd + 1);
+       if (mfn < 0)
+               temp = -temp;
+       temp = (ref_clk * mfi) + temp;
+
+       return temp;
+}
+
+static unsigned long clk_pllv2_recalc_rate(struct clk_hw *hw,
+               unsigned long parent_rate)
+{
+       u32 dp_op, dp_mfd, dp_mfn, dp_ctl;
+       void __iomem *pllbase;
+       struct clk_pllv2 *pll = to_clk_pllv2(hw);
+
+       pllbase = pll->base;
+
+       dp_ctl = __raw_readl(pllbase + MXC_PLL_DP_CTL);
+       dp_op = __raw_readl(pllbase + MXC_PLL_DP_OP);
+       dp_mfd = __raw_readl(pllbase + MXC_PLL_DP_MFD);
+       dp_mfn = __raw_readl(pllbase + MXC_PLL_DP_MFN);
+
+       return __clk_pllv2_recalc_rate(parent_rate, dp_ctl, dp_op, dp_mfd, dp_mfn);
+}
+
+static int __clk_pllv2_set_rate(unsigned long rate, unsigned long parent_rate,
+               u32 *dp_op, u32 *dp_mfd, u32 *dp_mfn)
+{
+       u32 reg;
+       long mfi, pdf, mfn, mfd = 999999;
+       s64 temp64;
+       unsigned long quad_parent_rate;
+
+       quad_parent_rate = 4 * parent_rate;
+       pdf = mfi = -1;
+       while (++pdf < 16 && mfi < 5)
+               mfi = rate * (pdf+1) / quad_parent_rate;
+       if (mfi > 15)
+               return -EINVAL;
+       pdf--;
+
+       temp64 = rate * (pdf + 1) - quad_parent_rate * mfi;
+       do_div(temp64, quad_parent_rate / 1000000);
+       mfn = (long)temp64;
+
+       reg = mfi << 4 | pdf;
+
+       *dp_op = reg;
+       *dp_mfd = mfd;
+       *dp_mfn = mfn;
+
+       return 0;
+}
+
+static int clk_pllv2_set_rate(struct clk_hw *hw, unsigned long rate,
+               unsigned long parent_rate)
+{
+       struct clk_pllv2 *pll = to_clk_pllv2(hw);
+       void __iomem *pllbase;
+       u32 dp_ctl, dp_op, dp_mfd, dp_mfn;
+       int ret;
+
+       pllbase = pll->base;
+
+
+       ret = __clk_pllv2_set_rate(rate, parent_rate, &dp_op, &dp_mfd, &dp_mfn);
+       if (ret)
+               return ret;
+
+       dp_ctl = __raw_readl(pllbase + MXC_PLL_DP_CTL);
+       /* use dpdck0_2 */
+       __raw_writel(dp_ctl | 0x1000L, pllbase + MXC_PLL_DP_CTL);
+
+       __raw_writel(dp_op, pllbase + MXC_PLL_DP_OP);
+       __raw_writel(dp_mfd, pllbase + MXC_PLL_DP_MFD);
+       __raw_writel(dp_mfn, pllbase + MXC_PLL_DP_MFN);
+
+       return 0;
+}
+
+static long clk_pllv2_round_rate(struct clk_hw *hw, unsigned long rate,
+               unsigned long *prate)
+{
+       u32 dp_op, dp_mfd, dp_mfn;
+
+       __clk_pllv2_set_rate(rate, *prate, &dp_op, &dp_mfd, &dp_mfn);
+       return __clk_pllv2_recalc_rate(*prate, MXC_PLL_DP_CTL_DPDCK0_2_EN,
+                       dp_op, dp_mfd, dp_mfn);
+}
+
+static int clk_pllv2_prepare(struct clk_hw *hw)
+{
+       struct clk_pllv2 *pll = to_clk_pllv2(hw);
+       u32 reg;
+       void __iomem *pllbase;
+       int i = 0;
+
+       pllbase = pll->base;
+       reg = __raw_readl(pllbase + MXC_PLL_DP_CTL) | MXC_PLL_DP_CTL_UPEN;
+       __raw_writel(reg, pllbase + MXC_PLL_DP_CTL);
+
+       /* Wait for lock */
+       do {
+               reg = __raw_readl(pllbase + MXC_PLL_DP_CTL);
+               if (reg & MXC_PLL_DP_CTL_LRF)
+                       break;
+
+               udelay(1);
+       } while (++i < MAX_DPLL_WAIT_TRIES);
+
+       if (i == MAX_DPLL_WAIT_TRIES) {
+               pr_err("MX5: pll locking failed\n");
+               return -EINVAL;
+       }
+
+       return 0;
+}
+
+static void clk_pllv2_unprepare(struct clk_hw *hw)
+{
+       struct clk_pllv2 *pll = to_clk_pllv2(hw);
+       u32 reg;
+       void __iomem *pllbase;
+
+       pllbase = pll->base;
+       reg = __raw_readl(pllbase + MXC_PLL_DP_CTL) & ~MXC_PLL_DP_CTL_UPEN;
+       __raw_writel(reg, pllbase + MXC_PLL_DP_CTL);
+}
+
+static struct clk_ops clk_pllv2_ops = {
+       .prepare = clk_pllv2_prepare,
+       .unprepare = clk_pllv2_unprepare,
+       .recalc_rate = clk_pllv2_recalc_rate,
+       .round_rate = clk_pllv2_round_rate,
+       .set_rate = clk_pllv2_set_rate,
+};
+
+struct clk *imx_clk_pllv2(const char *name, const char *parent,
+               void __iomem *base)
+{
+       struct clk_pllv2 *pll;
+       struct clk *clk;
+       struct clk_init_data init;
+
+       pll = kzalloc(sizeof(*pll), GFP_KERNEL);
+       if (!pll)
+               return ERR_PTR(-ENOMEM);
+
+       pll->base = base;
+
+       init.name = name;
+       init.ops = &clk_pllv2_ops;
+       init.flags = 0;
+       init.parent_names = &parent;
+       init.num_parents = 1;
+
+       pll->hw.init = &init;
+
+       clk = clk_register(NULL, &pll->hw);
+       if (IS_ERR(clk))
+               kfree(pll);
+
+       return clk;
+}
diff --git a/drivers/clk/imx/clk-pllv3.c b/drivers/clk/imx/clk-pllv3.c
new file mode 100644 (file)
index 0000000..f0d15fb
--- /dev/null
@@ -0,0 +1,338 @@
+/*
+ * Copyright 2012 Freescale Semiconductor, Inc.
+ * Copyright 2012 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:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+#include <linux/clk.h>
+#include <linux/clk-provider.h>
+#include <linux/delay.h>
+#include <linux/io.h>
+#include <linux/slab.h>
+#include <linux/jiffies.h>
+#include <linux/err.h>
+#include "clk.h"
+
+#define PLL_NUM_OFFSET         0x10
+#define PLL_DENOM_OFFSET       0x20
+
+#define BM_PLL_POWER           (0x1 << 12)
+#define BM_PLL_LOCK            (0x1 << 31)
+#define IMX7_ENET_PLL_POWER    (0x1 << 5)
+
+/**
+ * struct clk_pllv3 - IMX PLL clock version 3
+ * @clk_hw:     clock source
+ * @base:       base address of PLL registers
+ * @powerup_set: set POWER bit to power up the PLL
+ * @powerdown:   pll powerdown offset bit
+ * @div_mask:   mask of divider bits
+ * @div_shift:  shift of divider bits
+ *
+ * IMX PLL clock version 3, found on i.MX6 series.  Divider for pllv3
+ * is actually a multiplier, and always sits at bit 0.
+ */
+struct clk_pllv3 {
+       struct clk_hw   hw;
+       void __iomem    *base;
+       bool            powerup_set;
+       u32             powerdown;
+       u32             div_mask;
+       u32             div_shift;
+};
+
+#define to_clk_pllv3(_hw) container_of(_hw, struct clk_pllv3, hw)
+
+static int clk_pllv3_wait_lock(struct clk_pllv3 *pll)
+{
+       unsigned long timeout = jiffies + msecs_to_jiffies(10);
+       u32 val = readl_relaxed(pll->base) & pll->powerdown;
+
+       /* No need to wait for lock when pll is not powered up */
+       if ((pll->powerup_set && !val) || (!pll->powerup_set && val))
+               return 0;
+
+       /* Wait for PLL to lock */
+       do {
+               if (readl_relaxed(pll->base) & BM_PLL_LOCK)
+                       break;
+               if (time_after(jiffies, timeout))
+                       break;
+               usleep_range(50, 500);
+       } while (1);
+
+       return readl_relaxed(pll->base) & BM_PLL_LOCK ? 0 : -ETIMEDOUT;
+}
+
+static int clk_pllv3_prepare(struct clk_hw *hw)
+{
+       struct clk_pllv3 *pll = to_clk_pllv3(hw);
+       u32 val;
+
+       val = readl_relaxed(pll->base);
+       if (pll->powerup_set)
+               val |= BM_PLL_POWER;
+       else
+               val &= ~BM_PLL_POWER;
+       writel_relaxed(val, pll->base);
+
+       return clk_pllv3_wait_lock(pll);
+}
+
+static void clk_pllv3_unprepare(struct clk_hw *hw)
+{
+       struct clk_pllv3 *pll = to_clk_pllv3(hw);
+       u32 val;
+
+       val = readl_relaxed(pll->base);
+       if (pll->powerup_set)
+               val &= ~BM_PLL_POWER;
+       else
+               val |= BM_PLL_POWER;
+       writel_relaxed(val, pll->base);
+}
+
+static unsigned long clk_pllv3_recalc_rate(struct clk_hw *hw,
+                                          unsigned long parent_rate)
+{
+       struct clk_pllv3 *pll = to_clk_pllv3(hw);
+       u32 div = (readl_relaxed(pll->base) >> pll->div_shift)  & pll->div_mask;
+
+       return (div == 1) ? parent_rate * 22 : parent_rate * 20;
+}
+
+static long clk_pllv3_round_rate(struct clk_hw *hw, unsigned long rate,
+                                unsigned long *prate)
+{
+       unsigned long parent_rate = *prate;
+
+       return (rate >= parent_rate * 22) ? parent_rate * 22 :
+                                           parent_rate * 20;
+}
+
+static int clk_pllv3_set_rate(struct clk_hw *hw, unsigned long rate,
+               unsigned long parent_rate)
+{
+       struct clk_pllv3 *pll = to_clk_pllv3(hw);
+       u32 val, div;
+
+       if (rate == parent_rate * 22)
+               div = 1;
+       else if (rate == parent_rate * 20)
+               div = 0;
+       else
+               return -EINVAL;
+
+       val = readl_relaxed(pll->base);
+       val &= ~(pll->div_mask << pll->div_shift);
+       val |= (div << pll->div_shift);
+       writel_relaxed(val, pll->base);
+
+       return clk_pllv3_wait_lock(pll);
+}
+
+static const struct clk_ops clk_pllv3_ops = {
+       .prepare        = clk_pllv3_prepare,
+       .unprepare      = clk_pllv3_unprepare,
+       .recalc_rate    = clk_pllv3_recalc_rate,
+       .round_rate     = clk_pllv3_round_rate,
+       .set_rate       = clk_pllv3_set_rate,
+};
+
+static unsigned long clk_pllv3_sys_recalc_rate(struct clk_hw *hw,
+                                              unsigned long parent_rate)
+{
+       struct clk_pllv3 *pll = to_clk_pllv3(hw);
+       u32 div = readl_relaxed(pll->base) & pll->div_mask;
+
+       return parent_rate * div / 2;
+}
+
+static long clk_pllv3_sys_round_rate(struct clk_hw *hw, unsigned long rate,
+                                    unsigned long *prate)
+{
+       unsigned long parent_rate = *prate;
+       unsigned long min_rate = parent_rate * 54 / 2;
+       unsigned long max_rate = parent_rate * 108 / 2;
+       u32 div;
+
+       if (rate > max_rate)
+               rate = max_rate;
+       else if (rate < min_rate)
+               rate = min_rate;
+       div = rate * 2 / parent_rate;
+
+       return parent_rate * div / 2;
+}
+
+static int clk_pllv3_sys_set_rate(struct clk_hw *hw, unsigned long rate,
+               unsigned long parent_rate)
+{
+       struct clk_pllv3 *pll = to_clk_pllv3(hw);
+       unsigned long min_rate = parent_rate * 54 / 2;
+       unsigned long max_rate = parent_rate * 108 / 2;
+       u32 val, div;
+
+       if (rate < min_rate || rate > max_rate)
+               return -EINVAL;
+
+       div = rate * 2 / parent_rate;
+       val = readl_relaxed(pll->base);
+       val &= ~pll->div_mask;
+       val |= div;
+       writel_relaxed(val, pll->base);
+
+       return clk_pllv3_wait_lock(pll);
+}
+
+static const struct clk_ops clk_pllv3_sys_ops = {
+       .prepare        = clk_pllv3_prepare,
+       .unprepare      = clk_pllv3_unprepare,
+       .recalc_rate    = clk_pllv3_sys_recalc_rate,
+       .round_rate     = clk_pllv3_sys_round_rate,
+       .set_rate       = clk_pllv3_sys_set_rate,
+};
+
+static unsigned long clk_pllv3_av_recalc_rate(struct clk_hw *hw,
+                                             unsigned long parent_rate)
+{
+       struct clk_pllv3 *pll = to_clk_pllv3(hw);
+       u32 mfn = readl_relaxed(pll->base + PLL_NUM_OFFSET);
+       u32 mfd = readl_relaxed(pll->base + PLL_DENOM_OFFSET);
+       u32 div = readl_relaxed(pll->base) & pll->div_mask;
+
+       return (parent_rate * div) + ((parent_rate / mfd) * mfn);
+}
+
+static long clk_pllv3_av_round_rate(struct clk_hw *hw, unsigned long rate,
+                                   unsigned long *prate)
+{
+       unsigned long parent_rate = *prate;
+       unsigned long min_rate = parent_rate * 27;
+       unsigned long max_rate = parent_rate * 54;
+       u32 div;
+       u32 mfn, mfd = 1000000;
+       u64 temp64;
+
+       if (rate > max_rate)
+               rate = max_rate;
+       else if (rate < min_rate)
+               rate = min_rate;
+
+       div = rate / parent_rate;
+       temp64 = (u64) (rate - div * parent_rate);
+       temp64 *= mfd;
+       do_div(temp64, parent_rate);
+       mfn = temp64;
+
+       return parent_rate * div + parent_rate / mfd * mfn;
+}
+
+static int clk_pllv3_av_set_rate(struct clk_hw *hw, unsigned long rate,
+               unsigned long parent_rate)
+{
+       struct clk_pllv3 *pll = to_clk_pllv3(hw);
+       unsigned long min_rate = parent_rate * 27;
+       unsigned long max_rate = parent_rate * 54;
+       u32 val, div;
+       u32 mfn, mfd = 1000000;
+       u64 temp64;
+
+       if (rate < min_rate || rate > max_rate)
+               return -EINVAL;
+
+       div = rate / parent_rate;
+       temp64 = (u64) (rate - div * parent_rate);
+       temp64 *= mfd;
+       do_div(temp64, parent_rate);
+       mfn = temp64;
+
+       val = readl_relaxed(pll->base);
+       val &= ~pll->div_mask;
+       val |= div;
+       writel_relaxed(val, pll->base);
+       writel_relaxed(mfn, pll->base + PLL_NUM_OFFSET);
+       writel_relaxed(mfd, pll->base + PLL_DENOM_OFFSET);
+
+       return clk_pllv3_wait_lock(pll);
+}
+
+static const struct clk_ops clk_pllv3_av_ops = {
+       .prepare        = clk_pllv3_prepare,
+       .unprepare      = clk_pllv3_unprepare,
+       .recalc_rate    = clk_pllv3_av_recalc_rate,
+       .round_rate     = clk_pllv3_av_round_rate,
+       .set_rate       = clk_pllv3_av_set_rate,
+};
+
+static unsigned long clk_pllv3_enet_recalc_rate(struct clk_hw *hw,
+                                               unsigned long parent_rate)
+{
+       return 500000000;
+}
+
+static const struct clk_ops clk_pllv3_enet_ops = {
+       .prepare        = clk_pllv3_prepare,
+       .unprepare      = clk_pllv3_unprepare,
+       .recalc_rate    = clk_pllv3_enet_recalc_rate,
+};
+
+struct clk *imx_clk_pllv3(enum imx_pllv3_type type, const char *name,
+                         const char *parent_name, void __iomem *base,
+                         u32 div_mask)
+{
+       struct clk_pllv3 *pll;
+       const struct clk_ops *ops;
+       struct clk *clk;
+       struct clk_init_data init;
+
+       pll = kzalloc(sizeof(*pll), GFP_KERNEL);
+       if (!pll)
+               return ERR_PTR(-ENOMEM);
+
+       pll->powerdown = BM_PLL_POWER;
+
+       switch (type) {
+       case IMX_PLLV3_SYS:
+               ops = &clk_pllv3_sys_ops;
+               break;
+       case IMX_PLLV3_USB_VF610:
+               pll->div_shift = 1;
+       case IMX_PLLV3_USB:
+               ops = &clk_pllv3_ops;
+               pll->powerup_set = true;
+               break;
+       case IMX_PLLV3_AV:
+               ops = &clk_pllv3_av_ops;
+               break;
+       case IMX_PLLV3_ENET_IMX7:
+               pll->powerdown = IMX7_ENET_PLL_POWER;
+       case IMX_PLLV3_ENET:
+               ops = &clk_pllv3_enet_ops;
+               break;
+       default:
+               ops = &clk_pllv3_ops;
+       }
+       pll->base = base;
+       pll->div_mask = div_mask;
+
+       init.name = name;
+       init.ops = ops;
+       init.flags = 0;
+       init.parent_names = &parent_name;
+       init.num_parents = 1;
+
+       pll->hw.init = &init;
+
+       clk = clk_register(NULL, &pll->hw);
+       if (IS_ERR(clk))
+               kfree(pll);
+
+       return clk;
+}
diff --git a/drivers/clk/imx/clk-vf610.c b/drivers/clk/imx/clk-vf610.c
new file mode 100644 (file)
index 0000000..bff45ea
--- /dev/null
@@ -0,0 +1,416 @@
+/*
+ * Copyright 2012-2013 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 as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ */
+
+#include <linux/of_address.h>
+#include <linux/clk.h>
+#include <dt-bindings/clock/vf610-clock.h>
+
+#include "clk.h"
+
+#define CCM_CCR                        (ccm_base + 0x00)
+#define CCM_CSR                        (ccm_base + 0x04)
+#define CCM_CCSR               (ccm_base + 0x08)
+#define CCM_CACRR              (ccm_base + 0x0c)
+#define CCM_CSCMR1             (ccm_base + 0x10)
+#define CCM_CSCDR1             (ccm_base + 0x14)
+#define CCM_CSCDR2             (ccm_base + 0x18)
+#define CCM_CSCDR3             (ccm_base + 0x1c)
+#define CCM_CSCMR2             (ccm_base + 0x20)
+#define CCM_CSCDR4             (ccm_base + 0x24)
+#define CCM_CLPCR              (ccm_base + 0x2c)
+#define CCM_CISR               (ccm_base + 0x30)
+#define CCM_CIMR               (ccm_base + 0x34)
+#define CCM_CGPR               (ccm_base + 0x3c)
+#define CCM_CCGR0              (ccm_base + 0x40)
+#define CCM_CCGR1              (ccm_base + 0x44)
+#define CCM_CCGR2              (ccm_base + 0x48)
+#define CCM_CCGR3              (ccm_base + 0x4c)
+#define CCM_CCGR4              (ccm_base + 0x50)
+#define CCM_CCGR5              (ccm_base + 0x54)
+#define CCM_CCGR6              (ccm_base + 0x58)
+#define CCM_CCGR7              (ccm_base + 0x5c)
+#define CCM_CCGR8              (ccm_base + 0x60)
+#define CCM_CCGR9              (ccm_base + 0x64)
+#define CCM_CCGR10             (ccm_base + 0x68)
+#define CCM_CCGR11             (ccm_base + 0x6c)
+#define CCM_CMEOR0             (ccm_base + 0x70)
+#define CCM_CMEOR1             (ccm_base + 0x74)
+#define CCM_CMEOR2             (ccm_base + 0x78)
+#define CCM_CMEOR3             (ccm_base + 0x7c)
+#define CCM_CMEOR4             (ccm_base + 0x80)
+#define CCM_CMEOR5             (ccm_base + 0x84)
+#define CCM_CPPDSR             (ccm_base + 0x88)
+#define CCM_CCOWR              (ccm_base + 0x8c)
+#define CCM_CCPGR0             (ccm_base + 0x90)
+#define CCM_CCPGR1             (ccm_base + 0x94)
+#define CCM_CCPGR2             (ccm_base + 0x98)
+#define CCM_CCPGR3             (ccm_base + 0x9c)
+
+#define CCM_CCGRx_CGn(n)       ((n) * 2)
+
+#define PFD_PLL1_BASE          (anatop_base + 0x2b0)
+#define PFD_PLL2_BASE          (anatop_base + 0x100)
+#define PFD_PLL3_BASE          (anatop_base + 0xf0)
+#define PLL1_CTRL              (anatop_base + 0x270)
+#define PLL2_CTRL              (anatop_base + 0x30)
+#define PLL3_CTRL              (anatop_base + 0x10)
+#define PLL4_CTRL              (anatop_base + 0x70)
+#define PLL5_CTRL              (anatop_base + 0xe0)
+#define PLL6_CTRL              (anatop_base + 0xa0)
+#define PLL7_CTRL              (anatop_base + 0x20)
+#define ANA_MISC1              (anatop_base + 0x160)
+
+static void __iomem *anatop_base;
+static void __iomem *ccm_base;
+
+/* sources for multiplexer clocks, this is used multiple times */
+static const char *fast_sels[] = { "firc", "fxosc", };
+static const char *slow_sels[] = { "sirc_32k", "sxosc", };
+static const char *pll1_sels[] = { "pll1_sys", "pll1_pfd1", "pll1_pfd2", "pll1_pfd3", "pll1_pfd4", };
+static const char *pll2_sels[] = { "pll2_bus", "pll2_pfd1", "pll2_pfd2", "pll2_pfd3", "pll2_pfd4", };
+static const char *pll_bypass_src_sels[] = { "fast_clk_sel", "lvds1_in", };
+static const char *pll1_bypass_sels[] = { "pll1", "pll1_bypass_src", };
+static const char *pll2_bypass_sels[] = { "pll2", "pll2_bypass_src", };
+static const char *pll3_bypass_sels[] = { "pll3", "pll3_bypass_src", };
+static const char *pll4_bypass_sels[] = { "pll4", "pll4_bypass_src", };
+static const char *pll5_bypass_sels[] = { "pll5", "pll5_bypass_src", };
+static const char *pll6_bypass_sels[] = { "pll6", "pll6_bypass_src", };
+static const char *pll7_bypass_sels[] = { "pll7", "pll7_bypass_src", };
+static const char *sys_sels[]  = { "fast_clk_sel", "slow_clk_sel", "pll2_pfd_sel", "pll2_bus", "pll1_pfd_sel", "pll3_usb_otg", };
+static const char *ddr_sels[]  = { "pll2_pfd2", "sys_sel", };
+static const char *rmii_sels[] = { "enet_ext", "audio_ext", "enet_50m", "enet_25m", };
+static const char *enet_ts_sels[]      = { "enet_ext", "fxosc", "audio_ext", "usb", "enet_ts", "enet_25m", "enet_50m", };
+static const char *esai_sels[] = { "audio_ext", "mlb", "spdif_rx", "pll4_audio_div", };
+static const char *sai_sels[]  = { "audio_ext", "mlb", "spdif_rx", "pll4_audio_div", };
+static const char *nfc_sels[]  = { "platform_bus", "pll1_pfd1", "pll3_pfd1", "pll3_pfd3", };
+static const char *qspi_sels[] = { "pll3_usb_otg", "pll3_pfd4", "pll2_pfd4", "pll1_pfd4", };
+static const char *esdhc_sels[]        = { "pll3_usb_otg", "pll3_pfd3", "pll1_pfd3", "platform_bus", };
+static const char *dcu_sels[]  = { "pll1_pfd2", "pll3_usb_otg", };
+static const char *gpu_sels[]  = { "pll2_pfd2", "pll3_pfd2", };
+static const char *vadc_sels[] = { "pll6_video_div", "pll3_usb_otg_div", "pll3_usb_otg", };
+/* FTM counter clock source, not module clock */
+static const char *ftm_ext_sels[]      = {"sirc_128k", "sxosc", "fxosc_half", "audio_ext", };
+static const char *ftm_fix_sels[]      = { "sxosc", "ipg_bus", };
+
+
+static struct clk_div_table pll4_audio_div_table[] = {
+       { .val = 0, .div = 1 },
+       { .val = 1, .div = 2 },
+       { .val = 2, .div = 6 },
+       { .val = 3, .div = 8 },
+       { .val = 4, .div = 10 },
+       { .val = 5, .div = 12 },
+       { .val = 6, .div = 14 },
+       { .val = 7, .div = 16 },
+       { }
+};
+
+static struct clk *clk[VF610_CLK_END];
+static struct clk_onecell_data clk_data;
+
+static unsigned int const clks_init_on[] __initconst = {
+       VF610_CLK_SYS_BUS,
+       VF610_CLK_DDR_SEL,
+       VF610_CLK_DAP,
+};
+
+static struct clk * __init vf610_get_fixed_clock(
+                               struct device_node *ccm_node, const char *name)
+{
+       struct clk *clk = of_clk_get_by_name(ccm_node, name);
+
+       /* Backward compatibility if device tree is missing clks assignments */
+       if (IS_ERR(clk))
+               clk = imx_obtain_fixed_clock(name, 0);
+       return clk;
+};
+
+static void __init vf610_clocks_init(struct device_node *ccm_node)
+{
+       struct device_node *np;
+       int i;
+
+       clk[VF610_CLK_DUMMY] = imx_clk_fixed("dummy", 0);
+       clk[VF610_CLK_SIRC_128K] = imx_clk_fixed("sirc_128k", 128000);
+       clk[VF610_CLK_SIRC_32K] = imx_clk_fixed("sirc_32k", 32000);
+       clk[VF610_CLK_FIRC] = imx_clk_fixed("firc", 24000000);
+
+       clk[VF610_CLK_SXOSC] = vf610_get_fixed_clock(ccm_node, "sxosc");
+       clk[VF610_CLK_FXOSC] = vf610_get_fixed_clock(ccm_node, "fxosc");
+       clk[VF610_CLK_AUDIO_EXT] = vf610_get_fixed_clock(ccm_node, "audio_ext");
+       clk[VF610_CLK_ENET_EXT] = vf610_get_fixed_clock(ccm_node, "enet_ext");
+
+       /* Clock source from external clock via LVDs PAD */
+       clk[VF610_CLK_ANACLK1] = vf610_get_fixed_clock(ccm_node, "anaclk1");
+
+       clk[VF610_CLK_FXOSC_HALF] = imx_clk_fixed_factor("fxosc_half", "fxosc", 1, 2);
+
+       np = of_find_compatible_node(NULL, NULL, "fsl,vf610-anatop");
+       anatop_base = of_iomap(np, 0);
+       BUG_ON(!anatop_base);
+
+       np = ccm_node;
+       ccm_base = of_iomap(np, 0);
+       BUG_ON(!ccm_base);
+
+       clk[VF610_CLK_SLOW_CLK_SEL] = imx_clk_mux("slow_clk_sel", CCM_CCSR, 4, 1, slow_sels, ARRAY_SIZE(slow_sels));
+       clk[VF610_CLK_FASK_CLK_SEL] = imx_clk_mux("fast_clk_sel", CCM_CCSR, 5, 1, fast_sels, ARRAY_SIZE(fast_sels));
+
+       clk[VF610_CLK_PLL1_BYPASS_SRC] = imx_clk_mux("pll1_bypass_src", PLL1_CTRL, 14, 1, pll_bypass_src_sels, ARRAY_SIZE(pll_bypass_src_sels));
+       clk[VF610_CLK_PLL2_BYPASS_SRC] = imx_clk_mux("pll2_bypass_src", PLL2_CTRL, 14, 1, pll_bypass_src_sels, ARRAY_SIZE(pll_bypass_src_sels));
+       clk[VF610_CLK_PLL3_BYPASS_SRC] = imx_clk_mux("pll3_bypass_src", PLL3_CTRL, 14, 1, pll_bypass_src_sels, ARRAY_SIZE(pll_bypass_src_sels));
+       clk[VF610_CLK_PLL4_BYPASS_SRC] = imx_clk_mux("pll4_bypass_src", PLL4_CTRL, 14, 1, pll_bypass_src_sels, ARRAY_SIZE(pll_bypass_src_sels));
+       clk[VF610_CLK_PLL5_BYPASS_SRC] = imx_clk_mux("pll5_bypass_src", PLL5_CTRL, 14, 1, pll_bypass_src_sels, ARRAY_SIZE(pll_bypass_src_sels));
+       clk[VF610_CLK_PLL6_BYPASS_SRC] = imx_clk_mux("pll6_bypass_src", PLL6_CTRL, 14, 1, pll_bypass_src_sels, ARRAY_SIZE(pll_bypass_src_sels));
+       clk[VF610_CLK_PLL7_BYPASS_SRC] = imx_clk_mux("pll7_bypass_src", PLL7_CTRL, 14, 1, pll_bypass_src_sels, ARRAY_SIZE(pll_bypass_src_sels));
+
+       clk[VF610_CLK_PLL1] = imx_clk_pllv3(IMX_PLLV3_GENERIC, "pll1", "pll1_bypass_src", PLL1_CTRL, 0x1);
+       clk[VF610_CLK_PLL2] = imx_clk_pllv3(IMX_PLLV3_GENERIC, "pll2", "pll2_bypass_src", PLL2_CTRL, 0x1);
+       clk[VF610_CLK_PLL3] = imx_clk_pllv3(IMX_PLLV3_USB_VF610,     "pll3", "pll3_bypass_src", PLL3_CTRL, 0x2);
+       clk[VF610_CLK_PLL4] = imx_clk_pllv3(IMX_PLLV3_AV,      "pll4", "pll4_bypass_src", PLL4_CTRL, 0x7f);
+       clk[VF610_CLK_PLL5] = imx_clk_pllv3(IMX_PLLV3_ENET,    "pll5", "pll5_bypass_src", PLL5_CTRL, 0x3);
+       clk[VF610_CLK_PLL6] = imx_clk_pllv3(IMX_PLLV3_AV,      "pll6", "pll6_bypass_src", PLL6_CTRL, 0x7f);
+       clk[VF610_CLK_PLL7] = imx_clk_pllv3(IMX_PLLV3_USB_VF610,     "pll7", "pll7_bypass_src", PLL7_CTRL, 0x2);
+
+       clk[VF610_PLL1_BYPASS] = imx_clk_mux_flags("pll1_bypass", PLL1_CTRL, 16, 1, pll1_bypass_sels, ARRAY_SIZE(pll1_bypass_sels), CLK_SET_RATE_PARENT);
+       clk[VF610_PLL2_BYPASS] = imx_clk_mux_flags("pll2_bypass", PLL2_CTRL, 16, 1, pll2_bypass_sels, ARRAY_SIZE(pll2_bypass_sels), CLK_SET_RATE_PARENT);
+       clk[VF610_PLL3_BYPASS] = imx_clk_mux_flags("pll3_bypass", PLL3_CTRL, 16, 1, pll3_bypass_sels, ARRAY_SIZE(pll3_bypass_sels), CLK_SET_RATE_PARENT);
+       clk[VF610_PLL4_BYPASS] = imx_clk_mux_flags("pll4_bypass", PLL4_CTRL, 16, 1, pll4_bypass_sels, ARRAY_SIZE(pll4_bypass_sels), CLK_SET_RATE_PARENT);
+       clk[VF610_PLL5_BYPASS] = imx_clk_mux_flags("pll5_bypass", PLL5_CTRL, 16, 1, pll5_bypass_sels, ARRAY_SIZE(pll5_bypass_sels), CLK_SET_RATE_PARENT);
+       clk[VF610_PLL6_BYPASS] = imx_clk_mux_flags("pll6_bypass", PLL6_CTRL, 16, 1, pll6_bypass_sels, ARRAY_SIZE(pll6_bypass_sels), CLK_SET_RATE_PARENT);
+       clk[VF610_PLL7_BYPASS] = imx_clk_mux_flags("pll7_bypass", PLL7_CTRL, 16, 1, pll7_bypass_sels, ARRAY_SIZE(pll7_bypass_sels), CLK_SET_RATE_PARENT);
+
+       /* Do not bypass PLLs initially */
+       clk_set_parent(clk[VF610_PLL1_BYPASS], clk[VF610_CLK_PLL1]);
+       clk_set_parent(clk[VF610_PLL2_BYPASS], clk[VF610_CLK_PLL2]);
+       clk_set_parent(clk[VF610_PLL3_BYPASS], clk[VF610_CLK_PLL3]);
+       clk_set_parent(clk[VF610_PLL4_BYPASS], clk[VF610_CLK_PLL4]);
+       clk_set_parent(clk[VF610_PLL5_BYPASS], clk[VF610_CLK_PLL5]);
+       clk_set_parent(clk[VF610_PLL6_BYPASS], clk[VF610_CLK_PLL6]);
+       clk_set_parent(clk[VF610_PLL7_BYPASS], clk[VF610_CLK_PLL7]);
+
+       clk[VF610_CLK_PLL1_SYS]      = imx_clk_gate("pll1_sys",      "pll1_bypass", PLL1_CTRL, 13);
+       clk[VF610_CLK_PLL2_BUS]      = imx_clk_gate("pll2_bus",      "pll2_bypass", PLL2_CTRL, 13);
+       clk[VF610_CLK_PLL3_USB_OTG]  = imx_clk_gate("pll3_usb_otg",  "pll3_bypass", PLL3_CTRL, 13);
+       clk[VF610_CLK_PLL4_AUDIO]    = imx_clk_gate("pll4_audio",    "pll4_bypass", PLL4_CTRL, 13);
+       clk[VF610_CLK_PLL5_ENET]     = imx_clk_gate("pll5_enet",     "pll5_bypass", PLL5_CTRL, 13);
+       clk[VF610_CLK_PLL6_VIDEO]    = imx_clk_gate("pll6_video",    "pll6_bypass", PLL6_CTRL, 13);
+       clk[VF610_CLK_PLL7_USB_HOST] = imx_clk_gate("pll7_usb_host", "pll7_bypass", PLL7_CTRL, 13);
+
+       clk[VF610_CLK_LVDS1_IN]  = imx_clk_gate_exclusive("lvds1_in", "anaclk1", ANA_MISC1, 12, BIT(10));
+
+       clk[VF610_CLK_PLL1_PFD1] = imx_clk_pfd("pll1_pfd1", "pll1_sys", PFD_PLL1_BASE, 0);
+       clk[VF610_CLK_PLL1_PFD2] = imx_clk_pfd("pll1_pfd2", "pll1_sys", PFD_PLL1_BASE, 1);
+       clk[VF610_CLK_PLL1_PFD3] = imx_clk_pfd("pll1_pfd3", "pll1_sys", PFD_PLL1_BASE, 2);
+       clk[VF610_CLK_PLL1_PFD4] = imx_clk_pfd("pll1_pfd4", "pll1_sys", PFD_PLL1_BASE, 3);
+
+       clk[VF610_CLK_PLL2_PFD1] = imx_clk_pfd("pll2_pfd1", "pll2_bus", PFD_PLL2_BASE, 0);
+       clk[VF610_CLK_PLL2_PFD2] = imx_clk_pfd("pll2_pfd2", "pll2_bus", PFD_PLL2_BASE, 1);
+       clk[VF610_CLK_PLL2_PFD3] = imx_clk_pfd("pll2_pfd3", "pll2_bus", PFD_PLL2_BASE, 2);
+       clk[VF610_CLK_PLL2_PFD4] = imx_clk_pfd("pll2_pfd4", "pll2_bus", PFD_PLL2_BASE, 3);
+
+       clk[VF610_CLK_PLL3_PFD1] = imx_clk_pfd("pll3_pfd1", "pll3_usb_otg", PFD_PLL3_BASE, 0);
+       clk[VF610_CLK_PLL3_PFD2] = imx_clk_pfd("pll3_pfd2", "pll3_usb_otg", PFD_PLL3_BASE, 1);
+       clk[VF610_CLK_PLL3_PFD3] = imx_clk_pfd("pll3_pfd3", "pll3_usb_otg", PFD_PLL3_BASE, 2);
+       clk[VF610_CLK_PLL3_PFD4] = imx_clk_pfd("pll3_pfd4", "pll3_usb_otg", PFD_PLL3_BASE, 3);
+
+       clk[VF610_CLK_PLL1_PFD_SEL] = imx_clk_mux("pll1_pfd_sel", CCM_CCSR, 16, 3, pll1_sels, 5);
+       clk[VF610_CLK_PLL2_PFD_SEL] = imx_clk_mux("pll2_pfd_sel", CCM_CCSR, 19, 3, pll2_sels, 5);
+       clk[VF610_CLK_SYS_SEL] = imx_clk_mux("sys_sel", CCM_CCSR, 0, 3, sys_sels, ARRAY_SIZE(sys_sels));
+       clk[VF610_CLK_DDR_SEL] = imx_clk_mux("ddr_sel", CCM_CCSR, 6, 1, ddr_sels, ARRAY_SIZE(ddr_sels));
+       clk[VF610_CLK_SYS_BUS] = imx_clk_divider("sys_bus", "sys_sel", CCM_CACRR, 0, 3);
+       clk[VF610_CLK_PLATFORM_BUS] = imx_clk_divider("platform_bus", "sys_bus", CCM_CACRR, 3, 3);
+       clk[VF610_CLK_IPG_BUS] = imx_clk_divider("ipg_bus", "platform_bus", CCM_CACRR, 11, 2);
+
+       clk[VF610_CLK_PLL3_MAIN_DIV] = imx_clk_divider("pll3_usb_otg_div", "pll3_usb_otg", CCM_CACRR, 20, 1);
+       clk[VF610_CLK_PLL4_MAIN_DIV] = clk_register_divider_table(NULL, "pll4_audio_div", "pll4_audio", 0, CCM_CACRR, 6, 3, 0, pll4_audio_div_table, &imx_ccm_lock);
+       clk[VF610_CLK_PLL6_MAIN_DIV] = imx_clk_divider("pll6_video_div", "pll6_video", CCM_CACRR, 21, 1);
+
+       clk[VF610_CLK_USBPHY0] = imx_clk_gate("usbphy0", "pll3_usb_otg", PLL3_CTRL, 6);
+       clk[VF610_CLK_USBPHY1] = imx_clk_gate("usbphy1", "pll7_usb_host", PLL7_CTRL, 6);
+
+       clk[VF610_CLK_USBC0] = imx_clk_gate2("usbc0", "ipg_bus", CCM_CCGR1, CCM_CCGRx_CGn(4));
+       clk[VF610_CLK_USBC1] = imx_clk_gate2("usbc1", "ipg_bus", CCM_CCGR7, CCM_CCGRx_CGn(4));
+
+       clk[VF610_CLK_QSPI0_SEL] = imx_clk_mux("qspi0_sel", CCM_CSCMR1, 22, 2, qspi_sels, 4);
+       clk[VF610_CLK_QSPI0_EN] = imx_clk_gate("qspi0_en", "qspi0_sel", CCM_CSCDR3, 4);
+       clk[VF610_CLK_QSPI0_X4_DIV] = imx_clk_divider("qspi0_x4", "qspi0_en", CCM_CSCDR3, 0, 2);
+       clk[VF610_CLK_QSPI0_X2_DIV] = imx_clk_divider("qspi0_x2", "qspi0_x4", CCM_CSCDR3, 2, 1);
+       clk[VF610_CLK_QSPI0_X1_DIV] = imx_clk_divider("qspi0_x1", "qspi0_x2", CCM_CSCDR3, 3, 1);
+       clk[VF610_CLK_QSPI0] = imx_clk_gate2("qspi0", "qspi0_x1", CCM_CCGR2, CCM_CCGRx_CGn(4));
+
+       clk[VF610_CLK_QSPI1_SEL] = imx_clk_mux("qspi1_sel", CCM_CSCMR1, 24, 2, qspi_sels, 4);
+       clk[VF610_CLK_QSPI1_EN] = imx_clk_gate("qspi1_en", "qspi1_sel", CCM_CSCDR3, 12);
+       clk[VF610_CLK_QSPI1_X4_DIV] = imx_clk_divider("qspi1_x4", "qspi1_en", CCM_CSCDR3, 8, 2);
+       clk[VF610_CLK_QSPI1_X2_DIV] = imx_clk_divider("qspi1_x2", "qspi1_x4", CCM_CSCDR3, 10, 1);
+       clk[VF610_CLK_QSPI1_X1_DIV] = imx_clk_divider("qspi1_x1", "qspi1_x2", CCM_CSCDR3, 11, 1);
+       clk[VF610_CLK_QSPI1] = imx_clk_gate2("qspi1", "qspi1_x1", CCM_CCGR8, CCM_CCGRx_CGn(4));
+
+       clk[VF610_CLK_ENET_50M] = imx_clk_fixed_factor("enet_50m", "pll5_enet", 1, 10);
+       clk[VF610_CLK_ENET_25M] = imx_clk_fixed_factor("enet_25m", "pll5_enet", 1, 20);
+       clk[VF610_CLK_ENET_SEL] = imx_clk_mux("enet_sel", CCM_CSCMR2, 4, 2, rmii_sels, 4);
+       clk[VF610_CLK_ENET_TS_SEL] = imx_clk_mux("enet_ts_sel", CCM_CSCMR2, 0, 3, enet_ts_sels, 7);
+       clk[VF610_CLK_ENET] = imx_clk_gate("enet", "enet_sel", CCM_CSCDR1, 24);
+       clk[VF610_CLK_ENET_TS] = imx_clk_gate("enet_ts", "enet_ts_sel", CCM_CSCDR1, 23);
+       clk[VF610_CLK_ENET0] = imx_clk_gate2("enet0", "ipg_bus", CCM_CCGR9, CCM_CCGRx_CGn(0));
+       clk[VF610_CLK_ENET1] = imx_clk_gate2("enet1", "ipg_bus", CCM_CCGR9, CCM_CCGRx_CGn(1));
+
+       clk[VF610_CLK_PIT] = imx_clk_gate2("pit", "ipg_bus", CCM_CCGR1, CCM_CCGRx_CGn(7));
+
+       clk[VF610_CLK_UART0] = imx_clk_gate2("uart0", "ipg_bus", CCM_CCGR0, CCM_CCGRx_CGn(7));
+       clk[VF610_CLK_UART1] = imx_clk_gate2("uart1", "ipg_bus", CCM_CCGR0, CCM_CCGRx_CGn(8));
+       clk[VF610_CLK_UART2] = imx_clk_gate2("uart2", "ipg_bus", CCM_CCGR0, CCM_CCGRx_CGn(9));
+       clk[VF610_CLK_UART3] = imx_clk_gate2("uart3", "ipg_bus", CCM_CCGR0, CCM_CCGRx_CGn(10));
+       clk[VF610_CLK_UART4] = imx_clk_gate2("uart4", "ipg_bus", CCM_CCGR6, CCM_CCGRx_CGn(9));
+       clk[VF610_CLK_UART5] = imx_clk_gate2("uart5", "ipg_bus", CCM_CCGR6, CCM_CCGRx_CGn(10));
+
+       clk[VF610_CLK_I2C0] = imx_clk_gate2("i2c0", "ipg_bus", CCM_CCGR4, CCM_CCGRx_CGn(6));
+       clk[VF610_CLK_I2C1] = imx_clk_gate2("i2c1", "ipg_bus", CCM_CCGR4, CCM_CCGRx_CGn(7));
+       clk[VF610_CLK_I2C2] = imx_clk_gate2("i2c2", "ipg_bus", CCM_CCGR10, CCM_CCGRx_CGn(6));
+       clk[VF610_CLK_I2C3] = imx_clk_gate2("i2c3", "ipg_bus", CCM_CCGR10, CCM_CCGRx_CGn(7));
+
+       clk[VF610_CLK_DSPI0] = imx_clk_gate2("dspi0", "ipg_bus", CCM_CCGR0, CCM_CCGRx_CGn(12));
+       clk[VF610_CLK_DSPI1] = imx_clk_gate2("dspi1", "ipg_bus", CCM_CCGR0, CCM_CCGRx_CGn(13));
+       clk[VF610_CLK_DSPI2] = imx_clk_gate2("dspi2", "ipg_bus", CCM_CCGR6, CCM_CCGRx_CGn(12));
+       clk[VF610_CLK_DSPI3] = imx_clk_gate2("dspi3", "ipg_bus", CCM_CCGR6, CCM_CCGRx_CGn(13));
+
+       clk[VF610_CLK_WDT] = imx_clk_gate2("wdt", "ipg_bus", CCM_CCGR1, CCM_CCGRx_CGn(14));
+
+       clk[VF610_CLK_ESDHC0_SEL] = imx_clk_mux("esdhc0_sel", CCM_CSCMR1, 16, 2, esdhc_sels, 4);
+       clk[VF610_CLK_ESDHC0_EN] = imx_clk_gate("esdhc0_en", "esdhc0_sel", CCM_CSCDR2, 28);
+       clk[VF610_CLK_ESDHC0_DIV] = imx_clk_divider("esdhc0_div", "esdhc0_en", CCM_CSCDR2, 16, 4);
+       clk[VF610_CLK_ESDHC0] = imx_clk_gate2("eshc0", "esdhc0_div", CCM_CCGR7, CCM_CCGRx_CGn(1));
+
+       clk[VF610_CLK_ESDHC1_SEL] = imx_clk_mux("esdhc1_sel", CCM_CSCMR1, 18, 2, esdhc_sels, 4);
+       clk[VF610_CLK_ESDHC1_EN] = imx_clk_gate("esdhc1_en", "esdhc1_sel", CCM_CSCDR2, 29);
+       clk[VF610_CLK_ESDHC1_DIV] = imx_clk_divider("esdhc1_div", "esdhc1_en", CCM_CSCDR2, 20, 4);
+       clk[VF610_CLK_ESDHC1] = imx_clk_gate2("eshc1", "esdhc1_div", CCM_CCGR7, CCM_CCGRx_CGn(2));
+
+       /*
+        * ftm_ext_clk and ftm_fix_clk are FTM timer counter's
+        * selectable clock sources, both use a common enable bit
+        * in CCM_CSCDR1, selecting "dummy" clock as parent of
+        * "ftm0_ext_fix" make it serve only for enable/disable.
+        */
+       clk[VF610_CLK_FTM0_EXT_SEL] = imx_clk_mux("ftm0_ext_sel", CCM_CSCMR2, 6, 2, ftm_ext_sels, 4);
+       clk[VF610_CLK_FTM0_FIX_SEL] = imx_clk_mux("ftm0_fix_sel", CCM_CSCMR2, 14, 1, ftm_fix_sels, 2);
+       clk[VF610_CLK_FTM0_EXT_FIX_EN] = imx_clk_gate("ftm0_ext_fix_en", "dummy", CCM_CSCDR1, 25);
+       clk[VF610_CLK_FTM1_EXT_SEL] = imx_clk_mux("ftm1_ext_sel", CCM_CSCMR2, 8, 2, ftm_ext_sels, 4);
+       clk[VF610_CLK_FTM1_FIX_SEL] = imx_clk_mux("ftm1_fix_sel", CCM_CSCMR2, 15, 1, ftm_fix_sels, 2);
+       clk[VF610_CLK_FTM1_EXT_FIX_EN] = imx_clk_gate("ftm1_ext_fix_en", "dummy", CCM_CSCDR1, 26);
+       clk[VF610_CLK_FTM2_EXT_SEL] = imx_clk_mux("ftm2_ext_sel", CCM_CSCMR2, 10, 2, ftm_ext_sels, 4);
+       clk[VF610_CLK_FTM2_FIX_SEL] = imx_clk_mux("ftm2_fix_sel", CCM_CSCMR2, 16, 1, ftm_fix_sels, 2);
+       clk[VF610_CLK_FTM2_EXT_FIX_EN] = imx_clk_gate("ftm2_ext_fix_en", "dummy", CCM_CSCDR1, 27);
+       clk[VF610_CLK_FTM3_EXT_SEL] = imx_clk_mux("ftm3_ext_sel", CCM_CSCMR2, 12, 2, ftm_ext_sels, 4);
+       clk[VF610_CLK_FTM3_FIX_SEL] = imx_clk_mux("ftm3_fix_sel", CCM_CSCMR2, 17, 1, ftm_fix_sels, 2);
+       clk[VF610_CLK_FTM3_EXT_FIX_EN] = imx_clk_gate("ftm3_ext_fix_en", "dummy", CCM_CSCDR1, 28);
+
+       /* ftm(n)_clk are FTM module operation clock */
+       clk[VF610_CLK_FTM0] = imx_clk_gate2("ftm0", "ipg_bus", CCM_CCGR1, CCM_CCGRx_CGn(8));
+       clk[VF610_CLK_FTM1] = imx_clk_gate2("ftm1", "ipg_bus", CCM_CCGR1, CCM_CCGRx_CGn(9));
+       clk[VF610_CLK_FTM2] = imx_clk_gate2("ftm2", "ipg_bus", CCM_CCGR7, CCM_CCGRx_CGn(8));
+       clk[VF610_CLK_FTM3] = imx_clk_gate2("ftm3", "ipg_bus", CCM_CCGR7, CCM_CCGRx_CGn(9));
+
+       clk[VF610_CLK_DCU0_SEL] = imx_clk_mux("dcu0_sel", CCM_CSCMR1, 28, 1, dcu_sels, 2);
+       clk[VF610_CLK_DCU0_EN] = imx_clk_gate("dcu0_en", "dcu0_sel", CCM_CSCDR3, 19);
+       clk[VF610_CLK_DCU0_DIV] = imx_clk_divider("dcu0_div", "dcu0_en", CCM_CSCDR3, 16, 3);
+       clk[VF610_CLK_DCU0] = imx_clk_gate2("dcu0", "dcu0_div", CCM_CCGR3, CCM_CCGRx_CGn(8));
+       clk[VF610_CLK_DCU1_SEL] = imx_clk_mux("dcu1_sel", CCM_CSCMR1, 29, 1, dcu_sels, 2);
+       clk[VF610_CLK_DCU1_EN] = imx_clk_gate("dcu1_en", "dcu1_sel", CCM_CSCDR3, 23);
+       clk[VF610_CLK_DCU1_DIV] = imx_clk_divider("dcu1_div", "dcu1_en", CCM_CSCDR3, 20, 3);
+       clk[VF610_CLK_DCU1] = imx_clk_gate2("dcu1", "dcu1_div", CCM_CCGR9, CCM_CCGRx_CGn(8));
+
+       clk[VF610_CLK_ESAI_SEL] = imx_clk_mux("esai_sel", CCM_CSCMR1, 20, 2, esai_sels, 4);
+       clk[VF610_CLK_ESAI_EN] = imx_clk_gate("esai_en", "esai_sel", CCM_CSCDR2, 30);
+       clk[VF610_CLK_ESAI_DIV] = imx_clk_divider("esai_div", "esai_en", CCM_CSCDR2, 24, 4);
+       clk[VF610_CLK_ESAI] = imx_clk_gate2("esai", "esai_div", CCM_CCGR4, CCM_CCGRx_CGn(2));
+
+       clk[VF610_CLK_SAI0_SEL] = imx_clk_mux("sai0_sel", CCM_CSCMR1, 0, 2, sai_sels, 4);
+       clk[VF610_CLK_SAI0_EN] = imx_clk_gate("sai0_en", "sai0_sel", CCM_CSCDR1, 16);
+       clk[VF610_CLK_SAI0_DIV] = imx_clk_divider("sai0_div", "sai0_en", CCM_CSCDR1, 0, 4);
+       clk[VF610_CLK_SAI0] = imx_clk_gate2("sai0", "sai0_div", CCM_CCGR0, CCM_CCGRx_CGn(15));
+
+       clk[VF610_CLK_SAI1_SEL] = imx_clk_mux("sai1_sel", CCM_CSCMR1, 2, 2, sai_sels, 4);
+       clk[VF610_CLK_SAI1_EN] = imx_clk_gate("sai1_en", "sai1_sel", CCM_CSCDR1, 17);
+       clk[VF610_CLK_SAI1_DIV] = imx_clk_divider("sai1_div", "sai1_en", CCM_CSCDR1, 4, 4);
+       clk[VF610_CLK_SAI1] = imx_clk_gate2("sai1", "sai1_div", CCM_CCGR1, CCM_CCGRx_CGn(0));
+
+       clk[VF610_CLK_SAI2_SEL] = imx_clk_mux("sai2_sel", CCM_CSCMR1, 4, 2, sai_sels, 4);
+       clk[VF610_CLK_SAI2_EN] = imx_clk_gate("sai2_en", "sai2_sel", CCM_CSCDR1, 18);
+       clk[VF610_CLK_SAI2_DIV] = imx_clk_divider("sai2_div", "sai2_en", CCM_CSCDR1, 8, 4);
+       clk[VF610_CLK_SAI2] = imx_clk_gate2("sai2", "sai2_div", CCM_CCGR1, CCM_CCGRx_CGn(1));
+
+       clk[VF610_CLK_SAI3_SEL] = imx_clk_mux("sai3_sel", CCM_CSCMR1, 6, 2, sai_sels, 4);
+       clk[VF610_CLK_SAI3_EN] = imx_clk_gate("sai3_en", "sai3_sel", CCM_CSCDR1, 19);
+       clk[VF610_CLK_SAI3_DIV] = imx_clk_divider("sai3_div", "sai3_en", CCM_CSCDR1, 12, 4);
+       clk[VF610_CLK_SAI3] = imx_clk_gate2("sai3", "sai3_div", CCM_CCGR1, CCM_CCGRx_CGn(2));
+
+       clk[VF610_CLK_NFC_SEL] = imx_clk_mux("nfc_sel", CCM_CSCMR1, 12, 2, nfc_sels, 4);
+       clk[VF610_CLK_NFC_EN] = imx_clk_gate("nfc_en", "nfc_sel", CCM_CSCDR2, 9);
+       clk[VF610_CLK_NFC_PRE_DIV] = imx_clk_divider("nfc_pre_div", "nfc_en", CCM_CSCDR3, 13, 3);
+       clk[VF610_CLK_NFC_FRAC_DIV] = imx_clk_divider("nfc_frac_div", "nfc_pre_div", CCM_CSCDR2, 4, 4);
+       clk[VF610_CLK_NFC] = imx_clk_gate2("nfc", "nfc_frac_div", CCM_CCGR10, CCM_CCGRx_CGn(0));
+
+       clk[VF610_CLK_GPU_SEL] = imx_clk_mux("gpu_sel", CCM_CSCMR1, 14, 1, gpu_sels, 2);
+       clk[VF610_CLK_GPU_EN] = imx_clk_gate("gpu_en", "gpu_sel", CCM_CSCDR2, 10);
+       clk[VF610_CLK_GPU2D] = imx_clk_gate2("gpu", "gpu_en", CCM_CCGR8, CCM_CCGRx_CGn(15));
+
+       clk[VF610_CLK_VADC_SEL] = imx_clk_mux("vadc_sel", CCM_CSCMR1, 8, 2, vadc_sels, 3);
+       clk[VF610_CLK_VADC_EN] = imx_clk_gate("vadc_en", "vadc_sel", CCM_CSCDR1, 22);
+       clk[VF610_CLK_VADC_DIV] = imx_clk_divider("vadc_div", "vadc_en", CCM_CSCDR1, 20, 2);
+       clk[VF610_CLK_VADC_DIV_HALF] = imx_clk_fixed_factor("vadc_div_half", "vadc_div", 1, 2);
+       clk[VF610_CLK_VADC] = imx_clk_gate2("vadc", "vadc_div", CCM_CCGR8, CCM_CCGRx_CGn(7));
+
+       clk[VF610_CLK_ADC0] = imx_clk_gate2("adc0", "ipg_bus", CCM_CCGR1, CCM_CCGRx_CGn(11));
+       clk[VF610_CLK_ADC1] = imx_clk_gate2("adc1", "ipg_bus", CCM_CCGR7, CCM_CCGRx_CGn(11));
+       clk[VF610_CLK_DAC0] = imx_clk_gate2("dac0", "ipg_bus", CCM_CCGR8, CCM_CCGRx_CGn(12));
+       clk[VF610_CLK_DAC1] = imx_clk_gate2("dac1", "ipg_bus", CCM_CCGR8, CCM_CCGRx_CGn(13));
+
+       clk[VF610_CLK_ASRC] = imx_clk_gate2("asrc", "ipg_bus", CCM_CCGR4, CCM_CCGRx_CGn(1));
+
+       clk[VF610_CLK_FLEXCAN0_EN] = imx_clk_gate("flexcan0_en", "ipg_bus", CCM_CSCDR2, 11);
+       clk[VF610_CLK_FLEXCAN0] = imx_clk_gate2("flexcan0", "flexcan0_en", CCM_CCGR0, CCM_CCGRx_CGn(0));
+       clk[VF610_CLK_FLEXCAN1_EN] = imx_clk_gate("flexcan1_en", "ipg_bus", CCM_CSCDR2, 12);
+       clk[VF610_CLK_FLEXCAN1] = imx_clk_gate2("flexcan1", "flexcan1_en", CCM_CCGR9, CCM_CCGRx_CGn(4));
+
+       clk[VF610_CLK_DMAMUX0] = imx_clk_gate2("dmamux0", "platform_bus", CCM_CCGR0, CCM_CCGRx_CGn(4));
+       clk[VF610_CLK_DMAMUX1] = imx_clk_gate2("dmamux1", "platform_bus", CCM_CCGR0, CCM_CCGRx_CGn(5));
+       clk[VF610_CLK_DMAMUX2] = imx_clk_gate2("dmamux2", "platform_bus", CCM_CCGR6, CCM_CCGRx_CGn(1));
+       clk[VF610_CLK_DMAMUX3] = imx_clk_gate2("dmamux3", "platform_bus", CCM_CCGR6, CCM_CCGRx_CGn(2));
+
+       clk[VF610_CLK_SNVS] = imx_clk_gate2("snvs-rtc", "ipg_bus", CCM_CCGR6, CCM_CCGRx_CGn(7));
+       clk[VF610_CLK_DAP] = imx_clk_gate("dap", "platform_bus", CCM_CCSR, 24);
+
+       imx_check_clocks(clk, ARRAY_SIZE(clk));
+
+       clk_set_parent(clk[VF610_CLK_QSPI0_SEL], clk[VF610_CLK_PLL1_PFD4]);
+       clk_set_rate(clk[VF610_CLK_QSPI0_X4_DIV], clk_get_rate(clk[VF610_CLK_QSPI0_SEL]) / 2);
+       clk_set_rate(clk[VF610_CLK_QSPI0_X2_DIV], clk_get_rate(clk[VF610_CLK_QSPI0_X4_DIV]) / 2);
+       clk_set_rate(clk[VF610_CLK_QSPI0_X1_DIV], clk_get_rate(clk[VF610_CLK_QSPI0_X2_DIV]) / 2);
+
+       clk_set_parent(clk[VF610_CLK_QSPI1_SEL], clk[VF610_CLK_PLL1_PFD4]);
+       clk_set_rate(clk[VF610_CLK_QSPI1_X4_DIV], clk_get_rate(clk[VF610_CLK_QSPI1_SEL]) / 2);
+       clk_set_rate(clk[VF610_CLK_QSPI1_X2_DIV], clk_get_rate(clk[VF610_CLK_QSPI1_X4_DIV]) / 2);
+       clk_set_rate(clk[VF610_CLK_QSPI1_X1_DIV], clk_get_rate(clk[VF610_CLK_QSPI1_X2_DIV]) / 2);
+
+       clk_set_parent(clk[VF610_CLK_SAI0_SEL], clk[VF610_CLK_AUDIO_EXT]);
+       clk_set_parent(clk[VF610_CLK_SAI1_SEL], clk[VF610_CLK_AUDIO_EXT]);
+       clk_set_parent(clk[VF610_CLK_SAI2_SEL], clk[VF610_CLK_AUDIO_EXT]);
+       clk_set_parent(clk[VF610_CLK_SAI3_SEL], clk[VF610_CLK_AUDIO_EXT]);
+
+       for (i = 0; i < ARRAY_SIZE(clks_init_on); i++)
+               clk_prepare_enable(clk[clks_init_on[i]]);
+
+       /* Add the clocks to provider list */
+       clk_data.clks = clk;
+       clk_data.clk_num = ARRAY_SIZE(clk);
+       of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
+}
+CLK_OF_DECLARE(vf610, "fsl,vf610-ccm", vf610_clocks_init);
diff --git a/drivers/clk/imx/clk.c b/drivers/clk/imx/clk.c
new file mode 100644 (file)
index 0000000..df12b53
--- /dev/null
@@ -0,0 +1,75 @@
+#include <linux/clk.h>
+#include <linux/err.h>
+#include <linux/of.h>
+#include <linux/slab.h>
+#include <linux/spinlock.h>
+#include "clk.h"
+
+DEFINE_SPINLOCK(imx_ccm_lock);
+
+void __init imx_check_clocks(struct clk *clks[], unsigned int count)
+{
+       unsigned i;
+
+       for (i = 0; i < count; i++)
+               if (IS_ERR(clks[i]))
+                       pr_err("i.MX clk %u: register failed with %ld\n",
+                              i, PTR_ERR(clks[i]));
+}
+
+static struct clk * __init imx_obtain_fixed_clock_from_dt(const char *name)
+{
+       struct of_phandle_args phandle;
+       struct clk *clk = ERR_PTR(-ENODEV);
+       char *path;
+
+       path = kasprintf(GFP_KERNEL, "/clocks/%s", name);
+       if (!path)
+               return ERR_PTR(-ENOMEM);
+
+       phandle.np = of_find_node_by_path(path);
+       kfree(path);
+
+       if (phandle.np) {
+               clk = of_clk_get_from_provider(&phandle);
+               of_node_put(phandle.np);
+       }
+       return clk;
+}
+
+struct clk * __init imx_obtain_fixed_clock(
+                       const char *name, unsigned long rate)
+{
+       struct clk *clk;
+
+       clk = imx_obtain_fixed_clock_from_dt(name);
+       if (IS_ERR(clk))
+               clk = imx_clk_fixed(name, rate);
+       return clk;
+}
+
+/*
+ * This fixups the register CCM_CSCMR1 write value.
+ * The write/read/divider values of the aclk_podf field
+ * of that register have the relationship described by
+ * the following table:
+ *
+ * write value       read value        divider
+ * 3b'000            3b'110            7
+ * 3b'001            3b'111            8
+ * 3b'010            3b'100            5
+ * 3b'011            3b'101            6
+ * 3b'100            3b'010            3
+ * 3b'101            3b'011            4
+ * 3b'110            3b'000            1
+ * 3b'111            3b'001            2(default)
+ *
+ * That's why we do the xor operation below.
+ */
+#define CSCMR1_FIXUP   0x00600000
+
+void imx_cscmr1_fixup(u32 *val)
+{
+       *val ^= CSCMR1_FIXUP;
+       return;
+}
diff --git a/drivers/clk/imx/clk.h b/drivers/clk/imx/clk.h
new file mode 100644 (file)
index 0000000..1049b0c
--- /dev/null
@@ -0,0 +1,149 @@
+#ifndef __MACH_IMX_CLK_H
+#define __MACH_IMX_CLK_H
+
+#include <linux/spinlock.h>
+#include <linux/clk-provider.h>
+
+extern spinlock_t imx_ccm_lock;
+
+void imx_check_clocks(struct clk *clks[], unsigned int count);
+
+extern void imx_cscmr1_fixup(u32 *val);
+
+enum imx_pllv1_type {
+       IMX_PLLV1_IMX1,
+       IMX_PLLV1_IMX21,
+       IMX_PLLV1_IMX25,
+       IMX_PLLV1_IMX27,
+       IMX_PLLV1_IMX31,
+       IMX_PLLV1_IMX35,
+};
+
+struct clk *imx_clk_pllv1(enum imx_pllv1_type type, const char *name,
+               const char *parent, void __iomem *base);
+
+struct clk *imx_clk_pllv2(const char *name, const char *parent,
+               void __iomem *base);
+
+enum imx_pllv3_type {
+       IMX_PLLV3_GENERIC,
+       IMX_PLLV3_SYS,
+       IMX_PLLV3_USB,
+       IMX_PLLV3_USB_VF610,
+       IMX_PLLV3_AV,
+       IMX_PLLV3_ENET,
+       IMX_PLLV3_ENET_IMX7,
+};
+
+struct clk *imx_clk_pllv3(enum imx_pllv3_type type, const char *name,
+               const char *parent_name, void __iomem *base, u32 div_mask);
+
+struct clk *clk_register_gate2(struct device *dev, const char *name,
+               const char *parent_name, unsigned long flags,
+               void __iomem *reg, u8 bit_idx,
+               u8 clk_gate_flags, spinlock_t *lock,
+               unsigned int *share_count);
+
+struct clk * imx_obtain_fixed_clock(
+                       const char *name, unsigned long rate);
+
+struct clk *imx_clk_gate_exclusive(const char *name, const char *parent,
+        void __iomem *reg, u8 shift, u32 exclusive_mask);
+
+static inline struct clk *imx_clk_gate2(const char *name, const char *parent,
+               void __iomem *reg, u8 shift)
+{
+       return clk_register_gate2(NULL, name, parent, CLK_SET_RATE_PARENT, reg,
+                       shift, 0, &imx_ccm_lock, NULL);
+}
+
+static inline struct clk *imx_clk_gate2_shared(const char *name,
+               const char *parent, void __iomem *reg, u8 shift,
+               unsigned int *share_count)
+{
+       return clk_register_gate2(NULL, name, parent, CLK_SET_RATE_PARENT, reg,
+                       shift, 0, &imx_ccm_lock, share_count);
+}
+
+struct clk *imx_clk_pfd(const char *name, const char *parent_name,
+               void __iomem *reg, u8 idx);
+
+struct clk *imx_clk_busy_divider(const char *name, const char *parent_name,
+                                void __iomem *reg, u8 shift, u8 width,
+                                void __iomem *busy_reg, u8 busy_shift);
+
+struct clk *imx_clk_busy_mux(const char *name, void __iomem *reg, u8 shift,
+                            u8 width, void __iomem *busy_reg, u8 busy_shift,
+                            const char **parent_names, int num_parents);
+
+struct clk *imx_clk_fixup_divider(const char *name, const char *parent,
+                                 void __iomem *reg, u8 shift, u8 width,
+                                 void (*fixup)(u32 *val));
+
+struct clk *imx_clk_fixup_mux(const char *name, void __iomem *reg,
+                             u8 shift, u8 width, const char **parents,
+                             int num_parents, void (*fixup)(u32 *val));
+
+static inline struct clk *imx_clk_fixed(const char *name, int rate)
+{
+       return clk_register_fixed_rate(NULL, name, NULL, CLK_IS_ROOT, rate);
+}
+
+static inline struct clk *imx_clk_divider(const char *name, const char *parent,
+               void __iomem *reg, u8 shift, u8 width)
+{
+       return clk_register_divider(NULL, name, parent, CLK_SET_RATE_PARENT,
+                       reg, shift, width, 0, &imx_ccm_lock);
+}
+
+static inline struct clk *imx_clk_divider_flags(const char *name,
+               const char *parent, void __iomem *reg, u8 shift, u8 width,
+               unsigned long flags)
+{
+       return clk_register_divider(NULL, name, parent, flags,
+                       reg, shift, width, 0, &imx_ccm_lock);
+}
+
+static inline struct clk *imx_clk_gate(const char *name, const char *parent,
+               void __iomem *reg, u8 shift)
+{
+       return clk_register_gate(NULL, name, parent, CLK_SET_RATE_PARENT, reg,
+                       shift, 0, &imx_ccm_lock);
+}
+
+static inline struct clk *imx_clk_gate_dis(const char *name, const char *parent,
+               void __iomem *reg, u8 shift)
+{
+       return clk_register_gate(NULL, name, parent, CLK_SET_RATE_PARENT, reg,
+                       shift, CLK_GATE_SET_TO_DISABLE, &imx_ccm_lock);
+}
+
+static inline struct clk *imx_clk_mux(const char *name, void __iomem *reg,
+               u8 shift, u8 width, const char **parents, int num_parents)
+{
+       return clk_register_mux(NULL, name, parents, num_parents,
+                       CLK_SET_RATE_NO_REPARENT, reg, shift,
+                       width, 0, &imx_ccm_lock);
+}
+
+static inline struct clk *imx_clk_mux_flags(const char *name,
+               void __iomem *reg, u8 shift, u8 width, const char **parents,
+               int num_parents, unsigned long flags)
+{
+       return clk_register_mux(NULL, name, parents, num_parents,
+                       flags | CLK_SET_RATE_NO_REPARENT, reg, shift, width, 0,
+                       &imx_ccm_lock);
+}
+
+static inline struct clk *imx_clk_fixed_factor(const char *name,
+               const char *parent, unsigned int mult, unsigned int div)
+{
+       return clk_register_fixed_factor(NULL, name, parent,
+                       CLK_SET_RATE_PARENT, mult, div);
+}
+
+struct clk *imx_clk_cpu(const char *name, const char *parent_name,
+               struct clk *div, struct clk *mux, struct clk *pll,
+               struct clk *step);
+
+#endif
index 5f9b54b024b9e1607b724c8ceb5dcfba7b58c992..9a31b77eed23511545f453022d9263db08b7add8 100644 (file)
@@ -353,6 +353,34 @@ static u8 clk_pxa27x_memory_get_parent(struct clk_hw *hw)
 PARENTS(clk_pxa27x_memory) = { "osc_13mhz", "system_bus", "run" };
 MUX_RO_RATE_RO_OPS(clk_pxa27x_memory, "memory");
 
+#define DUMMY_CLK(_con_id, _dev_id, _parent) \
+       { .con_id = _con_id, .dev_id = _dev_id, .parent = _parent }
+struct dummy_clk {
+       const char *con_id;
+       const char *dev_id;
+       const char *parent;
+};
+static struct dummy_clk dummy_clks[] __initdata = {
+       DUMMY_CLK(NULL, "pxa27x-gpio", "osc_32_768khz"),
+       DUMMY_CLK(NULL, "sa1100-rtc", "osc_32_768khz"),
+       DUMMY_CLK("UARTCLK", "pxa2xx-ir", "STUART"),
+};
+
+static void __init pxa27x_dummy_clocks_init(void)
+{
+       struct clk *clk;
+       struct dummy_clk *d;
+       const char *name;
+       int i;
+
+       for (i = 0; i < ARRAY_SIZE(dummy_clks); i++) {
+               d = &dummy_clks[i];
+               name = d->dev_id ? d->dev_id : d->con_id;
+               clk = clk_register_fixed_factor(NULL, name, d->parent, 0, 1, 1);
+               clk_register_clkdev(clk, d->con_id, d->dev_id);
+       }
+}
+
 static void __init pxa27x_base_clocks_init(void)
 {
        pxa27x_register_plls();
@@ -362,12 +390,12 @@ static void __init pxa27x_base_clocks_init(void)
        clk_register_clk_pxa27x_lcd_base();
 }
 
-static int __init pxa27x_clocks_init(void)
+int __init pxa27x_clocks_init(void)
 {
        pxa27x_base_clocks_init();
+       pxa27x_dummy_clocks_init();
        return clk_pxa_cken_init(pxa27x_clocks, ARRAY_SIZE(pxa27x_clocks));
 }
-postcore_initcall(pxa27x_clocks_init);
 
 static void __init pxa27x_dt_clocks_init(struct device_node *np)
 {
diff --git a/drivers/clk/zte/Makefile b/drivers/clk/zte/Makefile
new file mode 100644 (file)
index 0000000..95b707c
--- /dev/null
@@ -0,0 +1,2 @@
+obj-y := clk-pll.o
+obj-$(CONFIG_SOC_ZX296702) += clk-zx296702.o
diff --git a/drivers/clk/zte/clk-pll.c b/drivers/clk/zte/clk-pll.c
new file mode 100644 (file)
index 0000000..c3b221a
--- /dev/null
@@ -0,0 +1,172 @@
+/*
+ * Copyright 2014 Linaro Ltd.
+ * Copyright (C) 2014 ZTE 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.
+ */
+
+#include <linux/clk-provider.h>
+#include <linux/err.h>
+#include <linux/io.h>
+#include <linux/iopoll.h>
+#include <linux/slab.h>
+#include <linux/spinlock.h>
+
+#include "clk.h"
+
+#define to_clk_zx_pll(_hw) container_of(_hw, struct clk_zx_pll, hw)
+
+#define CFG0_CFG1_OFFSET 4
+#define LOCK_FLAG BIT(30)
+#define POWER_DOWN BIT(31)
+
+static int rate_to_idx(struct clk_zx_pll *zx_pll, unsigned long rate)
+{
+       const struct zx_pll_config *config = zx_pll->lookup_table;
+       int i;
+
+       for (i = 0; i < zx_pll->count; i++) {
+               if (config[i].rate > rate)
+                       return i > 0 ? i - 1 : 0;
+
+               if (config[i].rate == rate)
+                       return i;
+       }
+
+       return i - 1;
+}
+
+static int hw_to_idx(struct clk_zx_pll *zx_pll)
+{
+       const struct zx_pll_config *config = zx_pll->lookup_table;
+       u32 hw_cfg0, hw_cfg1;
+       int i;
+
+       hw_cfg0 = readl_relaxed(zx_pll->reg_base);
+       hw_cfg1 = readl_relaxed(zx_pll->reg_base + CFG0_CFG1_OFFSET);
+
+       /* For matching the value in lookup table */
+       hw_cfg0 &= ~LOCK_FLAG;
+       hw_cfg0 |= POWER_DOWN;
+
+       for (i = 0; i < zx_pll->count; i++) {
+               if (hw_cfg0 == config[i].cfg0 && hw_cfg1 == config[i].cfg1)
+                       return i;
+       }
+
+       return -EINVAL;
+}
+
+static unsigned long zx_pll_recalc_rate(struct clk_hw *hw,
+                                       unsigned long parent_rate)
+{
+       struct clk_zx_pll *zx_pll = to_clk_zx_pll(hw);
+       int idx;
+
+       idx = hw_to_idx(zx_pll);
+       if (unlikely(idx == -EINVAL))
+               return 0;
+
+       return zx_pll->lookup_table[idx].rate;
+}
+
+static long zx_pll_round_rate(struct clk_hw *hw, unsigned long rate,
+                             unsigned long *prate)
+{
+       struct clk_zx_pll *zx_pll = to_clk_zx_pll(hw);
+       int idx;
+
+       idx = rate_to_idx(zx_pll, rate);
+
+       return zx_pll->lookup_table[idx].rate;
+}
+
+static int zx_pll_set_rate(struct clk_hw *hw, unsigned long rate,
+                          unsigned long parent_rate)
+{
+       /* Assume current cpu is not running on current PLL */
+       struct clk_zx_pll *zx_pll = to_clk_zx_pll(hw);
+       const struct zx_pll_config *config;
+       int idx;
+
+       idx = rate_to_idx(zx_pll, rate);
+       config = &zx_pll->lookup_table[idx];
+
+       writel_relaxed(config->cfg0, zx_pll->reg_base);
+       writel_relaxed(config->cfg1, zx_pll->reg_base + CFG0_CFG1_OFFSET);
+
+       return 0;
+}
+
+static int zx_pll_enable(struct clk_hw *hw)
+{
+       struct clk_zx_pll *zx_pll = to_clk_zx_pll(hw);
+       u32 reg;
+
+       reg = readl_relaxed(zx_pll->reg_base);
+       writel_relaxed(reg & ~POWER_DOWN, zx_pll->reg_base);
+
+       return readl_relaxed_poll_timeout(zx_pll->reg_base, reg,
+                                         reg & LOCK_FLAG, 0, 100);
+}
+
+static void zx_pll_disable(struct clk_hw *hw)
+{
+       struct clk_zx_pll *zx_pll = to_clk_zx_pll(hw);
+       u32 reg;
+
+       reg = readl_relaxed(zx_pll->reg_base);
+       writel_relaxed(reg | POWER_DOWN, zx_pll->reg_base);
+}
+
+static int zx_pll_is_enabled(struct clk_hw *hw)
+{
+       struct clk_zx_pll *zx_pll = to_clk_zx_pll(hw);
+       u32 reg;
+
+       reg = readl_relaxed(zx_pll->reg_base);
+
+       return !(reg & POWER_DOWN);
+}
+
+static const struct clk_ops zx_pll_ops = {
+       .recalc_rate = zx_pll_recalc_rate,
+       .round_rate = zx_pll_round_rate,
+       .set_rate = zx_pll_set_rate,
+       .enable = zx_pll_enable,
+       .disable = zx_pll_disable,
+       .is_enabled = zx_pll_is_enabled,
+};
+
+struct clk *clk_register_zx_pll(const char *name, const char *parent_name,
+       unsigned long flags, void __iomem *reg_base,
+       const struct zx_pll_config *lookup_table, int count, spinlock_t *lock)
+{
+       struct clk_zx_pll *zx_pll;
+       struct clk *clk;
+       struct clk_init_data init;
+
+       zx_pll = kzalloc(sizeof(*zx_pll), GFP_KERNEL);
+       if (!zx_pll)
+               return ERR_PTR(-ENOMEM);
+
+       init.name = name;
+       init.ops = &zx_pll_ops;
+       init.flags = flags;
+       init.parent_names = parent_name ? &parent_name : NULL;
+       init.num_parents = parent_name ? 1 : 0;
+
+       zx_pll->reg_base = reg_base;
+       zx_pll->lookup_table = lookup_table;
+       zx_pll->count = count;
+       zx_pll->lock = lock;
+       zx_pll->hw.init = &init;
+
+       clk = clk_register(NULL, &zx_pll->hw);
+       if (IS_ERR(clk))
+               kfree(zx_pll);
+
+       return clk;
+}
diff --git a/drivers/clk/zte/clk-zx296702.c b/drivers/clk/zte/clk-zx296702.c
new file mode 100644 (file)
index 0000000..929d033
--- /dev/null
@@ -0,0 +1,657 @@
+/*
+ * Copyright 2014 Linaro Ltd.
+ * Copyright (C) 2014 ZTE 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.
+ */
+
+#include <linux/clk-provider.h>
+#include <linux/of_address.h>
+#include <dt-bindings/clock/zx296702-clock.h>
+#include "clk.h"
+
+static DEFINE_SPINLOCK(reg_lock);
+
+static void __iomem *topcrm_base;
+static void __iomem *lsp0crpm_base;
+static void __iomem *lsp1crpm_base;
+
+static struct clk *topclk[ZX296702_TOPCLK_END];
+static struct clk *lsp0clk[ZX296702_LSP0CLK_END];
+static struct clk *lsp1clk[ZX296702_LSP1CLK_END];
+
+static struct clk_onecell_data topclk_data;
+static struct clk_onecell_data lsp0clk_data;
+static struct clk_onecell_data lsp1clk_data;
+
+#define CLK_MUX                        (topcrm_base + 0x04)
+#define CLK_DIV                        (topcrm_base + 0x08)
+#define CLK_EN0                        (topcrm_base + 0x0c)
+#define CLK_EN1                        (topcrm_base + 0x10)
+#define VOU_LOCAL_CLKEN                (topcrm_base + 0x68)
+#define VOU_LOCAL_CLKSEL       (topcrm_base + 0x70)
+#define VOU_LOCAL_DIV2_SET     (topcrm_base + 0x74)
+#define CLK_MUX1               (topcrm_base + 0x8c)
+
+#define CLK_SDMMC1             (lsp0crpm_base + 0x0c)
+
+#define CLK_UART0              (lsp1crpm_base + 0x20)
+#define CLK_UART1              (lsp1crpm_base + 0x24)
+#define CLK_SDMMC0             (lsp1crpm_base + 0x2c)
+
+static const struct zx_pll_config pll_a9_config[] = {
+       { .rate = 700000000, .cfg0 = 0x800405d1, .cfg1 = 0x04555555 },
+       { .rate = 800000000, .cfg0 = 0x80040691, .cfg1 = 0x04aaaaaa },
+       { .rate = 900000000, .cfg0 = 0x80040791, .cfg1 = 0x04000000 },
+       { .rate = 1000000000, .cfg0 = 0x80040851, .cfg1 = 0x04555555 },
+       { .rate = 1100000000, .cfg0 = 0x80040911, .cfg1 = 0x04aaaaaa },
+       { .rate = 1200000000, .cfg0 = 0x80040a11, .cfg1 = 0x04000000 },
+};
+
+static const struct clk_div_table main_hlk_div[] = {
+       { .val = 1, .div = 2, },
+       { .val = 3, .div = 4, },
+       { /* sentinel */ }
+};
+
+static const struct clk_div_table a9_as1_aclk_divider[] = {
+       { .val = 0, .div = 1, },
+       { .val = 1, .div = 2, },
+       { .val = 3, .div = 4, },
+       { /* sentinel */ }
+};
+
+static const struct clk_div_table sec_wclk_divider[] = {
+       { .val = 0, .div = 1, },
+       { .val = 1, .div = 2, },
+       { .val = 3, .div = 4, },
+       { .val = 5, .div = 6, },
+       { .val = 7, .div = 8, },
+       { /* sentinel */ }
+};
+
+static const char * matrix_aclk_sel[] = {
+       "pll_mm0_198M",
+       "osc",
+       "clk_148M5",
+       "pll_lsp_104M",
+};
+
+static const char * a9_wclk_sel[] = {
+       "pll_a9",
+       "osc",
+       "clk_500",
+       "clk_250",
+};
+
+static const char * a9_as1_aclk_sel[] = {
+       "clk_250",
+       "osc",
+       "pll_mm0_396M",
+       "pll_mac_333M",
+};
+
+static const char * a9_trace_clkin_sel[] = {
+       "clk_74M25",
+       "pll_mm1_108M",
+       "clk_125",
+       "clk_148M5",
+};
+
+static const char * decppu_aclk_sel[] = {
+       "clk_250",
+       "pll_mm0_198M",
+       "pll_lsp_104M",
+       "pll_audio_294M912",
+};
+
+static const char * vou_main_wclk_sel[] = {
+       "clk_148M5",
+       "clk_74M25",
+       "clk_27",
+       "pll_mm1_54M",
+};
+
+static const char * vou_scaler_wclk_sel[] = {
+       "clk_250",
+       "pll_mac_333M",
+       "pll_audio_294M912",
+       "pll_mm0_198M",
+};
+
+static const char * r2d_wclk_sel[] = {
+       "pll_audio_294M912",
+       "pll_mac_333M",
+       "pll_a9_350M",
+       "pll_mm0_396M",
+};
+
+static const char * ddr_wclk_sel[] = {
+       "pll_mac_333M",
+       "pll_ddr_266M",
+       "pll_audio_294M912",
+       "pll_mm0_198M",
+};
+
+static const char * nand_wclk_sel[] = {
+       "pll_lsp_104M",
+       "osc",
+};
+
+static const char * lsp_26_wclk_sel[] = {
+       "pll_lsp_26M",
+       "osc",
+};
+
+static const char * vl0_sel[] = {
+       "vou_main_channel_div",
+       "vou_aux_channel_div",
+};
+
+static const char * hdmi_sel[] = {
+       "vou_main_channel_wclk",
+       "vou_aux_channel_wclk",
+};
+
+static const char * sdmmc0_wclk_sel[] = {
+       "lsp1_104M_wclk",
+       "lsp1_26M_wclk",
+};
+
+static const char * sdmmc1_wclk_sel[] = {
+       "lsp0_104M_wclk",
+       "lsp0_26M_wclk",
+};
+
+static const char * uart_wclk_sel[] = {
+       "lsp1_104M_wclk",
+       "lsp1_26M_wclk",
+};
+
+static inline struct clk *zx_divtbl(const char *name, const char *parent,
+                                   void __iomem *reg, u8 shift, u8 width,
+                                   const struct clk_div_table *table)
+{
+       return clk_register_divider_table(NULL, name, parent, 0, reg, shift,
+                                         width, 0, table, &reg_lock);
+}
+
+static inline struct clk *zx_div(const char *name, const char *parent,
+                                void __iomem *reg, u8 shift, u8 width)
+{
+       return clk_register_divider(NULL, name, parent, 0,
+                                   reg, shift, width, 0, &reg_lock);
+}
+
+static inline struct clk *zx_mux(const char *name, const char **parents,
+               int num_parents, void __iomem *reg, u8 shift, u8 width)
+{
+       return clk_register_mux(NULL, name, parents, num_parents,
+                               0, reg, shift, width, 0, &reg_lock);
+}
+
+static inline struct clk *zx_gate(const char *name, const char *parent,
+                                 void __iomem *reg, u8 shift)
+{
+       return clk_register_gate(NULL, name, parent, CLK_IGNORE_UNUSED,
+                                reg, shift, 0, &reg_lock);
+}
+
+static void __init zx296702_top_clocks_init(struct device_node *np)
+{
+       struct clk **clk = topclk;
+       int i;
+
+       topcrm_base = of_iomap(np, 0);
+       WARN_ON(!topcrm_base);
+
+       clk[ZX296702_OSC] =
+               clk_register_fixed_rate(NULL, "osc", NULL, CLK_IS_ROOT,
+                               30000000);
+       clk[ZX296702_PLL_A9] =
+               clk_register_zx_pll("pll_a9", "osc", 0, topcrm_base
+                               + 0x01c, pll_a9_config,
+                               ARRAY_SIZE(pll_a9_config), &reg_lock);
+
+       /* TODO: pll_a9_350M look like changeble follow a9 pll */
+       clk[ZX296702_PLL_A9_350M] =
+               clk_register_fixed_rate(NULL, "pll_a9_350M", "osc", 0,
+                               350000000);
+       clk[ZX296702_PLL_MAC_1000M] =
+               clk_register_fixed_rate(NULL, "pll_mac_1000M", "osc", 0,
+                               1000000000);
+       clk[ZX296702_PLL_MAC_333M] =
+               clk_register_fixed_rate(NULL, "pll_mac_333M",    "osc", 0,
+                               333000000);
+       clk[ZX296702_PLL_MM0_1188M] =
+               clk_register_fixed_rate(NULL, "pll_mm0_1188M", "osc", 0,
+                               1188000000);
+       clk[ZX296702_PLL_MM0_396M] =
+               clk_register_fixed_rate(NULL, "pll_mm0_396M",  "osc", 0,
+                               396000000);
+       clk[ZX296702_PLL_MM0_198M] =
+               clk_register_fixed_rate(NULL, "pll_mm0_198M",  "osc", 0,
+                               198000000);
+       clk[ZX296702_PLL_MM1_108M] =
+               clk_register_fixed_rate(NULL, "pll_mm1_108M",  "osc", 0,
+                               108000000);
+       clk[ZX296702_PLL_MM1_72M] =
+               clk_register_fixed_rate(NULL, "pll_mm1_72M",     "osc", 0,
+                               72000000);
+       clk[ZX296702_PLL_MM1_54M] =
+               clk_register_fixed_rate(NULL, "pll_mm1_54M",     "osc", 0,
+                               54000000);
+       clk[ZX296702_PLL_LSP_104M] =
+               clk_register_fixed_rate(NULL, "pll_lsp_104M",  "osc", 0,
+                               104000000);
+       clk[ZX296702_PLL_LSP_26M] =
+               clk_register_fixed_rate(NULL, "pll_lsp_26M",     "osc", 0,
+                               26000000);
+       clk[ZX296702_PLL_DDR_266M] =
+               clk_register_fixed_rate(NULL, "pll_ddr_266M",    "osc", 0,
+                               266000000);
+       clk[ZX296702_PLL_AUDIO_294M912] =
+               clk_register_fixed_rate(NULL, "pll_audio_294M912", "osc", 0,
+                               294912000);
+
+       /* bus clock */
+       clk[ZX296702_MATRIX_ACLK] =
+               zx_mux("matrix_aclk", matrix_aclk_sel,
+                               ARRAY_SIZE(matrix_aclk_sel), CLK_MUX, 2, 2);
+       clk[ZX296702_MAIN_HCLK] =
+               zx_divtbl("main_hclk", "matrix_aclk", CLK_DIV, 0, 2,
+                               main_hlk_div);
+       clk[ZX296702_MAIN_PCLK] =
+               zx_divtbl("main_pclk", "matrix_aclk", CLK_DIV, 2, 2,
+                               main_hlk_div);
+
+       /* cpu clock */
+       clk[ZX296702_CLK_500] =
+               clk_register_fixed_factor(NULL, "clk_500", "pll_mac_1000M", 0,
+                               1, 2);
+       clk[ZX296702_CLK_250] =
+               clk_register_fixed_factor(NULL, "clk_250", "pll_mac_1000M", 0,
+                               1, 4);
+       clk[ZX296702_CLK_125] =
+               clk_register_fixed_factor(NULL, "clk_125", "clk_250", 0, 1, 2);
+       clk[ZX296702_CLK_148M5] =
+               clk_register_fixed_factor(NULL, "clk_148M5", "pll_mm0_1188M", 0,
+                               1, 8);
+       clk[ZX296702_CLK_74M25] =
+               clk_register_fixed_factor(NULL, "clk_74M25", "pll_mm0_1188M", 0,
+                               1, 16);
+       clk[ZX296702_A9_WCLK] =
+               zx_mux("a9_wclk", a9_wclk_sel, ARRAY_SIZE(a9_wclk_sel), CLK_MUX,
+                               0, 2);
+       clk[ZX296702_A9_AS1_ACLK_MUX] =
+               zx_mux("a9_as1_aclk_mux", a9_as1_aclk_sel,
+                               ARRAY_SIZE(a9_as1_aclk_sel), CLK_MUX, 4, 2);
+       clk[ZX296702_A9_TRACE_CLKIN_MUX] =
+               zx_mux("a9_trace_clkin_mux", a9_trace_clkin_sel,
+                               ARRAY_SIZE(a9_trace_clkin_sel), CLK_MUX1, 0, 2);
+       clk[ZX296702_A9_AS1_ACLK_DIV] =
+               zx_divtbl("a9_as1_aclk_div", "a9_as1_aclk_mux", CLK_DIV, 4, 2,
+                               a9_as1_aclk_divider);
+
+       /* multi-media clock */
+       clk[ZX296702_CLK_2] =
+               clk_register_fixed_factor(NULL, "clk_2", "pll_mm1_72M", 0,
+                               1, 36);
+       clk[ZX296702_CLK_27] =
+               clk_register_fixed_factor(NULL, "clk_27", "pll_mm1_54M", 0,
+                               1, 2);
+       clk[ZX296702_DECPPU_ACLK_MUX] =
+               zx_mux("decppu_aclk_mux", decppu_aclk_sel,
+                               ARRAY_SIZE(decppu_aclk_sel), CLK_MUX, 6, 2);
+       clk[ZX296702_PPU_ACLK_MUX] =
+               zx_mux("ppu_aclk_mux", decppu_aclk_sel,
+                               ARRAY_SIZE(decppu_aclk_sel), CLK_MUX, 8, 2);
+       clk[ZX296702_MALI400_ACLK_MUX] =
+               zx_mux("mali400_aclk_mux", decppu_aclk_sel,
+                               ARRAY_SIZE(decppu_aclk_sel), CLK_MUX, 12, 2);
+       clk[ZX296702_VOU_ACLK_MUX] =
+               zx_mux("vou_aclk_mux", decppu_aclk_sel,
+                               ARRAY_SIZE(decppu_aclk_sel), CLK_MUX, 10, 2);
+       clk[ZX296702_VOU_MAIN_WCLK_MUX] =
+               zx_mux("vou_main_wclk_mux", vou_main_wclk_sel,
+                               ARRAY_SIZE(vou_main_wclk_sel), CLK_MUX, 14, 2);
+       clk[ZX296702_VOU_AUX_WCLK_MUX] =
+               zx_mux("vou_aux_wclk_mux", vou_main_wclk_sel,
+                               ARRAY_SIZE(vou_main_wclk_sel), CLK_MUX, 16, 2);
+       clk[ZX296702_VOU_SCALER_WCLK_MUX] =
+               zx_mux("vou_scaler_wclk_mux", vou_scaler_wclk_sel,
+                               ARRAY_SIZE(vou_scaler_wclk_sel), CLK_MUX,
+                               18, 2);
+       clk[ZX296702_R2D_ACLK_MUX] =
+               zx_mux("r2d_aclk_mux", decppu_aclk_sel,
+                               ARRAY_SIZE(decppu_aclk_sel), CLK_MUX, 20, 2);
+       clk[ZX296702_R2D_WCLK_MUX] =
+               zx_mux("r2d_wclk_mux", r2d_wclk_sel,
+                               ARRAY_SIZE(r2d_wclk_sel), CLK_MUX, 22, 2);
+
+       /* other clock */
+       clk[ZX296702_CLK_50] =
+               clk_register_fixed_factor(NULL, "clk_50", "pll_mac_1000M",
+                               0, 1, 20);
+       clk[ZX296702_CLK_25] =
+               clk_register_fixed_factor(NULL, "clk_25", "pll_mac_1000M",
+                               0, 1, 40);
+       clk[ZX296702_CLK_12] =
+               clk_register_fixed_factor(NULL, "clk_12", "pll_mm1_72M",
+                               0, 1, 6);
+       clk[ZX296702_CLK_16M384] =
+               clk_register_fixed_factor(NULL, "clk_16M384",
+                               "pll_audio_294M912", 0, 1, 18);
+       clk[ZX296702_CLK_32K768] =
+               clk_register_fixed_factor(NULL, "clk_32K768", "clk_16M384",
+                               0, 1, 500);
+       clk[ZX296702_SEC_WCLK_DIV] =
+               zx_divtbl("sec_wclk_div", "pll_lsp_104M", CLK_DIV, 6, 3,
+                               sec_wclk_divider);
+       clk[ZX296702_DDR_WCLK_MUX] =
+               zx_mux("ddr_wclk_mux", ddr_wclk_sel,
+                               ARRAY_SIZE(ddr_wclk_sel), CLK_MUX, 24, 2);
+       clk[ZX296702_NAND_WCLK_MUX] =
+               zx_mux("nand_wclk_mux", nand_wclk_sel,
+                               ARRAY_SIZE(nand_wclk_sel), CLK_MUX, 24, 2);
+       clk[ZX296702_LSP_26_WCLK_MUX] =
+               zx_mux("lsp_26_wclk_mux", lsp_26_wclk_sel,
+                               ARRAY_SIZE(lsp_26_wclk_sel), CLK_MUX, 27, 1);
+
+       /* gates */
+       clk[ZX296702_A9_AS0_ACLK] =
+               zx_gate("a9_as0_aclk",  "matrix_aclk",          CLK_EN0, 0);
+       clk[ZX296702_A9_AS1_ACLK] =
+               zx_gate("a9_as1_aclk",  "a9_as1_aclk_div",      CLK_EN0, 1);
+       clk[ZX296702_A9_TRACE_CLKIN] =
+               zx_gate("a9_trace_clkin", "a9_trace_clkin_mux", CLK_EN0, 2);
+       clk[ZX296702_DECPPU_AXI_M_ACLK] =
+               zx_gate("decppu_axi_m_aclk", "decppu_aclk_mux", CLK_EN0, 3);
+       clk[ZX296702_DECPPU_AHB_S_HCLK] =
+               zx_gate("decppu_ahb_s_hclk",    "main_hclk",    CLK_EN0, 4);
+       clk[ZX296702_PPU_AXI_M_ACLK] =
+               zx_gate("ppu_axi_m_aclk",       "ppu_aclk_mux", CLK_EN0, 5);
+       clk[ZX296702_PPU_AHB_S_HCLK] =
+               zx_gate("ppu_ahb_s_hclk",       "main_hclk",    CLK_EN0, 6);
+       clk[ZX296702_VOU_AXI_M_ACLK] =
+               zx_gate("vou_axi_m_aclk",       "vou_aclk_mux", CLK_EN0, 7);
+       clk[ZX296702_VOU_APB_PCLK] =
+               zx_gate("vou_apb_pclk", "main_pclk",            CLK_EN0, 8);
+       clk[ZX296702_VOU_MAIN_CHANNEL_WCLK] =
+               zx_gate("vou_main_channel_wclk", "vou_main_wclk_mux",
+                               CLK_EN0, 9);
+       clk[ZX296702_VOU_AUX_CHANNEL_WCLK] =
+               zx_gate("vou_aux_channel_wclk", "vou_aux_wclk_mux",
+                               CLK_EN0, 10);
+       clk[ZX296702_VOU_HDMI_OSCLK_CEC] =
+               zx_gate("vou_hdmi_osclk_cec", "clk_2",          CLK_EN0, 11);
+       clk[ZX296702_VOU_SCALER_WCLK] =
+               zx_gate("vou_scaler_wclk", "vou_scaler_wclk_mux", CLK_EN0, 12);
+       clk[ZX296702_MALI400_AXI_M_ACLK] =
+               zx_gate("mali400_axi_m_aclk", "mali400_aclk_mux", CLK_EN0, 13);
+       clk[ZX296702_MALI400_APB_PCLK] =
+               zx_gate("mali400_apb_pclk",     "main_pclk",    CLK_EN0, 14);
+       clk[ZX296702_R2D_WCLK] =
+               zx_gate("r2d_wclk",             "r2d_wclk_mux", CLK_EN0, 15);
+       clk[ZX296702_R2D_AXI_M_ACLK] =
+               zx_gate("r2d_axi_m_aclk",       "r2d_aclk_mux", CLK_EN0, 16);
+       clk[ZX296702_R2D_AHB_HCLK] =
+               zx_gate("r2d_ahb_hclk",         "main_hclk",    CLK_EN0, 17);
+       clk[ZX296702_DDR3_AXI_S0_ACLK] =
+               zx_gate("ddr3_axi_s0_aclk",     "matrix_aclk",  CLK_EN0, 18);
+       clk[ZX296702_DDR3_APB_PCLK] =
+               zx_gate("ddr3_apb_pclk",        "main_pclk",    CLK_EN0, 19);
+       clk[ZX296702_DDR3_WCLK] =
+               zx_gate("ddr3_wclk",            "ddr_wclk_mux", CLK_EN0, 20);
+       clk[ZX296702_USB20_0_AHB_HCLK] =
+               zx_gate("usb20_0_ahb_hclk",     "main_hclk",    CLK_EN0, 21);
+       clk[ZX296702_USB20_0_EXTREFCLK] =
+               zx_gate("usb20_0_extrefclk",    "clk_12",       CLK_EN0, 22);
+       clk[ZX296702_USB20_1_AHB_HCLK] =
+               zx_gate("usb20_1_ahb_hclk",     "main_hclk",    CLK_EN0, 23);
+       clk[ZX296702_USB20_1_EXTREFCLK] =
+               zx_gate("usb20_1_extrefclk",    "clk_12",       CLK_EN0, 24);
+       clk[ZX296702_USB20_2_AHB_HCLK] =
+               zx_gate("usb20_2_ahb_hclk",     "main_hclk",    CLK_EN0, 25);
+       clk[ZX296702_USB20_2_EXTREFCLK] =
+               zx_gate("usb20_2_extrefclk",    "clk_12",       CLK_EN0, 26);
+       clk[ZX296702_GMAC_AXI_M_ACLK] =
+               zx_gate("gmac_axi_m_aclk",      "matrix_aclk",  CLK_EN0, 27);
+       clk[ZX296702_GMAC_APB_PCLK] =
+               zx_gate("gmac_apb_pclk",        "main_pclk",    CLK_EN0, 28);
+       clk[ZX296702_GMAC_125_CLKIN] =
+               zx_gate("gmac_125_clkin",       "clk_125",      CLK_EN0, 29);
+       clk[ZX296702_GMAC_RMII_CLKIN] =
+               zx_gate("gmac_rmii_clkin",      "clk_50",       CLK_EN0, 30);
+       clk[ZX296702_GMAC_25M_CLK] =
+               zx_gate("gmac_25M_clk",         "clk_25",       CLK_EN0, 31);
+       clk[ZX296702_NANDFLASH_AHB_HCLK] =
+               zx_gate("nandflash_ahb_hclk", "main_hclk",      CLK_EN1, 0);
+       clk[ZX296702_NANDFLASH_WCLK] =
+               zx_gate("nandflash_wclk",     "nand_wclk_mux",  CLK_EN1, 1);
+       clk[ZX296702_LSP0_APB_PCLK] =
+               zx_gate("lsp0_apb_pclk",        "main_pclk",    CLK_EN1, 2);
+       clk[ZX296702_LSP0_AHB_HCLK] =
+               zx_gate("lsp0_ahb_hclk",        "main_hclk",    CLK_EN1, 3);
+       clk[ZX296702_LSP0_26M_WCLK] =
+               zx_gate("lsp0_26M_wclk",   "lsp_26_wclk_mux",   CLK_EN1, 4);
+       clk[ZX296702_LSP0_104M_WCLK] =
+               zx_gate("lsp0_104M_wclk",       "pll_lsp_104M", CLK_EN1, 5);
+       clk[ZX296702_LSP0_16M384_WCLK] =
+               zx_gate("lsp0_16M384_wclk",     "clk_16M384",   CLK_EN1, 6);
+       clk[ZX296702_LSP1_APB_PCLK] =
+               zx_gate("lsp1_apb_pclk",        "main_pclk",    CLK_EN1, 7);
+       /* FIXME: wclk enable bit is bit8. We hack it as reserved 31 for
+        * UART does not work after parent clk is disabled/enabled */
+       clk[ZX296702_LSP1_26M_WCLK] =
+               zx_gate("lsp1_26M_wclk",     "lsp_26_wclk_mux", CLK_EN1, 31);
+       clk[ZX296702_LSP1_104M_WCLK] =
+               zx_gate("lsp1_104M_wclk",    "pll_lsp_104M",    CLK_EN1, 9);
+       clk[ZX296702_LSP1_32K_CLK] =
+               zx_gate("lsp1_32K_clk", "clk_32K768",           CLK_EN1, 10);
+       clk[ZX296702_AON_HCLK] =
+               zx_gate("aon_hclk",             "main_hclk",    CLK_EN1, 11);
+       clk[ZX296702_SYS_CTRL_PCLK] =
+               zx_gate("sys_ctrl_pclk",        "main_pclk",    CLK_EN1, 12);
+       clk[ZX296702_DMA_PCLK] =
+               zx_gate("dma_pclk",             "main_pclk",    CLK_EN1, 13);
+       clk[ZX296702_DMA_ACLK] =
+               zx_gate("dma_aclk",             "matrix_aclk",  CLK_EN1, 14);
+       clk[ZX296702_SEC_HCLK] =
+               zx_gate("sec_hclk",             "main_hclk",    CLK_EN1, 15);
+       clk[ZX296702_AES_WCLK] =
+               zx_gate("aes_wclk",             "sec_wclk_div", CLK_EN1, 16);
+       clk[ZX296702_DES_WCLK] =
+               zx_gate("des_wclk",             "sec_wclk_div", CLK_EN1, 17);
+       clk[ZX296702_IRAM_ACLK] =
+               zx_gate("iram_aclk",            "matrix_aclk",  CLK_EN1, 18);
+       clk[ZX296702_IROM_ACLK] =
+               zx_gate("irom_aclk",            "matrix_aclk",  CLK_EN1, 19);
+       clk[ZX296702_BOOT_CTRL_HCLK] =
+               zx_gate("boot_ctrl_hclk",       "main_hclk",    CLK_EN1, 20);
+       clk[ZX296702_EFUSE_CLK_30] =
+               zx_gate("efuse_clk_30", "osc",                  CLK_EN1, 21);
+
+       /* TODO: add VOU Local clocks */
+       clk[ZX296702_VOU_MAIN_CHANNEL_DIV] =
+               zx_div("vou_main_channel_div", "vou_main_channel_wclk",
+                               VOU_LOCAL_DIV2_SET, 1, 1);
+       clk[ZX296702_VOU_AUX_CHANNEL_DIV] =
+               zx_div("vou_aux_channel_div", "vou_aux_channel_wclk",
+                               VOU_LOCAL_DIV2_SET, 0, 1);
+       clk[ZX296702_VOU_TV_ENC_HD_DIV] =
+               zx_div("vou_tv_enc_hd_div", "vou_tv_enc_hd_mux",
+                               VOU_LOCAL_DIV2_SET, 3, 1);
+       clk[ZX296702_VOU_TV_ENC_SD_DIV] =
+               zx_div("vou_tv_enc_sd_div", "vou_tv_enc_sd_mux",
+                               VOU_LOCAL_DIV2_SET, 2, 1);
+       clk[ZX296702_VL0_MUX] =
+               zx_mux("vl0_mux", vl0_sel, ARRAY_SIZE(vl0_sel),
+                               VOU_LOCAL_CLKSEL, 8, 1);
+       clk[ZX296702_VL1_MUX] =
+               zx_mux("vl1_mux", vl0_sel, ARRAY_SIZE(vl0_sel),
+                               VOU_LOCAL_CLKSEL, 9, 1);
+       clk[ZX296702_VL2_MUX] =
+               zx_mux("vl2_mux", vl0_sel, ARRAY_SIZE(vl0_sel),
+                               VOU_LOCAL_CLKSEL, 10, 1);
+       clk[ZX296702_GL0_MUX] =
+               zx_mux("gl0_mux", vl0_sel, ARRAY_SIZE(vl0_sel),
+                               VOU_LOCAL_CLKSEL, 5, 1);
+       clk[ZX296702_GL1_MUX] =
+               zx_mux("gl1_mux", vl0_sel, ARRAY_SIZE(vl0_sel),
+                               VOU_LOCAL_CLKSEL, 6, 1);
+       clk[ZX296702_GL2_MUX] =
+               zx_mux("gl2_mux", vl0_sel, ARRAY_SIZE(vl0_sel),
+                               VOU_LOCAL_CLKSEL, 7, 1);
+       clk[ZX296702_WB_MUX] =
+               zx_mux("wb_mux",  vl0_sel, ARRAY_SIZE(vl0_sel),
+                               VOU_LOCAL_CLKSEL, 11, 1);
+       clk[ZX296702_HDMI_MUX] =
+               zx_mux("hdmi_mux", hdmi_sel, ARRAY_SIZE(hdmi_sel),
+                               VOU_LOCAL_CLKSEL, 4, 1);
+       clk[ZX296702_VOU_TV_ENC_HD_MUX] =
+               zx_mux("vou_tv_enc_hd_mux", hdmi_sel, ARRAY_SIZE(hdmi_sel),
+                               VOU_LOCAL_CLKSEL, 3, 1);
+       clk[ZX296702_VOU_TV_ENC_SD_MUX] =
+               zx_mux("vou_tv_enc_sd_mux", hdmi_sel, ARRAY_SIZE(hdmi_sel),
+                               VOU_LOCAL_CLKSEL, 2, 1);
+       clk[ZX296702_VL0_CLK] =
+               zx_gate("vl0_clk", "vl0_mux", VOU_LOCAL_CLKEN, 8);
+       clk[ZX296702_VL1_CLK] =
+               zx_gate("vl1_clk", "vl1_mux", VOU_LOCAL_CLKEN, 9);
+       clk[ZX296702_VL2_CLK] =
+               zx_gate("vl2_clk", "vl2_mux", VOU_LOCAL_CLKEN, 10);
+       clk[ZX296702_GL0_CLK] =
+               zx_gate("gl0_clk", "gl0_mux", VOU_LOCAL_CLKEN, 5);
+       clk[ZX296702_GL1_CLK] =
+               zx_gate("gl1_clk", "gl1_mux", VOU_LOCAL_CLKEN, 6);
+       clk[ZX296702_GL2_CLK] =
+               zx_gate("gl2_clk", "gl2_mux", VOU_LOCAL_CLKEN, 7);
+       clk[ZX296702_WB_CLK] =
+               zx_gate("wb_clk", "wb_mux", VOU_LOCAL_CLKEN, 11);
+       clk[ZX296702_CL_CLK] =
+               zx_gate("cl_clk", "vou_main_channel_div", VOU_LOCAL_CLKEN, 12);
+       clk[ZX296702_MAIN_MIX_CLK] =
+               zx_gate("main_mix_clk", "vou_main_channel_div",
+                               VOU_LOCAL_CLKEN, 4);
+       clk[ZX296702_AUX_MIX_CLK] =
+               zx_gate("aux_mix_clk", "vou_aux_channel_div",
+                               VOU_LOCAL_CLKEN, 3);
+       clk[ZX296702_HDMI_CLK] =
+               zx_gate("hdmi_clk", "hdmi_mux", VOU_LOCAL_CLKEN, 2);
+       clk[ZX296702_VOU_TV_ENC_HD_DAC_CLK] =
+               zx_gate("vou_tv_enc_hd_dac_clk", "vou_tv_enc_hd_div",
+                               VOU_LOCAL_CLKEN, 1);
+       clk[ZX296702_VOU_TV_ENC_SD_DAC_CLK] =
+               zx_gate("vou_tv_enc_sd_dac_clk", "vou_tv_enc_sd_div",
+                               VOU_LOCAL_CLKEN, 0);
+
+       /* CA9 PERIPHCLK = a9_wclk / 2 */
+       clk[ZX296702_A9_PERIPHCLK] =
+               clk_register_fixed_factor(NULL, "a9_periphclk", "a9_wclk",
+                               0, 1, 2);
+
+       for (i = 0; i < ARRAY_SIZE(topclk); i++) {
+               if (IS_ERR(clk[i])) {
+                       pr_err("zx296702 clk %d: register failed with %ld\n",
+                               i, PTR_ERR(clk[i]));
+                       return;
+               }
+       }
+
+       topclk_data.clks = topclk;
+       topclk_data.clk_num = ARRAY_SIZE(topclk);
+       of_clk_add_provider(np, of_clk_src_onecell_get, &topclk_data);
+}
+CLK_OF_DECLARE(zx296702_top_clk, "zte,zx296702-topcrm-clk",
+               zx296702_top_clocks_init);
+
+static void __init zx296702_lsp0_clocks_init(struct device_node *np)
+{
+       struct clk **clk = lsp0clk;
+       int i;
+
+       lsp0crpm_base = of_iomap(np, 0);
+       WARN_ON(!lsp0crpm_base);
+
+       /* SDMMC1 */
+       clk[ZX296702_SDMMC1_WCLK_MUX] =
+               zx_mux("sdmmc1_wclk_mux", sdmmc1_wclk_sel,
+                               ARRAY_SIZE(sdmmc1_wclk_sel), CLK_SDMMC1, 4, 1);
+       clk[ZX296702_SDMMC1_WCLK_DIV] =
+               zx_div("sdmmc1_wclk_div", "sdmmc1_wclk_mux", CLK_SDMMC1, 12, 4);
+       clk[ZX296702_SDMMC1_WCLK] =
+               zx_gate("sdmmc1_wclk", "sdmmc1_wclk_div", CLK_SDMMC1, 1);
+       clk[ZX296702_SDMMC1_PCLK] =
+               zx_gate("sdmmc1_pclk", "lsp1_apb_pclk", CLK_SDMMC1, 0);
+
+       for (i = 0; i < ARRAY_SIZE(lsp0clk); i++) {
+               if (IS_ERR(clk[i])) {
+                       pr_err("zx296702 clk %d: register failed with %ld\n",
+                               i, PTR_ERR(clk[i]));
+                       return;
+               }
+       }
+
+       lsp0clk_data.clks = lsp0clk;
+       lsp0clk_data.clk_num = ARRAY_SIZE(lsp0clk);
+       of_clk_add_provider(np, of_clk_src_onecell_get, &lsp0clk_data);
+}
+CLK_OF_DECLARE(zx296702_lsp0_clk, "zte,zx296702-lsp0crpm-clk",
+               zx296702_lsp0_clocks_init);
+
+static void __init zx296702_lsp1_clocks_init(struct device_node *np)
+{
+       struct clk **clk = lsp1clk;
+       int i;
+
+       lsp1crpm_base = of_iomap(np, 0);
+       WARN_ON(!lsp1crpm_base);
+
+       /* UART0 */
+       clk[ZX296702_UART0_WCLK_MUX] =
+               zx_mux("uart0_wclk_mux", uart_wclk_sel,
+                               ARRAY_SIZE(uart_wclk_sel), CLK_UART0, 4, 1);
+       /* FIXME: uart wclk enable bit is bit1 in. We hack it as reserved 31 for
+        * UART does not work after parent clk is disabled/enabled */
+       clk[ZX296702_UART0_WCLK] =
+               zx_gate("uart0_wclk", "uart0_wclk_mux", CLK_UART0, 31);
+       clk[ZX296702_UART0_PCLK] =
+               zx_gate("uart0_pclk", "lsp1_apb_pclk", CLK_UART0, 0);
+
+       /* UART1 */
+       clk[ZX296702_UART1_WCLK_MUX] =
+               zx_mux("uart1_wclk_mux", uart_wclk_sel,
+                               ARRAY_SIZE(uart_wclk_sel), CLK_UART1, 4, 1);
+       clk[ZX296702_UART1_WCLK] =
+               zx_gate("uart1_wclk", "uart1_wclk_mux", CLK_UART1, 1);
+       clk[ZX296702_UART1_PCLK] =
+               zx_gate("uart1_pclk", "lsp1_apb_pclk", CLK_UART1, 0);
+
+       /* SDMMC0 */
+       clk[ZX296702_SDMMC0_WCLK_MUX] =
+               zx_mux("sdmmc0_wclk_mux", sdmmc0_wclk_sel,
+                               ARRAY_SIZE(sdmmc0_wclk_sel), CLK_SDMMC0, 4, 1);
+       clk[ZX296702_SDMMC0_WCLK_DIV] =
+               zx_div("sdmmc0_wclk_div", "sdmmc0_wclk_mux", CLK_SDMMC0, 12, 4);
+       clk[ZX296702_SDMMC0_WCLK] =
+               zx_gate("sdmmc0_wclk", "sdmmc0_wclk_div", CLK_SDMMC0, 1);
+       clk[ZX296702_SDMMC0_PCLK] =
+               zx_gate("sdmmc0_pclk", "lsp1_apb_pclk", CLK_SDMMC0, 0);
+
+       for (i = 0; i < ARRAY_SIZE(lsp1clk); i++) {
+               if (IS_ERR(clk[i])) {
+                       pr_err("zx296702 clk %d: register failed with %ld\n",
+                               i, PTR_ERR(clk[i]));
+                       return;
+               }
+       }
+
+       lsp1clk_data.clks = lsp1clk;
+       lsp1clk_data.clk_num = ARRAY_SIZE(lsp1clk);
+       of_clk_add_provider(np, of_clk_src_onecell_get, &lsp1clk_data);
+}
+CLK_OF_DECLARE(zx296702_lsp1_clk, "zte,zx296702-lsp1crpm-clk",
+               zx296702_lsp1_clocks_init);
diff --git a/drivers/clk/zte/clk.h b/drivers/clk/zte/clk.h
new file mode 100644 (file)
index 0000000..0914a82
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2015 Linaro Ltd.
+ * Copyright (C) 2014 ZTE 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 __ZTE_CLK_H
+#define __ZTE_CLK_H
+#include <linux/clk-provider.h>
+#include <linux/spinlock.h>
+
+struct zx_pll_config {
+       unsigned long rate;
+       u32 cfg0;
+       u32 cfg1;
+};
+
+struct clk_zx_pll {
+       struct clk_hw hw;
+       void __iomem *reg_base;
+       const struct zx_pll_config *lookup_table; /* order by rate asc */
+       int count;
+       spinlock_t *lock;
+};
+
+struct clk *clk_register_zx_pll(const char *name, const char *parent_name,
+       unsigned long flags, void __iomem *reg_base,
+       const struct zx_pll_config *lookup_table, int count, spinlock_t *lock);
+#endif
index 51d7865fdddb6d59ae7a9406ae8d88cb4da30066..618102e5aa2ae79ff8caacb0dfe76a3ad2ae5963 100644 (file)
@@ -258,4 +258,10 @@ config CLKSRC_PXA
        help
          This enables OST0 support available on PXA and SA-11x0
          platforms.
+
+config CLKSRC_IMX_GPT
+       bool "Clocksource using i.MX GPT" if COMPILE_TEST
+       depends on ARM && CLKDEV_LOOKUP
+       select CLKSRC_MMIO
+
 endmenu
index 5b85f6adb25834c807c24aafa08ed0529b2e8a53..fce332cac646087e3884c7ad3902d1aa21235b77 100644 (file)
@@ -51,4 +51,5 @@ obj-$(CONFIG_ARCH_KEYSTONE)           += timer-keystone.o
 obj-$(CONFIG_ARCH_INTEGRATOR_AP)       += timer-integrator-ap.o
 obj-$(CONFIG_CLKSRC_VERSATILE)         += versatile.o
 obj-$(CONFIG_CLKSRC_MIPS_GIC)          += mips-gic-timer.o
+obj-$(CONFIG_CLKSRC_IMX_GPT)           += timer-imx-gpt.o
 obj-$(CONFIG_ASM9260_TIMER)            += asm9260_timer.o
diff --git a/drivers/clocksource/timer-imx-gpt.c b/drivers/clocksource/timer-imx-gpt.c
new file mode 100644 (file)
index 0000000..879c784
--- /dev/null
@@ -0,0 +1,540 @@
+/*
+ *  linux/arch/arm/plat-mxc/time.c
+ *
+ *  Copyright (C) 2000-2001 Deep Blue Solutions
+ *  Copyright (C) 2002 Shane Nay (shane@minirl.com)
+ *  Copyright (C) 2006-2007 Pavel Pisa (ppisa@pikron.com)
+ *  Copyright (C) 2008 Juergen Beisert (kernel@pengutronix.de)
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+
+#include <linux/interrupt.h>
+#include <linux/irq.h>
+#include <linux/clockchips.h>
+#include <linux/clk.h>
+#include <linux/delay.h>
+#include <linux/err.h>
+#include <linux/sched_clock.h>
+#include <linux/slab.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
+#include <soc/imx/timer.h>
+
+/*
+ * There are 4 versions of the timer hardware on Freescale MXC hardware.
+ *  - MX1/MXL
+ *  - MX21, MX27.
+ *  - MX25, MX31, MX35, MX37, MX51, MX6Q(rev1.0)
+ *  - MX6DL, MX6SX, MX6Q(rev1.1+)
+ */
+
+/* defines common for all i.MX */
+#define MXC_TCTL               0x00
+#define MXC_TCTL_TEN           (1 << 0) /* Enable module */
+#define MXC_TPRER              0x04
+
+/* MX1, MX21, MX27 */
+#define MX1_2_TCTL_CLK_PCLK1   (1 << 1)
+#define MX1_2_TCTL_IRQEN       (1 << 4)
+#define MX1_2_TCTL_FRR         (1 << 8)
+#define MX1_2_TCMP             0x08
+#define MX1_2_TCN              0x10
+#define MX1_2_TSTAT            0x14
+
+/* MX21, MX27 */
+#define MX2_TSTAT_CAPT         (1 << 1)
+#define MX2_TSTAT_COMP         (1 << 0)
+
+/* MX31, MX35, MX25, MX5, MX6 */
+#define V2_TCTL_WAITEN         (1 << 3) /* Wait enable mode */
+#define V2_TCTL_CLK_IPG                (1 << 6)
+#define V2_TCTL_CLK_PER                (2 << 6)
+#define V2_TCTL_CLK_OSC_DIV8   (5 << 6)
+#define V2_TCTL_FRR            (1 << 9)
+#define V2_TCTL_24MEN          (1 << 10)
+#define V2_TPRER_PRE24M                12
+#define V2_IR                  0x0c
+#define V2_TSTAT               0x08
+#define V2_TSTAT_OF1           (1 << 0)
+#define V2_TCN                 0x24
+#define V2_TCMP                        0x10
+
+#define V2_TIMER_RATE_OSC_DIV8 3000000
+
+struct imx_timer {
+       enum imx_gpt_type type;
+       void __iomem *base;
+       int irq;
+       struct clk *clk_per;
+       struct clk *clk_ipg;
+       const struct imx_gpt_data *gpt;
+       struct clock_event_device ced;
+       enum clock_event_mode cem;
+       struct irqaction act;
+};
+
+struct imx_gpt_data {
+       int reg_tstat;
+       int reg_tcn;
+       int reg_tcmp;
+       void (*gpt_setup_tctl)(struct imx_timer *imxtm);
+       void (*gpt_irq_enable)(struct imx_timer *imxtm);
+       void (*gpt_irq_disable)(struct imx_timer *imxtm);
+       void (*gpt_irq_acknowledge)(struct imx_timer *imxtm);
+       int (*set_next_event)(unsigned long evt,
+                             struct clock_event_device *ced);
+};
+
+static inline struct imx_timer *to_imx_timer(struct clock_event_device *ced)
+{
+       return container_of(ced, struct imx_timer, ced);
+}
+
+static void imx1_gpt_irq_disable(struct imx_timer *imxtm)
+{
+       unsigned int tmp;
+
+       tmp = readl_relaxed(imxtm->base + MXC_TCTL);
+       writel_relaxed(tmp & ~MX1_2_TCTL_IRQEN, imxtm->base + MXC_TCTL);
+}
+#define imx21_gpt_irq_disable imx1_gpt_irq_disable
+
+static void imx31_gpt_irq_disable(struct imx_timer *imxtm)
+{
+       writel_relaxed(0, imxtm->base + V2_IR);
+}
+#define imx6dl_gpt_irq_disable imx31_gpt_irq_disable
+
+static void imx1_gpt_irq_enable(struct imx_timer *imxtm)
+{
+       unsigned int tmp;
+
+       tmp = readl_relaxed(imxtm->base + MXC_TCTL);
+       writel_relaxed(tmp | MX1_2_TCTL_IRQEN, imxtm->base + MXC_TCTL);
+}
+#define imx21_gpt_irq_enable imx1_gpt_irq_enable
+
+static void imx31_gpt_irq_enable(struct imx_timer *imxtm)
+{
+       writel_relaxed(1<<0, imxtm->base + V2_IR);
+}
+#define imx6dl_gpt_irq_enable imx31_gpt_irq_enable
+
+static void imx1_gpt_irq_acknowledge(struct imx_timer *imxtm)
+{
+       writel_relaxed(0, imxtm->base + MX1_2_TSTAT);
+}
+
+static void imx21_gpt_irq_acknowledge(struct imx_timer *imxtm)
+{
+       writel_relaxed(MX2_TSTAT_CAPT | MX2_TSTAT_COMP,
+                               imxtm->base + MX1_2_TSTAT);
+}
+
+static void imx31_gpt_irq_acknowledge(struct imx_timer *imxtm)
+{
+       writel_relaxed(V2_TSTAT_OF1, imxtm->base + V2_TSTAT);
+}
+#define imx6dl_gpt_irq_acknowledge imx31_gpt_irq_acknowledge
+
+static void __iomem *sched_clock_reg;
+
+static u64 notrace mxc_read_sched_clock(void)
+{
+       return sched_clock_reg ? readl_relaxed(sched_clock_reg) : 0;
+}
+
+static struct delay_timer imx_delay_timer;
+
+static unsigned long imx_read_current_timer(void)
+{
+       return readl_relaxed(sched_clock_reg);
+}
+
+static int __init mxc_clocksource_init(struct imx_timer *imxtm)
+{
+       unsigned int c = clk_get_rate(imxtm->clk_per);
+       void __iomem *reg = imxtm->base + imxtm->gpt->reg_tcn;
+
+       imx_delay_timer.read_current_timer = &imx_read_current_timer;
+       imx_delay_timer.freq = c;
+       register_current_timer_delay(&imx_delay_timer);
+
+       sched_clock_reg = reg;
+
+       sched_clock_register(mxc_read_sched_clock, 32, c);
+       return clocksource_mmio_init(reg, "mxc_timer1", c, 200, 32,
+                       clocksource_mmio_readl_up);
+}
+
+/* clock event */
+
+static int mx1_2_set_next_event(unsigned long evt,
+                             struct clock_event_device *ced)
+{
+       struct imx_timer *imxtm = to_imx_timer(ced);
+       unsigned long tcmp;
+
+       tcmp = readl_relaxed(imxtm->base + MX1_2_TCN) + evt;
+
+       writel_relaxed(tcmp, imxtm->base + MX1_2_TCMP);
+
+       return (int)(tcmp - readl_relaxed(imxtm->base + MX1_2_TCN)) < 0 ?
+                               -ETIME : 0;
+}
+
+static int v2_set_next_event(unsigned long evt,
+                             struct clock_event_device *ced)
+{
+       struct imx_timer *imxtm = to_imx_timer(ced);
+       unsigned long tcmp;
+
+       tcmp = readl_relaxed(imxtm->base + V2_TCN) + evt;
+
+       writel_relaxed(tcmp, imxtm->base + V2_TCMP);
+
+       return evt < 0x7fffffff &&
+               (int)(tcmp - readl_relaxed(imxtm->base + V2_TCN)) < 0 ?
+                               -ETIME : 0;
+}
+
+#ifdef DEBUG
+static const char *clock_event_mode_label[] = {
+       [CLOCK_EVT_MODE_PERIODIC] = "CLOCK_EVT_MODE_PERIODIC",
+       [CLOCK_EVT_MODE_ONESHOT]  = "CLOCK_EVT_MODE_ONESHOT",
+       [CLOCK_EVT_MODE_SHUTDOWN] = "CLOCK_EVT_MODE_SHUTDOWN",
+       [CLOCK_EVT_MODE_UNUSED]   = "CLOCK_EVT_MODE_UNUSED",
+       [CLOCK_EVT_MODE_RESUME]   = "CLOCK_EVT_MODE_RESUME",
+};
+#endif /* DEBUG */
+
+static void mxc_set_mode(enum clock_event_mode mode,
+                               struct clock_event_device *ced)
+{
+       struct imx_timer *imxtm = to_imx_timer(ced);
+       unsigned long flags;
+
+       /*
+        * The timer interrupt generation is disabled at least
+        * for enough time to call mxc_set_next_event()
+        */
+       local_irq_save(flags);
+
+       /* Disable interrupt in GPT module */
+       imxtm->gpt->gpt_irq_disable(imxtm);
+
+       if (mode != imxtm->cem) {
+               u32 tcn = readl_relaxed(imxtm->base + imxtm->gpt->reg_tcn);
+               /* Set event time into far-far future */
+               writel_relaxed(tcn - 3, imxtm->base + imxtm->gpt->reg_tcmp);
+
+               /* Clear pending interrupt */
+               imxtm->gpt->gpt_irq_acknowledge(imxtm);
+       }
+
+#ifdef DEBUG
+       printk(KERN_INFO "mxc_set_mode: changing mode from %s to %s\n",
+               clock_event_mode_label[imxtm->cem],
+               clock_event_mode_label[mode]);
+#endif /* DEBUG */
+
+       /* Remember timer mode */
+       imxtm->cem = mode;
+       local_irq_restore(flags);
+
+       switch (mode) {
+       case CLOCK_EVT_MODE_PERIODIC:
+               printk(KERN_ERR"mxc_set_mode: Periodic mode is not "
+                               "supported for i.MX\n");
+               break;
+       case CLOCK_EVT_MODE_ONESHOT:
+       /*
+        * Do not put overhead of interrupt enable/disable into
+        * mxc_set_next_event(), the core has about 4 minutes
+        * to call mxc_set_next_event() or shutdown clock after
+        * mode switching
+        */
+               local_irq_save(flags);
+               imxtm->gpt->gpt_irq_enable(imxtm);
+               local_irq_restore(flags);
+               break;
+       case CLOCK_EVT_MODE_SHUTDOWN:
+       case CLOCK_EVT_MODE_UNUSED:
+       case CLOCK_EVT_MODE_RESUME:
+               /* Left event sources disabled, no more interrupts appear */
+               break;
+       }
+}
+
+/*
+ * IRQ handler for the timer
+ */
+static irqreturn_t mxc_timer_interrupt(int irq, void *dev_id)
+{
+       struct clock_event_device *ced = dev_id;
+       struct imx_timer *imxtm = to_imx_timer(ced);
+       uint32_t tstat;
+
+       tstat = readl_relaxed(imxtm->base + imxtm->gpt->reg_tstat);
+
+       imxtm->gpt->gpt_irq_acknowledge(imxtm);
+
+       ced->event_handler(ced);
+
+       return IRQ_HANDLED;
+}
+
+static int __init mxc_clockevent_init(struct imx_timer *imxtm)
+{
+       struct clock_event_device *ced = &imxtm->ced;
+       struct irqaction *act = &imxtm->act;
+
+       imxtm->cem = CLOCK_EVT_MODE_UNUSED;
+
+       ced->name = "mxc_timer1";
+       ced->features = CLOCK_EVT_FEAT_ONESHOT;
+       ced->set_mode = mxc_set_mode;
+       ced->set_next_event = imxtm->gpt->set_next_event;
+       ced->rating = 200;
+       ced->cpumask = cpumask_of(0);
+       clockevents_config_and_register(ced, clk_get_rate(imxtm->clk_per),
+                                       0xff, 0xfffffffe);
+
+       act->name = "i.MX Timer Tick";
+       act->flags = IRQF_TIMER | IRQF_IRQPOLL;
+       act->handler = mxc_timer_interrupt;
+       act->dev_id = ced;
+
+       return setup_irq(imxtm->irq, act);
+}
+
+static void imx1_gpt_setup_tctl(struct imx_timer *imxtm)
+{
+       u32 tctl_val;
+
+       tctl_val = MX1_2_TCTL_FRR | MX1_2_TCTL_CLK_PCLK1 | MXC_TCTL_TEN;
+       writel_relaxed(tctl_val, imxtm->base + MXC_TCTL);
+}
+#define imx21_gpt_setup_tctl imx1_gpt_setup_tctl
+
+static void imx31_gpt_setup_tctl(struct imx_timer *imxtm)
+{
+       u32 tctl_val;
+
+       tctl_val = V2_TCTL_FRR | V2_TCTL_WAITEN | MXC_TCTL_TEN;
+       if (clk_get_rate(imxtm->clk_per) == V2_TIMER_RATE_OSC_DIV8)
+               tctl_val |= V2_TCTL_CLK_OSC_DIV8;
+       else
+               tctl_val |= V2_TCTL_CLK_PER;
+
+       writel_relaxed(tctl_val, imxtm->base + MXC_TCTL);
+}
+
+static void imx6dl_gpt_setup_tctl(struct imx_timer *imxtm)
+{
+       u32 tctl_val;
+
+       tctl_val = V2_TCTL_FRR | V2_TCTL_WAITEN | MXC_TCTL_TEN;
+       if (clk_get_rate(imxtm->clk_per) == V2_TIMER_RATE_OSC_DIV8) {
+               tctl_val |= V2_TCTL_CLK_OSC_DIV8;
+               /* 24 / 8 = 3 MHz */
+               writel_relaxed(7 << V2_TPRER_PRE24M, imxtm->base + MXC_TPRER);
+               tctl_val |= V2_TCTL_24MEN;
+       } else {
+               tctl_val |= V2_TCTL_CLK_PER;
+       }
+
+       writel_relaxed(tctl_val, imxtm->base + MXC_TCTL);
+}
+
+static const struct imx_gpt_data imx1_gpt_data = {
+       .reg_tstat = MX1_2_TSTAT,
+       .reg_tcn = MX1_2_TCN,
+       .reg_tcmp = MX1_2_TCMP,
+       .gpt_irq_enable = imx1_gpt_irq_enable,
+       .gpt_irq_disable = imx1_gpt_irq_disable,
+       .gpt_irq_acknowledge = imx1_gpt_irq_acknowledge,
+       .gpt_setup_tctl = imx1_gpt_setup_tctl,
+       .set_next_event = mx1_2_set_next_event,
+};
+
+static const struct imx_gpt_data imx21_gpt_data = {
+       .reg_tstat = MX1_2_TSTAT,
+       .reg_tcn = MX1_2_TCN,
+       .reg_tcmp = MX1_2_TCMP,
+       .gpt_irq_enable = imx21_gpt_irq_enable,
+       .gpt_irq_disable = imx21_gpt_irq_disable,
+       .gpt_irq_acknowledge = imx21_gpt_irq_acknowledge,
+       .gpt_setup_tctl = imx21_gpt_setup_tctl,
+       .set_next_event = mx1_2_set_next_event,
+};
+
+static const struct imx_gpt_data imx31_gpt_data = {
+       .reg_tstat = V2_TSTAT,
+       .reg_tcn = V2_TCN,
+       .reg_tcmp = V2_TCMP,
+       .gpt_irq_enable = imx31_gpt_irq_enable,
+       .gpt_irq_disable = imx31_gpt_irq_disable,
+       .gpt_irq_acknowledge = imx31_gpt_irq_acknowledge,
+       .gpt_setup_tctl = imx31_gpt_setup_tctl,
+       .set_next_event = v2_set_next_event,
+};
+
+static const struct imx_gpt_data imx6dl_gpt_data = {
+       .reg_tstat = V2_TSTAT,
+       .reg_tcn = V2_TCN,
+       .reg_tcmp = V2_TCMP,
+       .gpt_irq_enable = imx6dl_gpt_irq_enable,
+       .gpt_irq_disable = imx6dl_gpt_irq_disable,
+       .gpt_irq_acknowledge = imx6dl_gpt_irq_acknowledge,
+       .gpt_setup_tctl = imx6dl_gpt_setup_tctl,
+       .set_next_event = v2_set_next_event,
+};
+
+static void __init _mxc_timer_init(struct imx_timer *imxtm)
+{
+       switch (imxtm->type) {
+       case GPT_TYPE_IMX1:
+               imxtm->gpt = &imx1_gpt_data;
+               break;
+       case GPT_TYPE_IMX21:
+               imxtm->gpt = &imx21_gpt_data;
+               break;
+       case GPT_TYPE_IMX31:
+               imxtm->gpt = &imx31_gpt_data;
+               break;
+       case GPT_TYPE_IMX6DL:
+               imxtm->gpt = &imx6dl_gpt_data;
+               break;
+       default:
+               BUG();
+       }
+
+       if (IS_ERR(imxtm->clk_per)) {
+               pr_err("i.MX timer: unable to get clk\n");
+               return;
+       }
+
+       if (!IS_ERR(imxtm->clk_ipg))
+               clk_prepare_enable(imxtm->clk_ipg);
+
+       clk_prepare_enable(imxtm->clk_per);
+
+       /*
+        * Initialise to a known state (all timers off, and timing reset)
+        */
+
+       writel_relaxed(0, imxtm->base + MXC_TCTL);
+       writel_relaxed(0, imxtm->base + MXC_TPRER); /* see datasheet note */
+
+       imxtm->gpt->gpt_setup_tctl(imxtm);
+
+       /* init and register the timer to the framework */
+       mxc_clocksource_init(imxtm);
+       mxc_clockevent_init(imxtm);
+}
+
+void __init mxc_timer_init(unsigned long pbase, int irq, enum imx_gpt_type type)
+{
+       struct imx_timer *imxtm;
+
+       imxtm = kzalloc(sizeof(*imxtm), GFP_KERNEL);
+       BUG_ON(!imxtm);
+
+       imxtm->clk_per = clk_get_sys("imx-gpt.0", "per");
+       imxtm->clk_ipg = clk_get_sys("imx-gpt.0", "ipg");
+
+       imxtm->base = ioremap(pbase, SZ_4K);
+       BUG_ON(!imxtm->base);
+
+       imxtm->type = type;
+
+       _mxc_timer_init(imxtm);
+}
+
+static void __init mxc_timer_init_dt(struct device_node *np,  enum imx_gpt_type type)
+{
+       struct imx_timer *imxtm;
+       static int initialized;
+
+       /* Support one instance only */
+       if (initialized)
+               return;
+
+       imxtm = kzalloc(sizeof(*imxtm), GFP_KERNEL);
+       BUG_ON(!imxtm);
+
+       imxtm->base = of_iomap(np, 0);
+       WARN_ON(!imxtm->base);
+       imxtm->irq = irq_of_parse_and_map(np, 0);
+
+       imxtm->clk_ipg = of_clk_get_by_name(np, "ipg");
+
+       /* Try osc_per first, and fall back to per otherwise */
+       imxtm->clk_per = of_clk_get_by_name(np, "osc_per");
+       if (IS_ERR(imxtm->clk_per))
+               imxtm->clk_per = of_clk_get_by_name(np, "per");
+
+       imxtm->type = type;
+
+       _mxc_timer_init(imxtm);
+
+       initialized = 1;
+}
+
+static void __init imx1_timer_init_dt(struct device_node *np)
+{
+       mxc_timer_init_dt(np, GPT_TYPE_IMX1);
+}
+
+static void __init imx21_timer_init_dt(struct device_node *np)
+{
+       mxc_timer_init_dt(np, GPT_TYPE_IMX21);
+}
+
+static void __init imx31_timer_init_dt(struct device_node *np)
+{
+       enum imx_gpt_type type = GPT_TYPE_IMX31;
+
+       /*
+        * We were using the same compatible string for i.MX6Q/D and i.MX6DL/S
+        * GPT device, while they actually have different programming model.
+        * This is a workaround to keep the existing i.MX6DL/S DTBs continue
+        * working with the new kernel.
+        */
+       if (of_machine_is_compatible("fsl,imx6dl"))
+               type = GPT_TYPE_IMX6DL;
+
+       mxc_timer_init_dt(np, type);
+}
+
+static void __init imx6dl_timer_init_dt(struct device_node *np)
+{
+       mxc_timer_init_dt(np, GPT_TYPE_IMX6DL);
+}
+
+CLOCKSOURCE_OF_DECLARE(imx1_timer, "fsl,imx1-gpt", imx1_timer_init_dt);
+CLOCKSOURCE_OF_DECLARE(imx21_timer, "fsl,imx21-gpt", imx21_timer_init_dt);
+CLOCKSOURCE_OF_DECLARE(imx31_timer, "fsl,imx31-gpt", imx31_timer_init_dt);
+CLOCKSOURCE_OF_DECLARE(imx25_timer, "fsl,imx25-gpt", imx31_timer_init_dt);
+CLOCKSOURCE_OF_DECLARE(imx50_timer, "fsl,imx50-gpt", imx31_timer_init_dt);
+CLOCKSOURCE_OF_DECLARE(imx51_timer, "fsl,imx51-gpt", imx31_timer_init_dt);
+CLOCKSOURCE_OF_DECLARE(imx53_timer, "fsl,imx53-gpt", imx31_timer_init_dt);
+CLOCKSOURCE_OF_DECLARE(imx6q_timer, "fsl,imx6q-gpt", imx31_timer_init_dt);
+CLOCKSOURCE_OF_DECLARE(imx6dl_timer, "fsl,imx6dl-gpt", imx6dl_timer_init_dt);
+CLOCKSOURCE_OF_DECLARE(imx6sl_timer, "fsl,imx6sl-gpt", imx6dl_timer_init_dt);
+CLOCKSOURCE_OF_DECLARE(imx6sx_timer, "fsl,imx6sx-gpt", imx6dl_timer_init_dt);
index ba0532efd3ae68d0368a00a1018dd22ee76f99b0..332c8ef8dae2cc262540f0d168dffa2266d82c73 100644 (file)
@@ -1544,6 +1544,8 @@ static int ahash_init(struct ahash_request *req)
 
        state->current_buf = 0;
        state->buf_dma = 0;
+       state->buflen_0 = 0;
+       state->buflen_1 = 0;
 
        return 0;
 }
index 26a544b505f1e17166f95cf0e0dccdc5191015d3..5095337205b830c148696a37d53a8902643b317f 100644 (file)
@@ -56,7 +56,7 @@
 
 /* Buffer, its dma address and lock */
 struct buf_data {
-       u8 buf[RN_BUF_SIZE];
+       u8 buf[RN_BUF_SIZE] ____cacheline_aligned;
        dma_addr_t addr;
        struct completion filled;
        u32 hw_desc[DESC_JOB_O_LEN];
index 933e4b338459284465d7970e3ff7dbf0f37314b8..7992164ea9ec2849f6ac3691629c47cda30aeb28 100644 (file)
 #define AT_XDMAC_MBR_UBC_NDV3          (0x3 << 27)     /* Next Descriptor View 3 */
 
 #define AT_XDMAC_MAX_CHAN      0x20
+#define AT_XDMAC_MAX_CSIZE     16      /* 16 data */
+#define AT_XDMAC_MAX_DWIDTH    8       /* 64 bits */
 
 #define AT_XDMAC_DMA_BUSWIDTHS\
        (BIT(DMA_SLAVE_BUSWIDTH_UNDEFINED) |\
@@ -192,20 +194,17 @@ struct at_xdmac_chan {
        struct dma_chan                 chan;
        void __iomem                    *ch_regs;
        u32                             mask;           /* Channel Mask */
-       u32                             cfg[2];         /* Channel Configuration Register */
-       #define AT_XDMAC_DEV_TO_MEM_CFG 0               /* Predifined dev to mem channel conf */
-       #define AT_XDMAC_MEM_TO_DEV_CFG 1               /* Predifined mem to dev channel conf */
+       u32                             cfg;            /* Channel Configuration Register */
        u8                              perid;          /* Peripheral ID */
        u8                              perif;          /* Peripheral Interface */
        u8                              memif;          /* Memory Interface */
-       u32                             per_src_addr;
-       u32                             per_dst_addr;
        u32                             save_cc;
        u32                             save_cim;
        u32                             save_cnda;
        u32                             save_cndc;
        unsigned long                   status;
        struct tasklet_struct           tasklet;
+       struct dma_slave_config         sconfig;
 
        spinlock_t                      lock;
 
@@ -415,8 +414,9 @@ static dma_cookie_t at_xdmac_tx_submit(struct dma_async_tx_descriptor *tx)
        struct at_xdmac_desc    *desc = txd_to_at_desc(tx);
        struct at_xdmac_chan    *atchan = to_at_xdmac_chan(tx->chan);
        dma_cookie_t            cookie;
+       unsigned long           irqflags;
 
-       spin_lock_bh(&atchan->lock);
+       spin_lock_irqsave(&atchan->lock, irqflags);
        cookie = dma_cookie_assign(tx);
 
        dev_vdbg(chan2dev(tx->chan), "%s: atchan 0x%p, add desc 0x%p to xfers_list\n",
@@ -425,7 +425,7 @@ static dma_cookie_t at_xdmac_tx_submit(struct dma_async_tx_descriptor *tx)
        if (list_is_singular(&atchan->xfers_list))
                at_xdmac_start_xfer(atchan, desc);
 
-       spin_unlock_bh(&atchan->lock);
+       spin_unlock_irqrestore(&atchan->lock, irqflags);
        return cookie;
 }
 
@@ -494,61 +494,94 @@ static struct dma_chan *at_xdmac_xlate(struct of_phandle_args *dma_spec,
        return chan;
 }
 
+static int at_xdmac_compute_chan_conf(struct dma_chan *chan,
+                                     enum dma_transfer_direction direction)
+{
+       struct at_xdmac_chan    *atchan = to_at_xdmac_chan(chan);
+       int                     csize, dwidth;
+
+       if (direction == DMA_DEV_TO_MEM) {
+               atchan->cfg =
+                       AT91_XDMAC_DT_PERID(atchan->perid)
+                       | AT_XDMAC_CC_DAM_INCREMENTED_AM
+                       | AT_XDMAC_CC_SAM_FIXED_AM
+                       | AT_XDMAC_CC_DIF(atchan->memif)
+                       | AT_XDMAC_CC_SIF(atchan->perif)
+                       | AT_XDMAC_CC_SWREQ_HWR_CONNECTED
+                       | AT_XDMAC_CC_DSYNC_PER2MEM
+                       | AT_XDMAC_CC_MBSIZE_SIXTEEN
+                       | AT_XDMAC_CC_TYPE_PER_TRAN;
+               csize = ffs(atchan->sconfig.src_maxburst) - 1;
+               if (csize < 0) {
+                       dev_err(chan2dev(chan), "invalid src maxburst value\n");
+                       return -EINVAL;
+               }
+               atchan->cfg |= AT_XDMAC_CC_CSIZE(csize);
+               dwidth = ffs(atchan->sconfig.src_addr_width) - 1;
+               if (dwidth < 0) {
+                       dev_err(chan2dev(chan), "invalid src addr width value\n");
+                       return -EINVAL;
+               }
+               atchan->cfg |= AT_XDMAC_CC_DWIDTH(dwidth);
+       } else if (direction == DMA_MEM_TO_DEV) {
+               atchan->cfg =
+                       AT91_XDMAC_DT_PERID(atchan->perid)
+                       | AT_XDMAC_CC_DAM_FIXED_AM
+                       | AT_XDMAC_CC_SAM_INCREMENTED_AM
+                       | AT_XDMAC_CC_DIF(atchan->perif)
+                       | AT_XDMAC_CC_SIF(atchan->memif)
+                       | AT_XDMAC_CC_SWREQ_HWR_CONNECTED
+                       | AT_XDMAC_CC_DSYNC_MEM2PER
+                       | AT_XDMAC_CC_MBSIZE_SIXTEEN
+                       | AT_XDMAC_CC_TYPE_PER_TRAN;
+               csize = ffs(atchan->sconfig.dst_maxburst) - 1;
+               if (csize < 0) {
+                       dev_err(chan2dev(chan), "invalid src maxburst value\n");
+                       return -EINVAL;
+               }
+               atchan->cfg |= AT_XDMAC_CC_CSIZE(csize);
+               dwidth = ffs(atchan->sconfig.dst_addr_width) - 1;
+               if (dwidth < 0) {
+                       dev_err(chan2dev(chan), "invalid dst addr width value\n");
+                       return -EINVAL;
+               }
+               atchan->cfg |= AT_XDMAC_CC_DWIDTH(dwidth);
+       }
+
+       dev_dbg(chan2dev(chan), "%s: cfg=0x%08x\n", __func__, atchan->cfg);
+
+       return 0;
+}
+
+/*
+ * Only check that maxburst and addr width values are supported by the
+ * the controller but not that the configuration is good to perform the
+ * transfer since we don't know the direction at this stage.
+ */
+static int at_xdmac_check_slave_config(struct dma_slave_config *sconfig)
+{
+       if ((sconfig->src_maxburst > AT_XDMAC_MAX_CSIZE)
+           || (sconfig->dst_maxburst > AT_XDMAC_MAX_CSIZE))
+               return -EINVAL;
+
+       if ((sconfig->src_addr_width > AT_XDMAC_MAX_DWIDTH)
+           || (sconfig->dst_addr_width > AT_XDMAC_MAX_DWIDTH))
+               return -EINVAL;
+
+       return 0;
+}
+
 static int at_xdmac_set_slave_config(struct dma_chan *chan,
                                      struct dma_slave_config *sconfig)
 {
        struct at_xdmac_chan    *atchan = to_at_xdmac_chan(chan);
-       u8 dwidth;
-       int csize;
 
-       atchan->cfg[AT_XDMAC_DEV_TO_MEM_CFG] =
-               AT91_XDMAC_DT_PERID(atchan->perid)
-               | AT_XDMAC_CC_DAM_INCREMENTED_AM
-               | AT_XDMAC_CC_SAM_FIXED_AM
-               | AT_XDMAC_CC_DIF(atchan->memif)
-               | AT_XDMAC_CC_SIF(atchan->perif)
-               | AT_XDMAC_CC_SWREQ_HWR_CONNECTED
-               | AT_XDMAC_CC_DSYNC_PER2MEM
-               | AT_XDMAC_CC_MBSIZE_SIXTEEN
-               | AT_XDMAC_CC_TYPE_PER_TRAN;
-       csize = at_xdmac_csize(sconfig->src_maxburst);
-       if (csize < 0) {
-               dev_err(chan2dev(chan), "invalid src maxburst value\n");
+       if (at_xdmac_check_slave_config(sconfig)) {
+               dev_err(chan2dev(chan), "invalid slave configuration\n");
                return -EINVAL;
        }
-       atchan->cfg[AT_XDMAC_DEV_TO_MEM_CFG] |= AT_XDMAC_CC_CSIZE(csize);
-       dwidth = ffs(sconfig->src_addr_width) - 1;
-       atchan->cfg[AT_XDMAC_DEV_TO_MEM_CFG] |= AT_XDMAC_CC_DWIDTH(dwidth);
-
-
-       atchan->cfg[AT_XDMAC_MEM_TO_DEV_CFG] =
-               AT91_XDMAC_DT_PERID(atchan->perid)
-               | AT_XDMAC_CC_DAM_FIXED_AM
-               | AT_XDMAC_CC_SAM_INCREMENTED_AM
-               | AT_XDMAC_CC_DIF(atchan->perif)
-               | AT_XDMAC_CC_SIF(atchan->memif)
-               | AT_XDMAC_CC_SWREQ_HWR_CONNECTED
-               | AT_XDMAC_CC_DSYNC_MEM2PER
-               | AT_XDMAC_CC_MBSIZE_SIXTEEN
-               | AT_XDMAC_CC_TYPE_PER_TRAN;
-       csize = at_xdmac_csize(sconfig->dst_maxburst);
-       if (csize < 0) {
-               dev_err(chan2dev(chan), "invalid src maxburst value\n");
-               return -EINVAL;
-       }
-       atchan->cfg[AT_XDMAC_MEM_TO_DEV_CFG] |= AT_XDMAC_CC_CSIZE(csize);
-       dwidth = ffs(sconfig->dst_addr_width) - 1;
-       atchan->cfg[AT_XDMAC_MEM_TO_DEV_CFG] |= AT_XDMAC_CC_DWIDTH(dwidth);
-
-       /* Src and dst addr are needed to configure the link list descriptor. */
-       atchan->per_src_addr = sconfig->src_addr;
-       atchan->per_dst_addr = sconfig->dst_addr;
 
-       dev_dbg(chan2dev(chan),
-               "%s: cfg[dev2mem]=0x%08x, cfg[mem2dev]=0x%08x, per_src_addr=0x%08x, per_dst_addr=0x%08x\n",
-               __func__, atchan->cfg[AT_XDMAC_DEV_TO_MEM_CFG],
-               atchan->cfg[AT_XDMAC_MEM_TO_DEV_CFG],
-               atchan->per_src_addr, atchan->per_dst_addr);
+       memcpy(&atchan->sconfig, sconfig, sizeof(atchan->sconfig));
 
        return 0;
 }
@@ -563,6 +596,8 @@ at_xdmac_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
        struct scatterlist      *sg;
        int                     i;
        unsigned int            xfer_size = 0;
+       unsigned long           irqflags;
+       struct dma_async_tx_descriptor  *ret = NULL;
 
        if (!sgl)
                return NULL;
@@ -578,7 +613,10 @@ at_xdmac_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
                 flags);
 
        /* Protect dma_sconfig field that can be modified by set_slave_conf. */
-       spin_lock_bh(&atchan->lock);
+       spin_lock_irqsave(&atchan->lock, irqflags);
+
+       if (at_xdmac_compute_chan_conf(chan, direction))
+               goto spin_unlock;
 
        /* Prepare descriptors. */
        for_each_sg(sgl, sg, sg_len, i) {
@@ -589,8 +627,7 @@ at_xdmac_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
                mem = sg_dma_address(sg);
                if (unlikely(!len)) {
                        dev_err(chan2dev(chan), "sg data length is zero\n");
-                       spin_unlock_bh(&atchan->lock);
-                       return NULL;
+                       goto spin_unlock;
                }
                dev_dbg(chan2dev(chan), "%s: * sg%d len=%u, mem=0x%08x\n",
                         __func__, i, len, mem);
@@ -600,20 +637,18 @@ at_xdmac_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
                        dev_err(chan2dev(chan), "can't get descriptor\n");
                        if (first)
                                list_splice_init(&first->descs_list, &atchan->free_descs_list);
-                       spin_unlock_bh(&atchan->lock);
-                       return NULL;
+                       goto spin_unlock;
                }
 
                /* Linked list descriptor setup. */
                if (direction == DMA_DEV_TO_MEM) {
-                       desc->lld.mbr_sa = atchan->per_src_addr;
+                       desc->lld.mbr_sa = atchan->sconfig.src_addr;
                        desc->lld.mbr_da = mem;
-                       desc->lld.mbr_cfg = atchan->cfg[AT_XDMAC_DEV_TO_MEM_CFG];
                } else {
                        desc->lld.mbr_sa = mem;
-                       desc->lld.mbr_da = atchan->per_dst_addr;
-                       desc->lld.mbr_cfg = atchan->cfg[AT_XDMAC_MEM_TO_DEV_CFG];
+                       desc->lld.mbr_da = atchan->sconfig.dst_addr;
                }
+               desc->lld.mbr_cfg = atchan->cfg;
                dwidth = at_xdmac_get_dwidth(desc->lld.mbr_cfg);
                fixed_dwidth = IS_ALIGNED(len, 1 << dwidth)
                               ? at_xdmac_get_dwidth(desc->lld.mbr_cfg)
@@ -645,13 +680,15 @@ at_xdmac_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
                xfer_size += len;
        }
 
-       spin_unlock_bh(&atchan->lock);
 
        first->tx_dma_desc.flags = flags;
        first->xfer_size = xfer_size;
        first->direction = direction;
+       ret = &first->tx_dma_desc;
 
-       return &first->tx_dma_desc;
+spin_unlock:
+       spin_unlock_irqrestore(&atchan->lock, irqflags);
+       return ret;
 }
 
 static struct dma_async_tx_descriptor *
@@ -664,6 +701,7 @@ at_xdmac_prep_dma_cyclic(struct dma_chan *chan, dma_addr_t buf_addr,
        struct at_xdmac_desc    *first = NULL, *prev = NULL;
        unsigned int            periods = buf_len / period_len;
        int                     i;
+       unsigned long           irqflags;
 
        dev_dbg(chan2dev(chan), "%s: buf_addr=%pad, buf_len=%zd, period_len=%zd, dir=%s, flags=0x%lx\n",
                __func__, &buf_addr, buf_len, period_len,
@@ -679,32 +717,34 @@ at_xdmac_prep_dma_cyclic(struct dma_chan *chan, dma_addr_t buf_addr,
                return NULL;
        }
 
+       if (at_xdmac_compute_chan_conf(chan, direction))
+               return NULL;
+
        for (i = 0; i < periods; i++) {
                struct at_xdmac_desc    *desc = NULL;
 
-               spin_lock_bh(&atchan->lock);
+               spin_lock_irqsave(&atchan->lock, irqflags);
                desc = at_xdmac_get_desc(atchan);
                if (!desc) {
                        dev_err(chan2dev(chan), "can't get descriptor\n");
                        if (first)
                                list_splice_init(&first->descs_list, &atchan->free_descs_list);
-                       spin_unlock_bh(&atchan->lock);
+                       spin_unlock_irqrestore(&atchan->lock, irqflags);
                        return NULL;
                }
-               spin_unlock_bh(&atchan->lock);
+               spin_unlock_irqrestore(&atchan->lock, irqflags);
                dev_dbg(chan2dev(chan),
                        "%s: desc=0x%p, tx_dma_desc.phys=%pad\n",
                        __func__, desc, &desc->tx_dma_desc.phys);
 
                if (direction == DMA_DEV_TO_MEM) {
-                       desc->lld.mbr_sa = atchan->per_src_addr;
+                       desc->lld.mbr_sa = atchan->sconfig.src_addr;
                        desc->lld.mbr_da = buf_addr + i * period_len;
-                       desc->lld.mbr_cfg = atchan->cfg[AT_XDMAC_DEV_TO_MEM_CFG];
                } else {
                        desc->lld.mbr_sa = buf_addr + i * period_len;
-                       desc->lld.mbr_da = atchan->per_dst_addr;
-                       desc->lld.mbr_cfg = atchan->cfg[AT_XDMAC_MEM_TO_DEV_CFG];
+                       desc->lld.mbr_da = atchan->sconfig.dst_addr;
                }
+               desc->lld.mbr_cfg = atchan->cfg;
                desc->lld.mbr_ubc = AT_XDMAC_MBR_UBC_NDV1
                        | AT_XDMAC_MBR_UBC_NDEN
                        | AT_XDMAC_MBR_UBC_NSEN
@@ -766,6 +806,7 @@ at_xdmac_prep_dma_memcpy(struct dma_chan *chan, dma_addr_t dest, dma_addr_t src,
                                        | AT_XDMAC_CC_SIF(0)
                                        | AT_XDMAC_CC_MBSIZE_SIXTEEN
                                        | AT_XDMAC_CC_TYPE_MEM_TRAN;
+       unsigned long           irqflags;
 
        dev_dbg(chan2dev(chan), "%s: src=%pad, dest=%pad, len=%zd, flags=0x%lx\n",
                __func__, &src, &dest, len, flags);
@@ -798,9 +839,9 @@ at_xdmac_prep_dma_memcpy(struct dma_chan *chan, dma_addr_t dest, dma_addr_t src,
 
                dev_dbg(chan2dev(chan), "%s: remaining_size=%zu\n", __func__, remaining_size);
 
-               spin_lock_bh(&atchan->lock);
+               spin_lock_irqsave(&atchan->lock, irqflags);
                desc = at_xdmac_get_desc(atchan);
-               spin_unlock_bh(&atchan->lock);
+               spin_unlock_irqrestore(&atchan->lock, irqflags);
                if (!desc) {
                        dev_err(chan2dev(chan), "can't get descriptor\n");
                        if (first)
@@ -886,6 +927,7 @@ at_xdmac_tx_status(struct dma_chan *chan, dma_cookie_t cookie,
        int                     residue;
        u32                     cur_nda, mask, value;
        u8                      dwidth = 0;
+       unsigned long           flags;
 
        ret = dma_cookie_status(chan, cookie, txstate);
        if (ret == DMA_COMPLETE)
@@ -894,7 +936,7 @@ at_xdmac_tx_status(struct dma_chan *chan, dma_cookie_t cookie,
        if (!txstate)
                return ret;
 
-       spin_lock_bh(&atchan->lock);
+       spin_lock_irqsave(&atchan->lock, flags);
 
        desc = list_first_entry(&atchan->xfers_list, struct at_xdmac_desc, xfer_node);
 
@@ -904,8 +946,7 @@ at_xdmac_tx_status(struct dma_chan *chan, dma_cookie_t cookie,
         */
        if (!desc->active_xfer) {
                dma_set_residue(txstate, desc->xfer_size);
-               spin_unlock_bh(&atchan->lock);
-               return ret;
+               goto spin_unlock;
        }
 
        residue = desc->xfer_size;
@@ -936,14 +977,14 @@ at_xdmac_tx_status(struct dma_chan *chan, dma_cookie_t cookie,
        }
        residue += at_xdmac_chan_read(atchan, AT_XDMAC_CUBC) << dwidth;
 
-       spin_unlock_bh(&atchan->lock);
-
        dma_set_residue(txstate, residue);
 
        dev_dbg(chan2dev(chan),
                 "%s: desc=0x%p, tx_dma_desc.phys=%pad, tx_status=%d, cookie=%d, residue=%d\n",
                 __func__, desc, &desc->tx_dma_desc.phys, ret, cookie, residue);
 
+spin_unlock:
+       spin_unlock_irqrestore(&atchan->lock, flags);
        return ret;
 }
 
@@ -964,8 +1005,9 @@ static void at_xdmac_remove_xfer(struct at_xdmac_chan *atchan,
 static void at_xdmac_advance_work(struct at_xdmac_chan *atchan)
 {
        struct at_xdmac_desc    *desc;
+       unsigned long           flags;
 
-       spin_lock_bh(&atchan->lock);
+       spin_lock_irqsave(&atchan->lock, flags);
 
        /*
         * If channel is enabled, do nothing, advance_work will be triggered
@@ -980,7 +1022,7 @@ static void at_xdmac_advance_work(struct at_xdmac_chan *atchan)
                        at_xdmac_start_xfer(atchan, desc);
        }
 
-       spin_unlock_bh(&atchan->lock);
+       spin_unlock_irqrestore(&atchan->lock, flags);
 }
 
 static void at_xdmac_handle_cyclic(struct at_xdmac_chan *atchan)
@@ -1116,12 +1158,13 @@ static int at_xdmac_device_config(struct dma_chan *chan,
 {
        struct at_xdmac_chan    *atchan = to_at_xdmac_chan(chan);
        int ret;
+       unsigned long           flags;
 
        dev_dbg(chan2dev(chan), "%s\n", __func__);
 
-       spin_lock_bh(&atchan->lock);
+       spin_lock_irqsave(&atchan->lock, flags);
        ret = at_xdmac_set_slave_config(chan, config);
-       spin_unlock_bh(&atchan->lock);
+       spin_unlock_irqrestore(&atchan->lock, flags);
 
        return ret;
 }
@@ -1130,18 +1173,19 @@ static int at_xdmac_device_pause(struct dma_chan *chan)
 {
        struct at_xdmac_chan    *atchan = to_at_xdmac_chan(chan);
        struct at_xdmac         *atxdmac = to_at_xdmac(atchan->chan.device);
+       unsigned long           flags;
 
        dev_dbg(chan2dev(chan), "%s\n", __func__);
 
        if (test_and_set_bit(AT_XDMAC_CHAN_IS_PAUSED, &atchan->status))
                return 0;
 
-       spin_lock_bh(&atchan->lock);
+       spin_lock_irqsave(&atchan->lock, flags);
        at_xdmac_write(atxdmac, AT_XDMAC_GRWS, atchan->mask);
        while (at_xdmac_chan_read(atchan, AT_XDMAC_CC)
               & (AT_XDMAC_CC_WRIP | AT_XDMAC_CC_RDIP))
                cpu_relax();
-       spin_unlock_bh(&atchan->lock);
+       spin_unlock_irqrestore(&atchan->lock, flags);
 
        return 0;
 }
@@ -1150,18 +1194,19 @@ static int at_xdmac_device_resume(struct dma_chan *chan)
 {
        struct at_xdmac_chan    *atchan = to_at_xdmac_chan(chan);
        struct at_xdmac         *atxdmac = to_at_xdmac(atchan->chan.device);
+       unsigned long           flags;
 
        dev_dbg(chan2dev(chan), "%s\n", __func__);
 
-       spin_lock_bh(&atchan->lock);
+       spin_lock_irqsave(&atchan->lock, flags);
        if (!at_xdmac_chan_is_paused(atchan)) {
-               spin_unlock_bh(&atchan->lock);
+               spin_unlock_irqrestore(&atchan->lock, flags);
                return 0;
        }
 
        at_xdmac_write(atxdmac, AT_XDMAC_GRWR, atchan->mask);
        clear_bit(AT_XDMAC_CHAN_IS_PAUSED, &atchan->status);
-       spin_unlock_bh(&atchan->lock);
+       spin_unlock_irqrestore(&atchan->lock, flags);
 
        return 0;
 }
@@ -1171,10 +1216,11 @@ static int at_xdmac_device_terminate_all(struct dma_chan *chan)
        struct at_xdmac_desc    *desc, *_desc;
        struct at_xdmac_chan    *atchan = to_at_xdmac_chan(chan);
        struct at_xdmac         *atxdmac = to_at_xdmac(atchan->chan.device);
+       unsigned long           flags;
 
        dev_dbg(chan2dev(chan), "%s\n", __func__);
 
-       spin_lock_bh(&atchan->lock);
+       spin_lock_irqsave(&atchan->lock, flags);
        at_xdmac_write(atxdmac, AT_XDMAC_GD, atchan->mask);
        while (at_xdmac_read(atxdmac, AT_XDMAC_GS) & atchan->mask)
                cpu_relax();
@@ -1184,7 +1230,7 @@ static int at_xdmac_device_terminate_all(struct dma_chan *chan)
                at_xdmac_remove_xfer(atchan, desc);
 
        clear_bit(AT_XDMAC_CHAN_IS_CYCLIC, &atchan->status);
-       spin_unlock_bh(&atchan->lock);
+       spin_unlock_irqrestore(&atchan->lock, flags);
 
        return 0;
 }
@@ -1194,8 +1240,9 @@ static int at_xdmac_alloc_chan_resources(struct dma_chan *chan)
        struct at_xdmac_chan    *atchan = to_at_xdmac_chan(chan);
        struct at_xdmac_desc    *desc;
        int                     i;
+       unsigned long           flags;
 
-       spin_lock_bh(&atchan->lock);
+       spin_lock_irqsave(&atchan->lock, flags);
 
        if (at_xdmac_chan_is_enabled(atchan)) {
                dev_err(chan2dev(chan),
@@ -1226,7 +1273,7 @@ static int at_xdmac_alloc_chan_resources(struct dma_chan *chan)
        dev_dbg(chan2dev(chan), "%s: allocated %d descriptors\n", __func__, i);
 
 spin_unlock:
-       spin_unlock_bh(&atchan->lock);
+       spin_unlock_irqrestore(&atchan->lock, flags);
        return i;
 }
 
index 2890d744bb1bb902cc095fb87841c492cef7542c..3ddfd1f6c23c0f0f891ed11d6f68cbcaaa3c6e03 100644 (file)
@@ -487,7 +487,11 @@ int dma_get_slave_caps(struct dma_chan *chan, struct dma_slave_caps *caps)
        caps->directions = device->directions;
        caps->residue_granularity = device->residue_granularity;
 
-       caps->cmd_pause = !!device->device_pause;
+       /*
+        * Some devices implement only pause (e.g. to get residuum) but no
+        * resume. However cmd_pause is advertised as pause AND resume.
+        */
+       caps->cmd_pause = !!(device->device_pause && device->device_resume);
        caps->cmd_terminate = !!device->device_terminate_all;
 
        return 0;
index 3fdd3912709af54950f84f7f2dacb1e9a5aee366..3001f1ae106281d4a9719446036a7efe73a71ed8 100644 (file)
@@ -12,7 +12,8 @@ obj-$(CONFIG_ISCSI_IBFT_FIND) += iscsi_ibft_find.o
 obj-$(CONFIG_ISCSI_IBFT)       += iscsi_ibft.o
 obj-$(CONFIG_FIRMWARE_MEMMAP)  += memmap.o
 obj-$(CONFIG_QCOM_SCM)         += qcom_scm.o
-CFLAGS_qcom_scm.o :=$(call as-instr,.arch_extension sec,-DREQUIRES_SEC=1)
+obj-$(CONFIG_QCOM_SCM)         += qcom_scm-32.o
+CFLAGS_qcom_scm-32.o :=$(call as-instr,.arch_extension sec,-DREQUIRES_SEC=1)
 
 obj-$(CONFIG_GOOGLE_FIRMWARE)  += google/
 obj-$(CONFIG_EFI)              += efi/
diff --git a/drivers/firmware/qcom_scm-32.c b/drivers/firmware/qcom_scm-32.c
new file mode 100644 (file)
index 0000000..1bd6f9c
--- /dev/null
@@ -0,0 +1,503 @@
+/* Copyright (c) 2010,2015, The Linux Foundation. All rights reserved.
+ * Copyright (C) 2015 Linaro 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 and
+ * only 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ */
+
+#include <linux/slab.h>
+#include <linux/io.h>
+#include <linux/module.h>
+#include <linux/mutex.h>
+#include <linux/errno.h>
+#include <linux/err.h>
+#include <linux/qcom_scm.h>
+
+#include <asm/outercache.h>
+#include <asm/cacheflush.h>
+
+#include "qcom_scm.h"
+
+#define QCOM_SCM_FLAG_COLDBOOT_CPU0    0x00
+#define QCOM_SCM_FLAG_COLDBOOT_CPU1    0x01
+#define QCOM_SCM_FLAG_COLDBOOT_CPU2    0x08
+#define QCOM_SCM_FLAG_COLDBOOT_CPU3    0x20
+
+#define QCOM_SCM_FLAG_WARMBOOT_CPU0    0x04
+#define QCOM_SCM_FLAG_WARMBOOT_CPU1    0x02
+#define QCOM_SCM_FLAG_WARMBOOT_CPU2    0x10
+#define QCOM_SCM_FLAG_WARMBOOT_CPU3    0x40
+
+struct qcom_scm_entry {
+       int flag;
+       void *entry;
+};
+
+static struct qcom_scm_entry qcom_scm_wb[] = {
+       { .flag = QCOM_SCM_FLAG_WARMBOOT_CPU0 },
+       { .flag = QCOM_SCM_FLAG_WARMBOOT_CPU1 },
+       { .flag = QCOM_SCM_FLAG_WARMBOOT_CPU2 },
+       { .flag = QCOM_SCM_FLAG_WARMBOOT_CPU3 },
+};
+
+static DEFINE_MUTEX(qcom_scm_lock);
+
+/**
+ * struct qcom_scm_command - one SCM command buffer
+ * @len: total available memory for command and response
+ * @buf_offset: start of command buffer
+ * @resp_hdr_offset: start of response buffer
+ * @id: command to be executed
+ * @buf: buffer returned from qcom_scm_get_command_buffer()
+ *
+ * An SCM command is laid out in memory as follows:
+ *
+ *     ------------------- <--- struct qcom_scm_command
+ *     | command header  |
+ *     ------------------- <--- qcom_scm_get_command_buffer()
+ *     | command buffer  |
+ *     ------------------- <--- struct qcom_scm_response and
+ *     | response header |      qcom_scm_command_to_response()
+ *     ------------------- <--- qcom_scm_get_response_buffer()
+ *     | response buffer |
+ *     -------------------
+ *
+ * There can be arbitrary padding between the headers and buffers so
+ * you should always use the appropriate qcom_scm_get_*_buffer() routines
+ * to access the buffers in a safe manner.
+ */
+struct qcom_scm_command {
+       __le32 len;
+       __le32 buf_offset;
+       __le32 resp_hdr_offset;
+       __le32 id;
+       __le32 buf[0];
+};
+
+/**
+ * struct qcom_scm_response - one SCM response buffer
+ * @len: total available memory for response
+ * @buf_offset: start of response data relative to start of qcom_scm_response
+ * @is_complete: indicates if the command has finished processing
+ */
+struct qcom_scm_response {
+       __le32 len;
+       __le32 buf_offset;
+       __le32 is_complete;
+};
+
+/**
+ * alloc_qcom_scm_command() - Allocate an SCM command
+ * @cmd_size: size of the command buffer
+ * @resp_size: size of the response buffer
+ *
+ * Allocate an SCM command, including enough room for the command
+ * and response headers as well as the command and response buffers.
+ *
+ * Returns a valid &qcom_scm_command on success or %NULL if the allocation fails.
+ */
+static struct qcom_scm_command *alloc_qcom_scm_command(size_t cmd_size, size_t resp_size)
+{
+       struct qcom_scm_command *cmd;
+       size_t len = sizeof(*cmd) + sizeof(struct qcom_scm_response) + cmd_size +
+               resp_size;
+       u32 offset;
+
+       cmd = kzalloc(PAGE_ALIGN(len), GFP_KERNEL);
+       if (cmd) {
+               cmd->len = cpu_to_le32(len);
+               offset = offsetof(struct qcom_scm_command, buf);
+               cmd->buf_offset = cpu_to_le32(offset);
+               cmd->resp_hdr_offset = cpu_to_le32(offset + cmd_size);
+       }
+       return cmd;
+}
+
+/**
+ * free_qcom_scm_command() - Free an SCM command
+ * @cmd: command to free
+ *
+ * Free an SCM command.
+ */
+static inline void free_qcom_scm_command(struct qcom_scm_command *cmd)
+{
+       kfree(cmd);
+}
+
+/**
+ * qcom_scm_command_to_response() - Get a pointer to a qcom_scm_response
+ * @cmd: command
+ *
+ * Returns a pointer to a response for a command.
+ */
+static inline struct qcom_scm_response *qcom_scm_command_to_response(
+               const struct qcom_scm_command *cmd)
+{
+       return (void *)cmd + le32_to_cpu(cmd->resp_hdr_offset);
+}
+
+/**
+ * qcom_scm_get_command_buffer() - Get a pointer to a command buffer
+ * @cmd: command
+ *
+ * Returns a pointer to the command buffer of a command.
+ */
+static inline void *qcom_scm_get_command_buffer(const struct qcom_scm_command *cmd)
+{
+       return (void *)cmd->buf;
+}
+
+/**
+ * qcom_scm_get_response_buffer() - Get a pointer to a response buffer
+ * @rsp: response
+ *
+ * Returns a pointer to a response buffer of a response.
+ */
+static inline void *qcom_scm_get_response_buffer(const struct qcom_scm_response *rsp)
+{
+       return (void *)rsp + le32_to_cpu(rsp->buf_offset);
+}
+
+static int qcom_scm_remap_error(int err)
+{
+       pr_err("qcom_scm_call failed with error code %d\n", err);
+       switch (err) {
+       case QCOM_SCM_ERROR:
+               return -EIO;
+       case QCOM_SCM_EINVAL_ADDR:
+       case QCOM_SCM_EINVAL_ARG:
+               return -EINVAL;
+       case QCOM_SCM_EOPNOTSUPP:
+               return -EOPNOTSUPP;
+       case QCOM_SCM_ENOMEM:
+               return -ENOMEM;
+       }
+       return -EINVAL;
+}
+
+static u32 smc(u32 cmd_addr)
+{
+       int context_id;
+       register u32 r0 asm("r0") = 1;
+       register u32 r1 asm("r1") = (u32)&context_id;
+       register u32 r2 asm("r2") = cmd_addr;
+       do {
+               asm volatile(
+                       __asmeq("%0", "r0")
+                       __asmeq("%1", "r0")
+                       __asmeq("%2", "r1")
+                       __asmeq("%3", "r2")
+#ifdef REQUIRES_SEC
+                       ".arch_extension sec\n"
+#endif
+                       "smc    #0      @ switch to secure world\n"
+                       : "=r" (r0)
+                       : "r" (r0), "r" (r1), "r" (r2)
+                       : "r3");
+       } while (r0 == QCOM_SCM_INTERRUPTED);
+
+       return r0;
+}
+
+static int __qcom_scm_call(const struct qcom_scm_command *cmd)
+{
+       int ret;
+       u32 cmd_addr = virt_to_phys(cmd);
+
+       /*
+        * Flush the command buffer so that the secure world sees
+        * the correct data.
+        */
+       __cpuc_flush_dcache_area((void *)cmd, cmd->len);
+       outer_flush_range(cmd_addr, cmd_addr + cmd->len);
+
+       ret = smc(cmd_addr);
+       if (ret < 0)
+               ret = qcom_scm_remap_error(ret);
+
+       return ret;
+}
+
+static void qcom_scm_inv_range(unsigned long start, unsigned long end)
+{
+       u32 cacheline_size, ctr;
+
+       asm volatile("mrc p15, 0, %0, c0, c0, 1" : "=r" (ctr));
+       cacheline_size = 4 << ((ctr >> 16) & 0xf);
+
+       start = round_down(start, cacheline_size);
+       end = round_up(end, cacheline_size);
+       outer_inv_range(start, end);
+       while (start < end) {
+               asm ("mcr p15, 0, %0, c7, c6, 1" : : "r" (start)
+                    : "memory");
+               start += cacheline_size;
+       }
+       dsb();
+       isb();
+}
+
+/**
+ * qcom_scm_call() - Send an SCM command
+ * @svc_id: service identifier
+ * @cmd_id: command identifier
+ * @cmd_buf: command buffer
+ * @cmd_len: length of the command buffer
+ * @resp_buf: response buffer
+ * @resp_len: length of the response buffer
+ *
+ * Sends a command to the SCM and waits for the command to finish processing.
+ *
+ * A note on cache maintenance:
+ * Note that any buffers that are expected to be accessed by the secure world
+ * must be flushed before invoking qcom_scm_call and invalidated in the cache
+ * immediately after qcom_scm_call returns. Cache maintenance on the command
+ * and response buffers is taken care of by qcom_scm_call; however, callers are
+ * responsible for any other cached buffers passed over to the secure world.
+ */
+static int qcom_scm_call(u32 svc_id, u32 cmd_id, const void *cmd_buf,
+                       size_t cmd_len, void *resp_buf, size_t resp_len)
+{
+       int ret;
+       struct qcom_scm_command *cmd;
+       struct qcom_scm_response *rsp;
+       unsigned long start, end;
+
+       cmd = alloc_qcom_scm_command(cmd_len, resp_len);
+       if (!cmd)
+               return -ENOMEM;
+
+       cmd->id = cpu_to_le32((svc_id << 10) | cmd_id);
+       if (cmd_buf)
+               memcpy(qcom_scm_get_command_buffer(cmd), cmd_buf, cmd_len);
+
+       mutex_lock(&qcom_scm_lock);
+       ret = __qcom_scm_call(cmd);
+       mutex_unlock(&qcom_scm_lock);
+       if (ret)
+               goto out;
+
+       rsp = qcom_scm_command_to_response(cmd);
+       start = (unsigned long)rsp;
+
+       do {
+               qcom_scm_inv_range(start, start + sizeof(*rsp));
+       } while (!rsp->is_complete);
+
+       end = (unsigned long)qcom_scm_get_response_buffer(rsp) + resp_len;
+       qcom_scm_inv_range(start, end);
+
+       if (resp_buf)
+               memcpy(resp_buf, qcom_scm_get_response_buffer(rsp), resp_len);
+out:
+       free_qcom_scm_command(cmd);
+       return ret;
+}
+
+#define SCM_CLASS_REGISTER     (0x2 << 8)
+#define SCM_MASK_IRQS          BIT(5)
+#define SCM_ATOMIC(svc, cmd, n) (((((svc) << 10)|((cmd) & 0x3ff)) << 12) | \
+                               SCM_CLASS_REGISTER | \
+                               SCM_MASK_IRQS | \
+                               (n & 0xf))
+
+/**
+ * qcom_scm_call_atomic1() - Send an atomic SCM command with one argument
+ * @svc_id: service identifier
+ * @cmd_id: command identifier
+ * @arg1: first argument
+ *
+ * This shall only be used with commands that are guaranteed to be
+ * uninterruptable, atomic and SMP safe.
+ */
+static s32 qcom_scm_call_atomic1(u32 svc, u32 cmd, u32 arg1)
+{
+       int context_id;
+
+       register u32 r0 asm("r0") = SCM_ATOMIC(svc, cmd, 1);
+       register u32 r1 asm("r1") = (u32)&context_id;
+       register u32 r2 asm("r2") = arg1;
+
+       asm volatile(
+                       __asmeq("%0", "r0")
+                       __asmeq("%1", "r0")
+                       __asmeq("%2", "r1")
+                       __asmeq("%3", "r2")
+#ifdef REQUIRES_SEC
+                       ".arch_extension sec\n"
+#endif
+                       "smc    #0      @ switch to secure world\n"
+                       : "=r" (r0)
+                       : "r" (r0), "r" (r1), "r" (r2)
+                       : "r3");
+       return r0;
+}
+
+u32 qcom_scm_get_version(void)
+{
+       int context_id;
+       static u32 version = -1;
+       register u32 r0 asm("r0");
+       register u32 r1 asm("r1");
+
+       if (version != -1)
+               return version;
+
+       mutex_lock(&qcom_scm_lock);
+
+       r0 = 0x1 << 8;
+       r1 = (u32)&context_id;
+       do {
+               asm volatile(
+                       __asmeq("%0", "r0")
+                       __asmeq("%1", "r1")
+                       __asmeq("%2", "r0")
+                       __asmeq("%3", "r1")
+#ifdef REQUIRES_SEC
+                       ".arch_extension sec\n"
+#endif
+                       "smc    #0      @ switch to secure world\n"
+                       : "=r" (r0), "=r" (r1)
+                       : "r" (r0), "r" (r1)
+                       : "r2", "r3");
+       } while (r0 == QCOM_SCM_INTERRUPTED);
+
+       version = r1;
+       mutex_unlock(&qcom_scm_lock);
+
+       return version;
+}
+EXPORT_SYMBOL(qcom_scm_get_version);
+
+/*
+ * Set the cold/warm boot address for one of the CPU cores.
+ */
+static int qcom_scm_set_boot_addr(u32 addr, int flags)
+{
+       struct {
+               __le32 flags;
+               __le32 addr;
+       } cmd;
+
+       cmd.addr = cpu_to_le32(addr);
+       cmd.flags = cpu_to_le32(flags);
+       return qcom_scm_call(QCOM_SCM_SVC_BOOT, QCOM_SCM_BOOT_ADDR,
+                       &cmd, sizeof(cmd), NULL, 0);
+}
+
+/**
+ * qcom_scm_set_cold_boot_addr() - Set the cold boot address for cpus
+ * @entry: Entry point function for the cpus
+ * @cpus: The cpumask of cpus that will use the entry point
+ *
+ * Set the cold boot address of the cpus. Any cpu outside the supported
+ * range would be removed from the cpu present mask.
+ */
+int __qcom_scm_set_cold_boot_addr(void *entry, const cpumask_t *cpus)
+{
+       int flags = 0;
+       int cpu;
+       int scm_cb_flags[] = {
+               QCOM_SCM_FLAG_COLDBOOT_CPU0,
+               QCOM_SCM_FLAG_COLDBOOT_CPU1,
+               QCOM_SCM_FLAG_COLDBOOT_CPU2,
+               QCOM_SCM_FLAG_COLDBOOT_CPU3,
+       };
+
+       if (!cpus || (cpus && cpumask_empty(cpus)))
+               return -EINVAL;
+
+       for_each_cpu(cpu, cpus) {
+               if (cpu < ARRAY_SIZE(scm_cb_flags))
+                       flags |= scm_cb_flags[cpu];
+               else
+                       set_cpu_present(cpu, false);
+       }
+
+       return qcom_scm_set_boot_addr(virt_to_phys(entry), flags);
+}
+
+/**
+ * qcom_scm_set_warm_boot_addr() - Set the warm boot address for cpus
+ * @entry: Entry point function for the cpus
+ * @cpus: The cpumask of cpus that will use the entry point
+ *
+ * Set the Linux entry point for the SCM to transfer control to when coming
+ * out of a power down. CPU power down may be executed on cpuidle or hotplug.
+ */
+int __qcom_scm_set_warm_boot_addr(void *entry, const cpumask_t *cpus)
+{
+       int ret;
+       int flags = 0;
+       int cpu;
+
+       /*
+        * Reassign only if we are switching from hotplug entry point
+        * to cpuidle entry point or vice versa.
+        */
+       for_each_cpu(cpu, cpus) {
+               if (entry == qcom_scm_wb[cpu].entry)
+                       continue;
+               flags |= qcom_scm_wb[cpu].flag;
+       }
+
+       /* No change in entry function */
+       if (!flags)
+               return 0;
+
+       ret = qcom_scm_set_boot_addr(virt_to_phys(entry), flags);
+       if (!ret) {
+               for_each_cpu(cpu, cpus)
+                       qcom_scm_wb[cpu].entry = entry;
+       }
+
+       return ret;
+}
+
+/**
+ * qcom_scm_cpu_power_down() - Power down the cpu
+ * @flags - Flags to flush cache
+ *
+ * This is an end point to power down cpu. If there was a pending interrupt,
+ * the control would return from this function, otherwise, the cpu jumps to the
+ * warm boot entry point set for this cpu upon reset.
+ */
+void __qcom_scm_cpu_power_down(u32 flags)
+{
+       qcom_scm_call_atomic1(QCOM_SCM_SVC_BOOT, QCOM_SCM_CMD_TERMINATE_PC,
+                       flags & QCOM_SCM_FLUSH_FLAG_MASK);
+}
+
+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;
+
+       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;
+}
+
+int __qcom_scm_hdcp_req(struct qcom_scm_hdcp_req *req, u32 req_cnt, u32 *resp)
+{
+       if (req_cnt > QCOM_SCM_HDCP_MAX_REQ_CNT)
+               return -ERANGE;
+
+       return qcom_scm_call(QCOM_SCM_SVC_HDCP, QCOM_SCM_CMD_HDCP,
+               req, req_cnt * sizeof(*req), resp, sizeof(*resp));
+}
index 994b50fd997c5eb0f4583e6c917a34b5752e7e70..45c008d688914fcbd63eb47f059bf0ac679761dd 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, Code Aurora Forum. All rights reserved.
+/* Copyright (c) 2010,2015, The Linux Foundation. All rights reserved.
  * Copyright (C) 2015 Linaro Ltd.
  *
  * This program is free software; you can redistribute it and/or modify
  * 02110-1301, USA.
  */
 
-#include <linux/slab.h>
-#include <linux/io.h>
-#include <linux/module.h>
-#include <linux/mutex.h>
-#include <linux/errno.h>
-#include <linux/err.h>
+#include <linux/cpumask.h>
+#include <linux/export.h>
+#include <linux/types.h>
 #include <linux/qcom_scm.h>
 
-#include <asm/outercache.h>
-#include <asm/cacheflush.h>
-
-
-#define QCOM_SCM_ENOMEM                -5
-#define QCOM_SCM_EOPNOTSUPP    -4
-#define QCOM_SCM_EINVAL_ADDR   -3
-#define QCOM_SCM_EINVAL_ARG    -2
-#define QCOM_SCM_ERROR         -1
-#define QCOM_SCM_INTERRUPTED   1
-
-#define QCOM_SCM_FLAG_COLDBOOT_CPU0    0x00
-#define QCOM_SCM_FLAG_COLDBOOT_CPU1    0x01
-#define QCOM_SCM_FLAG_COLDBOOT_CPU2    0x08
-#define QCOM_SCM_FLAG_COLDBOOT_CPU3    0x20
-
-#define QCOM_SCM_FLAG_WARMBOOT_CPU0    0x04
-#define QCOM_SCM_FLAG_WARMBOOT_CPU1    0x02
-#define QCOM_SCM_FLAG_WARMBOOT_CPU2    0x10
-#define QCOM_SCM_FLAG_WARMBOOT_CPU3    0x40
-
-struct qcom_scm_entry {
-       int flag;
-       void *entry;
-};
-
-static struct qcom_scm_entry qcom_scm_wb[] = {
-       { .flag = QCOM_SCM_FLAG_WARMBOOT_CPU0 },
-       { .flag = QCOM_SCM_FLAG_WARMBOOT_CPU1 },
-       { .flag = QCOM_SCM_FLAG_WARMBOOT_CPU2 },
-       { .flag = QCOM_SCM_FLAG_WARMBOOT_CPU3 },
-};
-
-static DEFINE_MUTEX(qcom_scm_lock);
-
-/**
- * struct qcom_scm_command - one SCM command buffer
- * @len: total available memory for command and response
- * @buf_offset: start of command buffer
- * @resp_hdr_offset: start of response buffer
- * @id: command to be executed
- * @buf: buffer returned from qcom_scm_get_command_buffer()
- *
- * An SCM command is laid out in memory as follows:
- *
- *     ------------------- <--- struct qcom_scm_command
- *     | command header  |
- *     ------------------- <--- qcom_scm_get_command_buffer()
- *     | command buffer  |
- *     ------------------- <--- struct qcom_scm_response and
- *     | response header |      qcom_scm_command_to_response()
- *     ------------------- <--- qcom_scm_get_response_buffer()
- *     | response buffer |
- *     -------------------
- *
- * There can be arbitrary padding between the headers and buffers so
- * you should always use the appropriate qcom_scm_get_*_buffer() routines
- * to access the buffers in a safe manner.
- */
-struct qcom_scm_command {
-       __le32 len;
-       __le32 buf_offset;
-       __le32 resp_hdr_offset;
-       __le32 id;
-       __le32 buf[0];
-};
-
-/**
- * struct qcom_scm_response - one SCM response buffer
- * @len: total available memory for response
- * @buf_offset: start of response data relative to start of qcom_scm_response
- * @is_complete: indicates if the command has finished processing
- */
-struct qcom_scm_response {
-       __le32 len;
-       __le32 buf_offset;
-       __le32 is_complete;
-};
-
-/**
- * alloc_qcom_scm_command() - Allocate an SCM command
- * @cmd_size: size of the command buffer
- * @resp_size: size of the response buffer
- *
- * Allocate an SCM command, including enough room for the command
- * and response headers as well as the command and response buffers.
- *
- * Returns a valid &qcom_scm_command on success or %NULL if the allocation fails.
- */
-static struct qcom_scm_command *alloc_qcom_scm_command(size_t cmd_size, size_t resp_size)
-{
-       struct qcom_scm_command *cmd;
-       size_t len = sizeof(*cmd) + sizeof(struct qcom_scm_response) + cmd_size +
-               resp_size;
-       u32 offset;
-
-       cmd = kzalloc(PAGE_ALIGN(len), GFP_KERNEL);
-       if (cmd) {
-               cmd->len = cpu_to_le32(len);
-               offset = offsetof(struct qcom_scm_command, buf);
-               cmd->buf_offset = cpu_to_le32(offset);
-               cmd->resp_hdr_offset = cpu_to_le32(offset + cmd_size);
-       }
-       return cmd;
-}
-
-/**
- * free_qcom_scm_command() - Free an SCM command
- * @cmd: command to free
- *
- * Free an SCM command.
- */
-static inline void free_qcom_scm_command(struct qcom_scm_command *cmd)
-{
-       kfree(cmd);
-}
-
-/**
- * qcom_scm_command_to_response() - Get a pointer to a qcom_scm_response
- * @cmd: command
- *
- * Returns a pointer to a response for a command.
- */
-static inline struct qcom_scm_response *qcom_scm_command_to_response(
-               const struct qcom_scm_command *cmd)
-{
-       return (void *)cmd + le32_to_cpu(cmd->resp_hdr_offset);
-}
-
-/**
- * qcom_scm_get_command_buffer() - Get a pointer to a command buffer
- * @cmd: command
- *
- * Returns a pointer to the command buffer of a command.
- */
-static inline void *qcom_scm_get_command_buffer(const struct qcom_scm_command *cmd)
-{
-       return (void *)cmd->buf;
-}
-
-/**
- * qcom_scm_get_response_buffer() - Get a pointer to a response buffer
- * @rsp: response
- *
- * Returns a pointer to a response buffer of a response.
- */
-static inline void *qcom_scm_get_response_buffer(const struct qcom_scm_response *rsp)
-{
-       return (void *)rsp + le32_to_cpu(rsp->buf_offset);
-}
-
-static int qcom_scm_remap_error(int err)
-{
-       pr_err("qcom_scm_call failed with error code %d\n", err);
-       switch (err) {
-       case QCOM_SCM_ERROR:
-               return -EIO;
-       case QCOM_SCM_EINVAL_ADDR:
-       case QCOM_SCM_EINVAL_ARG:
-               return -EINVAL;
-       case QCOM_SCM_EOPNOTSUPP:
-               return -EOPNOTSUPP;
-       case QCOM_SCM_ENOMEM:
-               return -ENOMEM;
-       }
-       return -EINVAL;
-}
-
-static u32 smc(u32 cmd_addr)
-{
-       int context_id;
-       register u32 r0 asm("r0") = 1;
-       register u32 r1 asm("r1") = (u32)&context_id;
-       register u32 r2 asm("r2") = cmd_addr;
-       do {
-               asm volatile(
-                       __asmeq("%0", "r0")
-                       __asmeq("%1", "r0")
-                       __asmeq("%2", "r1")
-                       __asmeq("%3", "r2")
-#ifdef REQUIRES_SEC
-                       ".arch_extension sec\n"
-#endif
-                       "smc    #0      @ switch to secure world\n"
-                       : "=r" (r0)
-                       : "r" (r0), "r" (r1), "r" (r2)
-                       : "r3");
-       } while (r0 == QCOM_SCM_INTERRUPTED);
-
-       return r0;
-}
-
-static int __qcom_scm_call(const struct qcom_scm_command *cmd)
-{
-       int ret;
-       u32 cmd_addr = virt_to_phys(cmd);
-
-       /*
-        * Flush the command buffer so that the secure world sees
-        * the correct data.
-        */
-       __cpuc_flush_dcache_area((void *)cmd, cmd->len);
-       outer_flush_range(cmd_addr, cmd_addr + cmd->len);
-
-       ret = smc(cmd_addr);
-       if (ret < 0)
-               ret = qcom_scm_remap_error(ret);
-
-       return ret;
-}
-
-static void qcom_scm_inv_range(unsigned long start, unsigned long end)
-{
-       u32 cacheline_size, ctr;
-
-       asm volatile("mrc p15, 0, %0, c0, c0, 1" : "=r" (ctr));
-       cacheline_size = 4 << ((ctr >> 16) & 0xf);
-
-       start = round_down(start, cacheline_size);
-       end = round_up(end, cacheline_size);
-       outer_inv_range(start, end);
-       while (start < end) {
-               asm ("mcr p15, 0, %0, c7, c6, 1" : : "r" (start)
-                    : "memory");
-               start += cacheline_size;
-       }
-       dsb();
-       isb();
-}
-
-/**
- * qcom_scm_call() - Send an SCM command
- * @svc_id: service identifier
- * @cmd_id: command identifier
- * @cmd_buf: command buffer
- * @cmd_len: length of the command buffer
- * @resp_buf: response buffer
- * @resp_len: length of the response buffer
- *
- * Sends a command to the SCM and waits for the command to finish processing.
- *
- * A note on cache maintenance:
- * Note that any buffers that are expected to be accessed by the secure world
- * must be flushed before invoking qcom_scm_call and invalidated in the cache
- * immediately after qcom_scm_call returns. Cache maintenance on the command
- * and response buffers is taken care of by qcom_scm_call; however, callers are
- * responsible for any other cached buffers passed over to the secure world.
- */
-static int qcom_scm_call(u32 svc_id, u32 cmd_id, const void *cmd_buf,
-                       size_t cmd_len, void *resp_buf, size_t resp_len)
-{
-       int ret;
-       struct qcom_scm_command *cmd;
-       struct qcom_scm_response *rsp;
-       unsigned long start, end;
-
-       cmd = alloc_qcom_scm_command(cmd_len, resp_len);
-       if (!cmd)
-               return -ENOMEM;
-
-       cmd->id = cpu_to_le32((svc_id << 10) | cmd_id);
-       if (cmd_buf)
-               memcpy(qcom_scm_get_command_buffer(cmd), cmd_buf, cmd_len);
-
-       mutex_lock(&qcom_scm_lock);
-       ret = __qcom_scm_call(cmd);
-       mutex_unlock(&qcom_scm_lock);
-       if (ret)
-               goto out;
-
-       rsp = qcom_scm_command_to_response(cmd);
-       start = (unsigned long)rsp;
-
-       do {
-               qcom_scm_inv_range(start, start + sizeof(*rsp));
-       } while (!rsp->is_complete);
-
-       end = (unsigned long)qcom_scm_get_response_buffer(rsp) + resp_len;
-       qcom_scm_inv_range(start, end);
-
-       if (resp_buf)
-               memcpy(resp_buf, qcom_scm_get_response_buffer(rsp), resp_len);
-out:
-       free_qcom_scm_command(cmd);
-       return ret;
-}
-
-#define SCM_CLASS_REGISTER     (0x2 << 8)
-#define SCM_MASK_IRQS          BIT(5)
-#define SCM_ATOMIC(svc, cmd, n) (((((svc) << 10)|((cmd) & 0x3ff)) << 12) | \
-                               SCM_CLASS_REGISTER | \
-                               SCM_MASK_IRQS | \
-                               (n & 0xf))
-
-/**
- * qcom_scm_call_atomic1() - Send an atomic SCM command with one argument
- * @svc_id: service identifier
- * @cmd_id: command identifier
- * @arg1: first argument
- *
- * This shall only be used with commands that are guaranteed to be
- * uninterruptable, atomic and SMP safe.
- */
-static s32 qcom_scm_call_atomic1(u32 svc, u32 cmd, u32 arg1)
-{
-       int context_id;
-
-       register u32 r0 asm("r0") = SCM_ATOMIC(svc, cmd, 1);
-       register u32 r1 asm("r1") = (u32)&context_id;
-       register u32 r2 asm("r2") = arg1;
-
-       asm volatile(
-                       __asmeq("%0", "r0")
-                       __asmeq("%1", "r0")
-                       __asmeq("%2", "r1")
-                       __asmeq("%3", "r2")
-#ifdef REQUIRES_SEC
-                       ".arch_extension sec\n"
-#endif
-                       "smc    #0      @ switch to secure world\n"
-                       : "=r" (r0)
-                       : "r" (r0), "r" (r1), "r" (r2)
-                       : "r3");
-       return r0;
-}
-
-u32 qcom_scm_get_version(void)
-{
-       int context_id;
-       static u32 version = -1;
-       register u32 r0 asm("r0");
-       register u32 r1 asm("r1");
-
-       if (version != -1)
-               return version;
-
-       mutex_lock(&qcom_scm_lock);
-
-       r0 = 0x1 << 8;
-       r1 = (u32)&context_id;
-       do {
-               asm volatile(
-                       __asmeq("%0", "r0")
-                       __asmeq("%1", "r1")
-                       __asmeq("%2", "r0")
-                       __asmeq("%3", "r1")
-#ifdef REQUIRES_SEC
-                       ".arch_extension sec\n"
-#endif
-                       "smc    #0      @ switch to secure world\n"
-                       : "=r" (r0), "=r" (r1)
-                       : "r" (r0), "r" (r1)
-                       : "r2", "r3");
-       } while (r0 == QCOM_SCM_INTERRUPTED);
-
-       version = r1;
-       mutex_unlock(&qcom_scm_lock);
-
-       return version;
-}
-EXPORT_SYMBOL(qcom_scm_get_version);
-
-#define QCOM_SCM_SVC_BOOT                      0x1
-#define QCOM_SCM_BOOT_ADDR                     0x1
-/*
- * Set the cold/warm boot address for one of the CPU cores.
- */
-static int qcom_scm_set_boot_addr(u32 addr, int flags)
-{
-       struct {
-               __le32 flags;
-               __le32 addr;
-       } cmd;
-
-       cmd.addr = cpu_to_le32(addr);
-       cmd.flags = cpu_to_le32(flags);
-       return qcom_scm_call(QCOM_SCM_SVC_BOOT, QCOM_SCM_BOOT_ADDR,
-                       &cmd, sizeof(cmd), NULL, 0);
-}
+#include "qcom_scm.h"
 
 /**
  * qcom_scm_set_cold_boot_addr() - Set the cold boot address for cpus
@@ -414,26 +33,7 @@ static int qcom_scm_set_boot_addr(u32 addr, int flags)
  */
 int qcom_scm_set_cold_boot_addr(void *entry, const cpumask_t *cpus)
 {
-       int flags = 0;
-       int cpu;
-       int scm_cb_flags[] = {
-               QCOM_SCM_FLAG_COLDBOOT_CPU0,
-               QCOM_SCM_FLAG_COLDBOOT_CPU1,
-               QCOM_SCM_FLAG_COLDBOOT_CPU2,
-               QCOM_SCM_FLAG_COLDBOOT_CPU3,
-       };
-
-       if (!cpus || (cpus && cpumask_empty(cpus)))
-               return -EINVAL;
-
-       for_each_cpu(cpu, cpus) {
-               if (cpu < ARRAY_SIZE(scm_cb_flags))
-                       flags |= scm_cb_flags[cpu];
-               else
-                       set_cpu_present(cpu, false);
-       }
-
-       return qcom_scm_set_boot_addr(virt_to_phys(entry), flags);
+       return __qcom_scm_set_cold_boot_addr(entry, cpus);
 }
 EXPORT_SYMBOL(qcom_scm_set_cold_boot_addr);
 
@@ -447,37 +47,10 @@ EXPORT_SYMBOL(qcom_scm_set_cold_boot_addr);
  */
 int qcom_scm_set_warm_boot_addr(void *entry, const cpumask_t *cpus)
 {
-       int ret;
-       int flags = 0;
-       int cpu;
-
-       /*
-        * Reassign only if we are switching from hotplug entry point
-        * to cpuidle entry point or vice versa.
-        */
-       for_each_cpu(cpu, cpus) {
-               if (entry == qcom_scm_wb[cpu].entry)
-                       continue;
-               flags |= qcom_scm_wb[cpu].flag;
-       }
-
-       /* No change in entry function */
-       if (!flags)
-               return 0;
-
-       ret = qcom_scm_set_boot_addr(virt_to_phys(entry), flags);
-       if (!ret) {
-               for_each_cpu(cpu, cpus)
-                       qcom_scm_wb[cpu].entry = entry;
-       }
-
-       return ret;
+       return __qcom_scm_set_warm_boot_addr(entry, cpus);
 }
 EXPORT_SYMBOL(qcom_scm_set_warm_boot_addr);
 
-#define QCOM_SCM_CMD_TERMINATE_PC      0x2
-#define QCOM_SCM_FLUSH_FLAG_MASK       0x3
-
 /**
  * qcom_scm_cpu_power_down() - Power down the cpu
  * @flags - Flags to flush cache
@@ -488,7 +61,36 @@ EXPORT_SYMBOL(qcom_scm_set_warm_boot_addr);
  */
 void qcom_scm_cpu_power_down(u32 flags)
 {
-       qcom_scm_call_atomic1(QCOM_SCM_SVC_BOOT, QCOM_SCM_CMD_TERMINATE_PC,
-                       flags & QCOM_SCM_FLUSH_FLAG_MASK);
+       __qcom_scm_cpu_power_down(flags);
 }
 EXPORT_SYMBOL(qcom_scm_cpu_power_down);
+
+/**
+ * qcom_scm_hdcp_available() - Check if secure environment supports HDCP.
+ *
+ * Return true if HDCP is supported, false if not.
+ */
+bool qcom_scm_hdcp_available(void)
+{
+       int ret;
+
+       ret = __qcom_scm_is_call_available(QCOM_SCM_SVC_HDCP,
+               QCOM_SCM_CMD_HDCP);
+
+       return (ret > 0) ? true : false;
+}
+EXPORT_SYMBOL(qcom_scm_hdcp_available);
+
+/**
+ * qcom_scm_hdcp_req() - Send HDCP request.
+ * @req: HDCP request array
+ * @req_cnt: HDCP request array count
+ * @resp: response buffer passed to SCM
+ *
+ * Write HDCP register(s) through SCM.
+ */
+int qcom_scm_hdcp_req(struct qcom_scm_hdcp_req *req, u32 req_cnt, u32 *resp)
+{
+       return __qcom_scm_hdcp_req(req, req_cnt, resp);
+}
+EXPORT_SYMBOL(qcom_scm_hdcp_req);
diff --git a/drivers/firmware/qcom_scm.h b/drivers/firmware/qcom_scm.h
new file mode 100644 (file)
index 0000000..2cce75c
--- /dev/null
@@ -0,0 +1,47 @@
+/* Copyright (c) 2010-2015, The Linux Foundation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 and
+ * only 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.
+ */
+#ifndef __QCOM_SCM_INT_H
+#define __QCOM_SCM_INT_H
+
+#define QCOM_SCM_SVC_BOOT              0x1
+#define QCOM_SCM_BOOT_ADDR             0x1
+#define QCOM_SCM_BOOT_ADDR_MC          0x11
+
+#define QCOM_SCM_FLAG_HLOS             0x01
+#define QCOM_SCM_FLAG_COLDBOOT_MC      0x02
+#define QCOM_SCM_FLAG_WARMBOOT_MC      0x04
+extern int __qcom_scm_set_warm_boot_addr(void *entry, const cpumask_t *cpus);
+extern int __qcom_scm_set_cold_boot_addr(void *entry, const cpumask_t *cpus);
+
+#define QCOM_SCM_CMD_TERMINATE_PC      0x2
+#define QCOM_SCM_FLUSH_FLAG_MASK       0x3
+#define QCOM_SCM_CMD_CORE_HOTPLUGGED   0x10
+extern void __qcom_scm_cpu_power_down(u32 flags);
+
+#define QCOM_SCM_SVC_INFO              0x6
+#define QCOM_IS_CALL_AVAIL_CMD         0x1
+extern int __qcom_scm_is_call_available(u32 svc_id, u32 cmd_id);
+
+#define QCOM_SCM_SVC_HDCP              0x11
+#define QCOM_SCM_CMD_HDCP              0x01
+extern int __qcom_scm_hdcp_req(struct qcom_scm_hdcp_req *req, u32 req_cnt,
+               u32 *resp);
+
+/* common error codes */
+#define QCOM_SCM_ENOMEM                -5
+#define QCOM_SCM_EOPNOTSUPP    -4
+#define QCOM_SCM_EINVAL_ADDR   -3
+#define QCOM_SCM_EINVAL_ARG    -2
+#define QCOM_SCM_ERROR         -1
+#define QCOM_SCM_INTERRUPTED   1
+
+#endif
index 851b585987f9aebeaff662844f5d5d356bbc5e6f..2d0995e7afc37482a594be7e25b5baaadc6a6798 100644 (file)
@@ -2656,6 +2656,9 @@ void i915_gem_reset(struct drm_device *dev)
 void
 i915_gem_retire_requests_ring(struct intel_engine_cs *ring)
 {
+       if (list_empty(&ring->request_list))
+               return;
+
        WARN_ON(i915_verify_lists(ring->dev));
 
        /* Retire requests first as we use it above for the early return.
@@ -3000,8 +3003,8 @@ int i915_vma_unbind(struct i915_vma *vma)
                } else if (vma->ggtt_view.pages) {
                        sg_free_table(vma->ggtt_view.pages);
                        kfree(vma->ggtt_view.pages);
-                       vma->ggtt_view.pages = NULL;
                }
+               vma->ggtt_view.pages = NULL;
        }
 
        drm_mm_remove_node(&vma->node);
index 56e437e3158021a09641d188affc6129f0b1eda8..ae628001fd97873b67f99fb0128167858948afe6 100644 (file)
@@ -435,7 +435,7 @@ gmbus_xfer(struct i2c_adapter *adapter,
                                               struct intel_gmbus,
                                               adapter);
        struct drm_i915_private *dev_priv = bus->dev_priv;
-       int i, reg_offset;
+       int i = 0, inc, try = 0, reg_offset;
        int ret = 0;
 
        intel_aux_display_runtime_get(dev_priv);
@@ -448,12 +448,14 @@ gmbus_xfer(struct i2c_adapter *adapter,
 
        reg_offset = dev_priv->gpio_mmio_base;
 
+retry:
        I915_WRITE(GMBUS0 + reg_offset, bus->reg0);
 
-       for (i = 0; i < num; i++) {
+       for (; i < num; i += inc) {
+               inc = 1;
                if (gmbus_is_index_read(msgs, i, num)) {
                        ret = gmbus_xfer_index_read(dev_priv, &msgs[i]);
-                       i += 1;  /* set i to the index of the read xfer */
+                       inc = 2; /* an index read is two msgs */
                } else if (msgs[i].flags & I2C_M_RD) {
                        ret = gmbus_xfer_read(dev_priv, &msgs[i], 0);
                } else {
@@ -525,6 +527,18 @@ clear_err:
                         adapter->name, msgs[i].addr,
                         (msgs[i].flags & I2C_M_RD) ? 'r' : 'w', msgs[i].len);
 
+       /*
+        * Passive adapters sometimes NAK the first probe. Retry the first
+        * message once on -ENXIO for GMBUS transfers; the bit banging algorithm
+        * has retries internally. See also the retry loop in
+        * drm_do_probe_ddc_edid, which bails out on the first -ENXIO.
+        */
+       if (ret == -ENXIO && i == 0 && try++ == 0) {
+               DRM_DEBUG_KMS("GMBUS [%s] NAK on first message, retry\n",
+                             adapter->name);
+               goto retry;
+       }
+
        goto out;
 
 timeout:
index e87d2f418de4f381d50471494e5fe8050de4bdb2..987b81f31b0e693cfe7d505b2f66eecc7eac6539 100644 (file)
@@ -2550,7 +2550,7 @@ intel_sdvo_analog_init(struct intel_sdvo *intel_sdvo, int device)
 
        DRM_DEBUG_KMS("initialising analog device %d\n", device);
 
-       intel_sdvo_connector = kzalloc(sizeof(*intel_sdvo_connector), GFP_KERNEL);
+       intel_sdvo_connector = intel_sdvo_connector_alloc();
        if (!intel_sdvo_connector)
                return false;
 
index 6e84df9369a657223d17387ad14929cdf435e238..ad4b9010dfb0bbed135185e9f64aed98c3239a24 100644 (file)
@@ -1526,6 +1526,11 @@ static int mga_vga_mode_valid(struct drm_connector *connector,
                return MODE_BANDWIDTH;
        }
 
+       if ((mode->hdisplay % 8) != 0 || (mode->hsync_start % 8) != 0 ||
+           (mode->hsync_end % 8) != 0 || (mode->htotal % 8) != 0) {
+               return MODE_H_ILLEGAL;
+       }
+
        if (mode->crtc_hdisplay > 2048 || mode->crtc_hsync_start > 4096 ||
            mode->crtc_hsync_end > 4096 || mode->crtc_htotal > 4096 ||
            mode->crtc_vdisplay > 2048 || mode->crtc_vsync_start > 4096 ||
index e597ffc265633ef7439b2247301333a3affaeaea..dac78ad24b31558aa53d917fb802865b6a122b61 100644 (file)
@@ -580,9 +580,6 @@ static u32 atombios_adjust_pll(struct drm_crtc *crtc,
                else
                        radeon_crtc->pll_flags |= RADEON_PLL_PREFER_LOW_REF_DIV;
 
-               /* if there is no audio, set MINM_OVER_MAXP  */
-               if (!drm_detect_monitor_audio(radeon_connector_edid(connector)))
-                       radeon_crtc->pll_flags |= RADEON_PLL_PREFER_MINM_OVER_MAXP;
                if (rdev->family < CHIP_RV770)
                        radeon_crtc->pll_flags |= RADEON_PLL_PREFER_MINM_OVER_MAXP;
                /* use frac fb div on APUs */
@@ -1798,9 +1795,7 @@ static int radeon_get_shared_nondp_ppll(struct drm_crtc *crtc)
                        if ((crtc->mode.clock == test_crtc->mode.clock) &&
                            (adjusted_clock == test_adjusted_clock) &&
                            (radeon_crtc->ss_enabled == test_radeon_crtc->ss_enabled) &&
-                           (test_radeon_crtc->pll_id != ATOM_PPLL_INVALID) &&
-                           (drm_detect_monitor_audio(radeon_connector_edid(test_radeon_crtc->connector)) ==
-                            drm_detect_monitor_audio(radeon_connector_edid(radeon_crtc->connector))))
+                           (test_radeon_crtc->pll_id != ATOM_PPLL_INVALID))
                                return test_radeon_crtc->pll_id;
                }
        }
index b7ca4c51462120fab3ab146dd74f653e8bcb91cb..a7fdfa4f0857b3a416e67d79007a1da731455b80 100644 (file)
@@ -1463,6 +1463,21 @@ int radeon_device_init(struct radeon_device *rdev,
        if (r)
                DRM_ERROR("ib ring test failed (%d).\n", r);
 
+       /*
+        * Turks/Thames GPU will freeze whole laptop if DPM is not restarted
+        * after the CP ring have chew one packet at least. Hence here we stop
+        * and restart DPM after the radeon_ib_ring_tests().
+        */
+       if (rdev->pm.dpm_enabled &&
+           (rdev->pm.pm_method == PM_METHOD_DPM) &&
+           (rdev->family == CHIP_TURKS) &&
+           (rdev->flags & RADEON_IS_MOBILITY)) {
+               mutex_lock(&rdev->pm.mutex);
+               radeon_dpm_disable(rdev);
+               radeon_dpm_enable(rdev);
+               mutex_unlock(&rdev->pm.mutex);
+       }
+
        if ((radeon_testing & 1)) {
                if (rdev->accel_working)
                        radeon_test_moves(rdev);
index 2b98ed3e684d706a07e3c43b6da9f2232143e580..257b10be5cda902861339d9fde17c38e4f238d06 100644 (file)
@@ -663,12 +663,17 @@ int
 radeon_dp_mst_probe(struct radeon_connector *radeon_connector)
 {
        struct radeon_connector_atom_dig *dig_connector = radeon_connector->con_priv;
+       struct drm_device *dev = radeon_connector->base.dev;
+       struct radeon_device *rdev = dev->dev_private;
        int ret;
        u8 msg[1];
 
        if (!radeon_mst)
                return 0;
 
+       if (!ASIC_IS_DCE5(rdev))
+               return 0;
+
        if (dig_connector->dpcd[DP_DPCD_REV] < 0x12)
                return 0;
 
index 7b2a7335cc5d557eafa6864d50cb6ebc9cdfb5ff..b0acf50d95581d9970cef89690be25b32324c7b3 100644 (file)
@@ -576,6 +576,9 @@ static int radeon_info_ioctl(struct drm_device *dev, void *data, struct drm_file
                if (radeon_get_allowed_info_register(rdev, *value, value))
                        return -EINVAL;
                break;
+       case RADEON_INFO_VA_UNMAP_WORKING:
+               *value = true;
+               break;
        default:
                DRM_DEBUG_KMS("Invalid request %d\n", info->request);
                return -EINVAL;
index de42fc4a22b869296ff44c85c859678c6155ddd7..9c3377ca17b75ecd2092e4fd78a2238c126d88f1 100644 (file)
@@ -458,14 +458,16 @@ int radeon_vm_bo_set_addr(struct radeon_device *rdev,
                /* make sure object fit at this offset */
                eoffset = soffset + size;
                if (soffset >= eoffset) {
-                       return -EINVAL;
+                       r = -EINVAL;
+                       goto error_unreserve;
                }
 
                last_pfn = eoffset / RADEON_GPU_PAGE_SIZE;
                if (last_pfn > rdev->vm_manager.max_pfn) {
                        dev_err(rdev->dev, "va above limit (0x%08X > 0x%08X)\n",
                                last_pfn, rdev->vm_manager.max_pfn);
-                       return -EINVAL;
+                       r = -EINVAL;
+                       goto error_unreserve;
                }
 
        } else {
@@ -486,7 +488,8 @@ int radeon_vm_bo_set_addr(struct radeon_device *rdev,
                                "(bo %p 0x%010lx 0x%010lx)\n", bo_va->bo,
                                soffset, tmp->bo, tmp->it.start, tmp->it.last);
                        mutex_unlock(&vm->mutex);
-                       return -EINVAL;
+                       r = -EINVAL;
+                       goto error_unreserve;
                }
        }
 
@@ -497,7 +500,8 @@ int radeon_vm_bo_set_addr(struct radeon_device *rdev,
                        tmp = kzalloc(sizeof(struct radeon_bo_va), GFP_KERNEL);
                        if (!tmp) {
                                mutex_unlock(&vm->mutex);
-                               return -ENOMEM;
+                               r = -ENOMEM;
+                               goto error_unreserve;
                        }
                        tmp->it.start = bo_va->it.start;
                        tmp->it.last = bo_va->it.last;
@@ -555,7 +559,6 @@ int radeon_vm_bo_set_addr(struct radeon_device *rdev,
                r = radeon_vm_clear_bo(rdev, pt);
                if (r) {
                        radeon_bo_unref(&pt);
-                       radeon_bo_reserve(bo_va->bo, false);
                        return r;
                }
 
@@ -575,6 +578,10 @@ int radeon_vm_bo_set_addr(struct radeon_device *rdev,
 
        mutex_unlock(&vm->mutex);
        return 0;
+
+error_unreserve:
+       radeon_bo_unreserve(bo_va->bo);
+       return r;
 }
 
 /**
index 3f40319a55da364f2e757acb7bc0e83d86c78c38..575a072d765f65cc49190a3066218759bd3569cd 100644 (file)
@@ -65,6 +65,8 @@ static int
 isert_rdma_accept(struct isert_conn *isert_conn);
 struct rdma_cm_id *isert_setup_id(struct isert_np *isert_np);
 
+static void isert_release_work(struct work_struct *work);
+
 static inline bool
 isert_prot_cmd(struct isert_conn *conn, struct se_cmd *cmd)
 {
@@ -648,6 +650,7 @@ isert_init_conn(struct isert_conn *isert_conn)
        mutex_init(&isert_conn->mutex);
        spin_lock_init(&isert_conn->pool_lock);
        INIT_LIST_HEAD(&isert_conn->fr_pool);
+       INIT_WORK(&isert_conn->release_work, isert_release_work);
 }
 
 static void
@@ -925,6 +928,7 @@ isert_disconnected_handler(struct rdma_cm_id *cma_id,
 {
        struct isert_np *isert_np = cma_id->context;
        struct isert_conn *isert_conn;
+       bool terminating = false;
 
        if (isert_np->np_cm_id == cma_id)
                return isert_np_cma_handler(cma_id->context, event);
@@ -932,12 +936,25 @@ isert_disconnected_handler(struct rdma_cm_id *cma_id,
        isert_conn = cma_id->qp->qp_context;
 
        mutex_lock(&isert_conn->mutex);
+       terminating = (isert_conn->state == ISER_CONN_TERMINATING);
        isert_conn_terminate(isert_conn);
        mutex_unlock(&isert_conn->mutex);
 
        isert_info("conn %p completing wait\n", isert_conn);
        complete(&isert_conn->wait);
 
+       if (terminating)
+               goto out;
+
+       mutex_lock(&isert_np->np_accept_mutex);
+       if (!list_empty(&isert_conn->accept_node)) {
+               list_del_init(&isert_conn->accept_node);
+               isert_put_conn(isert_conn);
+               queue_work(isert_release_wq, &isert_conn->release_work);
+       }
+       mutex_unlock(&isert_np->np_accept_mutex);
+
+out:
        return 0;
 }
 
@@ -2380,7 +2397,6 @@ isert_build_rdma_wr(struct isert_conn *isert_conn, struct isert_cmd *isert_cmd,
        page_off = offset % PAGE_SIZE;
 
        send_wr->sg_list = ib_sge;
-       send_wr->num_sge = sg_nents;
        send_wr->wr_id = (uintptr_t)&isert_cmd->tx_desc;
        /*
         * Perform mapping of TCM scatterlist memory ib_sge dma_addr.
@@ -2400,14 +2416,17 @@ isert_build_rdma_wr(struct isert_conn *isert_conn, struct isert_cmd *isert_cmd,
                          ib_sge->addr, ib_sge->length, ib_sge->lkey);
                page_off = 0;
                data_left -= ib_sge->length;
+               if (!data_left)
+                       break;
                ib_sge++;
                isert_dbg("Incrementing ib_sge pointer to %p\n", ib_sge);
        }
 
+       send_wr->num_sge = ++i;
        isert_dbg("Set outgoing sg_list: %p num_sg: %u from TCM SGLs\n",
                  send_wr->sg_list, send_wr->num_sge);
 
-       return sg_nents;
+       return send_wr->num_sge;
 }
 
 static int
@@ -3366,7 +3385,6 @@ static void isert_wait_conn(struct iscsi_conn *conn)
        isert_wait4flush(isert_conn);
        isert_wait4logout(isert_conn);
 
-       INIT_WORK(&isert_conn->release_work, isert_release_work);
        queue_work(isert_release_wq, &isert_conn->release_work);
 }
 
@@ -3374,6 +3392,7 @@ static void isert_free_conn(struct iscsi_conn *conn)
 {
        struct isert_conn *isert_conn = conn->context;
 
+       isert_wait4flush(isert_conn);
        isert_put_conn(isert_conn);
 }
 
index 630af73e98c488a5e266e4ccb6eed5dba622f3d3..35c8d0ceabeebf989b8eeff5cd54ee8f3ac2e247 100644 (file)
@@ -150,6 +150,11 @@ static const struct min_max_quirk min_max_pnpid_table[] = {
                {ANY_BOARD_ID, 2961},
                1024, 5112, 2024, 4832
        },
+       {
+               (const char * const []){"LEN2000", NULL},
+               {ANY_BOARD_ID, ANY_BOARD_ID},
+               1024, 5113, 2021, 4832
+       },
        {
                (const char * const []){"LEN2001", NULL},
                {ANY_BOARD_ID, ANY_BOARD_ID},
@@ -191,7 +196,7 @@ static const char * const topbuttonpad_pnp_ids[] = {
        "LEN0045",
        "LEN0047",
        "LEN0049",
-       "LEN2000",
+       "LEN2000", /* S540 */
        "LEN2001", /* Edge E431 */
        "LEN2002", /* Edge E531 */
        "LEN2003",
index 1ae4e547b419b909a9748b54cc6b973d31ff0221..73f918d066c628b7200f9a04700d932d38fe3c11 100644 (file)
@@ -219,7 +219,7 @@ config TEGRA_IOMMU_SMMU
        select IOMMU_API
        help
          This driver supports the IOMMU hardware (SMMU) found on NVIDIA Tegra
-         SoCs (Tegra30 up to Tegra124).
+         SoCs (Tegra30 up to Tegra132).
 
 config EXYNOS_IOMMU
        bool "Exynos IOMMU Support"
index 68d43beccb7e560f845ad49b8ae7d9e38872fcf7..5ecfaf29933ad4634e2124544e3c800b9b309d44 100644 (file)
@@ -422,6 +422,14 @@ static int dmar_map_gfx = 1;
 static int dmar_forcedac;
 static int intel_iommu_strict;
 static int intel_iommu_superpage = 1;
+static int intel_iommu_ecs = 1;
+
+/* We only actually use ECS when PASID support (on the new bit 40)
+ * is also advertised. Some early implementations â€” the ones with
+ * PASID support on bit 28 â€” have issues even when we *only* use
+ * extended root/context tables. */
+#define ecs_enabled(iommu) (intel_iommu_ecs && ecap_ecs(iommu->ecap) && \
+                           ecap_pasid(iommu->ecap))
 
 int intel_iommu_gfx_mapped;
 EXPORT_SYMBOL_GPL(intel_iommu_gfx_mapped);
@@ -465,6 +473,10 @@ static int __init intel_iommu_setup(char *str)
                        printk(KERN_INFO
                                "Intel-IOMMU: disable supported super page\n");
                        intel_iommu_superpage = 0;
+               } else if (!strncmp(str, "ecs_off", 7)) {
+                       printk(KERN_INFO
+                               "Intel-IOMMU: disable extended context table support\n");
+                       intel_iommu_ecs = 0;
                }
 
                str += strcspn(str, ",");
@@ -669,7 +681,7 @@ static inline struct context_entry *iommu_context_addr(struct intel_iommu *iommu
        struct context_entry *context;
        u64 *entry;
 
-       if (ecap_ecs(iommu->ecap)) {
+       if (ecs_enabled(iommu)) {
                if (devfn >= 0x80) {
                        devfn -= 0x80;
                        entry = &root->hi;
@@ -696,6 +708,11 @@ static inline struct context_entry *iommu_context_addr(struct intel_iommu *iommu
        return &context[devfn];
 }
 
+static int iommu_dummy(struct device *dev)
+{
+       return dev->archdata.iommu == DUMMY_DEVICE_DOMAIN_INFO;
+}
+
 static struct intel_iommu *device_to_iommu(struct device *dev, u8 *bus, u8 *devfn)
 {
        struct dmar_drhd_unit *drhd = NULL;
@@ -705,6 +722,9 @@ static struct intel_iommu *device_to_iommu(struct device *dev, u8 *bus, u8 *devf
        u16 segment = 0;
        int i;
 
+       if (iommu_dummy(dev))
+               return NULL;
+
        if (dev_is_pci(dev)) {
                pdev = to_pci_dev(dev);
                segment = pci_domain_nr(pdev->bus);
@@ -798,7 +818,7 @@ static void free_context_table(struct intel_iommu *iommu)
                if (context)
                        free_pgtable_page(context);
 
-               if (!ecap_ecs(iommu->ecap))
+               if (!ecs_enabled(iommu))
                        continue;
 
                context = iommu_context_addr(iommu, i, 0x80, 0);
@@ -1133,7 +1153,7 @@ static void iommu_set_root_entry(struct intel_iommu *iommu)
        unsigned long flag;
 
        addr = virt_to_phys(iommu->root_entry);
-       if (ecap_ecs(iommu->ecap))
+       if (ecs_enabled(iommu))
                addr |= DMA_RTADDR_RTT;
 
        raw_spin_lock_irqsave(&iommu->register_lock, flag);
@@ -2969,11 +2989,6 @@ static inline struct dmar_domain *get_valid_domain_for_dev(struct device *dev)
        return __get_valid_domain_for_dev(dev);
 }
 
-static int iommu_dummy(struct device *dev)
-{
-       return dev->archdata.iommu == DUMMY_DEVICE_DOMAIN_INFO;
-}
-
 /* Check if the dev needs to go through non-identity map and unmap process.*/
 static int iommu_no_mapping(struct device *dev)
 {
index c845d99ecf6b8c50757998f08c86224c70064acb..c1f2e521dc52cdb383b528c27d07f0786e4ffc43 100644 (file)
@@ -7,6 +7,7 @@
  */
 
 #include <linux/bitops.h>
+#include <linux/debugfs.h>
 #include <linux/err.h>
 #include <linux/iommu.h>
 #include <linux/kernel.h>
@@ -31,6 +32,8 @@ struct tegra_smmu {
        struct mutex lock;
 
        struct list_head list;
+
+       struct dentry *debugfs;
 };
 
 struct tegra_smmu_as {
@@ -673,6 +676,103 @@ static void tegra_smmu_ahb_enable(void)
        }
 }
 
+static int tegra_smmu_swgroups_show(struct seq_file *s, void *data)
+{
+       struct tegra_smmu *smmu = s->private;
+       unsigned int i;
+       u32 value;
+
+       seq_printf(s, "swgroup    enabled  ASID\n");
+       seq_printf(s, "------------------------\n");
+
+       for (i = 0; i < smmu->soc->num_swgroups; i++) {
+               const struct tegra_smmu_swgroup *group = &smmu->soc->swgroups[i];
+               const char *status;
+               unsigned int asid;
+
+               value = smmu_readl(smmu, group->reg);
+
+               if (value & SMMU_ASID_ENABLE)
+                       status = "yes";
+               else
+                       status = "no";
+
+               asid = value & SMMU_ASID_MASK;
+
+               seq_printf(s, "%-9s  %-7s  %#04x\n", group->name, status,
+                          asid);
+       }
+
+       return 0;
+}
+
+static int tegra_smmu_swgroups_open(struct inode *inode, struct file *file)
+{
+       return single_open(file, tegra_smmu_swgroups_show, inode->i_private);
+}
+
+static const struct file_operations tegra_smmu_swgroups_fops = {
+       .open = tegra_smmu_swgroups_open,
+       .read = seq_read,
+       .llseek = seq_lseek,
+       .release = single_release,
+};
+
+static int tegra_smmu_clients_show(struct seq_file *s, void *data)
+{
+       struct tegra_smmu *smmu = s->private;
+       unsigned int i;
+       u32 value;
+
+       seq_printf(s, "client       enabled\n");
+       seq_printf(s, "--------------------\n");
+
+       for (i = 0; i < smmu->soc->num_clients; i++) {
+               const struct tegra_mc_client *client = &smmu->soc->clients[i];
+               const char *status;
+
+               value = smmu_readl(smmu, client->smmu.reg);
+
+               if (value & BIT(client->smmu.bit))
+                       status = "yes";
+               else
+                       status = "no";
+
+               seq_printf(s, "%-12s %s\n", client->name, status);
+       }
+
+       return 0;
+}
+
+static int tegra_smmu_clients_open(struct inode *inode, struct file *file)
+{
+       return single_open(file, tegra_smmu_clients_show, inode->i_private);
+}
+
+static const struct file_operations tegra_smmu_clients_fops = {
+       .open = tegra_smmu_clients_open,
+       .read = seq_read,
+       .llseek = seq_lseek,
+       .release = single_release,
+};
+
+static void tegra_smmu_debugfs_init(struct tegra_smmu *smmu)
+{
+       smmu->debugfs = debugfs_create_dir("smmu", NULL);
+       if (!smmu->debugfs)
+               return;
+
+       debugfs_create_file("swgroups", S_IRUGO, smmu->debugfs, smmu,
+                           &tegra_smmu_swgroups_fops);
+       debugfs_create_file("clients", S_IRUGO, smmu->debugfs, smmu,
+                           &tegra_smmu_clients_fops);
+}
+
+static void tegra_smmu_debugfs_exit(struct tegra_smmu *smmu)
+{
+       debugfs_remove_recursive(smmu->debugfs);
+}
+
 struct tegra_smmu *tegra_smmu_probe(struct device *dev,
                                    const struct tegra_smmu_soc *soc,
                                    struct tegra_mc *mc)
@@ -743,5 +843,14 @@ struct tegra_smmu *tegra_smmu_probe(struct device *dev,
        if (err < 0)
                return ERR_PTR(err);
 
+       if (IS_ENABLED(CONFIG_DEBUG_FS))
+               tegra_smmu_debugfs_init(smmu);
+
        return smmu;
 }
+
+void tegra_smmu_remove(struct tegra_smmu *smmu)
+{
+       if (IS_ENABLED(CONFIG_DEBUG_FS))
+               tegra_smmu_debugfs_exit(smmu);
+}
index 6de62a96e79c80e9d442ca07f53549cf334f8c7c..99b9a979297531e67960a75d35917e93c2223368 100644 (file)
@@ -30,6 +30,7 @@ config ARM_GIC_V3_ITS
 config ARM_NVIC
        bool
        select IRQ_DOMAIN
+       select IRQ_DOMAIN_HIERARCHY
        select GENERIC_IRQ_CHIP
 
 config ARM_VIC
index 57f09cb544644bcd97aa81bfc044c2686b350bbb..269c2354c43169307aa02438dbf38aa4b54f0dad 100644 (file)
@@ -271,7 +271,7 @@ int gic_get_c0_fdc_int(void)
                                  GIC_LOCAL_TO_HWIRQ(GIC_LOCAL_INT_FDC));
 }
 
-static void gic_handle_shared_int(void)
+static void gic_handle_shared_int(bool chained)
 {
        unsigned int i, intr, virq;
        unsigned long *pcpu_mask;
@@ -299,7 +299,10 @@ static void gic_handle_shared_int(void)
        while (intr != gic_shared_intrs) {
                virq = irq_linear_revmap(gic_irq_domain,
                                         GIC_SHARED_TO_HWIRQ(intr));
-               do_IRQ(virq);
+               if (chained)
+                       generic_handle_irq(virq);
+               else
+                       do_IRQ(virq);
 
                /* go to next pending bit */
                bitmap_clear(pending, intr, 1);
@@ -431,7 +434,7 @@ static struct irq_chip gic_edge_irq_controller = {
 #endif
 };
 
-static void gic_handle_local_int(void)
+static void gic_handle_local_int(bool chained)
 {
        unsigned long pending, masked;
        unsigned int intr, virq;
@@ -445,7 +448,10 @@ static void gic_handle_local_int(void)
        while (intr != GIC_NUM_LOCAL_INTRS) {
                virq = irq_linear_revmap(gic_irq_domain,
                                         GIC_LOCAL_TO_HWIRQ(intr));
-               do_IRQ(virq);
+               if (chained)
+                       generic_handle_irq(virq);
+               else
+                       do_IRQ(virq);
 
                /* go to next pending bit */
                bitmap_clear(&pending, intr, 1);
@@ -509,13 +515,14 @@ static struct irq_chip gic_all_vpes_local_irq_controller = {
 
 static void __gic_irq_dispatch(void)
 {
-       gic_handle_local_int();
-       gic_handle_shared_int();
+       gic_handle_local_int(false);
+       gic_handle_shared_int(false);
 }
 
 static void gic_irq_dispatch(unsigned int irq, struct irq_desc *desc)
 {
-       __gic_irq_dispatch();
+       gic_handle_local_int(true);
+       gic_handle_shared_int(true);
 }
 
 #ifdef CONFIG_MIPS_GIC_IPI
index 4ff0805fca017376ea879f918517b9d61abf5ff6..5fac9100f6cbee9f7abf144eb4dcb9efeb3aaee0 100644 (file)
@@ -49,6 +49,31 @@ nvic_handle_irq(irq_hw_number_t hwirq, struct pt_regs *regs)
        handle_IRQ(irq, regs);
 }
 
+static int nvic_irq_domain_alloc(struct irq_domain *domain, unsigned int virq,
+                               unsigned int nr_irqs, void *arg)
+{
+       int i, ret;
+       irq_hw_number_t hwirq;
+       unsigned int type = IRQ_TYPE_NONE;
+       struct of_phandle_args *irq_data = arg;
+
+       ret = irq_domain_xlate_onecell(domain, irq_data->np, irq_data->args,
+                                  irq_data->args_count, &hwirq, &type);
+       if (ret)
+               return ret;
+
+       for (i = 0; i < nr_irqs; i++)
+               irq_map_generic_chip(domain, virq + i, hwirq + i);
+
+       return 0;
+}
+
+static const struct irq_domain_ops nvic_irq_domain_ops = {
+       .xlate = irq_domain_xlate_onecell,
+       .alloc = nvic_irq_domain_alloc,
+       .free = irq_domain_free_irqs_top,
+};
+
 static int __init nvic_of_init(struct device_node *node,
                               struct device_node *parent)
 {
@@ -70,7 +95,8 @@ static int __init nvic_of_init(struct device_node *node,
                irqs = NVIC_MAX_IRQ;
 
        nvic_irq_domain =
-               irq_domain_add_linear(node, irqs, &irq_generic_chip_ops, NULL);
+               irq_domain_add_linear(node, irqs, &nvic_irq_domain_ops, NULL);
+
        if (!nvic_irq_domain) {
                pr_warn("Failed to allocate irq domain\n");
                return -ENOMEM;
index 4a9ce5b50c5bba33b7428a0b67b88d26e31c4067..6b2b582433bde95062e85d17403e4a505c5a4ef9 100644 (file)
@@ -104,7 +104,7 @@ static int sunxi_sc_nmi_set_type(struct irq_data *data, unsigned int flow_type)
        irqd_set_trigger_type(data, flow_type);
        irq_setup_alt_chip(data, flow_type);
 
-       for (i = 0; i <= gc->num_ct; i++, ct++)
+       for (i = 0; i < gc->num_ct; i++, ct++)
                if (ct->type & flow_type)
                        ctrl_off = ct->regs.type;
 
index 9521057d47448a4f290df3d760e7df044968c427..b932ecb7b730f37058904cca791ac4c1df8a09ce 100644 (file)
@@ -47,6 +47,7 @@ struct vf610_mscm_ir_chip_data {
        void __iomem *mscm_ir_base;
        u16 cpu_mask;
        u16 saved_irsprc[MSCM_IRSPRC_NUM];
+       bool is_nvic;
 };
 
 static struct vf610_mscm_ir_chip_data *mscm_ir_data;
@@ -101,7 +102,7 @@ static void vf610_mscm_ir_enable(struct irq_data *data)
        writew_relaxed(chip_data->cpu_mask,
                       chip_data->mscm_ir_base + MSCM_IRSPRC(hwirq));
 
-       irq_chip_unmask_parent(data);
+       irq_chip_enable_parent(data);
 }
 
 static void vf610_mscm_ir_disable(struct irq_data *data)
@@ -111,7 +112,7 @@ static void vf610_mscm_ir_disable(struct irq_data *data)
 
        writew_relaxed(0x0, chip_data->mscm_ir_base + MSCM_IRSPRC(hwirq));
 
-       irq_chip_mask_parent(data);
+       irq_chip_disable_parent(data);
 }
 
 static struct irq_chip vf610_mscm_ir_irq_chip = {
@@ -143,10 +144,17 @@ static int vf610_mscm_ir_domain_alloc(struct irq_domain *domain, unsigned int vi
                                              domain->host_data);
 
        gic_data.np = domain->parent->of_node;
-       gic_data.args_count = 3;
-       gic_data.args[0] = GIC_SPI;
-       gic_data.args[1] = irq_data->args[0];
-       gic_data.args[2] = irq_data->args[1];
+
+       if (mscm_ir_data->is_nvic) {
+               gic_data.args_count = 1;
+               gic_data.args[0] = irq_data->args[0];
+       } else {
+               gic_data.args_count = 3;
+               gic_data.args[0] = GIC_SPI;
+               gic_data.args[1] = irq_data->args[0];
+               gic_data.args[2] = irq_data->args[1];
+       }
+
        return irq_domain_alloc_irqs_parent(domain, virq, nr_irqs, &gic_data);
 }
 
@@ -199,6 +207,9 @@ static int __init vf610_mscm_ir_of_init(struct device_node *node,
                goto out_unmap;
        }
 
+       if (of_device_is_compatible(domain->parent->of_node, "arm,armv7m-nvic"))
+               mscm_ir_data->is_nvic = true;
+
        cpu_pm_register_notifier(&mscm_ir_notifier_block);
 
        return 0;
index 6896e2d9ba58005b31ae79291a0f7afd0314e4c3..d1660b0398125943b58822401d350b9ce983d5f2 100644 (file)
@@ -20,6 +20,7 @@
  * MA 02111-1307 USA
  */
 #include <linux/io.h>
+#include <linux/module.h>
 #include <linux/of_device.h>
 #include <linux/of_address.h>
 #include <linux/platform_device.h>
@@ -66,102 +67,101 @@ static void syscon_led_set(struct led_classdev *led_cdev,
                dev_err(sled->cdev.dev, "error updating LED status\n");
 }
 
-static int __init syscon_leds_spawn(struct device_node *np,
-                                   struct device *dev,
-                                   struct regmap *map)
+static int syscon_led_probe(struct platform_device *pdev)
 {
-       struct device_node *child;
+       struct device *dev = &pdev->dev;
+       struct device_node *np = dev->of_node;
+       struct device *parent;
+       struct regmap *map;
+       struct syscon_led *sled;
+       const char *state;
        int ret;
 
-       for_each_available_child_of_node(np, child) {
-               struct syscon_led *sled;
-               const char *state;
-
-               /* Only check for register-bit-leds */
-               if (of_property_match_string(child, "compatible",
-                                            "register-bit-led") < 0)
-                       continue;
-
-               sled = devm_kzalloc(dev, sizeof(*sled), GFP_KERNEL);
-               if (!sled)
-                       return -ENOMEM;
-
-               sled->map = map;
-
-               if (of_property_read_u32(child, "offset", &sled->offset))
-                       return -EINVAL;
-               if (of_property_read_u32(child, "mask", &sled->mask))
-                       return -EINVAL;
-               sled->cdev.name =
-                       of_get_property(child, "label", NULL) ? : child->name;
-               sled->cdev.default_trigger =
-                       of_get_property(child, "linux,default-trigger", NULL);
-
-               state = of_get_property(child, "default-state", NULL);
-               if (state) {
-                       if (!strcmp(state, "keep")) {
-                               u32 val;
-
-                               ret = regmap_read(map, sled->offset, &val);
-                               if (ret < 0)
-                                       return ret;
-                               sled->state = !!(val & sled->mask);
-                       } else if (!strcmp(state, "on")) {
-                               sled->state = true;
-                               ret = regmap_update_bits(map, sled->offset,
-                                                        sled->mask,
-                                                        sled->mask);
-                               if (ret < 0)
-                                       return ret;
-                       } else {
-                               sled->state = false;
-                               ret = regmap_update_bits(map, sled->offset,
-                                                        sled->mask, 0);
-                               if (ret < 0)
-                                       return ret;
-                       }
+       parent = dev->parent;
+       if (!parent) {
+               dev_err(dev, "no parent for syscon LED\n");
+               return -ENODEV;
+       }
+       map = syscon_node_to_regmap(parent->of_node);
+       if (!map) {
+               dev_err(dev, "no regmap for syscon LED parent\n");
+               return -ENODEV;
+       }
+
+       sled = devm_kzalloc(dev, sizeof(*sled), GFP_KERNEL);
+       if (!sled)
+               return -ENOMEM;
+
+       sled->map = map;
+
+       if (of_property_read_u32(np, "offset", &sled->offset))
+               return -EINVAL;
+       if (of_property_read_u32(np, "mask", &sled->mask))
+               return -EINVAL;
+       sled->cdev.name =
+               of_get_property(np, "label", NULL) ? : np->name;
+       sled->cdev.default_trigger =
+               of_get_property(np, "linux,default-trigger", NULL);
+
+       state = of_get_property(np, "default-state", NULL);
+       if (state) {
+               if (!strcmp(state, "keep")) {
+                       u32 val;
+
+                       ret = regmap_read(map, sled->offset, &val);
+                       if (ret < 0)
+                               return ret;
+                       sled->state = !!(val & sled->mask);
+               } else if (!strcmp(state, "on")) {
+                       sled->state = true;
+                       ret = regmap_update_bits(map, sled->offset,
+                                                sled->mask,
+                                                sled->mask);
+                       if (ret < 0)
+                               return ret;
+               } else {
+                       sled->state = false;
+                       ret = regmap_update_bits(map, sled->offset,
+                                                sled->mask, 0);
+                       if (ret < 0)
+                               return ret;
                }
-               sled->cdev.brightness_set = syscon_led_set;
+       }
+       sled->cdev.brightness_set = syscon_led_set;
 
-               ret = led_classdev_register(dev, &sled->cdev);
-               if (ret < 0)
-                       return ret;
+       ret = led_classdev_register(dev, &sled->cdev);
+       if (ret < 0)
+               return ret;
+
+       platform_set_drvdata(pdev, sled);
+       dev_info(dev, "registered LED %s\n", sled->cdev.name);
 
-               dev_info(dev, "registered LED %s\n", sled->cdev.name);
-       }
        return 0;
 }
 
-static int __init syscon_leds_init(void)
+static int syscon_led_remove(struct platform_device *pdev)
 {
-       struct device_node *np;
-
-       for_each_of_allnodes(np) {
-               struct platform_device *pdev;
-               struct regmap *map;
-               int ret;
+       struct syscon_led *sled = platform_get_drvdata(pdev);
 
-               if (!of_device_is_compatible(np, "syscon"))
-                       continue;
+       led_classdev_unregister(&sled->cdev);
+       /* Turn it off */
+       regmap_update_bits(sled->map, sled->offset, sled->mask, 0);
+       return 0;
+}
 
-               map = syscon_node_to_regmap(np);
-               if (IS_ERR(map)) {
-                       pr_err("error getting regmap for syscon LEDs\n");
-                       continue;
-               }
+static const struct of_device_id of_syscon_leds_match[] = {
+       { .compatible = "register-bit-led", },
+       {},
+};
 
-               /*
-                * If the map is there, the device should be there, we allocate
-                * memory on the syscon device's behalf here.
-                */
-               pdev = of_find_device_by_node(np);
-               if (!pdev)
-                       return -ENODEV;
-               ret = syscon_leds_spawn(np, &pdev->dev, map);
-               if (ret)
-                       dev_err(&pdev->dev, "could not spawn syscon LEDs\n");
-       }
+MODULE_DEVICE_TABLE(of, of_syscon_leds_match);
 
-       return 0;
-}
-device_initcall(syscon_leds_init);
+static struct platform_driver syscon_led_driver = {
+       .probe          = syscon_led_probe,
+       .remove         = syscon_led_remove,
+       .driver         = {
+               .name   = "leds-syscon",
+               .of_match_table = of_syscon_leds_match,
+       },
+};
+module_platform_driver(syscon_led_driver);
index 27506302eb7aa42557bfc01547274957ccbace50..4dbed4a67aaf40e3c04bde925870c24d13cd1b4e 100644 (file)
@@ -3834,7 +3834,7 @@ array_state_store(struct mddev *mddev, const char *buf, size_t len)
                                err = -EBUSY;
                }
                spin_unlock(&mddev->lock);
-               return err;
+               return err ?: len;
        }
        err = mddev_lock(mddev);
        if (err)
@@ -4217,13 +4217,14 @@ action_store(struct mddev *mddev, const char *page, size_t len)
                        set_bit(MD_RECOVERY_FROZEN, &mddev->recovery);
                else
                        clear_bit(MD_RECOVERY_FROZEN, &mddev->recovery);
-               flush_workqueue(md_misc_wq);
-               if (mddev->sync_thread) {
-                       set_bit(MD_RECOVERY_INTR, &mddev->recovery);
-                       if (mddev_lock(mddev) == 0) {
+               if (test_bit(MD_RECOVERY_RUNNING, &mddev->recovery) &&
+                   mddev_lock(mddev) == 0) {
+                       flush_workqueue(md_misc_wq);
+                       if (mddev->sync_thread) {
+                               set_bit(MD_RECOVERY_INTR, &mddev->recovery);
                                md_reap_sync_thread(mddev);
-                               mddev_unlock(mddev);
                        }
+                       mddev_unlock(mddev);
                }
        } else if (test_bit(MD_RECOVERY_RUNNING, &mddev->recovery) ||
                   test_bit(MD_RECOVERY_NEEDED, &mddev->recovery))
@@ -8261,6 +8262,7 @@ void md_reap_sync_thread(struct mddev *mddev)
        if (mddev_is_clustered(mddev))
                md_cluster_ops->metadata_update_finish(mddev);
        clear_bit(MD_RECOVERY_RUNNING, &mddev->recovery);
+       clear_bit(MD_RECOVERY_DONE, &mddev->recovery);
        clear_bit(MD_RECOVERY_SYNC, &mddev->recovery);
        clear_bit(MD_RECOVERY_RESHAPE, &mddev->recovery);
        clear_bit(MD_RECOVERY_REQUESTED, &mddev->recovery);
index e793ab6b35705e0ed1ad6904ebe9353b6dbf6fd6..f55c3f35b7463141086afb727785c775c5185d76 100644 (file)
@@ -4156,6 +4156,7 @@ static int raid10_start_reshape(struct mddev *mddev)
 
        clear_bit(MD_RECOVERY_SYNC, &mddev->recovery);
        clear_bit(MD_RECOVERY_CHECK, &mddev->recovery);
+       clear_bit(MD_RECOVERY_DONE, &mddev->recovery);
        set_bit(MD_RECOVERY_RESHAPE, &mddev->recovery);
        set_bit(MD_RECOVERY_RUNNING, &mddev->recovery);
 
index 553d54b870528f0917e7518a9a783a28636d884a..b6793d2e051f3b278405f236e6623980bcdf1d04 100644 (file)
@@ -7354,6 +7354,7 @@ static int raid5_start_reshape(struct mddev *mddev)
 
        clear_bit(MD_RECOVERY_SYNC, &mddev->recovery);
        clear_bit(MD_RECOVERY_CHECK, &mddev->recovery);
+       clear_bit(MD_RECOVERY_DONE, &mddev->recovery);
        set_bit(MD_RECOVERY_RESHAPE, &mddev->recovery);
        set_bit(MD_RECOVERY_RUNNING, &mddev->recovery);
        mddev->sync_thread = md_register_thread(md_do_sync, mddev,
index 3ef0f90b128fc5bdf6d5e5dff0d5bbfbd5190d7b..157099243d6152190211b8625ba656d45feae003 100644 (file)
@@ -97,6 +97,7 @@ config MEDIA_CONTROLLER
 config MEDIA_CONTROLLER_DVB
        bool "Enable Media controller for DVB"
        depends on MEDIA_CONTROLLER
+       depends on BROKEN
        ---help---
          Enable the media controller API support for DVB.
 
index 868036f70f8f126c0e81e16fe8bd4af63319909a..8406c668ecdc49161795f578e773afeb132058e8 100644 (file)
@@ -49,6 +49,14 @@ config OMAP_GPMC
          interfacing to a variety of asynchronous as well as synchronous
          memory drives like NOR, NAND, OneNAND, SRAM.
 
+config OMAP_GPMC_DEBUG
+       bool
+       depends on OMAP_GPMC
+       help
+         Enables verbose debugging mostly to decode the bootloader provided
+         timings. Enable this during development to configure devices
+         connected to the GPMC bus.
+
 config MVEBU_DEVBUS
        bool "Marvell EBU Device Bus Controller"
        default y
index c94ea0d687467f176e19d44dae06ebe0efaef899..8911e51d410ab3c6e8d14af25fb5c1ff7751b47d 100644 (file)
@@ -403,7 +403,7 @@ static void gpmc_cs_bool_timings(int cs, const struct gpmc_bool_timings *p)
                           p->cycle2cyclediffcsen);
 }
 
-#ifdef DEBUG
+#ifdef CONFIG_OMAP_GPMC_DEBUG
 /**
  * get_gpmc_timing_reg - read a timing parameter and print DTS settings for it.
  * @cs:      Chip Select Region
@@ -612,7 +612,7 @@ static int set_gpmc_timing_reg(int cs, int reg, int st_bit, int end_bit, int max
        }
 
        l = gpmc_cs_read_reg(cs, reg);
-#ifdef DEBUG
+#ifdef CONFIG_OMAP_GPMC_DEBUG
        pr_info(
                "GPMC CS%d: %-17s: %3d ticks, %3lu ns (was %3i ticks) %3d ns\n",
               cs, name, ticks, gpmc_get_clk_period(cs, cd) * ticks / 1000,
@@ -767,7 +767,7 @@ int gpmc_cs_set_timings(int cs, const struct gpmc_timings *t,
                            GPMC_CONFIG1_CLKACTIVATIONTIME_MAX,
                            clk_activation, GPMC_CD_FCLK);
 
-#ifdef DEBUG
+#ifdef CONFIG_OMAP_GPMC_DEBUG
        pr_info("GPMC CS%d CLK period is %lu ns (div %d)\n",
                        cs, (div * gpmc_get_fclk_period()) / 1000, div);
 #endif
index 5710876218279ac067783e74b874c9f0f46071ee..6d74e499e18dde35f7881bacfba302864afde6b6 100644 (file)
@@ -5,3 +5,13 @@ config TEGRA_MC
        help
          This driver supports the Memory Controller (MC) hardware found on
          NVIDIA Tegra SoCs.
+
+config TEGRA124_EMC
+       bool "NVIDIA Tegra124 External Memory Controller driver"
+       default y
+       depends on TEGRA_MC && ARCH_TEGRA_124_SOC
+       help
+         This driver is for the External Memory Controller (EMC) found on
+         Tegra124 chips. The EMC controls the external DRAM on the board.
+         This driver is required to change memory timings / clock rate for
+         external memory.
index 0d9f497b786c1d239b0ce72096d5539bae262053..6a0b9ac54f0517927456b014b5e940da9b07518c 100644 (file)
@@ -3,5 +3,8 @@ tegra-mc-y := mc.o
 tegra-mc-$(CONFIG_ARCH_TEGRA_3x_SOC)  += tegra30.o
 tegra-mc-$(CONFIG_ARCH_TEGRA_114_SOC) += tegra114.o
 tegra-mc-$(CONFIG_ARCH_TEGRA_124_SOC) += tegra124.o
+tegra-mc-$(CONFIG_ARCH_TEGRA_132_SOC) += tegra124.o
 
 obj-$(CONFIG_TEGRA_MC) += tegra-mc.o
+
+obj-$(CONFIG_TEGRA124_EMC) += tegra124-emc.o
index fe3c44e7e1d1bf8268b1760fb8e9b828af4f3bc1..c71ede67e6c88399d5b6dec2be5cbf166985930d 100644 (file)
@@ -13,6 +13,9 @@
 #include <linux/of.h>
 #include <linux/platform_device.h>
 #include <linux/slab.h>
+#include <linux/sort.h>
+
+#include <soc/tegra/fuse.h>
 
 #include "mc.h"
 
@@ -48,6 +51,9 @@
 #define  MC_EMEM_ARB_CFG_CYCLES_PER_UPDATE_MASK        0x1ff
 #define MC_EMEM_ARB_MISC0 0xd8
 
+#define MC_EMEM_ADR_CFG 0x54
+#define MC_EMEM_ADR_CFG_EMEM_NUMDEV BIT(0)
+
 static const struct of_device_id tegra_mc_of_match[] = {
 #ifdef CONFIG_ARCH_TEGRA_3x_SOC
        { .compatible = "nvidia,tegra30-mc", .data = &tegra30_mc_soc },
@@ -57,6 +63,9 @@ static const struct of_device_id tegra_mc_of_match[] = {
 #endif
 #ifdef CONFIG_ARCH_TEGRA_124_SOC
        { .compatible = "nvidia,tegra124-mc", .data = &tegra124_mc_soc },
+#endif
+#ifdef CONFIG_ARCH_TEGRA_132_SOC
+       { .compatible = "nvidia,tegra132-mc", .data = &tegra132_mc_soc },
 #endif
        { }
 };
@@ -91,6 +100,130 @@ static int tegra_mc_setup_latency_allowance(struct tegra_mc *mc)
        return 0;
 }
 
+void tegra_mc_write_emem_configuration(struct tegra_mc *mc, unsigned long rate)
+{
+       unsigned int i;
+       struct tegra_mc_timing *timing = NULL;
+
+       for (i = 0; i < mc->num_timings; i++) {
+               if (mc->timings[i].rate == rate) {
+                       timing = &mc->timings[i];
+                       break;
+               }
+       }
+
+       if (!timing) {
+               dev_err(mc->dev, "no memory timing registered for rate %lu\n",
+                       rate);
+               return;
+       }
+
+       for (i = 0; i < mc->soc->num_emem_regs; ++i)
+               mc_writel(mc, timing->emem_data[i], mc->soc->emem_regs[i]);
+}
+
+unsigned int tegra_mc_get_emem_device_count(struct tegra_mc *mc)
+{
+       u8 dram_count;
+
+       dram_count = mc_readl(mc, MC_EMEM_ADR_CFG);
+       dram_count &= MC_EMEM_ADR_CFG_EMEM_NUMDEV;
+       dram_count++;
+
+       return dram_count;
+}
+
+static int load_one_timing(struct tegra_mc *mc,
+                          struct tegra_mc_timing *timing,
+                          struct device_node *node)
+{
+       int err;
+       u32 tmp;
+
+       err = of_property_read_u32(node, "clock-frequency", &tmp);
+       if (err) {
+               dev_err(mc->dev,
+                       "timing %s: failed to read rate\n", node->name);
+               return err;
+       }
+
+       timing->rate = tmp;
+       timing->emem_data = devm_kcalloc(mc->dev, mc->soc->num_emem_regs,
+                                        sizeof(u32), GFP_KERNEL);
+       if (!timing->emem_data)
+               return -ENOMEM;
+
+       err = of_property_read_u32_array(node, "nvidia,emem-configuration",
+                                        timing->emem_data,
+                                        mc->soc->num_emem_regs);
+       if (err) {
+               dev_err(mc->dev,
+                       "timing %s: failed to read EMEM configuration\n",
+                       node->name);
+               return err;
+       }
+
+       return 0;
+}
+
+static int load_timings(struct tegra_mc *mc, struct device_node *node)
+{
+       struct device_node *child;
+       struct tegra_mc_timing *timing;
+       int child_count = of_get_child_count(node);
+       int i = 0, err;
+
+       mc->timings = devm_kcalloc(mc->dev, child_count, sizeof(*timing),
+                                  GFP_KERNEL);
+       if (!mc->timings)
+               return -ENOMEM;
+
+       mc->num_timings = child_count;
+
+       for_each_child_of_node(node, child) {
+               timing = &mc->timings[i++];
+
+               err = load_one_timing(mc, timing, child);
+               if (err)
+                       return err;
+       }
+
+       return 0;
+}
+
+static int tegra_mc_setup_timings(struct tegra_mc *mc)
+{
+       struct device_node *node;
+       u32 ram_code, node_ram_code;
+       int err;
+
+       ram_code = tegra_read_ram_code();
+
+       mc->num_timings = 0;
+
+       for_each_child_of_node(mc->dev->of_node, node) {
+               err = of_property_read_u32(node, "nvidia,ram-code",
+                                          &node_ram_code);
+               if (err || (node_ram_code != ram_code)) {
+                       of_node_put(node);
+                       continue;
+               }
+
+               err = load_timings(mc, node);
+               if (err)
+                       return err;
+               of_node_put(node);
+               break;
+       }
+
+       if (mc->num_timings == 0)
+               dev_warn(mc->dev,
+                        "no memory timings for RAM code %u registered\n",
+                        ram_code);
+
+       return 0;
+}
+
 static const char *const status_names[32] = {
        [ 1] = "External interrupt",
        [ 6] = "EMEM address decode error",
@@ -248,6 +381,12 @@ static int tegra_mc_probe(struct platform_device *pdev)
                return err;
        }
 
+       err = tegra_mc_setup_timings(mc);
+       if (err < 0) {
+               dev_err(&pdev->dev, "failed to setup timings: %d\n", err);
+               return err;
+       }
+
        if (IS_ENABLED(CONFIG_TEGRA_IOMMU_SMMU)) {
                mc->smmu = tegra_smmu_probe(&pdev->dev, mc->soc->smmu, mc);
                if (IS_ERR(mc->smmu)) {
@@ -273,8 +412,8 @@ static int tegra_mc_probe(struct platform_device *pdev)
 
        value = MC_INT_DECERR_MTS | MC_INT_SECERR_SEC | MC_INT_DECERR_VPR |
                MC_INT_INVALID_APB_ASID_UPDATE | MC_INT_INVALID_SMMU_PAGE |
-               MC_INT_ARBITRATION_EMEM | MC_INT_SECURITY_VIOLATION |
-               MC_INT_DECERR_EMEM;
+               MC_INT_SECURITY_VIOLATION | MC_INT_DECERR_EMEM;
+
        mc_writel(mc, value, MC_INTMASK);
 
        return 0;
index d5d21147fc778368ea0451d8c008f643a621c94d..b7361b0a66964ce9a95dc02114cd276d759b6b60 100644 (file)
@@ -37,4 +37,8 @@ extern const struct tegra_mc_soc tegra114_mc_soc;
 extern const struct tegra_mc_soc tegra124_mc_soc;
 #endif
 
+#ifdef CONFIG_ARCH_TEGRA_132_SOC
+extern const struct tegra_mc_soc tegra132_mc_soc;
+#endif
+
 #endif /* MEMORY_TEGRA_MC_H */
index 511e9a25c151cda23f11bc73d2121ed7884175fa..9f579589e8000aaac06333c8d7162bdd5b6041ae 100644 (file)
@@ -896,22 +896,22 @@ static const struct tegra_mc_client tegra114_mc_clients[] = {
 };
 
 static const struct tegra_smmu_swgroup tegra114_swgroups[] = {
-       { .swgroup = TEGRA_SWGROUP_DC,        .reg = 0x240 },
-       { .swgroup = TEGRA_SWGROUP_DCB,       .reg = 0x244 },
-       { .swgroup = TEGRA_SWGROUP_EPP,       .reg = 0x248 },
-       { .swgroup = TEGRA_SWGROUP_G2,        .reg = 0x24c },
-       { .swgroup = TEGRA_SWGROUP_AVPC,      .reg = 0x23c },
-       { .swgroup = TEGRA_SWGROUP_NV,        .reg = 0x268 },
-       { .swgroup = TEGRA_SWGROUP_HDA,       .reg = 0x254 },
-       { .swgroup = TEGRA_SWGROUP_HC,        .reg = 0x250 },
-       { .swgroup = TEGRA_SWGROUP_MSENC,     .reg = 0x264 },
-       { .swgroup = TEGRA_SWGROUP_PPCS,      .reg = 0x270 },
-       { .swgroup = TEGRA_SWGROUP_VDE,       .reg = 0x27c },
-       { .swgroup = TEGRA_SWGROUP_VI,        .reg = 0x280 },
-       { .swgroup = TEGRA_SWGROUP_ISP,       .reg = 0x258 },
-       { .swgroup = TEGRA_SWGROUP_XUSB_HOST, .reg = 0x288 },
-       { .swgroup = TEGRA_SWGROUP_XUSB_DEV,  .reg = 0x28c },
-       { .swgroup = TEGRA_SWGROUP_TSEC,      .reg = 0x294 },
+       { .name = "dc",        .swgroup = TEGRA_SWGROUP_DC,        .reg = 0x240 },
+       { .name = "dcb",       .swgroup = TEGRA_SWGROUP_DCB,       .reg = 0x244 },
+       { .name = "epp",       .swgroup = TEGRA_SWGROUP_EPP,       .reg = 0x248 },
+       { .name = "g2",        .swgroup = TEGRA_SWGROUP_G2,        .reg = 0x24c },
+       { .name = "avpc",      .swgroup = TEGRA_SWGROUP_AVPC,      .reg = 0x23c },
+       { .name = "nv",        .swgroup = TEGRA_SWGROUP_NV,        .reg = 0x268 },
+       { .name = "hda",       .swgroup = TEGRA_SWGROUP_HDA,       .reg = 0x254 },
+       { .name = "hc",        .swgroup = TEGRA_SWGROUP_HC,        .reg = 0x250 },
+       { .name = "msenc",     .swgroup = TEGRA_SWGROUP_MSENC,     .reg = 0x264 },
+       { .name = "ppcs",      .swgroup = TEGRA_SWGROUP_PPCS,      .reg = 0x270 },
+       { .name = "vde",       .swgroup = TEGRA_SWGROUP_VDE,       .reg = 0x27c },
+       { .name = "vi",        .swgroup = TEGRA_SWGROUP_VI,        .reg = 0x280 },
+       { .name = "isp",       .swgroup = TEGRA_SWGROUP_ISP,       .reg = 0x258 },
+       { .name = "xusb_host", .swgroup = TEGRA_SWGROUP_XUSB_HOST, .reg = 0x288 },
+       { .name = "xusb_dev",  .swgroup = TEGRA_SWGROUP_XUSB_DEV,  .reg = 0x28c },
+       { .name = "tsec",      .swgroup = TEGRA_SWGROUP_TSEC,      .reg = 0x294 },
 };
 
 static void tegra114_flush_dcache(struct page *page, unsigned long offset,
diff --git a/drivers/memory/tegra/tegra124-emc.c b/drivers/memory/tegra/tegra124-emc.c
new file mode 100644 (file)
index 0000000..8620355
--- /dev/null
@@ -0,0 +1,1140 @@
+/*
+ * Copyright (c) 2014, NVIDIA CORPORATION.  All rights reserved.
+ *
+ * Author:
+ *     Mikko Perttunen <mperttunen@nvidia.com>
+ *
+ * This software is licensed under the terms of the GNU General Public
+ * License version 2, as published by the Free Software Foundation, and
+ * may be copied, distributed, and modified under those terms.
+ *
+ * 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-provider.h>
+#include <linux/clk.h>
+#include <linux/clkdev.h>
+#include <linux/debugfs.h>
+#include <linux/delay.h>
+#include <linux/of_address.h>
+#include <linux/of_platform.h>
+#include <linux/platform_device.h>
+#include <linux/sort.h>
+#include <linux/string.h>
+
+#include <soc/tegra/emc.h>
+#include <soc/tegra/fuse.h>
+#include <soc/tegra/mc.h>
+
+#define EMC_FBIO_CFG5                          0x104
+#define        EMC_FBIO_CFG5_DRAM_TYPE_MASK            0x3
+#define        EMC_FBIO_CFG5_DRAM_TYPE_SHIFT           0
+
+#define EMC_INTSTATUS                          0x0
+#define EMC_INTSTATUS_CLKCHANGE_COMPLETE       BIT(4)
+
+#define EMC_CFG                                        0xc
+#define EMC_CFG_DRAM_CLKSTOP_PD                        BIT(31)
+#define EMC_CFG_DRAM_CLKSTOP_SR                        BIT(30)
+#define EMC_CFG_DRAM_ACPD                      BIT(29)
+#define EMC_CFG_DYN_SREF                       BIT(28)
+#define EMC_CFG_PWR_MASK                       ((0xF << 28) | BIT(18))
+#define EMC_CFG_DSR_VTTGEN_DRV_EN              BIT(18)
+
+#define EMC_REFCTRL                            0x20
+#define EMC_REFCTRL_DEV_SEL_SHIFT              0
+#define EMC_REFCTRL_ENABLE                     BIT(31)
+
+#define EMC_TIMING_CONTROL                     0x28
+#define EMC_RC                                 0x2c
+#define EMC_RFC                                        0x30
+#define EMC_RAS                                        0x34
+#define EMC_RP                                 0x38
+#define EMC_R2W                                        0x3c
+#define EMC_W2R                                        0x40
+#define EMC_R2P                                        0x44
+#define EMC_W2P                                        0x48
+#define EMC_RD_RCD                             0x4c
+#define EMC_WR_RCD                             0x50
+#define EMC_RRD                                        0x54
+#define EMC_REXT                               0x58
+#define EMC_WDV                                        0x5c
+#define EMC_QUSE                               0x60
+#define EMC_QRST                               0x64
+#define EMC_QSAFE                              0x68
+#define EMC_RDV                                        0x6c
+#define EMC_REFRESH                            0x70
+#define EMC_BURST_REFRESH_NUM                  0x74
+#define EMC_PDEX2WR                            0x78
+#define EMC_PDEX2RD                            0x7c
+#define EMC_PCHG2PDEN                          0x80
+#define EMC_ACT2PDEN                           0x84
+#define EMC_AR2PDEN                            0x88
+#define EMC_RW2PDEN                            0x8c
+#define EMC_TXSR                               0x90
+#define EMC_TCKE                               0x94
+#define EMC_TFAW                               0x98
+#define EMC_TRPAB                              0x9c
+#define EMC_TCLKSTABLE                         0xa0
+#define EMC_TCLKSTOP                           0xa4
+#define EMC_TREFBW                             0xa8
+#define EMC_ODT_WRITE                          0xb0
+#define EMC_ODT_READ                           0xb4
+#define EMC_WEXT                               0xb8
+#define EMC_CTT                                        0xbc
+#define EMC_RFC_SLR                            0xc0
+#define EMC_MRS_WAIT_CNT2                      0xc4
+
+#define EMC_MRS_WAIT_CNT                       0xc8
+#define EMC_MRS_WAIT_CNT_SHORT_WAIT_SHIFT      0
+#define EMC_MRS_WAIT_CNT_SHORT_WAIT_MASK       \
+       (0x3FF << EMC_MRS_WAIT_CNT_SHORT_WAIT_SHIFT)
+#define EMC_MRS_WAIT_CNT_LONG_WAIT_SHIFT       16
+#define EMC_MRS_WAIT_CNT_LONG_WAIT_MASK                \
+       (0x3FF << EMC_MRS_WAIT_CNT_LONG_WAIT_SHIFT)
+
+#define EMC_MRS                                        0xcc
+#define EMC_MODE_SET_DLL_RESET                 BIT(8)
+#define EMC_MODE_SET_LONG_CNT                  BIT(26)
+#define EMC_EMRS                               0xd0
+#define EMC_REF                                        0xd4
+#define EMC_PRE                                        0xd8
+
+#define EMC_SELF_REF                           0xe0
+#define EMC_SELF_REF_CMD_ENABLED               BIT(0)
+#define EMC_SELF_REF_DEV_SEL_SHIFT             30
+
+#define EMC_MRW                                        0xe8
+
+#define EMC_MRR                                        0xec
+#define EMC_MRR_MA_SHIFT                       16
+#define LPDDR2_MR4_TEMP_SHIFT                  0
+
+#define EMC_XM2DQSPADCTRL3                     0xf8
+#define EMC_FBIO_SPARE                         0x100
+
+#define EMC_FBIO_CFG6                          0x114
+#define EMC_EMRS2                              0x12c
+#define EMC_MRW2                               0x134
+#define EMC_MRW4                               0x13c
+#define EMC_EINPUT                             0x14c
+#define EMC_EINPUT_DURATION                    0x150
+#define EMC_PUTERM_EXTRA                       0x154
+#define EMC_TCKESR                             0x158
+#define EMC_TPD                                        0x15c
+
+#define EMC_AUTO_CAL_CONFIG                    0x2a4
+#define EMC_AUTO_CAL_CONFIG_AUTO_CAL_START     BIT(31)
+#define EMC_AUTO_CAL_INTERVAL                  0x2a8
+#define EMC_AUTO_CAL_STATUS                    0x2ac
+#define EMC_AUTO_CAL_STATUS_ACTIVE             BIT(31)
+#define EMC_STATUS                             0x2b4
+#define EMC_STATUS_TIMING_UPDATE_STALLED       BIT(23)
+
+#define EMC_CFG_2                              0x2b8
+#define EMC_CFG_2_MODE_SHIFT                   0
+#define EMC_CFG_2_DIS_STP_OB_CLK_DURING_NON_WR BIT(6)
+
+#define EMC_CFG_DIG_DLL                                0x2bc
+#define EMC_CFG_DIG_DLL_PERIOD                 0x2c0
+#define EMC_RDV_MASK                           0x2cc
+#define EMC_WDV_MASK                           0x2d0
+#define EMC_CTT_DURATION                       0x2d8
+#define EMC_CTT_TERM_CTRL                      0x2dc
+#define EMC_ZCAL_INTERVAL                      0x2e0
+#define EMC_ZCAL_WAIT_CNT                      0x2e4
+
+#define EMC_ZQ_CAL                             0x2ec
+#define EMC_ZQ_CAL_CMD                         BIT(0)
+#define EMC_ZQ_CAL_LONG                                BIT(4)
+#define EMC_ZQ_CAL_LONG_CMD_DEV0               \
+       (DRAM_DEV_SEL_0 | EMC_ZQ_CAL_LONG | EMC_ZQ_CAL_CMD)
+#define EMC_ZQ_CAL_LONG_CMD_DEV1               \
+       (DRAM_DEV_SEL_1 | EMC_ZQ_CAL_LONG | EMC_ZQ_CAL_CMD)
+
+#define EMC_XM2CMDPADCTRL                      0x2f0
+#define EMC_XM2DQSPADCTRL                      0x2f8
+#define EMC_XM2DQSPADCTRL2                     0x2fc
+#define EMC_XM2DQSPADCTRL2_RX_FT_REC_ENABLE    BIT(0)
+#define EMC_XM2DQSPADCTRL2_VREF_ENABLE         BIT(5)
+#define EMC_XM2DQPADCTRL                       0x300
+#define EMC_XM2DQPADCTRL2                      0x304
+#define EMC_XM2CLKPADCTRL                      0x308
+#define EMC_XM2COMPPADCTRL                     0x30c
+#define EMC_XM2VTTGENPADCTRL                   0x310
+#define EMC_XM2VTTGENPADCTRL2                  0x314
+#define EMC_XM2VTTGENPADCTRL3                  0x318
+#define EMC_XM2DQSPADCTRL4                     0x320
+#define EMC_DLL_XFORM_DQS0                     0x328
+#define EMC_DLL_XFORM_DQS1                     0x32c
+#define EMC_DLL_XFORM_DQS2                     0x330
+#define EMC_DLL_XFORM_DQS3                     0x334
+#define EMC_DLL_XFORM_DQS4                     0x338
+#define EMC_DLL_XFORM_DQS5                     0x33c
+#define EMC_DLL_XFORM_DQS6                     0x340
+#define EMC_DLL_XFORM_DQS7                     0x344
+#define EMC_DLL_XFORM_QUSE0                    0x348
+#define EMC_DLL_XFORM_QUSE1                    0x34c
+#define EMC_DLL_XFORM_QUSE2                    0x350
+#define EMC_DLL_XFORM_QUSE3                    0x354
+#define EMC_DLL_XFORM_QUSE4                    0x358
+#define EMC_DLL_XFORM_QUSE5                    0x35c
+#define EMC_DLL_XFORM_QUSE6                    0x360
+#define EMC_DLL_XFORM_QUSE7                    0x364
+#define EMC_DLL_XFORM_DQ0                      0x368
+#define EMC_DLL_XFORM_DQ1                      0x36c
+#define EMC_DLL_XFORM_DQ2                      0x370
+#define EMC_DLL_XFORM_DQ3                      0x374
+#define EMC_DLI_TRIM_TXDQS0                    0x3a8
+#define EMC_DLI_TRIM_TXDQS1                    0x3ac
+#define EMC_DLI_TRIM_TXDQS2                    0x3b0
+#define EMC_DLI_TRIM_TXDQS3                    0x3b4
+#define EMC_DLI_TRIM_TXDQS4                    0x3b8
+#define EMC_DLI_TRIM_TXDQS5                    0x3bc
+#define EMC_DLI_TRIM_TXDQS6                    0x3c0
+#define EMC_DLI_TRIM_TXDQS7                    0x3c4
+#define EMC_STALL_THEN_EXE_AFTER_CLKCHANGE     0x3cc
+#define EMC_SEL_DPD_CTRL                       0x3d8
+#define EMC_SEL_DPD_CTRL_DATA_SEL_DPD          BIT(8)
+#define EMC_SEL_DPD_CTRL_ODT_SEL_DPD           BIT(5)
+#define EMC_SEL_DPD_CTRL_RESET_SEL_DPD         BIT(4)
+#define EMC_SEL_DPD_CTRL_CA_SEL_DPD            BIT(3)
+#define EMC_SEL_DPD_CTRL_CLK_SEL_DPD           BIT(2)
+#define EMC_SEL_DPD_CTRL_DDR3_MASK     \
+       ((0xf << 2) | BIT(8))
+#define EMC_SEL_DPD_CTRL_MASK \
+       ((0x3 << 2) | BIT(5) | BIT(8))
+#define EMC_PRE_REFRESH_REQ_CNT                        0x3dc
+#define EMC_DYN_SELF_REF_CONTROL               0x3e0
+#define EMC_TXSRDLL                            0x3e4
+#define EMC_CCFIFO_ADDR                                0x3e8
+#define EMC_CCFIFO_DATA                                0x3ec
+#define EMC_CCFIFO_STATUS                      0x3f0
+#define EMC_CDB_CNTL_1                         0x3f4
+#define EMC_CDB_CNTL_2                         0x3f8
+#define EMC_XM2CLKPADCTRL2                     0x3fc
+#define EMC_AUTO_CAL_CONFIG2                   0x458
+#define EMC_AUTO_CAL_CONFIG3                   0x45c
+#define EMC_IBDLY                              0x468
+#define EMC_DLL_XFORM_ADDR0                    0x46c
+#define EMC_DLL_XFORM_ADDR1                    0x470
+#define EMC_DLL_XFORM_ADDR2                    0x474
+#define EMC_DSR_VTTGEN_DRV                     0x47c
+#define EMC_TXDSRVTTGEN                                0x480
+#define EMC_XM2CMDPADCTRL4                     0x484
+#define EMC_XM2CMDPADCTRL5                     0x488
+#define EMC_DLL_XFORM_DQS8                     0x4a0
+#define EMC_DLL_XFORM_DQS9                     0x4a4
+#define EMC_DLL_XFORM_DQS10                    0x4a8
+#define EMC_DLL_XFORM_DQS11                    0x4ac
+#define EMC_DLL_XFORM_DQS12                    0x4b0
+#define EMC_DLL_XFORM_DQS13                    0x4b4
+#define EMC_DLL_XFORM_DQS14                    0x4b8
+#define EMC_DLL_XFORM_DQS15                    0x4bc
+#define EMC_DLL_XFORM_QUSE8                    0x4c0
+#define EMC_DLL_XFORM_QUSE9                    0x4c4
+#define EMC_DLL_XFORM_QUSE10                   0x4c8
+#define EMC_DLL_XFORM_QUSE11                   0x4cc
+#define EMC_DLL_XFORM_QUSE12                   0x4d0
+#define EMC_DLL_XFORM_QUSE13                   0x4d4
+#define EMC_DLL_XFORM_QUSE14                   0x4d8
+#define EMC_DLL_XFORM_QUSE15                   0x4dc
+#define EMC_DLL_XFORM_DQ4                      0x4e0
+#define EMC_DLL_XFORM_DQ5                      0x4e4
+#define EMC_DLL_XFORM_DQ6                      0x4e8
+#define EMC_DLL_XFORM_DQ7                      0x4ec
+#define EMC_DLI_TRIM_TXDQS8                    0x520
+#define EMC_DLI_TRIM_TXDQS9                    0x524
+#define EMC_DLI_TRIM_TXDQS10                   0x528
+#define EMC_DLI_TRIM_TXDQS11                   0x52c
+#define EMC_DLI_TRIM_TXDQS12                   0x530
+#define EMC_DLI_TRIM_TXDQS13                   0x534
+#define EMC_DLI_TRIM_TXDQS14                   0x538
+#define EMC_DLI_TRIM_TXDQS15                   0x53c
+#define EMC_CDB_CNTL_3                         0x540
+#define EMC_XM2DQSPADCTRL5                     0x544
+#define EMC_XM2DQSPADCTRL6                     0x548
+#define EMC_XM2DQPADCTRL3                      0x54c
+#define EMC_DLL_XFORM_ADDR3                    0x550
+#define EMC_DLL_XFORM_ADDR4                    0x554
+#define EMC_DLL_XFORM_ADDR5                    0x558
+#define EMC_CFG_PIPE                           0x560
+#define EMC_QPOP                               0x564
+#define EMC_QUSE_WIDTH                         0x568
+#define EMC_PUTERM_WIDTH                       0x56c
+#define EMC_BGBIAS_CTL0                                0x570
+#define EMC_BGBIAS_CTL0_BIAS0_DSC_E_PWRD_IBIAS_RX BIT(3)
+#define EMC_BGBIAS_CTL0_BIAS0_DSC_E_PWRD_IBIAS_VTTGEN BIT(2)
+#define EMC_BGBIAS_CTL0_BIAS0_DSC_E_PWRD       BIT(1)
+#define EMC_PUTERM_ADJ                         0x574
+
+#define DRAM_DEV_SEL_ALL                       0
+#define DRAM_DEV_SEL_0                         (2 << 30)
+#define DRAM_DEV_SEL_1                         (1 << 30)
+
+#define EMC_CFG_POWER_FEATURES_MASK            \
+       (EMC_CFG_DYN_SREF | EMC_CFG_DRAM_ACPD | EMC_CFG_DRAM_CLKSTOP_SR | \
+       EMC_CFG_DRAM_CLKSTOP_PD | EMC_CFG_DSR_VTTGEN_DRV_EN)
+#define EMC_REFCTRL_DEV_SEL(n) (((n > 1) ? 0 : 2) << EMC_REFCTRL_DEV_SEL_SHIFT)
+#define EMC_DRAM_DEV_SEL(n) ((n > 1) ? DRAM_DEV_SEL_ALL : DRAM_DEV_SEL_0)
+
+/* Maximum amount of time in us. to wait for changes to become effective */
+#define EMC_STATUS_UPDATE_TIMEOUT              1000
+
+enum emc_dram_type {
+       DRAM_TYPE_DDR3 = 0,
+       DRAM_TYPE_DDR1 = 1,
+       DRAM_TYPE_LPDDR3 = 2,
+       DRAM_TYPE_DDR2 = 3
+};
+
+enum emc_dll_change {
+       DLL_CHANGE_NONE,
+       DLL_CHANGE_ON,
+       DLL_CHANGE_OFF
+};
+
+static const unsigned long emc_burst_regs[] = {
+       EMC_RC,
+       EMC_RFC,
+       EMC_RFC_SLR,
+       EMC_RAS,
+       EMC_RP,
+       EMC_R2W,
+       EMC_W2R,
+       EMC_R2P,
+       EMC_W2P,
+       EMC_RD_RCD,
+       EMC_WR_RCD,
+       EMC_RRD,
+       EMC_REXT,
+       EMC_WEXT,
+       EMC_WDV,
+       EMC_WDV_MASK,
+       EMC_QUSE,
+       EMC_QUSE_WIDTH,
+       EMC_IBDLY,
+       EMC_EINPUT,
+       EMC_EINPUT_DURATION,
+       EMC_PUTERM_EXTRA,
+       EMC_PUTERM_WIDTH,
+       EMC_PUTERM_ADJ,
+       EMC_CDB_CNTL_1,
+       EMC_CDB_CNTL_2,
+       EMC_CDB_CNTL_3,
+       EMC_QRST,
+       EMC_QSAFE,
+       EMC_RDV,
+       EMC_RDV_MASK,
+       EMC_REFRESH,
+       EMC_BURST_REFRESH_NUM,
+       EMC_PRE_REFRESH_REQ_CNT,
+       EMC_PDEX2WR,
+       EMC_PDEX2RD,
+       EMC_PCHG2PDEN,
+       EMC_ACT2PDEN,
+       EMC_AR2PDEN,
+       EMC_RW2PDEN,
+       EMC_TXSR,
+       EMC_TXSRDLL,
+       EMC_TCKE,
+       EMC_TCKESR,
+       EMC_TPD,
+       EMC_TFAW,
+       EMC_TRPAB,
+       EMC_TCLKSTABLE,
+       EMC_TCLKSTOP,
+       EMC_TREFBW,
+       EMC_FBIO_CFG6,
+       EMC_ODT_WRITE,
+       EMC_ODT_READ,
+       EMC_FBIO_CFG5,
+       EMC_CFG_DIG_DLL,
+       EMC_CFG_DIG_DLL_PERIOD,
+       EMC_DLL_XFORM_DQS0,
+       EMC_DLL_XFORM_DQS1,
+       EMC_DLL_XFORM_DQS2,
+       EMC_DLL_XFORM_DQS3,
+       EMC_DLL_XFORM_DQS4,
+       EMC_DLL_XFORM_DQS5,
+       EMC_DLL_XFORM_DQS6,
+       EMC_DLL_XFORM_DQS7,
+       EMC_DLL_XFORM_DQS8,
+       EMC_DLL_XFORM_DQS9,
+       EMC_DLL_XFORM_DQS10,
+       EMC_DLL_XFORM_DQS11,
+       EMC_DLL_XFORM_DQS12,
+       EMC_DLL_XFORM_DQS13,
+       EMC_DLL_XFORM_DQS14,
+       EMC_DLL_XFORM_DQS15,
+       EMC_DLL_XFORM_QUSE0,
+       EMC_DLL_XFORM_QUSE1,
+       EMC_DLL_XFORM_QUSE2,
+       EMC_DLL_XFORM_QUSE3,
+       EMC_DLL_XFORM_QUSE4,
+       EMC_DLL_XFORM_QUSE5,
+       EMC_DLL_XFORM_QUSE6,
+       EMC_DLL_XFORM_QUSE7,
+       EMC_DLL_XFORM_ADDR0,
+       EMC_DLL_XFORM_ADDR1,
+       EMC_DLL_XFORM_ADDR2,
+       EMC_DLL_XFORM_ADDR3,
+       EMC_DLL_XFORM_ADDR4,
+       EMC_DLL_XFORM_ADDR5,
+       EMC_DLL_XFORM_QUSE8,
+       EMC_DLL_XFORM_QUSE9,
+       EMC_DLL_XFORM_QUSE10,
+       EMC_DLL_XFORM_QUSE11,
+       EMC_DLL_XFORM_QUSE12,
+       EMC_DLL_XFORM_QUSE13,
+       EMC_DLL_XFORM_QUSE14,
+       EMC_DLL_XFORM_QUSE15,
+       EMC_DLI_TRIM_TXDQS0,
+       EMC_DLI_TRIM_TXDQS1,
+       EMC_DLI_TRIM_TXDQS2,
+       EMC_DLI_TRIM_TXDQS3,
+       EMC_DLI_TRIM_TXDQS4,
+       EMC_DLI_TRIM_TXDQS5,
+       EMC_DLI_TRIM_TXDQS6,
+       EMC_DLI_TRIM_TXDQS7,
+       EMC_DLI_TRIM_TXDQS8,
+       EMC_DLI_TRIM_TXDQS9,
+       EMC_DLI_TRIM_TXDQS10,
+       EMC_DLI_TRIM_TXDQS11,
+       EMC_DLI_TRIM_TXDQS12,
+       EMC_DLI_TRIM_TXDQS13,
+       EMC_DLI_TRIM_TXDQS14,
+       EMC_DLI_TRIM_TXDQS15,
+       EMC_DLL_XFORM_DQ0,
+       EMC_DLL_XFORM_DQ1,
+       EMC_DLL_XFORM_DQ2,
+       EMC_DLL_XFORM_DQ3,
+       EMC_DLL_XFORM_DQ4,
+       EMC_DLL_XFORM_DQ5,
+       EMC_DLL_XFORM_DQ6,
+       EMC_DLL_XFORM_DQ7,
+       EMC_XM2CMDPADCTRL,
+       EMC_XM2CMDPADCTRL4,
+       EMC_XM2CMDPADCTRL5,
+       EMC_XM2DQPADCTRL2,
+       EMC_XM2DQPADCTRL3,
+       EMC_XM2CLKPADCTRL,
+       EMC_XM2CLKPADCTRL2,
+       EMC_XM2COMPPADCTRL,
+       EMC_XM2VTTGENPADCTRL,
+       EMC_XM2VTTGENPADCTRL2,
+       EMC_XM2VTTGENPADCTRL3,
+       EMC_XM2DQSPADCTRL3,
+       EMC_XM2DQSPADCTRL4,
+       EMC_XM2DQSPADCTRL5,
+       EMC_XM2DQSPADCTRL6,
+       EMC_DSR_VTTGEN_DRV,
+       EMC_TXDSRVTTGEN,
+       EMC_FBIO_SPARE,
+       EMC_ZCAL_WAIT_CNT,
+       EMC_MRS_WAIT_CNT2,
+       EMC_CTT,
+       EMC_CTT_DURATION,
+       EMC_CFG_PIPE,
+       EMC_DYN_SELF_REF_CONTROL,
+       EMC_QPOP
+};
+
+struct emc_timing {
+       unsigned long rate;
+
+       u32 emc_burst_data[ARRAY_SIZE(emc_burst_regs)];
+
+       u32 emc_auto_cal_config;
+       u32 emc_auto_cal_config2;
+       u32 emc_auto_cal_config3;
+       u32 emc_auto_cal_interval;
+       u32 emc_bgbias_ctl0;
+       u32 emc_cfg;
+       u32 emc_cfg_2;
+       u32 emc_ctt_term_ctrl;
+       u32 emc_mode_1;
+       u32 emc_mode_2;
+       u32 emc_mode_4;
+       u32 emc_mode_reset;
+       u32 emc_mrs_wait_cnt;
+       u32 emc_sel_dpd_ctrl;
+       u32 emc_xm2dqspadctrl2;
+       u32 emc_zcal_cnt_long;
+       u32 emc_zcal_interval;
+};
+
+struct tegra_emc {
+       struct device *dev;
+
+       struct tegra_mc *mc;
+
+       void __iomem *regs;
+
+       enum emc_dram_type dram_type;
+       unsigned int dram_num;
+
+       struct emc_timing last_timing;
+       struct emc_timing *timings;
+       unsigned int num_timings;
+};
+
+/* Timing change sequence functions */
+
+static void emc_ccfifo_writel(struct tegra_emc *emc, u32 value,
+                             unsigned long offset)
+{
+       writel(value, emc->regs + EMC_CCFIFO_DATA);
+       writel(offset, emc->regs + EMC_CCFIFO_ADDR);
+}
+
+static void emc_seq_update_timing(struct tegra_emc *emc)
+{
+       unsigned int i;
+       u32 value;
+
+       writel(1, emc->regs + EMC_TIMING_CONTROL);
+
+       for (i = 0; i < EMC_STATUS_UPDATE_TIMEOUT; ++i) {
+               value = readl(emc->regs + EMC_STATUS);
+               if ((value & EMC_STATUS_TIMING_UPDATE_STALLED) == 0)
+                       return;
+               udelay(1);
+       }
+
+       dev_err(emc->dev, "timing update timed out\n");
+}
+
+static void emc_seq_disable_auto_cal(struct tegra_emc *emc)
+{
+       unsigned int i;
+       u32 value;
+
+       writel(0, emc->regs + EMC_AUTO_CAL_INTERVAL);
+
+       for (i = 0; i < EMC_STATUS_UPDATE_TIMEOUT; ++i) {
+               value = readl(emc->regs + EMC_AUTO_CAL_STATUS);
+               if ((value & EMC_AUTO_CAL_STATUS_ACTIVE) == 0)
+                       return;
+               udelay(1);
+       }
+
+       dev_err(emc->dev, "auto cal disable timed out\n");
+}
+
+static void emc_seq_wait_clkchange(struct tegra_emc *emc)
+{
+       unsigned int i;
+       u32 value;
+
+       for (i = 0; i < EMC_STATUS_UPDATE_TIMEOUT; ++i) {
+               value = readl(emc->regs + EMC_INTSTATUS);
+               if (value & EMC_INTSTATUS_CLKCHANGE_COMPLETE)
+                       return;
+               udelay(1);
+       }
+
+       dev_err(emc->dev, "clock change timed out\n");
+}
+
+static struct emc_timing *tegra_emc_find_timing(struct tegra_emc *emc,
+                                               unsigned long rate)
+{
+       struct emc_timing *timing = NULL;
+       unsigned int i;
+
+       for (i = 0; i < emc->num_timings; i++) {
+               if (emc->timings[i].rate == rate) {
+                       timing = &emc->timings[i];
+                       break;
+               }
+       }
+
+       if (!timing) {
+               dev_err(emc->dev, "no timing for rate %lu\n", rate);
+               return NULL;
+       }
+
+       return timing;
+}
+
+int tegra_emc_prepare_timing_change(struct tegra_emc *emc,
+                                   unsigned long rate)
+{
+       struct emc_timing *timing = tegra_emc_find_timing(emc, rate);
+       struct emc_timing *last = &emc->last_timing;
+       enum emc_dll_change dll_change;
+       unsigned int pre_wait = 0;
+       u32 val, val2, mask;
+       bool update = false;
+       unsigned int i;
+
+       if (!timing)
+               return -ENOENT;
+
+       if ((last->emc_mode_1 & 0x1) == (timing->emc_mode_1 & 0x1))
+               dll_change = DLL_CHANGE_NONE;
+       else if (timing->emc_mode_1 & 0x1)
+               dll_change = DLL_CHANGE_ON;
+       else
+               dll_change = DLL_CHANGE_OFF;
+
+       /* Clear CLKCHANGE_COMPLETE interrupts */
+       writel(EMC_INTSTATUS_CLKCHANGE_COMPLETE, emc->regs + EMC_INTSTATUS);
+
+       /* Disable dynamic self-refresh */
+       val = readl(emc->regs + EMC_CFG);
+       if (val & EMC_CFG_PWR_MASK) {
+               val &= ~EMC_CFG_POWER_FEATURES_MASK;
+               writel(val, emc->regs + EMC_CFG);
+
+               pre_wait = 5;
+       }
+
+       /* Disable SEL_DPD_CTRL for clock change */
+       if (emc->dram_type == DRAM_TYPE_DDR3)
+               mask = EMC_SEL_DPD_CTRL_DDR3_MASK;
+       else
+               mask = EMC_SEL_DPD_CTRL_MASK;
+
+       val = readl(emc->regs + EMC_SEL_DPD_CTRL);
+       if (val & mask) {
+               val &= ~mask;
+               writel(val, emc->regs + EMC_SEL_DPD_CTRL);
+       }
+
+       /* Prepare DQ/DQS for clock change */
+       val = readl(emc->regs + EMC_BGBIAS_CTL0);
+       val2 = last->emc_bgbias_ctl0;
+       if (!(timing->emc_bgbias_ctl0 &
+             EMC_BGBIAS_CTL0_BIAS0_DSC_E_PWRD_IBIAS_RX) &&
+           (val & EMC_BGBIAS_CTL0_BIAS0_DSC_E_PWRD_IBIAS_RX)) {
+               val2 &= ~EMC_BGBIAS_CTL0_BIAS0_DSC_E_PWRD_IBIAS_RX;
+               update = true;
+       }
+
+       if ((val & EMC_BGBIAS_CTL0_BIAS0_DSC_E_PWRD) ||
+           (val & EMC_BGBIAS_CTL0_BIAS0_DSC_E_PWRD_IBIAS_VTTGEN)) {
+               update = true;
+       }
+
+       if (update) {
+               writel(val2, emc->regs + EMC_BGBIAS_CTL0);
+               if (pre_wait < 5)
+                       pre_wait = 5;
+       }
+
+       update = false;
+       val = readl(emc->regs + EMC_XM2DQSPADCTRL2);
+       if (timing->emc_xm2dqspadctrl2 & EMC_XM2DQSPADCTRL2_VREF_ENABLE &&
+           !(val & EMC_XM2DQSPADCTRL2_VREF_ENABLE)) {
+               val |= EMC_XM2DQSPADCTRL2_VREF_ENABLE;
+               update = true;
+       }
+
+       if (timing->emc_xm2dqspadctrl2 & EMC_XM2DQSPADCTRL2_RX_FT_REC_ENABLE &&
+           !(val & EMC_XM2DQSPADCTRL2_RX_FT_REC_ENABLE)) {
+               val |= EMC_XM2DQSPADCTRL2_RX_FT_REC_ENABLE;
+               update = true;
+       }
+
+       if (update) {
+               writel(val, emc->regs + EMC_XM2DQSPADCTRL2);
+               if (pre_wait < 30)
+                       pre_wait = 30;
+       }
+
+       /* Wait to settle */
+       if (pre_wait) {
+               emc_seq_update_timing(emc);
+               udelay(pre_wait);
+       }
+
+       /* Program CTT_TERM control */
+       if (last->emc_ctt_term_ctrl != timing->emc_ctt_term_ctrl) {
+               emc_seq_disable_auto_cal(emc);
+               writel(timing->emc_ctt_term_ctrl,
+                      emc->regs + EMC_CTT_TERM_CTRL);
+               emc_seq_update_timing(emc);
+       }
+
+       /* Program burst shadow registers */
+       for (i = 0; i < ARRAY_SIZE(timing->emc_burst_data); ++i)
+               writel(timing->emc_burst_data[i],
+                      emc->regs + emc_burst_regs[i]);
+
+       writel(timing->emc_xm2dqspadctrl2, emc->regs + EMC_XM2DQSPADCTRL2);
+       writel(timing->emc_zcal_interval, emc->regs + EMC_ZCAL_INTERVAL);
+
+       tegra_mc_write_emem_configuration(emc->mc, timing->rate);
+
+       val = timing->emc_cfg & ~EMC_CFG_POWER_FEATURES_MASK;
+       emc_ccfifo_writel(emc, val, EMC_CFG);
+
+       /* Program AUTO_CAL_CONFIG */
+       if (timing->emc_auto_cal_config2 != last->emc_auto_cal_config2)
+               emc_ccfifo_writel(emc, timing->emc_auto_cal_config2,
+                                 EMC_AUTO_CAL_CONFIG2);
+
+       if (timing->emc_auto_cal_config3 != last->emc_auto_cal_config3)
+               emc_ccfifo_writel(emc, timing->emc_auto_cal_config3,
+                                 EMC_AUTO_CAL_CONFIG3);
+
+       if (timing->emc_auto_cal_config != last->emc_auto_cal_config) {
+               val = timing->emc_auto_cal_config;
+               val &= EMC_AUTO_CAL_CONFIG_AUTO_CAL_START;
+               emc_ccfifo_writel(emc, val, EMC_AUTO_CAL_CONFIG);
+       }
+
+       /* DDR3: predict MRS long wait count */
+       if (emc->dram_type == DRAM_TYPE_DDR3 &&
+           dll_change == DLL_CHANGE_ON) {
+               u32 cnt = 512;
+
+               if (timing->emc_zcal_interval != 0 &&
+                   last->emc_zcal_interval == 0)
+                       cnt -= emc->dram_num * 256;
+
+               val = (timing->emc_mrs_wait_cnt
+                       & EMC_MRS_WAIT_CNT_SHORT_WAIT_MASK)
+                       >> EMC_MRS_WAIT_CNT_SHORT_WAIT_SHIFT;
+               if (cnt < val)
+                       cnt = val;
+
+               val = timing->emc_mrs_wait_cnt
+                       & ~EMC_MRS_WAIT_CNT_LONG_WAIT_MASK;
+               val |= (cnt << EMC_MRS_WAIT_CNT_LONG_WAIT_SHIFT)
+                       & EMC_MRS_WAIT_CNT_LONG_WAIT_MASK;
+
+               writel(val, emc->regs + EMC_MRS_WAIT_CNT);
+       }
+
+       val = timing->emc_cfg_2;
+       val &= ~EMC_CFG_2_DIS_STP_OB_CLK_DURING_NON_WR;
+       emc_ccfifo_writel(emc, val, EMC_CFG_2);
+
+       /* DDR3: Turn off DLL and enter self-refresh */
+       if (emc->dram_type == DRAM_TYPE_DDR3 && dll_change == DLL_CHANGE_OFF)
+               emc_ccfifo_writel(emc, timing->emc_mode_1, EMC_EMRS);
+
+       /* Disable refresh controller */
+       emc_ccfifo_writel(emc, EMC_REFCTRL_DEV_SEL(emc->dram_num),
+                         EMC_REFCTRL);
+       if (emc->dram_type == DRAM_TYPE_DDR3)
+               emc_ccfifo_writel(emc, EMC_DRAM_DEV_SEL(emc->dram_num) |
+                                      EMC_SELF_REF_CMD_ENABLED,
+                                 EMC_SELF_REF);
+
+       /* Flow control marker */
+       emc_ccfifo_writel(emc, 1, EMC_STALL_THEN_EXE_AFTER_CLKCHANGE);
+
+       /* DDR3: Exit self-refresh */
+       if (emc->dram_type == DRAM_TYPE_DDR3)
+               emc_ccfifo_writel(emc, EMC_DRAM_DEV_SEL(emc->dram_num),
+                                 EMC_SELF_REF);
+       emc_ccfifo_writel(emc, EMC_REFCTRL_DEV_SEL(emc->dram_num) |
+                              EMC_REFCTRL_ENABLE,
+                         EMC_REFCTRL);
+
+       /* Set DRAM mode registers */
+       if (emc->dram_type == DRAM_TYPE_DDR3) {
+               if (timing->emc_mode_1 != last->emc_mode_1)
+                       emc_ccfifo_writel(emc, timing->emc_mode_1, EMC_EMRS);
+               if (timing->emc_mode_2 != last->emc_mode_2)
+                       emc_ccfifo_writel(emc, timing->emc_mode_2, EMC_EMRS2);
+
+               if ((timing->emc_mode_reset != last->emc_mode_reset) ||
+                   dll_change == DLL_CHANGE_ON) {
+                       val = timing->emc_mode_reset;
+                       if (dll_change == DLL_CHANGE_ON) {
+                               val |= EMC_MODE_SET_DLL_RESET;
+                               val |= EMC_MODE_SET_LONG_CNT;
+                       } else {
+                               val &= ~EMC_MODE_SET_DLL_RESET;
+                       }
+                       emc_ccfifo_writel(emc, val, EMC_MRS);
+               }
+       } else {
+               if (timing->emc_mode_2 != last->emc_mode_2)
+                       emc_ccfifo_writel(emc, timing->emc_mode_2, EMC_MRW2);
+               if (timing->emc_mode_1 != last->emc_mode_1)
+                       emc_ccfifo_writel(emc, timing->emc_mode_1, EMC_MRW);
+               if (timing->emc_mode_4 != last->emc_mode_4)
+                       emc_ccfifo_writel(emc, timing->emc_mode_4, EMC_MRW4);
+       }
+
+       /*  Issue ZCAL command if turning ZCAL on */
+       if (timing->emc_zcal_interval != 0 && last->emc_zcal_interval == 0) {
+               emc_ccfifo_writel(emc, EMC_ZQ_CAL_LONG_CMD_DEV0, EMC_ZQ_CAL);
+               if (emc->dram_num > 1)
+                       emc_ccfifo_writel(emc, EMC_ZQ_CAL_LONG_CMD_DEV1,
+                                         EMC_ZQ_CAL);
+       }
+
+       /*  Write to RO register to remove stall after change */
+       emc_ccfifo_writel(emc, 0, EMC_CCFIFO_STATUS);
+
+       if (timing->emc_cfg_2 & EMC_CFG_2_DIS_STP_OB_CLK_DURING_NON_WR)
+               emc_ccfifo_writel(emc, timing->emc_cfg_2, EMC_CFG_2);
+
+       /* Disable AUTO_CAL for clock change */
+       emc_seq_disable_auto_cal(emc);
+
+       /* Read register to wait until programming has settled */
+       readl(emc->regs + EMC_INTSTATUS);
+
+       return 0;
+}
+
+void tegra_emc_complete_timing_change(struct tegra_emc *emc,
+                                     unsigned long rate)
+{
+       struct emc_timing *timing = tegra_emc_find_timing(emc, rate);
+       struct emc_timing *last = &emc->last_timing;
+       u32 val;
+
+       if (!timing)
+               return;
+
+       /* Wait until the state machine has settled */
+       emc_seq_wait_clkchange(emc);
+
+       /* Restore AUTO_CAL */
+       if (timing->emc_ctt_term_ctrl != last->emc_ctt_term_ctrl)
+               writel(timing->emc_auto_cal_interval,
+                      emc->regs + EMC_AUTO_CAL_INTERVAL);
+
+       /* Restore dynamic self-refresh */
+       if (timing->emc_cfg & EMC_CFG_PWR_MASK)
+               writel(timing->emc_cfg, emc->regs + EMC_CFG);
+
+       /* Set ZCAL wait count */
+       writel(timing->emc_zcal_cnt_long, emc->regs + EMC_ZCAL_WAIT_CNT);
+
+       /* LPDDR3: Turn off BGBIAS if low frequency */
+       if (emc->dram_type == DRAM_TYPE_LPDDR3 &&
+           timing->emc_bgbias_ctl0 &
+             EMC_BGBIAS_CTL0_BIAS0_DSC_E_PWRD_IBIAS_RX) {
+               val = timing->emc_bgbias_ctl0;
+               val |= EMC_BGBIAS_CTL0_BIAS0_DSC_E_PWRD_IBIAS_VTTGEN;
+               val |= EMC_BGBIAS_CTL0_BIAS0_DSC_E_PWRD;
+               writel(val, emc->regs + EMC_BGBIAS_CTL0);
+       } else {
+               if (emc->dram_type == DRAM_TYPE_DDR3 &&
+                   readl(emc->regs + EMC_BGBIAS_CTL0) !=
+                     timing->emc_bgbias_ctl0) {
+                       writel(timing->emc_bgbias_ctl0,
+                              emc->regs + EMC_BGBIAS_CTL0);
+               }
+
+               writel(timing->emc_auto_cal_interval,
+                      emc->regs + EMC_AUTO_CAL_INTERVAL);
+       }
+
+       /* Wait for timing to settle */
+       udelay(2);
+
+       /* Reprogram SEL_DPD_CTRL */
+       writel(timing->emc_sel_dpd_ctrl, emc->regs + EMC_SEL_DPD_CTRL);
+       emc_seq_update_timing(emc);
+
+       emc->last_timing = *timing;
+}
+
+/* Initialization and deinitialization */
+
+static void emc_read_current_timing(struct tegra_emc *emc,
+                                   struct emc_timing *timing)
+{
+       unsigned int i;
+
+       for (i = 0; i < ARRAY_SIZE(emc_burst_regs); ++i)
+               timing->emc_burst_data[i] =
+                       readl(emc->regs + emc_burst_regs[i]);
+
+       timing->emc_cfg = readl(emc->regs + EMC_CFG);
+
+       timing->emc_auto_cal_interval = 0;
+       timing->emc_zcal_cnt_long = 0;
+       timing->emc_mode_1 = 0;
+       timing->emc_mode_2 = 0;
+       timing->emc_mode_4 = 0;
+       timing->emc_mode_reset = 0;
+}
+
+static int emc_init(struct tegra_emc *emc)
+{
+       emc->dram_type = readl(emc->regs + EMC_FBIO_CFG5);
+       emc->dram_type &= EMC_FBIO_CFG5_DRAM_TYPE_MASK;
+       emc->dram_type >>= EMC_FBIO_CFG5_DRAM_TYPE_SHIFT;
+
+       emc->dram_num = tegra_mc_get_emem_device_count(emc->mc);
+
+       emc_read_current_timing(emc, &emc->last_timing);
+
+       return 0;
+}
+
+static int load_one_timing_from_dt(struct tegra_emc *emc,
+                                  struct emc_timing *timing,
+                                  struct device_node *node)
+{
+       u32 value;
+       int err;
+
+       err = of_property_read_u32(node, "clock-frequency", &value);
+       if (err) {
+               dev_err(emc->dev, "timing %s: failed to read rate: %d\n",
+                       node->name, err);
+               return err;
+       }
+
+       timing->rate = value;
+
+       err = of_property_read_u32_array(node, "nvidia,emc-configuration",
+                                        timing->emc_burst_data,
+                                        ARRAY_SIZE(timing->emc_burst_data));
+       if (err) {
+               dev_err(emc->dev,
+                       "timing %s: failed to read emc burst data: %d\n",
+                       node->name, err);
+               return err;
+       }
+
+#define EMC_READ_PROP(prop, dtprop) { \
+       err = of_property_read_u32(node, dtprop, &timing->prop); \
+       if (err) { \
+               dev_err(emc->dev, "timing %s: failed to read " #prop ": %d\n", \
+                       node->name, err); \
+               return err; \
+       } \
+}
+
+       EMC_READ_PROP(emc_auto_cal_config, "nvidia,emc-auto-cal-config")
+       EMC_READ_PROP(emc_auto_cal_config2, "nvidia,emc-auto-cal-config2")
+       EMC_READ_PROP(emc_auto_cal_config3, "nvidia,emc-auto-cal-config3")
+       EMC_READ_PROP(emc_auto_cal_interval, "nvidia,emc-auto-cal-interval")
+       EMC_READ_PROP(emc_bgbias_ctl0, "nvidia,emc-bgbias-ctl0")
+       EMC_READ_PROP(emc_cfg, "nvidia,emc-cfg")
+       EMC_READ_PROP(emc_cfg_2, "nvidia,emc-cfg-2")
+       EMC_READ_PROP(emc_ctt_term_ctrl, "nvidia,emc-ctt-term-ctrl")
+       EMC_READ_PROP(emc_mode_1, "nvidia,emc-mode-1")
+       EMC_READ_PROP(emc_mode_2, "nvidia,emc-mode-2")
+       EMC_READ_PROP(emc_mode_4, "nvidia,emc-mode-4")
+       EMC_READ_PROP(emc_mode_reset, "nvidia,emc-mode-reset")
+       EMC_READ_PROP(emc_mrs_wait_cnt, "nvidia,emc-mrs-wait-cnt")
+       EMC_READ_PROP(emc_sel_dpd_ctrl, "nvidia,emc-sel-dpd-ctrl")
+       EMC_READ_PROP(emc_xm2dqspadctrl2, "nvidia,emc-xm2dqspadctrl2")
+       EMC_READ_PROP(emc_zcal_cnt_long, "nvidia,emc-zcal-cnt-long")
+       EMC_READ_PROP(emc_zcal_interval, "nvidia,emc-zcal-interval")
+
+#undef EMC_READ_PROP
+
+       return 0;
+}
+
+static int cmp_timings(const void *_a, const void *_b)
+{
+       const struct emc_timing *a = _a;
+       const struct emc_timing *b = _b;
+
+       if (a->rate < b->rate)
+               return -1;
+       else if (a->rate == b->rate)
+               return 0;
+       else
+               return 1;
+}
+
+static int tegra_emc_load_timings_from_dt(struct tegra_emc *emc,
+                                         struct device_node *node)
+{
+       int child_count = of_get_child_count(node);
+       struct device_node *child;
+       struct emc_timing *timing;
+       unsigned int i = 0;
+       int err;
+
+       emc->timings = devm_kcalloc(emc->dev, child_count, sizeof(*timing),
+                                   GFP_KERNEL);
+       if (!emc->timings)
+               return -ENOMEM;
+
+       emc->num_timings = child_count;
+
+       for_each_child_of_node(node, child) {
+               timing = &emc->timings[i++];
+
+               err = load_one_timing_from_dt(emc, timing, child);
+               if (err)
+                       return err;
+       }
+
+       sort(emc->timings, emc->num_timings, sizeof(*timing), cmp_timings,
+            NULL);
+
+       return 0;
+}
+
+static const struct of_device_id tegra_emc_of_match[] = {
+       { .compatible = "nvidia,tegra124-emc" },
+       {}
+};
+
+static struct device_node *
+tegra_emc_find_node_by_ram_code(struct device_node *node, u32 ram_code)
+{
+       struct device_node *np;
+       int err;
+
+       for_each_child_of_node(node, np) {
+               u32 value;
+
+               err = of_property_read_u32(np, "nvidia,ram-code", &value);
+               if (err || (value != ram_code)) {
+                       of_node_put(np);
+                       continue;
+               }
+
+               return np;
+       }
+
+       return NULL;
+}
+
+/* Debugfs entry */
+
+static int emc_debug_rate_get(void *data, u64 *rate)
+{
+       struct clk *c = data;
+
+       *rate = clk_get_rate(c);
+
+       return 0;
+}
+
+static int emc_debug_rate_set(void *data, u64 rate)
+{
+       struct clk *c = data;
+
+       return clk_set_rate(c, rate);
+}
+
+DEFINE_SIMPLE_ATTRIBUTE(emc_debug_rate_fops, emc_debug_rate_get,
+                       emc_debug_rate_set, "%lld\n");
+
+static void emc_debugfs_init(struct device *dev)
+{
+       struct dentry *root, *file;
+       struct clk *clk;
+
+       root = debugfs_create_dir("emc", NULL);
+       if (!root) {
+               dev_err(dev, "failed to create debugfs directory\n");
+               return;
+       }
+
+       clk = clk_get_sys("tegra-clk-debug", "emc");
+       if (IS_ERR(clk)) {
+               dev_err(dev, "failed to get debug clock: %ld\n", PTR_ERR(clk));
+               return;
+       }
+
+       file = debugfs_create_file("rate", S_IRUGO | S_IWUSR, root, clk,
+                                  &emc_debug_rate_fops);
+       if (!file)
+               dev_err(dev, "failed to create debugfs entry\n");
+}
+
+static int tegra_emc_probe(struct platform_device *pdev)
+{
+       struct platform_device *mc;
+       struct device_node *np;
+       struct tegra_emc *emc;
+       struct resource *res;
+       u32 ram_code;
+       int err;
+
+       emc = devm_kzalloc(&pdev->dev, sizeof(*emc), GFP_KERNEL);
+       if (!emc)
+               return -ENOMEM;
+
+       emc->dev = &pdev->dev;
+
+       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+       emc->regs = devm_ioremap_resource(&pdev->dev, res);
+       if (IS_ERR(emc->regs))
+               return PTR_ERR(emc->regs);
+
+       np = of_parse_phandle(pdev->dev.of_node, "nvidia,memory-controller", 0);
+       if (!np) {
+               dev_err(&pdev->dev, "could not get memory controller\n");
+               return -ENOENT;
+       }
+
+       mc = of_find_device_by_node(np);
+       if (!mc)
+               return -ENOENT;
+
+       of_node_put(np);
+
+       emc->mc = platform_get_drvdata(mc);
+       if (!emc->mc)
+               return -EPROBE_DEFER;
+
+       ram_code = tegra_read_ram_code();
+
+       np = tegra_emc_find_node_by_ram_code(pdev->dev.of_node, ram_code);
+       if (!np) {
+               dev_err(&pdev->dev,
+                       "no memory timings for RAM code %u found in DT\n",
+                       ram_code);
+               return -ENOENT;
+       }
+
+       err = tegra_emc_load_timings_from_dt(emc, np);
+
+       of_node_put(np);
+
+       if (err)
+               return err;
+
+       if (emc->num_timings == 0) {
+               dev_err(&pdev->dev,
+                       "no memory timings for RAM code %u registered\n",
+                       ram_code);
+               return -ENOENT;
+       }
+
+       err = emc_init(emc);
+       if (err) {
+               dev_err(&pdev->dev, "EMC initialization failed: %d\n", err);
+               return err;
+       }
+
+       platform_set_drvdata(pdev, emc);
+
+       if (IS_ENABLED(CONFIG_DEBUG_FS))
+               emc_debugfs_init(&pdev->dev);
+
+       return 0;
+};
+
+static struct platform_driver tegra_emc_driver = {
+       .probe = tegra_emc_probe,
+       .driver = {
+               .name = "tegra-emc",
+               .of_match_table = tegra_emc_of_match,
+               .suppress_bind_attrs = true,
+       },
+};
+
+static int tegra_emc_init(void)
+{
+       return platform_driver_register(&tegra_emc_driver);
+}
+subsys_initcall(tegra_emc_init);
index 278d40b854c15a6ae72629e9a5a83cd2539674d5..966e1557e6f414598868a8392b5487cb05e09f61 100644 (file)
 
 #include "mc.h"
 
+#define MC_EMEM_ARB_CFG                                0x90
+#define MC_EMEM_ARB_OUTSTANDING_REQ            0x94
+#define MC_EMEM_ARB_TIMING_RCD                 0x98
+#define MC_EMEM_ARB_TIMING_RP                  0x9c
+#define MC_EMEM_ARB_TIMING_RC                  0xa0
+#define MC_EMEM_ARB_TIMING_RAS                 0xa4
+#define MC_EMEM_ARB_TIMING_FAW                 0xa8
+#define MC_EMEM_ARB_TIMING_RRD                 0xac
+#define MC_EMEM_ARB_TIMING_RAP2PRE             0xb0
+#define MC_EMEM_ARB_TIMING_WAP2PRE             0xb4
+#define MC_EMEM_ARB_TIMING_R2R                 0xb8
+#define MC_EMEM_ARB_TIMING_W2W                 0xbc
+#define MC_EMEM_ARB_TIMING_R2W                 0xc0
+#define MC_EMEM_ARB_TIMING_W2R                 0xc4
+#define MC_EMEM_ARB_DA_TURNS                   0xd0
+#define MC_EMEM_ARB_DA_COVERS                  0xd4
+#define MC_EMEM_ARB_MISC0                      0xd8
+#define MC_EMEM_ARB_MISC1                      0xdc
+#define MC_EMEM_ARB_RING1_THROTTLE             0xe0
+
+static const unsigned long tegra124_mc_emem_regs[] = {
+       MC_EMEM_ARB_CFG,
+       MC_EMEM_ARB_OUTSTANDING_REQ,
+       MC_EMEM_ARB_TIMING_RCD,
+       MC_EMEM_ARB_TIMING_RP,
+       MC_EMEM_ARB_TIMING_RC,
+       MC_EMEM_ARB_TIMING_RAS,
+       MC_EMEM_ARB_TIMING_FAW,
+       MC_EMEM_ARB_TIMING_RRD,
+       MC_EMEM_ARB_TIMING_RAP2PRE,
+       MC_EMEM_ARB_TIMING_WAP2PRE,
+       MC_EMEM_ARB_TIMING_R2R,
+       MC_EMEM_ARB_TIMING_W2W,
+       MC_EMEM_ARB_TIMING_R2W,
+       MC_EMEM_ARB_TIMING_W2R,
+       MC_EMEM_ARB_DA_TURNS,
+       MC_EMEM_ARB_DA_COVERS,
+       MC_EMEM_ARB_MISC0,
+       MC_EMEM_ARB_MISC1,
+       MC_EMEM_ARB_RING1_THROTTLE
+};
+
 static const struct tegra_mc_client tegra124_mc_clients[] = {
        {
                .id = 0x00,
@@ -934,29 +976,29 @@ static const struct tegra_mc_client tegra124_mc_clients[] = {
 };
 
 static const struct tegra_smmu_swgroup tegra124_swgroups[] = {
-       { .swgroup = TEGRA_SWGROUP_DC,        .reg = 0x240 },
-       { .swgroup = TEGRA_SWGROUP_DCB,       .reg = 0x244 },
-       { .swgroup = TEGRA_SWGROUP_AFI,       .reg = 0x238 },
-       { .swgroup = TEGRA_SWGROUP_AVPC,      .reg = 0x23c },
-       { .swgroup = TEGRA_SWGROUP_HDA,       .reg = 0x254 },
-       { .swgroup = TEGRA_SWGROUP_HC,        .reg = 0x250 },
-       { .swgroup = TEGRA_SWGROUP_MSENC,     .reg = 0x264 },
-       { .swgroup = TEGRA_SWGROUP_PPCS,      .reg = 0x270 },
-       { .swgroup = TEGRA_SWGROUP_SATA,      .reg = 0x274 },
-       { .swgroup = TEGRA_SWGROUP_VDE,       .reg = 0x27c },
-       { .swgroup = TEGRA_SWGROUP_ISP2,      .reg = 0x258 },
-       { .swgroup = TEGRA_SWGROUP_XUSB_HOST, .reg = 0x288 },
-       { .swgroup = TEGRA_SWGROUP_XUSB_DEV,  .reg = 0x28c },
-       { .swgroup = TEGRA_SWGROUP_ISP2B,     .reg = 0xaa4 },
-       { .swgroup = TEGRA_SWGROUP_TSEC,      .reg = 0x294 },
-       { .swgroup = TEGRA_SWGROUP_A9AVP,     .reg = 0x290 },
-       { .swgroup = TEGRA_SWGROUP_GPU,       .reg = 0xaac },
-       { .swgroup = TEGRA_SWGROUP_SDMMC1A,   .reg = 0xa94 },
-       { .swgroup = TEGRA_SWGROUP_SDMMC2A,   .reg = 0xa98 },
-       { .swgroup = TEGRA_SWGROUP_SDMMC3A,   .reg = 0xa9c },
-       { .swgroup = TEGRA_SWGROUP_SDMMC4A,   .reg = 0xaa0 },
-       { .swgroup = TEGRA_SWGROUP_VIC,       .reg = 0x284 },
-       { .swgroup = TEGRA_SWGROUP_VI,        .reg = 0x280 },
+       { .name = "dc",        .swgroup = TEGRA_SWGROUP_DC,        .reg = 0x240 },
+       { .name = "dcb",       .swgroup = TEGRA_SWGROUP_DCB,       .reg = 0x244 },
+       { .name = "afi",       .swgroup = TEGRA_SWGROUP_AFI,       .reg = 0x238 },
+       { .name = "avpc",      .swgroup = TEGRA_SWGROUP_AVPC,      .reg = 0x23c },
+       { .name = "hda",       .swgroup = TEGRA_SWGROUP_HDA,       .reg = 0x254 },
+       { .name = "hc",        .swgroup = TEGRA_SWGROUP_HC,        .reg = 0x250 },
+       { .name = "msenc",     .swgroup = TEGRA_SWGROUP_MSENC,     .reg = 0x264 },
+       { .name = "ppcs",      .swgroup = TEGRA_SWGROUP_PPCS,      .reg = 0x270 },
+       { .name = "sata",      .swgroup = TEGRA_SWGROUP_SATA,      .reg = 0x274 },
+       { .name = "vde",       .swgroup = TEGRA_SWGROUP_VDE,       .reg = 0x27c },
+       { .name = "isp2",      .swgroup = TEGRA_SWGROUP_ISP2,      .reg = 0x258 },
+       { .name = "xusb_host", .swgroup = TEGRA_SWGROUP_XUSB_HOST, .reg = 0x288 },
+       { .name = "xusb_dev",  .swgroup = TEGRA_SWGROUP_XUSB_DEV,  .reg = 0x28c },
+       { .name = "isp2b",     .swgroup = TEGRA_SWGROUP_ISP2B,     .reg = 0xaa4 },
+       { .name = "tsec",      .swgroup = TEGRA_SWGROUP_TSEC,      .reg = 0x294 },
+       { .name = "a9avp",     .swgroup = TEGRA_SWGROUP_A9AVP,     .reg = 0x290 },
+       { .name = "gpu",       .swgroup = TEGRA_SWGROUP_GPU,       .reg = 0xaac },
+       { .name = "sdmmc1a",   .swgroup = TEGRA_SWGROUP_SDMMC1A,   .reg = 0xa94 },
+       { .name = "sdmmc2a",   .swgroup = TEGRA_SWGROUP_SDMMC2A,   .reg = 0xa98 },
+       { .name = "sdmmc3a",   .swgroup = TEGRA_SWGROUP_SDMMC3A,   .reg = 0xa9c },
+       { .name = "sdmmc4a",   .swgroup = TEGRA_SWGROUP_SDMMC4A,   .reg = 0xaa0 },
+       { .name = "vic",       .swgroup = TEGRA_SWGROUP_VIC,       .reg = 0x284 },
+       { .name = "vi",        .swgroup = TEGRA_SWGROUP_VI,        .reg = 0x280 },
 };
 
 #ifdef CONFIG_ARCH_TEGRA_124_SOC
@@ -991,5 +1033,40 @@ const struct tegra_mc_soc tegra124_mc_soc = {
        .num_address_bits = 34,
        .atom_size = 32,
        .smmu = &tegra124_smmu_soc,
+       .emem_regs = tegra124_mc_emem_regs,
+       .num_emem_regs = ARRAY_SIZE(tegra124_mc_emem_regs),
 };
 #endif /* CONFIG_ARCH_TEGRA_124_SOC */
+
+#ifdef CONFIG_ARCH_TEGRA_132_SOC
+static void tegra132_flush_dcache(struct page *page, unsigned long offset,
+                                 size_t size)
+{
+       void *virt = page_address(page) + offset;
+
+       __flush_dcache_area(virt, size);
+}
+
+static const struct tegra_smmu_ops tegra132_smmu_ops = {
+       .flush_dcache = tegra132_flush_dcache,
+};
+
+static const struct tegra_smmu_soc tegra132_smmu_soc = {
+       .clients = tegra124_mc_clients,
+       .num_clients = ARRAY_SIZE(tegra124_mc_clients),
+       .swgroups = tegra124_swgroups,
+       .num_swgroups = ARRAY_SIZE(tegra124_swgroups),
+       .supports_round_robin_arbitration = true,
+       .supports_request_limit = true,
+       .num_asids = 128,
+       .ops = &tegra132_smmu_ops,
+};
+
+const struct tegra_mc_soc tegra132_mc_soc = {
+       .clients = tegra124_mc_clients,
+       .num_clients = ARRAY_SIZE(tegra124_mc_clients),
+       .num_address_bits = 34,
+       .atom_size = 32,
+       .smmu = &tegra132_smmu_soc,
+};
+#endif /* CONFIG_ARCH_TEGRA_132_SOC */
index 71fe9376fe53379180c4256b47ec15f576ab2f67..1abcd8f6f3ba60ed6cdabcc28478123061af0b63 100644 (file)
@@ -918,22 +918,22 @@ static const struct tegra_mc_client tegra30_mc_clients[] = {
 };
 
 static const struct tegra_smmu_swgroup tegra30_swgroups[] = {
-       { .swgroup = TEGRA_SWGROUP_DC,   .reg = 0x240 },
-       { .swgroup = TEGRA_SWGROUP_DCB,  .reg = 0x244 },
-       { .swgroup = TEGRA_SWGROUP_EPP,  .reg = 0x248 },
-       { .swgroup = TEGRA_SWGROUP_G2,   .reg = 0x24c },
-       { .swgroup = TEGRA_SWGROUP_MPE,  .reg = 0x264 },
-       { .swgroup = TEGRA_SWGROUP_VI,   .reg = 0x280 },
-       { .swgroup = TEGRA_SWGROUP_AFI,  .reg = 0x238 },
-       { .swgroup = TEGRA_SWGROUP_AVPC, .reg = 0x23c },
-       { .swgroup = TEGRA_SWGROUP_NV,   .reg = 0x268 },
-       { .swgroup = TEGRA_SWGROUP_NV2,  .reg = 0x26c },
-       { .swgroup = TEGRA_SWGROUP_HDA,  .reg = 0x254 },
-       { .swgroup = TEGRA_SWGROUP_HC,   .reg = 0x250 },
-       { .swgroup = TEGRA_SWGROUP_PPCS, .reg = 0x270 },
-       { .swgroup = TEGRA_SWGROUP_SATA, .reg = 0x278 },
-       { .swgroup = TEGRA_SWGROUP_VDE,  .reg = 0x27c },
-       { .swgroup = TEGRA_SWGROUP_ISP,  .reg = 0x258 },
+       { .name = "dc",   .swgroup = TEGRA_SWGROUP_DC,   .reg = 0x240 },
+       { .name = "dcb",  .swgroup = TEGRA_SWGROUP_DCB,  .reg = 0x244 },
+       { .name = "epp",  .swgroup = TEGRA_SWGROUP_EPP,  .reg = 0x248 },
+       { .name = "g2",   .swgroup = TEGRA_SWGROUP_G2,   .reg = 0x24c },
+       { .name = "mpe",  .swgroup = TEGRA_SWGROUP_MPE,  .reg = 0x264 },
+       { .name = "vi",   .swgroup = TEGRA_SWGROUP_VI,   .reg = 0x280 },
+       { .name = "afi",  .swgroup = TEGRA_SWGROUP_AFI,  .reg = 0x238 },
+       { .name = "avpc", .swgroup = TEGRA_SWGROUP_AVPC, .reg = 0x23c },
+       { .name = "nv",   .swgroup = TEGRA_SWGROUP_NV,   .reg = 0x268 },
+       { .name = "nv2",  .swgroup = TEGRA_SWGROUP_NV2,  .reg = 0x26c },
+       { .name = "hda",  .swgroup = TEGRA_SWGROUP_HDA,  .reg = 0x254 },
+       { .name = "hc",   .swgroup = TEGRA_SWGROUP_HC,   .reg = 0x250 },
+       { .name = "ppcs", .swgroup = TEGRA_SWGROUP_PPCS, .reg = 0x270 },
+       { .name = "sata", .swgroup = TEGRA_SWGROUP_SATA, .reg = 0x278 },
+       { .name = "vde",  .swgroup = TEGRA_SWGROUP_VDE,  .reg = 0x27c },
+       { .name = "isp",  .swgroup = TEGRA_SWGROUP_ISP,  .reg = 0x258 },
 };
 
 static void tegra30_flush_dcache(struct page *page, unsigned long offset,
index db84ddcfec8464191a3edcccfd87c869ac1c5a7c..9fd6c69a8bac3c77d1c0c6e99eb4f3644561f78a 100644 (file)
@@ -423,7 +423,7 @@ static void xgbe_tx_timer(unsigned long data)
        if (napi_schedule_prep(napi)) {
                /* Disable Tx and Rx interrupts */
                if (pdata->per_channel_irq)
-                       disable_irq(channel->dma_irq);
+                       disable_irq_nosync(channel->dma_irq);
                else
                        xgbe_disable_rx_tx_ints(pdata);
 
index 77363d6805321534a582e579552f46e254737e25..a3b1c07ae0af0935f3026ba8a56e21512e238e36 100644 (file)
@@ -2464,6 +2464,7 @@ err_out_powerdown:
        ssb_bus_may_powerdown(sdev->bus);
 
 err_out_free_dev:
+       netif_napi_del(&bp->napi);
        free_netdev(dev);
 
 out:
@@ -2480,6 +2481,7 @@ static void b44_remove_one(struct ssb_device *sdev)
                b44_unregister_phy_one(bp);
        ssb_device_disable(sdev, 0);
        ssb_bus_may_powerdown(sdev->bus);
+       netif_napi_del(&bp->napi);
        free_netdev(dev);
        ssb_pcihost_set_power_state(sdev, PCI_D3hot);
        ssb_set_drvdata(sdev, NULL);
index e7651b3c6c5767f7609115ef0430c13aac8d17a9..420949cc55aab6349b75c33f0c4f061aa384d537 100644 (file)
@@ -299,9 +299,6 @@ int bcmgenet_mii_config(struct net_device *dev, bool init)
                        phy_name = "external RGMII (no delay)";
                else
                        phy_name = "external RGMII (TX delay)";
-               reg = bcmgenet_ext_readl(priv, EXT_RGMII_OOB_CTRL);
-               reg |= RGMII_MODE_EN | id_mode_dis;
-               bcmgenet_ext_writel(priv, reg, EXT_RGMII_OOB_CTRL);
                bcmgenet_sys_writel(priv,
                                    PORT_MODE_EXT_GPHY, SYS_PORT_CTRL);
                break;
@@ -310,6 +307,15 @@ int bcmgenet_mii_config(struct net_device *dev, bool init)
                return -EINVAL;
        }
 
+       /* This is an external PHY (xMII), so we need to enable the RGMII
+        * block for the interface to work
+        */
+       if (priv->ext_phy) {
+               reg = bcmgenet_ext_readl(priv, EXT_RGMII_OOB_CTRL);
+               reg |= RGMII_MODE_EN | id_mode_dis;
+               bcmgenet_ext_writel(priv, reg, EXT_RGMII_OOB_CTRL);
+       }
+
        if (init)
                dev_info(kdev, "configuring instance for %s\n", phy_name);
 
index 28d9ca675a274f9876473bcce7e6995a14e1289e..68d47b196daec3d3c5d0b8af19f8d167735e1e79 100644 (file)
@@ -131,8 +131,15 @@ static void enic_get_drvinfo(struct net_device *netdev,
 {
        struct enic *enic = netdev_priv(netdev);
        struct vnic_devcmd_fw_info *fw_info;
+       int err;
 
-       enic_dev_fw_info(enic, &fw_info);
+       err = enic_dev_fw_info(enic, &fw_info);
+       /* return only when pci_zalloc_consistent fails in vnic_dev_fw_info
+        * For other failures, like devcmd failure, we return previously
+        * recorded info.
+        */
+       if (err == -ENOMEM)
+               return;
 
        strlcpy(drvinfo->driver, DRV_NAME, sizeof(drvinfo->driver));
        strlcpy(drvinfo->version, DRV_VERSION, sizeof(drvinfo->version));
@@ -181,8 +188,15 @@ static void enic_get_ethtool_stats(struct net_device *netdev,
        struct enic *enic = netdev_priv(netdev);
        struct vnic_stats *vstats;
        unsigned int i;
-
-       enic_dev_stats_dump(enic, &vstats);
+       int err;
+
+       err = enic_dev_stats_dump(enic, &vstats);
+       /* return only when pci_zalloc_consistent fails in vnic_dev_stats_dump
+        * For other failures, like devcmd failure, we return previously
+        * recorded stats.
+        */
+       if (err == -ENOMEM)
+               return;
 
        for (i = 0; i < enic_n_tx_stats; i++)
                *(data++) = ((u64 *)&vstats->tx)[enic_tx_stats[i].index];
index 204bd182473bceaaabaa5b1eba5ed618de751808..eadae1b412c652974dde24a9a76c5d74a8c3fa29 100644 (file)
@@ -615,8 +615,15 @@ static struct rtnl_link_stats64 *enic_get_stats(struct net_device *netdev,
 {
        struct enic *enic = netdev_priv(netdev);
        struct vnic_stats *stats;
+       int err;
 
-       enic_dev_stats_dump(enic, &stats);
+       err = enic_dev_stats_dump(enic, &stats);
+       /* return only when pci_zalloc_consistent fails in vnic_dev_stats_dump
+        * For other failures, like devcmd failure, we return previously
+        * recorded stats.
+        */
+       if (err == -ENOMEM)
+               return net_stats;
 
        net_stats->tx_packets = stats->tx.tx_frames_ok;
        net_stats->tx_bytes = stats->tx.tx_bytes_ok;
@@ -1407,6 +1414,7 @@ static int enic_poll_msix_rq(struct napi_struct *napi, int budget)
                 */
                enic_calc_int_moderation(enic, &enic->rq[rq]);
 
+       enic_poll_unlock_napi(&enic->rq[rq]);
        if (work_done < work_to_do) {
 
                /* Some work done, but not enough to stay in polling,
@@ -1418,7 +1426,6 @@ static int enic_poll_msix_rq(struct napi_struct *napi, int budget)
                        enic_set_int_moderation(enic, &enic->rq[rq]);
                vnic_intr_unmask(&enic->intr[intr]);
        }
-       enic_poll_unlock_napi(&enic->rq[rq]);
 
        return work_done;
 }
index 36a2ed606c911f21355360fad81eb39b18162c59..c4b2183bf352fb2a1881001777df91857c2d1f79 100644 (file)
@@ -188,16 +188,15 @@ void vnic_rq_clean(struct vnic_rq *rq,
        struct vnic_rq_buf *buf;
        u32 fetch_index;
        unsigned int count = rq->ring.desc_count;
+       int i;
 
        buf = rq->to_clean;
 
-       while (vnic_rq_desc_used(rq) > 0) {
-
+       for (i = 0; i < rq->ring.desc_count; i++) {
                (*buf_clean)(rq, buf);
-
-               buf = rq->to_clean = buf->next;
-               rq->ring.desc_avail++;
+               buf = buf->next;
        }
+       rq->ring.desc_avail = rq->ring.desc_count - 1;
 
        /* Use current fetch_index as the ring starting point */
        fetch_index = ioread32(&rq->ctrl->fetch_index);
index fb140faeafb1cbda612cd11a9a1aac04e936c4a3..c5e1d0ac75f909f843dd0397ad41b85eeb26a164 100644 (file)
@@ -1720,9 +1720,9 @@ int be_cmd_get_regs(struct be_adapter *adapter, u32 buf_len, void *buf)
        total_size = buf_len;
 
        get_fat_cmd.size = sizeof(struct be_cmd_req_get_fat) + 60*1024;
-       get_fat_cmd.va = pci_alloc_consistent(adapter->pdev,
-                                             get_fat_cmd.size,
-                                             &get_fat_cmd.dma);
+       get_fat_cmd.va = dma_zalloc_coherent(&adapter->pdev->dev,
+                                            get_fat_cmd.size,
+                                            &get_fat_cmd.dma, GFP_ATOMIC);
        if (!get_fat_cmd.va) {
                dev_err(&adapter->pdev->dev,
                        "Memory allocation failure while reading FAT data\n");
@@ -1767,8 +1767,8 @@ int be_cmd_get_regs(struct be_adapter *adapter, u32 buf_len, void *buf)
                log_offset += buf_size;
        }
 err:
-       pci_free_consistent(adapter->pdev, get_fat_cmd.size,
-                           get_fat_cmd.va, get_fat_cmd.dma);
+       dma_free_coherent(&adapter->pdev->dev, get_fat_cmd.size,
+                         get_fat_cmd.va, get_fat_cmd.dma);
        spin_unlock_bh(&adapter->mcc_lock);
        return status;
 }
@@ -2215,12 +2215,12 @@ int be_cmd_read_port_transceiver_data(struct be_adapter *adapter,
                return -EINVAL;
 
        cmd.size = sizeof(struct be_cmd_resp_port_type);
-       cmd.va = pci_alloc_consistent(adapter->pdev, cmd.size, &cmd.dma);
+       cmd.va = dma_zalloc_coherent(&adapter->pdev->dev, cmd.size, &cmd.dma,
+                                    GFP_ATOMIC);
        if (!cmd.va) {
                dev_err(&adapter->pdev->dev, "Memory allocation failed\n");
                return -ENOMEM;
        }
-       memset(cmd.va, 0, cmd.size);
 
        spin_lock_bh(&adapter->mcc_lock);
 
@@ -2245,7 +2245,7 @@ int be_cmd_read_port_transceiver_data(struct be_adapter *adapter,
        }
 err:
        spin_unlock_bh(&adapter->mcc_lock);
-       pci_free_consistent(adapter->pdev, cmd.size, cmd.va, cmd.dma);
+       dma_free_coherent(&adapter->pdev->dev, cmd.size, cmd.va, cmd.dma);
        return status;
 }
 
@@ -2720,7 +2720,8 @@ int be_cmd_get_phy_info(struct be_adapter *adapter)
                goto err;
        }
        cmd.size = sizeof(struct be_cmd_req_get_phy_info);
-       cmd.va = pci_alloc_consistent(adapter->pdev, cmd.size, &cmd.dma);
+       cmd.va = dma_zalloc_coherent(&adapter->pdev->dev, cmd.size, &cmd.dma,
+                                    GFP_ATOMIC);
        if (!cmd.va) {
                dev_err(&adapter->pdev->dev, "Memory alloc failure\n");
                status = -ENOMEM;
@@ -2754,7 +2755,7 @@ int be_cmd_get_phy_info(struct be_adapter *adapter)
                                BE_SUPPORTED_SPEED_1GBPS;
                }
        }
-       pci_free_consistent(adapter->pdev, cmd.size, cmd.va, cmd.dma);
+       dma_free_coherent(&adapter->pdev->dev, cmd.size, cmd.va, cmd.dma);
 err:
        spin_unlock_bh(&adapter->mcc_lock);
        return status;
@@ -2805,8 +2806,9 @@ int be_cmd_get_cntl_attributes(struct be_adapter *adapter)
 
        memset(&attribs_cmd, 0, sizeof(struct be_dma_mem));
        attribs_cmd.size = sizeof(struct be_cmd_resp_cntl_attribs);
-       attribs_cmd.va = pci_alloc_consistent(adapter->pdev, attribs_cmd.size,
-                                             &attribs_cmd.dma);
+       attribs_cmd.va = dma_zalloc_coherent(&adapter->pdev->dev,
+                                            attribs_cmd.size,
+                                            &attribs_cmd.dma, GFP_ATOMIC);
        if (!attribs_cmd.va) {
                dev_err(&adapter->pdev->dev, "Memory allocation failure\n");
                status = -ENOMEM;
@@ -2833,8 +2835,8 @@ int be_cmd_get_cntl_attributes(struct be_adapter *adapter)
 err:
        mutex_unlock(&adapter->mbox_lock);
        if (attribs_cmd.va)
-               pci_free_consistent(adapter->pdev, attribs_cmd.size,
-                                   attribs_cmd.va, attribs_cmd.dma);
+               dma_free_coherent(&adapter->pdev->dev, attribs_cmd.size,
+                                 attribs_cmd.va, attribs_cmd.dma);
        return status;
 }
 
@@ -2972,9 +2974,10 @@ int be_cmd_get_mac_from_list(struct be_adapter *adapter, u8 *mac,
 
        memset(&get_mac_list_cmd, 0, sizeof(struct be_dma_mem));
        get_mac_list_cmd.size = sizeof(struct be_cmd_resp_get_mac_list);
-       get_mac_list_cmd.va = pci_alloc_consistent(adapter->pdev,
-                                                  get_mac_list_cmd.size,
-                                                  &get_mac_list_cmd.dma);
+       get_mac_list_cmd.va = dma_zalloc_coherent(&adapter->pdev->dev,
+                                                 get_mac_list_cmd.size,
+                                                 &get_mac_list_cmd.dma,
+                                                 GFP_ATOMIC);
 
        if (!get_mac_list_cmd.va) {
                dev_err(&adapter->pdev->dev,
@@ -3047,8 +3050,8 @@ int be_cmd_get_mac_from_list(struct be_adapter *adapter, u8 *mac,
 
 out:
        spin_unlock_bh(&adapter->mcc_lock);
-       pci_free_consistent(adapter->pdev, get_mac_list_cmd.size,
-                           get_mac_list_cmd.va, get_mac_list_cmd.dma);
+       dma_free_coherent(&adapter->pdev->dev, get_mac_list_cmd.size,
+                         get_mac_list_cmd.va, get_mac_list_cmd.dma);
        return status;
 }
 
@@ -3101,8 +3104,8 @@ int be_cmd_set_mac_list(struct be_adapter *adapter, u8 *mac_array,
 
        memset(&cmd, 0, sizeof(struct be_dma_mem));
        cmd.size = sizeof(struct be_cmd_req_set_mac_list);
-       cmd.va = dma_alloc_coherent(&adapter->pdev->dev, cmd.size,
-                                   &cmd.dma, GFP_KERNEL);
+       cmd.va = dma_zalloc_coherent(&adapter->pdev->dev, cmd.size, &cmd.dma,
+                                    GFP_KERNEL);
        if (!cmd.va)
                return -ENOMEM;
 
@@ -3291,7 +3294,8 @@ int be_cmd_get_acpi_wol_cap(struct be_adapter *adapter)
 
        memset(&cmd, 0, sizeof(struct be_dma_mem));
        cmd.size = sizeof(struct be_cmd_resp_acpi_wol_magic_config_v1);
-       cmd.va = pci_alloc_consistent(adapter->pdev, cmd.size, &cmd.dma);
+       cmd.va = dma_zalloc_coherent(&adapter->pdev->dev, cmd.size, &cmd.dma,
+                                    GFP_ATOMIC);
        if (!cmd.va) {
                dev_err(&adapter->pdev->dev, "Memory allocation failure\n");
                status = -ENOMEM;
@@ -3326,7 +3330,8 @@ int be_cmd_get_acpi_wol_cap(struct be_adapter *adapter)
 err:
        mutex_unlock(&adapter->mbox_lock);
        if (cmd.va)
-               pci_free_consistent(adapter->pdev, cmd.size, cmd.va, cmd.dma);
+               dma_free_coherent(&adapter->pdev->dev, cmd.size, cmd.va,
+                                 cmd.dma);
        return status;
 
 }
@@ -3340,8 +3345,9 @@ int be_cmd_set_fw_log_level(struct be_adapter *adapter, u32 level)
 
        memset(&extfat_cmd, 0, sizeof(struct be_dma_mem));
        extfat_cmd.size = sizeof(struct be_cmd_resp_get_ext_fat_caps);
-       extfat_cmd.va = pci_alloc_consistent(adapter->pdev, extfat_cmd.size,
-                                            &extfat_cmd.dma);
+       extfat_cmd.va = dma_zalloc_coherent(&adapter->pdev->dev,
+                                           extfat_cmd.size, &extfat_cmd.dma,
+                                           GFP_ATOMIC);
        if (!extfat_cmd.va)
                return -ENOMEM;
 
@@ -3363,8 +3369,8 @@ int be_cmd_set_fw_log_level(struct be_adapter *adapter, u32 level)
 
        status = be_cmd_set_ext_fat_capabilites(adapter, &extfat_cmd, cfgs);
 err:
-       pci_free_consistent(adapter->pdev, extfat_cmd.size, extfat_cmd.va,
-                           extfat_cmd.dma);
+       dma_free_coherent(&adapter->pdev->dev, extfat_cmd.size, extfat_cmd.va,
+                         extfat_cmd.dma);
        return status;
 }
 
@@ -3377,8 +3383,9 @@ int be_cmd_get_fw_log_level(struct be_adapter *adapter)
 
        memset(&extfat_cmd, 0, sizeof(struct be_dma_mem));
        extfat_cmd.size = sizeof(struct be_cmd_resp_get_ext_fat_caps);
-       extfat_cmd.va = pci_alloc_consistent(adapter->pdev, extfat_cmd.size,
-                                            &extfat_cmd.dma);
+       extfat_cmd.va = dma_zalloc_coherent(&adapter->pdev->dev,
+                                           extfat_cmd.size, &extfat_cmd.dma,
+                                           GFP_ATOMIC);
 
        if (!extfat_cmd.va) {
                dev_err(&adapter->pdev->dev, "%s: Memory allocation failure\n",
@@ -3396,8 +3403,8 @@ int be_cmd_get_fw_log_level(struct be_adapter *adapter)
                                level = cfgs->module[0].trace_lvl[j].dbg_lvl;
                }
        }
-       pci_free_consistent(adapter->pdev, extfat_cmd.size, extfat_cmd.va,
-                           extfat_cmd.dma);
+       dma_free_coherent(&adapter->pdev->dev, extfat_cmd.size, extfat_cmd.va,
+                         extfat_cmd.dma);
 err:
        return level;
 }
@@ -3595,7 +3602,8 @@ int be_cmd_get_func_config(struct be_adapter *adapter, struct be_resources *res)
 
        memset(&cmd, 0, sizeof(struct be_dma_mem));
        cmd.size = sizeof(struct be_cmd_resp_get_func_config);
-       cmd.va = pci_alloc_consistent(adapter->pdev, cmd.size, &cmd.dma);
+       cmd.va = dma_zalloc_coherent(&adapter->pdev->dev, cmd.size, &cmd.dma,
+                                    GFP_ATOMIC);
        if (!cmd.va) {
                dev_err(&adapter->pdev->dev, "Memory alloc failure\n");
                status = -ENOMEM;
@@ -3635,7 +3643,8 @@ int be_cmd_get_func_config(struct be_adapter *adapter, struct be_resources *res)
 err:
        mutex_unlock(&adapter->mbox_lock);
        if (cmd.va)
-               pci_free_consistent(adapter->pdev, cmd.size, cmd.va, cmd.dma);
+               dma_free_coherent(&adapter->pdev->dev, cmd.size, cmd.va,
+                                 cmd.dma);
        return status;
 }
 
@@ -3656,7 +3665,8 @@ int be_cmd_get_profile_config(struct be_adapter *adapter,
 
        memset(&cmd, 0, sizeof(struct be_dma_mem));
        cmd.size = sizeof(struct be_cmd_resp_get_profile_config);
-       cmd.va = pci_alloc_consistent(adapter->pdev, cmd.size, &cmd.dma);
+       cmd.va = dma_zalloc_coherent(&adapter->pdev->dev, cmd.size, &cmd.dma,
+                                    GFP_ATOMIC);
        if (!cmd.va)
                return -ENOMEM;
 
@@ -3702,7 +3712,8 @@ int be_cmd_get_profile_config(struct be_adapter *adapter,
                res->vf_if_cap_flags = vf_res->cap_flags;
 err:
        if (cmd.va)
-               pci_free_consistent(adapter->pdev, cmd.size, cmd.va, cmd.dma);
+               dma_free_coherent(&adapter->pdev->dev, cmd.size, cmd.va,
+                                 cmd.dma);
        return status;
 }
 
@@ -3717,7 +3728,8 @@ static int be_cmd_set_profile_config(struct be_adapter *adapter, void *desc,
 
        memset(&cmd, 0, sizeof(struct be_dma_mem));
        cmd.size = sizeof(struct be_cmd_req_set_profile_config);
-       cmd.va = pci_alloc_consistent(adapter->pdev, cmd.size, &cmd.dma);
+       cmd.va = dma_zalloc_coherent(&adapter->pdev->dev, cmd.size, &cmd.dma,
+                                    GFP_ATOMIC);
        if (!cmd.va)
                return -ENOMEM;
 
@@ -3733,7 +3745,8 @@ static int be_cmd_set_profile_config(struct be_adapter *adapter, void *desc,
        status = be_cmd_notify_wait(adapter, &wrb);
 
        if (cmd.va)
-               pci_free_consistent(adapter->pdev, cmd.size, cmd.va, cmd.dma);
+               dma_free_coherent(&adapter->pdev->dev, cmd.size, cmd.va,
+                                 cmd.dma);
        return status;
 }
 
index b765c24625bf523fd7932be17f6dfa22840a8e46..2835dee5dc3930cc5d1d09ec958bd2557228a2cd 100644 (file)
@@ -264,8 +264,8 @@ static int lancer_cmd_read_file(struct be_adapter *adapter, u8 *file_name,
        int status = 0;
 
        read_cmd.size = LANCER_READ_FILE_CHUNK;
-       read_cmd.va = pci_alloc_consistent(adapter->pdev, read_cmd.size,
-                                          &read_cmd.dma);
+       read_cmd.va = dma_zalloc_coherent(&adapter->pdev->dev, read_cmd.size,
+                                         &read_cmd.dma, GFP_ATOMIC);
 
        if (!read_cmd.va) {
                dev_err(&adapter->pdev->dev,
@@ -289,8 +289,8 @@ static int lancer_cmd_read_file(struct be_adapter *adapter, u8 *file_name,
                        break;
                }
        }
-       pci_free_consistent(adapter->pdev, read_cmd.size, read_cmd.va,
-                           read_cmd.dma);
+       dma_free_coherent(&adapter->pdev->dev, read_cmd.size, read_cmd.va,
+                         read_cmd.dma);
 
        return status;
 }
@@ -818,8 +818,9 @@ static int be_test_ddr_dma(struct be_adapter *adapter)
        };
 
        ddrdma_cmd.size = sizeof(struct be_cmd_req_ddrdma_test);
-       ddrdma_cmd.va = dma_alloc_coherent(&adapter->pdev->dev, ddrdma_cmd.size,
-                                          &ddrdma_cmd.dma, GFP_KERNEL);
+       ddrdma_cmd.va = dma_zalloc_coherent(&adapter->pdev->dev,
+                                           ddrdma_cmd.size, &ddrdma_cmd.dma,
+                                           GFP_KERNEL);
        if (!ddrdma_cmd.va)
                return -ENOMEM;
 
@@ -941,8 +942,9 @@ static int be_read_eeprom(struct net_device *netdev,
 
        memset(&eeprom_cmd, 0, sizeof(struct be_dma_mem));
        eeprom_cmd.size = sizeof(struct be_cmd_req_seeprom_read);
-       eeprom_cmd.va = dma_alloc_coherent(&adapter->pdev->dev, eeprom_cmd.size,
-                                          &eeprom_cmd.dma, GFP_KERNEL);
+       eeprom_cmd.va = dma_zalloc_coherent(&adapter->pdev->dev,
+                                           eeprom_cmd.size, &eeprom_cmd.dma,
+                                           GFP_KERNEL);
 
        if (!eeprom_cmd.va)
                return -ENOMEM;
index 6f9ffb9026cd56825f90e0c300aab1c8cd2a7739..e43cc8a73ea7e85a927443c077c18ce6c673751a 100644 (file)
@@ -4605,8 +4605,8 @@ static int lancer_fw_download(struct be_adapter *adapter,
 
        flash_cmd.size = sizeof(struct lancer_cmd_req_write_object)
                                + LANCER_FW_DOWNLOAD_CHUNK;
-       flash_cmd.va = dma_alloc_coherent(dev, flash_cmd.size,
-                                         &flash_cmd.dma, GFP_KERNEL);
+       flash_cmd.va = dma_zalloc_coherent(dev, flash_cmd.size,
+                                          &flash_cmd.dma, GFP_KERNEL);
        if (!flash_cmd.va)
                return -ENOMEM;
 
@@ -4739,8 +4739,8 @@ static int be_fw_download(struct be_adapter *adapter, const struct firmware* fw)
        }
 
        flash_cmd.size = sizeof(struct be_cmd_write_flashrom);
-       flash_cmd.va = dma_alloc_coherent(dev, flash_cmd.size, &flash_cmd.dma,
-                                         GFP_KERNEL);
+       flash_cmd.va = dma_zalloc_coherent(dev, flash_cmd.size, &flash_cmd.dma,
+                                          GFP_KERNEL);
        if (!flash_cmd.va)
                return -ENOMEM;
 
@@ -5291,16 +5291,15 @@ static int be_drv_init(struct be_adapter *adapter)
        int status = 0;
 
        mbox_mem_alloc->size = sizeof(struct be_mcc_mailbox) + 16;
-       mbox_mem_alloc->va = dma_alloc_coherent(dev, mbox_mem_alloc->size,
-                                               &mbox_mem_alloc->dma,
-                                               GFP_KERNEL);
+       mbox_mem_alloc->va = dma_zalloc_coherent(dev, mbox_mem_alloc->size,
+                                                &mbox_mem_alloc->dma,
+                                                GFP_KERNEL);
        if (!mbox_mem_alloc->va)
                return -ENOMEM;
 
        mbox_mem_align->size = sizeof(struct be_mcc_mailbox);
        mbox_mem_align->va = PTR_ALIGN(mbox_mem_alloc->va, 16);
        mbox_mem_align->dma = PTR_ALIGN(mbox_mem_alloc->dma, 16);
-       memset(mbox_mem_align->va, 0, sizeof(struct be_mcc_mailbox));
 
        rx_filter->size = sizeof(struct be_cmd_req_rx_filter);
        rx_filter->va = dma_zalloc_coherent(dev, rx_filter->size,
index 33c35d3b7420fa9ae545aea4ebd5160036914718..5d47307121abbe413cd259ff74f9aa2ee68e6c45 100644 (file)
@@ -317,6 +317,7 @@ struct i40e_pf {
 #endif
 #define I40E_FLAG_PORT_ID_VALID                (u64)(1 << 28)
 #define I40E_FLAG_DCB_CAPABLE                  (u64)(1 << 29)
+#define I40E_FLAG_VEB_MODE_ENABLED             BIT_ULL(40)
 
        /* tracks features that get auto disabled by errors */
        u64 auto_disable_flags;
index 34170eabca7da939ba1c8b9b5fad14dc2f54370d..da0faf478af076199e4281b0f3da57ad92c5e62b 100644 (file)
@@ -1021,6 +1021,15 @@ static ssize_t i40e_dbg_command_write(struct file *filp,
                        goto command_write_done;
                }
 
+               /* By default we are in VEPA mode, if this is the first VF/VMDq
+                * VSI to be added switch to VEB mode.
+                */
+               if (!(pf->flags & I40E_FLAG_VEB_MODE_ENABLED)) {
+                       pf->flags |= I40E_FLAG_VEB_MODE_ENABLED;
+                       i40e_do_reset_safe(pf,
+                                          BIT_ULL(__I40E_PF_RESET_REQUESTED));
+               }
+
                vsi = i40e_vsi_setup(pf, I40E_VSI_VMDQ2, vsi_seid, 0);
                if (vsi)
                        dev_info(&pf->pdev->dev, "added VSI %d to relay %d\n",
index a54c14491e3b6a4dbc168980dd44d399b6766487..5b5bea159bd53c8684d0a69b310e492bc797c8b6 100644 (file)
@@ -6097,6 +6097,10 @@ static int i40e_reconstitute_veb(struct i40e_veb *veb)
        if (ret)
                goto end_reconstitute;
 
+       if (pf->flags & I40E_FLAG_VEB_MODE_ENABLED)
+               veb->bridge_mode = BRIDGE_MODE_VEB;
+       else
+               veb->bridge_mode = BRIDGE_MODE_VEPA;
        i40e_config_bridge_mode(veb);
 
        /* create the remaining VSIs attached to this VEB */
@@ -8031,7 +8035,12 @@ static int i40e_ndo_bridge_setlink(struct net_device *dev,
                } else if (mode != veb->bridge_mode) {
                        /* Existing HW bridge but different mode needs reset */
                        veb->bridge_mode = mode;
-                       i40e_do_reset(pf, (1 << __I40E_PF_RESET_REQUESTED));
+                       /* TODO: If no VFs or VMDq VSIs, disallow VEB mode */
+                       if (mode == BRIDGE_MODE_VEB)
+                               pf->flags |= I40E_FLAG_VEB_MODE_ENABLED;
+                       else
+                               pf->flags &= ~I40E_FLAG_VEB_MODE_ENABLED;
+                       i40e_do_reset(pf, BIT_ULL(__I40E_PF_RESET_REQUESTED));
                        break;
                }
        }
@@ -8343,11 +8352,12 @@ static int i40e_add_vsi(struct i40e_vsi *vsi)
                ctxt.uplink_seid = vsi->uplink_seid;
                ctxt.connection_type = I40E_AQ_VSI_CONN_TYPE_NORMAL;
                ctxt.flags = I40E_AQ_VSI_TYPE_PF;
-               if (i40e_is_vsi_uplink_mode_veb(vsi)) {
+               if ((pf->flags & I40E_FLAG_VEB_MODE_ENABLED) &&
+                   (i40e_is_vsi_uplink_mode_veb(vsi))) {
                        ctxt.info.valid_sections |=
-                               cpu_to_le16(I40E_AQ_VSI_PROP_SWITCH_VALID);
+                            cpu_to_le16(I40E_AQ_VSI_PROP_SWITCH_VALID);
                        ctxt.info.switch_id =
-                               cpu_to_le16(I40E_AQ_VSI_SW_ID_FLAG_ALLOW_LB);
+                          cpu_to_le16(I40E_AQ_VSI_SW_ID_FLAG_ALLOW_LB);
                }
                i40e_vsi_setup_queue_map(vsi, &ctxt, enabled_tc, true);
                break;
@@ -8746,6 +8756,14 @@ struct i40e_vsi *i40e_vsi_setup(struct i40e_pf *pf, u8 type,
                                         __func__);
                                return NULL;
                        }
+                       /* We come up by default in VEPA mode if SRIOV is not
+                        * already enabled, in which case we can't force VEPA
+                        * mode.
+                        */
+                       if (!(pf->flags & I40E_FLAG_VEB_MODE_ENABLED)) {
+                               veb->bridge_mode = BRIDGE_MODE_VEPA;
+                               pf->flags &= ~I40E_FLAG_VEB_MODE_ENABLED;
+                       }
                        i40e_config_bridge_mode(veb);
                }
                for (i = 0; i < I40E_MAX_VEB && !veb; i++) {
@@ -9856,6 +9874,15 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
                goto err_switch_setup;
        }
 
+#ifdef CONFIG_PCI_IOV
+       /* prep for VF support */
+       if ((pf->flags & I40E_FLAG_SRIOV_ENABLED) &&
+           (pf->flags & I40E_FLAG_MSIX_ENABLED) &&
+           !test_bit(__I40E_BAD_EEPROM, &pf->state)) {
+               if (pci_num_vf(pdev))
+                       pf->flags |= I40E_FLAG_VEB_MODE_ENABLED;
+       }
+#endif
        err = i40e_setup_pf_switch(pf, false);
        if (err) {
                dev_info(&pdev->dev, "setup_pf_switch failed: %d\n", err);
index 4bd3a80aba82998bba343a1870b2d21f59bca4e0..9d95042d5a0f5805824d53ecc847ff76a9909444 100644 (file)
@@ -2410,14 +2410,12 @@ static int i40e_maybe_stop_tx(struct i40e_ring *tx_ring, int size)
  * i40e_chk_linearize - Check if there are more than 8 fragments per packet
  * @skb:      send buffer
  * @tx_flags: collected send information
- * @hdr_len:  size of the packet header
  *
  * Note: Our HW can't scatter-gather more than 8 fragments to build
  * a packet on the wire and so we need to figure out the cases where we
  * need to linearize the skb.
  **/
-static bool i40e_chk_linearize(struct sk_buff *skb, u32 tx_flags,
-                              const u8 hdr_len)
+static bool i40e_chk_linearize(struct sk_buff *skb, u32 tx_flags)
 {
        struct skb_frag_struct *frag;
        bool linearize = false;
@@ -2429,7 +2427,7 @@ static bool i40e_chk_linearize(struct sk_buff *skb, u32 tx_flags,
        gso_segs = skb_shinfo(skb)->gso_segs;
 
        if (tx_flags & (I40E_TX_FLAGS_TSO | I40E_TX_FLAGS_FSO)) {
-               u16 j = 1;
+               u16 j = 0;
 
                if (num_frags < (I40E_MAX_BUFFER_TXD))
                        goto linearize_chk_done;
@@ -2440,21 +2438,18 @@ static bool i40e_chk_linearize(struct sk_buff *skb, u32 tx_flags,
                        goto linearize_chk_done;
                }
                frag = &skb_shinfo(skb)->frags[0];
-               size = hdr_len;
                /* we might still have more fragments per segment */
                do {
                        size += skb_frag_size(frag);
                        frag++; j++;
+                       if ((size >= skb_shinfo(skb)->gso_size) &&
+                           (j < I40E_MAX_BUFFER_TXD)) {
+                               size = (size % skb_shinfo(skb)->gso_size);
+                               j = (size) ? 1 : 0;
+                       }
                        if (j == I40E_MAX_BUFFER_TXD) {
-                               if (size < skb_shinfo(skb)->gso_size) {
-                                       linearize = true;
-                                       break;
-                               }
-                               j = 1;
-                               size -= skb_shinfo(skb)->gso_size;
-                               if (size)
-                                       j++;
-                               size += hdr_len;
+                               linearize = true;
+                               break;
                        }
                        num_frags--;
                } while (num_frags);
@@ -2724,7 +2719,7 @@ static netdev_tx_t i40e_xmit_frame_ring(struct sk_buff *skb,
        if (tsyn)
                tx_flags |= I40E_TX_FLAGS_TSYN;
 
-       if (i40e_chk_linearize(skb, tx_flags, hdr_len))
+       if (i40e_chk_linearize(skb, tx_flags))
                if (skb_linearize(skb))
                        goto out_drop;
 
index 78d1c4ff565e8853473b70c3827e6a727ff3ce1c..4e9376da051829969de7750c2dc7a66acc5e5f40 100644 (file)
@@ -1018,11 +1018,19 @@ int i40e_pci_sriov_configure(struct pci_dev *pdev, int num_vfs)
 {
        struct i40e_pf *pf = pci_get_drvdata(pdev);
 
-       if (num_vfs)
+       if (num_vfs) {
+               if (!(pf->flags & I40E_FLAG_VEB_MODE_ENABLED)) {
+                       pf->flags |= I40E_FLAG_VEB_MODE_ENABLED;
+                       i40e_do_reset_safe(pf,
+                                          BIT_ULL(__I40E_PF_RESET_REQUESTED));
+               }
                return i40e_pci_sriov_enable(pdev, num_vfs);
+       }
 
        if (!pci_vfs_assigned(pf->pdev)) {
                i40e_free_vfs(pf);
+               pf->flags &= ~I40E_FLAG_VEB_MODE_ENABLED;
+               i40e_do_reset_safe(pf, BIT_ULL(__I40E_PF_RESET_REQUESTED));
        } else {
                dev_warn(&pdev->dev, "Unable to free VFs because some are assigned to VMs.\n");
                return -EINVAL;
index b077e02a0cc7ac8f67ad90560cf990f8f7a66277..458fbb421090772d0bbc1620277624339e0cd757 100644 (file)
@@ -1619,14 +1619,12 @@ static void i40e_create_tx_ctx(struct i40e_ring *tx_ring,
  * i40e_chk_linearize - Check if there are more than 8 fragments per packet
  * @skb:      send buffer
  * @tx_flags: collected send information
- * @hdr_len:  size of the packet header
  *
  * Note: Our HW can't scatter-gather more than 8 fragments to build
  * a packet on the wire and so we need to figure out the cases where we
  * need to linearize the skb.
  **/
-static bool i40e_chk_linearize(struct sk_buff *skb, u32 tx_flags,
-                              const u8 hdr_len)
+static bool i40e_chk_linearize(struct sk_buff *skb, u32 tx_flags)
 {
        struct skb_frag_struct *frag;
        bool linearize = false;
@@ -1638,7 +1636,7 @@ static bool i40e_chk_linearize(struct sk_buff *skb, u32 tx_flags,
        gso_segs = skb_shinfo(skb)->gso_segs;
 
        if (tx_flags & (I40E_TX_FLAGS_TSO | I40E_TX_FLAGS_FSO)) {
-               u16 j = 1;
+               u16 j = 0;
 
                if (num_frags < (I40E_MAX_BUFFER_TXD))
                        goto linearize_chk_done;
@@ -1649,21 +1647,18 @@ static bool i40e_chk_linearize(struct sk_buff *skb, u32 tx_flags,
                        goto linearize_chk_done;
                }
                frag = &skb_shinfo(skb)->frags[0];
-               size = hdr_len;
                /* we might still have more fragments per segment */
                do {
                        size += skb_frag_size(frag);
                        frag++; j++;
+                       if ((size >= skb_shinfo(skb)->gso_size) &&
+                           (j < I40E_MAX_BUFFER_TXD)) {
+                               size = (size % skb_shinfo(skb)->gso_size);
+                               j = (size) ? 1 : 0;
+                       }
                        if (j == I40E_MAX_BUFFER_TXD) {
-                               if (size < skb_shinfo(skb)->gso_size) {
-                                       linearize = true;
-                                       break;
-                               }
-                               j = 1;
-                               size -= skb_shinfo(skb)->gso_size;
-                               if (size)
-                                       j++;
-                               size += hdr_len;
+                               linearize = true;
+                               break;
                        }
                        num_frags--;
                } while (num_frags);
@@ -1950,7 +1945,7 @@ static netdev_tx_t i40e_xmit_frame_ring(struct sk_buff *skb,
        else if (tso)
                tx_flags |= I40E_TX_FLAGS_TSO;
 
-       if (i40e_chk_linearize(skb, tx_flags, hdr_len))
+       if (i40e_chk_linearize(skb, tx_flags))
                if (skb_linearize(skb))
                        goto out_drop;
 
index e3b9b63ad01083cb987429f57c9ebef84d86f4db..c3a9392cbc192229f4178c913fad8ab64d8c44c3 100644 (file)
@@ -538,8 +538,8 @@ static int igb_ptp_feature_enable_i210(struct ptp_clock_info *ptp,
                        igb->perout[i].start.tv_nsec = rq->perout.start.nsec;
                        igb->perout[i].period.tv_sec = ts.tv_sec;
                        igb->perout[i].period.tv_nsec = ts.tv_nsec;
-                       wr32(trgttiml, rq->perout.start.sec);
-                       wr32(trgttimh, rq->perout.start.nsec);
+                       wr32(trgttimh, rq->perout.start.sec);
+                       wr32(trgttiml, rq->perout.start.nsec);
                        tsauxc |= tsauxc_mask;
                        tsim |= tsim_mask;
                } else {
index cd29b1038c5e3bf6f4a21659343c65584c44b969..15f9b7c9e4d38e93a52864a953e12d4172602797 100644 (file)
@@ -1660,6 +1660,7 @@ static int ntb_atom_detect(struct ntb_device *ndev)
        u32 ppd;
 
        ndev->hw_type = BWD_HW;
+       ndev->limits.max_mw = BWD_MAX_MW;
 
        rc = pci_read_config_dword(ndev->pdev, NTB_PPD_OFFSET, &ppd);
        if (rc)
@@ -1778,7 +1779,7 @@ static int ntb_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
                        dev_warn(&pdev->dev, "Cannot remap BAR %d\n",
                                 MW_TO_BAR(i));
                        rc = -EIO;
-                       goto err3;
+                       goto err4;
                }
        }
 
index a01f57c9e34eab8a95306b0a2643d26d2d764a1c..ddf8e42c9367d36132a2cd068fc441e9e29eea87 100644 (file)
@@ -25,6 +25,7 @@
 
 const struct of_device_id of_default_bus_match_table[] = {
        { .compatible = "simple-bus", },
+       { .compatible = "simple-mfd", },
 #ifdef CONFIG_ARM_AMBA
        { .compatible = "arm,amba-bus", },
 #endif /* CONFIG_ARM_AMBA */
index a65f821f52eb2ab882754cb16e9af9ae5b3ea06b..d3c378b4db6c5697d2daf903861b11b1bdd44ad5 100644 (file)
@@ -277,7 +277,6 @@ config AT91_CF
        tristate "AT91 CompactFlash Controller"
        depends on PCI
        depends on PCMCIA && ARCH_AT91
-       depends on !ARCH_MULTIPLATFORM
        help
          Say Y here to support the CompactFlash controller on AT91 chips.
          Or choose M to compile the driver as a module named "at91_cf".
index e7775a41ae5d11f397012194e20daa1ebf05d9b9..87147bcd16553f74b2a54a7cb054c6847aecbdf7 100644 (file)
 #include <linux/platform_data/atmel.h>
 #include <linux/io.h>
 #include <linux/sizes.h>
+#include <linux/mfd/syscon.h>
+#include <linux/mfd/syscon/atmel-mc.h>
 #include <linux/of.h>
 #include <linux/of_device.h>
 #include <linux/of_gpio.h>
+#include <linux/regmap.h>
 
 #include <pcmcia/ss.h>
 
-#include <mach/at91rm9200_mc.h>
-#include <mach/at91_ramc.h>
-
-
 /*
  * A0..A10 work in each range; A23 indicates I/O space;  A25 is CFRNW;
  * some other bit in {A24,A22..A11} is nREG to flag memory access
@@ -40,6 +39,8 @@
 #define        CF_IO_PHYS      (1 << 23)
 #define        CF_MEM_PHYS     (0x017ff800)
 
+struct regmap *mc;
+
 /*--------------------------------------------------------------------------*/
 
 struct at91_cf_socket {
@@ -155,10 +156,7 @@ static int at91_cf_set_io_map(struct pcmcia_socket *s, struct pccard_io_map *io)
 
        /*
         * Use 16 bit accesses unless/until we need 8-bit i/o space.
-        */
-       csr = at91_ramc_read(0, AT91_SMC_CSR(cf->board->chipselect)) & ~AT91_SMC_DBW;
-
-       /*
+        *
         * NOTE: this CF controller ignores IOIS16, so we can't really do
         * MAP_AUTOSZ.  The 16bit mode allows single byte access on either
         * D0-D7 (even addr) or D8-D15 (odd), so it's close enough for many
@@ -169,13 +167,14 @@ static int at91_cf_set_io_map(struct pcmcia_socket *s, struct pccard_io_map *io)
         * CF 3.0 spec table 35 also giving the D8-D15 option.
         */
        if (!(io->flags & (MAP_16BIT | MAP_AUTOSZ))) {
-               csr |= AT91_SMC_DBW_8;
+               csr = AT91_MC_SMC_DBW_8;
                dev_dbg(&cf->pdev->dev, "8bit i/o bus\n");
        } else {
-               csr |= AT91_SMC_DBW_16;
+               csr = AT91_MC_SMC_DBW_16;
                dev_dbg(&cf->pdev->dev, "16bit i/o bus\n");
        }
-       at91_ramc_write(0, AT91_SMC_CSR(cf->board->chipselect), csr);
+       regmap_update_bits(mc, AT91_MC_SMC_CSR(cf->board->chipselect),
+                          AT91_MC_SMC_DBW, csr);
 
        io->start = cf->socket.io_offset;
        io->stop = io->start + SZ_2K - 1;
@@ -236,6 +235,10 @@ static int at91_cf_dt_init(struct platform_device *pdev)
 
        pdev->dev.platform_data = board;
 
+       mc = syscon_regmap_lookup_by_compatible("atmel,at91rm9200-sdramc");
+       if (IS_ERR(mc))
+               return PTR_ERR(mc);
+
        return 0;
 }
 #else
index b71a6fffef1be35f8df1763e0abe81445130b929..3769eaedf519cbaa12fa9f7bb9d3b0b1f1cc3d3b 100644 (file)
@@ -218,11 +218,11 @@ static const struct berlin_pinctrl_desc berlin2_sysmgr_pinctrl_data = {
 
 static const struct of_device_id berlin2_pinctrl_match[] = {
        {
-               .compatible = "marvell,berlin2-chip-ctrl",
+               .compatible = "marvell,berlin2-soc-pinctrl",
                .data = &berlin2_soc_pinctrl_data
        },
        {
-               .compatible = "marvell,berlin2-system-ctrl",
+               .compatible = "marvell,berlin2-system-pinctrl",
                .data = &berlin2_sysmgr_pinctrl_data
        },
        {}
@@ -233,28 +233,6 @@ static int berlin2_pinctrl_probe(struct platform_device *pdev)
 {
        const struct of_device_id *match =
                of_match_device(berlin2_pinctrl_match, &pdev->dev);
-       struct regmap_config *rmconfig;
-       struct regmap *regmap;
-       struct resource *res;
-       void __iomem *base;
-
-       rmconfig = devm_kzalloc(&pdev->dev, sizeof(*rmconfig), GFP_KERNEL);
-       if (!rmconfig)
-               return -ENOMEM;
-
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       base = devm_ioremap_resource(&pdev->dev, res);
-       if (IS_ERR(base))
-               return PTR_ERR(base);
-
-       rmconfig->reg_bits = 32,
-       rmconfig->val_bits = 32,
-       rmconfig->reg_stride = 4,
-       rmconfig->max_register = resource_size(res);
-
-       regmap = devm_regmap_init_mmio(&pdev->dev, base, rmconfig);
-       if (IS_ERR(regmap))
-               return PTR_ERR(regmap);
 
        return berlin_pinctrl_probe(pdev, match->data);
 }
index 19ac5a22c9471abb671f3bef2ad9d5a9b114b674..9e11f191d643a4be01b66fe888728d3d0b23bc5a 100644 (file)
@@ -161,11 +161,11 @@ static const struct berlin_pinctrl_desc berlin2cd_sysmgr_pinctrl_data = {
 
 static const struct of_device_id berlin2cd_pinctrl_match[] = {
        {
-               .compatible = "marvell,berlin2cd-chip-ctrl",
+               .compatible = "marvell,berlin2cd-soc-pinctrl",
                .data = &berlin2cd_soc_pinctrl_data
        },
        {
-               .compatible = "marvell,berlin2cd-system-ctrl",
+               .compatible = "marvell,berlin2cd-system-pinctrl",
                .data = &berlin2cd_sysmgr_pinctrl_data
        },
        {}
@@ -176,28 +176,6 @@ static int berlin2cd_pinctrl_probe(struct platform_device *pdev)
 {
        const struct of_device_id *match =
                of_match_device(berlin2cd_pinctrl_match, &pdev->dev);
-       struct regmap_config *rmconfig;
-       struct regmap *regmap;
-       struct resource *res;
-       void __iomem *base;
-
-       rmconfig = devm_kzalloc(&pdev->dev, sizeof(*rmconfig), GFP_KERNEL);
-       if (!rmconfig)
-               return -ENOMEM;
-
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       base = devm_ioremap_resource(&pdev->dev, res);
-       if (IS_ERR(base))
-               return PTR_ERR(base);
-
-       rmconfig->reg_bits = 32,
-       rmconfig->val_bits = 32,
-       rmconfig->reg_stride = 4,
-       rmconfig->max_register = resource_size(res);
-
-       regmap = devm_regmap_init_mmio(&pdev->dev, base, rmconfig);
-       if (IS_ERR(regmap))
-               return PTR_ERR(regmap);
 
        return berlin_pinctrl_probe(pdev, match->data);
 }
index bd9662e57ad3b653821882b9b4ff56ade237a9c3..ba7a8a8ad010fc3509471a6b5fe2332bbceab76d 100644 (file)
@@ -380,11 +380,11 @@ static const struct berlin_pinctrl_desc berlin2q_sysmgr_pinctrl_data = {
 
 static const struct of_device_id berlin2q_pinctrl_match[] = {
        {
-               .compatible = "marvell,berlin2q-chip-ctrl",
+               .compatible = "marvell,berlin2q-soc-pinctrl",
                .data = &berlin2q_soc_pinctrl_data,
        },
        {
-               .compatible = "marvell,berlin2q-system-ctrl",
+               .compatible = "marvell,berlin2q-system-pinctrl",
                .data = &berlin2q_sysmgr_pinctrl_data,
        },
        {}
@@ -395,28 +395,6 @@ static int berlin2q_pinctrl_probe(struct platform_device *pdev)
 {
        const struct of_device_id *match =
                of_match_device(berlin2q_pinctrl_match, &pdev->dev);
-       struct regmap_config *rmconfig;
-       struct regmap *regmap;
-       struct resource *res;
-       void __iomem *base;
-
-       rmconfig = devm_kzalloc(&pdev->dev, sizeof(*rmconfig), GFP_KERNEL);
-       if (!rmconfig)
-               return -ENOMEM;
-
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       base = devm_ioremap_resource(&pdev->dev, res);
-       if (IS_ERR(base))
-               return PTR_ERR(base);
-
-       rmconfig->reg_bits = 32,
-       rmconfig->val_bits = 32,
-       rmconfig->reg_stride = 4,
-       rmconfig->max_register = resource_size(res);
-
-       regmap = devm_regmap_init_mmio(&pdev->dev, base, rmconfig);
-       if (IS_ERR(regmap))
-               return PTR_ERR(regmap);
 
        return berlin_pinctrl_probe(pdev, match->data);
 }
index 7f0b0f93242b7240198283896cce5276f29006f7..65b0e211b89e751d6456571947f361a761391a9a 100644 (file)
@@ -11,6 +11,7 @@
  */
 
 #include <linux/io.h>
+#include <linux/mfd/syscon.h>
 #include <linux/module.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
@@ -295,13 +296,15 @@ int berlin_pinctrl_probe(struct platform_device *pdev,
                         const struct berlin_pinctrl_desc *desc)
 {
        struct device *dev = &pdev->dev;
+       struct device_node *parent_np = of_get_parent(dev->of_node);
        struct berlin_pinctrl *pctrl;
        struct regmap *regmap;
        int ret;
 
-       regmap = dev_get_regmap(&pdev->dev, NULL);
-       if (!regmap)
-               return -ENODEV;
+       regmap = syscon_node_to_regmap(parent_np);
+       of_node_put(parent_np);
+       if (IS_ERR(regmap))
+               return PTR_ERR(regmap);
 
        pctrl = devm_kzalloc(dev, sizeof(*pctrl), GFP_KERNEL);
        if (!pctrl)
index f8b48a13cf0ba86738da958f1a42a875a9f06dfa..3c922d37255c6d937ff5cd90ea995259aac55e90 100644 (file)
 
 #include <linux/delay.h>
 #include <linux/io.h>
+#include <linux/mfd/syscon.h>
 #include <linux/module.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
 #include <linux/platform_device.h>
+#include <linux/regmap.h>
 #include <linux/reset-controller.h>
 #include <linux/slab.h>
 #include <linux/types.h>
@@ -25,8 +27,7 @@
        container_of((p), struct berlin_reset_priv, rcdev)
 
 struct berlin_reset_priv {
-       void __iomem                    *base;
-       unsigned int                    size;
+       struct regmap                   *regmap;
        struct reset_controller_dev     rcdev;
 };
 
@@ -37,7 +38,7 @@ static int berlin_reset_reset(struct reset_controller_dev *rcdev,
        int offset = id >> 8;
        int mask = BIT(id & 0x1f);
 
-       writel(mask, priv->base + offset);
+       regmap_write(priv->regmap, offset, mask);
 
        /* let the reset be effective */
        udelay(10);
@@ -52,7 +53,6 @@ static struct reset_control_ops berlin_reset_ops = {
 static int berlin_reset_xlate(struct reset_controller_dev *rcdev,
                              const struct of_phandle_args *reset_spec)
 {
-       struct berlin_reset_priv *priv = to_berlin_reset_priv(rcdev);
        unsigned offset, bit;
 
        if (WARN_ON(reset_spec->args_count != rcdev->of_reset_n_cells))
@@ -61,71 +61,53 @@ static int berlin_reset_xlate(struct reset_controller_dev *rcdev,
        offset = reset_spec->args[0];
        bit = reset_spec->args[1];
 
-       if (offset >= priv->size)
-               return -EINVAL;
-
        if (bit >= BERLIN_MAX_RESETS)
                return -EINVAL;
 
        return (offset << 8) | bit;
 }
 
-static int __berlin_reset_init(struct device_node *np)
+static int berlin2_reset_probe(struct platform_device *pdev)
 {
+       struct device_node *parent_np = of_get_parent(pdev->dev.of_node);
        struct berlin_reset_priv *priv;
-       struct resource res;
-       resource_size_t size;
-       int ret;
 
-       priv = kzalloc(sizeof(*priv), GFP_KERNEL);
+       priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
        if (!priv)
                return -ENOMEM;
 
-       ret = of_address_to_resource(np, 0, &res);
-       if (ret)
-               goto err;
-
-       size = resource_size(&res);
-       priv->base = ioremap(res.start, size);
-       if (!priv->base) {
-               ret = -ENOMEM;
-               goto err;
-       }
-       priv->size = size;
+       priv->regmap = syscon_node_to_regmap(parent_np);
+       of_node_put(parent_np);
+       if (IS_ERR(priv->regmap))
+               return PTR_ERR(priv->regmap);
 
        priv->rcdev.owner = THIS_MODULE;
        priv->rcdev.ops = &berlin_reset_ops;
-       priv->rcdev.of_node = np;
+       priv->rcdev.of_node = pdev->dev.of_node;
        priv->rcdev.of_reset_n_cells = 2;
        priv->rcdev.of_xlate = berlin_reset_xlate;
 
        reset_controller_register(&priv->rcdev);
 
        return 0;
-
-err:
-       kfree(priv);
-       return ret;
 }
 
-static const struct of_device_id berlin_reset_of_match[] __initconst = {
-       { .compatible = "marvell,berlin2-chip-ctrl" },
-       { .compatible = "marvell,berlin2cd-chip-ctrl" },
-       { .compatible = "marvell,berlin2q-chip-ctrl" },
+static const struct of_device_id berlin_reset_dt_match[] = {
+       { .compatible = "marvell,berlin2-reset" },
        { },
 };
+MODULE_DEVICE_TABLE(of, berlin_reset_dt_match);
+
+static struct platform_driver berlin_reset_driver = {
+       .probe  = berlin2_reset_probe,
+       .driver = {
+               .name = "berlin2-reset",
+               .of_match_table = berlin_reset_dt_match,
+       },
+};
+module_platform_driver(berlin_reset_driver);
 
-static int __init berlin_reset_init(void)
-{
-       struct device_node *np;
-       int ret;
-
-       for_each_matching_node(np, berlin_reset_of_match) {
-               ret = __berlin_reset_init(np);
-               if (ret)
-                       return ret;
-       }
-
-       return 0;
-}
-arch_initcall(berlin_reset_init);
+MODULE_AUTHOR("Antoine Tenart <antoine.tenart@free-electrons.com>");
+MODULE_AUTHOR("Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>");
+MODULE_DESCRIPTION("Marvell Berlin reset driver");
+MODULE_LICENSE("GPL");
index d8bde82f03708bf96f7c3fbd86cdbcdd20b9689b..96ddecb922545e9294040e05950e6c695e01b3c6 100644 (file)
@@ -2,6 +2,7 @@ menu "SOC (System On Chip) specific Drivers"
 
 source "drivers/soc/mediatek/Kconfig"
 source "drivers/soc/qcom/Kconfig"
+source "drivers/soc/sunxi/Kconfig"
 source "drivers/soc/ti/Kconfig"
 source "drivers/soc/versatile/Kconfig"
 
index 70042b259744eab805dea6e65aff46e03a74da25..7dc7c0d8a2c13f50827e1d9345d6ebed8283b2e2 100644 (file)
@@ -4,6 +4,7 @@
 
 obj-$(CONFIG_ARCH_MEDIATEK)    += mediatek/
 obj-$(CONFIG_ARCH_QCOM)                += qcom/
+obj-$(CONFIG_ARCH_SUNXI)       += sunxi/
 obj-$(CONFIG_ARCH_TEGRA)       += tegra/
 obj-$(CONFIG_SOC_TI)           += ti/
 obj-$(CONFIG_PLAT_VERSATILE)   += versatile/
index bcdb22d5e215c9a393ccabe58f4f94ef132e3516..3c1850332a90212798ab5030554bc8fad39d9796 100644 (file)
@@ -4,6 +4,7 @@
 config MTK_PMIC_WRAP
        tristate "MediaTek PMIC Wrapper Support"
        depends on ARCH_MEDIATEK
+       depends on RESET_CONTROLLER
        select REGMAP
        help
          Say yes here to add support for MediaTek PMIC Wrapper found
index db5be1eec54c8db3977ea810e13c5470f416aaa7..f432291feee91e4b7c7b5ce3cc84f3b130933309 100644 (file)
@@ -443,11 +443,6 @@ static int pwrap_wait_for_state(struct pmic_wrapper *wrp,
 static int pwrap_write(struct pmic_wrapper *wrp, u32 adr, u32 wdata)
 {
        int ret;
-       u32 val;
-
-       val = pwrap_readl(wrp, PWRAP_WACS2_RDATA);
-       if (PWRAP_GET_WACS_FSM(val) == PWRAP_WACS_FSM_WFVLDCLR)
-               pwrap_writel(wrp, 1, PWRAP_WACS2_VLDCLR);
 
        ret = pwrap_wait_for_state(wrp, pwrap_is_fsm_idle);
        if (ret)
@@ -462,11 +457,6 @@ static int pwrap_write(struct pmic_wrapper *wrp, u32 adr, u32 wdata)
 static int pwrap_read(struct pmic_wrapper *wrp, u32 adr, u32 *rdata)
 {
        int ret;
-       u32 val;
-
-       val = pwrap_readl(wrp, PWRAP_WACS2_RDATA);
-       if (PWRAP_GET_WACS_FSM(val) == PWRAP_WACS_FSM_WFVLDCLR)
-               pwrap_writel(wrp, 1, PWRAP_WACS2_VLDCLR);
 
        ret = pwrap_wait_for_state(wrp, pwrap_is_fsm_idle);
        if (ret)
@@ -480,6 +470,8 @@ static int pwrap_read(struct pmic_wrapper *wrp, u32 adr, u32 *rdata)
 
        *rdata = PWRAP_GET_WACS_RDATA(pwrap_readl(wrp, PWRAP_WACS2_RDATA));
 
+       pwrap_writel(wrp, 1, PWRAP_WACS2_VLDCLR);
+
        return 0;
 }
 
@@ -563,45 +555,17 @@ static int pwrap_init_sidly(struct pmic_wrapper *wrp)
 
 static int pwrap_init_reg_clock(struct pmic_wrapper *wrp)
 {
-       unsigned long rate_spi;
-       int ck_mhz;
-
-       rate_spi = clk_get_rate(wrp->clk_spi);
-
-       if (rate_spi > 26000000)
-               ck_mhz = 26;
-       else if (rate_spi > 18000000)
-               ck_mhz = 18;
-       else
-               ck_mhz = 0;
-
-       switch (ck_mhz) {
-       case 18:
-               if (pwrap_is_mt8135(wrp))
-                       pwrap_writel(wrp, 0xc, PWRAP_CSHEXT);
-               pwrap_writel(wrp, 0x4, PWRAP_CSHEXT_WRITE);
-               pwrap_writel(wrp, 0xc, PWRAP_CSHEXT_READ);
-               pwrap_writel(wrp, 0x0, PWRAP_CSLEXT_START);
-               pwrap_writel(wrp, 0x0, PWRAP_CSLEXT_END);
-               break;
-       case 26:
-               if (pwrap_is_mt8135(wrp))
-                       pwrap_writel(wrp, 0x4, PWRAP_CSHEXT);
+       if (pwrap_is_mt8135(wrp)) {
+               pwrap_writel(wrp, 0x4, PWRAP_CSHEXT);
                pwrap_writel(wrp, 0x0, PWRAP_CSHEXT_WRITE);
                pwrap_writel(wrp, 0x4, PWRAP_CSHEXT_READ);
                pwrap_writel(wrp, 0x0, PWRAP_CSLEXT_START);
                pwrap_writel(wrp, 0x0, PWRAP_CSLEXT_END);
-               break;
-       case 0:
-               if (pwrap_is_mt8135(wrp))
-                       pwrap_writel(wrp, 0xf, PWRAP_CSHEXT);
-               pwrap_writel(wrp, 0xf, PWRAP_CSHEXT_WRITE);
-               pwrap_writel(wrp, 0xf, PWRAP_CSHEXT_READ);
-               pwrap_writel(wrp, 0xf, PWRAP_CSLEXT_START);
-               pwrap_writel(wrp, 0xf, PWRAP_CSLEXT_END);
-               break;
-       default:
-               return -EINVAL;
+       } else {
+               pwrap_writel(wrp, 0x0, PWRAP_CSHEXT_WRITE);
+               pwrap_writel(wrp, 0x4, PWRAP_CSHEXT_READ);
+               pwrap_writel(wrp, 0x2, PWRAP_CSLEXT_START);
+               pwrap_writel(wrp, 0x2, PWRAP_CSLEXT_END);
        }
 
        return 0;
index 460b2dba109c8dac48eb3acdb493dc2b535d62c7..5eea374c8fa621ac91056fdd9b1853dd772d358c 100644 (file)
@@ -10,3 +10,10 @@ config QCOM_GSBI
           functions for connecting the underlying serial UART, SPI, and I2C
           devices to the output pins.
 
+config QCOM_PM
+       bool "Qualcomm Power Management"
+       depends on ARCH_QCOM && !ARM64
+       help
+         QCOM Platform specific power driver to manage cores and L2 low power
+         modes. It interface with various system drivers to put the cores in
+         low power modes.
index 438901257ac1e4cbfb866e3cef73141c879c5c1a..931d385386c535b846548a3c6b9070c774013fa1 100644 (file)
@@ -1 +1,2 @@
 obj-$(CONFIG_QCOM_GSBI)        +=      qcom_gsbi.o
+obj-$(CONFIG_QCOM_PM)  +=      spm.o
diff --git a/drivers/soc/qcom/spm.c b/drivers/soc/qcom/spm.c
new file mode 100644 (file)
index 0000000..b04b05a
--- /dev/null
@@ -0,0 +1,385 @@
+/*
+ * Copyright (c) 2011-2014, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2014,2015, Linaro 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 and
+ * only 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/module.h>
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/io.h>
+#include <linux/slab.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/of_device.h>
+#include <linux/err.h>
+#include <linux/platform_device.h>
+#include <linux/cpuidle.h>
+#include <linux/cpu_pm.h>
+#include <linux/qcom_scm.h>
+
+#include <asm/cpuidle.h>
+#include <asm/proc-fns.h>
+#include <asm/suspend.h>
+
+#define MAX_PMIC_DATA          2
+#define MAX_SEQ_DATA           64
+#define SPM_CTL_INDEX          0x7f
+#define SPM_CTL_INDEX_SHIFT    4
+#define SPM_CTL_EN             BIT(0)
+
+enum pm_sleep_mode {
+       PM_SLEEP_MODE_STBY,
+       PM_SLEEP_MODE_RET,
+       PM_SLEEP_MODE_SPC,
+       PM_SLEEP_MODE_PC,
+       PM_SLEEP_MODE_NR,
+};
+
+enum spm_reg {
+       SPM_REG_CFG,
+       SPM_REG_SPM_CTL,
+       SPM_REG_DLY,
+       SPM_REG_PMIC_DLY,
+       SPM_REG_PMIC_DATA_0,
+       SPM_REG_PMIC_DATA_1,
+       SPM_REG_VCTL,
+       SPM_REG_SEQ_ENTRY,
+       SPM_REG_SPM_STS,
+       SPM_REG_PMIC_STS,
+       SPM_REG_NR,
+};
+
+struct spm_reg_data {
+       const u8 *reg_offset;
+       u32 spm_cfg;
+       u32 spm_dly;
+       u32 pmic_dly;
+       u32 pmic_data[MAX_PMIC_DATA];
+       u8 seq[MAX_SEQ_DATA];
+       u8 start_index[PM_SLEEP_MODE_NR];
+};
+
+struct spm_driver_data {
+       void __iomem *reg_base;
+       const struct spm_reg_data *reg_data;
+};
+
+static const u8 spm_reg_offset_v2_1[SPM_REG_NR] = {
+       [SPM_REG_CFG]           = 0x08,
+       [SPM_REG_SPM_CTL]       = 0x30,
+       [SPM_REG_DLY]           = 0x34,
+       [SPM_REG_SEQ_ENTRY]     = 0x80,
+};
+
+/* SPM register data for 8974, 8084 */
+static const struct spm_reg_data spm_reg_8974_8084_cpu  = {
+       .reg_offset = spm_reg_offset_v2_1,
+       .spm_cfg = 0x1,
+       .spm_dly = 0x3C102800,
+       .seq = { 0x03, 0x0B, 0x0F, 0x00, 0x20, 0x80, 0x10, 0xE8, 0x5B, 0x03,
+               0x3B, 0xE8, 0x5B, 0x82, 0x10, 0x0B, 0x30, 0x06, 0x26, 0x30,
+               0x0F },
+       .start_index[PM_SLEEP_MODE_STBY] = 0,
+       .start_index[PM_SLEEP_MODE_SPC] = 3,
+};
+
+static const u8 spm_reg_offset_v1_1[SPM_REG_NR] = {
+       [SPM_REG_CFG]           = 0x08,
+       [SPM_REG_SPM_CTL]       = 0x20,
+       [SPM_REG_PMIC_DLY]      = 0x24,
+       [SPM_REG_PMIC_DATA_0]   = 0x28,
+       [SPM_REG_PMIC_DATA_1]   = 0x2C,
+       [SPM_REG_SEQ_ENTRY]     = 0x80,
+};
+
+/* SPM register data for 8064 */
+static const struct spm_reg_data spm_reg_8064_cpu = {
+       .reg_offset = spm_reg_offset_v1_1,
+       .spm_cfg = 0x1F,
+       .pmic_dly = 0x02020004,
+       .pmic_data[0] = 0x0084009C,
+       .pmic_data[1] = 0x00A4001C,
+       .seq = { 0x03, 0x0F, 0x00, 0x24, 0x54, 0x10, 0x09, 0x03, 0x01,
+               0x10, 0x54, 0x30, 0x0C, 0x24, 0x30, 0x0F },
+       .start_index[PM_SLEEP_MODE_STBY] = 0,
+       .start_index[PM_SLEEP_MODE_SPC] = 2,
+};
+
+static DEFINE_PER_CPU(struct spm_driver_data *, cpu_spm_drv);
+
+typedef int (*idle_fn)(int);
+static DEFINE_PER_CPU(idle_fn*, qcom_idle_ops);
+
+static inline void spm_register_write(struct spm_driver_data *drv,
+                                       enum spm_reg reg, u32 val)
+{
+       if (drv->reg_data->reg_offset[reg])
+               writel_relaxed(val, drv->reg_base +
+                               drv->reg_data->reg_offset[reg]);
+}
+
+/* Ensure a guaranteed write, before return */
+static inline void spm_register_write_sync(struct spm_driver_data *drv,
+                                       enum spm_reg reg, u32 val)
+{
+       u32 ret;
+
+       if (!drv->reg_data->reg_offset[reg])
+               return;
+
+       do {
+               writel_relaxed(val, drv->reg_base +
+                               drv->reg_data->reg_offset[reg]);
+               ret = readl_relaxed(drv->reg_base +
+                               drv->reg_data->reg_offset[reg]);
+               if (ret == val)
+                       break;
+               cpu_relax();
+       } while (1);
+}
+
+static inline u32 spm_register_read(struct spm_driver_data *drv,
+                                       enum spm_reg reg)
+{
+       return readl_relaxed(drv->reg_base + drv->reg_data->reg_offset[reg]);
+}
+
+static void spm_set_low_power_mode(struct spm_driver_data *drv,
+                                       enum pm_sleep_mode mode)
+{
+       u32 start_index;
+       u32 ctl_val;
+
+       start_index = drv->reg_data->start_index[mode];
+
+       ctl_val = spm_register_read(drv, SPM_REG_SPM_CTL);
+       ctl_val &= ~(SPM_CTL_INDEX << SPM_CTL_INDEX_SHIFT);
+       ctl_val |= start_index << SPM_CTL_INDEX_SHIFT;
+       ctl_val |= SPM_CTL_EN;
+       spm_register_write_sync(drv, SPM_REG_SPM_CTL, ctl_val);
+}
+
+static int qcom_pm_collapse(unsigned long int unused)
+{
+       qcom_scm_cpu_power_down(QCOM_SCM_CPU_PWR_DOWN_L2_ON);
+
+       /*
+        * Returns here only if there was a pending interrupt and we did not
+        * power down as a result.
+        */
+       return -1;
+}
+
+static int qcom_cpu_spc(int cpu)
+{
+       int ret;
+       struct spm_driver_data *drv = per_cpu(cpu_spm_drv, cpu);
+
+       spm_set_low_power_mode(drv, PM_SLEEP_MODE_SPC);
+       ret = cpu_suspend(0, qcom_pm_collapse);
+       /*
+        * ARM common code executes WFI without calling into our driver and
+        * if the SPM mode is not reset, then we may accidently power down the
+        * cpu when we intended only to gate the cpu clock.
+        * Ensure the state is set to standby before returning.
+        */
+       spm_set_low_power_mode(drv, PM_SLEEP_MODE_STBY);
+
+       return ret;
+}
+
+static int qcom_idle_enter(int cpu, unsigned long index)
+{
+       return per_cpu(qcom_idle_ops, cpu)[index](cpu);
+}
+
+static const struct of_device_id qcom_idle_state_match[] __initconst = {
+       { .compatible = "qcom,idle-state-spc", .data = qcom_cpu_spc },
+       { },
+};
+
+static int __init qcom_cpuidle_init(struct device_node *cpu_node, int cpu)
+{
+       const struct of_device_id *match_id;
+       struct device_node *state_node;
+       int i;
+       int state_count = 1;
+       idle_fn idle_fns[CPUIDLE_STATE_MAX];
+       idle_fn *fns;
+       cpumask_t mask;
+       bool use_scm_power_down = false;
+
+       for (i = 0; ; i++) {
+               state_node = of_parse_phandle(cpu_node, "cpu-idle-states", i);
+               if (!state_node)
+                       break;
+
+               if (!of_device_is_available(state_node))
+                       continue;
+
+               if (i == CPUIDLE_STATE_MAX) {
+                       pr_warn("%s: cpuidle states reached max possible\n",
+                                       __func__);
+                       break;
+               }
+
+               match_id = of_match_node(qcom_idle_state_match, state_node);
+               if (!match_id)
+                       return -ENODEV;
+
+               idle_fns[state_count] = match_id->data;
+
+               /* Check if any of the states allow power down */
+               if (match_id->data == qcom_cpu_spc)
+                       use_scm_power_down = true;
+
+               state_count++;
+       }
+
+       if (state_count == 1)
+               goto check_spm;
+
+       fns = devm_kcalloc(get_cpu_device(cpu), state_count, sizeof(*fns),
+                       GFP_KERNEL);
+       if (!fns)
+               return -ENOMEM;
+
+       for (i = 1; i < state_count; i++)
+               fns[i] = idle_fns[i];
+
+       if (use_scm_power_down) {
+               /* We have atleast one power down mode */
+               cpumask_clear(&mask);
+               cpumask_set_cpu(cpu, &mask);
+               qcom_scm_set_warm_boot_addr(cpu_resume_arm, &mask);
+       }
+
+       per_cpu(qcom_idle_ops, cpu) = fns;
+
+       /*
+        * SPM probe for the cpu should have happened by now, if the
+        * SPM device does not exist, return -ENXIO to indicate that the
+        * cpu does not support idle states.
+        */
+check_spm:
+       return per_cpu(cpu_spm_drv, cpu) ? 0 : -ENXIO;
+}
+
+static struct cpuidle_ops qcom_cpuidle_ops __initdata = {
+       .suspend = qcom_idle_enter,
+       .init = qcom_cpuidle_init,
+};
+
+CPUIDLE_METHOD_OF_DECLARE(qcom_idle_v1, "qcom,kpss-acc-v1", &qcom_cpuidle_ops);
+CPUIDLE_METHOD_OF_DECLARE(qcom_idle_v2, "qcom,kpss-acc-v2", &qcom_cpuidle_ops);
+
+static struct spm_driver_data *spm_get_drv(struct platform_device *pdev,
+               int *spm_cpu)
+{
+       struct spm_driver_data *drv = NULL;
+       struct device_node *cpu_node, *saw_node;
+       int cpu;
+       bool found;
+
+       for_each_possible_cpu(cpu) {
+               cpu_node = of_cpu_device_node_get(cpu);
+               if (!cpu_node)
+                       continue;
+               saw_node = of_parse_phandle(cpu_node, "qcom,saw", 0);
+               found = (saw_node == pdev->dev.of_node);
+               of_node_put(saw_node);
+               of_node_put(cpu_node);
+               if (found)
+                       break;
+       }
+
+       if (found) {
+               drv = devm_kzalloc(&pdev->dev, sizeof(*drv), GFP_KERNEL);
+               if (drv)
+                       *spm_cpu = cpu;
+       }
+
+       return drv;
+}
+
+static const struct of_device_id spm_match_table[] = {
+       { .compatible = "qcom,msm8974-saw2-v2.1-cpu",
+         .data = &spm_reg_8974_8084_cpu },
+       { .compatible = "qcom,apq8084-saw2-v2.1-cpu",
+         .data = &spm_reg_8974_8084_cpu },
+       { .compatible = "qcom,apq8064-saw2-v1.1-cpu",
+         .data = &spm_reg_8064_cpu },
+       { },
+};
+
+static int spm_dev_probe(struct platform_device *pdev)
+{
+       struct spm_driver_data *drv;
+       struct resource *res;
+       const struct of_device_id *match_id;
+       void __iomem *addr;
+       int cpu;
+
+       drv = spm_get_drv(pdev, &cpu);
+       if (!drv)
+               return -EINVAL;
+
+       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+       drv->reg_base = devm_ioremap_resource(&pdev->dev, res);
+       if (IS_ERR(drv->reg_base))
+               return PTR_ERR(drv->reg_base);
+
+       match_id = of_match_node(spm_match_table, pdev->dev.of_node);
+       if (!match_id)
+               return -ENODEV;
+
+       drv->reg_data = match_id->data;
+
+       /* Write the SPM sequences first.. */
+       addr = drv->reg_base + drv->reg_data->reg_offset[SPM_REG_SEQ_ENTRY];
+       __iowrite32_copy(addr, drv->reg_data->seq,
+                       ARRAY_SIZE(drv->reg_data->seq) / 4);
+
+       /*
+        * ..and then the control registers.
+        * On some SoC if the control registers are written first and if the
+        * CPU was held in reset, the reset signal could trigger the SPM state
+        * machine, before the sequences are completely written.
+        */
+       spm_register_write(drv, SPM_REG_CFG, drv->reg_data->spm_cfg);
+       spm_register_write(drv, SPM_REG_DLY, drv->reg_data->spm_dly);
+       spm_register_write(drv, SPM_REG_PMIC_DLY, drv->reg_data->pmic_dly);
+       spm_register_write(drv, SPM_REG_PMIC_DATA_0,
+                               drv->reg_data->pmic_data[0]);
+       spm_register_write(drv, SPM_REG_PMIC_DATA_1,
+                               drv->reg_data->pmic_data[1]);
+
+       /* Set up Standby as the default low power mode */
+       spm_set_low_power_mode(drv, PM_SLEEP_MODE_STBY);
+
+       per_cpu(cpu_spm_drv, cpu) = drv;
+
+       return 0;
+}
+
+static struct platform_driver spm_driver = {
+       .probe = spm_dev_probe,
+       .driver = {
+               .name = "saw",
+               .of_match_table = spm_match_table,
+       },
+};
+module_platform_driver(spm_driver);
+
+MODULE_LICENSE("GPL v2");
+MODULE_DESCRIPTION("SAW power controller driver");
+MODULE_ALIAS("platform:saw");
diff --git a/drivers/soc/sunxi/Kconfig b/drivers/soc/sunxi/Kconfig
new file mode 100644 (file)
index 0000000..353b07e
--- /dev/null
@@ -0,0 +1,10 @@
+#
+# Allwinner sunXi SoC drivers
+#
+config SUNXI_SRAM
+       bool
+       default ARCH_SUNXI
+       help
+         Say y here to enable the SRAM controller support. This
+         device is responsible on mapping the SRAM in the sunXi SoCs
+         whether to the CPU/DMA, or to the devices.
diff --git a/drivers/soc/sunxi/Makefile b/drivers/soc/sunxi/Makefile
new file mode 100644 (file)
index 0000000..4cf9dbd
--- /dev/null
@@ -0,0 +1 @@
+obj-$(CONFIG_SUNXI_SRAM) +=    sunxi_sram.o
diff --git a/drivers/soc/sunxi/sunxi_sram.c b/drivers/soc/sunxi/sunxi_sram.c
new file mode 100644 (file)
index 0000000..bc52670
--- /dev/null
@@ -0,0 +1,284 @@
+/*
+ * Allwinner SoCs SRAM Controller Driver
+ *
+ * Copyright (C) 2015 Maxime Ripard
+ *
+ * Author: Maxime Ripard <maxime.ripard@free-electrons.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.
+ */
+
+#include <linux/debugfs.h>
+#include <linux/io.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/of_device.h>
+#include <linux/platform_device.h>
+
+#include <linux/soc/sunxi/sunxi_sram.h>
+
+struct sunxi_sram_func {
+       char    *func;
+       u8      val;
+};
+
+struct sunxi_sram_data {
+       char                    *name;
+       u8                      reg;
+       u8                      offset;
+       u8                      width;
+       struct sunxi_sram_func  *func;
+       struct list_head        list;
+};
+
+struct sunxi_sram_desc {
+       struct sunxi_sram_data  data;
+       bool                    claimed;
+};
+
+#define SUNXI_SRAM_MAP(_val, _func)                            \
+       {                                                       \
+               .func = _func,                                  \
+               .val = _val,                                    \
+       }
+
+#define SUNXI_SRAM_DATA(_name, _reg, _off, _width, ...)                \
+       {                                                       \
+               .name = _name,                                  \
+               .reg = _reg,                                    \
+               .offset = _off,                                 \
+               .width = _width,                                \
+               .func = (struct sunxi_sram_func[]){             \
+                       __VA_ARGS__, { } },                     \
+       }
+
+static struct sunxi_sram_desc sun4i_a10_sram_a3_a4 = {
+       .data   = SUNXI_SRAM_DATA("A3-A4", 0x4, 0x4, 2,
+                                 SUNXI_SRAM_MAP(0, "cpu"),
+                                 SUNXI_SRAM_MAP(1, "emac")),
+};
+
+static struct sunxi_sram_desc sun4i_a10_sram_d = {
+       .data   = SUNXI_SRAM_DATA("D", 0x4, 0x0, 1,
+                                 SUNXI_SRAM_MAP(0, "cpu"),
+                                 SUNXI_SRAM_MAP(1, "usb-otg")),
+};
+
+static const struct of_device_id sunxi_sram_dt_ids[] = {
+       {
+               .compatible     = "allwinner,sun4i-a10-sram-a3-a4",
+               .data           = &sun4i_a10_sram_a3_a4.data,
+       },
+       {
+               .compatible     = "allwinner,sun4i-a10-sram-d",
+               .data           = &sun4i_a10_sram_d.data,
+       },
+       {}
+};
+
+static struct device *sram_dev;
+static LIST_HEAD(claimed_sram);
+static DEFINE_SPINLOCK(sram_lock);
+static void __iomem *base;
+
+static int sunxi_sram_show(struct seq_file *s, void *data)
+{
+       struct device_node *sram_node, *section_node;
+       const struct sunxi_sram_data *sram_data;
+       const struct of_device_id *match;
+       struct sunxi_sram_func *func;
+       const __be32 *sram_addr_p, *section_addr_p;
+       u32 val;
+
+       seq_puts(s, "Allwinner sunXi SRAM\n");
+       seq_puts(s, "--------------------\n\n");
+
+       for_each_child_of_node(sram_dev->of_node, sram_node) {
+               sram_addr_p = of_get_address(sram_node, 0, NULL, NULL);
+
+               seq_printf(s, "sram@%08x\n",
+                          be32_to_cpu(*sram_addr_p));
+
+               for_each_child_of_node(sram_node, section_node) {
+                       match = of_match_node(sunxi_sram_dt_ids, section_node);
+                       if (!match)
+                               continue;
+                       sram_data = match->data;
+
+                       section_addr_p = of_get_address(section_node, 0,
+                                                       NULL, NULL);
+
+                       seq_printf(s, "\tsection@%04x\t(%s)\n",
+                                  be32_to_cpu(*section_addr_p),
+                                  sram_data->name);
+
+                       val = readl(base + sram_data->reg);
+                       val >>= sram_data->offset;
+                       val &= sram_data->width;
+
+                       for (func = sram_data->func; func->func; func++) {
+                               seq_printf(s, "\t\t%s%c\n", func->func,
+                                          func->val == val ? '*' : ' ');
+                       }
+               }
+
+               seq_puts(s, "\n");
+       }
+
+       return 0;
+}
+
+static int sunxi_sram_open(struct inode *inode, struct file *file)
+{
+       return single_open(file, sunxi_sram_show, inode->i_private);
+}
+
+static const struct file_operations sunxi_sram_fops = {
+       .open = sunxi_sram_open,
+       .read = seq_read,
+       .llseek = seq_lseek,
+       .release = single_release,
+};
+
+static inline struct sunxi_sram_desc *to_sram_desc(const struct sunxi_sram_data *data)
+{
+       return container_of(data, struct sunxi_sram_desc, data);
+}
+
+static const struct sunxi_sram_data *sunxi_sram_of_parse(struct device_node *node,
+                                                        unsigned int *value)
+{
+       const struct of_device_id *match;
+       struct of_phandle_args args;
+       int ret;
+
+       ret = of_parse_phandle_with_fixed_args(node, "allwinner,sram", 1, 0,
+                                              &args);
+       if (ret)
+               return ERR_PTR(ret);
+
+       if (!of_device_is_available(args.np)) {
+               ret = -EBUSY;
+               goto err;
+       }
+
+       if (value)
+               *value = args.args[0];
+
+       match = of_match_node(sunxi_sram_dt_ids, args.np);
+       if (!match) {
+               ret = -EINVAL;
+               goto err;
+       }
+
+       of_node_put(args.np);
+       return match->data;
+
+err:
+       of_node_put(args.np);
+       return ERR_PTR(ret);
+}
+
+int sunxi_sram_claim(struct device *dev)
+{
+       const struct sunxi_sram_data *sram_data;
+       struct sunxi_sram_desc *sram_desc;
+       unsigned int device;
+       u32 val, mask;
+
+       if (IS_ERR(base))
+               return -EPROBE_DEFER;
+
+       if (!dev || !dev->of_node)
+               return -EINVAL;
+
+       sram_data = sunxi_sram_of_parse(dev->of_node, &device);
+       if (IS_ERR(sram_data))
+               return PTR_ERR(sram_data);
+
+       sram_desc = to_sram_desc(sram_data);
+
+       spin_lock(&sram_lock);
+
+       if (sram_desc->claimed) {
+               spin_unlock(&sram_lock);
+               return -EBUSY;
+       }
+
+       mask = GENMASK(sram_data->offset + sram_data->width, sram_data->offset);
+       val = readl(base + sram_data->reg);
+       val &= ~mask;
+       writel(val | ((device << sram_data->offset) & mask),
+              base + sram_data->reg);
+
+       spin_unlock(&sram_lock);
+
+       return 0;
+}
+EXPORT_SYMBOL(sunxi_sram_claim);
+
+int sunxi_sram_release(struct device *dev)
+{
+       const struct sunxi_sram_data *sram_data;
+       struct sunxi_sram_desc *sram_desc;
+
+       if (!dev || !dev->of_node)
+               return -EINVAL;
+
+       sram_data = sunxi_sram_of_parse(dev->of_node, NULL);
+       if (IS_ERR(sram_data))
+               return -EINVAL;
+
+       sram_desc = to_sram_desc(sram_data);
+
+       spin_lock(&sram_lock);
+       sram_desc->claimed = false;
+       spin_unlock(&sram_lock);
+
+       return 0;
+}
+EXPORT_SYMBOL(sunxi_sram_release);
+
+static int sunxi_sram_probe(struct platform_device *pdev)
+{
+       struct resource *res;
+       struct dentry *d;
+
+       sram_dev = &pdev->dev;
+
+       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+       base = devm_ioremap_resource(&pdev->dev, res);
+       if (IS_ERR(base))
+               return PTR_ERR(base);
+
+       of_platform_populate(pdev->dev.of_node, NULL, NULL, &pdev->dev);
+
+       d = debugfs_create_file("sram", S_IRUGO, NULL, NULL,
+                               &sunxi_sram_fops);
+       if (!d)
+               return -ENOMEM;
+
+       return 0;
+}
+
+static const struct of_device_id sunxi_sram_dt_match[] = {
+       { .compatible = "allwinner,sun4i-a10-sram-controller" },
+       { },
+};
+MODULE_DEVICE_TABLE(of, sunxi_sram_dt_match);
+
+static struct platform_driver sunxi_sram_driver = {
+       .driver = {
+               .name           = "sunxi-sram",
+               .of_match_table = sunxi_sram_dt_match,
+       },
+       .probe  = sunxi_sram_probe,
+};
+module_platform_driver(sunxi_sram_driver);
+
+MODULE_AUTHOR("Maxime Ripard <maxime.ripard@free-electrons.com>");
+MODULE_DESCRIPTION("Allwinner sunXi SRAM Controller Driver");
+MODULE_LICENSE("GPL");
index 5eff6f097f980ceb1c5de96b114c7fc686663293..6acc2c44ee2c9afd70bf121786a7267819a86c88 100644 (file)
@@ -59,6 +59,7 @@ static u32 tegra20_fuse_readl(const unsigned int offset)
        int ret;
        u32 val = 0;
        struct dma_async_tx_descriptor *dma_desc;
+       unsigned long time_left;
 
        mutex_lock(&apb_dma_lock);
 
@@ -82,9 +83,10 @@ static u32 tegra20_fuse_readl(const unsigned int offset)
 
        dmaengine_submit(dma_desc);
        dma_async_issue_pending(apb_dma_chan);
-       ret = wait_for_completion_timeout(&apb_dma_wait, msecs_to_jiffies(50));
+       time_left = wait_for_completion_timeout(&apb_dma_wait,
+                                               msecs_to_jiffies(50));
 
-       if (WARN(ret == 0, "apb read dma timed out"))
+       if (WARN(time_left == 0, "apb read dma timed out"))
                dmaengine_terminate_all(apb_dma_chan);
        else
                val = *apb_buffer;
index 3bf5aba4caaa8b4ec9279ff0482dbc57f01dd7f3..73fad05d8f2cf7966052878f217a3ceac2cb566d 100644 (file)
 #define APBMISC_SIZE   0x64
 #define FUSE_SKU_INFO  0x10
 
+#define PMC_STRAPPING_OPT_A_RAM_CODE_SHIFT     4
+#define PMC_STRAPPING_OPT_A_RAM_CODE_MASK_LONG \
+       (0xf << PMC_STRAPPING_OPT_A_RAM_CODE_SHIFT)
+#define PMC_STRAPPING_OPT_A_RAM_CODE_MASK_SHORT        \
+       (0x3 << PMC_STRAPPING_OPT_A_RAM_CODE_SHIFT)
+
 static void __iomem *apbmisc_base;
 static void __iomem *strapping_base;
+static bool long_ram_code;
 
 u32 tegra_read_chipid(void)
 {
@@ -54,6 +61,18 @@ u32 tegra_read_straps(void)
                return 0;
 }
 
+u32 tegra_read_ram_code(void)
+{
+       u32 straps = tegra_read_straps();
+
+       if (long_ram_code)
+               straps &= PMC_STRAPPING_OPT_A_RAM_CODE_MASK_LONG;
+       else
+               straps &= PMC_STRAPPING_OPT_A_RAM_CODE_MASK_SHORT;
+
+       return straps >> PMC_STRAPPING_OPT_A_RAM_CODE_SHIFT;
+}
+
 static const struct of_device_id apbmisc_match[] __initconst = {
        { .compatible = "nvidia,tegra20-apbmisc", },
        {},
@@ -112,4 +131,6 @@ void __init tegra_init_apbmisc(void)
        strapping_base = of_iomap(np, 1);
        if (!strapping_base)
                pr_err("ioremap tegra strapping_base failed\n");
+
+       long_ram_code = of_property_read_bool(np, "nvidia,long-ram-code");
 }
index c956395cf46f961beaf6f56674d20f58b2c717b6..cc119d15dd1616feeef9821ecf98c94fc19ecfec 100644 (file)
@@ -377,13 +377,10 @@ int tegra_pmc_cpu_remove_clamping(int cpuid)
 }
 #endif /* CONFIG_SMP */
 
-/**
- * tegra_pmc_restart() - reboot the system
- * @mode: which mode to reboot in
- * @cmd: reboot command
- */
-void tegra_pmc_restart(enum reboot_mode mode, const char *cmd)
+static int tegra_pmc_restart_notify(struct notifier_block *this,
+                                   unsigned long action, void *data)
 {
+       const char *cmd = data;
        u32 value;
 
        value = tegra_pmc_readl(PMC_SCRATCH0);
@@ -405,8 +402,15 @@ void tegra_pmc_restart(enum reboot_mode mode, const char *cmd)
        value = tegra_pmc_readl(0);
        value |= 0x10;
        tegra_pmc_writel(value, 0);
+
+       return NOTIFY_DONE;
 }
 
+static struct notifier_block tegra_pmc_restart_handler = {
+       .notifier_call = tegra_pmc_restart_notify,
+       .priority = 128,
+};
+
 static int powergate_show(struct seq_file *s, void *data)
 {
        unsigned int i;
@@ -837,6 +841,13 @@ static int tegra_pmc_probe(struct platform_device *pdev)
                        return err;
        }
 
+       err = register_restart_handler(&tegra_pmc_restart_handler);
+       if (err) {
+               dev_err(&pdev->dev, "unable to register restart handler, %d\n",
+                       err);
+               return err;
+       }
+
        return 0;
 }
 
index 09428412139e399979537da2e6272eda827a8757..c5352ea4821ea0df593c7043ac911ee891f103b0 100644 (file)
@@ -621,8 +621,8 @@ static u32 ssb_pmu_get_alp_clock_clk0(struct ssb_chipcommon *cc)
        u32 crystalfreq;
        const struct pmu0_plltab_entry *e = NULL;
 
-       crystalfreq = chipco_read32(cc, SSB_CHIPCO_PMU_CTL) &
-                     SSB_CHIPCO_PMU_CTL_XTALFREQ >> SSB_CHIPCO_PMU_CTL_XTALFREQ_SHIFT;
+       crystalfreq = (chipco_read32(cc, SSB_CHIPCO_PMU_CTL) &
+                      SSB_CHIPCO_PMU_CTL_XTALFREQ)  >> SSB_CHIPCO_PMU_CTL_XTALFREQ_SHIFT;
        e = pmu0_plltab_find_entry(crystalfreq);
        BUG_ON(!e);
        return e->freq * 1000;
@@ -634,7 +634,7 @@ u32 ssb_pmu_get_alp_clock(struct ssb_chipcommon *cc)
 
        switch (bus->chip_id) {
        case 0x5354:
-               ssb_pmu_get_alp_clock_clk0(cc);
+               return ssb_pmu_get_alp_clock_clk0(cc);
        default:
                ssb_err("ERROR: PMU alp clock unknown for device %04X\n",
                        bus->chip_id);
index e894eb278d8336d018d3e6e8c29556dc9b5f3cb5..eba1b7ac729454d30b1d611cd01d45b5ba23407e 100644 (file)
@@ -423,6 +423,7 @@ int vp_set_vq_affinity(struct virtqueue *vq, int cpu)
                if (cpu == -1)
                        irq_set_affinity_hint(irq, NULL);
                else {
+                       cpumask_clear(mask);
                        cpumask_set_cpu(cpu, mask);
                        irq_set_affinity_hint(irq, mask);
                }
index 2b5a9bbf80b7e08989040d9b46d890ff54b06813..7116968dee12944ebca036127aedc136825f2dda 100644 (file)
  * option) any later version.
  */
 
+#include <linux/delay.h>
+#include <linux/reboot.h>
 #include <linux/types.h>
 #include <linux/module.h>
 #include <linux/io.h>
 #include <linux/watchdog.h>
 #include <linux/platform_device.h>
 #include <linux/of_address.h>
+#include <linux/of_platform.h>
 
 #define PM_RSTC                                0x1c
+#define PM_RSTS                                0x20
 #define PM_WDOG                                0x24
 
 #define PM_PASSWORD                    0x5a000000
 
 #define PM_WDOG_TIME_SET               0x000fffff
 #define PM_RSTC_WRCFG_CLR              0xffffffcf
+#define PM_RSTS_HADWRH_SET             0x00000040
 #define PM_RSTC_WRCFG_SET              0x00000030
 #define PM_RSTC_WRCFG_FULL_RESET       0x00000020
 #define PM_RSTC_RESET                  0x00000102
@@ -37,6 +42,7 @@
 struct bcm2835_wdt {
        void __iomem            *base;
        spinlock_t              lock;
+       struct notifier_block   restart_handler;
 };
 
 static unsigned int heartbeat;
@@ -106,6 +112,53 @@ static struct watchdog_device bcm2835_wdt_wdd = {
        .timeout =      WDOG_TICKS_TO_SECS(PM_WDOG_TIME_SET),
 };
 
+static int
+bcm2835_restart(struct notifier_block *this, unsigned long mode, void *cmd)
+{
+       struct bcm2835_wdt *wdt = container_of(this, struct bcm2835_wdt,
+                                              restart_handler);
+       u32 val;
+
+       /* use a timeout of 10 ticks (~150us) */
+       writel_relaxed(10 | PM_PASSWORD, wdt->base + PM_WDOG);
+       val = readl_relaxed(wdt->base + PM_RSTC);
+       val &= PM_RSTC_WRCFG_CLR;
+       val |= PM_PASSWORD | PM_RSTC_WRCFG_FULL_RESET;
+       writel_relaxed(val, wdt->base + PM_RSTC);
+
+       /* No sleeping, possibly atomic. */
+       mdelay(1);
+
+       return 0;
+}
+
+/*
+ * We can't really power off, but if we do the normal reset scheme, and
+ * indicate to bootcode.bin not to reboot, then most of the chip will be
+ * powered off.
+ */
+static void bcm2835_power_off(void)
+{
+       struct device_node *np =
+               of_find_compatible_node(NULL, NULL, "brcm,bcm2835-pm-wdt");
+       struct platform_device *pdev = of_find_device_by_node(np);
+       struct bcm2835_wdt *wdt = platform_get_drvdata(pdev);
+       u32 val;
+
+       /*
+        * We set the watchdog hard reset bit here to distinguish this reset
+        * from the normal (full) reset. bootcode.bin will not reboot after a
+        * hard reset.
+        */
+       val = readl_relaxed(wdt->base + PM_RSTS);
+       val &= PM_RSTC_WRCFG_CLR;
+       val |= PM_PASSWORD | PM_RSTS_HADWRH_SET;
+       writel_relaxed(val, wdt->base + PM_RSTS);
+
+       /* Continue with normal reset mechanism */
+       bcm2835_restart(&wdt->restart_handler, REBOOT_HARD, NULL);
+}
+
 static int bcm2835_wdt_probe(struct platform_device *pdev)
 {
        struct device *dev = &pdev->dev;
@@ -136,6 +189,12 @@ static int bcm2835_wdt_probe(struct platform_device *pdev)
                return err;
        }
 
+       wdt->restart_handler.notifier_call = bcm2835_restart;
+       wdt->restart_handler.priority = 128;
+       register_restart_handler(&wdt->restart_handler);
+       if (pm_power_off == NULL)
+               pm_power_off = bcm2835_power_off;
+
        dev_info(dev, "Broadcom BCM2835 watchdog timer");
        return 0;
 }
@@ -144,6 +203,9 @@ static int bcm2835_wdt_remove(struct platform_device *pdev)
 {
        struct bcm2835_wdt *wdt = platform_get_drvdata(pdev);
 
+       unregister_restart_handler(&wdt->restart_handler);
+       if (pm_power_off == bcm2835_power_off)
+               pm_power_off = NULL;
        watchdog_unregister_device(&bcm2835_wdt_wdd);
        iounmap(wdt->base);
 
diff --git a/include/dt-bindings/clock/imx7d-clock.h b/include/dt-bindings/clock/imx7d-clock.h
new file mode 100644 (file)
index 0000000..728df28
--- /dev/null
@@ -0,0 +1,450 @@
+/*
+ * Copyright (C) 2014-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 __DT_BINDINGS_CLOCK_IMX7D_H
+#define __DT_BINDINGS_CLOCK_IMX7D_H
+
+#define IMX7D_OSC_24M_CLK              0
+#define IMX7D_PLL_ARM_MAIN             1
+#define IMX7D_PLL_ARM_MAIN_CLK         2
+#define IMX7D_PLL_ARM_MAIN_SRC         3
+#define IMX7D_PLL_ARM_MAIN_BYPASS      4
+#define IMX7D_PLL_SYS_MAIN             5
+#define IMX7D_PLL_SYS_MAIN_CLK         6
+#define IMX7D_PLL_SYS_MAIN_SRC         7
+#define IMX7D_PLL_SYS_MAIN_BYPASS      8
+#define IMX7D_PLL_SYS_MAIN_480M                9
+#define IMX7D_PLL_SYS_MAIN_240M                10
+#define IMX7D_PLL_SYS_MAIN_120M                11
+#define IMX7D_PLL_SYS_MAIN_480M_CLK    12
+#define IMX7D_PLL_SYS_MAIN_240M_CLK    13
+#define IMX7D_PLL_SYS_MAIN_120M_CLK    14
+#define IMX7D_PLL_SYS_PFD0_392M_CLK    15
+#define IMX7D_PLL_SYS_PFD0_196M                16
+#define IMX7D_PLL_SYS_PFD0_196M_CLK    17
+#define IMX7D_PLL_SYS_PFD1_332M_CLK    18
+#define IMX7D_PLL_SYS_PFD1_166M                19
+#define IMX7D_PLL_SYS_PFD1_166M_CLK    20
+#define IMX7D_PLL_SYS_PFD2_270M_CLK    21
+#define IMX7D_PLL_SYS_PFD2_135M                22
+#define IMX7D_PLL_SYS_PFD2_135M_CLK    23
+#define IMX7D_PLL_SYS_PFD3_CLK         24
+#define IMX7D_PLL_SYS_PFD4_CLK         25
+#define IMX7D_PLL_SYS_PFD5_CLK         26
+#define IMX7D_PLL_SYS_PFD6_CLK         27
+#define IMX7D_PLL_SYS_PFD7_CLK         28
+#define IMX7D_PLL_ENET_MAIN            29
+#define IMX7D_PLL_ENET_MAIN_CLK                30
+#define IMX7D_PLL_ENET_MAIN_SRC                31
+#define IMX7D_PLL_ENET_MAIN_BYPASS     32
+#define IMX7D_PLL_ENET_MAIN_500M       33
+#define IMX7D_PLL_ENET_MAIN_250M       34
+#define IMX7D_PLL_ENET_MAIN_125M       35
+#define IMX7D_PLL_ENET_MAIN_100M       36
+#define IMX7D_PLL_ENET_MAIN_50M                37
+#define IMX7D_PLL_ENET_MAIN_40M                38
+#define IMX7D_PLL_ENET_MAIN_25M                39
+#define IMX7D_PLL_ENET_MAIN_500M_CLK   40
+#define IMX7D_PLL_ENET_MAIN_250M_CLK   41
+#define IMX7D_PLL_ENET_MAIN_125M_CLK   42
+#define IMX7D_PLL_ENET_MAIN_100M_CLK   43
+#define IMX7D_PLL_ENET_MAIN_50M_CLK    44
+#define IMX7D_PLL_ENET_MAIN_40M_CLK    45
+#define IMX7D_PLL_ENET_MAIN_25M_CLK    46
+#define IMX7D_PLL_DRAM_MAIN            47
+#define IMX7D_PLL_DRAM_MAIN_CLK                48
+#define IMX7D_PLL_DRAM_MAIN_SRC                49
+#define IMX7D_PLL_DRAM_MAIN_BYPASS     50
+#define IMX7D_PLL_DRAM_MAIN_533M       51
+#define IMX7D_PLL_DRAM_MAIN_533M_CLK   52
+#define IMX7D_PLL_AUDIO_MAIN           53
+#define IMX7D_PLL_AUDIO_MAIN_CLK       54
+#define IMX7D_PLL_AUDIO_MAIN_SRC       55
+#define IMX7D_PLL_AUDIO_MAIN_BYPASS    56
+#define IMX7D_PLL_VIDEO_MAIN_CLK       57
+#define IMX7D_PLL_VIDEO_MAIN           58
+#define IMX7D_PLL_VIDEO_MAIN_SRC       59
+#define IMX7D_PLL_VIDEO_MAIN_BYPASS    60
+#define IMX7D_USB_MAIN_480M_CLK                61
+#define IMX7D_ARM_A7_ROOT_CLK          62
+#define IMX7D_ARM_A7_ROOT_SRC          63
+#define IMX7D_ARM_A7_ROOT_CG           64
+#define IMX7D_ARM_A7_ROOT_DIV          65
+#define IMX7D_ARM_M4_ROOT_CLK          66
+#define IMX7D_ARM_M4_ROOT_SRC          67
+#define IMX7D_ARM_M4_ROOT_CG           68
+#define IMX7D_ARM_M4_ROOT_DIV          69
+#define IMX7D_ARM_M0_ROOT_CLK          70
+#define IMX7D_ARM_M0_ROOT_SRC          71
+#define IMX7D_ARM_M0_ROOT_CG           72
+#define IMX7D_ARM_M0_ROOT_DIV          73
+#define IMX7D_MAIN_AXI_ROOT_CLK                74
+#define IMX7D_MAIN_AXI_ROOT_SRC                75
+#define IMX7D_MAIN_AXI_ROOT_CG         76
+#define IMX7D_MAIN_AXI_ROOT_DIV                77
+#define IMX7D_DISP_AXI_ROOT_CLK                78
+#define IMX7D_DISP_AXI_ROOT_SRC                79
+#define IMX7D_DISP_AXI_ROOT_CG         80
+#define IMX7D_DISP_AXI_ROOT_DIV                81
+#define IMX7D_ENET_AXI_ROOT_CLK                82
+#define IMX7D_ENET_AXI_ROOT_SRC                83
+#define IMX7D_ENET_AXI_ROOT_CG         84
+#define IMX7D_ENET_AXI_ROOT_DIV                85
+#define IMX7D_NAND_USDHC_BUS_ROOT_CLK  86
+#define IMX7D_NAND_USDHC_BUS_ROOT_SRC  87
+#define IMX7D_NAND_USDHC_BUS_ROOT_CG   88
+#define IMX7D_NAND_USDHC_BUS_ROOT_DIV  89
+#define IMX7D_AHB_CHANNEL_ROOT_CLK     90
+#define IMX7D_AHB_CHANNEL_ROOT_SRC     91
+#define IMX7D_AHB_CHANNEL_ROOT_CG      92
+#define IMX7D_AHB_CHANNEL_ROOT_DIV     93
+#define IMX7D_DRAM_PHYM_ROOT_CLK       94
+#define IMX7D_DRAM_PHYM_ROOT_SRC       95
+#define IMX7D_DRAM_PHYM_ROOT_CG                96
+#define IMX7D_DRAM_PHYM_ROOT_DIV       97
+#define IMX7D_DRAM_ROOT_CLK            98
+#define IMX7D_DRAM_ROOT_SRC            99
+#define IMX7D_DRAM_ROOT_CG             100
+#define IMX7D_DRAM_ROOT_DIV            101
+#define IMX7D_DRAM_PHYM_ALT_ROOT_CLK   102
+#define IMX7D_DRAM_PHYM_ALT_ROOT_SRC   103
+#define IMX7D_DRAM_PHYM_ALT_ROOT_CG    104
+#define IMX7D_DRAM_PHYM_ALT_ROOT_DIV   105
+#define IMX7D_DRAM_ALT_ROOT_CLK                106
+#define IMX7D_DRAM_ALT_ROOT_SRC                107
+#define IMX7D_DRAM_ALT_ROOT_CG         108
+#define IMX7D_DRAM_ALT_ROOT_DIV                109
+#define IMX7D_USB_HSIC_ROOT_CLK                110
+#define IMX7D_USB_HSIC_ROOT_SRC                111
+#define IMX7D_USB_HSIC_ROOT_CG         112
+#define IMX7D_USB_HSIC_ROOT_DIV                113
+#define IMX7D_PCIE_CTRL_ROOT_CLK       114
+#define IMX7D_PCIE_CTRL_ROOT_SRC       115
+#define IMX7D_PCIE_CTRL_ROOT_CG                116
+#define IMX7D_PCIE_CTRL_ROOT_DIV       117
+#define IMX7D_PCIE_PHY_ROOT_CLK                118
+#define IMX7D_PCIE_PHY_ROOT_SRC                119
+#define IMX7D_PCIE_PHY_ROOT_CG         120
+#define IMX7D_PCIE_PHY_ROOT_DIV                121
+#define IMX7D_EPDC_PIXEL_ROOT_CLK      122
+#define IMX7D_EPDC_PIXEL_ROOT_SRC      123
+#define IMX7D_EPDC_PIXEL_ROOT_CG       124
+#define IMX7D_EPDC_PIXEL_ROOT_DIV      125
+#define IMX7D_LCDIF_PIXEL_ROOT_CLK     126
+#define IMX7D_LCDIF_PIXEL_ROOT_SRC     127
+#define IMX7D_LCDIF_PIXEL_ROOT_CG      128
+#define IMX7D_LCDIF_PIXEL_ROOT_DIV     129
+#define IMX7D_MIPI_DSI_ROOT_CLK                130
+#define IMX7D_MIPI_DSI_ROOT_SRC                131
+#define IMX7D_MIPI_DSI_ROOT_CG         132
+#define IMX7D_MIPI_DSI_ROOT_DIV                133
+#define IMX7D_MIPI_CSI_ROOT_CLK                134
+#define IMX7D_MIPI_CSI_ROOT_SRC                135
+#define IMX7D_MIPI_CSI_ROOT_CG         136
+#define IMX7D_MIPI_CSI_ROOT_DIV                137
+#define IMX7D_MIPI_DPHY_ROOT_CLK       138
+#define IMX7D_MIPI_DPHY_ROOT_SRC       139
+#define IMX7D_MIPI_DPHY_ROOT_CG                140
+#define IMX7D_MIPI_DPHY_ROOT_DIV       141
+#define IMX7D_SAI1_ROOT_CLK            142
+#define IMX7D_SAI1_ROOT_SRC            143
+#define IMX7D_SAI1_ROOT_CG             144
+#define IMX7D_SAI1_ROOT_DIV            145
+#define IMX7D_SAI2_ROOT_CLK            146
+#define IMX7D_SAI2_ROOT_SRC            147
+#define IMX7D_SAI2_ROOT_CG             148
+#define IMX7D_SAI2_ROOT_DIV            149
+#define IMX7D_SAI3_ROOT_CLK            150
+#define IMX7D_SAI3_ROOT_SRC            151
+#define IMX7D_SAI3_ROOT_CG             152
+#define IMX7D_SAI3_ROOT_DIV            153
+#define IMX7D_SPDIF_ROOT_CLK           154
+#define IMX7D_SPDIF_ROOT_SRC           155
+#define IMX7D_SPDIF_ROOT_CG            156
+#define IMX7D_SPDIF_ROOT_DIV           157
+#define IMX7D_ENET1_REF_ROOT_CLK       158
+#define IMX7D_ENET1_REF_ROOT_SRC       159
+#define IMX7D_ENET1_REF_ROOT_CG                160
+#define IMX7D_ENET1_REF_ROOT_DIV       161
+#define IMX7D_ENET1_TIME_ROOT_CLK      162
+#define IMX7D_ENET1_TIME_ROOT_SRC      163
+#define IMX7D_ENET1_TIME_ROOT_CG       164
+#define IMX7D_ENET1_TIME_ROOT_DIV      165
+#define IMX7D_ENET2_REF_ROOT_CLK       166
+#define IMX7D_ENET2_REF_ROOT_SRC       167
+#define IMX7D_ENET2_REF_ROOT_CG                168
+#define IMX7D_ENET2_REF_ROOT_DIV       169
+#define IMX7D_ENET2_TIME_ROOT_CLK      170
+#define IMX7D_ENET2_TIME_ROOT_SRC      171
+#define IMX7D_ENET2_TIME_ROOT_CG       172
+#define IMX7D_ENET2_TIME_ROOT_DIV      173
+#define IMX7D_ENET_PHY_REF_ROOT_CLK    174
+#define IMX7D_ENET_PHY_REF_ROOT_SRC    175
+#define IMX7D_ENET_PHY_REF_ROOT_CG     176
+#define IMX7D_ENET_PHY_REF_ROOT_DIV    177
+#define IMX7D_EIM_ROOT_CLK             178
+#define IMX7D_EIM_ROOT_SRC             179
+#define IMX7D_EIM_ROOT_CG              180
+#define IMX7D_EIM_ROOT_DIV             181
+#define IMX7D_NAND_ROOT_CLK            182
+#define IMX7D_NAND_ROOT_SRC            183
+#define IMX7D_NAND_ROOT_CG             184
+#define IMX7D_NAND_ROOT_DIV            185
+#define IMX7D_QSPI_ROOT_CLK            186
+#define IMX7D_QSPI_ROOT_SRC            187
+#define IMX7D_QSPI_ROOT_CG             188
+#define IMX7D_QSPI_ROOT_DIV            189
+#define IMX7D_USDHC1_ROOT_CLK          190
+#define IMX7D_USDHC1_ROOT_SRC          191
+#define IMX7D_USDHC1_ROOT_CG           192
+#define IMX7D_USDHC1_ROOT_DIV          193
+#define IMX7D_USDHC2_ROOT_CLK          194
+#define IMX7D_USDHC2_ROOT_SRC          195
+#define IMX7D_USDHC2_ROOT_CG           196
+#define IMX7D_USDHC2_ROOT_DIV          197
+#define IMX7D_USDHC3_ROOT_CLK          198
+#define IMX7D_USDHC3_ROOT_SRC          199
+#define IMX7D_USDHC3_ROOT_CG           200
+#define IMX7D_USDHC3_ROOT_DIV          201
+#define IMX7D_CAN1_ROOT_CLK            202
+#define IMX7D_CAN1_ROOT_SRC            203
+#define IMX7D_CAN1_ROOT_CG             204
+#define IMX7D_CAN1_ROOT_DIV            205
+#define IMX7D_CAN2_ROOT_CLK            206
+#define IMX7D_CAN2_ROOT_SRC            207
+#define IMX7D_CAN2_ROOT_CG             208
+#define IMX7D_CAN2_ROOT_DIV            209
+#define IMX7D_I2C1_ROOT_CLK            210
+#define IMX7D_I2C1_ROOT_SRC            211
+#define IMX7D_I2C1_ROOT_CG             212
+#define IMX7D_I2C1_ROOT_DIV            213
+#define IMX7D_I2C2_ROOT_CLK            214
+#define IMX7D_I2C2_ROOT_SRC            215
+#define IMX7D_I2C2_ROOT_CG             216
+#define IMX7D_I2C2_ROOT_DIV            217
+#define IMX7D_I2C3_ROOT_CLK            218
+#define IMX7D_I2C3_ROOT_SRC            219
+#define IMX7D_I2C3_ROOT_CG             220
+#define IMX7D_I2C3_ROOT_DIV            221
+#define IMX7D_I2C4_ROOT_CLK            222
+#define IMX7D_I2C4_ROOT_SRC            223
+#define IMX7D_I2C4_ROOT_CG             224
+#define IMX7D_I2C4_ROOT_DIV            225
+#define IMX7D_UART1_ROOT_CLK           226
+#define IMX7D_UART1_ROOT_SRC           227
+#define IMX7D_UART1_ROOT_CG            228
+#define IMX7D_UART1_ROOT_DIV           229
+#define IMX7D_UART2_ROOT_CLK           230
+#define IMX7D_UART2_ROOT_SRC           231
+#define IMX7D_UART2_ROOT_CG            232
+#define IMX7D_UART2_ROOT_DIV           233
+#define IMX7D_UART3_ROOT_CLK           234
+#define IMX7D_UART3_ROOT_SRC           235
+#define IMX7D_UART3_ROOT_CG            236
+#define IMX7D_UART3_ROOT_DIV           237
+#define IMX7D_UART4_ROOT_CLK           238
+#define IMX7D_UART4_ROOT_SRC           239
+#define IMX7D_UART4_ROOT_CG            240
+#define IMX7D_UART4_ROOT_DIV           241
+#define IMX7D_UART5_ROOT_CLK           242
+#define IMX7D_UART5_ROOT_SRC           243
+#define IMX7D_UART5_ROOT_CG            244
+#define IMX7D_UART5_ROOT_DIV           245
+#define IMX7D_UART6_ROOT_CLK           246
+#define IMX7D_UART6_ROOT_SRC           247
+#define IMX7D_UART6_ROOT_CG            248
+#define IMX7D_UART6_ROOT_DIV           249
+#define IMX7D_UART7_ROOT_CLK           250
+#define IMX7D_UART7_ROOT_SRC           251
+#define IMX7D_UART7_ROOT_CG            252
+#define IMX7D_UART7_ROOT_DIV           253
+#define IMX7D_ECSPI1_ROOT_CLK          254
+#define IMX7D_ECSPI1_ROOT_SRC          255
+#define IMX7D_ECSPI1_ROOT_CG           256
+#define IMX7D_ECSPI1_ROOT_DIV          257
+#define IMX7D_ECSPI2_ROOT_CLK          258
+#define IMX7D_ECSPI2_ROOT_SRC          259
+#define IMX7D_ECSPI2_ROOT_CG           260
+#define IMX7D_ECSPI2_ROOT_DIV          261
+#define IMX7D_ECSPI3_ROOT_CLK          262
+#define IMX7D_ECSPI3_ROOT_SRC          263
+#define IMX7D_ECSPI3_ROOT_CG           264
+#define IMX7D_ECSPI3_ROOT_DIV          265
+#define IMX7D_ECSPI4_ROOT_CLK          266
+#define IMX7D_ECSPI4_ROOT_SRC          267
+#define IMX7D_ECSPI4_ROOT_CG           268
+#define IMX7D_ECSPI4_ROOT_DIV          269
+#define IMX7D_PWM1_ROOT_CLK            270
+#define IMX7D_PWM1_ROOT_SRC            271
+#define IMX7D_PWM1_ROOT_CG             272
+#define IMX7D_PWM1_ROOT_DIV            273
+#define IMX7D_PWM2_ROOT_CLK            274
+#define IMX7D_PWM2_ROOT_SRC            275
+#define IMX7D_PWM2_ROOT_CG             276
+#define IMX7D_PWM2_ROOT_DIV            277
+#define IMX7D_PWM3_ROOT_CLK            278
+#define IMX7D_PWM3_ROOT_SRC            279
+#define IMX7D_PWM3_ROOT_CG             280
+#define IMX7D_PWM3_ROOT_DIV            281
+#define IMX7D_PWM4_ROOT_CLK            282
+#define IMX7D_PWM4_ROOT_SRC            283
+#define IMX7D_PWM4_ROOT_CG             284
+#define IMX7D_PWM4_ROOT_DIV            285
+#define IMX7D_FLEXTIMER1_ROOT_CLK      286
+#define IMX7D_FLEXTIMER1_ROOT_SRC      287
+#define IMX7D_FLEXTIMER1_ROOT_CG       288
+#define IMX7D_FLEXTIMER1_ROOT_DIV      289
+#define IMX7D_FLEXTIMER2_ROOT_CLK      290
+#define IMX7D_FLEXTIMER2_ROOT_SRC      291
+#define IMX7D_FLEXTIMER2_ROOT_CG       292
+#define IMX7D_FLEXTIMER2_ROOT_DIV      293
+#define IMX7D_SIM1_ROOT_CLK            294
+#define IMX7D_SIM1_ROOT_SRC            295
+#define IMX7D_SIM1_ROOT_CG             296
+#define IMX7D_SIM1_ROOT_DIV            297
+#define IMX7D_SIM2_ROOT_CLK            298
+#define IMX7D_SIM2_ROOT_SRC            299
+#define IMX7D_SIM2_ROOT_CG             300
+#define IMX7D_SIM2_ROOT_DIV            301
+#define IMX7D_GPT1_ROOT_CLK            302
+#define IMX7D_GPT1_ROOT_SRC            303
+#define IMX7D_GPT1_ROOT_CG             304
+#define IMX7D_GPT1_ROOT_DIV            305
+#define IMX7D_GPT2_ROOT_CLK            306
+#define IMX7D_GPT2_ROOT_SRC            307
+#define IMX7D_GPT2_ROOT_CG             308
+#define IMX7D_GPT2_ROOT_DIV            309
+#define IMX7D_GPT3_ROOT_CLK            310
+#define IMX7D_GPT3_ROOT_SRC            311
+#define IMX7D_GPT3_ROOT_CG             312
+#define IMX7D_GPT3_ROOT_DIV            313
+#define IMX7D_GPT4_ROOT_CLK            314
+#define IMX7D_GPT4_ROOT_SRC            315
+#define IMX7D_GPT4_ROOT_CG             316
+#define IMX7D_GPT4_ROOT_DIV            317
+#define IMX7D_TRACE_ROOT_CLK           318
+#define IMX7D_TRACE_ROOT_SRC           319
+#define IMX7D_TRACE_ROOT_CG            320
+#define IMX7D_TRACE_ROOT_DIV           321
+#define IMX7D_WDOG1_ROOT_CLK           322
+#define IMX7D_WDOG_ROOT_SRC            323
+#define IMX7D_WDOG_ROOT_CG             324
+#define IMX7D_WDOG_ROOT_DIV            325
+#define IMX7D_CSI_MCLK_ROOT_CLK                326
+#define IMX7D_CSI_MCLK_ROOT_SRC                327
+#define IMX7D_CSI_MCLK_ROOT_CG         328
+#define IMX7D_CSI_MCLK_ROOT_DIV                329
+#define IMX7D_AUDIO_MCLK_ROOT_CLK      330
+#define IMX7D_AUDIO_MCLK_ROOT_SRC      331
+#define IMX7D_AUDIO_MCLK_ROOT_CG       332
+#define IMX7D_AUDIO_MCLK_ROOT_DIV      333
+#define IMX7D_WRCLK_ROOT_CLK           334
+#define IMX7D_WRCLK_ROOT_SRC           335
+#define IMX7D_WRCLK_ROOT_CG            336
+#define IMX7D_WRCLK_ROOT_DIV           337
+#define IMX7D_CLKO1_ROOT_SRC           338
+#define IMX7D_CLKO1_ROOT_CG            339
+#define IMX7D_CLKO1_ROOT_DIV           340
+#define IMX7D_CLKO2_ROOT_SRC           341
+#define IMX7D_CLKO2_ROOT_CG            342
+#define IMX7D_CLKO2_ROOT_DIV           343
+#define IMX7D_MAIN_AXI_ROOT_PRE_DIV    344
+#define IMX7D_DISP_AXI_ROOT_PRE_DIV    345
+#define IMX7D_ENET_AXI_ROOT_PRE_DIV    346
+#define IMX7D_NAND_USDHC_BUS_ROOT_PRE_DIV 347
+#define IMX7D_AHB_CHANNEL_ROOT_PRE_DIV 348
+#define IMX7D_USB_HSIC_ROOT_PRE_DIV    349
+#define IMX7D_PCIE_CTRL_ROOT_PRE_DIV   350
+#define IMX7D_PCIE_PHY_ROOT_PRE_DIV    351
+#define IMX7D_EPDC_PIXEL_ROOT_PRE_DIV  352
+#define IMX7D_LCDIF_PIXEL_ROOT_PRE_DIV 353
+#define IMX7D_MIPI_DSI_ROOT_PRE_DIV    354
+#define IMX7D_MIPI_CSI_ROOT_PRE_DIV    355
+#define IMX7D_MIPI_DPHY_ROOT_PRE_DIV   356
+#define IMX7D_SAI1_ROOT_PRE_DIV                357
+#define IMX7D_SAI2_ROOT_PRE_DIV                358
+#define IMX7D_SAI3_ROOT_PRE_DIV                359
+#define IMX7D_SPDIF_ROOT_PRE_DIV       360
+#define IMX7D_ENET1_REF_ROOT_PRE_DIV   361
+#define IMX7D_ENET1_TIME_ROOT_PRE_DIV  362
+#define IMX7D_ENET2_REF_ROOT_PRE_DIV   363
+#define IMX7D_ENET2_TIME_ROOT_PRE_DIV  364
+#define IMX7D_ENET_PHY_REF_ROOT_PRE_DIV 365
+#define IMX7D_EIM_ROOT_PRE_DIV         366
+#define IMX7D_NAND_ROOT_PRE_DIV                367
+#define IMX7D_QSPI_ROOT_PRE_DIV                368
+#define IMX7D_USDHC1_ROOT_PRE_DIV      369
+#define IMX7D_USDHC2_ROOT_PRE_DIV      370
+#define IMX7D_USDHC3_ROOT_PRE_DIV      371
+#define IMX7D_CAN1_ROOT_PRE_DIV                372
+#define IMX7D_CAN2_ROOT_PRE_DIV                373
+#define IMX7D_I2C1_ROOT_PRE_DIV                374
+#define IMX7D_I2C2_ROOT_PRE_DIV                375
+#define IMX7D_I2C3_ROOT_PRE_DIV                376
+#define IMX7D_I2C4_ROOT_PRE_DIV                377
+#define IMX7D_UART1_ROOT_PRE_DIV       378
+#define IMX7D_UART2_ROOT_PRE_DIV       379
+#define IMX7D_UART3_ROOT_PRE_DIV       380
+#define IMX7D_UART4_ROOT_PRE_DIV       381
+#define IMX7D_UART5_ROOT_PRE_DIV       382
+#define IMX7D_UART6_ROOT_PRE_DIV       383
+#define IMX7D_UART7_ROOT_PRE_DIV       384
+#define IMX7D_ECSPI1_ROOT_PRE_DIV      385
+#define IMX7D_ECSPI2_ROOT_PRE_DIV      386
+#define IMX7D_ECSPI3_ROOT_PRE_DIV      387
+#define IMX7D_ECSPI4_ROOT_PRE_DIV      388
+#define IMX7D_PWM1_ROOT_PRE_DIV                389
+#define IMX7D_PWM2_ROOT_PRE_DIV                390
+#define IMX7D_PWM3_ROOT_PRE_DIV                391
+#define IMX7D_PWM4_ROOT_PRE_DIV                392
+#define IMX7D_FLEXTIMER1_ROOT_PRE_DIV  393
+#define IMX7D_FLEXTIMER2_ROOT_PRE_DIV  394
+#define IMX7D_SIM1_ROOT_PRE_DIV                395
+#define IMX7D_SIM2_ROOT_PRE_DIV                396
+#define IMX7D_GPT1_ROOT_PRE_DIV                397
+#define IMX7D_GPT2_ROOT_PRE_DIV                398
+#define IMX7D_GPT3_ROOT_PRE_DIV                399
+#define IMX7D_GPT4_ROOT_PRE_DIV                400
+#define IMX7D_TRACE_ROOT_PRE_DIV       401
+#define IMX7D_WDOG_ROOT_PRE_DIV                402
+#define IMX7D_CSI_MCLK_ROOT_PRE_DIV    403
+#define IMX7D_AUDIO_MCLK_ROOT_PRE_DIV  404
+#define IMX7D_WRCLK_ROOT_PRE_DIV       405
+#define IMX7D_CLKO1_ROOT_PRE_DIV       406
+#define IMX7D_CLKO2_ROOT_PRE_DIV       407
+#define IMX7D_DRAM_PHYM_ALT_ROOT_PRE_DIV 408
+#define IMX7D_DRAM_ALT_ROOT_PRE_DIV    409
+#define IMX7D_LVDS1_IN_CLK             410
+#define IMX7D_LVDS1_OUT_SEL            411
+#define IMX7D_LVDS1_OUT_CLK            412
+#define IMX7D_CLK_DUMMY                        413
+#define IMX7D_GPT_3M_CLK               414
+#define IMX7D_OCRAM_CLK                        415
+#define IMX7D_OCRAM_S_CLK              416
+#define IMX7D_WDOG2_ROOT_CLK           417
+#define IMX7D_WDOG3_ROOT_CLK           418
+#define IMX7D_WDOG4_ROOT_CLK           419
+#define IMX7D_SDMA_CORE_CLK            420
+#define IMX7D_USB1_MAIN_480M_CLK       421
+#define IMX7D_USB_CTRL_CLK             422
+#define IMX7D_USB_PHY1_CLK             423
+#define IMX7D_USB_PHY2_CLK             424
+#define IMX7D_IPG_ROOT_CLK             425
+#define IMX7D_SAI1_IPG_CLK             426
+#define IMX7D_SAI2_IPG_CLK             427
+#define IMX7D_SAI3_IPG_CLK             428
+#define IMX7D_PLL_AUDIO_TEST_DIV       429
+#define IMX7D_PLL_AUDIO_POST_DIV       430
+#define IMX7D_PLL_VIDEO_TEST_DIV       431
+#define IMX7D_PLL_VIDEO_POST_DIV       432
+#define IMX7D_MU_ROOT_CLK              433
+#define IMX7D_SEMA4_HS_ROOT_CLK                434
+#define IMX7D_PLL_DRAM_TEST_DIV                435
+#define IMX7D_CLK_END                  436
+#endif /* __DT_BINDINGS_CLOCK_IMX7D_H */
index 9a4b4c9ca44aba707e793ceeafa09a1d935027ad..dd11ecdf837e8e65da9e241ef55cdfe376722eb2 100644 (file)
@@ -54,6 +54,7 @@
 #define R8A73A4_CLK_IIC3       11
 #define R8A73A4_CLK_IIC4       10
 #define R8A73A4_CLK_IIC5       9
+#define R8A73A4_CLK_IRQC       7
 
 /* MSTP5 */
 #define R8A73A4_CLK_THERMAL    22
index 3f2c6b198d4ac2890af9b1eb07b19988e6b106e8..ff7ca3584e1695898eb5ddd825cfc2d7a68c46ff 100644 (file)
@@ -79,6 +79,9 @@
 #define R8A7790_CLK_USBDMAC0           30
 #define R8A7790_CLK_USBDMAC1           31
 
+/* MSTP4 */
+#define R8A7790_CLK_IRQC               7
+
 /* MSTP5 */
 #define R8A7790_CLK_AUDIO_DMAC1                1
 #define R8A7790_CLK_AUDIO_DMAC0                2
index 8fc5dc8faeea40517f25ef8811c3a97f75bfad93..402268384b99093cb2ad723ec81e3d50f9aee968 100644 (file)
@@ -70,6 +70,9 @@
 #define R8A7791_CLK_USBDMAC0           30
 #define R8A7791_CLK_USBDMAC1           31
 
+/* MSTP4 */
+#define R8A7791_CLK_IRQC               7
+
 /* MSTP5 */
 #define R8A7791_CLK_AUDIO_DMAC1                1
 #define R8A7791_CLK_AUDIO_DMAC0                2
index d63323032d6ef80e7dde4d91c707e24da6cb776f..09da38a58776b4039e0c205d8c9bb1ed7751daab 100644 (file)
@@ -60,6 +60,9 @@
 #define R8A7794_CLK_USBDMAC0           30
 #define R8A7794_CLK_USBDMAC1           31
 
+/* MSTP4 */
+#define R8A7794_CLK_IRQC               7
+
 /* MSTP5 */
 #define R8A7794_CLK_THERMAL            22
 #define R8A7794_CLK_PWM                        23
diff --git a/include/dt-bindings/clock/samsung,s2mps11.h b/include/dt-bindings/clock/samsung,s2mps11.h
new file mode 100644 (file)
index 0000000..b903d7d
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ * Copyright (C) 2015 Markus Reichl
+ *
+ * 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.
+ *
+ * Device Tree binding constants clocks for the Samsung S2MPS11 PMIC.
+ */
+
+#ifndef _DT_BINDINGS_CLOCK_SAMSUNG_S2MPS11_CLOCK_H
+#define _DT_BINDINGS_CLOCK_SAMSUNG_S2MPS11_CLOCK_H
+
+/* Fixed rate clocks. */
+
+#define S2MPS11_CLK_AP         0
+#define S2MPS11_CLK_CP         1
+#define S2MPS11_CLK_BT         2
+
+/* Total number of clocks. */
+#define S2MPS11_CLKS_NUM               (S2MPS11_CLK_BT + 1)
+
+#endif /* _DT_BINDINGS_CLOCK_SAMSUNG_S2MPS11_CLOCK_H */
index 979d24a6799f052df426ea3400413c71aa0efbd0..d19763439472237589e216dd64d3b10863682259 100644 (file)
 #define VF610_PLL6_BYPASS              180
 #define VF610_PLL7_BYPASS              181
 #define VF610_CLK_SNVS                 182
-#define VF610_CLK_END                  183
+#define VF610_CLK_DAP                  183
+#define VF610_CLK_END                  184
 
 #endif /* __DT_BINDINGS_CLOCK_VF610_H */
diff --git a/include/dt-bindings/clock/zx296702-clock.h b/include/dt-bindings/clock/zx296702-clock.h
new file mode 100644 (file)
index 0000000..e683dbb
--- /dev/null
@@ -0,0 +1,170 @@
+/*
+ * Copyright 2014 Linaro Ltd.
+ * Copyright (C) 2014 ZTE 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 __DT_BINDINGS_CLOCK_ZX296702_H
+#define __DT_BINDINGS_CLOCK_ZX296702_H
+
+#define ZX296702_OSC                           0
+#define ZX296702_PLL_A9                                1
+#define ZX296702_PLL_A9_350M                   2
+#define ZX296702_PLL_MAC_1000M                 3
+#define ZX296702_PLL_MAC_333M                  4
+#define ZX296702_PLL_MM0_1188M                 5
+#define ZX296702_PLL_MM0_396M                  6
+#define ZX296702_PLL_MM0_198M                  7
+#define ZX296702_PLL_MM1_108M                  8
+#define ZX296702_PLL_MM1_72M                   9
+#define ZX296702_PLL_MM1_54M                   10
+#define ZX296702_PLL_LSP_104M                  11
+#define ZX296702_PLL_LSP_26M                   12
+#define ZX296702_PLL_AUDIO_294M912             13
+#define ZX296702_PLL_DDR_266M                  14
+#define ZX296702_CLK_148M5                     15
+#define ZX296702_MATRIX_ACLK                   16
+#define ZX296702_MAIN_HCLK                     17
+#define ZX296702_MAIN_PCLK                     18
+#define ZX296702_CLK_500                       19
+#define ZX296702_CLK_250                       20
+#define ZX296702_CLK_125                       21
+#define ZX296702_CLK_74M25                     22
+#define ZX296702_A9_WCLK                       23
+#define ZX296702_A9_AS1_ACLK_MUX               24
+#define ZX296702_A9_TRACE_CLKIN_MUX            25
+#define ZX296702_A9_AS1_ACLK_DIV               26
+#define ZX296702_CLK_2                         27
+#define ZX296702_CLK_27                                28
+#define ZX296702_DECPPU_ACLK_MUX               29
+#define ZX296702_PPU_ACLK_MUX                  30
+#define ZX296702_MALI400_ACLK_MUX              31
+#define ZX296702_VOU_ACLK_MUX                  32
+#define ZX296702_VOU_MAIN_WCLK_MUX             33
+#define ZX296702_VOU_AUX_WCLK_MUX              34
+#define ZX296702_VOU_SCALER_WCLK_MUX           35
+#define ZX296702_R2D_ACLK_MUX                  36
+#define ZX296702_R2D_WCLK_MUX                  37
+#define ZX296702_CLK_50                                38
+#define ZX296702_CLK_25                                39
+#define ZX296702_CLK_12                                40
+#define ZX296702_CLK_16M384                    41
+#define ZX296702_CLK_32K768                    42
+#define ZX296702_SEC_WCLK_DIV                  43
+#define ZX296702_DDR_WCLK_MUX                  44
+#define ZX296702_NAND_WCLK_MUX                 45
+#define ZX296702_LSP_26_WCLK_MUX               46
+#define ZX296702_A9_AS0_ACLK                   47
+#define ZX296702_A9_AS1_ACLK                   48
+#define ZX296702_A9_TRACE_CLKIN                        49
+#define ZX296702_DECPPU_AXI_M_ACLK             50
+#define ZX296702_DECPPU_AHB_S_HCLK             51
+#define ZX296702_PPU_AXI_M_ACLK                        52
+#define ZX296702_PPU_AHB_S_HCLK                        53
+#define ZX296702_VOU_AXI_M_ACLK                        54
+#define ZX296702_VOU_APB_PCLK                  55
+#define ZX296702_VOU_MAIN_CHANNEL_WCLK         56
+#define ZX296702_VOU_AUX_CHANNEL_WCLK          57
+#define ZX296702_VOU_HDMI_OSCLK_CEC            58
+#define ZX296702_VOU_SCALER_WCLK               59
+#define ZX296702_MALI400_AXI_M_ACLK            60
+#define ZX296702_MALI400_APB_PCLK              61
+#define ZX296702_R2D_WCLK                      62
+#define ZX296702_R2D_AXI_M_ACLK                        63
+#define ZX296702_R2D_AHB_HCLK                  64
+#define ZX296702_DDR3_AXI_S0_ACLK              65
+#define ZX296702_DDR3_APB_PCLK                 66
+#define ZX296702_DDR3_WCLK                     67
+#define ZX296702_USB20_0_AHB_HCLK              68
+#define ZX296702_USB20_0_EXTREFCLK             69
+#define ZX296702_USB20_1_AHB_HCLK              70
+#define ZX296702_USB20_1_EXTREFCLK             71
+#define ZX296702_USB20_2_AHB_HCLK              72
+#define ZX296702_USB20_2_EXTREFCLK             73
+#define ZX296702_GMAC_AXI_M_ACLK               74
+#define ZX296702_GMAC_APB_PCLK                 75
+#define ZX296702_GMAC_125_CLKIN                        76
+#define ZX296702_GMAC_RMII_CLKIN               77
+#define ZX296702_GMAC_25M_CLK                  78
+#define ZX296702_NANDFLASH_AHB_HCLK            79
+#define ZX296702_NANDFLASH_WCLK                        80
+#define ZX296702_LSP0_APB_PCLK                 81
+#define ZX296702_LSP0_AHB_HCLK                 82
+#define ZX296702_LSP0_26M_WCLK                 83
+#define ZX296702_LSP0_104M_WCLK                        84
+#define ZX296702_LSP0_16M384_WCLK              85
+#define ZX296702_LSP1_APB_PCLK                 86
+#define ZX296702_LSP1_26M_WCLK                 87
+#define ZX296702_LSP1_104M_WCLK                        88
+#define ZX296702_LSP1_32K_CLK                  89
+#define ZX296702_AON_HCLK                      90
+#define ZX296702_SYS_CTRL_PCLK                 91
+#define ZX296702_DMA_PCLK                      92
+#define ZX296702_DMA_ACLK                      93
+#define ZX296702_SEC_HCLK                      94
+#define ZX296702_AES_WCLK                      95
+#define ZX296702_DES_WCLK                      96
+#define ZX296702_IRAM_ACLK                     97
+#define ZX296702_IROM_ACLK                     98
+#define ZX296702_BOOT_CTRL_HCLK                        99
+#define ZX296702_EFUSE_CLK_30                  100
+#define ZX296702_VOU_MAIN_CHANNEL_DIV          101
+#define ZX296702_VOU_AUX_CHANNEL_DIV           102
+#define ZX296702_VOU_TV_ENC_HD_DIV             103
+#define ZX296702_VOU_TV_ENC_SD_DIV             104
+#define ZX296702_VL0_MUX                       105
+#define ZX296702_VL1_MUX                       106
+#define ZX296702_VL2_MUX                       107
+#define ZX296702_GL0_MUX                       108
+#define ZX296702_GL1_MUX                       109
+#define ZX296702_GL2_MUX                       110
+#define ZX296702_WB_MUX                                111
+#define ZX296702_HDMI_MUX                      112
+#define ZX296702_VOU_TV_ENC_HD_MUX             113
+#define ZX296702_VOU_TV_ENC_SD_MUX             114
+#define ZX296702_VL0_CLK                       115
+#define ZX296702_VL1_CLK                       116
+#define ZX296702_VL2_CLK                       117
+#define ZX296702_GL0_CLK                       118
+#define ZX296702_GL1_CLK                       119
+#define ZX296702_GL2_CLK                       120
+#define ZX296702_WB_CLK                                121
+#define ZX296702_CL_CLK                                122
+#define ZX296702_MAIN_MIX_CLK                  123
+#define ZX296702_AUX_MIX_CLK                   124
+#define ZX296702_HDMI_CLK                      125
+#define ZX296702_VOU_TV_ENC_HD_DAC_CLK         126
+#define ZX296702_VOU_TV_ENC_SD_DAC_CLK         127
+#define ZX296702_A9_PERIPHCLK                  128
+#define ZX296702_TOPCLK_END                    129
+
+#define ZX296702_SDMMC1_WCLK_MUX               0
+#define ZX296702_SDMMC1_WCLK_DIV               1
+#define ZX296702_SDMMC1_WCLK                   2
+#define ZX296702_SDMMC1_PCLK                   3
+#define ZX296702_SPDIF0_WCLK_MUX               4
+#define ZX296702_SPDIF0_WCLK                   5
+#define ZX296702_SPDIF0_PCLK                   6
+#define ZX296702_SPDIF0_DIV                    7
+#define ZX296702_I2S0_WCLK_MUX                 8
+#define ZX296702_I2S0_WCLK                     9
+#define ZX296702_I2S0_PCLK                     10
+#define ZX296702_I2S0_DIV                      11
+#define ZX296702_LSP0CLK_END                   12
+
+#define ZX296702_UART0_WCLK_MUX                        0
+#define ZX296702_UART0_WCLK                    1
+#define ZX296702_UART0_PCLK                    2
+#define ZX296702_UART1_WCLK_MUX                        3
+#define ZX296702_UART1_WCLK                    4
+#define ZX296702_UART1_PCLK                    5
+#define ZX296702_SDMMC0_WCLK_MUX               6
+#define ZX296702_SDMMC0_WCLK_DIV               7
+#define ZX296702_SDMMC0_WCLK                   8
+#define ZX296702_SDMMC0_PCLK                   9
+#define ZX296702_LSP1CLK_END                   10
+
+#endif /* __DT_BINDINGS_CLOCK_ZX296702_H */
diff --git a/include/dt-bindings/mfd/st-lpc.h b/include/dt-bindings/mfd/st-lpc.h
new file mode 100644 (file)
index 0000000..e3e6c75
--- /dev/null
@@ -0,0 +1,15 @@
+/*
+ * This header provides shared DT/Driver defines for ST's LPC device
+ *
+ * Copyright (C) 2014 STMicroelectronics -- All Rights Reserved
+ *
+ * Author: Lee Jones <lee.jones@linaro.org> for STMicroelectronics
+ */
+
+#ifndef __DT_BINDINGS_ST_LPC_H__
+#define __DT_BINDINGS_ST_LPC_H__
+
+#define ST_LPC_MODE_RTC                0
+#define ST_LPC_MODE_WDT                1
+
+#endif /* __DT_BINDINGS_ST_LPC_H__ */
index 5f4d01898c9c153ff73feebd46930524a2d50a4d..b00bbc9c60b41dabd0ba5b657bdba3ee076fa120 100644 (file)
@@ -21,6 +21,7 @@
 #define SLEWCTRL_SLOW          (1 << 19)
 #define SLEWCTRL_FAST          0
 #define DS0_PULL_UP_DOWN_EN    (1 << 27)
+#define WAKEUP_ENABLE          (1 << 29)
 
 #define PIN_OUTPUT             (PULL_DISABLE)
 #define PIN_OUTPUT_PULLUP      (PULL_UP)
diff --git a/include/dt-bindings/pinctrl/bcm2835.h b/include/dt-bindings/pinctrl/bcm2835.h
new file mode 100644 (file)
index 0000000..6f0bc37
--- /dev/null
@@ -0,0 +1,27 @@
+/*
+ * Header providing constants for bcm2835 pinctrl bindings.
+ *
+ * Copyright (C) 2015 Stefan Wahren <stefan.wahren@i2se.com>
+ *
+ * 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 at the following locations:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+#ifndef __DT_BINDINGS_PINCTRL_BCM2835_H__
+#define __DT_BINDINGS_PINCTRL_BCM2835_H__
+
+/* brcm,function property */
+#define BCM2835_FSEL_GPIO_IN   0
+#define BCM2835_FSEL_GPIO_OUT  1
+#define BCM2835_FSEL_ALT5      2
+#define BCM2835_FSEL_ALT4      3
+#define BCM2835_FSEL_ALT0      4
+#define BCM2835_FSEL_ALT1      5
+#define BCM2835_FSEL_ALT2      6
+#define BCM2835_FSEL_ALT3      7
+
+#endif /* __DT_BINDINGS_PINCTRL_BCM2835_H__ */
index 796ef9645827f000cb76ce4cd8637dc6cfa4db7a..a240e61a7700da6ca9d0f751967829b9ba47676d 100644 (file)
@@ -115,13 +115,14 @@ static inline void dmar_writeq(void __iomem *addr, u64 val)
  * Extended Capability Register
  */
 
+#define ecap_pasid(e)          ((e >> 40) & 0x1)
 #define ecap_pss(e)            ((e >> 35) & 0x1f)
 #define ecap_eafs(e)           ((e >> 34) & 0x1)
 #define ecap_nwfs(e)           ((e >> 33) & 0x1)
 #define ecap_srs(e)            ((e >> 31) & 0x1)
 #define ecap_ers(e)            ((e >> 30) & 0x1)
 #define ecap_prs(e)            ((e >> 29) & 0x1)
-#define ecap_pasid(e)          ((e >> 28) & 0x1)
+/* PASID support used to be on bit 28 */
 #define ecap_dis(e)            ((e >> 27) & 0x1)
 #define ecap_nest(e)           ((e >> 26) & 0x1)
 #define ecap_mts(e)            ((e >> 25) & 0x1)
index 62c6901cab550d7f57039c5b7052fc08bbe0964d..2633061364b1d1215ba117e1e6238f87431b011d 100644 (file)
@@ -458,6 +458,8 @@ extern void handle_nested_irq(unsigned int irq);
 
 extern int irq_chip_compose_msi_msg(struct irq_data *data, struct msi_msg *msg);
 #ifdef CONFIG_IRQ_DOMAIN_HIERARCHY
+extern void irq_chip_enable_parent(struct irq_data *data);
+extern void irq_chip_disable_parent(struct irq_data *data);
 extern void irq_chip_ack_parent(struct irq_data *data);
 extern int irq_chip_retrigger_hierarchy(struct irq_data *data);
 extern void irq_chip_mask_parent(struct irq_data *data);
index 676d7306a3609cc9aaccb090f71000f965f0e3bd..744ac0ec98eb2c9e094f8ebdcfd71aebcdd32026 100644 (file)
@@ -258,6 +258,10 @@ int irq_domain_xlate_onetwocell(struct irq_domain *d, struct device_node *ctrlr,
 /* V2 interfaces to support hierarchy IRQ domains. */
 extern struct irq_data *irq_domain_get_irq_data(struct irq_domain *domain,
                                                unsigned int virq);
+extern void irq_domain_set_info(struct irq_domain *domain, unsigned int virq,
+                               irq_hw_number_t hwirq, struct irq_chip *chip,
+                               void *chip_data, irq_flow_handler_t handler,
+                               void *handler_data, const char *handler_name);
 #ifdef CONFIG_IRQ_DOMAIN_HIERARCHY
 extern struct irq_domain *irq_domain_add_hierarchy(struct irq_domain *parent,
                        unsigned int flags, unsigned int size,
@@ -281,10 +285,6 @@ extern int irq_domain_set_hwirq_and_chip(struct irq_domain *domain,
                                         irq_hw_number_t hwirq,
                                         struct irq_chip *chip,
                                         void *chip_data);
-extern void irq_domain_set_info(struct irq_domain *domain, unsigned int virq,
-                               irq_hw_number_t hwirq, struct irq_chip *chip,
-                               void *chip_data, irq_flow_handler_t handler,
-                               void *handler_data, const char *handler_name);
 extern void irq_domain_reset_irq_data(struct irq_data *irq_data);
 extern void irq_domain_free_irqs_common(struct irq_domain *domain,
                                        unsigned int virq,
index 611b69fa85941ebae8d4f61ab61221a469e1c079..1f7bc630d2252618ea940e75675cc39013b052fb 100644 (file)
@@ -54,11 +54,16 @@ struct mbus_dram_target_info
  */
 #ifdef CONFIG_PLAT_ORION
 extern const struct mbus_dram_target_info *mv_mbus_dram_info(void);
+extern const struct mbus_dram_target_info *mv_mbus_dram_info_nooverlap(void);
 #else
 static inline const struct mbus_dram_target_info *mv_mbus_dram_info(void)
 {
        return NULL;
 }
+static inline const struct mbus_dram_target_info *mv_mbus_dram_info_nooverlap(void)
+{
+       return NULL;
+}
 #endif
 
 int mvebu_mbus_save_cpu_target(u32 *store_addr);
diff --git a/include/linux/mfd/syscon/atmel-mc.h b/include/linux/mfd/syscon/atmel-mc.h
new file mode 100644 (file)
index 0000000..afd9b8f
--- /dev/null
@@ -0,0 +1,144 @@
+/*
+ * Copyright (C) 2005 Ivan Kokshaysky
+ * Copyright (C) SAN People
+ *
+ * Memory Controllers (MC, EBI, SMC, SDRAMC, BFC) - System peripherals
+ * registers.
+ * Based on AT91RM9200 datasheet revision E.
+ *
+ * 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 _LINUX_MFD_SYSCON_ATMEL_MC_H_
+#define _LINUX_MFD_SYSCON_ATMEL_MC_H_
+
+/* Memory Controller */
+#define AT91_MC_RCR                    0x00
+#define AT91_MC_RCB                    BIT(0)
+
+#define AT91_MC_ASR                    0x04
+#define AT91_MC_UNADD                  BIT(0)
+#define AT91_MC_MISADD                 BIT(1)
+#define AT91_MC_ABTSZ                  GENMASK(9, 8)
+#define AT91_MC_ABTSZ_BYTE             (0 << 8)
+#define AT91_MC_ABTSZ_HALFWORD         (1 << 8)
+#define AT91_MC_ABTSZ_WORD             (2 << 8)
+#define AT91_MC_ABTTYP                 GENMASK(11, 10)
+#define AT91_MC_ABTTYP_DATAREAD                (0 << 10)
+#define AT91_MC_ABTTYP_DATAWRITE       (1 << 10)
+#define AT91_MC_ABTTYP_FETCH           (2 << 10)
+#define AT91_MC_MST(n)                 BIT(16 + (n))
+#define AT91_MC_SVMST(n)               BIT(24 + (n))
+
+#define AT91_MC_AASR                   0x08
+
+#define AT91_MC_MPR                    0x0c
+#define AT91_MPR_MSTP(n)               GENMASK(2 + ((x) * 4), ((x) * 4))
+
+/* External Bus Interface (EBI) registers */
+#define AT91_MC_EBI_CSA                        0x60
+#define AT91_MC_EBI_CS(n)              BIT(x)
+#define AT91_MC_EBI_NUM_CS             8
+
+#define AT91_MC_EBI_CFGR               0x64
+#define AT91_MC_EBI_DBPUC              BIT(0)
+
+/* Static Memory Controller (SMC) registers */
+#define AT91_MC_SMC_CSR(n)             (0x70 + ((n) * 4))
+#define AT91_MC_SMC_NWS                        GENMASK(6, 0)
+#define AT91_MC_SMC_NWS_(x)            ((x) << 0)
+#define AT91_MC_SMC_WSEN               BIT(7)
+#define AT91_MC_SMC_TDF                        GENMASK(11, 8)
+#define AT91_MC_SMC_TDF_(x)            ((x) << 8)
+#define AT91_MC_SMC_TDF_MAX            0xf
+#define AT91_MC_SMC_BAT                        BIT(12)
+#define AT91_MC_SMC_DBW                        GENMASK(14, 13)
+#define AT91_MC_SMC_DBW_16             (1 << 13)
+#define AT91_MC_SMC_DBW_8              (2 << 13)
+#define AT91_MC_SMC_DPR                        BIT(15)
+#define AT91_MC_SMC_ACSS               GENMASK(17, 16)
+#define AT91_MC_SMC_ACSS_(x)           ((x) << 16)
+#define AT91_MC_SMC_ACSS_MAX           3
+#define AT91_MC_SMC_RWSETUP            GENMASK(26, 24)
+#define AT91_MC_SMC_RWSETUP_(x)                ((x) << 24)
+#define AT91_MC_SMC_RWHOLD             GENMASK(30, 28)
+#define AT91_MC_SMC_RWHOLD_(x)         ((x) << 28)
+#define AT91_MC_SMC_RWHOLDSETUP_MAX    7
+
+/* SDRAM Controller registers */
+#define AT91_MC_SDRAMC_MR              0x90
+#define AT91_MC_SDRAMC_MODE            GENMASK(3, 0)
+#define AT91_MC_SDRAMC_MODE_NORMAL     (0 << 0)
+#define AT91_MC_SDRAMC_MODE_NOP                (1 << 0)
+#define AT91_MC_SDRAMC_MODE_PRECHARGE  (2 << 0)
+#define AT91_MC_SDRAMC_MODE_LMR                (3 << 0)
+#define AT91_MC_SDRAMC_MODE_REFRESH    (4 << 0)
+#define AT91_MC_SDRAMC_DBW_16          BIT(4)
+
+#define AT91_MC_SDRAMC_TR              0x94
+#define AT91_MC_SDRAMC_COUNT           GENMASK(11, 0)
+
+#define AT91_MC_SDRAMC_CR              0x98
+#define AT91_MC_SDRAMC_NC              GENMASK(1, 0)
+#define AT91_MC_SDRAMC_NC_8            (0 << 0)
+#define AT91_MC_SDRAMC_NC_9            (1 << 0)
+#define AT91_MC_SDRAMC_NC_10           (2 << 0)
+#define AT91_MC_SDRAMC_NC_11           (3 << 0)
+#define AT91_MC_SDRAMC_NR              GENMASK(3, 2)
+#define AT91_MC_SDRAMC_NR_11           (0 << 2)
+#define AT91_MC_SDRAMC_NR_12           (1 << 2)
+#define AT91_MC_SDRAMC_NR_13           (2 << 2)
+#define AT91_MC_SDRAMC_NB              BIT(4)
+#define AT91_MC_SDRAMC_NB_2            (0 << 4)
+#define AT91_MC_SDRAMC_NB_4            (1 << 4)
+#define AT91_MC_SDRAMC_CAS             GENMASK(6, 5)
+#define AT91_MC_SDRAMC_CAS_2           (2 << 5)
+#define AT91_MC_SDRAMC_TWR             GENMASK(10,  7)
+#define AT91_MC_SDRAMC_TRC             GENMASK(14, 11)
+#define AT91_MC_SDRAMC_TRP             GENMASK(18, 15)
+#define AT91_MC_SDRAMC_TRCD            GENMASK(22, 19)
+#define AT91_MC_SDRAMC_TRAS            GENMASK(26, 23)
+#define AT91_MC_SDRAMC_TXSR            GENMASK(30, 27)
+
+#define AT91_MC_SDRAMC_SRR             0x9c
+#define AT91_MC_SDRAMC_SRCB            BIT(0)
+
+#define AT91_MC_SDRAMC_LPR             0xa0
+#define AT91_MC_SDRAMC_LPCB            BIT(0)
+
+#define AT91_MC_SDRAMC_IER             0xa4
+#define AT91_MC_SDRAMC_IDR             0xa8
+#define AT91_MC_SDRAMC_IMR             0xac
+#define AT91_MC_SDRAMC_ISR             0xb0
+#define AT91_MC_SDRAMC_RES             BIT(0)
+
+/* Burst Flash Controller register */
+#define AT91_MC_BFC_MR                 0xc0
+#define AT91_MC_BFC_BFCOM              GENMASK(1, 0)
+#define AT91_MC_BFC_BFCOM_DISABLED     (0 << 0)
+#define AT91_MC_BFC_BFCOM_ASYNC                (1 << 0)
+#define AT91_MC_BFC_BFCOM_BURST                (2 << 0)
+#define AT91_MC_BFC_BFCC               GENMASK(3, 2)
+#define AT91_MC_BFC_BFCC_MCK           (1 << 2)
+#define AT91_MC_BFC_BFCC_DIV2          (2 << 2)
+#define AT91_MC_BFC_BFCC_DIV4          (3 << 2)
+#define AT91_MC_BFC_AVL                        GENMASK(7,  4)
+#define AT91_MC_BFC_PAGES              GENMASK(10, 8)
+#define AT91_MC_BFC_PAGES_NO_PAGE      (0 << 8)
+#define AT91_MC_BFC_PAGES_16           (1 << 8)
+#define AT91_MC_BFC_PAGES_32           (2 << 8)
+#define AT91_MC_BFC_PAGES_64           (3 << 8)
+#define AT91_MC_BFC_PAGES_128          (4 << 8)
+#define AT91_MC_BFC_PAGES_256          (5 << 8)
+#define AT91_MC_BFC_PAGES_512          (6 << 8)
+#define AT91_MC_BFC_PAGES_1024         (7 << 8)
+#define AT91_MC_BFC_OEL                        GENMASK(13, 12)
+#define AT91_MC_BFC_BAAEN              BIT(16)
+#define AT91_MC_BFC_BFOEH              BIT(17)
+#define AT91_MC_BFC_MUXEN              BIT(18)
+#define AT91_MC_BFC_RDYEN              BIT(19)
+
+#endif /* _LINUX_MFD_SYSCON_ATMEL_MC_H_ */
index d7a974d5f57c43f98eb8cb497e7b9b978a3cc0c9..6e7d5ec65838249cb8e5117eaa410c4d35adde5c 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010-2014, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2010-2015, The Linux Foundation. All rights reserved.
  * Copyright (C) 2015 Linaro Ltd.
  *
  * This program is free software; you can redistribute it and/or modify
 extern int qcom_scm_set_cold_boot_addr(void *entry, const cpumask_t *cpus);
 extern int qcom_scm_set_warm_boot_addr(void *entry, const cpumask_t *cpus);
 
+#define QCOM_SCM_HDCP_MAX_REQ_CNT      5
+
+struct qcom_scm_hdcp_req {
+       u32 addr;
+       u32 val;
+};
+
+extern bool qcom_scm_hdcp_available(void);
+extern int qcom_scm_hdcp_req(struct qcom_scm_hdcp_req *req, u32 req_cnt,
+               u32 *resp);
+
 #define QCOM_SCM_CPU_PWR_DOWN_L2_ON    0x0
 #define QCOM_SCM_CPU_PWR_DOWN_L2_OFF   0x1
 
diff --git a/include/linux/reset/bcm63xx_pmb.h b/include/linux/reset/bcm63xx_pmb.h
new file mode 100644 (file)
index 0000000..bb4af7b
--- /dev/null
@@ -0,0 +1,88 @@
+/*
+ * Broadcom BCM63xx Processor Monitor Bus shared routines (SMP and reset)
+ *
+ * Copyright (C) 2015, Broadcom Corporation
+ * Author: Florian Fainelli <f.fainelli@gmail.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.
+ *
+ * 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.
+ */
+#ifndef __BCM63XX_PMB_H
+#define __BCM63XX_PMB_H
+
+#include <linux/io.h>
+#include <linux/types.h>
+#include <linux/delay.h>
+#include <linux/err.h>
+
+/* PMB Master controller register */
+#define PMB_CTRL               0x00
+#define  PMC_PMBM_START                (1 << 31)
+#define  PMC_PMBM_TIMEOUT      (1 << 30)
+#define  PMC_PMBM_SLAVE_ERR    (1 << 29)
+#define  PMC_PMBM_BUSY         (1 << 28)
+#define  PMC_PMBM_READ         (0 << 20)
+#define  PMC_PMBM_WRITE                (1 << 20)
+#define PMB_WR_DATA            0x04
+#define PMB_TIMEOUT            0x08
+#define PMB_RD_DATA            0x0C
+
+#define PMB_BUS_ID_SHIFT       8
+
+/* Perform the low-level PMB master operation, shared between reads and
+ * writes.
+ */
+static inline int __bpcm_do_op(void __iomem *master, unsigned int addr,
+                              u32 off, u32 op)
+{
+       unsigned int timeout = 1000;
+       u32 cmd;
+
+       cmd = (PMC_PMBM_START | op | (addr & 0xff) << 12 | off);
+       writel(cmd, master + PMB_CTRL);
+       do {
+               cmd = readl(master + PMB_CTRL);
+               if (!(cmd & PMC_PMBM_START))
+                       return 0;
+
+               if (cmd & PMC_PMBM_SLAVE_ERR)
+                       return -EIO;
+
+               if (cmd & PMC_PMBM_TIMEOUT)
+                       return -ETIMEDOUT;
+
+               udelay(1);
+       } while (timeout-- > 0);
+
+       return -ETIMEDOUT;
+}
+
+static inline int bpcm_rd(void __iomem *master, unsigned int addr,
+                         u32 off, u32 *val)
+{
+       int ret = 0;
+
+       ret = __bpcm_do_op(master, addr, off >> 2, PMC_PMBM_READ);
+       *val = readl(master + PMB_RD_DATA);
+
+       return ret;
+}
+
+static inline int bpcm_wr(void __iomem *master, unsigned int addr,
+                         u32 off, u32 val)
+{
+       int ret = 0;
+
+       writel(val, master + PMB_WR_DATA);
+       ret = __bpcm_do_op(master, addr, off >> 2, PMC_PMBM_WRITE);
+
+       return ret;
+}
+
+#endif /* __BCM63XX_PMB_H */
diff --git a/include/linux/soc/sunxi/sunxi_sram.h b/include/linux/soc/sunxi/sunxi_sram.h
new file mode 100644 (file)
index 0000000..c5f663b
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+ * Allwinner SoCs SRAM Controller Driver
+ *
+ * Copyright (C) 2015 Maxime Ripard
+ *
+ * Author: Maxime Ripard <maxime.ripard@free-electrons.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.
+ */
+
+#ifndef _SUNXI_SRAM_H_
+#define _SUNXI_SRAM_H_
+
+int sunxi_sram_claim(struct device *dev);
+int sunxi_sram_release(struct device *dev);
+
+#endif /* _SUNXI_SRAM_H_ */
diff --git a/include/soc/at91/at91rm9200_sdramc.h b/include/soc/at91/at91rm9200_sdramc.h
deleted file mode 100644 (file)
index aa047f4..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * arch/arm/mach-at91/include/mach/at91rm9200_sdramc.h
- *
- * Copyright (C) 2005 Ivan Kokshaysky
- * Copyright (C) SAN People
- *
- * Memory Controllers (SDRAMC only) - System peripherals registers.
- * Based on AT91RM9200 datasheet revision E.
- *
- * 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 AT91RM9200_SDRAMC_H
-#define AT91RM9200_SDRAMC_H
-
-/* SDRAM Controller registers */
-#define AT91RM9200_SDRAMC_MR           0x90                    /* Mode Register */
-#define                AT91RM9200_SDRAMC_MODE  (0xf << 0)              /* Command Mode */
-#define                        AT91RM9200_SDRAMC_MODE_NORMAL           (0 << 0)
-#define                        AT91RM9200_SDRAMC_MODE_NOP              (1 << 0)
-#define                        AT91RM9200_SDRAMC_MODE_PRECHARGE        (2 << 0)
-#define                        AT91RM9200_SDRAMC_MODE_LMR              (3 << 0)
-#define                        AT91RM9200_SDRAMC_MODE_REFRESH  (4 << 0)
-#define                AT91RM9200_SDRAMC_DBW           (1   << 4)              /* Data Bus Width */
-#define                        AT91RM9200_SDRAMC_DBW_32        (0 << 4)
-#define                        AT91RM9200_SDRAMC_DBW_16        (1 << 4)
-
-#define AT91RM9200_SDRAMC_TR           0x94                    /* Refresh Timer Register */
-#define                AT91RM9200_SDRAMC_COUNT (0xfff << 0)            /* Refresh Timer Count */
-
-#define AT91RM9200_SDRAMC_CR           0x98                    /* Configuration Register */
-#define                AT91RM9200_SDRAMC_NC            (3   <<  0)             /* Number of Column Bits */
-#define                        AT91RM9200_SDRAMC_NC_8  (0 << 0)
-#define                        AT91RM9200_SDRAMC_NC_9  (1 << 0)
-#define                        AT91RM9200_SDRAMC_NC_10 (2 << 0)
-#define                        AT91RM9200_SDRAMC_NC_11 (3 << 0)
-#define                AT91RM9200_SDRAMC_NR            (3   <<  2)             /* Number of Row Bits */
-#define                        AT91RM9200_SDRAMC_NR_11 (0 << 2)
-#define                        AT91RM9200_SDRAMC_NR_12 (1 << 2)
-#define                        AT91RM9200_SDRAMC_NR_13 (2 << 2)
-#define                AT91RM9200_SDRAMC_NB            (1   <<  4)             /* Number of Banks */
-#define                        AT91RM9200_SDRAMC_NB_2  (0 << 4)
-#define                        AT91RM9200_SDRAMC_NB_4  (1 << 4)
-#define                AT91RM9200_SDRAMC_CAS           (3   <<  5)             /* CAS Latency */
-#define                        AT91RM9200_SDRAMC_CAS_2 (2 << 5)
-#define                AT91RM9200_SDRAMC_TWR           (0xf <<  7)             /* Write Recovery Delay */
-#define                AT91RM9200_SDRAMC_TRC           (0xf << 11)             /* Row Cycle Delay */
-#define                AT91RM9200_SDRAMC_TRP           (0xf << 15)             /* Row Precharge Delay */
-#define                AT91RM9200_SDRAMC_TRCD  (0xf << 19)             /* Row to Column Delay */
-#define                AT91RM9200_SDRAMC_TRAS  (0xf << 23)             /* Active to Precharge Delay */
-#define                AT91RM9200_SDRAMC_TXSR  (0xf << 27)             /* Exit Self Refresh to Active Delay */
-
-#define AT91RM9200_SDRAMC_SRR          0x9c                    /* Self Refresh Register */
-#define AT91RM9200_SDRAMC_LPR          0xa0                    /* Low Power Register */
-#define AT91RM9200_SDRAMC_IER          0xa4                    /* Interrupt Enable Register */
-#define AT91RM9200_SDRAMC_IDR          0xa8                    /* Interrupt Disable Register */
-#define AT91RM9200_SDRAMC_IMR          0xac                    /* Interrupt Mask Register */
-#define AT91RM9200_SDRAMC_ISR          0xb0                    /* Interrupt Status Register */
-
-#endif
diff --git a/include/soc/imx/revision.h b/include/soc/imx/revision.h
new file mode 100644 (file)
index 0000000..9ea3469
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2015 Linaro 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.
+ */
+
+#ifndef __SOC_IMX_REVISION_H__
+#define __SOC_IMX_REVISION_H__
+
+#define IMX_CHIP_REVISION_1_0          0x10
+#define IMX_CHIP_REVISION_1_1          0x11
+#define IMX_CHIP_REVISION_1_2          0x12
+#define IMX_CHIP_REVISION_1_3          0x13
+#define IMX_CHIP_REVISION_1_4          0x14
+#define IMX_CHIP_REVISION_1_5          0x15
+#define IMX_CHIP_REVISION_2_0          0x20
+#define IMX_CHIP_REVISION_2_1          0x21
+#define IMX_CHIP_REVISION_2_2          0x22
+#define IMX_CHIP_REVISION_2_3          0x23
+#define IMX_CHIP_REVISION_3_0          0x30
+#define IMX_CHIP_REVISION_3_1          0x31
+#define IMX_CHIP_REVISION_3_2          0x32
+#define IMX_CHIP_REVISION_3_3          0x33
+#define IMX_CHIP_REVISION_UNKNOWN      0xff
+
+int mx27_revision(void);
+int mx31_revision(void);
+int mx35_revision(void);
+int mx51_revision(void);
+int mx53_revision(void);
+
+unsigned int imx_get_soc_revision(void);
+void imx_print_silicon_rev(const char *cpu, int srev);
+
+#endif /* __SOC_IMX_REVISION_H__ */
diff --git a/include/soc/imx/timer.h b/include/soc/imx/timer.h
new file mode 100644 (file)
index 0000000..bbbafd6
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2015 Linaro 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.
+ */
+
+#ifndef __SOC_IMX_TIMER_H__
+#define __SOC_IMX_TIMER_H__
+
+enum imx_gpt_type {
+       GPT_TYPE_IMX1,          /* i.MX1 */
+       GPT_TYPE_IMX21,         /* i.MX21/27 */
+       GPT_TYPE_IMX31,         /* i.MX31/35/25/37/51/6Q */
+       GPT_TYPE_IMX6DL,        /* i.MX6DL/SX/SL */
+};
+
+/*
+ * This is a stop-gap solution for clock drivers like imx1/imx21 which call
+ * mxc_timer_init() to initialize timer for non-DT boot.  It can be removed
+ * when these legacy non-DT support is converted or dropped.
+ */
+void mxc_timer_init(unsigned long pbase, int irq, enum imx_gpt_type type);
+
+#endif  /* __SOC_IMX_TIMER_H__ */
diff --git a/include/soc/tegra/emc.h b/include/soc/tegra/emc.h
new file mode 100644 (file)
index 0000000..f6db33b
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2014 NVIDIA Corporation. All rights reserved.
+ *
+ * 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_TEGRA_EMC_H__
+#define __SOC_TEGRA_EMC_H__
+
+struct tegra_emc;
+
+int tegra_emc_prepare_timing_change(struct tegra_emc *emc,
+                                   unsigned long rate);
+void tegra_emc_complete_timing_change(struct tegra_emc *emc,
+                                     unsigned long rate);
+
+#endif /* __SOC_TEGRA_EMC_H__ */
index b5f7b5f8d008f26b2b930af7b2df853124f89a66..b019e3465f113bec9df2aecb0bbe06f37f50b208 100644 (file)
@@ -56,6 +56,7 @@ struct tegra_sku_info {
 };
 
 u32 tegra_read_straps(void);
+u32 tegra_read_ram_code(void);
 u32 tegra_read_chipid(void);
 int tegra_fuse_readl(unsigned long offset, u32 *value);
 
index 63deb8d9f82af579cbcf3dfe7d96f47cfd04d7e8..1ab2813273cd1cf7d0116ca3d64b08de18013304 100644 (file)
@@ -20,6 +20,12 @@ struct tegra_smmu_enable {
        unsigned int bit;
 };
 
+struct tegra_mc_timing {
+       unsigned long rate;
+
+       u32 *emem_data;
+};
+
 /* latency allowance */
 struct tegra_mc_la {
        unsigned int reg;
@@ -40,6 +46,7 @@ struct tegra_mc_client {
 };
 
 struct tegra_smmu_swgroup {
+       const char *name;
        unsigned int swgroup;
        unsigned int reg;
 };
@@ -71,6 +78,7 @@ struct tegra_smmu;
 struct tegra_smmu *tegra_smmu_probe(struct device *dev,
                                    const struct tegra_smmu_soc *soc,
                                    struct tegra_mc *mc);
+void tegra_smmu_remove(struct tegra_smmu *smmu);
 #else
 static inline struct tegra_smmu *
 tegra_smmu_probe(struct device *dev, const struct tegra_smmu_soc *soc,
@@ -78,13 +86,17 @@ tegra_smmu_probe(struct device *dev, const struct tegra_smmu_soc *soc,
 {
        return NULL;
 }
+
+static inline void tegra_smmu_remove(struct tegra_smmu *smmu)
+{
+}
 #endif
 
 struct tegra_mc_soc {
        const struct tegra_mc_client *clients;
        unsigned int num_clients;
 
-       const unsigned int *emem_regs;
+       const unsigned long *emem_regs;
        unsigned int num_emem_regs;
 
        unsigned int num_address_bits;
@@ -102,6 +114,12 @@ struct tegra_mc {
 
        const struct tegra_mc_soc *soc;
        unsigned long tick;
+
+       struct tegra_mc_timing *timings;
+       unsigned int num_timings;
 };
 
+void tegra_mc_write_emem_configuration(struct tegra_mc *mc, unsigned long rate);
+unsigned int tegra_mc_get_emem_device_count(struct tegra_mc *mc);
+
 #endif /* __SOC_TEGRA_MC_H__ */
index 65a93273e72fe9d8f9ad5bc9358f734ab031e5ff..f5c0de43a5fad229b0c7cb2f5c82219210e6dec1 100644 (file)
@@ -26,8 +26,6 @@
 struct clk;
 struct reset_control;
 
-void tegra_pmc_restart(enum reboot_mode mode, const char *cmd);
-
 #ifdef CONFIG_PM_SLEEP
 enum tegra_suspend_mode tegra_pmc_get_suspend_mode(void);
 void tegra_pmc_set_suspend_mode(enum tegra_suspend_mode mode);
index 53a18b3635e24a458700a21566c56a10d0704c56..df705908480aebbf754900731834162fa8097f75 100644 (file)
@@ -9,6 +9,8 @@
 #include <sound/core.h>
 #include <sound/hdaudio.h>
 
+#define AC_AMP_FAKE_MUTE       0x10    /* fake mute bit set to amp verbs */
+
 int snd_hdac_regmap_init(struct hdac_device *codec);
 void snd_hdac_regmap_exit(struct hdac_device *codec);
 int snd_hdac_regmap_add_vendor_verb(struct hdac_device *codec,
index 871e73f99a4d7aa13b4cd6f5bc8969421c2a9301..94d44ab2fda1821bcda7e1b541bcfeffb556e7c5 100644 (file)
@@ -1038,6 +1038,7 @@ struct drm_radeon_cs {
 #define RADEON_INFO_CURRENT_GPU_SCLK   0x22
 #define RADEON_INFO_CURRENT_GPU_MCLK   0x23
 #define RADEON_INFO_READ_REG           0x24
+#define RADEON_INFO_VA_UNMAP_WORKING   0x25
 
 struct drm_radeon_info {
        uint32_t                request;
index e9b4cb0cd7edae5aaf029288db27fe56a8ff05c5..1e5ac4e776da77bdc2cc4f6ab6403d4d7b71f351 100644 (file)
  * Extra serial register definitions for the internal UARTs
  * in TI OMAP processors.
  */
+#define OMAP1_UART1_BASE       0xfffb0000
+#define OMAP1_UART2_BASE       0xfffb0800
+#define OMAP1_UART3_BASE       0xfffb9800
 #define UART_OMAP_MDR1         0x08    /* Mode definition register */
 #define UART_OMAP_MDR2         0x09    /* Mode definition register 2 */
 #define UART_OMAP_SCR          0x10    /* Supplementary control register */
index eb9a4ea394ab33fdde25420f11cb9021df384824..2456fe89719c5a732cdf82046178433ed3dd6239 100644 (file)
@@ -875,6 +875,34 @@ void irq_cpu_offline(void)
 }
 
 #ifdef CONFIG_IRQ_DOMAIN_HIERARCHY
+/**
+ * irq_chip_enable_parent - Enable the parent interrupt (defaults to unmask if
+ * NULL)
+ * @data:      Pointer to interrupt specific data
+ */
+void irq_chip_enable_parent(struct irq_data *data)
+{
+       data = data->parent_data;
+       if (data->chip->irq_enable)
+               data->chip->irq_enable(data);
+       else
+               data->chip->irq_unmask(data);
+}
+
+/**
+ * irq_chip_disable_parent - Disable the parent interrupt (defaults to mask if
+ * NULL)
+ * @data:      Pointer to interrupt specific data
+ */
+void irq_chip_disable_parent(struct irq_data *data)
+{
+       data = data->parent_data;
+       if (data->chip->irq_disable)
+               data->chip->irq_disable(data);
+       else
+               data->chip->irq_mask(data);
+}
+
 /**
  * irq_chip_ack_parent - Acknowledge the parent interrupt
  * @data:      Pointer to interrupt specific data
index 61024e8abdeffdeff717d389ddbe8fd99110532c..15b370daf23446d3a6b5213cbeac4d9559fb095d 100644 (file)
@@ -360,7 +360,7 @@ static struct lock_class_key irq_nested_lock_class;
 int irq_map_generic_chip(struct irq_domain *d, unsigned int virq,
                         irq_hw_number_t hw_irq)
 {
-       struct irq_data *data = irq_get_irq_data(virq);
+       struct irq_data *data = irq_domain_get_irq_data(d, virq);
        struct irq_domain_chip_generic *dgc = d->gc;
        struct irq_chip_generic *gc;
        struct irq_chip_type *ct;
@@ -405,8 +405,7 @@ int irq_map_generic_chip(struct irq_domain *d, unsigned int virq,
        else
                data->mask = 1 << idx;
 
-       irq_set_chip_and_handler(virq, chip, ct->handler);
-       irq_set_chip_data(virq, gc);
+       irq_domain_set_info(d, virq, hw_irq, chip, gc, ct->handler, NULL, NULL);
        irq_modify_status(virq, dgc->irq_flags_to_clear, dgc->irq_flags_to_set);
        return 0;
 }
index 7fac311057b806e7e6ba6c4634fac7151ace347b..41bf6dc49f59a6975cc4def14cf04af7a191226a 100644 (file)
@@ -1232,6 +1232,27 @@ struct irq_data *irq_domain_get_irq_data(struct irq_domain *domain,
        return (irq_data && irq_data->domain == domain) ? irq_data : NULL;
 }
 
+/**
+ * irq_domain_set_info - Set the complete data for a @virq in @domain
+ * @domain:            Interrupt domain to match
+ * @virq:              IRQ number
+ * @hwirq:             The hardware interrupt number
+ * @chip:              The associated interrupt chip
+ * @chip_data:         The associated interrupt chip data
+ * @handler:           The interrupt flow handler
+ * @handler_data:      The interrupt flow handler data
+ * @handler_name:      The interrupt handler name
+ */
+void irq_domain_set_info(struct irq_domain *domain, unsigned int virq,
+                        irq_hw_number_t hwirq, struct irq_chip *chip,
+                        void *chip_data, irq_flow_handler_t handler,
+                        void *handler_data, const char *handler_name)
+{
+       irq_set_chip_and_handler_name(virq, chip, handler, handler_name);
+       irq_set_chip_data(virq, chip_data);
+       irq_set_handler_data(virq, handler_data);
+}
+
 static void irq_domain_check_hierarchy(struct irq_domain *domain)
 {
 }
index a0831e1b99f4aabd6c80ea68cedb6350a7a9affc..aaeae885d9af7d1dc190c566d95e0d6bed845cfe 100644 (file)
@@ -3900,7 +3900,8 @@ static void zap_class(struct lock_class *class)
        list_del_rcu(&class->hash_entry);
        list_del_rcu(&class->lock_entry);
 
-       class->key = NULL;
+       RCU_INIT_POINTER(class->key, NULL);
+       RCU_INIT_POINTER(class->name, NULL);
 }
 
 static inline int within(const void *addr, void *start, unsigned long size)
index ef43ac4bafb59b83ab979a680d49d6077749f955..d83d798bef95a042e1060a35bf4b79e7c7a6c05c 100644 (file)
@@ -426,10 +426,12 @@ static void seq_lock_time(struct seq_file *m, struct lock_time *lt)
 
 static void seq_stats(struct seq_file *m, struct lock_stat_data *data)
 {
-       char name[39];
-       struct lock_class *class;
+       struct lockdep_subclass_key *ckey;
        struct lock_class_stats *stats;
+       struct lock_class *class;
+       const char *cname;
        int i, namelen;
+       char name[39];
 
        class = data->class;
        stats = &data->stats;
@@ -440,15 +442,25 @@ static void seq_stats(struct seq_file *m, struct lock_stat_data *data)
        if (class->subclass)
                namelen -= 2;
 
-       if (!class->name) {
+       rcu_read_lock_sched();
+       cname = rcu_dereference_sched(class->name);
+       ckey  = rcu_dereference_sched(class->key);
+
+       if (!cname && !ckey) {
+               rcu_read_unlock_sched();
+               return;
+
+       } else if (!cname) {
                char str[KSYM_NAME_LEN];
                const char *key_name;
 
-               key_name = __get_key_name(class->key, str);
+               key_name = __get_key_name(ckey, str);
                snprintf(name, namelen, "%s", key_name);
        } else {
-               snprintf(name, namelen, "%s", class->name);
+               snprintf(name, namelen, "%s", cname);
        }
+       rcu_read_unlock_sched();
+
        namelen = strlen(name);
        if (class->name_version > 1) {
                snprintf(name+namelen, 3, "#%d", class->name_version);
index ffeaa4105e48a36105ecaea8967082e1e7a7af98..c2980e8733bcb9da333f5d06e85441a78f1097a8 100644 (file)
@@ -2181,7 +2181,7 @@ void task_numa_work(struct callback_head *work)
        }
        for (; vma; vma = vma->vm_next) {
                if (!vma_migratable(vma) || !vma_policy_mof(vma) ||
-                       is_vm_hugetlb_page(vma)) {
+                       is_vm_hugetlb_page(vma) || (vma->vm_flags & VM_MIXEDMAP)) {
                        continue;
                }
 
index 13d945c0d03f2bda5802971484b21bbe9f65301f..1b28df2d91042de97566454a80dcb36d24674a49 100644 (file)
@@ -450,7 +450,7 @@ static int __init ring_buffer_benchmark_init(void)
 
        if (producer_fifo >= 0) {
                struct sched_param param = {
-                       .sched_priority = consumer_fifo
+                       .sched_priority = producer_fifo
                };
                sched_setscheduler(producer, SCHED_FIFO, &param);
        } else
index ced69da0ff55ba08a7358cae7ceaae31546f9332..7f2e97ce71a7d12a9b2ed5e703969e635f320a57 100644 (file)
@@ -1369,19 +1369,26 @@ static int check_preds(struct filter_parse_state *ps)
 {
        int n_normal_preds = 0, n_logical_preds = 0;
        struct postfix_elt *elt;
+       int cnt = 0;
 
        list_for_each_entry(elt, &ps->postfix, list) {
-               if (elt->op == OP_NONE)
+               if (elt->op == OP_NONE) {
+                       cnt++;
                        continue;
+               }
 
                if (elt->op == OP_AND || elt->op == OP_OR) {
                        n_logical_preds++;
+                       cnt--;
                        continue;
                }
+               if (elt->op != OP_NOT)
+                       cnt--;
                n_normal_preds++;
+               WARN_ON_ONCE(cnt < 0);
        }
 
-       if (!n_normal_preds || n_logical_preds >= n_normal_preds) {
+       if (cnt != 1 || !n_normal_preds || n_logical_preds >= n_normal_preds) {
                parse_error(ps, FILT_ERR_INVALID_FILTER, 0);
                return -EINVAL;
        }
index 5f627084f2e998b2605016c311411d91f7016918..5a70f6196f577a071ae0a31e9da7fa0e1dd1bc68 100644 (file)
 int cpumask_next_and(int n, const struct cpumask *src1p,
                     const struct cpumask *src2p)
 {
-       struct cpumask tmp;
-
-       if (cpumask_and(&tmp, src1p, src2p))
-               return cpumask_next(n, &tmp);
-       return nr_cpu_ids;
+       while ((n = cpumask_next(n, src1p)) < nr_cpu_ids)
+               if (cpumask_test_cpu(n, src2p))
+                       break;
+       return n;
 }
 EXPORT_SYMBOL(cpumask_next_and);
 
index aac511417ad19af5d9e3472747a983be5ed3ee4b..a89d041592c8bfa7b092c382962a4085560f5b1a 100644 (file)
@@ -639,7 +639,7 @@ do { \
        **************  MIPS  *****************
        ***************************************/
 #if defined(__mips__) && W_TYPE_SIZE == 32
-#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 4
+#if (__GNUC__ >= 5) || (__GNUC__ >= 4 && __GNUC_MINOR__ >= 4)
 #define umul_ppmm(w1, w0, u, v)                        \
 do {                                           \
        UDItype __ll = (UDItype)(u) * (v);      \
@@ -671,7 +671,7 @@ do {                                                \
        **************  MIPS/64  **************
        ***************************************/
 #if (defined(__mips) && __mips >= 3) && W_TYPE_SIZE == 64
-#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 4
+#if (__GNUC__ >= 5) || (__GNUC__ >= 4 && __GNUC_MINOR__ >= 4)
 #define umul_ppmm(w1, w0, u, v) \
 do {                                                                   \
        typedef unsigned int __ll_UTItype __attribute__((mode(TI)));    \
index 4396434e471536b4772ef06efcb983f87c580889..8609378e6505123a3688e0e95a18cdde013e278a 100644 (file)
@@ -26,6 +26,7 @@
 #include <linux/random.h>
 #include <linux/rhashtable.h>
 #include <linux/err.h>
+#include <linux/export.h>
 
 #define HASH_DEFAULT_SIZE      64UL
 #define HASH_MIN_SIZE          4U
index 14c2f2017e37cc405e52cb12bc30b128997f1f8e..a04225d372ba3ab77516b970c10135b19def3ac4 100644 (file)
@@ -2323,6 +2323,8 @@ done_restock:
        css_get_many(&memcg->css, batch);
        if (batch > nr_pages)
                refill_stock(memcg, batch - nr_pages);
+       if (!(gfp_mask & __GFP_WAIT))
+               goto done;
        /*
         * If the hierarchy is above the normal consumption range,
         * make the charging task trim their excess contribution.
@@ -5833,9 +5835,7 @@ void mem_cgroup_swapout(struct page *page, swp_entry_t entry)
        if (!mem_cgroup_is_root(memcg))
                page_counter_uncharge(&memcg->memory, 1);
 
-       /* XXX: caller holds IRQ-safe mapping->tree_lock */
-       VM_BUG_ON(!irqs_disabled());
-
+       /* Caller disabled preemption with mapping->tree_lock */
        mem_cgroup_charge_statistics(memcg, page, -1);
        memcg_check_events(memcg, page);
 }
index 457bde530cbedcf0dea2f35e219466de0acf204d..9e88f749aa512395daea45f2727545fa0f281533 100644 (file)
@@ -1969,8 +1969,10 @@ void try_offline_node(int nid)
                 * wait_table may be allocated from boot memory,
                 * here only free if it's allocated by vmalloc.
                 */
-               if (is_vmalloc_addr(zone->wait_table))
+               if (is_vmalloc_addr(zone->wait_table)) {
                        vfree(zone->wait_table);
+                       zone->wait_table = NULL;
+               }
        }
 }
 EXPORT_SYMBOL(try_offline_node);
index de981370fbc5d596de3d419062c0977829602af7..47d536e59fc02c2251c36ce4d16d654921101cbf 100644 (file)
@@ -3401,7 +3401,13 @@ int shmem_zero_setup(struct vm_area_struct *vma)
        struct file *file;
        loff_t size = vma->vm_end - vma->vm_start;
 
-       file = shmem_file_setup("dev/zero", size, vma->vm_flags);
+       /*
+        * Cloning a new file under mmap_sem leads to a lock ordering conflict
+        * between XFS directory reading and selinux: since this file is only
+        * accessible to the user through its mapping, use S_PRIVATE flag to
+        * bypass file security, in the same way as shmem_kernel_file_setup().
+        */
+       file = __shmem_file_setup("dev/zero", size, vma->vm_flags, S_PRIVATE);
        if (IS_ERR(file))
                return PTR_ERR(file);
 
index 08bd7a3d464a9c6959a39e269d2284600e750a50..a8b5e749e84e7dbd50d325eecf84a47316145598 100644 (file)
@@ -289,7 +289,8 @@ static int create_handle_cache(struct zs_pool *pool)
 
 static void destroy_handle_cache(struct zs_pool *pool)
 {
-       kmem_cache_destroy(pool->handle_cachep);
+       if (pool->handle_cachep)
+               kmem_cache_destroy(pool->handle_cachep);
 }
 
 static unsigned long alloc_handle(struct zs_pool *pool)
index e0670d7054f97c05d46b74952ee53d6fa6910776..659fb96672e41e2e6525323697ca23a41d271fbb 100644 (file)
@@ -796,9 +796,11 @@ static int __br_fdb_add(struct ndmsg *ndm, struct net_bridge_port *p,
        int err = 0;
 
        if (ndm->ndm_flags & NTF_USE) {
+               local_bh_disable();
                rcu_read_lock();
                br_fdb_update(p->br, p, addr, vid, true);
                rcu_read_unlock();
+               local_bh_enable();
        } else {
                spin_lock_bh(&p->br->hash_lock);
                err = fdb_add_entry(p, addr, ndm->ndm_state,
index 22fd0419b31455965223566f4676b46efedd8722..ff667e18b2d6313f0a806752a4ef88435e939c4d 100644 (file)
@@ -1167,6 +1167,9 @@ static void br_multicast_add_router(struct net_bridge *br,
        struct net_bridge_port *p;
        struct hlist_node *slot = NULL;
 
+       if (!hlist_unhashed(&port->rlist))
+               return;
+
        hlist_for_each_entry(p, &br->router_list, rlist) {
                if ((unsigned long) port >= (unsigned long) p)
                        break;
@@ -1194,12 +1197,8 @@ static void br_multicast_mark_router(struct net_bridge *br,
        if (port->multicast_router != 1)
                return;
 
-       if (!hlist_unhashed(&port->rlist))
-               goto timer;
-
        br_multicast_add_router(br, port);
 
-timer:
        mod_timer(&port->multicast_router_timer,
                  now + br->multicast_querier_interval);
 }
index 2c1c67fad64d57f3d744c89843816b2d64f5b834..aa82f9ab6a36d164769bf7c9633fcdfd5971466f 100644 (file)
@@ -1718,15 +1718,8 @@ EXPORT_SYMBOL_GPL(is_skb_forwardable);
 
 int __dev_forward_skb(struct net_device *dev, struct sk_buff *skb)
 {
-       if (skb_shinfo(skb)->tx_flags & SKBTX_DEV_ZEROCOPY) {
-               if (skb_copy_ubufs(skb, GFP_ATOMIC)) {
-                       atomic_long_inc(&dev->rx_dropped);
-                       kfree_skb(skb);
-                       return NET_RX_DROP;
-               }
-       }
-
-       if (unlikely(!is_skb_forwardable(dev, skb))) {
+       if (skb_orphan_frags(skb, GFP_ATOMIC) ||
+           unlikely(!is_skb_forwardable(dev, skb))) {
                atomic_long_inc(&dev->rx_dropped);
                kfree_skb(skb);
                return NET_RX_DROP;
index 3cfff2a3d651fb7d7cd2baaa3698c123eb7fc00f..41ec02242ea7c2ff57a6b506b685df22c62f3dcc 100644 (file)
@@ -4398,7 +4398,7 @@ struct sk_buff *alloc_skb_with_frags(unsigned long header_len,
 
                while (order) {
                        if (npages >= 1 << order) {
-                               page = alloc_pages(gfp_mask |
+                               page = alloc_pages((gfp_mask & ~__GFP_WAIT) |
                                                   __GFP_COMP |
                                                   __GFP_NOWARN |
                                                   __GFP_NORETRY,
index 292f42228bfb361b5748998bbcc538b1e16a2f22..dc30dc5bb1b892923397fee073d42e9e5ef53a7e 100644 (file)
@@ -354,15 +354,12 @@ void sk_clear_memalloc(struct sock *sk)
 
        /*
         * SOCK_MEMALLOC is allowed to ignore rmem limits to ensure forward
-        * progress of swapping. However, if SOCK_MEMALLOC is cleared while
-        * it has rmem allocations there is a risk that the user of the
-        * socket cannot make forward progress due to exceeding the rmem
-        * limits. By rights, sk_clear_memalloc() should only be called
-        * on sockets being torn down but warn and reset the accounting if
-        * that assumption breaks.
+        * progress of swapping. SOCK_MEMALLOC may be cleared while
+        * it has rmem allocations due to the last swapfile being deactivated
+        * but there is a risk that the socket is unusable due to exceeding
+        * the rmem limits. Reclaim the reserves and obey rmem limits again.
         */
-       if (WARN_ON(sk->sk_forward_alloc))
-               sk_mem_reclaim(sk);
+       sk_mem_reclaim(sk);
 }
 EXPORT_SYMBOL_GPL(sk_clear_memalloc);
 
@@ -1883,7 +1880,7 @@ bool skb_page_frag_refill(unsigned int sz, struct page_frag *pfrag, gfp_t gfp)
 
        pfrag->offset = 0;
        if (SKB_FRAG_PAGE_ORDER) {
-               pfrag->page = alloc_pages(gfp | __GFP_COMP |
+               pfrag->page = alloc_pages((gfp & ~__GFP_WAIT) | __GFP_COMP |
                                          __GFP_NOWARN | __GFP_NORETRY,
                                          SKB_FRAG_PAGE_ORDER);
                if (likely(pfrag->page)) {
index 1c92ea67baefefb801d334fe60144cbcc3af63f2..83aa604f9273c332c5a0e5399253d961ef92eb9a 100644 (file)
@@ -90,6 +90,7 @@
 #include <linux/socket.h>
 #include <linux/sockios.h>
 #include <linux/igmp.h>
+#include <linux/inetdevice.h>
 #include <linux/in.h>
 #include <linux/errno.h>
 #include <linux/timer.h>
@@ -1960,6 +1961,7 @@ void udp_v4_early_demux(struct sk_buff *skb)
        struct sock *sk;
        struct dst_entry *dst;
        int dif = skb->dev->ifindex;
+       int ours;
 
        /* validate the packet */
        if (!pskb_may_pull(skb, skb_transport_offset(skb) + sizeof(struct udphdr)))
@@ -1969,14 +1971,24 @@ void udp_v4_early_demux(struct sk_buff *skb)
        uh = udp_hdr(skb);
 
        if (skb->pkt_type == PACKET_BROADCAST ||
-           skb->pkt_type == PACKET_MULTICAST)
+           skb->pkt_type == PACKET_MULTICAST) {
+               struct in_device *in_dev = __in_dev_get_rcu(skb->dev);
+
+               if (!in_dev)
+                       return;
+
+               ours = ip_check_mc_rcu(in_dev, iph->daddr, iph->saddr,
+                                      iph->protocol);
+               if (!ours)
+                       return;
                sk = __udp4_lib_mcast_demux_lookup(net, uh->dest, iph->daddr,
                                                   uh->source, iph->saddr, dif);
-       else if (skb->pkt_type == PACKET_HOST)
+       } else if (skb->pkt_type == PACKET_HOST) {
                sk = __udp4_lib_demux_lookup(net, uh->dest, iph->daddr,
                                             uh->source, iph->saddr, dif);
-       else
+       } else {
                return;
+       }
 
        if (!sk)
                return;
index d873ceea86e6c74c34e7fcd31bec41c78ce5720b..ca09bf49ac6806b399dba51399f84e47590cb9ed 100644 (file)
@@ -133,6 +133,14 @@ static void snmp6_free_dev(struct inet6_dev *idev)
        free_percpu(idev->stats.ipv6);
 }
 
+static void in6_dev_finish_destroy_rcu(struct rcu_head *head)
+{
+       struct inet6_dev *idev = container_of(head, struct inet6_dev, rcu);
+
+       snmp6_free_dev(idev);
+       kfree(idev);
+}
+
 /* Nobody refers to this device, we may destroy it. */
 
 void in6_dev_finish_destroy(struct inet6_dev *idev)
@@ -151,7 +159,6 @@ void in6_dev_finish_destroy(struct inet6_dev *idev)
                pr_warn("Freeing alive inet6 device %p\n", idev);
                return;
        }
-       snmp6_free_dev(idev);
-       kfree_rcu(idev, rcu);
+       call_rcu(&idev->rcu, in6_dev_finish_destroy_rcu);
 }
 EXPORT_SYMBOL(in6_dev_finish_destroy);
index 7b3f732269e43bb33dc1a6584eaa91b74eab9b64..1f93a5978f2ad43fc81a16427e34d07ca2c0f34e 100644 (file)
@@ -541,7 +541,7 @@ static void mpls_ifdown(struct net_device *dev)
 
        RCU_INIT_POINTER(dev->mpls_ptr, NULL);
 
-       kfree(mdev);
+       kfree_rcu(mdev, rcu);
 }
 
 static int mpls_dev_notify(struct notifier_block *this, unsigned long event,
@@ -564,6 +564,17 @@ static int mpls_dev_notify(struct notifier_block *this, unsigned long event,
        case NETDEV_UNREGISTER:
                mpls_ifdown(dev);
                break;
+       case NETDEV_CHANGENAME:
+               mdev = mpls_dev_get(dev);
+               if (mdev) {
+                       int err;
+
+                       mpls_dev_sysctl_unregister(mdev);
+                       err = mpls_dev_sysctl_register(dev, mdev);
+                       if (err)
+                               return notifier_from_errno(err);
+               }
+               break;
        }
        return NOTIFY_OK;
 }
index b064c345042c17ccd9ec841535857fb29041a8a3..8cabeb5a1cb928c856c037c5994116df8547fb71 100644 (file)
@@ -16,6 +16,7 @@ struct mpls_dev {
        int                     input_enabled;
 
        struct ctl_table_header *sysctl;
+       struct rcu_head         rcu;
 };
 
 struct sk_buff;
index 4776282c64175209924740fbd87a56de8e05b609..33e6d6e2908f553516c5ca97c4b93abee7b7057b 100644 (file)
@@ -125,6 +125,7 @@ static struct vport *netdev_create(const struct vport_parms *parms)
        if (err)
                goto error_master_upper_dev_unlink;
 
+       dev_disable_lro(netdev_vport->dev);
        dev_set_promiscuity(netdev_vport->dev, 1);
        netdev_vport->dev->priv_flags |= IFF_OVS_DATAPATH;
        rtnl_unlock();
index fb7976aee61c84f38aecdc5c5f0d8be20e577fa9..4f15b7d730e13d6aaa58ba7a28262c9831afea95 100644 (file)
@@ -381,13 +381,14 @@ nomem:
 }
 
 
-/* Public interface to creat the association shared key.
+/* Public interface to create the association shared key.
  * See code above for the algorithm.
  */
 int sctp_auth_asoc_init_active_key(struct sctp_association *asoc, gfp_t gfp)
 {
        struct sctp_auth_bytes  *secret;
        struct sctp_shared_key *ep_key;
+       struct sctp_chunk *chunk;
 
        /* If we don't support AUTH, or peer is not capable
         * we don't need to do anything.
@@ -410,6 +411,14 @@ int sctp_auth_asoc_init_active_key(struct sctp_association *asoc, gfp_t gfp)
        sctp_auth_key_put(asoc->asoc_shared_key);
        asoc->asoc_shared_key = secret;
 
+       /* Update send queue in case any chunk already in there now
+        * needs authenticating
+        */
+       list_for_each_entry(chunk, &asoc->outqueue.out_chunk_list, list) {
+               if (sctp_auth_send_cid(chunk->chunk_hdr->type, asoc))
+                       chunk->auth = 1;
+       }
+
        return 0;
 }
 
index 9074b5cede38b8edd75890b684a706d96b9f71ba..f485600c4507bc152cef654ae5667a03a52d990c 100644 (file)
@@ -2142,11 +2142,17 @@ static void tipc_sk_timeout(unsigned long data)
        peer_node = tsk_peer_node(tsk);
 
        if (tsk->probing_state == TIPC_CONN_PROBING) {
-               /* Previous probe not answered -> self abort */
-               skb = tipc_msg_create(TIPC_CRITICAL_IMPORTANCE,
-                                     TIPC_CONN_MSG, SHORT_H_SIZE, 0,
-                                     own_node, peer_node, tsk->portid,
-                                     peer_port, TIPC_ERR_NO_PORT);
+               if (!sock_owned_by_user(sk)) {
+                       sk->sk_socket->state = SS_DISCONNECTING;
+                       tsk->connected = 0;
+                       tipc_node_remove_conn(sock_net(sk), tsk_peer_node(tsk),
+                                             tsk_peer_port(tsk));
+                       sk->sk_state_change(sk);
+               } else {
+                       /* Try again later */
+                       sk_reset_timer(sk, &sk->sk_timer, (HZ / 20));
+               }
+
        } else {
                skb = tipc_msg_create(CONN_MANAGER, CONN_PROBE,
                                      INT_H_SIZE, 0, peer_node, own_node,
index fff1bef6ed6d916f9019a63d708652f4ab07cddf..fd682832a0e3635d52c734871d5402d270336dc3 100644 (file)
@@ -1333,6 +1333,8 @@ static struct iw_statistics *cfg80211_wireless_stats(struct net_device *dev)
        memcpy(bssid, wdev->current_bss->pub.bssid, ETH_ALEN);
        wdev_unlock(wdev);
 
+       memset(&sinfo, 0, sizeof(sinfo));
+
        if (rdev_get_station(rdev, dev, bssid, &sinfo))
                return NULL;
 
index 89b1df4e72ab3423bce45011fb03f86c193f5ad4..c5ec977b9c3786097b214e1c835efd8fa337c173 100755 (executable)
@@ -3169,12 +3169,12 @@ sub process {
                }
 
 # check for global initialisers.
-               if ($line =~ /^\+(\s*$Type\s*$Ident\s*(?:\s+$Modifier))*\s*=\s*(0|NULL|false)\s*;/) {
+               if ($line =~ /^\+$Type\s*$Ident(?:\s+$Modifier)*\s*=\s*(?:0|NULL|false)\s*;/) {
                        if (ERROR("GLOBAL_INITIALISERS",
                                  "do not initialise globals to 0 or NULL\n" .
                                      $herecurr) &&
                            $fix) {
-                               $fixed[$fixlinenr] =~ s/($Type\s*$Ident\s*(?:\s+$Modifier))*\s*=\s*(0|NULL|false)\s*;/$1;/;
+                               $fixed[$fixlinenr] =~ s/(^.$Type\s*$Ident(?:\s+$Modifier)*)\s*=\s*(0|NULL|false)\s*;/$1;/;
                        }
                }
 # check for static initialisers.
index 7371e0c3926f32a9104b521d0bf70f1c35f0740f..1eabcdf69457311129b766ec237d37e402f640bc 100644 (file)
@@ -246,6 +246,9 @@ static int hda_reg_read(void *context, unsigned int reg, unsigned int *val)
                return hda_reg_read_stereo_amp(codec, reg, val);
        if (verb == AC_VERB_GET_PROC_COEF)
                return hda_reg_read_coef(codec, reg, val);
+       if ((verb & 0x700) == AC_VERB_SET_AMP_GAIN_MUTE)
+               reg &= ~AC_AMP_FAKE_MUTE;
+
        err = snd_hdac_exec_verb(codec, reg, 0, val);
        if (err < 0)
                return err;
@@ -265,6 +268,9 @@ static int hda_reg_write(void *context, unsigned int reg, unsigned int val)
        unsigned int verb;
        int i, bytes, err;
 
+       if (codec->caps_overwriting)
+               return 0;
+
        reg &= ~0x00080000U; /* drop GET bit */
        reg |= (codec->addr << 28);
        verb = get_verb(reg);
@@ -280,6 +286,8 @@ static int hda_reg_write(void *context, unsigned int reg, unsigned int val)
 
        switch (verb & 0xf00) {
        case AC_VERB_SET_AMP_GAIN_MUTE:
+               if ((reg & AC_AMP_FAKE_MUTE) && (val & AC_AMP_MUTE))
+                       val = 0;
                verb = AC_VERB_SET_AMP_GAIN_MUTE;
                if (reg & AC_AMP_GET_LEFT)
                        verb |= AC_AMP_SET_LEFT >> 8;
index d2f615ab177a7ca021d9f802d61ba2b57b10a7ca..2153d31fb66312025cb6221afd8476d313261785 100644 (file)
@@ -12,12 +12,14 @@ if SND_MIPS
 config SND_SGI_O2
        tristate "SGI O2 Audio"
        depends on SGI_IP32
+       select SND_PCM
         help
                 Sound support for the SGI O2 Workstation. 
 
 config SND_SGI_HAL2
         tristate "SGI HAL2 Audio"
         depends on SGI_HAS_HAL2
+       select SND_PCM
         help
                 Sound support for the SGI Indy and Indigo2 Workstation.
 
index b49feff0a31982e7c22071c08e8d088e91a97727..5645481af3d9571b8340c963a27c34e377c405c5 100644 (file)
@@ -436,7 +436,7 @@ static unsigned int get_num_devices(struct hda_codec *codec, hda_nid_t nid)
            get_wcaps_type(wcaps) != AC_WID_PIN)
                return 0;
 
-       parm = snd_hda_param_read(codec, nid, AC_PAR_DEVLIST_LEN);
+       parm = snd_hdac_read_parm_uncached(&codec->core, nid, AC_PAR_DEVLIST_LEN);
        if (parm == -1 && codec->bus->rirb_error)
                parm = 0;
        return parm & AC_DEV_LIST_LEN_MASK;
@@ -1375,6 +1375,31 @@ int snd_hda_override_amp_caps(struct hda_codec *codec, hda_nid_t nid, int dir,
 }
 EXPORT_SYMBOL_GPL(snd_hda_override_amp_caps);
 
+/**
+ * snd_hda_codec_amp_update - update the AMP mono value
+ * @codec: HD-audio codec
+ * @nid: NID to read the AMP value
+ * @ch: channel to update (0 or 1)
+ * @dir: #HDA_INPUT or #HDA_OUTPUT
+ * @idx: the index value (only for input direction)
+ * @mask: bit mask to set
+ * @val: the bits value to set
+ *
+ * Update the AMP values for the given channel, direction and index.
+ */
+int snd_hda_codec_amp_update(struct hda_codec *codec, hda_nid_t nid,
+                            int ch, int dir, int idx, int mask, int val)
+{
+       unsigned int cmd = snd_hdac_regmap_encode_amp(nid, ch, dir, idx);
+
+       /* enable fake mute if no h/w mute but min=mute */
+       if ((query_amp_caps(codec, nid, dir) &
+            (AC_AMPCAP_MUTE | AC_AMPCAP_MIN_MUTE)) == AC_AMPCAP_MIN_MUTE)
+               cmd |= AC_AMP_FAKE_MUTE;
+       return snd_hdac_regmap_update_raw(&codec->core, cmd, mask, val);
+}
+EXPORT_SYMBOL_GPL(snd_hda_codec_amp_update);
+
 /**
  * snd_hda_codec_amp_stereo - update the AMP stereo values
  * @codec: HD-audio codec
index fea198c58196a41caf4b093da8d6b37355e78a32..b6db25b23dd316d0205d6a14fed365f5ae8cde4f 100644 (file)
@@ -340,6 +340,11 @@ enum {
 #define use_vga_switcheroo(chip)       0
 #endif
 
+#define CONTROLLER_IN_GPU(pci) (((pci)->device == 0x0a0c) || \
+                                       ((pci)->device == 0x0c0c) || \
+                                       ((pci)->device == 0x0d0c) || \
+                                       ((pci)->device == 0x160c))
+
 static char *driver_short_names[] = {
        [AZX_DRIVER_ICH] = "HDA Intel",
        [AZX_DRIVER_PCH] = "HDA Intel PCH",
@@ -1854,8 +1859,17 @@ static int azx_probe_continue(struct azx *chip)
        if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL) {
 #ifdef CONFIG_SND_HDA_I915
                err = hda_i915_init(hda);
-               if (err < 0)
-                       goto out_free;
+               if (err < 0) {
+                       /* if the controller is bound only with HDMI/DP
+                        * (for HSW and BDW), we need to abort the probe;
+                        * for other chips, still continue probing as other
+                        * codecs can be on the same link.
+                        */
+                       if (CONTROLLER_IN_GPU(pci))
+                               goto out_free;
+                       else
+                               goto skip_i915;
+               }
                err = hda_display_power(hda, true);
                if (err < 0) {
                        dev_err(chip->card->dev,
@@ -1865,6 +1879,9 @@ static int azx_probe_continue(struct azx *chip)
 #endif
        }
 
+#ifdef CONFIG_SND_HDA_I915
+ skip_i915:
+#endif
        err = azx_first_init(chip);
        if (err < 0)
                goto out_free;
index 3b567f42296b9d6b2ca148c66c59c12b5628cb9e..bed66c3144318de3f82dcddeb2445a84ad9ce594 100644 (file)
@@ -129,8 +129,8 @@ int snd_hda_mixer_amp_switch_put_beep(struct snd_kcontrol *kcontrol,
 /* lowlevel accessor with caching; use carefully */
 #define snd_hda_codec_amp_read(codec, nid, ch, dir, idx) \
        snd_hdac_regmap_get_amp(&(codec)->core, nid, ch, dir, idx)
-#define snd_hda_codec_amp_update(codec, nid, ch, dir, idx, mask, val) \
-       snd_hdac_regmap_update_amp(&(codec)->core, nid, ch, dir, idx, mask, val)
+int snd_hda_codec_amp_update(struct hda_codec *codec, hda_nid_t nid,
+                            int ch, int dir, int idx, int mask, int val);
 int snd_hda_codec_amp_stereo(struct hda_codec *codec, hda_nid_t nid,
                             int dir, int idx, int mask, int val);
 int snd_hda_codec_amp_init(struct hda_codec *codec, hda_nid_t nid, int ch,
index 0320cb523d9e68112d34f28b8f621c6c10cc6cc3..6d010452c1f5c5d131c0ac0a4ae3b2c539e56ad9 100644 (file)
@@ -4515,6 +4515,8 @@ enum {
        ALC288_FIXUP_DELL_HEADSET_MODE,
        ALC288_FIXUP_DELL1_MIC_NO_PRESENCE,
        ALC288_FIXUP_DELL_XPS_13_GPIO6,
+       ALC292_FIXUP_DELL_E7X,
+       ALC292_FIXUP_DISABLE_AAMIX,
 };
 
 static const struct hda_fixup alc269_fixups[] = {
@@ -5037,6 +5039,16 @@ static const struct hda_fixup alc269_fixups[] = {
                .chained = true,
                .chain_id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE
        },
+       [ALC292_FIXUP_DISABLE_AAMIX] = {
+               .type = HDA_FIXUP_FUNC,
+               .v.func = alc_fixup_disable_aamix,
+       },
+       [ALC292_FIXUP_DELL_E7X] = {
+               .type = HDA_FIXUP_FUNC,
+               .v.func = alc_fixup_dell_xps13,
+               .chained = true,
+               .chain_id = ALC292_FIXUP_DISABLE_AAMIX
+       },
 };
 
 static const struct snd_pci_quirk alc269_fixup_tbl[] = {
@@ -5049,6 +5061,8 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
        SND_PCI_QUIRK(0x1025, 0x0775, "Acer Aspire E1-572", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572),
        SND_PCI_QUIRK(0x1025, 0x079b, "Acer Aspire V5-573G", ALC282_FIXUP_ASPIRE_V5_PINS),
        SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z),
+       SND_PCI_QUIRK(0x1028, 0x05ca, "Dell Latitude E7240", ALC292_FIXUP_DELL_E7X),
+       SND_PCI_QUIRK(0x1028, 0x05cb, "Dell Latitude E7440", ALC292_FIXUP_DELL_E7X),
        SND_PCI_QUIRK(0x1028, 0x05da, "Dell Vostro 5460", ALC290_FIXUP_SUBWOOFER),
        SND_PCI_QUIRK(0x1028, 0x05f4, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
        SND_PCI_QUIRK(0x1028, 0x05f5, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
@@ -5058,6 +5072,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
        SND_PCI_QUIRK(0x1028, 0x0638, "Dell Inspiron 5439", ALC290_FIXUP_MONO_SPEAKERS_HSJACK),
        SND_PCI_QUIRK(0x1028, 0x064a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
        SND_PCI_QUIRK(0x1028, 0x064b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
+       SND_PCI_QUIRK(0x1028, 0x0665, "Dell XPS 13", ALC292_FIXUP_DELL_E7X),
        SND_PCI_QUIRK(0x1028, 0x06c7, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
        SND_PCI_QUIRK(0x1028, 0x06d9, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
        SND_PCI_QUIRK(0x1028, 0x06da, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
@@ -5637,8 +5652,7 @@ static int patch_alc269(struct hda_codec *codec)
 
        spec = codec->spec;
        spec->gen.shared_mic_vref_pin = 0x18;
-       if (codec->core.vendor_id != 0x10ec0292)
-               codec->power_save_node = 1;
+       codec->power_save_node = 1;
 
        snd_hda_pick_fixup(codec, alc269_fixup_models,
                       alc269_fixup_tbl, alc269_fixups);
index 6833c74ed6ff47f60598d6d250b8709d914590a5..6c66d7e164391b7e824e2c72b5fa2e5ae889f16d 100644 (file)
@@ -100,6 +100,7 @@ enum {
        STAC_HP_ENVY_BASS,
        STAC_HP_BNB13_EQ,
        STAC_HP_ENVY_TS_BASS,
+       STAC_HP_ENVY_TS_DAC_BIND,
        STAC_92HD83XXX_GPIO10_EAPD,
        STAC_92HD83XXX_MODELS
 };
@@ -2171,6 +2172,22 @@ static void stac92hd83xxx_fixup_gpio10_eapd(struct hda_codec *codec,
        spec->eapd_switch = 0;
 }
 
+static void hp_envy_ts_fixup_dac_bind(struct hda_codec *codec,
+                                           const struct hda_fixup *fix,
+                                           int action)
+{
+       struct sigmatel_spec *spec = codec->spec;
+       static hda_nid_t preferred_pairs[] = {
+               0xd, 0x13,
+               0
+       };
+
+       if (action != HDA_FIXUP_ACT_PRE_PROBE)
+               return;
+
+       spec->gen.preferred_dacs = preferred_pairs;
+}
+
 static const struct hda_verb hp_bnb13_eq_verbs[] = {
        /* 44.1KHz base */
        { 0x22, 0x7A6, 0x3E },
@@ -2686,6 +2703,12 @@ static const struct hda_fixup stac92hd83xxx_fixups[] = {
                        {}
                },
        },
+       [STAC_HP_ENVY_TS_DAC_BIND] = {
+               .type = HDA_FIXUP_FUNC,
+               .v.func = hp_envy_ts_fixup_dac_bind,
+               .chained = true,
+               .chain_id = STAC_HP_ENVY_TS_BASS,
+       },
        [STAC_92HD83XXX_GPIO10_EAPD] = {
                .type = HDA_FIXUP_FUNC,
                .v.func = stac92hd83xxx_fixup_gpio10_eapd,
@@ -2764,6 +2787,8 @@ static const struct snd_pci_quirk stac92hd83xxx_fixup_tbl[] = {
                          "HP bNB13", STAC_HP_BNB13_EQ),
        SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x190e,
                          "HP ENVY TS", STAC_HP_ENVY_TS_BASS),
+       SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x1967,
+                         "HP ENVY TS", STAC_HP_ENVY_TS_DAC_BIND),
        SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x1940,
                          "HP bNB13", STAC_HP_BNB13_EQ),
        SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x1941,
index b8c97d092a47086a802b119e33596f5b1ef3d0eb..754e689596a21b43f3b3a45b8f3062ec29b74099 100644 (file)
@@ -1267,8 +1267,9 @@ u64 snd_usb_interface_dsd_format_quirks(struct snd_usb_audio *chip,
                if (fp->altsetting == 2)
                        return SNDRV_PCM_FMTBIT_DSD_U32_BE;
                break;
-       /* DIYINHK DSD DXD 384kHz USB to I2S/DSD */
-       case USB_ID(0x20b1, 0x2009):
+
+       case USB_ID(0x20b1, 0x2009): /* DIYINHK DSD DXD 384kHz USB to I2S/DSD */
+       case USB_ID(0x20b1, 0x2023): /* JLsounds I2SoverUSB */
                if (fp->altsetting == 3)
                        return SNDRV_PCM_FMTBIT_DSD_U32_BE;
                break;